Skip to content

Test: implement kargs e2e test#594

Merged
cgwalters merged 1 commit intobootc-dev:mainfrom
lukewarmtemp:kargs-integration-test
Jul 18, 2024
Merged

Test: implement kargs e2e test#594
cgwalters merged 1 commit intobootc-dev:mainfrom
lukewarmtemp:kargs-integration-test

Conversation

@lukewarmtemp
Copy link
Copy Markdown
Contributor

@lukewarmtemp lukewarmtemp commented Jun 10, 2024

Integration test for the changes in: #401

@lukewarmtemp
Copy link
Copy Markdown
Contributor Author

@cgwalters @henrywang Sorry, do you guys think you'd be able to help me figure out how to stop the integration tests from skipping?

@henrywang
Copy link
Copy Markdown
Collaborator

Hi! I think we can reuse image-install-upgrade.sh and check-system.yaml.

diff --git i/tests/integration/image-install-upgrade.sh w/tests/integration/image-install-upgrade.sh
index 2468802..bc668bc 100755
--- i/tests/integration/image-install-upgrade.sh
+++ w/tests/integration/image-install-upgrade.sh
@@ -154,7 +154,7 @@ case "$IMAGE_TYPE" in
             -v /dev:/dev \
             -v .:/output \
             "$TEST_IMAGE_URL" \
-            bootc install to-disk --filesystem "$ROOTFS" --generic-image --via-loopback /output/disk.raw
+            bootc install to-disk --filesystem "$ROOTFS" --generic-image --via-loopback --karg=nosmt /output/disk.raw
 
         sudo qemu-img convert -f raw ./disk.raw -O qcow2 "/var/lib/libvirt/images/disk.qcow2"
         rm -f disk.raw
@@ -194,6 +194,7 @@ ansible-playbook -v \
     -e test_os="$TEST_OS" \
     -e bootc_image="$TEST_IMAGE_URL" \
     -e image_label_version_id="$REDHAT_VERSION_ID" \
+    -e karg="nosmt" \
     playbooks/check-system.yaml
 
 greenprint "Create upgrade Containerfile"
diff --git i/tests/integration/playbooks/check-system.yaml w/tests/integration/playbooks/check-system.yaml
index ede5a3a..6a9bae1 100644
--- i/tests/integration/playbooks/check-system.yaml
+++ w/tests/integration/playbooks/check-system.yaml
@@ -4,6 +4,7 @@
   vars:
     bootc_image: ""
     upgrade: ""
+    karg: ""
     total_counter: "0"
     failed_counter: "0"
 
@@ -452,6 +453,31 @@
       when: ansible_facts['distribution_version'] != "41"
       # workaround for issue https://gitlab.com/fedora/bootc/base-images/-/issues/10
 
+    # case: check karg
+    - name: grep for kargs
+      shell: cat /proc/cmdline | grep {{ karg }}
+      register: kargs_check
+      # grep will exit with 1 when no results found.
+      # This causes the task not to halt play.
+      ignore_errors: true
+      when: karg != ''
+
+    - name: check if kargs exist
+      block:
+        - assert:
+            that:
+              - kargs_check is succeeded
+            fail_msg: install kargs not found
+            success_msg: install kargs found
+      always:
+        - set_fact:
+            total_counter: "{{ total_counter | int + 1 }}"
+      rescue:
+        - name: failed count + 1
+          set_fact:
+            failed_counter: "{{ failed_counter | int + 1 }}"
+      when: karg != ''
+
     # case: check reboot times
     - name: check reboot times
       command: last reboot

Comment thread .github/workflows/integration.yml Outdated
@lukewarmtemp lukewarmtemp force-pushed the kargs-integration-test branch from 4428baf to 52063f7 Compare June 12, 2024 14:45
@lukewarmtemp lukewarmtemp force-pushed the kargs-integration-test branch from 5e1ffa4 to a23f730 Compare June 19, 2024 18:07
@cgwalters
Copy link
Copy Markdown
Collaborator

I forgot to mention here that I added kargs tests in b777459 (that said, it makes sense to have some in the e2e tests too)

@lukewarmtemp lukewarmtemp force-pushed the kargs-integration-test branch 4 times, most recently from 1210f17 to 3e2d32c Compare July 3, 2024 17:26
@lukewarmtemp lukewarmtemp force-pushed the kargs-integration-test branch from 41da374 to f4c37b9 Compare July 8, 2024 14:04
@lukewarmtemp lukewarmtemp marked this pull request as ready for review July 8, 2024 14:05
@lukewarmtemp lukewarmtemp changed the title Kargs integration test Test: implement kargs e2e test Jul 8, 2024
Update check-system.yaml to check the kargs in the installed system.
Update the install Containerfile with install kargs in
`/usr/lib/bootc/install` and day 2 kargs in `/usr/lib/bootc/kargs.d`,
checking to see that the kargs are applied in the installed system.
Update the upgrade Containerfile with different day 2 kargs, checking
to see if the delta is applied properly.

Signed-off-by: Luke Yang <luyang@redhat.com>
@lukewarmtemp lukewarmtemp force-pushed the kargs-integration-test branch from f4c37b9 to b66a34f Compare July 8, 2024 15:09
@cgwalters cgwalters enabled auto-merge July 18, 2024 19:06
@cgwalters cgwalters merged commit 1fb8a15 into bootc-dev:main Jul 18, 2024
cgwalters pushed a commit to cgwalters/bootc that referenced this pull request Nov 5, 2024
….0.195

build(deps): bump serde from 1.0.193 to 1.0.195
cgwalters added a commit to cgwalters/bootc that referenced this pull request Nov 6, 2024
deploy: Don't enforce container sigpolicy by default, add `--enforce-container-sigpolicy`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants