aboutsummaryrefslogtreecommitdiffstats
path: root/tests/zfs-tests/tests/functional/acl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/zfs-tests/tests/functional/acl')
-rw-r--r--tests/zfs-tests/tests/functional/acl/Makefile.am2
-rw-r--r--tests/zfs-tests/tests/functional/acl/posix-sa/Makefile.am8
-rw-r--r--tests/zfs-tests/tests/functional/acl/posix-sa/cleanup.ksh33
-rw-r--r--tests/zfs-tests/tests/functional/acl/posix-sa/posix_001_pos.ksh1
-rw-r--r--tests/zfs-tests/tests/functional/acl/posix-sa/posix_002_pos.ksh1
-rw-r--r--tests/zfs-tests/tests/functional/acl/posix-sa/posix_003_pos.ksh1
-rw-r--r--tests/zfs-tests/tests/functional/acl/posix-sa/posix_004_pos.ksh1
-rw-r--r--tests/zfs-tests/tests/functional/acl/posix-sa/setup.ksh52
-rw-r--r--tests/zfs-tests/tests/functional/acl/posix/Makefile.am3
-rwxr-xr-xtests/zfs-tests/tests/functional/acl/posix/posix_003_pos.ksh1
-rw-r--r--tests/zfs-tests/tests/functional/acl/posix/posix_004_pos.ksh49
-rwxr-xr-xtests/zfs-tests/tests/functional/acl/posix/setup.ksh1
12 files changed, 149 insertions, 4 deletions
diff --git a/tests/zfs-tests/tests/functional/acl/Makefile.am b/tests/zfs-tests/tests/functional/acl/Makefile.am
index 6086930e36fa..382bb5f064e1 100644
--- a/tests/zfs-tests/tests/functional/acl/Makefile.am
+++ b/tests/zfs-tests/tests/functional/acl/Makefile.am
@@ -3,4 +3,4 @@ dist_pkgdata_DATA = \
acl.cfg \
acl_common.kshlib
-SUBDIRS = posix
+SUBDIRS = posix posix-sa
diff --git a/tests/zfs-tests/tests/functional/acl/posix-sa/Makefile.am b/tests/zfs-tests/tests/functional/acl/posix-sa/Makefile.am
new file mode 100644
index 000000000000..31d1237ce265
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/acl/posix-sa/Makefile.am
@@ -0,0 +1,8 @@
+pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/acl/posix-sa
+dist_pkgdata_SCRIPTS = \
+ cleanup.ksh \
+ setup.ksh \
+ posix_001_pos.ksh \
+ posix_002_pos.ksh \
+ posix_003_pos.ksh \
+ posix_004_pos.ksh
diff --git a/tests/zfs-tests/tests/functional/acl/posix-sa/cleanup.ksh b/tests/zfs-tests/tests/functional/acl/posix-sa/cleanup.ksh
new file mode 100644
index 000000000000..bb58a8cf2e7b
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/acl/posix-sa/cleanup.ksh
@@ -0,0 +1,33 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/acl/acl_common.kshlib
+
+cleanup_user_group
+
+default_cleanup
diff --git a/tests/zfs-tests/tests/functional/acl/posix-sa/posix_001_pos.ksh b/tests/zfs-tests/tests/functional/acl/posix-sa/posix_001_pos.ksh
new file mode 100644
index 000000000000..e6467b3470c8
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/acl/posix-sa/posix_001_pos.ksh
@@ -0,0 +1 @@
+../posix/posix_001_pos.ksh \ No newline at end of file
diff --git a/tests/zfs-tests/tests/functional/acl/posix-sa/posix_002_pos.ksh b/tests/zfs-tests/tests/functional/acl/posix-sa/posix_002_pos.ksh
new file mode 100644
index 000000000000..10140d0e87ec
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/acl/posix-sa/posix_002_pos.ksh
@@ -0,0 +1 @@
+../posix/posix_002_pos.ksh \ No newline at end of file
diff --git a/tests/zfs-tests/tests/functional/acl/posix-sa/posix_003_pos.ksh b/tests/zfs-tests/tests/functional/acl/posix-sa/posix_003_pos.ksh
new file mode 100644
index 000000000000..3f3db2807ddc
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/acl/posix-sa/posix_003_pos.ksh
@@ -0,0 +1 @@
+../posix/posix_003_pos.ksh \ No newline at end of file
diff --git a/tests/zfs-tests/tests/functional/acl/posix-sa/posix_004_pos.ksh b/tests/zfs-tests/tests/functional/acl/posix-sa/posix_004_pos.ksh
new file mode 100644
index 000000000000..2c2bab4477bd
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/acl/posix-sa/posix_004_pos.ksh
@@ -0,0 +1 @@
+../posix/posix_004_pos.ksh \ No newline at end of file
diff --git a/tests/zfs-tests/tests/functional/acl/posix-sa/setup.ksh b/tests/zfs-tests/tests/functional/acl/posix-sa/setup.ksh
new file mode 100644
index 000000000000..d8bf8a638e7b
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/acl/posix-sa/setup.ksh
@@ -0,0 +1,52 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/acl/acl_common.kshlib
+
+log_must getfacl --version
+log_must setfacl --version
+
+cleanup_user_group
+
+# Create staff group and add user to it
+log_must add_group $ZFS_ACL_STAFF_GROUP
+log_must add_user $ZFS_ACL_STAFF_GROUP $ZFS_ACL_STAFF1
+
+DISK=${DISKS%% *}
+default_setup_noexit $DISK
+log_must chmod 777 $TESTDIR
+
+# Use POSIX ACLs on filesystem
+log_must zfs set acltype=posix $TESTPOOL/$TESTFS
+log_must zfs set xattr=sa $TESTPOOL/$TESTFS
+
+log_pass
diff --git a/tests/zfs-tests/tests/functional/acl/posix/Makefile.am b/tests/zfs-tests/tests/functional/acl/posix/Makefile.am
index dcf278858090..e63f63185afe 100644
--- a/tests/zfs-tests/tests/functional/acl/posix/Makefile.am
+++ b/tests/zfs-tests/tests/functional/acl/posix/Makefile.am
@@ -4,4 +4,5 @@ dist_pkgdata_SCRIPTS = \
setup.ksh \
posix_001_pos.ksh \
posix_002_pos.ksh \
- posix_003_pos.ksh
+ posix_003_pos.ksh \
+ posix_004_pos.ksh
diff --git a/tests/zfs-tests/tests/functional/acl/posix/posix_003_pos.ksh b/tests/zfs-tests/tests/functional/acl/posix/posix_003_pos.ksh
index dc6ef0d2477d..1b04a024f2ad 100755
--- a/tests/zfs-tests/tests/functional/acl/posix/posix_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/acl/posix/posix_003_pos.ksh
@@ -25,7 +25,6 @@
#
# DESCRIPTION:
# Verify that ACLs survive remount.
-# Regression test for https://github.com/zfsonlinux/zfs/issues/4520
#
# STRATEGY:
# 1. Test presence of default and regular ACLs after remount
diff --git a/tests/zfs-tests/tests/functional/acl/posix/posix_004_pos.ksh b/tests/zfs-tests/tests/functional/acl/posix/posix_004_pos.ksh
new file mode 100644
index 000000000000..6c6b592fbb9e
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/acl/posix/posix_004_pos.ksh
@@ -0,0 +1,49 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Portions Copyright 2020 iXsystems, Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/acl/acl_common.kshlib
+
+#
+# DESCRIPTION:
+# Verify chown works with POSIX ACLs.
+# Regression test for https://github.com/openzfs/zfs/issues/10043
+#
+# STRATEGY:
+# 1. Prepare an appropriate ACL on the test directory
+# 2. Change the owner of the directory
+#
+
+verify_runnable "both"
+log_assert "Verify chown works with POSIX ACLs"
+
+log_must setfacl -d -m u:$ZFS_ACL_STAFF1:rwx $TESTDIR
+log_must setfacl -b $TESTDIR
+
+log_must chown $ZFS_ACL_STAFF1 $TESTDIR
+log_must chown 0 $TESTDIR
+
+log_pass "chown works with POSIX ACLs"
diff --git a/tests/zfs-tests/tests/functional/acl/posix/setup.ksh b/tests/zfs-tests/tests/functional/acl/posix/setup.ksh
index d8bf8a638e7b..526c78e17f1a 100755
--- a/tests/zfs-tests/tests/functional/acl/posix/setup.ksh
+++ b/tests/zfs-tests/tests/functional/acl/posix/setup.ksh
@@ -47,6 +47,5 @@ log_must chmod 777 $TESTDIR
# Use POSIX ACLs on filesystem
log_must zfs set acltype=posix $TESTPOOL/$TESTFS
-log_must zfs set xattr=sa $TESTPOOL/$TESTFS
log_pass