]> git.proxmox.com Git - mirror_zfs.git/blame - tests/zfs-tests/tests/functional/history/history_006_neg.ksh
Enable remaining tests
[mirror_zfs.git] / tests / zfs-tests / tests / functional / history / history_006_neg.ksh
CommitLineData
6bb24f4d
BB
1#!/bin/ksh -p
2#
3# CDDL HEADER START
4#
5# The contents of this file are subject to the terms of the
6# Common Development and Distribution License (the "License").
7# You may not use this file except in compliance with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22
23#
24# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
25# Use is subject to license terms.
26#
27
28#
c1d9abf9 29# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
6bb24f4d
BB
30#
31
32. $STF_SUITE/tests/functional/history/history_common.kshlib
33. $STF_SUITE/include/libtest.shlib
34
35#
36# DESCRIPTION:
37# Verify the following zfs subcommands are not logged.
38# list, get, holds, mount, unmount, share, unshare, send
39#
40# STRATEGY:
41# 1. Create a test pool.
42# 2. Separately invoke zfs list|get|holds|mount|unmount|share|unshare|send
43# 3. Verify they were not recored in pool history.
44#
45
46verify_runnable "global"
47
95401cb6
BB
48# See issue: https://github.com/zfsonlinux/zfs/issues/5657
49if is_linux; then
50 log_unsupported "Test case occasionally fails"
51fi
52
6bb24f4d
BB
53function cleanup
54{
55 if datasetexists $fs ; then
c1d9abf9 56 log_must zfs destroy -rf $fs
6bb24f4d 57 fi
c1d9abf9 58 log_must zfs create $fs
6bb24f4d
BB
59}
60
61log_assert "Verify 'zfs list|get|holds|mount|unmount|share|unshare|send' " \
62 "will not be logged."
63log_onexit cleanup
64
65# Create initial test environment
66fs=$TESTPOOL/$TESTFS; snap1=$fs@snap1; snap2=$fs@snap2
67if ! is_linux; then
c1d9abf9 68 log_must zfs set sharenfs=on $fs
6bb24f4d 69fi
c1d9abf9
JWK
70log_must zfs snapshot $snap1
71log_must zfs hold tag $snap1
72log_must zfs snapshot $snap2
6bb24f4d
BB
73
74# Save initial TESTPOOL history
c1d9abf9 75log_must eval "zpool history $TESTPOOL > $OLD_HISTORY"
6bb24f4d 76
c1d9abf9
JWK
77log_must zfs list $fs > /dev/null
78log_must zfs get mountpoint $fs > /dev/null
79log_must zfs unmount $fs
80log_must zfs mount $fs
6bb24f4d 81if ! is_linux; then
c1d9abf9
JWK
82 log_must zfs share $fs
83 log_must zfs unshare $fs
6bb24f4d 84fi
c1d9abf9
JWK
85log_must zfs send -i $snap1 $snap2 > /dev/null
86log_must zfs holds $snap1
6bb24f4d 87
c1d9abf9
JWK
88log_must eval "zpool history $TESTPOOL > $NEW_HISTORY"
89log_must diff $OLD_HISTORY $NEW_HISTORY
6bb24f4d 90
c1d9abf9 91log_must zfs release tag $snap1
6bb24f4d
BB
92
93log_pass "Verify 'zfs list|get|mount|unmount|share|unshare|send' passed."