Module Name: src
Committed By: pooka
Date: Sat Dec 11 11:31:28 UTC 2010
Modified Files:
src/tests/sbin/resize_ffs: common.sh t_grow.sh t_shrink.sh
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/sbin/resize_ffs/common.sh \
src/tests/sbin/resize_ffs/t_grow.sh src/tests/sbin/resize_ffs/t_shrink.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/sbin/resize_ffs/common.sh
diff -u src/tests/sbin/resize_ffs/common.sh:1.2 src/tests/sbin/resize_ffs/common.sh:1.3
--- src/tests/sbin/resize_ffs/common.sh:1.2 Thu Dec 9 16:59:35 2010
+++ src/tests/sbin/resize_ffs/common.sh Sat Dec 11 11:31:27 2010
@@ -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
}
Index: src/tests/sbin/resize_ffs/t_grow.sh
diff -u src/tests/sbin/resize_ffs/t_grow.sh:1.2 src/tests/sbin/resize_ffs/t_grow.sh:1.3
--- src/tests/sbin/resize_ffs/t_grow.sh:1.2 Thu Dec 9 17:28:05 2010
+++ src/tests/sbin/resize_ffs/t_grow.sh Sat Dec 11 11:31:27 2010
@@ -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
}
Index: src/tests/sbin/resize_ffs/t_shrink.sh
diff -u src/tests/sbin/resize_ffs/t_shrink.sh:1.2 src/tests/sbin/resize_ffs/t_shrink.sh:1.3
--- src/tests/sbin/resize_ffs/t_shrink.sh:1.2 Thu Dec 9 17:28:05 2010
+++ src/tests/sbin/resize_ffs/t_shrink.sh Sat Dec 11 11:31:27 2010
@@ -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
}