From 1ec3b7fd550324cf3c8759c84f080bb4e98e6bb0 Mon Sep 17 00:00:00 2001 From: Luca BRUNO Date: Mon, 19 Apr 2021 07:19:09 +0000 Subject: [PATCH] tests/compose: add more autovar testcases This adds some testcases in order to cover more codepaths in the translation logic. --- tests/compose/test-basic.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/compose/test-basic.sh b/tests/compose/test-basic.sh index 32fae0e9..ba4a6d3f 100755 --- a/tests/compose/test-basic.sh +++ b/tests/compose/test-basic.sh @@ -45,13 +45,15 @@ runcompose --add-metadata-from-json metadata.json \ . "${dn}/libbasic-test.sh" basic_test -# This one is done by postprocessing /var +# Check tmpfiles.d entries created by postprocessing /var. +# Testcases picked at random to cover translation logic. They are unlikely to change upstream, +# but if that happens we will need to adapt the entries. ostree --repo="${repo}" cat "${treeref}" /usr/lib/tmpfiles.d/rpm-ostree-1-autovar.conf > autovar.txt -# Picked this one at random as an example of something that won't likely be -# converted to tmpfiles.d upstream. But if it is, we can change this test. assert_file_has_content_literal autovar.txt 'd /var/cache 0755 root root - -' -# And this one has a non-root uid assert_file_has_content_literal autovar.txt 'd /var/log/chrony 0755 chrony chrony - -' +assert_file_has_content_literal autovar.txt 'L /var/mail - - - - spool/mail' +assert_file_has_content_literal autovar.txt 'd /var/tmp 1777 root root - -' +assert_file_has_content_literal autovar.txt 'd /var/lib/polkit-1 0750 root polkitd - -' echo "ok autovar" # Validate this exists