1#!/usr/local/bin/ksh93 -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# ident	"@(#)history_006_neg.ksh	1.2	07/01/09 SMI"
28#
29
30. $STF_SUITE/tests/history/history_common.kshlib
31
32#################################################################################
33#
34# __stc_assertion_start
35#
36# ID: history_006_neg
37#
38# DESCRIPTION:
39# 	Verify the following zfs subcommands are not logged.
40#      	    list, get, mount, unmount, share, unshare, send
41#
42# STRATEGY:
43#	1. Create a test pool.
44#	2. Separately invoke zfs list|get|mount|unmount|share|unshare|send
45#	3. Verify they was not recored in pool history.
46#
47# TESTABILITY: explicit
48#
49# TEST_AUTOMATION_LEVEL: automated
50#
51# CODING_STATUS: COMPLETED (2006-07-05)
52#
53# __stc_assertion_end
54#
55################################################################################
56
57verify_runnable "global"
58
59function cleanup
60{
61	[[ -f $EXPECT_HISTORY ]] && $RM -f $EXPECT_HISTORY
62	[[ -f $REAL_HISTORY ]] && $RM -f $REAL_HISTORY
63	if datasetexists $fs ; then
64		log_must $ZFS destroy -rf $fs
65	fi
66	log_must $ZFS create $fs
67}
68
69log_assert "Verify 'zfs list|get|mount|unmount|share|unshare|send' will not " \
70	"be logged."
71log_onexit cleanup
72
73# Create initial test environment
74fs=$TESTPOOL/$TESTFS; snap1=$fs@snap1; snap2=$fs@snap2
75log_must $ZFS set sharenfs=on $fs
76log_must $ZFS snapshot $snap1
77log_must $ZFS snapshot $snap2
78
79# Save initial TESTPOOL history
80log_must eval "$ZPOOL history $TESTPOOL > $EXPECT_HISTORY"
81
82log_must $ZFS list $fs > /dev/null
83log_must $ZFS get mountpoint $fs > /dev/null
84log_must $ZFS unmount $fs
85log_must $ZFS mount $fs
86log_must $ZFS share $fs
87log_must $ZFS unshare $fs
88log_must $ZFS send -i $snap1 $snap2 > /dev/null
89
90log_must eval "$ZPOOL history $TESTPOOL > $REAL_HISTORY"
91log_must $DIFF $EXPECT_HISTORY $REAL_HISTORY
92
93log_pass "Verify 'zfs list|get|mount|unmount|share|unshare|send' passed."
94