Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewarmtemp committed Jul 3, 2024
1 parent 2c4ca36 commit 3e2d32c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tests/e2e/bootc-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,23 @@ sed "s|REPLACE_COPR_PROJECT|${PACKIT_COPR_PROJECT}|; s|REPLACE_TEST_OS|${REPLACE

# Configure continerfile
greenprint "Create $TEST_OS installation Containerfile"
tee "$INSTALL_CONTAINERFILE" > /dev/null << EOF
tee "$INSTALL_CONTAINERFILE" > /dev/null << REALEOF
FROM "$TIER1_IMAGE_URL"
COPY bootc.repo /etc/yum.repos.d/
COPY domain.crt /etc/pki/ca-trust/source/anchors/
RUN dnf -y update bootc && \
update-ca-trust
RUN cat <<EOF >> /usr/lib/bootc/install/00-mitigations.toml
[install.filesystem.root]
type = "xfs"
[install]
kargs = ["mitigations=on", "nosmt"]
EOF
RUN mkdir -p /usr/lib/bootc/kargs.d
RUN cat <<EOF >> /usr/lib/bootc/kargs.d/01-console.toml
kargs = ["systemd.unified_cgroup_hierarchy=0","console=ttyS0","panic=0"]
EOF
REALEOF

case "$TEST_CASE" in
"to-existing-root")
Expand Down Expand Up @@ -244,6 +254,7 @@ ansible-playbook -v \
-e test_os="$TEST_OS" \
-e bootc_image="$TEST_IMAGE_URL" \
-e image_label_version_id="$REDHAT_VERSION_ID" \
-e kargs="mitigations=on,nosmt,systemd.unified_cgroup_hierarchy=0,console=ttyS0,panic=0" \
playbooks/check-system.yaml

# Prepare upgrade containerfile
Expand All @@ -252,6 +263,9 @@ tee "$UPGRADE_CONTAINERFILE" > /dev/null << EOF
FROM "$TEST_IMAGE_URL"
RUN dnf -y install wget && \
dnf -y clean all
RUN rm /usr/lib/bootc/kargs.d/01-console.toml
RUN cat <<EOF >> /usr/lib/bootc/kargs.d/01-console.toml
kargs = ["systemd.unified_cgroup_hierarchy=1","console=ttyS","panic=0"]
EOF

# Build upgrade container image and push to locay registry
Expand Down Expand Up @@ -284,6 +298,7 @@ ansible-playbook -v \
-e bootc_image="$BOOTC_IMAGE" \
-e image_label_version_id="$REDHAT_VERSION_ID" \
-e upgrade="true" \
-e kargs="systemd.unified_cgroup_hierarchy=1,console=ttyS,panic=0" \
playbooks/check-system.yaml

# bootc rollback test
Expand Down
27 changes: 27 additions & 0 deletions tests/e2e/playbooks/check-system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
vars:
bootc_image: ""
upgrade: ""
kargs: ""
total_counter: "0"
failed_counter: "0"

Expand Down Expand Up @@ -355,6 +356,32 @@
register: result_selinux_denied
become: true
ignore_errors: true

# case: check karg
- name: grep for kargs
shell: cat /proc/cmdline | grep {{item}}
with_items: "{{ kargs.split(',') }}"
register: kargs_check
# grep will exit with 1 when no results found.
# This causes the task not to halt play.
ignore_errors: true
when: kargs != ''

- 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: kargs != ''

# case: check running container with podman in root
- name: run CentOS Stream 9 image with podman in root
Expand Down

0 comments on commit 3e2d32c

Please sign in to comment.