Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewarmtemp committed Jun 26, 2024
1 parent e075d09 commit 9bc8449
Showing 1 changed file with 40 additions and 11 deletions.
51 changes: 40 additions & 11 deletions tests/integration/image-install-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ RUN cat <<EOF >> /usr/lib/bootc/install/00-mitigations.toml
[install.filesystem.root]
type = "xfs"
[install]
kargs = ["mitigations=off"]
kargs = ["mitigations=on", "nosmt"]
EOF
REALEOF

Expand Down Expand Up @@ -201,17 +201,49 @@ 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=off" \
-e kargs="mitigations=on,nosmt" \
playbooks/check-system.yaml

greenprint "Create upgrade Containerfile"
tee "$UPGRADE_CONTAINERFILE" > /dev/null << REALEOF
FROM "$TEST_IMAGE_URL"
RUN dnf -y install wget && \
dnf -y clean all
REALEOF

greenprint "Build $TEST_OS upgrade container image"
sudo podman build --tls-verify=false --retry=5 --retry-delay=10 -t "${TEST_IMAGE_NAME}:${QUAY_REPO_TAG}" -f "$UPGRADE_CONTAINERFILE" .
greenprint "Push $TEST_OS upgrade container image"
sudo podman push --tls-verify=false --quiet "${TEST_IMAGE_NAME}:${QUAY_REPO_TAG}" "$TEST_IMAGE_URL"

greenprint "Upgrade $TEST_OS system"
ansible-playbook -v \
-i "$INVENTORY_FILE" \
playbooks/upgrade.yaml

greenprint "Run ostree checking test after upgrade on $PLATFORM instance"
ansible-playbook -v \
-i "$INVENTORY_FILE" \
-e test_os="$TEST_OS" \
-e bootc_image="$TEST_IMAGE_URL" \
-e image_label_version_id="$REDHAT_VERSION_ID" \
-e upgrade="true" \
-e kargs="systemd.unified_cgroup_hierarchy=0" \
playbooks/check-system.yaml

greenprint "Rollback $TEST_OS system"
ansible-playbook -v \
-i "$INVENTORY_FILE" \
playbooks/rollback.yaml

greenprint "Create upgrade Containerfile with kargs"
tee "$UPGRADE_CONTAINERFILE" > /dev/null << REALEOF
FROM "$TEST_IMAGE_URL"
RUN dnf -y install wget && \
dnf -y clean all
RUN mkdir -p /usr/lib/bootc/kargs.d
RUN cat <<EOF >> /usr/lib/bootc/kargs.d/01-console.toml
kargs = ["systemd.unified_cgroup_hierarchy=1"]
kargs = ["systemd.unified_cgroup_hierarchy=0","console=ttyS0"]
EOF
REALEOF

Expand All @@ -232,15 +264,17 @@ ansible-playbook -v \
-e bootc_image="$TEST_IMAGE_URL" \
-e image_label_version_id="$REDHAT_VERSION_ID" \
-e upgrade="true" \
-e kargs="systemd.unified_cgroup_hierarchy=1" \
-e kargs="systemd.unified_cgroup_hierarchy=0,console=ttyS0" \
playbooks/check-system.yaml

greenprint "Create second upgrade Containerfile to test kargs delta"
tee "$UPGRADE_CONTAINERFILE" > /dev/null << REALEOF
FROM "$TEST_IMAGE_URL"
RUN dnf -y install wget && \
dnf -y clean all
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"]
kargs = ["systemd.unified_cgroup_hierarchy=1","console=ttyS"]
EOF
REALEOF

Expand All @@ -261,14 +295,9 @@ ansible-playbook -v \
-e bootc_image="$TEST_IMAGE_URL" \
-e image_label_version_id="$REDHAT_VERSION_ID" \
-e upgrade="true" \
-e kargs="systemd.unified_cgroup_hierarchy=0" \
-e kargs="systemd.unified_cgroup_hierarchy=1,console=ttyS" \
playbooks/check-system.yaml

greenprint "Rollback $TEST_OS system"
ansible-playbook -v \
-i "$INVENTORY_FILE" \
playbooks/rollback.yaml

greenprint "Terminate $PLATFORM instance and deregister AMI"
ansible-playbook -v \
-i "$INVENTORY_FILE" \
Expand Down

0 comments on commit 9bc8449

Please sign in to comment.