From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (wildebeest.demon.nl [212.238.236.112]) by sourceware.org (Postfix) with ESMTPS id 16F233840C25 for ; Mon, 2 Nov 2020 14:23:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 16F233840C25 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mark@klomp.org Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id EEBD630291AB; Mon, 2 Nov 2020 15:23:16 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id AA3B24000985; Mon, 2 Nov 2020 15:23:16 +0100 (CET) From: Mark Wielaard To: elfutils-devel@sourceware.org Cc: Martin Cermak , Mark Wielaard Subject: [PATCH] tests: Create bogus R/nothing.rpm with cyclic symlink. Date: Mon, 2 Nov 2020 15:23:06 +0100 Message-Id: <20201102142306.2704-1-mark@klomp.org> X-Mailer: git-send-email 2.18.4 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Nov 2020 14:23:19 -0000 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 --- tests/ChangeLog | 5 +++++ tests/run-debuginfod-find.sh | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/ChangeLog b/tests/ChangeLog index 57fc4c8e..2f8b75c3 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,8 @@ +2020-11-02 Mark Wielaard + + * run-debuginfod-find.sh: Create bogus R/nothing.rpm with cyclic + symlink instead of chmod 000. + 2020-10-31 Mark Wielaard * dwfl-proc-attach.c (dlopen): New external function override. diff --git a/tests/run-debuginfod-find.sh b/tests/run-debuginfod-find.sh index 48dbc7d4..5af45667 100755 --- a/tests/run-debuginfod-find.sh +++ b/tests/run-debuginfod-find.sh @@ -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=$! -- 2.18.4