quota_005_pos.ksh revision f38cb554a534c6df738be3f4d23327e69888e634
2N/A#! /bin/ksh -p
2N/A#
2N/A# CDDL HEADER START
2N/A#
2N/A# The contents of this file are subject to the terms of the
2N/A# Common Development and Distribution License (the "License").
2N/A# You may not use this file except in compliance with the License.
2N/A#
2N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A# or http://www.opensolaris.org/os/licensing.
2N/A# See the License for the specific language governing permissions
2N/A# and limitations under the License.
2N/A#
2N/A# When distributing Covered Code, include this CDDL HEADER in each
2N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A# If applicable, add the following below this CDDL HEADER, with the
2N/A# fields enclosed by brackets "[]" replaced with your own identifying
2N/A# information: Portions Copyright [yyyy] [name of copyright owner]
2N/A#
2N/A# CDDL HEADER END
2N/A#
2N/A
2N/A#
2N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
2N/A# Use is subject to license terms.
2N/A#
2N/A
2N/A#
2N/A# Copyright (c) 2013 by Delphix. All rights reserved.
2N/A#
2N/A
2N/A. $STF_SUITE/include/libtest.shlib
2N/A. $STF_SUITE/tests/functional/quota/quota.kshlib
2N/A
2N/A#
2N/A# DESCRIPTION:
2N/A#
2N/A# Verify that quota doesn't inherit its value from parent.
2N/A#
2N/A# STRATEGY:
2N/A# 1) Set quota for parents
2N/A# 2) Create a filesystem tree
2N/A# 3) Verify that the 'quota' for descendent doesnot inherit the value.
2N/A#
2N/A###############################################################################
2N/A
2N/Averify_runnable "both"
2N/A
2N/Afunction cleanup
2N/A{
2N/A datasetexists $fs_child && \
2N/A log_must $ZFS destroy $fs_child
log_must $ZFS set quota=$quota_val $fs
}
log_onexit cleanup
log_assert "Verify that quota doesnot inherit its value from parent."
log_onexit cleanup
fs=$TESTPOOL/$TESTFS
fs_child=$TESTPOOL/$TESTFS/$TESTFS
space_avail=$(get_prop available $fs)
quota_val=$(get_prop quota $fs)
typeset -i quotasize=$space_avail
((quotasize = quotasize * 2 ))
log_must $ZFS set quota=$quotasize $fs
log_must $ZFS create $fs_child
quota_space=$(get_prop quota $fs_child)
[[ $quota_space == $quotasize ]] && \
log_fail "The quota of child dataset inherits its value from parent."
log_pass "quota doesnot inherit its value from parent as expected."