From c4fdce5ceaabc559d6a21b42a05ac3695e505853 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sat, 30 Jul 2016 22:52:27 +0000 Subject: [PATCH] memfd_create.test: rewrite from match_grep to match_diff * tests/memfd_create.c (main): Print expected output. * tests/memfd_create.test: Use run_strace_match_diff. * tests/memfd_create.expected: Remove. * tests/Makefile.am (EXTRA_DIST): Remove it. --- tests/Makefile.am | 1 - tests/memfd_create.c | 12 ++++++++++-- tests/memfd_create.expected | 1 - tests/memfd_create.test | 9 ++------- 4 files changed, 12 insertions(+), 11 deletions(-) delete mode 100644 tests/memfd_create.expected diff --git a/tests/Makefile.am b/tests/Makefile.am index 1e99c44a..099638c9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -738,7 +738,6 @@ EXTRA_DIST = init.sh run.sh match.awk \ ipc_msgbuf.expected \ ksysent.sed \ lstatx.c \ - memfd_create.expected \ mq.expected \ net.expected \ oldselect.expected \ diff --git a/tests/memfd_create.c b/tests/memfd_create.c index 9fe7f6d4..2b1bd026 100644 --- a/tests/memfd_create.c +++ b/tests/memfd_create.c @@ -1,13 +1,21 @@ #include "tests.h" -#include #include #ifdef __NR_memfd_create +# include +# include + int main(void) { - syscall(__NR_memfd_create, "strace", 7); + static const char text[] = "strace"; + int rc = syscall(__NR_memfd_create, text, 7); + + printf("memfd_create(\"%s\", %s) = %d %s (%m)\n", + text, "MFD_CLOEXEC|MFD_ALLOW_SEALING|0x4", rc, errno2name()); + + puts("+++ exited with 0 +++"); return 0; } diff --git a/tests/memfd_create.expected b/tests/memfd_create.expected deleted file mode 100644 index 6fb938fd..00000000 --- a/tests/memfd_create.expected +++ /dev/null @@ -1 +0,0 @@ -memfd_create\("strace", MFD_CLOEXEC\|MFD_ALLOW_SEALING\|0x4\) += -1 .* diff --git a/tests/memfd_create.test b/tests/memfd_create.test index 6a34fc13..4361dae4 100755 --- a/tests/memfd_create.test +++ b/tests/memfd_create.test @@ -1,11 +1,6 @@ #!/bin/sh -# Check memfd_create syscall decoding. +# Check decoding of memfd_create syscall. . "${srcdir=.}/init.sh" - -run_prog -run_strace -e memfd_create $args -match_grep - -exit 0 +run_strace_match_diff