003 File Manager
Current Path:
/usr/src/tests/sys/cddl/zfs/tests/history
usr
/
src
/
tests
/
sys
/
cddl
/
zfs
/
tests
/
history
/
📁
..
📄
Makefile
(961 B)
📄
cleanup.ksh
(1.08 KB)
📄
history.cfg
(1.38 KB)
📄
history_001_pos.ksh
(3.68 KB)
📄
history_002_pos.ksh
(5.37 KB)
📄
history_003_pos.ksh
(2.49 KB)
📄
history_004_pos.ksh
(2.97 KB)
📄
history_005_neg.ksh
(2.22 KB)
📄
history_006_neg.ksh
(2.65 KB)
📄
history_007_pos.ksh
(4.14 KB)
📄
history_008_pos.ksh
(4.25 KB)
📄
history_009_pos.ksh
(5.76 KB)
📄
history_010_pos.ksh
(3.26 KB)
📄
history_common.kshlib
(6.12 KB)
📄
history_test.sh
(8.15 KB)
📄
i386.migratedpool.DAT.Z
(168.99 KB)
📄
i386.orig_history.txt
(635 B)
📄
setup.ksh
(1.1 KB)
📄
sparc.migratedpool.DAT.Z
(160.04 KB)
📄
sparc.orig_history.txt
(636 B)
📄
zfs-pool-v4.dat.Z
(71.69 KB)
Editing: history_002_pos.ksh
#!/usr/local/bin/ksh93 -p # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # $FreeBSD$ # # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)history_002_pos.ksh 1.5 09/01/12 SMI" # . $STF_SUITE/tests/history/history_common.kshlib . $STF_SUITE/tests/cli_root/zfs_rollback/zfs_rollback_common.kshlib ################################################################################# # # __stc_assertion_start # # ID: history_002_pos # # DESCRIPTION: # Create a scenario to verify the following zfs subcommands are logged. # create, destroy, clone, rename, snapshot, rollback, # set, inherit, receive, promote. # # STRATEGY: # 1. Format zpool history to file $EXPECT_HISTORY. # 2. Invoke every sub-commands to this mirror. # 3. Compare 'zpool history' log with expected log. # # TESTABILITY: explicit # # TEST_AUTOMATION_LEVEL: automated # # CODING_STATUS: COMPLETED (2006-07-05) # # __stc_assertion_end # ################################################################################ verify_runnable "global" function cleanup { for FileToRm in $EXPECT_HISTORY $REAL_HISTORY $tmpfile $tmpfile2; do [[ -f $FileToRm ]] && log_must $RM -f $FileToRm done for dataset in $fs $newfs $fsclone $vol $newvol $volclone; do datasetexists $dataset && $ZFS destroy -Rf $dataset done log_must $RM -rf /history.${TESTCASE_ID} } log_assert "Verify zfs sub-commands which modify state are logged." log_onexit cleanup format_history $TESTPOOL $EXPECT_HISTORY fs=$TESTPOOL/$TESTFS1; newfs=$TESTPOOL/newfs; fsclone=$TESTPOOL/clone vol=$TESTPOOL/$TESTVOL ; newvol=$TESTPOOL/newvol; volclone=$TESTPOOL/volclone fssnap=$fs@fssnap; fssnap2=$fs@fssnap2 volsnap=$vol@volsnap; volsnap2=$vol@volsnap2 # property value property value # set -A props \ quota 64M recordsize 512 \ reservation 32M reservation none \ mountpoint /history.${TESTCASE_ID} mountpoint legacy \ mountpoint none sharenfs on \ sharenfs off \ compression on compression off \ compression lzjb aclmode discard \ aclmode groupmask aclmode passthrough \ atime on atime off \ exec on exec off \ setuid on setuid off \ readonly on readonly off \ snapdir hidden snapdir visible \ aclinherit discard aclinherit noallow \ aclinherit secure aclinherit passthrough \ canmount off canmount on \ compression gzip compression gzip-$((RANDOM%9 + 1)) \ copies $((RANDOM%3 +1)) # Add a few extra properties not supported on FreeBSD, if applicable. The # currently unsupported list is in the source in libzfs_dataset.c. if [[ $os_name != "FreeBSD" ]]; then set +A props \ devices on devices off \ zoned on zoned off \ shareiscsi on shareiscsi off \ xattr on xattr off fi tmpfile=$TMPDIR/tmpfile.${TESTCASE_ID} ; tmpfile2=$TMPDIR/tmpfile2.${TESTCASE_ID} exec_record $ZFS create $fs typeset enc="" enc=$(get_prop encryption $fs) if [[ $? -ne 0 ]] || [[ -z "$enc" ]] || [[ "$enc" == "off" ]]; then typeset -i n=${#props[@]} props[$n]=checksum ; props[((n+1))]="on" props[((n+2))]=checksum ; props[((n+3))]="off" props[((n+4))]=checksum ; props[((n+5))]="fletcher2" props[((n+6))]=checksum ; props[((n+7))]="fletcher4" props[((n+8))]=checksum ; props[((n+9))]="sha256" fi # Set all the property for filesystem typeset -i i=0 while ((i < ${#props[@]})) ; do exec_record $ZFS set ${props[$i]}=${props[((i+1))]} $fs # quota, reservation, canmount can not be inherited. # if [[ ${props[$i]} != "quota" && \ ${props[$i]} != "reservation" && \ ${props[$i]} != "canmount" ]]; then exec_record $ZFS inherit ${props[$i]} $fs fi ((i += 2)) done exec_record $ZFS create -V 64M $vol exec_record $ZFS set volsize=32M $vol exec_record $ZFS snapshot $fssnap exec_record $ZFS snapshot $volsnap exec_record $ZFS snapshot $fssnap2 exec_record $ZFS snapshot $volsnap2 log_must eval "$ZFS send -i $fssnap $fssnap2 > $tmpfile" log_must eval "$ZFS send -i $volsnap $volsnap2 > $tmpfile2" exec_record $ZFS destroy $fssnap2 exec_record $ZFS destroy $volsnap2 exec_record eval "$ZFS receive $fs < $tmpfile" exec_record eval "$ZFS receive $vol < $tmpfile2" exec_record $ZFS rollback -r $fssnap exec_record $ZFS rollback -r $volsnap exec_record $ZFS clone $fssnap $fsclone exec_record $ZFS clone $volsnap $volclone exec_record $ZFS rename $fs $newfs exec_record $ZFS rename $vol $newvol exec_record $ZFS promote $fsclone exec_record $ZFS promote $volclone exec_record $ZFS destroy $newfs exec_record $ZFS destroy $newvol exec_record $ZFS destroy -rf $fsclone exec_record $ZFS destroy -rf $volclone format_history $TESTPOOL $REAL_HISTORY log_must $DIFF $REAL_HISTORY $EXPECT_HISTORY log_pass "zfs sub-commands which modify state are logged passed."
Upload File
Create Folder