Blame SOURCES/0023-tests-move-PTRACE_SEIZE-check-to-a-separate-file.patch

8e169c
From ca7fc3695b061c48af1975d14a3e50a87329031a Mon Sep 17 00:00:00 2001
8e169c
From: "Dmitry V. Levin" <ldv@altlinux.org>
8e169c
Date: Wed, 6 Mar 2019 16:02:38 +0000
8e169c
Subject: [PATCH 23/27] tests: move PTRACE_SEIZE check to a separate file
8e169c
8e169c
The check is going to be used by another test soon.
8e169c
8e169c
* tests/PTRACE_SEIZE.sh: New file.
8e169c
* tests/detach-stopped.test: Use it.
8e169c
* tests/Makefile.am (EXTRA_DIST): Add PTRACE_SEIZE.sh.
8e169c
8e169c
Conflicts:
8e169c
	tests/Makefile.am
8e169c
	tests/detach-stopped.test
8e169c
8e169c
Additional changes:
8e169c
	tests-m32/PTRACE_SEIZE.sh (copy of tests/PTRACE_SEIZE.sh)
8e169c
	tests-m32/detach-stopped.test (copy of tests/detach-stopped.test)
8e169c
	tests-mx32/PTRACE_SEIZE.sh (copy of tests/PTRACE_SEIZE.sh)
8e169c
	tests-mx32/detach-stopped.test (copy of tests/detach-stopped.test)
8e169c
8e169c
---
8e169c
 tests/Makefile.am         |  1 +
8e169c
 tests/PTRACE_SEIZE.sh     | 13 +++++++++++++
8e169c
 tests/detach-stopped.test |  6 +-----
8e169c
 3 files changed, 15 insertions(+), 5 deletions(-)
8e169c
 create mode 100755 tests/PTRACE_SEIZE.sh
8e169c
8e169c
Index: strace-4.24/tests/Makefile.am
8e169c
===================================================================
8e169c
--- strace-4.24.orig/tests/Makefile.am	2019-03-10 05:40:37.969676713 +0100
8e169c
+++ strace-4.24/tests/Makefile.am	2019-03-10 05:47:36.446486219 +0100
8e169c
@@ -361,6 +361,7 @@
8e169c
 EXTRA_DIST = \
8e169c
 	COPYING \
8e169c
 	GPL-2.0-or-later \
8e169c
+	PTRACE_SEIZE.sh \
8e169c
 	accept_compat.h \
8e169c
 	attach-p-cmd.h \
8e169c
 	caps-abbrev.awk \
8e169c
Index: strace-4.24/tests/PTRACE_SEIZE.sh
8e169c
===================================================================
8e169c
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
8e169c
+++ strace-4.24/tests/PTRACE_SEIZE.sh	2019-03-10 05:47:36.447486209 +0100
8e169c
@@ -0,0 +1,13 @@
8e169c
+#!/bin/sh
8e169c
+#
8e169c
+# Skip the test if PTRACE_SEIZE is not supported.
8e169c
+#
8e169c
+# Copyright (c) 2014-2019 The strace developers.
8e169c
+# All rights reserved.
8e169c
+#
8e169c
+# SPDX-License-Identifier: GPL-2.0-or-later
8e169c
+
8e169c
+$STRACE -d -enone / > /dev/null 2> "$LOG" ||:
8e169c
+if grep -x "[^:]*strace: PTRACE_SEIZE doesn't work" "$LOG" > /dev/null; then
8e169c
+	skip_ "PTRACE_SEIZE doesn't work"
8e169c
+fi
8e169c
Index: strace-4.24/tests/detach-stopped.test
8e169c
===================================================================
8e169c
--- strace-4.24.orig/tests/detach-stopped.test	2019-03-10 05:34:50.982151335 +0100
8e169c
+++ strace-4.24/tests/detach-stopped.test	2019-03-10 05:47:36.447486209 +0100
8e169c
@@ -9,17 +9,13 @@
8e169c
 # SPDX-License-Identifier: GPL-2.0-or-later
8e169c
 
8e169c
 . "${srcdir=.}/init.sh"
8e169c
+. "${srcdir=.}/PTRACE_SEIZE.sh"
8e169c
 
8e169c
 run_prog_skip_if_failed \
8e169c
 	kill -0 $$
8e169c
 
8e169c
 check_prog sleep
8e169c
 
8e169c
-$STRACE -d -enone / > /dev/null 2> "$LOG"
8e169c
-if grep -x "[^:]*strace: PTRACE_SEIZE doesn't work" "$LOG" > /dev/null; then
8e169c
-	skip_ "PTRACE_SEIZE doesn't work"
8e169c
-fi
8e169c
-
8e169c
 set -e
8e169c
 
8e169c
 > "$LOG"
8e169c
Index: strace-4.24/tests-m32/PTRACE_SEIZE.sh
8e169c
===================================================================
8e169c
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
8e169c
+++ strace-4.24/tests-m32/PTRACE_SEIZE.sh	2019-03-10 05:48:20.038049708 +0100
8e169c
@@ -0,0 +1,13 @@
8e169c
+#!/bin/sh
8e169c
+#
8e169c
+# Skip the test if PTRACE_SEIZE is not supported.
8e169c
+#
8e169c
+# Copyright (c) 2014-2019 The strace developers.
8e169c
+# All rights reserved.
8e169c
+#
8e169c
+# SPDX-License-Identifier: GPL-2.0-or-later
8e169c
+
8e169c
+$STRACE -d -enone / > /dev/null 2> "$LOG" ||:
8e169c
+if grep -x "[^:]*strace: PTRACE_SEIZE doesn't work" "$LOG" > /dev/null; then
8e169c
+	skip_ "PTRACE_SEIZE doesn't work"
8e169c
+fi
8e169c
Index: strace-4.24/tests-m32/detach-stopped.test
8e169c
===================================================================
8e169c
--- strace-4.24.orig/tests-m32/detach-stopped.test	2017-05-22 19:33:51.000000000 +0200
8e169c
+++ strace-4.24/tests-m32/detach-stopped.test	2019-03-10 05:48:30.588944054 +0100
8e169c
@@ -6,40 +6,16 @@
8e169c
 # Copyright (c) 2014-2017 The strace developers.
8e169c
 # All rights reserved.
8e169c
 #
8e169c
-# Redistribution and use in source and binary forms, with or without
8e169c
-# modification, are permitted provided that the following conditions
8e169c
-# are met:
8e169c
-# 1. Redistributions of source code must retain the above copyright
8e169c
-#    notice, this list of conditions and the following disclaimer.
8e169c
-# 2. Redistributions in binary form must reproduce the above copyright
8e169c
-#    notice, this list of conditions and the following disclaimer in the
8e169c
-#    documentation and/or other materials provided with the distribution.
8e169c
-# 3. The name of the author may not be used to endorse or promote products
8e169c
-#    derived from this software without specific prior written permission.
8e169c
-#
8e169c
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
8e169c
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
8e169c
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
8e169c
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8e169c
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8e169c
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8e169c
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8e169c
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8e169c
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8e169c
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8e169c
+# SPDX-License-Identifier: GPL-2.0-or-later
8e169c
 
8e169c
 . "${srcdir=.}/init.sh"
8e169c
+. "${srcdir=.}/PTRACE_SEIZE.sh"
8e169c
 
8e169c
 run_prog_skip_if_failed \
8e169c
 	kill -0 $$
8e169c
 
8e169c
 check_prog sleep
8e169c
 
8e169c
-$STRACE -d -enone / > /dev/null 2> "$LOG"
8e169c
-if grep -x "[^:]*strace: PTRACE_SEIZE doesn't work" "$LOG" > /dev/null; then
8e169c
-	skip_ "PTRACE_SEIZE doesn't work"
8e169c
-fi
8e169c
-
8e169c
 set -e
8e169c
 
8e169c
 > "$LOG"
8e169c
Index: strace-4.24/tests-mx32/detach-stopped.test
8e169c
===================================================================
8e169c
--- strace-4.24.orig/tests-mx32/detach-stopped.test	2017-05-22 19:33:51.000000000 +0200
8e169c
+++ strace-4.24/tests-mx32/detach-stopped.test	2019-03-10 05:48:33.040919501 +0100
8e169c
@@ -6,40 +6,16 @@
8e169c
 # Copyright (c) 2014-2017 The strace developers.
8e169c
 # All rights reserved.
8e169c
 #
8e169c
-# Redistribution and use in source and binary forms, with or without
8e169c
-# modification, are permitted provided that the following conditions
8e169c
-# are met:
8e169c
-# 1. Redistributions of source code must retain the above copyright
8e169c
-#    notice, this list of conditions and the following disclaimer.
8e169c
-# 2. Redistributions in binary form must reproduce the above copyright
8e169c
-#    notice, this list of conditions and the following disclaimer in the
8e169c
-#    documentation and/or other materials provided with the distribution.
8e169c
-# 3. The name of the author may not be used to endorse or promote products
8e169c
-#    derived from this software without specific prior written permission.
8e169c
-#
8e169c
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
8e169c
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
8e169c
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
8e169c
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8e169c
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8e169c
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8e169c
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8e169c
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8e169c
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8e169c
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8e169c
+# SPDX-License-Identifier: GPL-2.0-or-later
8e169c
 
8e169c
 . "${srcdir=.}/init.sh"
8e169c
+. "${srcdir=.}/PTRACE_SEIZE.sh"
8e169c
 
8e169c
 run_prog_skip_if_failed \
8e169c
 	kill -0 $$
8e169c
 
8e169c
 check_prog sleep
8e169c
 
8e169c
-$STRACE -d -enone / > /dev/null 2> "$LOG"
8e169c
-if grep -x "[^:]*strace: PTRACE_SEIZE doesn't work" "$LOG" > /dev/null; then
8e169c
-	skip_ "PTRACE_SEIZE doesn't work"
8e169c
-fi
8e169c
-
8e169c
 set -e
8e169c
 
8e169c
 > "$LOG"