From: Dmitry V. Levin Date: Fri, 21 Apr 2017 01:29:29 +0000 (+0000) Subject: tests: tabulate regex.test X-Git-Tag: v4.17~55 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d29335184107252324a595df21078a138e2d2bdc;p=strace tests: tabulate regex.test Rewrite regex.test using test_trace_expr(). * tests/gen_tests.in (regex): New entry. * tests/regex.in: New file, derived from a set of tests in regex.test. * tests/regex.test: Remove. * tests/Makefile.am (DECODER_TESTS): Remove regex.test. (EXTRA_DIST): Add regex.in. --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 78889d13..67b381d6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -215,7 +215,6 @@ DECODER_TESTS = \ prctl-tsc.test \ qual_fault-exit_group.test \ readv.test \ - regex.test \ sched.test \ scm_rights-fd.test \ seccomp-strict.test \ @@ -318,6 +317,7 @@ EXTRA_DIST = \ qual_inject-error-signal.expected \ qual_inject-signal.expected \ quotactl.h \ + regex.in \ run.sh \ scno_tampering.sh \ setfsugid.c \ diff --git a/tests/gen_tests.in b/tests/gen_tests.in index e715c086..d3096ebc 100644 --- a/tests/gen_tests.in +++ b/tests/gen_tests.in @@ -225,6 +225,7 @@ reboot recvfrom -a35 recvmmsg-timeout -a25 -e trace=recvmmsg recvmsg -eread=0 -ewrite=1 -e trace=recvmsg,sendmsg +regex test_trace_expr '' -etrace='/^(.*_)?statv?fs' remap_file_pages rename -a35 renameat diff --git a/tests/regex.in b/tests/regex.in new file mode 100755 index 00000000..7c4adfe1 --- /dev/null +++ b/tests/regex.in @@ -0,0 +1,2 @@ +statfs -a17 +statfs64 -a23 diff --git a/tests/regex.test b/tests/regex.test deleted file mode 100755 index 64c1b3a6..00000000 --- a/tests/regex.test +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# -# Check -e trace=/regex option. -# -# Copyright (c) 2017 The strace developers. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -. "${srcdir=.}/init.sh" - -while read w s; do { - try_run_prog "../$s" || continue - run_strace -a$w -etrace='/^(.*_)?statv?fs' ../$s > "$EXP" - match_diff "$LOG" "$EXP" -} < /dev/null; done << EOF -17 statfs -23 statfs64 -EOF - -grep -E -v '^(#|statfs)' \ - < "$srcdir/pure_executables.list" > negative.list - -while read s; do { - try_run_prog "../$s" || continue - run_strace -qq -esignal=none -etrace='/^(.*_)?statv?fs' ../$s > /dev/null - match_diff "$LOG" /dev/null -} < /dev/null; done < negative.list