Source-Changes-HG archive

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

[src/trunk]: src/tests/sbin/resize_ffs Can't use dynamic data in cleanup (it'...



details:   https://anonhg.NetBSD.org/src/rev/24dd9facdd6b
branches:  trunk
changeset: 759475:24dd9facdd6b
user:      pooka <pooka%NetBSD.org@localhost>
date:      Sat Dec 11 11:31:27 2010 +0000

description:
Can't use dynamic data in cleanup (it's run in a different process),
so get rid of $MNTPT and use the constant value the variable was
set to.

diffstat:

 tests/sbin/resize_ffs/common.sh   |  11 +++++------
 tests/sbin/resize_ffs/t_grow.sh   |  12 ++++++------
 tests/sbin/resize_ffs/t_shrink.sh |  12 ++++++------
 3 files changed, 17 insertions(+), 18 deletions(-)

diffs (137 lines):

diff -r 5ee8e30d72fc -r 24dd9facdd6b tests/sbin/resize_ffs/common.sh
--- a/tests/sbin/resize_ffs/common.sh   Sat Dec 11 10:44:55 2010 +0000
+++ b/tests/sbin/resize_ffs/common.sh   Sat Dec 11 11:31:27 2010 +0000
@@ -8,7 +8,6 @@
        IMG=fsimage
        TDBASE64=$(atf_get_srcdir)/testdata.tar.gz.base64
        GOODMD5=$(atf_get_srcdir)/testdata.md5
-       MNTPT=mnt
        # set BYTESWAP to opposite-endian.
        if [ $(sysctl -n hw.byteorder) = "1234" ]; then
                BYTESWAP=be
@@ -29,7 +28,7 @@
                ${check_function} " "${@}" "; \
        }"
        eval "${name}_cleanup() { \
-               umount -f ${MNTPT}  ; \
+               umount -f mnt  ; \
        }"
 }
 
@@ -46,14 +45,14 @@
                ${check_function} " "${@}" "; \
        }"
        eval "${name}_cleanup() { \
-               umount -f ${MNTPT}  ; \
+               umount -f mnt  ; \
        }"
 }
 
 # copy_data requires the mount already done;  makes one copy of the test data
 copy_data ()
 {
-       uudecode -p ${TDBASE64} | (cd ${MNTPT}; tar xzf - -s/testdata/TD$1/)
+       uudecode -p ${TDBASE64} | (cd mnt; tar xzf - -s/testdata/TD$1/)
 }
 
 copy_multiple ()
@@ -68,7 +67,7 @@
 # is to ensure data exists near the end of the fs under test.
 remove_data ()
 {
-       rm -rf ${MNTPT}/TD$1
+       rm -rf mnt/TD$1
 }
 
 remove_multiple ()
@@ -83,7 +82,7 @@
 # generated md5 file doesn't need explicit cleanup thanks to ATF
 check_data ()
 {
-       (cd ${MNTPT}/TD$1 && md5 *) > TD$1.md5
+       (cd mnt/TD$1 && md5 *) > TD$1.md5
        atf_check diff -u ${GOODMD5} TD$1.md5
 }
 
diff -r 5ee8e30d72fc -r 24dd9facdd6b tests/sbin/resize_ffs/t_grow.sh
--- a/tests/sbin/resize_ffs/t_grow.sh   Sat Dec 11 10:44:55 2010 +0000
+++ b/tests/sbin/resize_ffs/t_grow.sh   Sat Dec 11 11:31:27 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_grow.sh,v 1.2 2010/12/09 17:28:05 riz Exp $
+# $NetBSD: t_grow.sh,v 1.3 2010/12/11 11:31:27 pooka Exp $
 #
 # Copyright (c) 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -38,7 +38,7 @@
        local fslevel=$5
        local numdata=$6
        local swap=$7
-       mkdir -p ${MNTPT}
+       mkdir -p mnt
        echo "bs is ${bs} numdata is ${numdata}"
        echo "****growing fs with blocksize ${bs}"
 
@@ -57,15 +57,15 @@
        fi
 
        # we're specifying relative paths, so rump_ffs warns - ignore.
-       atf_check -s exit:0 -e ignore rump_ffs ${IMG} ${MNTPT}
+       atf_check -s exit:0 -e ignore rump_ffs ${IMG} mnt
        copy_multiple ${numdata}
-       umount ${MNTPT}
+       umount mnt
        atf_check -s exit:0 resize_ffs -y -s ${nsize} ${IMG}
        atf_check -s exit:0 -o ignore fsck_ffs -f -n -F ${IMG}
-       atf_check -s exit:0 -e ignore rump_ffs ${IMG} ${MNTPT}
+       atf_check -s exit:0 -e ignore rump_ffs ${IMG} mnt
        # checking everything because we don't delete on grow
        check_data_range 1 ${numdata}
-       umount ${MNTPT}
+       umount mnt
        rm -f ${IMG}    # probably unnecessary
 }
 
diff -r 5ee8e30d72fc -r 24dd9facdd6b tests/sbin/resize_ffs/t_shrink.sh
--- a/tests/sbin/resize_ffs/t_shrink.sh Sat Dec 11 10:44:55 2010 +0000
+++ b/tests/sbin/resize_ffs/t_shrink.sh Sat Dec 11 11:31:27 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_shrink.sh,v 1.2 2010/12/09 17:28:05 riz Exp $
+# $NetBSD: t_shrink.sh,v 1.3 2010/12/11 11:31:27 pooka Exp $
 #
 # Copyright (c) 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -38,7 +38,7 @@
        local fslevel=$5
        local numdata=$6
        local swap=$7
-       mkdir -p ${MNTPT}
+       mkdir -p mnt
        echo "bs is ${bs} numdata is ${numdata}"
        echo "****shrinking fs with blocksize ${bs}"
 
@@ -57,7 +57,7 @@
        fi
 
        # we're specifying relative paths, so rump_ffs warns - ignore.
-       atf_check -s exit:0 -e ignore rump_ffs ${IMG} ${MNTPT}
+       atf_check -s exit:0 -e ignore rump_ffs ${IMG} mnt
        copy_multiple ${numdata}
 
        # how much data to remove so fs can be shrunk
@@ -65,13 +65,13 @@
        local dataleft=$((numdata-remove))
        echo remove is $remove dataleft is $dataleft
        remove_multiple ${remove}
-       umount ${MNTPT}
+       umount mnt
        atf_check -s exit:0 resize_ffs -y -s ${nsize} ${IMG}
        atf_check -s exit:0 -o ignore fsck_ffs -f -n -F ${IMG}
-       atf_check -s exit:0 -e ignore rump_ffs ${IMG} ${MNTPT}
+       atf_check -s exit:0 -e ignore rump_ffs ${IMG} mnt
        # checking everything because we don't delete on grow
        check_data_range $((remove + 1)) ${numdata}
-       umount ${MNTPT}
+       umount mnt
        rm -f ${IMG}    # probably unnecessary
 }
 



Home | Main Index | Thread Index | Old Index