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 https://opensource.org/licenses/CDDL-1.0. 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# 29# Copyright (c) 2013, 2016 by Delphix. All rights reserved. 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 recorded in pool history. 44# 45 46verify_runnable "global" 47 48function cleanup 49{ 50 datasetexists $fs && destroy_dataset $fs -rf 51 log_must zfs create $fs 52} 53 54log_assert "Verify 'zfs list|get|holds|mount|unmount|share|unshare|send' " \ 55 "will not be logged." 56log_onexit cleanup 57 58# Create initial test environment 59fs=$TESTPOOL/$TESTFS; snap1=$fs@snap1; snap2=$fs@snap2 60if ! is_linux; then 61 log_must zfs set sharenfs=on $fs 62fi 63log_must zfs snapshot $snap1 64log_must zfs hold tag $snap1 65log_must zfs snapshot $snap2 66 67# Save initial TESTPOOL history 68log_must eval "zpool history $TESTPOOL > $OLD_HISTORY" 69 70log_must eval "zfs list $fs > /dev/null" 71log_must eval "zfs get mountpoint $fs > /dev/null" 72log_must zfs unmount $fs 73log_must zfs mount $fs 74if ! is_linux; then 75 log_must zfs share $fs 76 log_must zfs unshare $fs 77fi 78log_must eval "zfs send -i $snap1 $snap2 > /dev/null" 79log_must zfs holds $snap1 80 81log_must eval "zpool history $TESTPOOL > $NEW_HISTORY" 82log_must diff $OLD_HISTORY $NEW_HISTORY 83 84log_must zfs release tag $snap1 85 86log_pass "Verify 'zfs list|get|mount|unmount|share|unshare|send' passed." 87