Module Name:    src
Committed By:   bouyer
Date:           Sun Jan 30 13:23:27 UTC 2011

Modified Files:
        src/tests/fs/ffs [bouyer-quota2]: quotas_common.sh t_getquota.sh
            t_setquota.sh

Log Message:
Ask the rump server to background itself, to avoid a race at startup where
a rump command could be run before the server is available.
Add a sleep after shutdown to workaround a race where the fsck would run
before the server is fully showdown (testing for the existence of the
socket seems to not be enough).


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/tests/fs/ffs/quotas_common.sh \
    src/tests/fs/ffs/t_getquota.sh
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/tests/fs/ffs/t_setquota.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/ffs/quotas_common.sh
diff -u src/tests/fs/ffs/quotas_common.sh:1.1.2.2 src/tests/fs/ffs/quotas_common.sh:1.1.2.3
--- src/tests/fs/ffs/quotas_common.sh:1.1.2.2	Sun Jan 30 12:37:34 2011
+++ src/tests/fs/ffs/quotas_common.sh	Sun Jan 30 13:23:26 2011
@@ -1,4 +1,4 @@
-# $NetBSD: quotas_common.sh,v 1.1.2.2 2011/01/30 12:37:34 bouyer Exp $ 
+# $NetBSD: quotas_common.sh,v 1.1.2.3 2011/01/30 13:23:26 bouyer Exp $ 
 
 create_with_quotas()
 {
@@ -13,9 +13,8 @@
 	fi
 	atf_check -o ignore -e ignore newfs ${op} \
 		-B ${endian} -O ${vers} -s 4000 -F ${IMG}
-	#atf_check -o ignore -e ignore $(atf_get_srcdir)/h_quota2_server \
-	#	${IMG} ${RUMP_SERVER}
-	$(atf_get_srcdir)/h_quota2_server ${IMG} ${RUMP_SERVER} &
+	atf_check -o ignore -e ignore $(atf_get_srcdir)/h_quota2_server -b \
+		${IMG} ${RUMP_SERVER}
 }
 
 # from tests/ipf/h_common.sh via tests/sbin/resize_ffs
@@ -66,7 +65,8 @@
 {
 	IMG=fsimage
 	DIR=target
-	RUMP_SERVER=unix:///tmp/test
+	RUMP_SOCKET=test
+	RUMP_SERVER=unix://${RUMP_SOCKET}
 	export RUMP_SERVER
 	for i in ${tests}; do
 		atf_add_test_case $i
Index: src/tests/fs/ffs/t_getquota.sh
diff -u src/tests/fs/ffs/t_getquota.sh:1.1.2.2 src/tests/fs/ffs/t_getquota.sh:1.1.2.3
--- src/tests/fs/ffs/t_getquota.sh:1.1.2.2	Sun Jan 30 11:33:33 2011
+++ src/tests/fs/ffs/t_getquota.sh	Sun Jan 30 13:23:26 2011
@@ -1,4 +1,4 @@
-# $NetBSD: t_getquota.sh,v 1.1.2.2 2011/01/30 11:33:33 bouyer Exp $ 
+# $NetBSD: t_getquota.sh,v 1.1.2.3 2011/01/30 13:23:26 bouyer Exp $ 
 #
 #  Copyright (c) 2011 Manuel Bouyer
 #  All rights reserved.
@@ -83,7 +83,9 @@
 		    $(atf_get_srcdir)/rump_repquota -${q} /mnt
 	done
 	atf_check -s exit:0 rump.halt
-	wait $!
+#wait for rump server to be gone
+	while [ -e ${RUMP_SOCKET} ] ; do done
+	sleep 1
 # check that the quota inode creation didn't corrupt the filesystem
 	atf_check -s exit:0 -o "match:already clean" \
 		-o "match:Phase 6 - Check Quotas" \

Index: src/tests/fs/ffs/t_setquota.sh
diff -u src/tests/fs/ffs/t_setquota.sh:1.1.2.1 src/tests/fs/ffs/t_setquota.sh:1.1.2.2
--- src/tests/fs/ffs/t_setquota.sh:1.1.2.1	Sun Jan 30 12:37:34 2011
+++ src/tests/fs/ffs/t_setquota.sh	Sun Jan 30 13:23:26 2011
@@ -1,4 +1,4 @@
-# $NetBSD: t_setquota.sh,v 1.1.2.1 2011/01/30 12:37:34 bouyer Exp $ 
+# $NetBSD: t_setquota.sh,v 1.1.2.2 2011/01/30 13:23:26 bouyer Exp $ 
 #
 #  Copyright (c) 2011 Manuel Bouyer
 #  All rights reserved.
@@ -97,7 +97,9 @@
 		    $(atf_get_srcdir)/rump_repquota -${q} /mnt
 	done
 	atf_check -s exit:0 rump.halt
-	wait $!
+#wait for rump server to be gone
+	while [ -e ${RUMP_SOCKET} ] ; do done
+	sleep 1
 # check that the quota inode creation didn't corrupt the filesystem
 	atf_check -s exit:0 -o "match:already clean" \
 		-o "match:Phase 6 - Check Quotas" \
@@ -151,7 +153,9 @@
 		    $(atf_get_srcdir)/rump_quota -${q} -v ${id}
 	done
 	atf_check -s exit:0 rump.halt
-	wait $!
+#wait for rump server to be gone
+	while [ -e ${RUMP_SOCKET} ] ; do done
+	sleep 1
 # check that the quota inode creation didn't corrupt the filesystem
 	atf_check -s exit:0 -o "match:already clean" \
 		-o "match:Phase 6 - Check Quotas" \
@@ -205,7 +209,9 @@
 		    $(atf_get_srcdir)/rump_quota -${q} -v ${id}
 	done
 	atf_check -s exit:0 rump.halt
-	wait $!
+#wait for rump server to be gone
+	while [ -e ${RUMP_SOCKET} ] ; do done
+	sleep 1
 # check that the quota inode creation didn't corrupt the filesystem
 	atf_check -s exit:0 -o "match:already clean" \
 		-o "match:Phase 6 - Check Quotas" \

Reply via email to