]> granicus.if.org Git - strace/commitdiff
tests: add lstat.test and lstat64.test
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 5 Dec 2015 00:03:02 +0000 (00:03 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 5 Dec 2015 00:03:02 +0000 (00:03 +0000)
* tests/lstat.c: New file.
* tests/lstat64.c: Likewise.
* tests/lstatx.c: Likewise.
* tests/lstat.test: New test.
* tests/lstat64.test: Likewise.
* tests/Makefile.am (check_PROGRAMS): Add lstat and lstat64.
(lstat64_CFLAGS): Define.
(TESTS): Add lstat.test and lstat64.test.
(EXTRA_DIST): Add lstatx.c.
* tests/.gitignore: Add lstat and lstat64.

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

index ffd3bf6c8b0d6258f6bbba3bf38a5faa73d29013..69b09830fef9400d26e76a337095adf6d3599bbb 100644 (file)
@@ -29,6 +29,8 @@ ipc_sem
 ipc_shm
 llseek
 lseek
+lstat
+lstat64
 membarrier
 memfd_create
 mlock2
index fdbf3f081b50d6ab7d78844457eec28ef14d4ade..85fc147e5dbcebc42fc47d1f960535be4d6574d7 100644 (file)
@@ -42,6 +42,8 @@ check_PROGRAMS = \
        ipc_shm \
        llseek \
        lseek \
+       lstat \
+       lstat64 \
        membarrier \
        memfd_create \
        mlock2 \
@@ -111,6 +113,7 @@ filter_unavailable_LDADD = -lpthread
 fstat64_CFLAGS = $(AM_CFLAGS) -D_FILE_OFFSET_BITS=64
 fstatat64_CFLAGS = $(AM_CFLAGS) -D_FILE_OFFSET_BITS=64
 ftruncate64_CFLAGS = $(AM_CFLAGS) -D_FILE_OFFSET_BITS=64
+lstat64_CFLAGS = $(AM_CFLAGS) -D_FILE_OFFSET_BITS=64
 mmap64_CFLAGS = $(AM_CFLAGS) -D_FILE_OFFSET_BITS=64
 mq_LDADD = -lrt
 newfstatat_CFLAGS = $(AM_CFLAGS) -D_FILE_OFFSET_BITS=64
@@ -158,6 +161,8 @@ TESTS = \
        ipc_sem.test \
        llseek.test \
        lseek.test \
+       lstat.test \
+       lstat64.test \
        mq.test \
        pselect6.test \
        readdir.test \
@@ -247,6 +252,7 @@ EXTRA_DIST = init.sh run.sh match.awk \
             ip_mreq.expected \
             ipc.sh \
             ipc_msgbuf.expected \
+            lstatx.c \
             memfd_create.expected \
             mmsg.expected \
             mq.expected \
diff --git a/tests/lstat.c b/tests/lstat.c
new file mode 100644 (file)
index 0000000..d759dd3
--- /dev/null
@@ -0,0 +1,13 @@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <sys/syscall.h>
+
+#undef TEST_SYSCALL_NAME
+#ifdef __NR_lstat
+# define TEST_SYSCALL_NAME lstat
+# define SAMPLE_SIZE ((kernel_ulong_t) 43147718418)
+#endif
+
+#include "lstatx.c"
diff --git a/tests/lstat.test b/tests/lstat.test
new file mode 100755 (executable)
index 0000000..f513bb4
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# Check lstat syscall decoding.
+
+. "${srcdir=.}/statx.sh"
diff --git a/tests/lstat64.c b/tests/lstat64.c
new file mode 100644 (file)
index 0000000..4c0713f
--- /dev/null
@@ -0,0 +1,14 @@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <sys/syscall.h>
+
+#undef TEST_SYSCALL_NAME
+#ifdef __NR_lstat64
+# define TEST_SYSCALL_NAME lstat64
+# define STRUCT_STAT struct stat64
+# define SAMPLE_SIZE ((libc_off_t) 43147718418)
+#endif
+
+#include "lstatx.c"
diff --git a/tests/lstat64.test b/tests/lstat64.test
new file mode 100755 (executable)
index 0000000..fcafe79
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# Check lstat64 syscall decoding.
+
+. "${srcdir=.}/statx.sh"
diff --git a/tests/lstatx.c b/tests/lstatx.c
new file mode 100644 (file)
index 0000000..d2bd636
--- /dev/null
@@ -0,0 +1,14 @@
+#define TEST_SYSCALL_INVOKE(sample, pst) \
+       syscall(TEST_SYSCALL_NR, sample, pst)
+#define PRINT_SYSCALL_HEADER(sample) \
+       printf("%s(\"%s\", ", TEST_SYSCALL_STR, sample)
+#define PRINT_SYSCALL_FOOTER \
+       puts(") = 0")
+
+#define TEST_SYSCALL_NR nrify(TEST_SYSCALL_NAME)
+#define nrify(arg) nrify_(arg)
+#define nrify_(arg) __NR_ ## arg
+
+#define USE_ASM_STAT
+
+#include "xstatx.c"