xref: /freebsd/sys/contrib/openzfs/tests/zfs-tests/tests/functional/projectquota/setup.ksh (revision 61145dc2b94f12f6a47344fb9aac702321880e43)
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 2009 Sun Microsystems, Inc.  All rights reserved.
26# Use is subject to license terms.
27#
28
29#
30# Copyright (c) 2017 by Fan Yong. All rights reserved.
31#
32
33. $STF_SUITE/tests/functional/projectquota/projectquota_common.kshlib
34
35verify_runnable "both"
36
37del_user $PUSER
38del_group $PGROUP
39log_must add_group $PGROUP
40log_must add_user $PGROUP $PUSER
41
42#
43# Verify the test user can execute the zfs utilities.  This may not
44# be possible due to default permissions on the user home directory.
45# This can be resolved granting group read access.
46#
47# chmod 0750 $HOME
48#
49user_run $PUSER zfs list ||
50	log_unsupported "Test user $PUSER cannot execute zfs utilities"
51
52DISK=${DISKS%% *}
53default_setup_noexit $DISK
54
55zfs set compression=off $TESTPOOL
56
57log_pass
58