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 2007 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
29 # Copyright (c) 2016 by Delphix. All rights reserved.
32 . $STF_SUITE/include/libtest.shlib
33 . $STF_SUITE/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
37 # Setting a valid value to atime, readonly, setuid or zoned on file
38 # system or volume. It should be successful.
41 # 1. Create pool and filesystem & volume within it.
42 # 2. Setting valid value, it should be successful.
45 verify_runnable "both"
54 set -A props "atime" "readonly" "setuid"
60 set -A values "on" "off"
62 if is_global_zone ; then
63 set -A dataset "$TESTPOOL/$TESTFS" "$TESTPOOL/$TESTCTR" "$TESTPOOL/$TESTVOL"
65 set -A dataset "$TESTPOOL/$TESTFS" "$TESTPOOL/$TESTCTR"
68 log_assert "Setting a valid value to atime, readonly, setuid or zoned on file" \
69 "system or volume. It should be successful."
74 while (( i < ${#dataset[@]} )); do
76 while (( j < ${#props[@]} )); do
78 while (( k < ${#values[@]} )); do
79 if [[ ${dataset[i]} == "$TESTPOOL/$TESTVOL" && \
80 ${props[j]} != "readonly" ]]
82 set_n_check_prop "${values[k]}" "${props[j]}" \
83 "${dataset[i]}" "false"
84 elif [[ ${props[j]} == "zoned" ]] ; then
85 if is_global_zone ; then
87 "${values[k]}" "${props[j]}" \
91 "${values[k]}" "${props[j]}" \
92 "${dataset[i]}" "false"
96 set_n_check_prop "${values[k]}" "${props[j]}" \
107 log_pass "Setting a valid value to atime, readonly, setuid or zoned on file" \
108 "system or volume pass."