summaryrefslogtreecommitdiff
path: root/tests/libtest.sh
diff options
context:
space:
mode:
authorDan Nicholson <dbn@endlessos.org>2021-04-19 11:00:20 -0600
committerDan Nicholson <dbn@endlessos.org>2021-04-19 11:09:44 -0600
commite660855796a40ad417d13cbe081bd62e56a1c6f5 (patch)
tree3a35f3f166ee0494f003e72bd3cdf7c5d108bc71 /tests/libtest.sh
parent2458df446f65083df6ef4580b69839045c5985ed (diff)
downloadostree-e660855796a40ad417d13cbe081bd62e56a1c6f5.tar.gz
tests: Test without a cache directory by default
Several tests generate summaries and then expect to use the generated summary immediately. However, this can cause intermittent test failures when they inadvertantly get a cached summary file. This typically happens when the test is run on a filesystem that doesn't support user extended attributes. In that case, the caching code can only use the last modified time, which only has 1 second granularity. If tests don't carefully manage the summary modification times or the repo cache then they are likely subject to races in some test environments. This introduces an environment variable `OSTREE_SKIP_CACHE` that prevents the repo from using a cache directory. This is enabled by default in tests and disabled for tests that are a explicitly trying to test the caching behavior. Fixes: #2313 Fixes: #2351
Diffstat (limited to 'tests/libtest.sh')
-rwxr-xr-xtests/libtest.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/libtest.sh b/tests/libtest.sh
index 2e9a99df..40f362be 100755
--- a/tests/libtest.sh
+++ b/tests/libtest.sh
@@ -86,6 +86,11 @@ unset TAR_OPTIONS
# easily clean up.
export OSTREE_SYSROOT_DEBUG=mutable-deployments
+# By default, don't use a cache directory since it makes the tests racy.
+# Tests that are explicitly testing the cache operation should unset
+# this.
+export OSTREE_SKIP_CACHE=1
+
export TEST_GPG_KEYID_1="7FCA23D8472CDAFA"
export TEST_GPG_KEYFPR_1="5E65DE75AB1C501862D476347FCA23D8472CDAFA"
export TEST_GPG_KEYID_2="D8228CFECA950D41"