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

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