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.
This commit is contained in:
Дмитрий Левин 2015-12-05 00:03:02 +00:00
parent c863827ddb
commit 38e37686f2
7 changed files with 59 additions and 0 deletions

2
tests/.gitignore vendored
View File

@ -29,6 +29,8 @@ ipc_sem
ipc_shm
llseek
lseek
lstat
lstat64
membarrier
memfd_create
mlock2

View 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 \

13
tests/lstat.c Normal file
View File

@ -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"

5
tests/lstat.test Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
# Check lstat syscall decoding.
. "${srcdir=.}/statx.sh"

14
tests/lstat64.c Normal file
View File

@ -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"

5
tests/lstat64.test Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
# Check lstat64 syscall decoding.
. "${srcdir=.}/statx.sh"

14
tests/lstatx.c Normal file
View File

@ -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"