From: Mark Wielaard Date: Fri, 3 Sep 2021 23:40:53 +0000 (+0200) Subject: tests: Make sure all debuginfod tests use a clean database and cache. X-Git-Tag: elfutils-0.186~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8e9edeab19931f878e16cc1bff6ac286937e997f;p=thirdparty%2Felfutils.git tests: Make sure all debuginfod tests use a clean database and cache. Always set DEBUGINFOD_CACHE_PATH to an unique (new) directory and make sure that each debuginfod invocation uses a new sqlite database. Signed-off-by: Mark Wielaard --- diff --git a/tests/ChangeLog b/tests/ChangeLog index 9540f7388..178697bb7 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,18 @@ +2021-09-03 Mark Wielaard + + * run-debuginfod-000-permission.sh: Set DEBUGINFOD_CACHE_PATH + and use an unique sqlite db. + * run-debuginfod-archive-groom.sh: Likewise. + * run-debuginfod-archive-test.sh: Likewise. + * run-debuginfod-dlopen.sh: Likewise. + * run-debuginfod-duplicate-urls.sh: Likewise. + * run-debuginfod-extraction.sh: Likewise. + * run-debuginfod-fd-prefetch-caches.sh: Likewise. + * run-debuginfod-malformed.sh: Likewise. + * run-debuginfod-sizetime.sh: Likewise. + * run-debuginfod-tmp-home.sh: Likewise. + * run-debuginfod-writable.sh: Likewise. + 2021-09-03 Mark Wielaard * debuginfod-subr.sh (EXTRA_DIST): Add debuginfod-subr.sh. diff --git a/tests/run-debuginfod-000-permission.sh b/tests/run-debuginfod-000-permission.sh index 28e54385d..1e92bdb8c 100755 --- a/tests/run-debuginfod-000-permission.sh +++ b/tests/run-debuginfod-000-permission.sh @@ -22,12 +22,13 @@ set -x unset VALGRIND_CMD DB=${PWD}/.debuginfod_tmp.sqlite +tempfiles $DB export DEBUGINFOD_CACHE_PATH=${PWD}/.client_cache # This variable is essential and ensures no time-race for claiming ports occurs # set base to a unique multiple of 100 not used in any other 'run-debuginfod-*' test base=8000 get_ports -env LD_LIBRARY_PATH=$ldpath DEBUGINFOD_URLS= ${abs_builddir}/../debuginfod/debuginfod $VERBOSE -F -p $PORT1 \ +env LD_LIBRARY_PATH=$ldpath DEBUGINFOD_URLS= ${abs_builddir}/../debuginfod/debuginfod $VERBOSE -F -p $PORT1 -d $DB \ -t0 -g0 -v ${PWD} > vlog$PORT1 2>&1 & PID1=$! tempfiles vlog$PORT1 diff --git a/tests/run-debuginfod-archive-groom.sh b/tests/run-debuginfod-archive-groom.sh index 0ee056ff9..4b991f536 100755 --- a/tests/run-debuginfod-archive-groom.sh +++ b/tests/run-debuginfod-archive-groom.sh @@ -26,6 +26,7 @@ unset VALGRIND_CMD base=8100 get_ports DB=${PWD}/.debuginfod_tmp.sqlite +tempfiles $DB export DEBUGINFOD_CACHE_PATH=${PWD}/.client_cache export DEBUGINFOD_TIMEOUT=10 export DEBUGINFOD_URLS='http://127.0.0.1:'$PORT1 @@ -68,7 +69,7 @@ if [ "$zstd" = "false" ]; then # nuke the zstd fedora 31 ones rm -vrf R/debuginfod-rpms/fedora31 fi -tempfiles vlog3 $DB +tempfiles vlog3 cp -rvp ${abs_srcdir}/debuginfod-tars Z kill -USR1 $PID1 # Wait till both files are in the index and scan/index fully finished diff --git a/tests/run-debuginfod-archive-test.sh b/tests/run-debuginfod-archive-test.sh index bc5005408..1ec57bbaa 100755 --- a/tests/run-debuginfod-archive-test.sh +++ b/tests/run-debuginfod-archive-test.sh @@ -28,8 +28,11 @@ mkdir R # set base to a unique multiple of 100 not used in any other 'run-debuginfod-*' test base=8300 get_ports +DB=${PWD}/.debuginfod_tmp.sqlite +tempfiles $DB +export DEBUGINFOD_CACHE_PATH=${PWD}/.client_cache -env LD_LIBRARY_PATH=$ldpath ${abs_builddir}/../debuginfod/debuginfod $VERBOSE -R -p $PORT1 -t0 -g0 -v R > vlog$PORT1 2>&1 & +env LD_LIBRARY_PATH=$ldpath ${abs_builddir}/../debuginfod/debuginfod $VERBOSE -R -p $PORT1 -d $DB -t0 -g0 -v R > vlog$PORT1 2>&1 & PID1=$! tempfiles vlog$PORT1 errfiles vlog$PORT1 diff --git a/tests/run-debuginfod-dlopen.sh b/tests/run-debuginfod-dlopen.sh index 6476612c8..0f2d13e26 100755 --- a/tests/run-debuginfod-dlopen.sh +++ b/tests/run-debuginfod-dlopen.sh @@ -27,7 +27,12 @@ mkdir F # set base to a unique multiple of 100 not used in any other 'run-debuginfod-*' test base=8500 get_ports -env LD_LIBRARY_PATH=$ldpath DEBUGINFOD_URLS= ${abs_builddir}/../debuginfod/debuginfod -F -R $VERBOSE -p $PORT1 \ + +DB=${PWD}/.debuginfod_tmp.sqlite +tempfiles $DB +export DEBUGINFOD_CACHE_PATH=${PWD}/.client_cache + +env LD_LIBRARY_PATH=$ldpath DEBUGINFOD_URLS= ${abs_builddir}/../debuginfod/debuginfod -F -R $VERBOSE -p $PORT1 -d $DB \ -t0 -g0 -v F > vlog$PORT1 2>&1 & PID1=$! tempfiles vlog$PORT1 diff --git a/tests/run-debuginfod-duplicate-urls.sh b/tests/run-debuginfod-duplicate-urls.sh index b76b39a39..50e39cb2d 100755 --- a/tests/run-debuginfod-duplicate-urls.sh +++ b/tests/run-debuginfod-duplicate-urls.sh @@ -26,6 +26,10 @@ unset VALGRIND_CMD base=8600 get_ports +DB=${PWD}/.debuginfod_tmp.sqlite +tempfiles $DB +export DEBUGINFOD_CACHE_PATH=${PWD}/.client_cache + env LD_LIBRARY_PATH=$ldpath ${abs_builddir}/../debuginfod/debuginfod \ $VERBOSE -F -p $PORT1 -t0 -g0 -d ${DB} F > vlog$PORT1 2>&1 & PID1=$! diff --git a/tests/run-debuginfod-extraction.sh b/tests/run-debuginfod-extraction.sh index 7c534d099..e984f32f1 100755 --- a/tests/run-debuginfod-extraction.sh +++ b/tests/run-debuginfod-extraction.sh @@ -28,7 +28,11 @@ mkdir R Z base=8700 get_ports -env LD_LIBRARY_PATH=$ldpath ${abs_builddir}/../debuginfod/debuginfod $VERBOSE -F -R -Z .tar.xz -Z .tar.bz2=bzcat -p $PORT1 -t0 -g0 -v R Z > vlog$PORT1 2>&1 & +DB=${PWD}/.debuginfod_tmp.sqlite +tempfiles $DB +export DEBUGINFOD_CACHE_PATH=${PWD}/.client_cache + +env LD_LIBRARY_PATH=$ldpath ${abs_builddir}/../debuginfod/debuginfod $VERBOSE -d $DB -F -R -Z .tar.xz -Z .tar.bz2=bzcat -p $PORT1 -t0 -g0 -v R Z > vlog$PORT1 2>&1 & PID1=$! tempfiles vlog$PORT1 errfiles vlog$PORT1 diff --git a/tests/run-debuginfod-fd-prefetch-caches.sh b/tests/run-debuginfod-fd-prefetch-caches.sh index 08b329236..61fee9e94 100755 --- a/tests/run-debuginfod-fd-prefetch-caches.sh +++ b/tests/run-debuginfod-fd-prefetch-caches.sh @@ -31,8 +31,12 @@ PREFETCH_MBS=100 base=8800 get_ports +DB=${PWD}/.debuginfod_tmp.sqlite +tempfiles $DB +export DEBUGINFOD_CACHE_PATH=${PWD}/.client_cache + echo $PORT1 -env LD_LIBRARY_PATH=$ldpath DEBUGINFOD_URLS= ${abs_builddir}/../debuginfod/debuginfod $VERBOSE -p $PORT1 \ +env LD_LIBRARY_PATH=$ldpath DEBUGINFOD_URLS= ${abs_builddir}/../debuginfod/debuginfod $VERBOSE -p $PORT1 -d $DB \ --fdcache-mbs=$FDCACHE_MDS --fdcache-fds=$FDCACHE_FDS --fdcache-prefetch-mbs=$PREFETCH_MBS \ --fdcache-prefetch-fds=$PREFETCH_FDS --fdcache-mintmp 0 -v -F F > vlog$PORT1 2>&1 & PID1=$! diff --git a/tests/run-debuginfod-malformed.sh b/tests/run-debuginfod-malformed.sh index 78b3b7fcb..eb504181d 100755 --- a/tests/run-debuginfod-malformed.sh +++ b/tests/run-debuginfod-malformed.sh @@ -28,11 +28,12 @@ base=9200 # find an unused port number get_ports DB=${PWD}/.debuginfod_tmp.sqlite +tempfiles $DB export DEBUGINFOD_CACHE_PATH=${PWD}/.client_cache mkdir F mkdir -p $DEBUGINFOD_CACHE_PATH -env LD_LIBRARY_PATH=$ldpath DEBUGINFOD_URLS= ${abs_builddir}/../debuginfod/debuginfod $VERBOSE -F -p $PORT1 \ +env LD_LIBRARY_PATH=$ldpath DEBUGINFOD_URLS= ${abs_builddir}/../debuginfod/debuginfod $VERBOSE -F -p $PORT1 -d $DB \ -t0 -g0 -v F > vlog$PORT1 2>&1 & PID1=$! tempfiles vlog$PORT1 diff --git a/tests/run-debuginfod-sizetime.sh b/tests/run-debuginfod-sizetime.sh index 068b548b9..2cf6f252c 100755 --- a/tests/run-debuginfod-sizetime.sh +++ b/tests/run-debuginfod-sizetime.sh @@ -25,6 +25,10 @@ unset VALGRIND_CMD base=9600 get_ports +DB=${PWD}/.debuginfod_tmp.sqlite +tempfiles $DB +export DEBUGINFOD_CACHE_PATH=${PWD}/.client_cache + echo "int main() { return 0; }" > ${PWD}/prog.c # Create a subdirectory to confound source path names mkdir foobar @@ -34,7 +38,7 @@ tempfiles prog prog.debug prog.c BUILDID=`env LD_LIBRARY_PATH=$ldpath ${abs_builddir}/../src/readelf \ -a prog | grep 'Build ID' | cut -d ' ' -f 7` -env LD_LIBRARY_PATH=$ldpath ${abs_builddir}/../debuginfod/debuginfod $VERBOSE -F -p $PORT1 -t0 -g0 ${PWD} > vlog$PORT1 2>&1 & +env LD_LIBRARY_PATH=$ldpath ${abs_builddir}/../debuginfod/debuginfod $VERBOSE -F -p $PORT1 -d $DB -t0 -g0 ${PWD} > vlog$PORT1 2>&1 & PID1=$! tempfiles vlog$PORT1 errfiles vlog$PORT1 diff --git a/tests/run-debuginfod-tmp-home.sh b/tests/run-debuginfod-tmp-home.sh index 81986198d..25b89be46 100755 --- a/tests/run-debuginfod-tmp-home.sh +++ b/tests/run-debuginfod-tmp-home.sh @@ -23,6 +23,7 @@ set -x unset VALGRIND_CMD DB=${PWD}/.debuginfod_tmp.sqlite +tempfiles $DB export DEBUGINFOD_CACHE_PATH=${PWD}/.client_cache mkdir F @@ -32,7 +33,7 @@ mkdir -p $DEBUGINFOD_CACHE_PATH base=9700 get_ports -env LD_LIBRARY_PATH=$ldpath DEBUGINFOD_URLS= ${abs_builddir}/../debuginfod/debuginfod $VERBOSE -F -p $PORT1 \ +env LD_LIBRARY_PATH=$ldpath DEBUGINFOD_URLS= ${abs_builddir}/../debuginfod/debuginfod $VERBOSE -F -p $PORT1 -d $DB \ -t0 -g0 -v F > vlog$PORT1 2>&1 & PID1=$! tempfiles vlog$PORT1 diff --git a/tests/run-debuginfod-writable.sh b/tests/run-debuginfod-writable.sh index 440a56668..0bc70379b 100755 --- a/tests/run-debuginfod-writable.sh +++ b/tests/run-debuginfod-writable.sh @@ -28,7 +28,11 @@ mkdir F base=9800 get_ports -env LD_LIBRARY_PATH=$ldpath DEBUGINFOD_URLS= ${abs_builddir}/../debuginfod/debuginfod $VERBOSE -F -p $PORT1 \ +DB=${PWD}/.debuginfod_tmp.sqlite +tempfiles $DB +export DEBUGINFOD_CACHE_PATH=${PWD}/.client_cache + +env LD_LIBRARY_PATH=$ldpath DEBUGINFOD_URLS= ${abs_builddir}/../debuginfod/debuginfod $VERBOSE -F -p $PORT1 -d $DB \ -t0 -g0 -v F > vlog$PORT1 2>&1 & PID1=$! tempfiles vlog$PORT1