]> granicus.if.org Git - strace/commitdiff
tests: check decoding of fchown syscall
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 17 Apr 2016 22:24:41 +0000 (22:24 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 18 Apr 2016 01:10:44 +0000 (01:10 +0000)
* tests/fchown.c: New file.
* tests/fchown.test: New test.
* tests/.gitignore: Add fchown.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add fchown.test.

tests/.gitignore
tests/Makefile.am
tests/fchown.c [new file with mode: 0644]
tests/fchown.test [new file with mode: 0755]

index 99411f2078c6d40f7c02109e698377467f73cdbb..5bb8b590697db6cdf3fc657ecf776ec0cb3228e2 100644 (file)
@@ -40,6 +40,7 @@ faccessat
 fanotify_mark
 fchmod
 fchmodat
+fchown
 fchownat
 fcntl
 fcntl64
index 823fc0a5949a61300dc33a050417e9debc5b5ebb..2e576c3643b0e1c4832b4114669944de5b83682f 100644 (file)
@@ -92,6 +92,7 @@ check_PROGRAMS = \
        fanotify_mark \
        fchmod \
        fchmodat \
+       fchown \
        fchownat \
        fcntl \
        fcntl64 \
@@ -303,6 +304,7 @@ DECODER_TESTS = \
        fanotify_mark.test \
        fchmod.test \
        fchmodat.test \
+       fchown.test \
        fchownat.test \
        fcntl.test \
        fcntl64.test \
diff --git a/tests/fchown.c b/tests/fchown.c
new file mode 100644 (file)
index 0000000..53a522e
--- /dev/null
@@ -0,0 +1,20 @@
+#include "tests.h"
+#include <sys/syscall.h>
+
+#ifdef __NR_fchown
+
+# define SYSCALL_NR __NR_fchown
+# define SYSCALL_NAME "fchown"
+# define ACCESS_BY_DESCRIPTOR
+
+# if defined __NR_fchown32 && __NR_fchown != __NR_fchown32
+#  define UGID_TYPE_IS_SHORT
+# endif
+
+# include "xchownx.c"
+
+#else
+
+SKIP_MAIN_UNDEFINED("__NR_fchown")
+
+#endif
diff --git a/tests/fchown.test b/tests/fchown.test
new file mode 100755 (executable)
index 0000000..63a0f2e
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# Check fchown syscall decoding.
+
+. "${srcdir=.}/init.sh"
+run_strace_match_diff -a16