Module Name:    src
Committed By:   bouyer
Date:           Mon Jan 31 22:04:26 UTC 2011

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

Log Message:
Extract code to shut down the rump server and check the filesystem image
to a function.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/tests/fs/ffs/quotas_common.sh
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/tests/fs/ffs/t_getquota.sh \
    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.3 src/tests/fs/ffs/quotas_common.sh:1.1.2.4
--- src/tests/fs/ffs/quotas_common.sh:1.1.2.3	Sun Jan 30 13:23:26 2011
+++ src/tests/fs/ffs/quotas_common.sh	Mon Jan 31 22:04:26 2011
@@ -1,4 +1,4 @@
-# $NetBSD: quotas_common.sh,v 1.1.2.3 2011/01/30 13:23:26 bouyer Exp $ 
+# $NetBSD: quotas_common.sh,v 1.1.2.4 2011/01/31 22:04:26 bouyer Exp $ 
 
 create_with_quotas()
 {
@@ -17,6 +17,15 @@
 		${IMG} ${RUMP_SERVER}
 }
 
+rump_shutdown()
+{
+	atf_check -s exit:0 rump.halt
+# 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" \
+		fsck_ffs -nf -F ${IMG}
+}
+
 # from tests/ipf/h_common.sh via tests/sbin/resize_ffs
 test_case()
 {

Index: src/tests/fs/ffs/t_getquota.sh
diff -u src/tests/fs/ffs/t_getquota.sh:1.1.2.4 src/tests/fs/ffs/t_getquota.sh:1.1.2.5
--- src/tests/fs/ffs/t_getquota.sh:1.1.2.4	Sun Jan 30 19:49:48 2011
+++ src/tests/fs/ffs/t_getquota.sh	Mon Jan 31 22:04:26 2011
@@ -1,4 +1,4 @@
-# $NetBSD: t_getquota.sh,v 1.1.2.4 2011/01/30 19:49:48 bouyer Exp $ 
+# $NetBSD: t_getquota.sh,v 1.1.2.5 2011/01/31 22:04:26 bouyer Exp $ 
 #
 #  Copyright (c) 2011 Manuel Bouyer
 #  All rights reserved.
@@ -82,9 +82,5 @@
 -o "not-match:--        0        -        -                1       -       -" \
 		    $(atf_get_srcdir)/rump_repquota -${q} /mnt
 	done
-	atf_check -s exit:0 rump.halt
-# 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" \
-		fsck_ffs -nf -F ${IMG}
+	rump_shutdown
 }
Index: src/tests/fs/ffs/t_setquota.sh
diff -u src/tests/fs/ffs/t_setquota.sh:1.1.2.4 src/tests/fs/ffs/t_setquota.sh:1.1.2.5
--- src/tests/fs/ffs/t_setquota.sh:1.1.2.4	Sun Jan 30 23:04:52 2011
+++ src/tests/fs/ffs/t_setquota.sh	Mon Jan 31 22:04:26 2011
@@ -1,4 +1,4 @@
-# $NetBSD: t_setquota.sh,v 1.1.2.4 2011/01/30 23:04:52 bouyer Exp $ 
+# $NetBSD: t_setquota.sh,v 1.1.2.5 2011/01/31 22:04:26 bouyer Exp $ 
 #
 #  Copyright (c) 2011 Manuel Bouyer
 #  All rights reserved.
@@ -97,11 +97,7 @@
 -o "not-match:--        0        -        -" \
 		    $(atf_get_srcdir)/rump_repquota -${q} /mnt
 	done
-	atf_check -s exit:0 rump.halt
-# 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" \
-		fsck_ffs -nf -F ${IMG}
+	rump_shutdown
 }
 
 set_quota_new()
@@ -151,11 +147,7 @@
 		    -o "match:Disk quotas for .*: none$" \
 		    $(atf_get_srcdir)/rump_quota -${q} -v ${id}
 	done
-	atf_check -s exit:0 rump.halt
-# 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" \
-		fsck_ffs -nf -F ${IMG}
+	rump_shutdown
 }
 
 set_quota_default()
@@ -205,9 +197,5 @@
 		    -o "match:Default (user|group) disk quotas: none$" \
 		    $(atf_get_srcdir)/rump_quota -${q} -v ${id}
 	done
-	atf_check -s exit:0 rump.halt
-# 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" \
-		fsck_ffs -nf -F ${IMG}
+	rump_shutdown
 }

Reply via email to