From: Dmitry V. Levin Date: Sat, 5 Dec 2015 00:03:02 +0000 (+0000) Subject: tests: add lstat.test and lstat64.test X-Git-Tag: v4.11~63 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=38e37686f20a7ed354f4f8d1eb5dcbf822c4d8bd;p=strace tests: add lstat.test and lstat64.test * 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. --- diff --git a/tests/.gitignore b/tests/.gitignore index ffd3bf6c..69b09830 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -29,6 +29,8 @@ ipc_sem ipc_shm llseek lseek +lstat +lstat64 membarrier memfd_create mlock2 diff --git a/tests/Makefile.am b/tests/Makefile.am index fdbf3f08..85fc147e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 index 00000000..d759dd39 --- /dev/null +++ b/tests/lstat.c @@ -0,0 +1,13 @@ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include + +#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 index 00000000..f513bb48 --- /dev/null +++ b/tests/lstat.test @@ -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 index 00000000..4c0713f8 --- /dev/null +++ b/tests/lstat64.c @@ -0,0 +1,14 @@ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include + +#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 index 00000000..fcafe79d --- /dev/null +++ b/tests/lstat64.test @@ -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 index 00000000..d2bd636c --- /dev/null +++ b/tests/lstatx.c @@ -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"