5 # This file and its contents are supplied under the terms of the
6 # Common Development and Distribution License ("CDDL"), version 1.0.
7 # You may only use this file in accordance with the terms of version
10 # A full copy of the text of the CDDL should have accompanied this
11 # source. A copy of the CDDL is also available via the Internet at
12 # http://www.illumos.org/license/CDDL.
18 # Copyright (c) 2013 by Delphix. All rights reserved.
21 . $STF_SUITE/include/libtest.shlib
25 # refquota limits the amount of space a dataset can consume,
26 # snapshot rollback should be limited by refquota.
29 # 1. Create a file in a filesystem
30 # 2. Create a snapshot of the filesystem
32 # 4. Set a refquota of size half of the file
33 # 5. Rollback the filesystem from the snapshot
34 # 6. Rollback should fail
37 verify_runnable "both"
41 log_must zfs destroy -rf $TESTPOOL/$TESTFS
42 log_must zfs create $TESTPOOL/$TESTFS
43 log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
51 mntpnt=$(get_prop mountpoint $FS)
52 log_must mkfile 20M $mntpnt/$TESTFILE
53 log_must zfs snapshot $FS@snap20M
54 log_must rm $mntpnt/$TESTFILE
58 log_must zfs set refquota=10M $FS
59 log_mustnot zfs rollback $FS@snap20M
61 log_pass "The rollback to the snapshot was restricted by refquota."