From 12f6562f2b59fd9677a88a2d3aa646a6877a91bd Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Wed, 19 Apr 2017 02:16:31 +0000 Subject: [PATCH] tests: tabulate read-write.test * 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 | 1 - tests/gen_tests.in | 1 + tests/read-write.c | 4 +++- tests/read-write.test | 15 --------------- 4 files changed, 4 insertions(+), 17 deletions(-) delete mode 100755 tests/read-write.test diff --git a/tests/Makefile.am b/tests/Makefile.am index 0ed8694c..9c4cc66f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 \ diff --git a/tests/gen_tests.in b/tests/gen_tests.in index 2aa39436..da105b46 100644 --- a/tests/gen_tests.in +++ b/tests/gen_tests.in @@ -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 diff --git a/tests/read-write.c b/tests/read-write.c index 262e07b5..67a334e2 100644 --- a/tests/read-write.c +++ b/tests/read-write.c @@ -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 index 29bb4dc6..00000000 --- a/tests/read-write.test +++ /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