diff options
author | Aaron Merey <amerey@redhat.com> | 2022-04-08 19:37:11 -0400 |
---|---|---|
committer | Aaron Merey <amerey@redhat.com> | 2022-04-13 14:52:55 -0400 |
commit | 8b568fdea8e1baea3d68cc38dec587e4c9219276 (patch) | |
tree | bdf0a8e064e579901da0f527f2bd6fbe93517259 /tests | |
parent | 399b55a75830f1854c8da9f29282810e82f270b6 (diff) | |
download | elfutils-8b568fdea8e1baea3d68cc38dec587e4c9219276.tar.gz |
PR29022: 000-permissions files cause problems for backups
000-permission files currently used for negative caching can cause
permission problems for some backup software and disk usage checkers.
Fix this by using empty files for negative caching instead.
Also use each empty file's mtime to determine the time since
last download attempt instead of the cache_miss_s file's mtime.
https://sourceware.org/bugzilla/show_bug.cgi?id=29022
Tested-by: Milian Wolff <mail@milianw.de>
Signed-off-by: Aaron Merey <amerey@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ChangeLog | 11 | ||||
-rw-r--r-- | tests/Makefile.am | 4 | ||||
-rwxr-xr-x | tests/run-debuginfod-federation-link.sh | 4 | ||||
-rwxr-xr-x | tests/run-debuginfod-federation-metrics.sh | 4 | ||||
-rwxr-xr-x | tests/run-debuginfod-federation-sqlite.sh | 4 | ||||
-rwxr-xr-x | tests/run-debuginfod-negative-cache.sh (renamed from tests/run-debuginfod-000-permission.sh) | 6 | ||||
-rwxr-xr-x | tests/run-debuginfod-tmp-home.sh | 2 |
7 files changed, 23 insertions, 12 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog index c195f9f7..6cb0d649 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,14 @@ +2022-04-13 Aaron Merey <amerey@redhat.com> + + * Makefile.am (TESTS): Remove run-debuginfod-000-permission.sh + and add run-debuginfod-negative-cache.sh. + (EXTRA_DIST): Likewise. + * run-debuginfod-federation-link.sh: Update comments about + negative-hit file. + * run-debuginfod-federation-metrics.sh: Likewise. + * run-debuginfod-federation-sqlite.sh: Likewise. + * run-debuginfod-tmp-home.sh: Likewise. + 2022-03-20 Mark Wielaard <mark@klomp.org> * run-large-elf-file.sh: Check elf class of addsections binary. diff --git a/tests/Makefile.am b/tests/Makefile.am index b2da2c83..84c3950a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -227,7 +227,7 @@ TESTS += run-debuginfod-dlopen.sh \ run-debuginfod-file.sh \ run-debuginfod-sizetime.sh \ run-debuginfod-malformed.sh \ - run-debuginfod-000-permission.sh \ + run-debuginfod-negative-cache.sh \ run-debuginfod-tmp-home.sh \ run-debuginfod-writable.sh \ run-debuginfod-no-urls.sh \ @@ -529,7 +529,7 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh run-ar.sh \ run-debuginfod-sizetime.sh \ run-debuginfod-dlopen.sh \ run-debuginfod-malformed.sh \ - run-debuginfod-000-permission.sh \ + run-debuginfod-negative-cache.sh \ run-debuginfod-tmp-home.sh \ run-debuginfod-writable.sh \ run-debuginfod-no-urls.sh \ diff --git a/tests/run-debuginfod-federation-link.sh b/tests/run-debuginfod-federation-link.sh index 4f043741..d7827436 100755 --- a/tests/run-debuginfod-federation-link.sh +++ b/tests/run-debuginfod-federation-link.sh @@ -136,7 +136,7 @@ file -L L/foo export DEBUGINFOD_URLS=http://127.0.0.1:$PORT1 rm -rf $DEBUGINFOD_CACHE_PATH testrun ${abs_top_builddir}/debuginfod/debuginfod-find debuginfo $BUILDID && false || true -rm -f $DEBUGINFOD_CACHE_PATH/$BUILDID/debuginfo # drop 000-perm negative-hit file +rm -f $DEBUGINFOD_CACHE_PATH/$BUILDID/debuginfo # drop negative-hit file export DEBUGINFOD_URLS=http://127.0.0.1:$PORT2 testrun ${abs_top_builddir}/debuginfod/debuginfod-find debuginfo $BUILDID @@ -144,7 +144,7 @@ testrun ${abs_top_builddir}/debuginfod/debuginfod-find debuginfo $BUILDID export DEBUGINFOD_URLS=127.0.0.1:$PORT1 rm -rf $DEBUGINFOD_CACHE_PATH testrun ${abs_top_builddir}/debuginfod/debuginfod-find debuginfo $BUILDID && false || true -rm -f $DEBUGINFOD_CACHE_PATH/$BUILDID/debuginfo # drop 000-perm negative-hit file +rm -f $DEBUGINFOD_CACHE_PATH/$BUILDID/debuginfo # drop negative-hit file export DEBUGINFOD_URLS=127.0.0.1:$PORT2 testrun ${abs_top_builddir}/debuginfod/debuginfod-find debuginfo $BUILDID diff --git a/tests/run-debuginfod-federation-metrics.sh b/tests/run-debuginfod-federation-metrics.sh index 3da457e8..3d716246 100755 --- a/tests/run-debuginfod-federation-metrics.sh +++ b/tests/run-debuginfod-federation-metrics.sh @@ -130,7 +130,7 @@ file -L L/foo export DEBUGINFOD_URLS=http://127.0.0.1:$PORT1 rm -rf $DEBUGINFOD_CACHE_PATH testrun ${abs_top_builddir}/debuginfod/debuginfod-find debuginfo $BUILDID && false || true -rm -f $DEBUGINFOD_CACHE_PATH/$BUILDID/debuginfo # drop 000-perm negative-hit file +rm -f $DEBUGINFOD_CACHE_PATH/$BUILDID/debuginfo # drop negative-hit file export DEBUGINFOD_URLS=http://127.0.0.1:$PORT2 testrun ${abs_top_builddir}/debuginfod/debuginfod-find debuginfo $BUILDID @@ -138,7 +138,7 @@ testrun ${abs_top_builddir}/debuginfod/debuginfod-find debuginfo $BUILDID export DEBUGINFOD_URLS=127.0.0.1:$PORT1 rm -rf $DEBUGINFOD_CACHE_PATH testrun ${abs_top_builddir}/debuginfod/debuginfod-find debuginfo $BUILDID && false || true -rm -f $DEBUGINFOD_CACHE_PATH/$BUILDID/debuginfo # drop 000-perm negative-hit file +rm -f $DEBUGINFOD_CACHE_PATH/$BUILDID/debuginfo # drop negative-hit file export DEBUGINFOD_URLS=127.0.0.1:$PORT2 testrun ${abs_top_builddir}/debuginfod/debuginfod-find debuginfo $BUILDID # test parallel queries in client diff --git a/tests/run-debuginfod-federation-sqlite.sh b/tests/run-debuginfod-federation-sqlite.sh index 449df5db..bb3cda12 100755 --- a/tests/run-debuginfod-federation-sqlite.sh +++ b/tests/run-debuginfod-federation-sqlite.sh @@ -117,7 +117,7 @@ file -L L/foo export DEBUGINFOD_URLS=http://127.0.0.1:$PORT1 rm -rf $DEBUGINFOD_CACHE_PATH testrun ${abs_top_builddir}/debuginfod/debuginfod-find debuginfo $BUILDID && false || true -rm -f $DEBUGINFOD_CACHE_PATH/$BUILDID/debuginfo # drop 000-perm negative-hit file +rm -f $DEBUGINFOD_CACHE_PATH/$BUILDID/debuginfo # drop negative-hit file export DEBUGINFOD_URLS=http://127.0.0.1:$PORT2 testrun ${abs_top_builddir}/debuginfod/debuginfod-find debuginfo $BUILDID @@ -125,7 +125,7 @@ testrun ${abs_top_builddir}/debuginfod/debuginfod-find debuginfo $BUILDID export DEBUGINFOD_URLS=127.0.0.1:$PORT1 rm -rf $DEBUGINFOD_CACHE_PATH testrun ${abs_top_builddir}/debuginfod/debuginfod-find debuginfo $BUILDID && false || true -rm -f $DEBUGINFOD_CACHE_PATH/$BUILDID/debuginfo # drop 000-perm negative-hit file +rm -f $DEBUGINFOD_CACHE_PATH/$BUILDID/debuginfo # drop negative-hit file export DEBUGINFOD_URLS=127.0.0.1:$PORT2 testrun ${abs_top_builddir}/debuginfod/debuginfod-find debuginfo $BUILDID # test parallel queries in client diff --git a/tests/run-debuginfod-000-permission.sh b/tests/run-debuginfod-negative-cache.sh index 1f46c341..f40e99c5 100755 --- a/tests/run-debuginfod-000-permission.sh +++ b/tests/run-debuginfod-negative-cache.sh @@ -46,15 +46,15 @@ ps -q $PID1 -e -L -o '%p %c %a' | grep traverse # PR25628 rm -rf $DEBUGINFOD_CACHE_PATH # clean it from previous tests -# The query is designed to fail, while the 000-permission file should be created. +# The query is designed to fail, while the empty file should be created. testrun ${abs_top_builddir}/debuginfod/debuginfod-find debuginfo 01234567 || true if [ ! -f $DEBUGINFOD_CACHE_PATH/01234567/debuginfo ]; then echo "could not find cache in $DEBUGINFOD_CACHE_PATH" err fi -if [ `stat -c "%A" $DEBUGINFOD_CACHE_PATH/01234567/debuginfo` != "----------" ]; then - echo "The cache $DEBUGINFOD_CACHE_PATH/01234567/debuginfo is readable" +if [ `stat -c "%s" $DEBUGINFOD_CACHE_PATH/01234567/debuginfo` != 0 ]; then + echo "The cache $DEBUGINFOD_CACHE_PATH/01234567/debuginfo is not empty" err fi diff --git a/tests/run-debuginfod-tmp-home.sh b/tests/run-debuginfod-tmp-home.sh index 4256f6f2..5946777a 100755 --- a/tests/run-debuginfod-tmp-home.sh +++ b/tests/run-debuginfod-tmp-home.sh @@ -104,7 +104,7 @@ fi # priority over $HOME/.cache, $XDG_CACHE_HOME. cp -vr $DEBUGINFOD_CACHE_PATH tmphome/.debuginfod_client_cache || true # ||true is for tolerating errors, such a valgrind or something else -# leaving 000-perm files in there +# leaving negative-hit files in there # Add a file that doesn't exist in $HOME/.cache, $XDG_CACHE_HOME. mkdir tmphome/.debuginfod_client_cache/deadbeef |