]> granicus.if.org Git - strace/commitdiff
tests: check decoding of lchown syscall
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 16 Apr 2016 23:02:27 +0000 (23:02 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 18 Apr 2016 01:10:43 +0000 (01:10 +0000)
* tests/lchown.c: New file.
* tests/lchown.test: New test.
* tests/.gitignore: Add lchown.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add lchown.test.

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

index 49f20c677352f63908329cce0d13b50f375989a7..1e138b00d4e804dad7ae04a561c59001dcda9771 100644 (file)
@@ -69,6 +69,7 @@ ipc_sem
 ipc_shm
 ksysent
 ksysent.h
+lchown
 libtests.a
 linkat
 llseek
index 0888a5a85a9d4affa07d2199f014b1973bc39dfd..83e0f7bae1813a906376de303f6054069a5c328a 100644 (file)
@@ -120,6 +120,7 @@ check_PROGRAMS = \
        ipc_sem \
        ipc_shm \
        ksysent \
+       lchown \
        linkat \
        llseek \
        lseek \
@@ -326,6 +327,7 @@ DECODER_TESTS = \
        ipc_msgbuf.test \
        ipc_sem.test \
        ipc_shm.test \
+       lchown.test \
        linkat.test \
        llseek.test \
        lseek.test \
diff --git a/tests/lchown.c b/tests/lchown.c
new file mode 100644 (file)
index 0000000..a116901
--- /dev/null
@@ -0,0 +1,19 @@
+#include "tests.h"
+#include <sys/syscall.h>
+
+#ifdef __NR_lchown
+
+# define SYSCALL_NR __NR_lchown
+# define SYSCALL_NAME "lchown"
+
+# if defined __NR_lchown32 && __NR_lchown != __NR_lchown32
+#  define UGID_TYPE_IS_SHORT
+# endif
+
+# include "xchownx.c"
+
+#else
+
+SKIP_MAIN_UNDEFINED("__NR_lchown")
+
+#endif
diff --git a/tests/lchown.test b/tests/lchown.test
new file mode 100755 (executable)
index 0000000..ceeaa85
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# Check lchown syscall decoding.
+
+. "${srcdir=.}/init.sh"
+run_strace_match_diff -a30