File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
tests/zfs-tests/tests/functional/cli_root/zfs Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 45
45
46
46
verify_runnable " global"
47
47
48
+ function cleanup
49
+ {
50
+ for file in $ZFS_DEV $MNTTAB ; do
51
+ log_must eval " [ -e ${file} ] || mv ${file} .bak $file "
52
+ done
53
+ }
54
+
48
55
log_assert " zfs fails with unexpected scenario."
56
+ log_onexit cleanup
49
57
50
58
# verify zfs failed if ZFS_DEV cannot be opened
51
59
ZFS_DEV=/dev/zfs
@@ -56,13 +64,11 @@ if is_linux; then
56
64
fi
57
65
58
66
for file in $ZFS_DEV $MNTTAB ; do
59
- if [[ -e $file ]]; then
60
- mv $file ${file} .bak
61
- fi
67
+ log_must mv $file ${file} .bak
62
68
for cmd in " " " list" " get all" " mount" ; do
63
69
log_mustnot eval " zfs $cmd >/dev/null 2>&1"
64
70
done
65
- mv ${file} .bak $file
71
+ log_must mv ${file} .bak $file
66
72
done
67
73
68
74
log_pass " zfs fails with unexpected scenario as expected."
You can’t perform that action at this time.
0 commit comments