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/snapshot/snapshot_016_pos.ksh
+++ new/usr/src/test/zfs-tests/tests/functional/snapshot/snapshot_016_pos.ksh
1 1 #!/bin/ksh -p
2 2 #
3 3 # CDDL HEADER START
4 4 #
5 5 # The contents of this file are subject to the terms of the
6 6 # Common Development and Distribution License (the "License").
7 7 # You may not use this file except in compliance with the License.
8 8 #
9 9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 # or http://www.opensolaris.org/os/licensing.
11 11 # See the License for the specific language governing permissions
12 12 # and limitations under the License.
13 13 #
14 14 # When distributing Covered Code, include this CDDL HEADER in each
15 15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 # If applicable, add the following below this CDDL HEADER, with the
17 17 # fields enclosed by brackets "[]" replaced with your own identifying
18 18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 19 #
|
↓ open down ↓ |
19 lines elided |
↑ open up ↑ |
20 20 # CDDL HEADER END
21 21 #
22 22
23 23 #
24 24 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
25 25 # Use is subject to license terms.
26 26 #
27 27
28 28
29 29 #
30 -# Copyright (c) 2013 by Delphix. All rights reserved.
30 +# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
31 31 #
32 32
33 33 . $STF_SUITE/include/libtest.shlib
34 34 . $STF_SUITE/tests/functional/snapshot/snapshot.cfg
35 35
36 36 #
37 37 # DESCRIPTION:
38 38 # Verify renamed snapshots via mv can be destroyed
39 39 #
40 40 # STRATEGY:
41 41 # 1. Create snapshot
42 42 # 2. Rename the snapshot via mv command
43 43 # 2. Verify destroying the renamed snapshot via 'zfs destroy' succeeds
44 44 #
45 45
46 46 verify_runnable "both"
47 47
48 48 function cleanup
49 49 {
50 50 datasetexists $SNAPFS && \
51 - log_must $ZFS destroy -Rf $SNAPFS
51 + log_must zfs destroy -Rf $SNAPFS
52 52 datasetexists $TESTPOOL/$TESTFS@snap_a && \
53 - log_must $ZFS destroy -Rf $TESTPOOL/$TESTFS@snap_a
53 + log_must zfs destroy -Rf $TESTPOOL/$TESTFS@snap_a
54 54 datasetexists $TESTPOOL/$TESTCLONE@snap_a && \
55 - log_must $ZFS destroy -Rf $TESTPOOL/$TESTCLONE@snap_a
55 + log_must zfs destroy -Rf $TESTPOOL/$TESTCLONE@snap_a
56 56
57 57 datasetexists $TESTPOOL/$TESTCLONE && \
58 - log_must $ZFS destroy $TESTPOOL/$TESTCLONE
58 + log_must zfs destroy $TESTPOOL/$TESTCLONE
59 59 datasetexists $TESTPOOL/$TESTFS && \
60 - log_must $ZFS destroy $TESTPOOL/$TESTFS
60 + log_must zfs destroy $TESTPOOL/$TESTFS
61 61
62 - log_must $ZFS create $TESTPOOL/$TESTFS
63 - log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
62 + log_must zfs create $TESTPOOL/$TESTFS
63 + log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
64 64 }
65 65
66 66 log_assert "Verify renamed snapshots via mv can be destroyed."
67 67 log_onexit cleanup
68 68
69 69 # scenario 1
70 70
71 -log_must $ZFS snapshot $SNAPFS
72 -log_must $MV $TESTDIR/$SNAPROOT/$TESTSNAP $TESTDIR/$SNAPROOT/snap_a
71 +log_must zfs snapshot $SNAPFS
72 +log_must mv $TESTDIR/$SNAPROOT/$TESTSNAP $TESTDIR/$SNAPROOT/snap_a
73 73
74 74 datasetexists $TESTPOOL/$TESTFS@snap_a || \
75 75 log_fail "rename snapshot via mv in .zfs/snapshot fails."
76 -log_must $ZFS destroy $TESTPOOL/$TESTFS@snap_a
76 +log_must zfs destroy $TESTPOOL/$TESTFS@snap_a
77 77
78 78 # scenario 2
79 79
80 -log_must $ZFS snapshot $SNAPFS
81 -log_must $ZFS clone $SNAPFS $TESTPOOL/$TESTCLONE
82 -log_must $MV $TESTDIR/$SNAPROOT/$TESTSNAP $TESTDIR/$SNAPROOT/snap_a
80 +log_must zfs snapshot $SNAPFS
81 +log_must zfs clone $SNAPFS $TESTPOOL/$TESTCLONE
82 +log_must mv $TESTDIR/$SNAPROOT/$TESTSNAP $TESTDIR/$SNAPROOT/snap_a
83 83
84 84 datasetexists $TESTPOOL/$TESTFS@snap_a || \
85 85 log_fail "rename snapshot via mv in .zfs/snapshot fails."
86 -log_must $ZFS promote $TESTPOOL/$TESTCLONE
86 +log_must zfs promote $TESTPOOL/$TESTCLONE
87 87 # promote back to $TESTPOOL/$TESTFS for scenario 3
88 -log_must $ZFS promote $TESTPOOL/$TESTFS
89 -log_must $ZFS destroy $TESTPOOL/$TESTCLONE
90 -log_must $ZFS destroy $TESTPOOL/$TESTFS@snap_a
88 +log_must zfs promote $TESTPOOL/$TESTFS
89 +log_must zfs destroy $TESTPOOL/$TESTCLONE
90 +log_must zfs destroy $TESTPOOL/$TESTFS@snap_a
91 91
92 92 # scenario 3
93 93
94 -log_must $ZFS snapshot $SNAPFS
95 -log_must $ZFS clone $SNAPFS $TESTPOOL/$TESTCLONE
96 -log_must $ZFS rename $SNAPFS $TESTPOOL/$TESTFS@snap_a
97 -log_must $ZFS promote $TESTPOOL/$TESTCLONE
98 -log_must $ZFS destroy $TESTPOOL/$TESTFS
99 -log_must $ZFS destroy $TESTPOOL/$TESTCLONE@snap_a
94 +log_must zfs snapshot $SNAPFS
95 +log_must zfs clone $SNAPFS $TESTPOOL/$TESTCLONE
96 +log_must zfs rename $SNAPFS $TESTPOOL/$TESTFS@snap_a
97 +log_must zfs promote $TESTPOOL/$TESTCLONE
98 +log_must zfs destroy $TESTPOOL/$TESTFS
99 +log_must zfs destroy $TESTPOOL/$TESTCLONE@snap_a
100 100
101 101 log_pass "Verify renamed snapshots via mv can be destroyed."
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX