testing: skip tarfs tests if module is not loadable.
Approved by: asomers Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D38828
This commit is contained in:
parent
0c42886449
commit
e78dc78e51
@ -38,6 +38,7 @@ tarfs_basic_head() {
|
|||||||
atf_set "require.user" "root"
|
atf_set "require.user" "root"
|
||||||
}
|
}
|
||||||
tarfs_basic_body() {
|
tarfs_basic_body() {
|
||||||
|
kldload -n tarfs || atf_skip "This test requires tarfs and could not load it"
|
||||||
mkdir "${mnt}"
|
mkdir "${mnt}"
|
||||||
"${mktar}" tarfs_test.tar.zst
|
"${mktar}" tarfs_test.tar.zst
|
||||||
atf_check mount -rt tarfs tarfs_test.tar.zst "${mnt}"
|
atf_check mount -rt tarfs tarfs_test.tar.zst "${mnt}"
|
||||||
@ -47,7 +48,7 @@ tarfs_basic_body() {
|
|||||||
atf_check_equal "$(sha256 -q "${mnt}"/sparse_file)" ${sum}
|
atf_check_equal "$(sha256 -q "${mnt}"/sparse_file)" ${sum}
|
||||||
}
|
}
|
||||||
tarfs_basic_cleanup() {
|
tarfs_basic_cleanup() {
|
||||||
umount "${mnt}"
|
umount "${mnt}" || true
|
||||||
}
|
}
|
||||||
|
|
||||||
atf_test_case tarfs_notdir_device cleanup
|
atf_test_case tarfs_notdir_device cleanup
|
||||||
@ -56,6 +57,7 @@ tarfs_notdir_device_head() {
|
|||||||
atf_set "require.user" "root"
|
atf_set "require.user" "root"
|
||||||
}
|
}
|
||||||
tarfs_notdir_device_body() {
|
tarfs_notdir_device_body() {
|
||||||
|
kldload -n tarfs || atf_skip "This test requires tarfs and could not load it"
|
||||||
mkdir "${mnt}"
|
mkdir "${mnt}"
|
||||||
atf_check mknod d b 0xdead 0xbeef
|
atf_check mknod d b 0xdead 0xbeef
|
||||||
tar cf tarfs_notdir.tar d
|
tar cf tarfs_notdir.tar d
|
||||||
@ -76,6 +78,7 @@ tarfs_notdir_dot_head() {
|
|||||||
atf_set "require.user" "root"
|
atf_set "require.user" "root"
|
||||||
}
|
}
|
||||||
tarfs_notdir_dot_body() {
|
tarfs_notdir_dot_body() {
|
||||||
|
kldload -n tarfs || atf_skip "This test requires tarfs and could not load it"
|
||||||
mkdir "${mnt}"
|
mkdir "${mnt}"
|
||||||
echo "hello" >d
|
echo "hello" >d
|
||||||
tar cf tarfs_notdir.tar d
|
tar cf tarfs_notdir.tar d
|
||||||
@ -96,6 +99,7 @@ tarfs_notdir_dotdot_head() {
|
|||||||
atf_set "require.user" "root"
|
atf_set "require.user" "root"
|
||||||
}
|
}
|
||||||
tarfs_notdir_dotdot_body() {
|
tarfs_notdir_dotdot_body() {
|
||||||
|
kldload -n tarfs || atf_skip "This test requires tarfs and could not load it"
|
||||||
mkdir "${mnt}"
|
mkdir "${mnt}"
|
||||||
echo "hello" >d
|
echo "hello" >d
|
||||||
tar cf tarfs_notdir.tar d
|
tar cf tarfs_notdir.tar d
|
||||||
@ -116,6 +120,7 @@ tarfs_notdir_file_head() {
|
|||||||
atf_set "require.user" "root"
|
atf_set "require.user" "root"
|
||||||
}
|
}
|
||||||
tarfs_notdir_file_body() {
|
tarfs_notdir_file_body() {
|
||||||
|
kldload -n tarfs || atf_skip "This test requires tarfs and could not load it"
|
||||||
mkdir "${mnt}"
|
mkdir "${mnt}"
|
||||||
echo "hello" >d
|
echo "hello" >d
|
||||||
tar cf tarfs_notdir.tar d
|
tar cf tarfs_notdir.tar d
|
||||||
|
Loading…
Reference in New Issue
Block a user