public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Mike Frysinger" <vapier@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/sandbox:master commit in: tests/
Date: Wed,  3 Nov 2021 19:13:35 +0000 (UTC)	[thread overview]
Message-ID: <1635966693.369fc5965ce5065f2653225627f61442641c5bef.vapier@gentoo> (raw)

commit:     369fc5965ce5065f2653225627f61442641c5bef
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Nov  3 19:11:33 2021 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Nov  3 19:11:33 2021 +0000
URL:        https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=369fc596

tests: skip static children tests when YAMA ptrace_scope is enabled

Since we can't trace static children under certain YAMA ptrace_scope
settings, skip tests that rely on that functionality.

Closes: https://bugs.gentoo.org/821418
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

 tests/atlocal.in   | 9 +++++++++
 tests/script-17.sh | 8 +++++++-
 tests/script-8.sh  | 3 +++
 3 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/tests/atlocal.in b/tests/atlocal.in
index e8213c0..adf3bad 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -42,5 +42,14 @@ case "${MAKEFLAGS}" in
 	;;
 esac
 
+# Figure out currently YAMA ptrace_scope restriction level.
+at_yama_ptrace_scope=$(cat /proc/sys/kernel/yama/ptrace_scope 2>/dev/null || echo 0)
+if [ ${at_yama_ptrace_scope} -gt 0 ] ; then
+	if [ "$(id -u)" -eq 0 ] ; then
+		at_yama_ptrace_scope=0
+	fi
+fi
+export at_yama_ptrace_scope
+
 # This script must finish with ($? == 0) else the autotest runner gets upset.
 :

diff --git a/tests/script-17.sh b/tests/script-17.sh
index a8a8f51..83c51f9 100755
--- a/tests/script-17.sh
+++ b/tests/script-17.sh
@@ -10,7 +10,13 @@ adddeny "${PWD}/subdir"
 for child in 0 1 2 3 4 5 ; do
 	fork-follow_tst ${child} subdir/dyn${child} || exit $?
 done
-for child in 0 1 2 3 4 5 ; do
+
+depth="0"
+# We can't trace static children currently with YAMA ptrace_scope 1+.
+if [ ${at_yama_ptrace_scope} -eq 0 ] ; then
+	depth="${depth} 1 2 3 4 5"
+fi
+for child in ${depth} ; do
 	fork-follow_static_tst ${child} subdir/static${child} || exit $?
 done
 

diff --git a/tests/script-8.sh b/tests/script-8.sh
index 6d9de55..9d8ca11 100755
--- a/tests/script-8.sh
+++ b/tests/script-8.sh
@@ -6,6 +6,9 @@ sigsuspend-zsh_tst
 d=$?
 echo "ret = $d"
 
+# We can't trace static children currently with YAMA ptrace_scope 1+.
+[ ${at_yama_ptrace_scope} -gt 0 ] && exit ${d}
+
 sigsuspend-zsh_static_tst
 s=$?
 echo "ret = $s"


             reply	other threads:[~2021-11-03 19:13 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-03 19:13 Mike Frysinger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-01-14 18:43 [gentoo-commits] proj/sandbox:master commit in: tests/ Mike Gilbert
2025-01-14  4:38 Mike Gilbert
2025-01-08  4:09 [gentoo-commits] proj/sandbox:stable-2.x " Mike Gilbert
2025-01-14  4:38 ` [gentoo-commits] proj/sandbox:master " Mike Gilbert
2025-01-08  3:29 [gentoo-commits] proj/sandbox:stable-2.x " Mike Gilbert
2025-01-14  4:38 ` [gentoo-commits] proj/sandbox:master " Mike Gilbert
2025-01-08  3:04 [gentoo-commits] proj/sandbox:stable-2.x " Mike Gilbert
2025-01-14  4:38 ` [gentoo-commits] proj/sandbox:master " Mike Gilbert
2024-11-11 22:47 Sam James
2023-07-01 23:52 Mike Gilbert
2023-06-22 13:54 Mike Gilbert
2023-06-22 13:54 Mike Gilbert
2021-10-24  0:54 Mike Frysinger
2021-10-23 22:19 Mike Frysinger
2021-10-22  7:21 Michał Górny
2021-10-22  4:54 Mike Frysinger
2021-10-22  4:15 Mike Frysinger
2021-10-21  2:48 Mike Frysinger
2021-10-18  5:21 Mike Frysinger
2020-05-31 10:52 Michał Górny
2019-06-27 21:41 Sergei Trofimovich
2018-02-19  5:50 Michał Górny
2016-03-29 12:24 Mike Frysinger
2016-03-29 12:24 Mike Frysinger
2015-12-20 21:33 Mike Frysinger
2015-09-28 20:17 Mike Frysinger
2015-09-27  6:13 Mike Frysinger
2015-09-11  7:53 Mike Frysinger
2015-09-11  7:53 Mike Frysinger
2012-12-24 23:58 Mike Frysinger
2012-11-26 10:10 Mike Frysinger
2012-06-24  6:14 Mike Frysinger
2012-06-23 21:27 Mike Frysinger
2012-03-06 19:00 Mike Frysinger
2012-03-05  7:01 Mike Frysinger
2012-03-05  7:01 Mike Frysinger
2011-07-08 19:53 Mike Frysinger
2011-07-04 23:06 Mike Frysinger
2011-07-04 23:06 Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1635966693.369fc5965ce5065f2653225627f61442641c5bef.vapier@gentoo \
    --to=vapier@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox