Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/bouyer-quota2]: src/tests/fs/ffs Ask the rump server to background itsel...



details:   https://anonhg.NetBSD.org/src/rev/cfdc475b983c
branches:  bouyer-quota2
changeset: 761089:cfdc475b983c
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sun Jan 30 13:23:26 2011 +0000

description:
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).

diffstat:

 tests/fs/ffs/quotas_common.sh |  10 +++++-----
 tests/fs/ffs/t_getquota.sh    |   6 ++++--
 tests/fs/ffs/t_setquota.sh    |  14 ++++++++++----
 3 files changed, 19 insertions(+), 11 deletions(-)

diffs (93 lines):

diff -r b323577a1f28 -r cfdc475b983c tests/fs/ffs/quotas_common.sh
--- a/tests/fs/ffs/quotas_common.sh     Sun Jan 30 13:15:14 2011 +0000
+++ b/tests/fs/ffs/quotas_common.sh     Sun Jan 30 13:23:26 2011 +0000
@@ -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
diff -r b323577a1f28 -r cfdc475b983c tests/fs/ffs/t_getquota.sh
--- a/tests/fs/ffs/t_getquota.sh        Sun Jan 30 13:15:14 2011 +0000
+++ b/tests/fs/ffs/t_getquota.sh        Sun Jan 30 13:23:26 2011 +0000
@@ -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" \
diff -r b323577a1f28 -r cfdc475b983c tests/fs/ffs/t_setquota.sh
--- a/tests/fs/ffs/t_setquota.sh        Sun Jan 30 13:15:14 2011 +0000
+++ b/tests/fs/ffs/t_setquota.sh        Sun Jan 30 13:23:26 2011 +0000
@@ -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" \



Home | Main Index | Thread Index | Old Index