Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: implement kargs e2e test #594

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

lukewarmtemp
Copy link
Contributor

@lukewarmtemp lukewarmtemp commented Jun 10, 2024

Integration test for the changes in: #401

@lukewarmtemp
Copy link
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
Contributor

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

@cgwalters
Copy link
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 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 <[email protected]>
@cgwalters cgwalters merged commit 1fb8a15 into containers:main Jul 18, 2024
24 of 27 checks passed
cgwalters pushed a commit to cgwalters/bootc that referenced this pull request Nov 5, 2024
…1.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