-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
- Do client-side layering tests on old build, then upgrade rpm-ostree to new version, then upgrade to another new update. - Start old build, upgrade rpm-ostree to new version, do client-side layering tests, then upgrade to another new update.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#!/bin/bash | ||
## kola: | ||
## # This test reboots a lot, generates container images, etc. | ||
## timeoutMin: 40 | ||
## minMemory: 2048 | ||
## tags: needs-internet | ||
## description: Do client-side layering tests on old build, then upgrade | ||
## rpm-ostree to new version, then upgrade to another new update. | ||
|
||
# Start old build, do client-side layering tests, reboot; | ||
# upgrade to new rpm-ostree, reboot; | ||
# exported to a container image from current commit, then rebase to it, reboot; | ||
# then upgrade to another update, reboot. | ||
|
||
|
||
set -xeuo pipefail | ||
|
||
. ${KOLA_EXT_DATA}/libtest.sh | ||
|
||
. /etc/os-release | ||
case $VERSION_ID in | ||
39) kernel_release=6.5.6-300.fc39.x86_64 | ||
Check warning Code scanning / shellcheck kernel_release appears unused. Verify use (or export if used externally). Warning test
kernel_release appears unused. Verify use (or export if used externally).
|
||
koji_kernel_url="https://koji.fedoraproject.org/koji/buildinfo?buildID=2302642" | ||
Check warning Code scanning / shellcheck koji_kernel_url appears unused. Verify use (or export if used externally). Warning test
koji_kernel_url appears unused. Verify use (or export if used externally).
|
||
;; | ||
*) echo "Unsupported Fedora version: $VERSION_ID" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
cd "$(mktemp -d)" | ||
|
||
image=containers-storage:localhost/fcos | ||
image_pull=ostree-unverified-image:$image | ||
|
||
case "${AUTOPKGTEST_REBOOT_MARK:-}" in | ||
"") | ||
rpm-ostree --version | ||
systemctl mask --now zincati | ||
|
||
client_side_layering_tests | ||
/tmp/autopkgtest-reboot 1 | ||
;; | ||
"1") | ||
client_side_layering_checking | ||
echo "ok client-side layering tests" | ||
|
||
# update rpm-ostree | ||
rpm-ostree override replace ${KOLA_EXT_DATA}/rpm-ostree* | ||
/tmp/autopkgtest-reboot 2 | ||
;; | ||
"2") | ||
client_side_layering_checking | ||
echo "ok upgrade to new rpm-ostree" | ||
|
||
# remove foo as workaround, see https://github.com/coreos/rpm-ostree/issues/4805 | ||
rpm-ostree uninstall foo | ||
checksum=$(rpm-ostree status --json | jq -r '.deployments[0].checksum') | ||
ostree container encapsulate --repo=/ostree/repo ${checksum} ${image} | ||
|
||
# rebase to container image | ||
rpm-ostree rebase ${image_pull} | ||
/tmp/autopkgtest-reboot 3 | ||
;; | ||
"3") | ||
rpm-ostree status | ||
|
||
booted_image=$(rpm-ostree status --json | jq -r '.deployments[0]["container-image-reference"]') | ||
test "${image_pull}" = "$booted_image" | ||
echo "ok rebase container image" | ||
|
||
cat > Containerfile << EOF | ||
FROM localhost/fcos | ||
RUN rpm-ostree install vim-filesystem && rpm-ostree cleanup -m | ||
EOF | ||
|
||
podman build --net=host -t localhost/fcos-derived --squash . | ||
rpm-ostree rebase "${image_pull}-derived" | ||
/tmp/autopkgtest-reboot 4 | ||
;; | ||
"4") | ||
rpm-ostree status | ||
rpm -q vim-filesystem | ||
echo "ok upgrade to another container image" | ||
;; | ||
*) echo "unexpected mark: ${AUTOPKGTEST_REBOOT_MARK}"; exit 1;; | ||
esac |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#!/bin/bash | ||
## kola: | ||
## # This test reboots a lot, generates container images, etc. | ||
## timeoutMin: 40 | ||
## minMemory: 2048 | ||
## tags: needs-internet | ||
## description: Start old build, upgrade rpm-ostree to new version, | ||
## do client-side layering tests, then upgrade to another new update. | ||
|
||
# start old build, upgrade to new rpm-ostree, reboot; | ||
# do client-side layering tests, reboot; | ||
# upgrade to container image, reboot; | ||
# then upgrade to another update, reboot. | ||
|
||
|
||
set -xeuo pipefail | ||
|
||
. ${KOLA_EXT_DATA}/libtest.sh | ||
|
||
. /etc/os-release | ||
case $VERSION_ID in | ||
39) kernel_release=6.5.6-300.fc39.x86_64 | ||
Check warning Code scanning / shellcheck kernel_release appears unused. Verify use (or export if used externally). Warning test
kernel_release appears unused. Verify use (or export if used externally).
|
||
koji_kernel_url="https://koji.fedoraproject.org/koji/buildinfo?buildID=2302642" | ||
Check warning Code scanning / shellcheck koji_kernel_url appears unused. Verify use (or export if used externally). Warning test
koji_kernel_url appears unused. Verify use (or export if used externally).
|
||
;; | ||
*) echo "Unsupported Fedora version: $VERSION_ID" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
cd "$(mktemp -d)" | ||
|
||
image=containers-storage:localhost/fcos | ||
image_pull=ostree-unverified-image:$image | ||
|
||
case "${AUTOPKGTEST_REBOOT_MARK:-}" in | ||
"") | ||
rpm-ostree --version | ||
systemctl mask --now zincati | ||
|
||
# update rpm-ostree | ||
rpm-ostree override replace ${KOLA_EXT_DATA}/rpm-ostree* | ||
/tmp/autopkgtest-reboot 1 | ||
;; | ||
"1") | ||
rpm-ostree status | ||
echo "ok upgrade rpm-ostree" | ||
|
||
client_side_layering_tests | ||
/tmp/autopkgtest-reboot 2 | ||
;; | ||
"2") | ||
client_side_layering_checking | ||
echo "ok client-side layering tests with new rpm-ostree" | ||
|
||
# remove foo as workaround, see https://github.com/coreos/rpm-ostree/issues/4805 | ||
rpm-ostree uninstall foo | ||
checksum=$(rpm-ostree status --json | jq -r '.deployments[0].checksum') | ||
ostree container encapsulate --repo=/ostree/repo ${checksum} ${image} | ||
|
||
# rebase to container image | ||
rpm-ostree rebase ${image_pull} | ||
/tmp/autopkgtest-reboot 3 | ||
;; | ||
"3") | ||
rpm-ostree status | ||
|
||
booted_image=$(rpm-ostree status --json | jq -r '.deployments[0]["container-image-reference"]') | ||
test "${image_pull}" = "$booted_image" | ||
echo "ok rebase container image" | ||
|
||
cat > Containerfile << EOF | ||
FROM localhost/fcos | ||
RUN rpm-ostree install vim-filesystem && rpm-ostree cleanup -m | ||
EOF | ||
|
||
podman build --net=host -t localhost/fcos-derived --squash . | ||
rpm-ostree rebase "${image_pull}-derived" | ||
/tmp/autopkgtest-reboot 4 | ||
;; | ||
"4") | ||
rpm-ostree status | ||
rpm -q vim-filesystem | ||
echo "ok upgrade to another container image" | ||
;; | ||
*) echo "unexpected mark: ${AUTOPKGTEST_REBOOT_MARK}"; exit 1;; | ||
esac |