]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
tests: Create bogus R/nothing.rpm with cyclic symlink.
authorMark Wielaard <mark@klomp.org>
Mon, 2 Nov 2020 14:20:54 +0000 (15:20 +0100)
committerMark Wielaard <mark@klomp.org>
Fri, 6 Nov 2020 17:37:36 +0000 (18:37 +0100)
We used to try to trigger an error during debuginfod scanning using
a chmod 000 file. But this doesn't always result in an error. Create
a cyclic symlink instead, which always results in a failure to open/read.

Signed-off-by: Mark Wielaard <mark@klomp.org>
tests/ChangeLog
tests/run-debuginfod-find.sh

index f7b78c83fb7986c8d312755ebeb92e793c73dffe..94686137613a2cd9dc65fafb66d7229e6fc665a2 100644 (file)
@@ -1,3 +1,8 @@
+2020-11-02  Mark Wielaard  <mark@klomp.org>
+
+       * run-debuginfod-find.sh: Create bogus R/nothing.rpm with cyclic
+       symlink instead of chmod 000.
+
 2020-11-01  Érico N. Rolim  <erico.erc@gmail.com>
            Mark Wielaard  <mark@klomp.org>
 
index 48dbc7d4edf42e5cf30414ae3c382822cb6cb92f..5af456674727d235c7c1ff94cdfdb2e4346414d8 100755 (executable)
@@ -95,9 +95,10 @@ wait_ready()
   fi
 }
 
-# create a 000 empty .rpm file to evoke a metric-visible error
-touch R/nothing.rpm
-chmod 000 R/nothing.rpm
+# create a bogus .rpm file to evoke a metric-visible error
+# Use a cyclic symlink instead of chmod 000 to make sure even root
+# would see an error (running the testsuite under root is NOT encouraged).
+ln -s R/nothing.rpm R/nothing.rpm
 
 env LD_LIBRARY_PATH=$ldpath DEBUGINFOD_URLS= ${abs_builddir}/../debuginfod/debuginfod $VERBOSE -F -R -d $DB -p $PORT1 -t0 -g0 --fdcache-fds 1 --fdcache-mbs 2 -Z .tar.xz -Z .tar.bz2=bzcat -v R F Z L > vlog4 2>&1 &
 PID1=$!