tests: move /proc/ checks from scripts to executables
Move most of /proc/self/task/ and /proc/self/fd/ checks from scripts to xecutables. * tests/attach-f-p.test: Move /proc/self/task/ check ... * tests/attach-f-p-cmd.c (main): ... here. * tests/fstat.test: Move /proc/self/fd/ check ... * tests/xstatx.c (main): ... here. * tests/net-y-unix.test: Move /proc/self/fd/ check ... * tests/net-y-unix.c (main): ... here. * tests/net-yy-inet.test: Move /proc/self/fd/ check ... * tests/net-yy-inet.c (main): ... here. * tests/net-yy-netlink.test: Move /proc/self/fd/ check ... * tests/net-yy-netlink.c (main): ... here. * tests/net-yy-unix.test: Move /proc/self/fd/ check ... * tests/net-yy-unix.c (main): ... here.
This commit is contained in:
parent
db1f9c58e1
commit
c79792293b
@ -34,6 +34,8 @@
|
|||||||
int
|
int
|
||||||
main(void)
|
main(void)
|
||||||
{
|
{
|
||||||
|
skip_if_unavailable("/proc/self/task/");
|
||||||
|
|
||||||
static const char dir[] = "attach-f-p.test cmd";
|
static const char dir[] = "attach-f-p.test cmd";
|
||||||
pid_t pid = getpid();
|
pid_t pid = getpid();
|
||||||
int rc = chdir(dir);
|
int rc = chdir(dir);
|
||||||
|
@ -29,9 +29,6 @@
|
|||||||
|
|
||||||
. "${srcdir=.}/init.sh"
|
. "${srcdir=.}/init.sh"
|
||||||
|
|
||||||
# strace -f -p is implemented using /proc/$pid/task/
|
|
||||||
[ -d /proc/self/task/ ] ||
|
|
||||||
framework_skip_ '/proc/self/task/ is not available'
|
|
||||||
run_prog_skip_if_failed \
|
run_prog_skip_if_failed \
|
||||||
kill -0 $$
|
kill -0 $$
|
||||||
run_prog ../attach-f-p-cmd > /dev/null
|
run_prog ../attach-f-p-cmd > /dev/null
|
||||||
|
@ -4,10 +4,6 @@
|
|||||||
|
|
||||||
. "${srcdir=.}/init.sh"
|
. "${srcdir=.}/init.sh"
|
||||||
|
|
||||||
# strace -P is implemented using /proc/self/fd
|
|
||||||
[ -d /proc/self/fd/ ] ||
|
|
||||||
framework_skip_ '/proc/self/fd/ is not available'
|
|
||||||
|
|
||||||
syscall=$NAME
|
syscall=$NAME
|
||||||
run_prog > /dev/null
|
run_prog > /dev/null
|
||||||
sample=$syscall.sample
|
sample=$syscall.sample
|
||||||
|
@ -43,6 +43,8 @@
|
|||||||
int
|
int
|
||||||
main(void)
|
main(void)
|
||||||
{
|
{
|
||||||
|
skip_if_unavailable("/proc/self/fd/");
|
||||||
|
|
||||||
static const struct sockaddr_un addr = {
|
static const struct sockaddr_un addr = {
|
||||||
.sun_family = AF_UNIX,
|
.sun_family = AF_UNIX,
|
||||||
.sun_path = TEST_SOCKET
|
.sun_path = TEST_SOCKET
|
||||||
|
@ -29,13 +29,9 @@
|
|||||||
|
|
||||||
. "${srcdir=.}/init.sh"
|
. "${srcdir=.}/init.sh"
|
||||||
|
|
||||||
# strace -y is implemented using /proc/self/fd
|
|
||||||
[ -d /proc/self/fd/ ] ||
|
|
||||||
framework_skip_ '/proc/self/fd/ is not available'
|
|
||||||
|
|
||||||
check_prog sed
|
check_prog sed
|
||||||
|
|
||||||
run_prog "../$NAME" > /dev/null
|
run_prog > /dev/null
|
||||||
run_strace -a20 -y -eclose,network $args > "$EXP"
|
run_strace -a20 -y -eclose,network $args > "$EXP"
|
||||||
|
|
||||||
# Filter out close() calls made by ld.so and libc.
|
# Filter out close() calls made by ld.so and libc.
|
||||||
|
@ -41,6 +41,8 @@
|
|||||||
int
|
int
|
||||||
main(void)
|
main(void)
|
||||||
{
|
{
|
||||||
|
skip_if_unavailable("/proc/self/fd/");
|
||||||
|
|
||||||
const struct sockaddr_in addr = {
|
const struct sockaddr_in addr = {
|
||||||
.sin_family = AF_INET,
|
.sin_family = AF_INET,
|
||||||
.sin_addr.s_addr = htonl(INADDR_LOOPBACK)
|
.sin_addr.s_addr = htonl(INADDR_LOOPBACK)
|
||||||
|
@ -29,14 +29,10 @@
|
|||||||
|
|
||||||
. "${srcdir=.}/init.sh"
|
. "${srcdir=.}/init.sh"
|
||||||
|
|
||||||
# strace -yy is implemented using /proc/self/fd
|
|
||||||
[ -d /proc/self/fd/ ] ||
|
|
||||||
framework_skip_ '/proc/self/fd/ is not available'
|
|
||||||
|
|
||||||
check_prog sed
|
check_prog sed
|
||||||
|
|
||||||
run_prog ../netlink_inet_diag
|
run_prog ../netlink_inet_diag
|
||||||
run_prog "../$NAME" > /dev/null
|
run_prog > /dev/null
|
||||||
run_strace -a22 -yy -eclose,network $args > "$EXP"
|
run_strace -a22 -yy -eclose,network $args > "$EXP"
|
||||||
|
|
||||||
# Filter out close() calls made by ld.so and libc.
|
# Filter out close() calls made by ld.so and libc.
|
||||||
|
@ -47,6 +47,8 @@
|
|||||||
int
|
int
|
||||||
main(void)
|
main(void)
|
||||||
{
|
{
|
||||||
|
skip_if_unavailable("/proc/self/fd/");
|
||||||
|
|
||||||
struct sockaddr_nl addr = {
|
struct sockaddr_nl addr = {
|
||||||
.nl_family = AF_NETLINK,
|
.nl_family = AF_NETLINK,
|
||||||
.nl_pid = getpid()
|
.nl_pid = getpid()
|
||||||
|
@ -32,14 +32,10 @@
|
|||||||
|
|
||||||
. "${srcdir=.}/init.sh"
|
. "${srcdir=.}/init.sh"
|
||||||
|
|
||||||
# strace -yy is implemented using /proc/self/fd
|
|
||||||
[ -d /proc/self/fd/ ] ||
|
|
||||||
framework_skip_ '/proc/self/fd/ is not available'
|
|
||||||
|
|
||||||
check_prog sed
|
check_prog sed
|
||||||
|
|
||||||
run_prog ../netlink_netlink_diag
|
run_prog ../netlink_netlink_diag
|
||||||
run_prog "../$NAME" > /dev/null
|
run_prog > /dev/null
|
||||||
run_strace -a22 -yy -eclose,network $args > "$EXP"
|
run_strace -a22 -yy -eclose,network $args > "$EXP"
|
||||||
|
|
||||||
# Filter out close() calls made by ld.so and libc.
|
# Filter out close() calls made by ld.so and libc.
|
||||||
|
@ -43,6 +43,8 @@
|
|||||||
int
|
int
|
||||||
main(void)
|
main(void)
|
||||||
{
|
{
|
||||||
|
skip_if_unavailable("/proc/self/fd/");
|
||||||
|
|
||||||
struct sockaddr_un addr = {
|
struct sockaddr_un addr = {
|
||||||
.sun_family = AF_UNIX,
|
.sun_family = AF_UNIX,
|
||||||
.sun_path = TEST_SOCKET
|
.sun_path = TEST_SOCKET
|
||||||
|
@ -31,14 +31,10 @@
|
|||||||
|
|
||||||
. "${srcdir=.}/init.sh"
|
. "${srcdir=.}/init.sh"
|
||||||
|
|
||||||
# strace -yy is implemented using /proc/self/fd
|
|
||||||
[ -d /proc/self/fd/ ] ||
|
|
||||||
framework_skip_ '/proc/self/fd/ is not available'
|
|
||||||
|
|
||||||
check_prog sed
|
check_prog sed
|
||||||
|
|
||||||
run_prog ../netlink_unix_diag
|
run_prog ../netlink_unix_diag
|
||||||
run_prog "../$NAME" > /dev/null
|
run_prog > /dev/null
|
||||||
run_strace -a22 -yy -eclose,network $args > "$EXP"
|
run_strace -a22 -yy -eclose,network $args > "$EXP"
|
||||||
|
|
||||||
# Filter out close() calls made by ld.so and libc.
|
# Filter out close() calls made by ld.so and libc.
|
||||||
|
@ -267,7 +267,9 @@ create_sample(const char *fname, const libc_off_t size)
|
|||||||
int
|
int
|
||||||
main(void)
|
main(void)
|
||||||
{
|
{
|
||||||
# if !IS_FSTAT
|
# if IS_FSTAT
|
||||||
|
skip_if_unavailable("/proc/self/fd/");
|
||||||
|
# else
|
||||||
static const char full[] = "/dev/full";
|
static const char full[] = "/dev/full";
|
||||||
# endif
|
# endif
|
||||||
static const char sample[] = TEST_SYSCALL_STR ".sample";
|
static const char sample[] = TEST_SYSCALL_STR ".sample";
|
||||||
|
Loading…
Reference in New Issue
Block a user