Extend filesystem tests to test mfs and tmpfs. Hook up mfs but leave tmpfs
authorclaudio <claudio@openbsd.org>
Sun, 3 Oct 2021 08:56:53 +0000 (08:56 +0000)
committerclaudio <claudio@openbsd.org>
Sun, 3 Oct 2021 08:56:53 +0000 (08:56 +0000)
out for now since it is not enabled by default.
mfs reports the same errors as ffs (no real surprise), tmpfs has a few
different errors.
OK bluhm@

regress/sys/ffs/Makefile
regress/sys/ffs/mfs/Makefile [new file with mode: 0644]
regress/sys/ffs/tmpfs/Makefile [new file with mode: 0644]

index e12d979..78a5df1 100644 (file)
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile,v 1.7 2017/01/13 01:19:13 bluhm Exp $
+# $OpenBSD: Makefile,v 1.8 2021/10/03 08:56:53 claudio Exp $
 
-SUBDIR=                ffs nfs
+SUBDIR=                ffs nfs mfs
 PROG=          fstest
 NOMAN=         yes
 
diff --git a/regress/sys/ffs/mfs/Makefile b/regress/sys/ffs/mfs/Makefile
new file mode 100644 (file)
index 0000000..0afa414
--- /dev/null
@@ -0,0 +1,33 @@
+# $OpenBSD: Makefile,v 1.1 2021/10/03 08:56:53 claudio Exp $
+
+TESTS=         chflags chmod chown link mkdir mkfifo open rename rmdir \
+               symlink truncate unlink
+
+.PHONY: mount umount unconfig clean
+
+REGRESS_SETUP_ONCE+=   mount
+mount:
+       mkdir -p /mnt/regress-mfs
+       mount_mfs -s 4096 swap /mnt/regress-mfs
+
+REGRESS_CLEANUP+=      umount
+umount:
+       umount /mnt/regress-mfs
+
+REGRESS_CLEANUP+=      unconfig
+unconfig:
+       -umount -f /mnt/regress-mfs 2>/dev/null || true
+       -rmdir /mnt/regress-mfs 2>/dev/null || true
+
+REGRESS_SETUP+=                ${.OBJDIR}/../fstest
+${.OBJDIR}/../fstest:
+       ${.MAKE} -C ${.CURDIR}/.. fstest
+
+.for t in ${TESTS}
+REGRESS_TARGETS+=      run-$t
+run-$t:
+       cd /mnt/regress-mfs && env FSTEST=${.OBJDIR}/../fstest \
+           /bin/sh ${.CURDIR}/../run ${.CURDIR}/../tests/$t/*.t
+.endfor
+
+.include <bsd.regress.mk>
diff --git a/regress/sys/ffs/tmpfs/Makefile b/regress/sys/ffs/tmpfs/Makefile
new file mode 100644 (file)
index 0000000..0ec8a68
--- /dev/null
@@ -0,0 +1,33 @@
+# $OpenBSD: Makefile,v 1.1 2021/10/03 08:56:53 claudio Exp $
+
+TESTS=         chflags chmod chown link mkdir mkfifo open rename rmdir \
+               symlink truncate unlink
+
+.PHONY: mount umount unconfig clean
+
+REGRESS_SETUP_ONCE+=   mount
+mount:
+       mkdir -p /mnt/regress-tmpfs
+       mount_tmpfs -s 2M swap /mnt/regress-tmpfs
+
+REGRESS_CLEANUP+=      umount
+umount:
+       umount /mnt/regress-tmpfs
+
+REGRESS_CLEANUP+=      unconfig
+unconfig:
+       -umount -f /mnt/regress-tmpfs 2>/dev/null || true
+       -rmdir /mnt/regress-tmpfs 2>/dev/null || true
+
+REGRESS_SETUP+=                ${.OBJDIR}/../fstest
+${.OBJDIR}/../fstest:
+       ${.MAKE} -C ${.CURDIR}/.. fstest
+
+.for t in ${TESTS}
+REGRESS_TARGETS+=      run-$t
+run-$t:
+       cd /mnt/regress-tmpfs && env FSTEST=${.OBJDIR}/../fstest \
+           /bin/sh ${.CURDIR}/../run ${.CURDIR}/../tests/$t/*.t
+.endfor
+
+.include <bsd.regress.mk>