tests: extend test coverage of setgid32 syscall

* tests/setgid32.c: New file.
* tests/setgid32.test: New test.
* tests/.gitignore: Add setgid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setgid32.test.
This commit is contained in:
Дмитрий Левин 2016-04-18 13:46:47 +00:00
parent cf273016fe
commit 6511b2df01
4 changed files with 26 additions and 0 deletions

1
tests/.gitignore vendored
View File

@ -143,6 +143,7 @@ sendfile
sendfile64
set_ptracer_any
setgid
setgid32
sethostname
setuid
setuid32

View File

@ -193,6 +193,7 @@ check_PROGRAMS = \
sendfile64 \
set_ptracer_any \
setgid \
setgid32 \
sethostname \
setuid \
setuid32 \
@ -403,6 +404,7 @@ DECODER_TESTS = \
sendfile.test \
sendfile64.test \
setgid.test \
setgid32.test \
sethostname.test \
setuid.test \
setuid32.test \

17
tests/setgid32.c Normal file
View File

@ -0,0 +1,17 @@
#include "tests.h"
#include <sys/syscall.h>
#ifdef __NR_setgid32
# define SYSCALL_NR __NR_setgid32
# define SYSCALL_NAME "setgid32"
# define UGID_TYPE int
# define GETUGID getegid()
# define CHECK_OVERFLOWUGID(arg)
# include "setugid.c"
#else
SKIP_MAIN_UNDEFINED("__NR_setgid32")
#endif

6
tests/setgid32.test Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
# Check setgid32 syscall decoding.
. "${srcdir=.}/init.sh"
run_strace_match_diff -a12