From 506a42f8c3058fc1c06ebfdbaf686474515fa297 Mon Sep 17 00:00:00 2001 From: Fei Jie Date: Mon, 25 Apr 2016 16:18:22 +0800 Subject: [PATCH] tests: add rmdir.test * tests/rmdir.c: New file. * tests/rmdir.test: New test. * tests/.gitignore: Add rmdir. * tests/Makefile.am (check_PROGRAMS): Likewise. (DECODER_TESTS): Add rmdir.test. --- tests/.gitignore | 1 + tests/Makefile.am | 2 ++ tests/rmdir.c | 25 +++++++++++++++++++++++++ tests/rmdir.test | 6 ++++++ 4 files changed, 34 insertions(+) create mode 100644 tests/rmdir.c create mode 100755 tests/rmdir.test diff --git a/tests/.gitignore b/tests/.gitignore index b263ac98..b05c68ad 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -145,6 +145,7 @@ recvmsg rename renameat restart_syscall +rmdir rt_sigpending rt_sigprocmask rt_sigqueueinfo diff --git a/tests/Makefile.am b/tests/Makefile.am index c53bc66e..92d43104 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -196,6 +196,7 @@ check_PROGRAMS = \ rename \ renameat\ restart_syscall \ + rmdir \ rt_sigpending \ rt_sigprocmask \ rt_sigqueueinfo \ @@ -445,6 +446,7 @@ DECODER_TESTS = \ recvmsg.test \ rename.test \ renameat.test \ + rmdir.test \ rt_sigpending.test \ rt_sigprocmask.test \ rt_sigqueueinfo.test \ diff --git a/tests/rmdir.c b/tests/rmdir.c new file mode 100644 index 00000000..e5a7f1d1 --- /dev/null +++ b/tests/rmdir.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_rmdir + +# include +# include + +int +main(void) +{ + static const char sample[] = "rmdir_sample"; + long rc = syscall(__NR_rmdir, sample); + printf("rmdir(\"%s\") = %ld %s (%m)\n", + sample, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_rmdir") + +#endif diff --git a/tests/rmdir.test b/tests/rmdir.test new file mode 100755 index 00000000..81ee66b8 --- /dev/null +++ b/tests/rmdir.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check rmdir syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -- 2.40.0