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.
This commit is contained in:
parent
126e32a17e
commit
772299258e
@ -8,7 +8,6 @@ setupvars()
|
||||
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 @@ test_case()
|
||||
${check_function} " "${@}" "; \
|
||||
}"
|
||||
eval "${name}_cleanup() { \
|
||||
umount -f ${MNTPT} ; \
|
||||
umount -f mnt ; \
|
||||
}"
|
||||
}
|
||||
|
||||
@ -46,14 +45,14 @@ test_case_xfail()
|
||||
${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 @@ copy_multiple ()
|
||||
# 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 @@ remove_multiple ()
|
||||
# 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
|
||||
}
|
||||
|
||||
|
@ -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 @@ grow_ffs()
|
||||
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 @@ grow_ffs()
|
||||
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
|
||||
}
|
||||
|
||||
|
@ -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 @@ shrink_ffs()
|
||||
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 @@ shrink_ffs()
|
||||
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 @@ shrink_ffs()
|
||||
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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user