]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
tests: Make sure all debuginfod tests use a clean database and cache.
authorMark Wielaard <mark@klomp.org>
Fri, 3 Sep 2021 23:40:53 +0000 (01:40 +0200)
committerMark Wielaard <mark@klomp.org>
Fri, 3 Sep 2021 23:40:53 +0000 (01:40 +0200)
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 <mark@klomp.org>
12 files changed:
tests/ChangeLog
tests/run-debuginfod-000-permission.sh
tests/run-debuginfod-archive-groom.sh
tests/run-debuginfod-archive-test.sh
tests/run-debuginfod-dlopen.sh
tests/run-debuginfod-duplicate-urls.sh
tests/run-debuginfod-extraction.sh
tests/run-debuginfod-fd-prefetch-caches.sh
tests/run-debuginfod-malformed.sh
tests/run-debuginfod-sizetime.sh
tests/run-debuginfod-tmp-home.sh
tests/run-debuginfod-writable.sh

index 9540f738896c7c147b6e683dabd81d9500a0d888..178697bb7216fd82fa95b6b251cfe049bee8599b 100644 (file)
@@ -1,3 +1,18 @@
+2021-09-03  Mark Wielaard  <mark@klomp.org>
+
+       * 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  <mark@klomp.org>
 
        * debuginfod-subr.sh (EXTRA_DIST): Add debuginfod-subr.sh.
index 28e54385dfdab384bb7782e1ee6c367c630cdad8..1e92bdb8cc34e143ba5e957505e56be8a89bf12c 100755 (executable)
 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
index 0ee056ff9c28a241695809df615086c2b9b6ffe5..4b991f536469797cf850f71cf9a74766cfea1742 100755 (executable)
@@ -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
index bc5005408bbdcf6ab9023951d0888dfbfa585ce2..1ec57bbaa5b5f1ffa6f4f44fef97a451416164cd 100755 (executable)
@@ -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
index 6476612c8ae4fbac224362c6d23358b0159d8429..0f2d13e263b21e4fa38d31cf9727d8a3aedfead7 100755 (executable)
@@ -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
index b76b39a39ccb85751121d053926c5ff657de2035..50e39cb2df95f3c7670d637ac0563bf86dc477fa 100755 (executable)
@@ -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=$!
index 7c534d099a11beb604266131da19ce36ce921e0a..e984f32f1296fa913bcebfae01ea518840640dee 100755 (executable)
@@ -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
index 08b329236f7807e81020b079ee415f50a6990c9a..61fee9e94aae77f10273a872217fad1f0f8f2e62 100755 (executable)
@@ -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=$!
index 78b3b7fcbf48dcb9bfe6df9c8fe84999a597ba0f..eb504181d48aeb641ed6511f38ab34df4ea3ca95 100755 (executable)
@@ -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
index 068b548b9c9687271d6d1b3c5dde94d169e02788..2cf6f252c50d23eeb9ca902969c9db6d9cfe9b4f 100755 (executable)
@@ -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
index 81986198dbeacf5060d3220bb0c6c7e251a18cd9..25b89be46fd9105dc223f6a57d8bf3159a71078f 100755 (executable)
@@ -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
index 440a566685a162c14b92ab3673294558ce7dd26c..0bc70379b4a5a9128b753bb009ca1fb22998eb5b 100755 (executable)
@@ -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