From: Dmitry V. Levin Date: Wed, 6 Mar 2019 16:02:38 +0000 (+0000) Subject: tests: move PTRACE_SEIZE check to a separate file X-Git-Tag: v5.0~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=875efe9fa58ae86150664733fd4a8d110d94a386;p=strace tests: move PTRACE_SEIZE check to a separate file The check is going to be used by another test soon. * tests/PTRACE_SEIZE.sh: New file. * tests/detach-stopped.test: Use it. * tests/Makefile.am (EXTRA_DIST): Add PTRACE_SEIZE.sh. --- diff --git a/tests/Makefile.am b/tests/Makefile.am index d354695d..5c52c8d6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -365,6 +365,7 @@ VALGRIND_SUPPRESSIONS_FILES = $(abs_srcdir)/strace.supp EXTRA_DIST = \ COPYING \ GPL-2.0-or-later \ + PTRACE_SEIZE.sh \ accept_compat.h \ attach-p-cmd.h \ caps-abbrev.awk \ diff --git a/tests/PTRACE_SEIZE.sh b/tests/PTRACE_SEIZE.sh new file mode 100755 index 00000000..9ffe4c78 --- /dev/null +++ b/tests/PTRACE_SEIZE.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# +# Skip the test if PTRACE_SEIZE is not supported. +# +# Copyright (c) 2014-2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +$STRACE -d -enone / > /dev/null 2> "$LOG" ||: +if grep -x "[^:]*strace: PTRACE_SEIZE doesn't work" "$LOG" > /dev/null; then + skip_ "PTRACE_SEIZE doesn't work" +fi diff --git a/tests/detach-stopped.test b/tests/detach-stopped.test index fb678534..8d92ec7b 100755 --- a/tests/detach-stopped.test +++ b/tests/detach-stopped.test @@ -9,15 +9,11 @@ # SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" +. "${srcdir=.}/PTRACE_SEIZE.sh" run_prog_skip_if_failed \ kill -0 $$ -$STRACE -d -enone / > /dev/null 2> "$LOG" -if grep -x "[^:]*strace: PTRACE_SEIZE doesn't work" "$LOG" > /dev/null; then - skip_ "PTRACE_SEIZE doesn't work" -fi - check_prog sleep trap - TERM