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

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