File tree 3 files changed +8
-13
lines changed
tests/zfs-tests/tests/functional/online_offline
3 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -50,16 +50,17 @@ DISKLIST=$(get_disklist $TESTPOOL)
50
50
51
51
function cleanup
52
52
{
53
+ kill $killpid > /dev/null 2>&1
54
+
53
55
#
54
56
# Ensure we don't leave disks in the offline state
55
57
#
56
58
for disk in $DISKLIST ; do
57
59
log_must zpool online $TESTPOOL $disk
58
60
log_must check_state $TESTPOOL $disk " online"
59
-
60
61
done
62
+ log_must zpool wait -t resilver $TESTPOOL
61
63
62
- kill $killpid > /dev/null 2>&1
63
64
[[ -e $TESTDIR ]] && log_must rm -rf $TESTDIR /*
64
65
}
65
66
@@ -77,8 +78,7 @@ for disk in $DISKLIST; do
77
78
log_must zpool online $TESTPOOL $disk
78
79
log_must check_state $TESTPOOL $disk " online"
79
80
80
- # Delay for resilver to complete
81
- sleep 3
81
+ log_must zpool wait -t resilver $TESTPOOL
82
82
done
83
83
84
84
log_must kill $killpid
Original file line number Diff line number Diff line change @@ -51,15 +51,17 @@ DISKLIST=$(get_disklist $TESTPOOL)
51
51
52
52
function cleanup
53
53
{
54
+ kill $killpid > /dev/null 2>&1
55
+
54
56
#
55
57
# Ensure we don't leave disks in the offline state
56
58
#
57
59
for disk in $DISKLIST ; do
58
60
log_must zpool online $TESTPOOL $disk
59
61
log_must check_state $TESTPOOL $disk " online"
60
62
done
63
+ log_must zpool wait -t resilver $TESTPOOL
61
64
62
- kill $killpid > /dev/null 2>&1
63
65
[[ -e $TESTDIR ]] && log_must rm -rf $TESTDIR /*
64
66
}
65
67
Original file line number Diff line number Diff line change @@ -49,7 +49,6 @@ function cleanup
49
49
destroy_pool $TESTPOOL1
50
50
fi
51
51
52
- kill $killpid > /dev/null 2>&1
53
52
[[ -e $TESTDIR ]] && log_must rm -rf $TESTDIR /*
54
53
}
55
54
@@ -59,7 +58,7 @@ log_onexit cleanup
59
58
60
59
specials_list=" "
61
60
for i in 0 1 2; do
62
- mkfile $MINVDEVSIZE $TESTDIR /$TESTFILE1 .$i
61
+ log_must mkfile $MINVDEVSIZE $TESTDIR /$TESTFILE1 .$i
63
62
specials_list=" $specials_list $TESTDIR /$TESTFILE1 .$i "
64
63
done
65
64
disk=($specials_list )
@@ -68,15 +67,9 @@ create_pool $TESTPOOL1 $specials_list
68
67
log_must zfs create $TESTPOOL1 /$TESTFS1
69
68
log_must zfs set mountpoint=$TESTDIR1 $TESTPOOL1 /$TESTFS1
70
69
71
- file_trunc -f $(( 64 * 1024 * 1024 )) -b 8192 -c 0 -r $TESTDIR /$TESTFILE1 &
72
- typeset killpid=" $! "
73
-
74
70
for i in 0 1 2; do
75
71
log_mustnot zpool offline $TESTPOOL1 ${disk[$i]}
76
72
check_state $TESTPOOL1 ${disk[$i]} " online"
77
73
done
78
74
79
- log_must kill $killpid
80
- sync_all_pools
81
-
82
75
log_pass
You can’t perform that action at this time.
0 commit comments