Blame SOURCES/elfutils-0.182-debuginfod-test-fix.patch

5f06b3
commit f172a31c56405750114924eba0786999bccc501f
5f06b3
Author: Mark Wielaard <mark@klomp.org>
5f06b3
Date:   Mon Nov 2 15:20:54 2020 +0100
5f06b3
5f06b3
    tests: Create bogus R/nothing.rpm with cyclic symlink.
5f06b3
    
5f06b3
    We used to try to trigger an error during debuginfod scanning using
5f06b3
    a chmod 000 file. But this doesn't always result in an error. Create
5f06b3
    a cyclic symlink instead, which always results in a failure to open/read.
5f06b3
    
5f06b3
    Signed-off-by: Mark Wielaard <mark@klomp.org>
5f06b3
5f06b3
diff --git a/tests/ChangeLog b/tests/ChangeLog
5f06b3
index 57fc4c8e..2f8b75c3 100644
5f06b3
--- a/tests/ChangeLog
5f06b3
+++ b/tests/ChangeLog
5f06b3
@@ -1,3 +1,8 @@
5f06b3
+2020-11-02  Mark Wielaard  <mark@klomp.org>
5f06b3
+
5f06b3
+	* run-debuginfod-find.sh: Create bogus R/nothing.rpm with cyclic
5f06b3
+	symlink instead of chmod 000.
5f06b3
+
5f06b3
 2020-10-31  Mark Wielaard  <mark@klomp.org>
5f06b3
 
5f06b3
 	* dwfl-proc-attach.c (dlopen): New external function override.
5f06b3
diff --git a/tests/run-debuginfod-find.sh b/tests/run-debuginfod-find.sh
5f06b3
index 48dbc7d4..5af45667 100755
5f06b3
--- a/tests/run-debuginfod-find.sh
5f06b3
+++ b/tests/run-debuginfod-find.sh
5f06b3
@@ -95,9 +95,10 @@ wait_ready()
5f06b3
   fi
5f06b3
 }
5f06b3
 
5f06b3
-# create a 000 empty .rpm file to evoke a metric-visible error
5f06b3
-touch R/nothing.rpm
5f06b3
-chmod 000 R/nothing.rpm
5f06b3
+# create a bogus .rpm file to evoke a metric-visible error
5f06b3
+# Use a cyclic symlink instead of chmod 000 to make sure even root
5f06b3
+# would see an error (running the testsuite under root is NOT encouraged).
5f06b3
+ln -s R/nothing.rpm R/nothing.rpm
5f06b3
 
5f06b3
 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 &
5f06b3
 PID1=$!