Port vnd_test to FreeBSD
Use mdmfs/mdconfig instead of vndconfig/newfs. vndconfig doesn't exist on FreeBSD. TODO: need to parameterize out the md(4) device as it's currently hardcoded to "3" (in both the FreeBSD and NetBSD cases). MFC after: 1 month Sponsored by: Dell EMC Isilon
This commit is contained in:
parent
9e2df3fd22
commit
9eb992cdc6
@ -38,12 +38,21 @@ basic_body() {
|
||||
|
||||
atf_check -s eq:0 -o ignore -e ignore \
|
||||
dd if=/dev/zero of=disk.img bs=1m count=10
|
||||
# Begin FreeBSD
|
||||
if true; then
|
||||
atf_check -s eq:0 -o empty -e empty mkdir mnt
|
||||
atf_check -s eq:0 -o empty -e empty mdmfs -F disk.img md3 mnt
|
||||
else
|
||||
# End FreeBSD
|
||||
atf_check -s eq:0 -o empty -e empty vndconfig /dev/vnd3 disk.img
|
||||
|
||||
atf_check -s eq:0 -o ignore -e ignore newfs /dev/rvnd3a
|
||||
|
||||
atf_check -s eq:0 -o empty -e empty mkdir mnt
|
||||
atf_check -s eq:0 -o empty -e empty mount /dev/vnd3a mnt
|
||||
# Begin FreeBSD
|
||||
fi
|
||||
# End FreeBSD
|
||||
|
||||
echo "Creating test files"
|
||||
for f in $(jot -w %u 100 | uniq); do
|
||||
@ -58,7 +67,15 @@ basic_body() {
|
||||
done
|
||||
|
||||
atf_check -s eq:0 -o empty -e empty umount mnt
|
||||
# Begin FreeBSD
|
||||
if true; then
|
||||
atf_check -s eq:0 -o empty -e empty mdconfig -d -u 3
|
||||
else
|
||||
# End FreeBSD
|
||||
atf_check -s eq:0 -o empty -e empty vndconfig -u /dev/vnd3
|
||||
# Begin FreeBSD
|
||||
fi
|
||||
# End FreeBSD
|
||||
|
||||
test_unmount
|
||||
touch done
|
||||
@ -66,7 +83,15 @@ basic_body() {
|
||||
basic_cleanup() {
|
||||
if [ ! -f done ]; then
|
||||
umount mnt 2>/dev/null 1>&2
|
||||
# Begin FreeBSD
|
||||
if true; then
|
||||
atf_check -s eq:0 -o empty -e empty mdconfig -d -u 3
|
||||
else
|
||||
# End FreeBSD
|
||||
vndconfig -u /dev/vnd3 2>/dev/null 1>&2
|
||||
# Begin FreeBSD
|
||||
fi
|
||||
# End FreeBSD
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user