diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2020-12-16 21:49:21 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2020-12-16 21:49:21 +0000 |
commit | d9c39fa94dc5fc818c0325c2d8ceafeadfb5b5e1 (patch) | |
tree | 5586fd5f5f2b7f7df48562694a407df9437aec9e /regress | |
parent | c95e11a41965fcfa264f34e691b8736d815a765c (diff) |
Use setup and cleanup feature from regress framework.
Remove echo headlines. Use consistent target names.
Diffstat (limited to 'regress')
-rw-r--r-- | regress/sys/ffs/ffs/Makefile | 33 | ||||
-rw-r--r-- | regress/sys/ffs/nfs/Makefile | 33 | ||||
-rw-r--r-- | regress/sys/fileops/Makefile.inc | 40 | ||||
-rw-r--r-- | regress/sys/nfs/Makefile | 51 |
4 files changed, 67 insertions, 90 deletions
diff --git a/regress/sys/ffs/ffs/Makefile b/regress/sys/ffs/ffs/Makefile index 2f28d08eaca..89a89924222 100644 --- a/regress/sys/ffs/ffs/Makefile +++ b/regress/sys/ffs/ffs/Makefile @@ -1,46 +1,41 @@ -# $OpenBSD: Makefile,v 1.4 2017/11/15 14:43:13 bluhm Exp $ +# $OpenBSD: Makefile,v 1.5 2020/12/16 21:49:20 bluhm Exp $ TESTS= chflags chmod chown link mkdir mkfifo open rename rmdir \ symlink truncate unlink -CLEANFILES= diskimage stamp-* +CLEANFILES= diskimage -.PHONY: disk mount unconfig clean +.PHONY: disk mount umount unconfig clean disk: unconfig dd if=/dev/zero of=diskimage bs=512 count=4k vnconfig vnd0 diskimage newfs vnd0c +REGRESS_SETUP_ONCE+= mount mount: disk mkdir -p /mnt/regress-ffs mount /dev/vnd0c /mnt/regress-ffs +REGRESS_CLEANUP+= umount +umount: + umount /mnt/regress-ffs + +REGRESS_CLEANUP+= unconfig unconfig: -umount -f /dev/vnd0c 2>/dev/null || true -rmdir /mnt/regress-ffs 2>/dev/null || true -vnconfig -u vnd0 2>/dev/null || true - -rm -f stamp-setup - -stamp-setup: - @echo '\n======== $@ ========' - ${.MAKE} -C ${.CURDIR} mount - date >$@ + rm -f stamp-mount +REGRESS_SETUP+= ${.OBJDIR}/../fstest ${.OBJDIR}/../fstest: ${.MAKE} -C ${.CURDIR}/.. fstest .for t in ${TESTS} -REGRESS_TARGETS+= run-regress-${t} -run-regress-${t}: stamp-setup ${.OBJDIR}/../fstest - @echo '\n======== $@ ========' +REGRESS_TARGETS+= run-$t +run-$t: cd /mnt/regress-ffs && env FSTEST=${.OBJDIR}/../fstest \ - /bin/sh ${.CURDIR}/../run ${.CURDIR}/../tests/${t}/*.t + /bin/sh ${.CURDIR}/../run ${.CURDIR}/../tests/$t/*.t .endfor -REGRESS_TARGETS+= run-regress-cleanup -run-regress-cleanup: - @echo '\n======== $@ ========' - umount /mnt/regress-ffs - ${.MAKE} -C ${.CURDIR} unconfig - .include <bsd.regress.mk> diff --git a/regress/sys/ffs/nfs/Makefile b/regress/sys/ffs/nfs/Makefile index d3272a7cdb7..c64ba7c8bb8 100644 --- a/regress/sys/ffs/nfs/Makefile +++ b/regress/sys/ffs/nfs/Makefile @@ -1,10 +1,10 @@ -# $OpenBSD: Makefile,v 1.5 2017/09/04 12:04:03 bluhm Exp $ +# $OpenBSD: Makefile,v 1.6 2020/12/16 21:49:20 bluhm Exp $ TESTS= chflags chmod chown link mkdir mkfifo open rename rmdir \ symlink truncate unlink -CLEANFILES= diskimage stamp-* +CLEANFILES= diskimage -.PHONY: disk nfs mount unconfig clean +.PHONY: disk nfs mount umount unconfig clean disk: unconfig dd if=/dev/zero of=diskimage bs=512 count=4k @@ -18,6 +18,7 @@ nfs: rcctl -f start nfsd rcctl -f start mountd +REGRESS_SETUP_ONCE+= mount mount: disk nfs mkdir -p /mnt/regress-nfs-server mount /dev/vnd0c /mnt/regress-nfs-server @@ -30,6 +31,11 @@ mount: disk nfs mkdir -p /mnt/regress-nfs-client mount -t nfs 127.0.0.1:/mnt/regress-nfs-server /mnt/regress-nfs-client +REGRESS_CLEANUP+= umount +umount: + umount /mnt/regress-nfs-client + +REGRESS_CLEANUP+= unconfig unconfig: -umount -f -t nfs -h 127.0.0.1 -a -rmdir /mnt/regress-nfs-client 2>/dev/null || true @@ -39,28 +45,17 @@ unconfig: -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-setup - -stamp-setup: - @echo '\n======== $@ ========' - ${.MAKE} -C ${.CURDIR} mount - date >$@ + rm -f stamp-mount +REGRESS_SETUP+= ${.OBJDIR}/../fstest ${.OBJDIR}/../fstest: ${.MAKE} -C ${.CURDIR}/.. fstest .for t in ${TESTS} -REGRESS_TARGETS+= run-regress-${t} -run-regress-${t}: stamp-setup ${.OBJDIR}/../fstest - @echo '\n======== $@ ========' +REGRESS_TARGETS+= run-$t +run-$t: cd /mnt/regress-nfs-client && env FSTEST=${.OBJDIR}/../fstest \ - /bin/sh ${.CURDIR}/../run ${.CURDIR}/../tests/${t}/*.t + /bin/sh ${.CURDIR}/../run ${.CURDIR}/../tests/$t/*.t .endfor -REGRESS_TARGETS+= run-regress-cleanup -run-regress-cleanup: - @echo '\n======== $@ ========' - umount /mnt/regress-nfs-client - ${.MAKE} -C ${.CURDIR} unconfig - .include <bsd.regress.mk> diff --git a/regress/sys/fileops/Makefile.inc b/regress/sys/fileops/Makefile.inc index d6d2c05781e..1dab209fff4 100644 --- a/regress/sys/fileops/Makefile.inc +++ b/regress/sys/fileops/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.3 2017/08/15 17:16:39 sf Exp $ +# $OpenBSD: Makefile.inc,v 1.4 2020/12/16 21:49:20 bluhm Exp $ PERL_REQUIRE != perl -e 'eval { require File::Slurp } or print $$@' @@ -8,7 +8,7 @@ TESTS= ${TESTS1} ${TESTS2} FILEOPS_MNT= /mnt/regress-fileops FILEOPS_PROG= ${.OBJDIR}/../fileops -CLEANFILES= diskimage stamp-* +CLEANFILES= diskimage .poison !defined (MOUNT) .poison !defined (NEWFS) @@ -20,48 +20,40 @@ disk: unconfig vnconfig vnd0 diskimage ${NEWFS} /dev/rvnd0c +REGRESS_SETUP_ONCE+= mount mount: disk mkdir -p ${FILEOPS_MNT} ${MOUNT} /dev/vnd0c ${FILEOPS_MNT} +REGRESS_CLEANUP+= umount +umount: + umount ${FILEOPS_MNT} + +REGRESS_CLEANUP+= unconfig unconfig: -umount -f /dev/vnd0c 2>/dev/null || true -rmdir ${FILEOPS_MNT} 2>/dev/null || true -vnconfig -u vnd0 2>/dev/null || true - -rm -f stamp-setup diskimage - -stamp-setup: - @echo '\n======== $@ ========' - ${.MAKE} -C ${.CURDIR} mount - date >$@ + rm -f stamp-setup ${.OBJDIR}/../fileops: ${.MAKE} -C ${.CURDIR}/.. fileops .for t in ${TESTS1} -REGRESS_TARGETS+= run-regress-${t} -run-regress-${t}: stamp-setup ${.OBJDIR}/../fileops - @echo '\n======== $@ ========' +REGRESS_TARGETS+= run-$t +run-$t: ${.OBJDIR}/../fileops cd ${FILEOPS_MNT} && \ - ${FILEOPS_PROG} ${t} ${FILEOPS_MNT}/file + ${FILEOPS_PROG} $t ${FILEOPS_MNT}/file .endfor .for t in ${TESTS2} -REGRESS_TARGETS+= run-regress-${t} +REGRESS_TARGETS+= run-$t +run-$t: ${.CURDIR}/../fileops2.pl .if ! empty(PERL_REQUIRE) -run-regress-${t}: @echo "${PERL_REQUIRE}" - @echo "Install the p5-File-Slurp package to run the fileops ${t} subtest" + @echo "Install the p5-File-Slurp package to run fileops $t subtest" @echo SKIPPED .else -run-regress-${t}: stamp-setup - @echo '\n======== $@ ========' - perl ${.CURDIR}/../fileops2.pl ${t} ${FILEOPS_MNT} + perl ${.CURDIR}/../fileops2.pl $t ${FILEOPS_MNT} .endif .endfor - -REGRESS_TARGETS+= run-regress-cleanup -run-regress-cleanup: - @echo '\n======== $@ ========' - umount ${FILEOPS_MNT} - ${.MAKE} -C ${.CURDIR} unconfig diff --git a/regress/sys/nfs/Makefile b/regress/sys/nfs/Makefile index 848512c41a6..5886c8f089e 100644 --- a/regress/sys/nfs/Makefile +++ b/regress/sys/nfs/Makefile @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile,v 1.7 2017/09/04 12:04:03 bluhm Exp $ +# $OpenBSD: Makefile,v 1.8 2020/12/16 21:49:20 bluhm Exp $ PROGS= mmap-sysctl-copyin mmap-sysctl-copyout -CLEANFILES= diskimage stamp-* +CLEANFILES= diskimage -.PHONY: disk nfs mount unconfig clean +.PHONY: disk nfs mount killnc umount unconfig clean disk: unconfig dd if=/dev/zero of=diskimage bs=512 count=4k @@ -17,6 +17,7 @@ nfs: rcctl -f start nfsd rcctl -f start mountd +REGRESS_SETUP_ONCE+= mount mount: disk nfs mkdir -p /mnt/regress-nfs-server mount /dev/vnd0c /mnt/regress-nfs-server @@ -29,6 +30,16 @@ mount: disk nfs mkdir -p /mnt/regress-nfs-client mount -t nfs 127.0.0.1:/mnt/regress-nfs-server /mnt/regress-nfs-client +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 + +REGRESS_CLEANUP+= umount +umount: + umount /mnt/regress-nfs-client + +REGRESS_CLEANUP+= unconfig unconfig: -umount -f -t nfs -h 127.0.0.1 -a || true -rmdir /mnt/regress-nfs-client 2>/dev/null || true @@ -38,36 +49,27 @@ unconfig: -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-setup - -stamp-setup: - @echo '\n======== $@ ========' - ${.MAKE} -C ${.CURDIR} mount - date >$@ + rm -f stamp-mount REGRESS_TARGETS+= run-regress-read -run-regress-read: stamp-setup - @echo '\n======== $@ ========' +run-regress-read: echo -n $@ >/mnt/regress-nfs-server/read [ $@ = "`cat /mnt/regress-nfs-client/read`" ] -REGRESS_TARGETS+= run-regress-write -run-regress-write: stamp-setup - @echo '\n======== $@ ========' +REGRESS_TARGETS+= run-write +run-write: echo -n $@ >/mnt/regress-nfs-client/write [ $@ = "`cat /mnt/regress-nfs-server/write`" ] .for p in ${PROGS} -REGRESS_TARGETS+= run-regress-${p} -run-regress-${p}: stamp-setup ${p} - @echo '\n======== $@ ========' - ./${p} +REGRESS_TARGETS+= run-$p +run-$p: $p + ./$p .endfor .for socktype nctype in stream -U dgram -Uu -REGRESS_TARGETS+= run-regress-socket-${socktype} -run-regress-socket-${socktype}: stamp-setup - @echo '\n======== $@ ========' +REGRESS_TARGETS+= run-socket-${socktype} +run-socket-${socktype}: rm -f /mnt/regress-nfs-client/socket-${socktype} nc ${nctype} -v -l /mnt/regress-nfs-client/socket-${socktype} & [ -S /mnt/regress-nfs-client/socket-${socktype} ] || sleep 1 @@ -78,11 +80,4 @@ run-regress-socket-${socktype}: stamp-setup .endif .endfor -REGRESS_TARGETS+= run-regress-cleanup -run-regress-cleanup: - @echo '\n======== $@ ========' - -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 - ${.MAKE} -C ${.CURDIR} unconfig - .include <bsd.regress.mk> |