From f6f6ac5ff3d16ab162c909ed42aa3d30ed7251d3 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 11 Mar 2021 15:20:14 +0000 Subject: [PATCH] ci: Add composepost-checks.sh, drop a compose test The compose tests are expensive; each run involves running all the `%post` scripts and `dracut` etc. This is definitely a source of timeouts in CCI. Remove `test-boot-location-modules.sh` - it's the default now and is used by FCOS. Add dedicated script where we can test all these things by default after a `cosa build`. This aims to move the compose tests to only cover bits *not* in cosa like the non-unified-core path. --- .cci.jenkinsfile | 1 + ci/composepost-checks.sh | 28 +++++++++++++++++++++ tests/compose/test-boot-location-modules.sh | 26 ------------------- 3 files changed, 29 insertions(+), 26 deletions(-) create mode 100755 ci/composepost-checks.sh delete mode 100755 tests/compose/test-boot-location-modules.sh diff --git a/.cci.jenkinsfile b/.cci.jenkinsfile index be14a72b..fe65c985 100644 --- a/.cci.jenkinsfile +++ b/.cci.jenkinsfile @@ -47,6 +47,7 @@ parallel insttests: { (cd overrides/rpm && curl -LO https://kojipkgs.fedoraproject.org//packages/libsolv/0.7.17/1.fc33/x86_64/libsolv-0.7.17-1.fc33.x86_64.rpm) coreos-assembler fetch coreos-assembler build + ${env.WORKSPACE}/ci/composepost-checks.sh """) } stage("Install Deps") { diff --git a/ci/composepost-checks.sh b/ci/composepost-checks.sh new file mode 100755 index 00000000..a3cf6f99 --- /dev/null +++ b/ci/composepost-checks.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# This script expects a coreos-assembler working directory +# and will validate parts of the generated ostree commit. + +set -xeuo pipefail + +dn=$(cd "$(dirname "$0")" && pwd) +commondir=$(cd "$dn/../tests/common" && pwd) +. "${commondir}/libtest-core.sh" + +repo=tmp/repo +ref=$(cosa meta --get-value ref) + +# Nothing in /boot (but it should exist) +ostree --repo="${repo}" ls -R "${ref}" /boot > tmp/bootls.txt +cat >tmp/bootls-expected.txt < tmp/bootls.txt +assert_not_file_has_content tmp/bootls.txt vmlinuz- +assert_not_file_has_content tmp/bootls.txt initramfs- +# And use the kver to find the kernel in /usr/lib/modules +ostree --repo="${repo}" ls -R "${ref}" /usr/lib/modules > tmp/modules-lsr.txt +assert_file_has_content tmp/modules-lsr.txt '/vmlinuz$' +assert_file_has_content tmp/modules-lsr.txt '/initramfs.img$' +echo "ok boot location modules" diff --git a/tests/compose/test-boot-location-modules.sh b/tests/compose/test-boot-location-modules.sh deleted file mode 100755 index 2dc1fa52..00000000 --- a/tests/compose/test-boot-location-modules.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -set -xeuo pipefail - -dn=$(cd "$(dirname "$0")" && pwd) -# shellcheck source=libcomposetest.sh -. "${dn}/libcomposetest.sh" - -treefile_set boot-location '"modules"' -runcompose -echo "ok compose" - -# Nothing in /boot (but it should exist) -ostree --repo="${repo}" ls -R "${treeref}" /boot > bootls.txt -cat >bootls-expected.txt < bootls.txt -assert_not_file_has_content bootls.txt vmlinuz- -assert_not_file_has_content bootls.txt initramfs- -# And use the kver to find the kernel in /usr/lib/modules -ostree --repo="${repo}" ls -R "${treeref}" /usr/lib/modules > modules-lsr.txt -assert_file_has_content modules-lsr.txt '/vmlinuz$' -assert_file_has_content modules-lsr.txt '/initramfs.img$' -echo "ok boot location modules"