tests: add xattr.test
* tests/xattr.c: New file. * tests/xattr.expected: Likewise. * tests/xattr.test: New test. * tests/Makefile.am (check_PROGRAMS): Add xattr. (TESTS): Add xattr.test. (EXTRA_DIST): Add xattr.expected. * tests/.gitignore: Add xattr.
This commit is contained in:
parent
6156d81cef
commit
b60b2a5aa3
1
tests/.gitignore
vendored
1
tests/.gitignore
vendored
@ -33,6 +33,7 @@ uio
|
||||
umovestr
|
||||
umovestr2
|
||||
unix-pair-send-recv
|
||||
xattr
|
||||
*.log
|
||||
*.log.*
|
||||
*.o
|
||||
|
@ -43,7 +43,8 @@ check_PROGRAMS = \
|
||||
uio \
|
||||
umovestr \
|
||||
umovestr2 \
|
||||
unix-pair-send-recv
|
||||
unix-pair-send-recv \
|
||||
xattr
|
||||
|
||||
filter_unavailable_LDFLAGS = -pthread
|
||||
mmap64_CFLAGS = $(AM_CFLAGS) -D_FILE_OFFSET_BITS=64
|
||||
@ -94,6 +95,7 @@ TESTS = \
|
||||
uid16.test \
|
||||
uid32.test \
|
||||
uio.test \
|
||||
xattr.test \
|
||||
count.test \
|
||||
detach-sleeping.test \
|
||||
detach-stopped.test \
|
||||
@ -134,6 +136,7 @@ EXTRA_DIST = init.sh run.sh match.awk \
|
||||
umovestr.expected \
|
||||
unix-yy-accept.awk \
|
||||
unix-yy-connect.awk \
|
||||
xattr.expected \
|
||||
$(TESTS)
|
||||
|
||||
CLEANFILES = $(TESTS:=.tmp)
|
||||
|
27
tests/xattr.c
Normal file
27
tests/xattr.c
Normal file
@ -0,0 +1,27 @@
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_XATTR_H
|
||||
# include <sys/xattr.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
#define NAME "strace.test"
|
||||
#define VALUE "foo\0bar"
|
||||
if (!removexattr(".", NAME) ||
|
||||
!setxattr(".", NAME, VALUE, sizeof(VALUE), XATTR_CREATE))
|
||||
return 77;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
return 77;
|
||||
}
|
||||
|
||||
#endif
|
2
tests/xattr.expected
Normal file
2
tests/xattr.expected
Normal file
@ -0,0 +1,2 @@
|
||||
removexattr\("\.", "strace\.test"\) += -1 .*
|
||||
setxattr\("\.", "strace\.test", "foo\\0bar", 8, XATTR_CREATE\) += -1 .*
|
11
tests/xattr.test
Executable file
11
tests/xattr.test
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Check *xattr syscalls decoding.
|
||||
|
||||
. "${srcdir=.}/init.sh"
|
||||
|
||||
run_prog
|
||||
run_strace -e removexattr,setxattr $args
|
||||
match_grep
|
||||
|
||||
exit 0
|
Loading…
x
Reference in New Issue
Block a user