diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2021-07-05 16:11:53 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2021-07-05 16:11:53 +0000 |
commit | f04adc00e223b50e776145c0ac0a45f496e77599 (patch) | |
tree | 1d699b9b7a8688a253435a90b5fa52841a121d1b | |
parent | 59504c6567741c600979138f5574b7c71411370a (diff) |
Write ktrace output files onto NFS mounted file systems.
-rw-r--r-- | regress/sys/nfs/LICENSE | 2 | ||||
-rw-r--r-- | regress/sys/nfs/Makefile | 29 | ||||
-rw-r--r-- | regress/sys/nfs/README | 5 |
3 files changed, 33 insertions, 3 deletions
diff --git a/regress/sys/nfs/LICENSE b/regress/sys/nfs/LICENSE index 86aa7cbdc83..0cfd9cd3761 100644 --- a/regress/sys/nfs/LICENSE +++ b/regress/sys/nfs/LICENSE @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Alexander Bluhm <bluhm@openbsd.org> + * Copyright (c) 2017-2021 Alexander Bluhm <bluhm@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/regress/sys/nfs/Makefile b/regress/sys/nfs/Makefile index 5886c8f089e..90d0f8417ee 100644 --- a/regress/sys/nfs/Makefile +++ b/regress/sys/nfs/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.8 2020/12/16 21:49:20 bluhm Exp $ +# $OpenBSD: Makefile,v 1.9 2021/07/05 16:11:52 bluhm Exp $ PROGS= mmap-sysctl-copyin mmap-sysctl-copyout CLEANFILES= diskimage @@ -34,6 +34,7 @@ REGRESS_CLEANUP+= killnc killnc: -pkill -xf "nc -U -v -l /mnt/regress-nfs-client/socket-stream" || true -pkill -xf "nc -Uu -v -l /mnt/regress-nfs-client/socket-dgram" || true + -pkill -xf "nc -n -v -l 127.0.0.1 0" || true REGRESS_CLEANUP+= umount umount: @@ -80,4 +81,30 @@ run-socket-${socktype}: .endif .endfor +REGRESS_TARGETS+= run-ktrace-true +run-ktrace-true: + ktrace -f /mnt/regress-nfs-client/true.ktrace /usr/bin/true + sync + kdump -f /mnt/regress-nfs-client/true.ktrace |\ + fgrep 'true CALL exit(0)' + +REGRESS_TARGETS+= run-ktrace-netcat +run-ktrace-netcat: + echo foo | \ + ktrace -f /mnt/regress-nfs-client/netcat-server.ktrace \ + nc -n -v -l 127.0.0.1 0 2>server.log & + # Wait until netcat is listening. + for i in `jot 30`; do\ + if fgrep -q Listening server.log; then break; fi; sleep .1; done + fgrep Listening server.log + echo bar | \ + ktrace -f /mnt/regress-nfs-client/netcat-client.ktrace \ + nc -n -v -N 127.0.0.1 \ + `sed -n 's/Listening on 127.0.0.1 //p' server.log` 2>client.log + fgrep Connection client.log + kdump -f /mnt/regress-nfs-client/netcat-server.ktrace |\ + fgrep 'nc CALL exit(0)' + kdump -f /mnt/regress-nfs-client/netcat-client.ktrace |\ + fgrep 'nc CALL exit(0)' + .include <bsd.regress.mk> diff --git a/regress/sys/nfs/README b/regress/sys/nfs/README index 02cd469e717..1519ab6f8fb 100644 --- a/regress/sys/nfs/README +++ b/regress/sys/nfs/README @@ -1,7 +1,10 @@ Use a NFS mount via loopback for testing file system operations. By changing files directly on the server and accessing them on the client or vice versa, specific kernel behavior can be triggered. -Especially using file mmap(2) over NFS is tested. +Using file mmap(2) over NFS is tested. +UNIX domain sockets are created and used on NFS file systems. +Write ktrace output files onto NFS mounted file systems. Especially +test system calls used by true and TCP netcat. These tests must be run as root, on a system with a free vnd0 slot. They create an entry in /etc/exports and start NFS server daemons |