aboutsummaryrefslogtreecommitdiff
path: root/tests/zfs-tests/tests/functional/online_offline/online_offline_002_neg.ksh
diff options
context:
space:
mode:
authorJohn Wren Kennedy <john.kennedy@delphix.com>2017-04-06 00:18:22 +0000
committerBrian Behlendorf <behlendorf1@llnl.gov>2017-04-06 16:25:36 +0000
commitc1d9abf9059a19c2b48eaa645dbce2e1fba3e0b1 (patch)
treee10f847d69d44292b0b641324cc5007b8c4badff /tests/zfs-tests/tests/functional/online_offline/online_offline_002_neg.ksh
parent7a4500a10102c00a67442628df2ac2395484757e (diff)
downloadsrc-c1d9abf9059a19c2b48eaa645dbce2e1fba3e0b1.tar.gz
src-c1d9abf9059a19c2b48eaa645dbce2e1fba3e0b1.zip
OpenZFS 7290 - ZFS test suite needs to control what utilities it can run
Authored by: John Wren Kennedy <john.kennedy@delphix.com> Reviewed by: Dan Kimmel <dan.kimmel@delphix.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Dan McDonald <danmcd@omniti.com> Approved by: Gordon Ross <gordon.w.ross@gmail.com> Ported-by: Brian Behlendorf <behlendorf1@llnl.gov> Ported-by: George Melikov <mail@gmelikov.ru> Porting Notes: - Utilities which aren't available under Linux have been removed. - Because of sudo's default secure path behavior PATH must be explicitly reset at the top of libtest.shlib. This avoids the need for all users to customize secure path on their system. - Updated ZoL infrastructure to manage constrained path - Updated all test cases - Check permissions for usergroup tests - When testing in-tree create links under bin/ - Update fault cleanup such that missing files during cleanup aren't fatal. - Configure su environment with constrained path OpenZFS-issue: https://www.illumos.org/issues/7290 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/1d32ba6 Closes #5903
Diffstat (limited to 'tests/zfs-tests/tests/functional/online_offline/online_offline_002_neg.ksh')
-rwxr-xr-xtests/zfs-tests/tests/functional/online_offline/online_offline_002_neg.ksh26
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/zfs-tests/tests/functional/online_offline/online_offline_002_neg.ksh b/tests/zfs-tests/tests/functional/online_offline/online_offline_002_neg.ksh
index 12c191a03aa4..2f32e21e9011 100755
--- a/tests/zfs-tests/tests/functional/online_offline/online_offline_002_neg.ksh
+++ b/tests/zfs-tests/tests/functional/online_offline/online_offline_002_neg.ksh
@@ -26,7 +26,7 @@
#
#
-# Copyright (c) 2013, 2014 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
@@ -53,7 +53,7 @@ function cleanup
# Ensure we don't leave disks in the offline state
#
for disk in $DISKLIST; do
- log_must $ZPOOL online $TESTPOOL $disk
+ log_must zpool online $TESTPOOL $disk
check_state $TESTPOOL $disk "online"
if [[ $? != 0 ]]; then
log_fail "Unable to online $disk"
@@ -61,15 +61,15 @@ function cleanup
done
- $KILL $killpid >/dev/null 2>&1
- [[ -e $TESTDIR ]] && log_must $RM -rf $TESTDIR/*
+ kill $killpid >/dev/null 2>&1
+ [[ -e $TESTDIR ]] && log_must rm -rf $TESTDIR/*
}
log_assert "Turning both disks offline should fail."
log_onexit cleanup
-$FILE_TRUNC -f $((64 * 1024 * 1024)) -b 8192 -c 0 -r $TESTDIR/$TESTFILE1 &
+file_trunc -f $((64 * 1024 * 1024)) -b 8192 -c 0 -r $TESTDIR/$TESTFILE1 &
typeset killpid="$! "
disks=($DISKLIST)
@@ -79,14 +79,14 @@ disks=($DISKLIST)
# all but one vdev offlined, whereas with raidz there can be only one.
#
pooltype='mirror'
-$ZPOOL list -v $TESTPOOL | $GREP raidz >/dev/null 2>&1 && pooltype='raidz'
+zpool list -v $TESTPOOL | grep raidz >/dev/null 2>&1 && pooltype='raidz'
typeset -i i=0
while [[ $i -lt ${#disks[*]} ]]; do
typeset -i j=0
if [[ $pooltype = 'mirror' ]]; then
# Hold one disk online, verify the others can be offlined.
- log_must $ZPOOL online $TESTPOOL ${disks[$i]}
+ log_must zpool online $TESTPOOL ${disks[$i]}
check_state $TESTPOOL ${disks[$i]} "online" || \
log_fail "Failed to set ${disks[$i]} online"
while [[ $j -lt ${#disks[*]} ]]; do
@@ -94,14 +94,14 @@ while [[ $i -lt ${#disks[*]} ]]; do
((j++))
continue
fi
- log_must $ZPOOL offline $TESTPOOL ${disks[$j]}
+ log_must zpool offline $TESTPOOL ${disks[$j]}
check_state $TESTPOOL ${disks[$j]} "offline" || \
log_fail "Failed to set ${disks[$j]} offline"
((j++))
done
elif [[ $pooltype = 'raidz' ]]; then
# Hold one disk offline, verify the others can't be offlined.
- log_must $ZPOOL offline $TESTPOOL ${disks[$i]}
+ log_must zpool offline $TESTPOOL ${disks[$i]}
check_state $TESTPOOL ${disks[$i]} "offline" || \
log_fail "Failed to set ${disks[$i]} offline"
while [[ $j -lt ${#disks[*]} ]]; do
@@ -109,22 +109,22 @@ while [[ $i -lt ${#disks[*]} ]]; do
((j++))
continue
fi
- log_mustnot $ZPOOL offline $TESTPOOL ${disks[$j]}
+ log_mustnot zpool offline $TESTPOOL ${disks[$j]}
check_state $TESTPOOL ${disks[$j]} "online" || \
log_fail "Failed to set ${disks[$j]} online"
check_state $TESTPOOL ${disks[$i]} "offline" || \
log_fail "Failed to set ${disks[$i]} offline"
((j++))
done
- log_must $ZPOOL online $TESTPOOL ${disks[$i]}
+ log_must zpool online $TESTPOOL ${disks[$i]}
check_state $TESTPOOL ${disks[$i]} "online" || \
log_fail "Failed to set ${disks[$i]} online"
fi
((i++))
done
-log_must $KILL $killpid
-$SYNC
+log_must kill $killpid
+sync
typeset dir=$(get_device_dir $DISKS)
verify_filesys "$TESTPOOL" "$TESTPOOL/$TESTFS" "$dir"