5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
24 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
29 # Copyright (c) 2013, 2016 by Delphix. All rights reserved.
32 . $STF_SUITE/tests/functional/history/history_common.kshlib
36 # Verify the delegation internal history are correctly.
39 # 1. Create test group and user.
40 # 2. Define permission sets and verify the internal history correctly.
41 # 3. Separately verify the internal history above is correct.
44 verify_runnable "global"
52 log_assert "Verify delegated commands are logged in the pool history."
55 testfs=$TESTPOOL/$TESTFS
56 # Create history test group and user and get user id and group id
58 add_user $HIST_GROUP $HIST_USER
60 # subcmd allow_options
61 array=( "allow" "-s @basic snapshot"
62 "allow" "-s @set @basic"
67 "allow" "-l -u $HIST_USER snapshot"
68 "allow" "-u $HIST_USER snapshot"
69 "unallow" "-u $HIST_USER snapshot"
70 "allow" "-l -u $HIST_USER @set"
71 "allow" "-u $HIST_USER @set"
72 "unallow" "-u $HIST_USER @set"
73 "allow" "-d -u $HIST_USER snapshot"
74 "allow" "-u $HIST_USER snapshot"
75 "unallow" "-u $HIST_USER snapshot"
76 "allow" "-d -u $HIST_USER @set"
77 "allow" "-u $HIST_USER @set"
78 "unallow" "-u $HIST_USER @set"
79 "allow" "-l -g $HIST_GROUP snapshot"
80 "allow" "-g $HIST_GROUP snapshot"
81 "unallow" "-g $HIST_GROUP snapshot"
82 "allow" "-l -g $HIST_GROUP @set"
83 "allow" "-g $HIST_GROUP @set"
84 "unallow" "-g $HIST_GROUP @set"
85 "allow" "-d -g $HIST_GROUP snapshot"
86 "allow" "-g $HIST_GROUP snapshot"
87 "unallow" "-g $HIST_GROUP snapshot"
88 "allow" "-d -g $HIST_GROUP @set"
89 "allow" "-g $HIST_GROUP @set"
90 "unallow" "-g $HIST_GROUP @set"
91 "allow" "-l -e snapshot"
93 "unallow" "-e snapshot"
97 "allow" "-d -e snapshot"
99 "unallow" "-e snapshot"
106 while ((i < ${#array[@]})); do
108 options=${array[((i + 1))]}
110 run_and_verify "zfs $subcmd $options $testfs" "-i"
114 log_pass "Verify delegated commands are logged in the pool history."