START sys/nfs 2024-10-05T22:21:09Z ==== mount ==== umount -f -t nfs -h 127.0.0.1 -a || true rmdir /mnt/regress-nfs-client 2>/dev/null || true pkill -KILL mountd || true rcctl -f stop nfsd rcctl -f stop portmap umount -f /dev/vnd0c 2>/dev/null || true rmdir /mnt/regress-nfs-server 2>/dev/null || true vnconfig -u vnd0 2>/dev/null || true rm -f stamp-mount dd if=/dev/zero of=diskimage bs=512 count=4k 4096+0 records in 4096+0 records out 2097152 bytes transferred in 0.063 secs (33047428 bytes/sec) vnconfig vnd0 diskimage newfs vnd0c /dev/rvnd0c: 2.0MB in 4096 sectors of 512 bytes 4 cylinder groups of 0.50MB, 32 blocks, 64 inodes each super-block backups (for fsck -b #) at: 160, 1184, 2208, 3232, grep '/mnt/regress-nfs-server\>' /etc/exports || echo /mnt/regress-nfs-server -maproot=0:0 127.0.0.1 >>/etc/exports /mnt/regress-nfs-server -maproot=0:0 127.0.0.1 rcctl -f start portmap portmap(ok) rcctl -f start nfsd nfsd(ok) rcctl -f start mountd mountd(ok) mkdir -p /mnt/regress-nfs-server mount /dev/vnd0c /mnt/regress-nfs-server # wait until mountd(8) has exported the directory for i in `jot 100`; do mount | grep 'regress-nfs-server .*NFS exported' && break; [ $i = 100 ] && exit 1; sleep .1; done /dev/vnd0c on /mnt/regress-nfs-server type ffs (NFS exported, local) mkdir -p /mnt/regress-nfs-client mount -t nfs 127.0.0.1:/mnt/regress-nfs-server /mnt/regress-nfs-client ==== run-regress-read ==== echo -n run-regress-read >/mnt/regress-nfs-server/read [ run-regress-read = "`cat /mnt/regress-nfs-client/read`" ] ==== run-write ==== echo -n run-write >/mnt/regress-nfs-client/write [ run-write = "`cat /mnt/regress-nfs-server/write`" ] ==== run-mmap-sysctl-copyin ==== cc -O2 -pipe -MD -MP -c /usr/src/regress/sys/nfs/mmap-sysctl-copyin.c cc -o mmap-sysctl-copyin mmap-sysctl-copyin.o ./mmap-sysctl-copyin ==== run-mmap-sysctl-copyout ==== cc -O2 -pipe -MD -MP -c /usr/src/regress/sys/nfs/mmap-sysctl-copyout.c cc -o mmap-sysctl-copyout mmap-sysctl-copyout.o ./mmap-sysctl-copyout ==== run-socket-stream ==== rm -f /mnt/regress-nfs-client/socket-stream nc -U -v -l /mnt/regress-nfs-client/socket-stream & [ -S /mnt/regress-nfs-client/socket-stream ] || sleep 1 Bound on /mnt/regress-nfs-client/socket-stream Listening on /mnt/regress-nfs-client/socket-stream [ -S /mnt/regress-nfs-client/socket-stream ] nc -U -z /mnt/regress-nfs-client/socket-stream Connection received on /mnt/regress-nfs-client/socket-stream ==== run-socket-dgram ==== rm -f /mnt/regress-nfs-client/socket-dgram nc -Uu -v -l /mnt/regress-nfs-client/socket-dgram & [ -S /mnt/regress-nfs-client/socket-dgram ] || sleep 1 Bound on /mnt/regress-nfs-client/socket-dgram [ -S /mnt/regress-nfs-client/socket-dgram ] nc -Uu -z /mnt/regress-nfs-client/socket-dgram pkill -xf "nc -Uu -v -l /mnt/regress-nfs-client/socket-dgram" ==== 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)' 18240 true CALL exit(0) ==== 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 100`; do if fgrep -q Listening server.log; then break; fi; sleep .1; done fgrep Listening server.log Listening on 127.0.0.1 12700 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 foo bar fgrep Connection client.log Connection to 127.0.0.1 12700 port [tcp/*] succeeded! kdump -f /mnt/regress-nfs-client/netcat-server.ktrace | fgrep 'nc CALL exit(0)' 49859 nc CALL exit(0) kdump -f /mnt/regress-nfs-client/netcat-client.ktrace | fgrep 'nc CALL exit(0)' 69141 nc CALL exit(0) ==== 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 ==== umount ==== umount /mnt/regress-nfs-client ==== unconfig ==== umount -f -t nfs -h 127.0.0.1 -a || true rmdir /mnt/regress-nfs-client 2>/dev/null || true pkill -KILL mountd || true rcctl -f stop nfsd nfsd(ok) rcctl -f stop portmap portmap(ok) umount -f /dev/vnd0c 2>/dev/null || true rmdir /mnt/regress-nfs-server 2>/dev/null || true vnconfig -u vnd0 2>/dev/null || true rm -f stamp-mount PASS sys/nfs Duration 0m12.70s