tests: add setdomainname.test

* tests/setdomainname.c: New file.
* tests/setdomainname.test: New test.
* tests/.gitignore: Add setdomainname.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setdomainname.test.
This commit is contained in:
Fei Jie 2016-04-25 16:18:21 +08:00 committed by Dmitry V. Levin
parent cd61c9f3e4
commit 7f05113624
4 changed files with 33 additions and 0 deletions

1
tests/.gitignore vendored
View File

@ -166,6 +166,7 @@ semop
sendfile
sendfile64
set_ptracer_any
setdomainname
setfsgid
setfsgid32
setfsuid

View File

@ -217,6 +217,7 @@ check_PROGRAMS = \
sendfile \
sendfile64 \
set_ptracer_any \
setdomainname \
setfsgid \
setfsgid32 \
setfsuid \
@ -464,6 +465,7 @@ DECODER_TESTS = \
semop.test \
sendfile.test \
sendfile64.test \
setdomainname.test \
setfsgid.test \
setfsgid32.test \
setfsuid.test \

24
tests/setdomainname.c Normal file
View File

@ -0,0 +1,24 @@
#include "tests.h"
#include <sys/syscall.h>
#ifdef __NR_setdomainname
# include <stdio.h>
# include <unistd.h>
int
main(void)
{
long rc = syscall(__NR_setdomainname, 0, 63);
printf("setdomainname(NULL, 63) = %ld %s (%m)\n",
rc, errno2name());
puts("+++ exited with 0 +++");
return 0;
}
#else
SKIP_MAIN_UNDEFINED("__NR_setdomainname")
#endif

6
tests/setdomainname.test Executable file
View File

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