|
| 1 | +#!/bin/ksh -p |
| 2 | +# SPDX-License-Identifier: CDDL-1.0 |
| 3 | +# |
| 4 | +# CDDL HEADER START |
| 5 | +# |
| 6 | +# The contents of this file are subject to the terms of the |
| 7 | +# Common Development and Distribution License (the "License"). |
| 8 | +# You may not use this file except in compliance with the License. |
| 9 | +# |
| 10 | +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
| 11 | +# or https://opensource.org/licenses/CDDL-1.0. |
| 12 | +# See the License for the specific language governing permissions |
| 13 | +# and limitations under the License. |
| 14 | +# |
| 15 | +# When distributing Covered Code, include this CDDL HEADER in each |
| 16 | +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
| 17 | +# If applicable, add the following below this CDDL HEADER, with the |
| 18 | +# fields enclosed by brackets "[]" replaced with your own identifying |
| 19 | +# information: Portions Copyright [yyyy] [name of copyright owner] |
| 20 | +# |
| 21 | +# CDDL HEADER END |
| 22 | +# |
| 23 | + |
| 24 | +# |
| 25 | +# Copyright (c) 2025 by Klara, Inc. |
| 26 | +# |
| 27 | + |
| 28 | +. $STF_SUITE/include/libtest.shlib |
| 29 | +. $STF_SUITE/tests/functional/xattr/xattr_common.kshlib |
| 30 | + |
| 31 | +# |
| 32 | +# DESCRIPTION: |
| 33 | +# The default xattr should be shown as 'sa', not 'on', for clarity. |
| 34 | +# |
| 35 | +# STRATEGY: |
| 36 | +# 1. Create a filesystem. |
| 37 | +# 2. Verify that the xattra is shown as 'sa'. |
| 38 | +# 3. Manually set the value to 'dir', 'sa', 'on', and 'off'. |
| 39 | +# 4. Verify that it is shown as 'dir', 'sa', 'sa', and 'off. |
| 40 | +# |
| 41 | + |
| 42 | +log_assert "The default and specific xattr values are displayed correctly." |
| 43 | + |
| 44 | +set -A args "dir" "sa" "on" "off" |
| 45 | +set -A display "dir" "sa" "sa" "off" |
| 46 | + |
| 47 | +log_must eval "[[ 'sa' == '$(zfs get -Hpo value xattr $TESTPOOL)' ]]" |
| 48 | + |
| 49 | +for i in `seq 0 3`; do |
| 50 | + log_must zfs set xattr="${args[$i]}" $TESTPOOL |
| 51 | + log_must eval "[[ '${display[$i]}' == '$(zfs get -Hpo value xattr $TESTPOOL)' ]]" |
| 52 | +done |
| 53 | +log_pass "The default and specific xattr values are displayed correctly." |
0 commit comments