]> granicus.if.org Git - strace/commitdiff
tests: tabulate read-write.test
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 19 Apr 2017 02:16:31 +0000 (02:16 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 19 Apr 2017 02:16:31 +0000 (02:16 +0000)
* tests/gen_tests.in (read-write): New entry.
* tests/read-write.c: (main): Skip the test if /proc/self/fd/
is not available.
* tests/read-write.test: Remove.
* tests/Makefile.am (DECODER_TESTS): Remove read-write.test.

tests/Makefile.am
tests/gen_tests.in
tests/read-write.c
tests/read-write.test [deleted file]

index 0ed8694c3ce1982851e0360b02338f4c27b6e012..9c4cc66f947a34fe1a344b5155946f3840dba4b8 100644 (file)
@@ -216,7 +216,6 @@ DECODER_TESTS = \
        prctl-tsc.test \
        pread64-pwrite64.test \
        qual_fault-exit_group.test \
-       read-write.test \
        readv.test \
        regex.test \
        sched.test \
index 2aa39436b17ec8b1afa42490d4a040a355b6b374..da105b46dfb578e06b56aae20e0a070d19521e80 100644 (file)
@@ -214,6 +214,7 @@ quotactl
 quotactl-v     -v -e trace=quotactl
 quotactl-xfs   -e trace=quotactl
 quotactl-xfs-v -v -e trace=quotactl
+read-write     -a15 -eread=0 -ewrite=1 -e trace=read,write -P read-write-tmpfile -P /dev/zero -P /dev/null
 readahead      -a1
 readdir        -a16
 readlink       -xx
index 262e07b5be6b153fb0ef30a39e19bbef0e50e03c..67a334e24eb5e67430b51ac1c1df02564119f535 100644 (file)
@@ -137,7 +137,9 @@ main(void)
 {
        tprintf("%s", "");
 
-       static char tmp[] = "read-write-tmpfile";
+       skip_if_unavailable("/proc/self/fd/");
+
+       static const char tmp[] = "read-write-tmpfile";
        if (open(tmp, O_CREAT|O_RDONLY|O_TRUNC, 0600) != 0)
                perror_msg_and_fail("creat: %s", tmp);
        if (open(tmp, O_WRONLY) != 1)
diff --git a/tests/read-write.test b/tests/read-write.test
deleted file mode 100755 (executable)
index 29bb4dc..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-# Check decoding and dumping of read and write syscalls.
-
-. "${srcdir=.}/init.sh"
-
-# strace -P is implemented using /proc/self/fd
-[ -d /proc/self/fd/ ] ||
-       framework_skip_ '/proc/self/fd/ is not available'
-
-tmpfile=read-write-tmpfile
-
-run_strace_match_diff \
-       -a15 -eread=0 -ewrite=1 -e trace=read,write \
-       -P $tmpfile -P /dev/zero -P /dev/null