Print this page
NEX-3974 Remove timing issues so the robot can run consistently
Reviewed by: Steve Peng <steve.peng@nexenta.com>
Reviewed by: Josef Sipek <josef.sipek@nexenta.com>
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
4206 history_003_pos relies on exact size of history log and entries
4207 history_008_pos depends on obsolete internal history log message
4208 Typo in zfs_main.c: "posxiuser"
4209 Populate zfstest with the remainder of the STF tests
Reviewed by: Sonu Pillai <sonu.pillai@delphix.com>
Reviewed by: Will Guyette <will.guyette@delphix.com>
Reviewed by: Eric Diven <eric.diven@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/test/zfs-tests/tests/functional/slog/slog.kshlib
+++ new/usr/src/test/zfs-tests/tests/functional/slog/slog.kshlib
1 1 #
2 2 # CDDL HEADER START
3 3 #
4 4 # The contents of this file are subject to the terms of the
5 5 # Common Development and Distribution License (the "License").
6 6 # You may not use this file except in compliance with the License.
7 7 #
8 8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 # or http://www.opensolaris.org/os/licensing.
10 10 # See the License for the specific language governing permissions
11 11 # and limitations under the License.
12 12 #
13 13 # When distributing Covered Code, include this CDDL HEADER in each
14 14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 # If applicable, add the following below this CDDL HEADER, with the
16 16 # fields enclosed by brackets "[]" replaced with your own identifying
17 17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 18 #
|
↓ open down ↓ |
18 lines elided |
↑ open up ↑ |
19 19 # CDDL HEADER END
20 20 #
21 21
22 22 #
23 23 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 24 # Use is subject to license terms.
25 25 #
26 26
27 27 #
28 28 # Copyright (c) 2013, 2016 by Delphix. All rights reserved.
29 +# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
29 30 #
30 31
31 32 . $STF_SUITE/include/libtest.shlib
32 33 . $STF_SUITE/tests/functional/slog/slog.cfg
33 34
34 35 function cleanup
35 36 {
36 37 if datasetexists $TESTPOOL ; then
37 - log_must zpool destroy -f $TESTPOOL
38 + log_must destroy_pool $TESTPOOL
38 39 fi
39 40 if datasetexists $TESTPOOL2 ; then
40 - log_must zpool destroy -f $TESTPOOL2
41 + log_must destroy_pool $TESTPOOL2
41 42 fi
42 43 }
43 44
44 45 #
45 46 # Try zpool status/iostat for given pool
46 47 #
47 48 # $1 pool
48 49 #
49 50 function display_status
50 51 {
51 52 typeset pool=$1
52 53
53 54 typeset -i ret=0
54 55 zpool status -xv $pool > /dev/null 2>&1
55 56 ret=$?
56 57
57 58 zpool iostat > /dev/null 2>&1
58 59 ((ret |= $?))
59 60
60 61 typeset mntpnt=$(get_prop mountpoint $pool)
61 62 dd if=/dev/random of=$mntpnt/testfile.$$ &
62 63 typeset pid=$!
63 64
64 65 zpool iostat -v 1 3 > /dev/null
65 66 ((ret |= $?))
66 67
67 68 kill -9 $pid
68 69
69 70 return $ret
70 71 }
71 72
72 73 #
73 74 # Verify the give slog device have correct type and status
74 75 #
75 76 # $1 pool name
76 77 # $2 device name
77 78 # $3 device status
78 79 # $4 device type
79 80 #
80 81 function verify_slog_device
81 82 {
82 83 typeset pool=$1
83 84 typeset device=$2
84 85 typeset status=$3
85 86 typeset type=$4
86 87
87 88 if [[ -z $pool || -z $device || -z $status ]]; then
88 89 log_fail "Usage: verify_slog_device <pool> <device> " \
89 90 "<status> [type]"
90 91 fi
91 92
92 93 #
93 94 # Get all the slog devices and status table like below
94 95 #
95 96 # mirror:/disks/d ONLINE mirror:/disks/e ONLINE stripe:/disks/f ONLINE
96 97 #
97 98 set -A dev_stat_tab $(zpool status -v $pool | nawk 'BEGIN {start=0} \
98 99 /\tlogs/ {start=1}
99 100 /\tmirror/ || /\tspares/ || /^$/ {start=0}
100 101 (start==1) && /\t (\/|[a-zA-Z])/ \
101 102 {print "stripe:" $1 " " $2}
102 103 (start==1) && /\t (\/|[a-zA-Z])/ \
103 104 {print "mirror:" $1 " " $2}
104 105 # When hotspare is replacing
105 106 (start==1) && /\t (\/|[a-zA-Z])/ \
106 107 {print "mirror:" $1 " " $2}'
107 108 )
108 109
109 110 typeset -i i=0
110 111 typeset find=0
111 112 while (( i < ${#dev_stat_tab[@]} )); do
112 113 typeset dev=${dev_stat_tab[$i]}
113 114 typeset stat=${dev_stat_tab[((i+1))]}
114 115
115 116 case $dev in
116 117 stripe:$device)
117 118 if [[ "$type" == 'mirror' ]]; then
118 119 log_note "Unexpected type: mirror"
119 120 return 1
120 121 else
121 122 if [[ $stat != $status ]]; then
122 123 log_note "Status($stat) " \
123 124 "!= Expected stat($status)"
124 125 return 1
125 126 fi
126 127 return 0
127 128 fi
128 129 ;;
129 130 mirror:$device)
130 131 if [[ -z "$type" || $type == 'stripe' ]]; then
131 132 log_note "Unexpected type: stripe"
132 133 return 1
133 134 else
134 135 if [[ $stat != $status ]]; then
135 136 log_note "Status($stat) " \
136 137 "!= Expected stat($status)"
137 138 return 1
138 139 fi
139 140 return 0
140 141 fi
141 142 ;;
142 143 esac
143 144
144 145 ((i += 2))
145 146 done
146 147
147 148 log_note "Can not find device: $device"
148 149
149 150 return 1
150 151 }
|
↓ open down ↓ |
100 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX