Print this page
7290 ZFS test suite needs to control what utilities it can run
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/test/zfs-tests/tests/functional/nopwrite/nopwrite.shlib
+++ new/usr/src/test/zfs-tests/tests/functional/nopwrite/nopwrite.shlib
1 1 #
2 2 # This file and its contents are supplied under the terms of the
|
↓ open down ↓ |
2 lines elided |
↑ open up ↑ |
3 3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 4 # You may only use this file in accordance with the terms of version
5 5 # 1.0 of the CDDL.
6 6 #
7 7 # A full copy of the text of the CDDL should have accompanied this
8 8 # source. A copy of the CDDL is also available via the Internet at
9 9 # http://www.illumos.org/license/CDDL.
10 10 #
11 11
12 12 #
13 -# Copyright (c) 2012 by Delphix. All rights reserved.
13 +# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
14 14 #
15 15
16 16 . $STF_SUITE/include/math.shlib
17 17
18 18 export TESTVOL="testvol.nopwrite"
19 19 export VOLSIZE="256M"
20 20 export MEGS="64"
21 21
22 22 function verify_nopwrite
23 23 {
24 24 typeset origin=$1
25 25 typeset snap=$2
26 26 typeset clone=$3
27 27 typeset low=1
28 28 typeset high=99
29 29
30 - $SYNC
30 + sync
31 31 for i in origin snap clone; do
32 32 for j in used refer usedbychildren written; do
33 33 typeset ${i}_$j=$(get_prop $j $(eval echo \$$i))
34 34 done
35 35 done
36 36
37 37 #
38 38 # If we are dealing with a volume, deduct the refreserv from the used
39 39 # value to prevent real failures from being masked by the unexpected
40 40 # extra space. Also, volumes use more space for metadata, so adjust the
41 41 # percentages to be more forgiving.
42 42 #
43 43 if [[ "$(get_prop type $origin)" = "volume" ]]; then
44 44 typeset rr=$(get_prop refreserv $origin)
45 45 ((origin_used -= rr ))
46 46 low=2
47 47 high=98
48 48 fi
49 49
50 50 # These values should differ greatly with nopwrite.
51 51 within_percent $origin_used $clone_used $low && return 1
52 52 within_percent $origin_refer $origin_usedbychildren $low && return 1
|
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
53 53 within_percent $snap_written $clone_written $low && return 1
54 54
55 55 # These values should be nearly the same with nopwrite.
56 56 within_percent $origin_used $clone_refer $high || return 1
57 57 within_percent $origin_used $snap_refer $high || return 1
58 58
59 59 #
60 60 # The comparisons below should pass regardless of nopwrite. They're
61 61 # here for sanity.
62 62 #
63 - typeset deadlist=$($ZDB -Pddd $clone | $AWK '/Deadlist:/ {print $2}')
63 + typeset deadlist=$(zdb -Pddd $clone | awk '/Deadlist:/ {print $2}')
64 64 within_percent $deadlist $clone_written $high || return 1
65 65 within_percent $snap_refer $snap_written $high || return 1
66 66
67 67 return 0
68 68 }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX