tests: make ioctl.test more flexible, use it for the rest of ioctl tests
authorEugene Syromyatnikov <evgsyr@gmail.com>
Thu, 25 Jan 2018 09:54:56 +0000 (10:54 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 25 Jan 2018 07:18:38 +0000 (07:18 +0000)
As the remaining non-generated ioctl tests differ from ioctl.test only
in strace options, and since gen_tests.sh can pass arguments to sourced
tests, replace the remaining non-generated ioctl tests with invocations
of ioctl.test with appropriate parameters.

* tests/ioctl.test: Pass script arguments to the strace invocation.
* tests/gen_tests.in (ioctl_dm): New entry, invoke ioctl.test with -s9.
(ioctl_dm-v): New entry, invoke ioctl.test with -v -s9.
(ioctl_kvm_run): New entry, invoke ioctl.test with -a36 -y.
(ioctl_loop-nv): New entry, invoke ioctl.test with -a22 -e verbose=none.
(ioctl_nsfs): New entry, invoke ioctl.test with -esignal=none.
(ioctl_sock_gifconf): New entry, invoke ioctl.test with -a28 -s1.
(ioctl_evdev-v, ioctl_loop-v, ioctl_rtc-v): Invoke ioctl.test
with -v option instead of ioctl-v.sh.
* tests/ioctl_dm-v.test: Remove.
* tests/ioctl_dm.test: Likewise.
* tests/ioctl_kvm_run.test: Likewise.
* tests/ioctl_loop-nv.test: Likewise.
* tests/ioctl_nsfs.test: Likewise.
* tests/ioctl_sock_gifconf.test: Likewise.
* tests/ioctl-v.sh: Likewise.
* tests/Makefile.am (DECODER_TESTS, EXTRA_DIST): Remove them.

tests/Makefile.am
tests/gen_tests.in
tests/ioctl-v.sh [deleted file]
tests/ioctl.test
tests/ioctl_dm-v.test [deleted file]
tests/ioctl_dm.test [deleted file]
tests/ioctl_kvm_run.test [deleted file]
tests/ioctl_loop-nv.test [deleted file]
tests/ioctl_nsfs.test [deleted file]
tests/ioctl_sock_gifconf.test [deleted file]

index 57bca00c55aa28e11ccca8c4850b368296444788..103a90dde772ffe9c5e18b7a33446b91aa4c9921 100644 (file)
@@ -219,12 +219,6 @@ DECODER_TESTS = \
        futex.test \
        getuid.test \
        ioctl.test \
-       ioctl_dm-v.test \
-       ioctl_dm.test \
-       ioctl_kvm_run.test \
-       ioctl_loop-nv.test \
-       ioctl_nsfs.test \
-       ioctl_sock_gifconf.test \
        ipc_msgbuf.test \
        llseek.test \
        lseek.test \
@@ -354,7 +348,6 @@ EXTRA_DIST = \
        getresugid.c \
        init.sh \
        init_delete_module.h \
-       ioctl-v.sh \
        ipc.sh \
        ipc_msgbuf.expected \
        ksysent.sed \
index 611d990811df541efa8c9e91f2a1c6914e6e5ee4..3116b00dfd6df674696baf729c76f08c4b9ab01b 100644 (file)
@@ -124,16 +124,22 @@ inotify   -a23 -e trace=inotify_add_watch,inotify_rm_watch
 inotify_init1  -a27
 int_0x80       -a11 -e trace=getgid32
 ioctl_block    +ioctl.test
+ioctl_dm       +ioctl.test -s9
+ioctl_dm-v     +ioctl.test -v -s9
 ioctl_evdev    +ioctl.test
-ioctl_evdev-v  +ioctl-v.sh
+ioctl_evdev-v  +ioctl.test -v
+ioctl_kvm_run  +ioctl.test -a36 -y
 ioctl_loop     +ioctl.test
-ioctl_loop-v   +ioctl-v.sh
+ioctl_loop-nv  +ioctl.test -a22 -e verbose=none
+ioctl_loop-v   +ioctl.test -v
 ioctl_mtd      +ioctl.test
+ioctl_nsfs     +ioctl.test -esignal=none
 ioctl_rtc      +ioctl.test
-ioctl_rtc-v    +ioctl-v.sh
+ioctl_rtc-v    +ioctl.test -v
 ioctl_scsi     +ioctl.test
 ioctl_sg_io_v3 +ioctl.test
 ioctl_sg_io_v4 +ioctl.test
+ioctl_sock_gifconf     +ioctl.test -a28 -s1
 ioctl_uffdio   +ioctl.test
 ioctl_v4l2     +ioctl.test
 ioperm -a27
diff --git a/tests/ioctl-v.sh b/tests/ioctl-v.sh
deleted file mode 100755 (executable)
index be89671..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-# Check non-abbreviated decoding of ioctls.
-
-. "${srcdir=.}/init.sh"
-
-check_prog grep
-run_prog > /dev/null
-run_strace -a16 -v -eioctl $args > "$EXP"
-grep -v '^ioctl([012],' < "$LOG" > "$OUT"
-match_diff "$OUT" "$EXP"
index 1eb469ee486df85c3747a2b3b80fd84f008b7375..cbbadc831b08cb63e61e656ce2ce1b7f239302d6 100755 (executable)
@@ -6,6 +6,6 @@
 
 check_prog grep
 run_prog > /dev/null
-run_strace -a16 -eioctl $args > "$EXP"
+run_strace -a16 -eioctl "$@" $args > "$EXP"
 grep -v '^ioctl([012],' < "$LOG" > "$OUT"
 match_diff "$OUT" "$EXP"
diff --git a/tests/ioctl_dm-v.test b/tests/ioctl_dm-v.test
deleted file mode 100755 (executable)
index eed37c2..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-# Check unabbreviated decoding of DM* ioctls.
-
-. "${srcdir=.}/init.sh"
-
-check_prog grep
-run_prog > /dev/null
-run_strace -a16 -s9 -veioctl $args > "$EXP"
-grep -v '^ioctl([012],' < "$LOG" > "$OUT"
-match_diff "$OUT" "$EXP"
diff --git a/tests/ioctl_dm.test b/tests/ioctl_dm.test
deleted file mode 100755 (executable)
index e9cca03..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-# Check decoding of DM* ioctls.
-
-. "${srcdir=.}/init.sh"
-
-check_prog grep
-run_prog > /dev/null
-run_strace -a16 -s9 -eioctl $args > "$EXP"
-grep -v '^ioctl([012],' < "$LOG" > "$OUT"
-match_diff "$OUT" "$EXP"
diff --git a/tests/ioctl_kvm_run.test b/tests/ioctl_kvm_run.test
deleted file mode 100755 (executable)
index a23cbeb..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-# Check decoding of KVM_* ioctl commands.
-
-. "${srcdir=.}/init.sh"
-
-check_prog grep
-run_prog > /dev/null
-run_strace -a36 -y -eioctl $args > "$EXP"
-grep -v '^ioctl([012],' < "$LOG" > "$OUT"
-match_diff "$OUT" "$EXP"
diff --git a/tests/ioctl_loop-nv.test b/tests/ioctl_loop-nv.test
deleted file mode 100755 (executable)
index 7d59cc2..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-# Check non-verbose decoding of LOOP_* ioctls.
-
-. "${srcdir=.}/init.sh"
-
-check_prog grep
-run_prog > /dev/null
-run_strace -a22 -eioctl -e verbose=none $args > "$EXP"
-grep -v '^ioctl([012],' < "$LOG" > "$OUT"
-match_diff "$OUT" "$EXP"
diff --git a/tests/ioctl_nsfs.test b/tests/ioctl_nsfs.test
deleted file mode 100755 (executable)
index acdfb61..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-# Check decoding of NS_* ioctls.
-
-. "${srcdir=.}/init.sh"
-
-check_prog grep
-run_prog > /dev/null
-run_strace -a16 -eioctl -esignal=none $args > "$EXP"
-grep -v '^ioctl([012],' < "$LOG" > "$OUT"
-match_diff "$OUT" "$EXP"
diff --git a/tests/ioctl_sock_gifconf.test b/tests/ioctl_sock_gifconf.test
deleted file mode 100755 (executable)
index 22d7ea4..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-# Check decoding of SIOCGIFCONF ioctl.
-
-. "${srcdir=.}/init.sh"
-
-check_prog grep
-run_prog > /dev/null
-run_strace -a28 -s1 -eioctl $args > "$EXP"
-grep -v '^ioctl([012],' < "$LOG" > "$OUT"
-match_diff "$OUT" "$EXP"