1196938Strasz#!/bin/sh 2196938Strasz# 3219877Strasz# Copyright (c) 2011 Edward Tomasz Napiera��a <trasz@FreeBSD.org> 4196938Strasz# All rights reserved. 5196938Strasz# 6196938Strasz# Redistribution and use in source and binary forms, with or without 7196938Strasz# modification, are permitted provided that the following conditions 8196938Strasz# are met: 9196938Strasz# 1. Redistributions of source code must retain the above copyright 10196938Strasz# notice, this list of conditions and the following disclaimer. 11196938Strasz# 2. Redistributions in binary form must reproduce the above copyright 12196938Strasz# notice, this list of conditions and the following disclaimer in the 13196938Strasz# documentation and/or other materials provided with the distribution. 14196938Strasz# 15196938Strasz# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16196938Strasz# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17196938Strasz# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18196938Strasz# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19196938Strasz# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20196938Strasz# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21196938Strasz# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22196938Strasz# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23196938Strasz# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24196938Strasz# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25196938Strasz# SUCH DAMAGE. 26196938Strasz# 27196938Strasz# $FreeBSD: releng/11.0/tests/sys/acl/04.sh 288680 2015-10-05 00:55:16Z ngie $ 28196938Strasz# 29196938Strasz 30219877Strasz# This is a wrapper script to run tools-nfs4-trivial.test on ZFS filesystem. 31196938Strasz# 32196938Strasz# WARNING: It uses hardcoded ZFS pool name "acltools" 33196938Strasz 34288680Sngieif ! sysctl vfs.zfs.version.spa >/dev/null 2>&1; then 35288680Sngie echo "1..0 # SKIP system doesn't have ZFS loaded" 36288680Sngie exit 0 37288680Sngiefi 38288680Sngieif [ $(id -u) -ne 0 ]; then 39288680Sngie echo "1..0 # SKIP you must be root" 40288680Sngie exit 0 41288680Sngiefi 42288680Sngie 43219877Straszecho "1..3" 44196938Strasz 45219266StraszTESTDIR=$(dirname $(realpath $0)) 46196938Strasz 47196938Strasz# Set up the test filesystem. 48196938StraszMD=`mdconfig -at swap -s 64m` 49196938StraszMNT=`mktemp -dt acltools` 50271459Straszzpool create -m $MNT acltools /dev/$MD 51196938Straszif [ $? -ne 0 ]; then 52196938Strasz echo "not ok 1 - 'zpool create' failed." 53196938Strasz exit 1 54196938Straszfi 55196938Strasz 56196938Straszecho "ok 1" 57196938Strasz 58196938Straszcd $MNT 59196938Strasz 60219877Straszperl $TESTDIR/run $TESTDIR/tools-nfs4-trivial.test > /dev/null 61196938Strasz 62196938Straszif [ $? -eq 0 ]; then 63219877Strasz echo "ok 2" 64196938Straszelse 65219877Strasz echo "not ok 2" 66196938Straszfi 67196938Strasz 68196938Straszcd / 69196938Straszzpool destroy -f acltools 70196938Straszrmdir $MNT 71196938Straszmdconfig -du $MD 72196938Strasz 73219877Straszecho "ok 3" 74