Makefile revision 1.5
11.5Sperseant#	$NetBSD: Makefile,v 1.5 2006/06/24 05:28:54 perseant Exp $
21.1Sperseant#
31.1Sperseant# Note: this test must be run with LFSDEV defined, e.g. "LFSDEV=wd0g".
41.1Sperseant# It will destroy the existing contents of $LFSDEV to perform the test.
51.2Sperseant# The test also requires the availability of two files each the size
61.2Sperseant# of ${LFSDEV} to store temporary filesystem images in, during the course
71.2Sperseant# of the run.
81.2Sperseant#
91.1Sperseant# This test requires that Perl be installed to run.
101.1Sperseant#
111.1Sperseant
121.1SperseantNOMAN=	# defined
131.1SperseantTMPMP= /tmp/lfsregresstest_mount
141.1SperseantSRCDIR?= ${.CURDIR}
151.1SperseantCLEAN= clean
161.1SperseantLFSBDEV="/dev/${LFSDEV}"
171.1SperseantLFSCDEV="/dev/r${LFSDEV}"
181.2SperseantGFILE?= "good_fs.img"		# "Good" file - will be as large as the FS
191.2SperseantWFILE?= "work_fs.img"		# Work file - will also be as large as the FS
201.1SperseantCOUNT?= 20
211.1SperseantPLEX?=  2
221.4SperseantFSIZE?= 16384
231.1Sperseant
241.1Sperseantregress: test_ckckp
251.1Sperseant
261.2Sperseant.ifndef REGRESS_LOG
271.2SperseantREGRESS_LOG=/dev/null
281.2Sperseant.endif
291.2Sperseant
301.1Sperseanttest_ckckp: ckckp cleanalot_async run_ckckp
311.2Sperseant.ifndef LFSDEV
321.2Sperseant	@echo "***  Checkpoint validity test skipped"
331.2Sperseant	@echo ${.CURDIR} SKIPPED "LFSDEV not defined" >> ${REGRESS_LOG}
341.2Sperseant.else
351.1Sperseant	@echo "***  Checkpoint validity test"
361.1Sperseant	@echo "***  WARNING: will newfs_lfs ${LFSCDEV} in 10 seconds"
371.1Sperseant	@sleep 10
381.1Sperseant	newfs_lfs ${LFSCDEV}
391.1Sperseant	-mkdir ${TMPMP}
401.1Sperseant	mount ${LFSBDEV} ${TMPMP}
411.4Sperseant	./run_ckckp ${TMPMP} ${LFSCDEV} ${GFILE} ${WFILE} ${PLEX} ${COUNT} ${FSIZE} || \
421.2Sperseant		echo ${.CURDIR} FAILED | tee -a ${REGRESS_LOG}
431.1Sperseant	umount ${TMPMP}
441.1Sperseant	rmdir ${TMPMP}
451.2Sperseant	echo ${.CURDIR} PASSED | tee -a ${REGRESS_LOG}
461.2Sperseant.endif
471.2Sperseant
481.5Sperseantabort:
491.2Sperseant	-kill -9 `ps auxww | grep ckckp | grep -v grep | awk '{print $$2}'`
501.2Sperseant	umount ${TMPMP}
511.1Sperseant
521.1Sperseantclean:
531.5Sperseant	rm -f ckckp cleanalot_async *~ *.core ${GFILE} ${WFILE}
541.1Sperseant
551.1Sperseant.include <bsd.prog.mk>
56