xref: /netbsd/regress/sys/fs/lfs/ckckp/Makefile (revision 2947e73b)
1#	$NetBSD: Makefile,v 1.7 2006/11/11 14:47:27 jmmv Exp $
2#
3# Note: this test must be run with LFSDEV defined, e.g. "LFSDEV=wd0g".
4# It will destroy the existing contents of $LFSDEV to perform the test.
5# The test also requires the availability of two files each the size
6# of ${LFSDEV} to store temporary filesystem images in, during the course
7# of the run.
8#
9# This test requires that Perl be installed to run.
10#
11
12NOMAN=	# defined
13TMPMP= /tmp/lfsregresstest_mount
14SRCDIR?= ${.CURDIR}
15CLEAN= clean
16LFSBDEV="/dev/${LFSDEV}"
17LFSCDEV="/dev/r${LFSDEV}"
18GFILE?= "good_fs.img"		# "Good" file - will be as large as the FS
19WFILE?= "work_fs.img"		# Work file - will also be as large as the FS
20COUNT?= 5
21PLEX?=  2
22FSIZE?= 16384
23
24regress: test_ckckp
25
26.ifndef REGRESS_LOG
27REGRESS_LOG=/dev/null
28.endif
29
30test_ckckp: ckckp cleanalot_async run_ckckp
31.ifndef LFSDEV
32	@echo "***  Checkpoint validity test skipped"
33	@echo ${.CURDIR} SKIPPED "LFSDEV not defined" >> ${REGRESS_LOG}
34.else
35	@echo "***  Checkpoint validity test"
36	@echo "***  WARNING: will newfs_lfs ${LFSCDEV} in 10 seconds"
37	@sleep 10
38	newfs_lfs ${LFSCDEV}
39	-mkdir ${TMPMP}
40	mount -o-n ${LFSBDEV} ${TMPMP}
41	/libexec/lfs_cleanerd -b -n4 -t5 ${TMPMP}
42	./run_ckckp ${TMPMP} ${LFSCDEV} ${GFILE} ${WFILE} ${PLEX} ${COUNT} ${FSIZE} || \
43		echo ${.CURDIR} FAILED | tee -a ${REGRESS_LOG}
44	umount ${TMPMP}
45	rmdir ${TMPMP}
46	echo ${.CURDIR} PASSED | tee -a ${REGRESS_LOG}
47.endif
48
49abort:
50	-kill -9 `ps auxww | grep ckckp | grep -v grep | awk '{print $$2}'`
51	umount ${TMPMP}
52
53clean:
54	rm -f *.o ckckp cleanalot_async *~ *.core check-all.log ${GFILE} ${WFILE}
55
56.include <bsd.prog.mk>
57