From: Dmitry V. Levin Date: Fri, 21 Apr 2017 01:29:29 +0000 (+0000) Subject: tests: tabulate sched.test X-Git-Tag: v4.17~54 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=adf9387ae31842fcd0bc746c8c58ad12e922c891;p=strace tests: tabulate sched.test Rewrite sched.test using test_trace_expr(). * tests/gen_tests.in (sched): New entry. * tests/sched.in: New file, derived from a set of tests in sched.test. * tests/sched.test: Remove. * tests/Makefile.am (DECODER_TESTS): Remove sched.test. (EXTRA_DIST): Add sched.in. --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 67b381d6..ee708fd7 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 \ - sched.test \ scm_rights-fd.test \ seccomp-strict.test \ sigaction.test \ @@ -319,6 +318,7 @@ EXTRA_DIST = \ quotactl.h \ regex.in \ run.sh \ + sched.in \ scno_tampering.sh \ setfsugid.c \ setresugid.c \ diff --git a/tests/gen_tests.in b/tests/gen_tests.in index d3096ebc..ddcb8f7d 100644 --- a/tests/gen_tests.in +++ b/tests/gen_tests.in @@ -239,6 +239,7 @@ rt_sigreturn -esignal='!USR1' rt_sigsuspend -a20 -esignal=none rt_sigtimedwait -a38 rt_tgsigqueueinfo -esignal=none +sched test_trace_expr times -e/sched sched_get_priority_mxx -a33 -e trace=sched_get_priority_min,sched_get_priority_max sched_rr_get_interval -a31 sched_xetaffinity -a28 -e trace=sched_getaffinity,sched_setaffinity diff --git a/tests/sched.in b/tests/sched.in new file mode 100755 index 00000000..46031d6c --- /dev/null +++ b/tests/sched.in @@ -0,0 +1,7 @@ +sched_xetaffinity -a28 +sched_xetparam -a23 +sched_rr_get_interval -a31 +sched_get_priority_mxx -a33 +sched_xetattr -a29 +sched_xetscheduler -a22 +sched_yield -a14 diff --git a/tests/sched.test b/tests/sched.test deleted file mode 100755 index 4b145010..00000000 --- a/tests/sched.test +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# Check how scheduler-related syscalls are traced. -# -# 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 -e/sched ../$s > "$EXP" - match_diff "$LOG" "$EXP" -} < /dev/null; done << EOF -28 sched_xetaffinity -23 sched_xetparam -31 sched_rr_get_interval -33 sched_get_priority_mxx -29 sched_xetattr -22 sched_xetscheduler -14 sched_yield -EOF - -grep -E -v '^(#|sched_|times$)' \ - < "$srcdir/pure_executables.list" > negative.list - -while read s; do { - try_run_prog "../$s" || continue - run_strace -qq -esignal=none -e/sched ../$s > /dev/null - match_diff "$LOG" /dev/null -} < /dev/null; done < negative.list