Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewarmtemp committed Jul 2, 2024
1 parent fdb11ff commit 60f782d
Showing 1 changed file with 10 additions and 49 deletions.
59 changes: 10 additions & 49 deletions tests/integration/image-install-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ 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

greenprint "Check $TEST_OS installation Containerfile"
Expand Down Expand Up @@ -202,48 +206,17 @@ 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" \
-e kargs="mitigations=on,nosmt,systemd.unified_cgroup_hierarchy=0,console=ttyS0,panic=0" \
playbooks/check-system.yaml

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

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" \
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=0","console=ttyS0","panic=0"]
kargs = ["systemd.unified_cgroup_hierarchy=1","console=ttyS","panic=0"]
EOF
REALEOF

Expand All @@ -264,24 +237,12 @@ 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,console=ttyS0,panic=0" \
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=1","console=ttyS","panic=0"]
EOF
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 "Rollback $TEST_OS system"
ansible-playbook -v \
-i "$INVENTORY_FILE" \
playbooks/rollback.yaml

greenprint "Upgrade $TEST_OS system"
ansible-playbook -v \
Expand Down

0 comments on commit 60f782d

Please sign in to comment.