Image tests: skip rpm-ostree-1-autovar.conf tmpfiles.d config on Fedora

The content of `/usr/lib/tmpfiles.d/rpm-ostree-1-autovar.conf` is
dynamically created and its lines are not ordered deterministically.
This causes the rpm-ostree based image test cases to fail often on
Fedora, because the diff of the expected and actual image-info report
always produces some different lines.

Add a new option `-skip-tmpfilesd-path` to `osbuild-image-tests`
accepting a tmpfiles.d configuration path, which should be ignored when
comparing the expected and actual image-info report. The option can be
specified multiple times and all paths will be ignored.

Modify the `image_tests.sh` test case to use the new option and ignore the
`/usr/lib/tmpfiles.d/rpm-ostree-1-autovar.conf` file when testing Fedora
images.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
This commit is contained in:
Tomas Hozza 2021-10-07 19:18:18 +02:00 committed by Tom Gundersen
parent 9d5c16f623
commit 9497ef8ca9
2 changed files with 56 additions and 6 deletions

View file

@ -26,6 +26,13 @@ if [[ "${DISTRO_CODE}" =~ "rhel-84" ]]; then
IMAGE_TEST_CASE_RUNNER="${IMAGE_TEST_CASE_RUNNER} -skip-selinux-ctx-check"
fi
# Skip the /usr/lib/tmpfiles.d/rpm-ostree-1-autovar.conf file form the 'tmpfiles.d'
# section of the image-info report. The content of the file is dynamically generated
# and lines are not deterministically sorted, thus the diff often fails.
if [[ "${DISTRO_CODE}" =~ "fedora" ]]; then
IMAGE_TEST_CASE_RUNNER="${IMAGE_TEST_CASE_RUNNER} -skip-tmpfilesd-path /usr/lib/tmpfiles.d/rpm-ostree-1-autovar.conf"
fi
PASSED_TESTS=()
FAILED_TESTS=()