100+ results for 'test lang:BourneShell'

Not the results you expected?

TrangGUITest.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 181 lines ✨ Summary

This Java code is a unit test for a GUI application called Trang Translator, which converts XML files to XSD files. The test class contains two tests: one that checks the conversion of a DTD file to an XSD file with inline attribute lists enabled and disabled, and another that tests changing the input format from XML to RNC.

33 import org.gjt.sp.jedit.testframework.Log;

34

35 import static org.gjt.sp.jedit.testframework.TestUtils.*;

36 import static org.gjt.sp.jedit.testframework.EBFixture.*;

37 import org.gjt.sp.jedit.testframework.PluginOptionsFixture;

38 import org.gjt.sp.jedit.testframework.TestUtils;

39

40 // }}}

50

51 /**

52 * unit tests for TrangTranslator

53 * $Id: TrangGUITest.java 21325 2012-03-11 11:03:44Z kerik-sf $

60 TestUtils.beforeClass();

61 testData = new File(System.getProperty("test_data")).getCanonicalFile();

62 assertTrue(testData.exists());

signal.c (http://omnia2droid.googlecode.com/svn/trunk/) C · 721 lines ✨ Summary

This C code implements signal handling for Linux. It checks if a process has pending signals, and if so, delivers them to the process by executing user-level signal handlers. If no signals are pending, it restarts the syscall. The do_notify_resume function is used to notify processes that they have pending signals, allowing them to handle them.

251 #endif

252 #ifdef CONFIG_IWMMXT

253 if (err == 0 && test_thread_flag(TIF_USING_IWMMXT))

254 err |= restore_iwmmxt_context(&aux->iwmmxt);

255 #endif

366 #endif

367 #ifdef CONFIG_IWMMXT

368 if (err == 0 && test_thread_flag(TIF_USING_IWMMXT))

369 err |= preserve_iwmmxt_context(&aux->iwmmxt);

370 #endif

jbi-admin-cli00003.ksh (https://bitbucket.org/ldassonville/openesb-core.git) Korn Shell · 295 lines

33 # Perform any necessary cleanup to restore the repository back to its initial state.

34 #----------------------------------------------------------------------------------

35 test_cleanup()

36 {

37 cleanup server

40

41 #----------------------------------------------------------------------------------

42 # Main function called that will run the test

43 #----------------------------------------------------------------------------------

44 run_test()

45 {

46 initilize_test

47

48 # Clean up the (Remove uninstall everything so this regression test will work

DebugExpressionFactory.h (https://bitbucket.org/ultra_iter/qt-vtl.git) C Header · 128 lines

5 ** Contact: Nokia Corporation (qt-info@nokia.com)

6 **

7 ** This file is part of the test suite of the Qt Toolkit.

8 **

9 ** $QT_BEGIN_LICENSE:LGPL$

xattr_011_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 241 lines

89 log_mustnot eval "runat $TESTDIR/cpio.$$ cat passwd > /dev/null 2>&1"

90 log_must rm $TESTDIR/cpio.$$ $TEST_BASE_DIR/xattr.$$.cpio $TEST_BASE_DIR/noxattr.$$.cpio

91 else

92 log_note "Checking cpio - unsupported"

174 log_mustnot eval "runat $TESTDIR/pax.$$ cat passwd > /dev/null 2>&1"

175 log_must rm $TESTDIR/pax.$$ $TESTDIR/noxattr.pax $TESTDIR/xattr.pax

176 else

177 log_note "Checking pax - unsupported"

208 log_mustnot eval "runat $TESTDIR/tar.$$ cat passwd > /dev/null 2>&1"

209 log_must rm $TESTDIR/tar.$$ $TESTDIR/noxattr.tar $TESTDIR/xattr.tar

210 else

211 log_must touch $TESTDIR/tar.$$

237 log_mustnot get_xattr passwd $TESTDIR/tar.$$

238 log_must rm $TESTDIR/tar.$$ $TESTDIR/noxattr.tar $TESTDIR/xattr.tar

239 fi

240

zfs_bookmark_cliargs.ksh (https://github.com/adilger/zfs.git) Korn Shell · 238 lines

133 log_must zfs snapshot "$TESTPOOL@$TESTSNAP"

134 log_must zfs bookmark "$TESTPOOL@$TESTSNAP" "$TESTPOOL#$TESTBM"

135 log_must zfs destroy "$TESTPOOL#$TESTBM"

191 log_must zfs bookmark "$TESTPOOL@$TESTSNAP" "$TESTPOOL#$TESTBM"

192 log_must zfs bookmark "$TESTPOOL#$TESTBM" "$TESTPOOL#$TESTBMCOPY"

193 log_must zfs destroy "$TESTPOOL#$TESTBM"

201 log_must eval "destroy_dataset $TESTPOOL/$TESTFS/recv"

202 log_must eval "zfs recv -o mountpoint=none $TESTPOOL/$TESTFS/recv < $TEST_BASE_DIR/zfstest_datastream.$$"

203 log_must zfs snapshot "$DATASET@$TESTSNAP2"

204 log_must eval "zfs send -i \#$TESTBMCOPY $DATASET@$TESTSNAP2 > $TEST_BASE_DIR/zfstest_datastream.$$"

205 log_must eval "zfs recv $TESTPOOL/$TESTFS/recv < $TEST_BASE_DIR/zfstest_datastream.$$"

206 # cleanup

207 log_must eval "destroy_dataset $DATASET@$TESTSNAP2"

218 log_must zfs snapshot "$DATASET@$TESTSNAP2" # TESTSNAP2 is the redaction snapshot

219 log_must zfs list -t all -o name,createtxg,guid,mountpoint,written

220 log_must zfs redact "$DATASET@$TESTSNAP" "$TESTBM" "$DATASET@$TESTSNAP2"

221 # ensure our primitive for testing whether a bookmark is a redaction bookmark works

tst.localsctpstate.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 175 lines

26

27 #

28 # Test sctp:::state-change and sctp:::{send,receive} by connecting to

29 # the local discard service.

30 # A number of state transition events along with SCTP send and

34 #

35 # 1. A change to the ip stack breaking expected probe behavior,

36 # which is the reason we are testing.

37 # 2. The lo0 interface missing or not up.

38 # 3. An unlikely race causes the unlocked global send/receive

39 # variables to be corrupted.

40 #

41 # This test performs a SCTP connection and checks that at least the

42 # following packet counts were traced:

43 #

jbi-admin-cli00008.ksh (https://bitbucket.org/ldassonville/openesb-core.git) Korn Shell · 179 lines

31

32 #----------------------------------------------------------------------------------

33 # Main function called that will run the test

34 #----------------------------------------------------------------------------------

35 run_test()

36 {

37 initilize_test

38

39 #--------------------------------------------------------------------------------

40 # Test setting and showing the runtime configuration values

41 #--------------------------------------------------------------------------------

42

172 TEST_NAME="jbi-admin-cli00008"

173 TEST_DESCRIPTION="Test the set and show commands for Runtime Configuration and Runtime Loggers"

174 . ./regress_defs.ksh

175 run_test

zfs_clone_001_neg.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 143 lines

70 typeset target1=$TESTPOOL/$TESTFS1

71 typeset target2=$TESTPOOL/$TESTCTR1/$TESTFS1

72 typeset targets="$target1 $target2 $NONEXISTPOOLNAME/$TESTFS"

73

74 set -A args "" \

75 "$TESTPOOL/$TESTFS@blah $target1" "$TESTPOOL/$TESTVOL@blah $target1" \

76 "$TESTPOOL/$TESTFS@blah* $target1" "$TESTPOOL/$TESTVOL@blah* $target1" \

77 "$SNAPFS $target1*" "$SNAPFS1 $target1*" \

78 "$SNAPFS /$target1" "$SNAPFS1 /$target1" \

79 "$SNAPFS $TESTPOOL//$TESTFS1" "$SNAPFS1 $TESTPOOL//$TESTFS1" \

80 "$SNAPFS $NONEXISTPOOLNAME/$TESTFS" "$SNAPFS1 $NONEXISTPOOLNAME/$TESTFS" \

92 "$SNAPFS $TESTPOOL/$TESTCTR" "$SNAPFS $TESTPOOL/$TESTFS" \

93 "$SNAPFS1 $TESTPOOL/$TESTCTR" "$SNAPFS1 $TESTPOOL/$TESTFS"

94

95 set -A args ${args[*]} ${moreargs[*]}

zfs_unmount_009_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 141 lines

68 DISK=${DISKS%% *}

69

70 for fs in $TESTPOOL/$TESTFS $TESTPOOL ; do

71 typeset snap=$fs@$TESTSNAP

82 log_must $ZFS create $TESTPOOL/$TESTFS

83 log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS

84 fi

85 }

92 log_must cd $TESTDIR

93 $ECHO hello > world

94 log_must $ZFS snapshot $TESTPOOL/$TESTFS@$TESTSNAP

95 log_must cd $(get_snapdir_name)/$TESTSNAP

101 log_onexit cleanup

102

103 for fs in $TESTPOOL/$TESTFS $TESTPOOL ; do

104 typeset snap=$fs@$TESTSNAP

zfs_rename_004_neg.ksh (https://github.com/adilger/zfs.git) Korn Shell · 112 lines

54 set -A bad_dataset $TESTPOOL/$TESTFS1 $TESTPOOL/$TESTCTR1 \

55 $TESTPOOL/$TESTFS1 $TESTPOOL/$TESTCTR/$TESTFS1 \

56 $TESTPOOL/$TESTFS1 $TESTPOOL/$TESTVOL \

61 $TESTPOOL/$TESTCTR1 $TESTPOOL/$TESTFS1 \

62 $TESTPOOL/$TESTCTR1 $TESTPOOL/$TESTCTR/$TESTFS1 \

63 $TESTPOOL/$TESTCTR/$TESTFS1 $TESTPOOL/$TESTVOL \

65 $TESTPOOL/$TESTCTR/$TESTFS1 $TESTPOOL/$TESTFS1 \

66 $TESTPOOL/$TESTCTR/$TESTFS1 $TESTPOOL/$TESTCTR1 \

67 $TESTPOOL/$TESTVOL $TESTPOOL/$TESTCTR1 \

69 $TESTPOOL/$TESTVOL $TESTPOOL/$TESTFS1 \

70 $TESTPOOL/$TESTVOL $TESTPOOL/$TESTCTR/$TESTFS1 \

71 $TESTPOOL/$TESTFS@snapshot $TESTPOOL/$TESTCTR1 \

73 $TESTPOOL/$TESTFS@snapshot $TESTPOOL/$TESTFS1 \

74 $TESTPOOL/$TESTFS@snapshot $TESTPOOL/$TESTCTR/$TESTFS1 \

75 $TESTPOOL/$TESTFS1 $TESTPOOL/${TESTFS1}%c \

tst.remotetcpstate.ksh (https://github.com/buffygb/illumos-gate.git) Korn Shell · 172 lines

26

27 #

28 # Test tcp:::state-change and tcp:::{send,receive} by connecting to

29 # the remote ssh service and sending a test message. This should result

35 #

36 # 1. A change to the ip stack breaking expected probe behavior,

37 # which is the reason we are testing.

38 # 2. The lo0 interface missing or not up.

39 # 3. The remote ssh service is not online.

41 # variables to be corrupted.

42 #

43 # This test performs a TCP connection to the ssh service (port 22) and

44 # checks that at least the following packet counts were traced:

45 #

49 # 3 x tcp:::receive (1 during the TCP handshake, the response, then the FIN ACK)

50 #

51 # For this test to work, we are assuming that the TCP handshake and

52 # TCP close will enter the IP code path and not use tcp fusion.

53 #

zinject_003_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 144 lines

83 inject_fault $etype $object $errno 1

84

85 unmounted $TESTPOOL/$TESTFS || \

86 log_fail "$TESTPOOL/$TESTFS mount unexpected."

87

88 log_must check_status $TESTPOOL "$TESTPOOL/$TESTFS:<0x0>"

89

90 inject_clear

133 log_must $ZFS create $TESTPOOL/$TESTFS

134 log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS

135

136 populate_test_env $TESTDIR/bad_dir $maxnumber

137

138 test_zinject $TESTDIR/bad_dir $type

139

140 cleanup_env

zfs_get_002_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 116 lines

30 #

31

32 . $STF_SUITE/tests/cli_root/zfs_get/zfs_get_common.kshlib

33 . $STF_SUITE/tests/userquota/userquota_common.kshlib

49 # command line return value.

50 #

51 # TESTABILITY: explicit

52 #

53 # TEST_AUTOMATION_LEVEL: automated

82 set -A props -- "${zfs_props[@]}" "${userquota_props[@]}"

83

84 set -A dataset $TESTPOOL/$TESTCTR $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL \

85 $TESTPOOL/$TESTFS@$TESTSNAP $TESTPOOL/$TESTVOL@$TESTSNAP

90

91 # Create volume and filesystem's snapshot

92 create_snapshot $TESTPOOL/$TESTFS $TESTSNAP

93 create_snapshot $TESTPOOL/$TESTVOL $TESTSNAP

rollback_002_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 133 lines

45 # 6. Remove the original files

46 # 7. Perform a rollback

47 # 8. Verify the latest snapshot and file system agree

48 #

49

68 log_onexit cleanup

69

70 [[ -n $TESTDIR ]] && \

71 log_must rm -rf $TESTDIR/* > /dev/null 2>&1

93 typeset -i i=1

94 while [[ $i -le $COUNT ]]; do

95 log_must file_write -o create -f $TESTDIR/afterfirst_file$i \

96 -b $BLOCKSZ -c $NUM_WRITES -d $i

97

125 fi

126

127 FILE_COUNT=`ls -Al $TESTDIR/original* $TESTDIR/afterfirst*| grep -v "total" | wc -l`

128 if [[ $FILE_COUNT -ne 20 ]]; then

129 ls -Al $TESTDIR

redacted_deleted.ksh (https://github.com/adilger/zfs.git) Korn Shell · 103 lines

16 #

17

18 . $STF_SUITE/tests/functional/redacted_send/redacted.kshlib

19

20 #

zfs_allow_010_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 194 lines

30 #

31

32 . $STF_SUITE/tests/functional/delegate/delegate_common.kshlib

33

34 #

jbi-admin-cli00010.ksh (https://bitbucket.org/ldassonville/openesb-core.git) Korn Shell · 195 lines

32 # Perform any necessary cleanup to restore the repository back to its initial state.

33 #----------------------------------------------------------------------------------

34 test_cleanup()

35 {

36 cleanup server

39

40 #----------------------------------------------------------------------------------

41 # Main function called that will run the test

42 #----------------------------------------------------------------------------------

43 run_test()

44 {

45 initilize_test

46 build_test_application_artifacts

188 TEST_NAME="jbi-admin-cli00010"

189 TEST_DESCRIPTION="Test Application Variable Commands"

190 . ./regress_defs.ksh

191 run_test

hotplug_008_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 74 lines

30 #

31

32 . $STF_SUITE/tests/hotplug/hotplug.kshlib

33

34 #################################################################################

49 # 5. Verify no FMA fault was generated.

50 #

51 # TESTABILITY: explicit

52 #

53 # TEST_AUTOMATION_LEVEL: automated

69

70 log_must create_gnop $DISK3

71 cleanup_testenv $TESTPOOL

72 done

73

zpool_set_001_neg.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 85 lines

30 #

31

32 . $STF_SUITE/include/libtest.kshlib

33 . $STF_SUITE/tests/cli_user/cli_user.kshlib

48 #

49 #

50 # TESTABILITY: explicit

51 #

52 # TEST_AUTOMATION_LEVEL: automated

71 EXPECTED=${prop_vals[$i]}

72 NEW=${prop_new[$i]}

73 log_mustnot run_unprivileged "$ZPOOL set $PROP=$NEW $TESTPOOL"

74

75 # Now verify that the above command did nothing

76 ACTUAL=$( $ZPOOL get $PROP $TESTPOOL | $GREP $PROP | $AWK '{print $1}' )

77 if [ "$ACTUAL" != "$EXPECTED" ]

78 then

zfs_create_001_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 84 lines

29 # ident "@(#)zfs_create_001_pos.ksh 1.2 07/01/09 SMI"

30 #

31 . $STF_SUITE/include/libtest.kshlib

32

33 ################################################################################

44 # 2. Verify the filesystem created successfully

45 #

46 # TESTABILITY: explicit

47 #

48 # TEST_AUTOMATION_LEVEL: automated

69 log_onexit cleanup

70

71 set -A datasets "$TESTPOOL/$TESTFS1" "$TESTPOOL/$LONGFSNAME" "$TESTPOOL/..." \

72 "$TESTPOOL/_1234_"

tst.static2.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 108 lines

48 foo(void)

49 {

50 DTRACE_PROBE(test_prov, probe1);

51 DTRACE_PROBE(test_prov, probe2);

57 DTRACE_PROBE(test_prov, probe1);

58 DTRACE_PROBE(test_prov, probe2);

59 foo();

60 }

68 EOF

69

70 cc -c test.c

71 if [ $? -ne 0 ]; then

72 print -u2 "failed to compile test.c"

84 exit 1

85 fi

86 cc -o test test.o prov.o

87 if [ $? -ne 0 ]; then

88 print -u2 "failed to link final executable"

zpool_import_012_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 194 lines

102 log_must $ZFS create $TESTPOOL/$TESTFS

103 log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS

104

105 [[ -d $ALTER_ROOT ]] && \

118 log_must $ZFS set canmount=off $pool/$TESTFS/$TESTCTR

119 log_must $ZFS set canmount=off $pool/$TESTFS/$TESTCTR/$TESTCTR1

120 log_must $ZFS create $pool/$TESTFS/$TESTCTR/$TESTFS1

121 log_must $ZFS create $pool/$TESTFS/$TESTCTR/$TESTCTR1/$TESTFS1

122 log_must $ZFS create $pool/$TESTFS/$TESTFS1

123 log_must $ZFS snapshot $pool/$TESTFS/$TESTFS1@snap

124 log_must $ZFS clone $pool/$TESTFS/$TESTFS1@snap $pool/$TESTCLONE1

125 done

126

127 typeset mount_fs="$TESTFS $TESTFS/$TESTFS1 $TESTCLONE1 \

128 $TESTFS/$TESTCTR/$TESTFS1 $TESTFS/$TESTCTR/$TESTCTR1/$TESTFS1"

129 typeset nomount_fs="$TESTFS/$TESTCTR $TESTFS/$TESTCTR/$TESTCTR1"

hotspare_import_001_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 167 lines

56 # TESTABILITY: explicit

57 #

58 # TEST_AUTOMATION_LEVEL: automated

59 #

60 # CODING STATUS: COMPLETED (2006-06-14)

68 function cleanup

69 {

70 poolexists $TESTPOOL && \

71 destroy_pool $TESTPOOL

130 log_must $ZPOOL offline $TESTPOOL $odev

131 verify_export_import $TESTPOOL \

132 $mtpt/$TESTFILE0 $checksum1

152 mtpt=$(get_prop mountpoint $TESTPOOL)

153 log_must $CP $MYTESTFILE $mtpt/$TESTFILE0

154

155 #

zvol_misc_005_neg.ksh (https://github.com/adilger/zfs.git) Korn Shell · 83 lines

50 fi

51

52 volsize=$(zfs get -H -o value volsize $TESTPOOL/$TESTVOL)

53

54 function cleanup

63 safe_dumpadm $savedumpdev

64 fi

65 zfs set volsize=$volsize $TESTPOOL/$TESTVOL

66 }

67

69 log_onexit cleanup

70

71 voldev=${ZVOL_DEVDIR}/$TESTPOOL/$TESTVOL

72 savedumpdev=$(get_dumpdevice)

73

history_008_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 74 lines

48 function cleanup

49 {

50 if datasetexists $root_testfs; then

51 log_must zfs destroy -rf $root_testfs

52 fi

53 log_must zfs create $root_testfs

54 }

55

57 log_onexit cleanup

58

59 root_testfs=$TESTPOOL/$TESTFS

60 fs1=$root_testfs/fs1; fs2=$root_testfs/fs2; fs3=$root_testfs/fs3

63 done

64

65 run_and_verify "zfs snapshot -r $root_testfs@snap" "-i"

66 run_and_verify "zfs hold -r tag $root_testfs@snap" "-i"

zfs_promote_006_neg.ksh (https://github.com/adilger/zfs.git) Korn Shell · 90 lines

30 #

31

32 . $STF_SUITE/include/libtest.shlib

33

34 #

51 verify_runnable "both"

52

53 snap=$TESTPOOL/$TESTFS@$TESTSNAP

54 clone=$TESTPOOL/$TESTCLONE

55 recvfs=$TESTPOOL/recvfs

56 set -A args "" \

57 "$TESTPOOL/blah" \

58 "$TESTPOOL" "$TESTPOOL/$TESTFS" "$snap" \

59 "$TESTPOOL/$TESTVOL" "$TESTPOOL $TESTPOOL/$TESTFS" \

60 "$clone $TESTPOOL/$TESTFS" "- $clone" "-? $clone" \

zfs_load-key_all.ksh (https://github.com/adilger/zfs.git) Korn Shell · 77 lines

41 log_must zfs destroy $TESTPOOL/$TESTFS1

42 datasetexists $TESTPOOL/zvol && log_must zfs destroy $TESTPOOL/zvol

43 poolexists $TESTPOOL1 && log_must destroy_pool $TESTPOOL1

49 log_must eval "echo $PASSPHRASE1 > /$TESTPOOL/pkey"

50 log_must zfs create -o encryption=on -o keyformat=passphrase \

51 -o keylocation=file:///$TESTPOOL/pkey $TESTPOOL/$TESTFS1

52

53 log_must zfs create -V 64M -o encryption=on -o keyformat=passphrase \

58 -O keylocation=file:///$TESTPOOL/pkey $TESTPOOL1 $DISK2

59

60 log_must zfs unmount $TESTPOOL/$TESTFS1

61 log_must zfs unload-key $TESTPOOL/$TESTFS1

74 log_must zfs mount $TESTPOOL1

75 log_must zfs mount $TESTPOOL/$TESTFS1

76

77 log_pass "'zfs load-key -a' loads keys for all datasets"

groupspace_001_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 79 lines

30 #

31

32 . $STF_SUITE/include/libtest.shlib

33 . $STF_SUITE/tests/functional/userquota/userquota_common.kshlib

quota_003_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 80 lines

30 #

31

32 . $STF_SUITE/include/libtest.shlib

33 . $STF_SUITE/tests/functional/quota/quota.kshlib

39 # that no more file creates are permitted.

40 #

41 # NOTE: THis test applies to a dataset rather than a file system.

42 #

43 # STRATEGY:

58 function cleanup

59 {

60 [[ -e $TESTDIR1/$TESTFILE1 ]] && \

61 log_must rm $TESTDIR1/$TESTFILE1

76 # twice the size of the quota

77 #

78 log_must fill_quota $TESTPOOL/$TESTCTR/$TESTFS1 $TESTDIR1

79

80 log_pass "File size limited by quota"

projectspace_004_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 76 lines

30 #

31

32 . $STF_SUITE/tests/functional/projectquota/projectquota_common.kshlib

33

34 #

large_dnode_001_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 82 lines

26 #

27

28 . $STF_SUITE/include/libtest.shlib

29

30 #

42 #

43

44 TEST_FS=$TESTPOOL/large_dnode

45

46 verify_runnable "both"

48 function cleanup

49 {

50 datasetexists $TEST_FS && log_must zfs destroy $TEST_FS

51 }

52

zpool_upgrade_001_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 78 lines

31 #

32

33 . $STF_SUITE/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib

34

35 #

54 log_onexit cleanup

55

56 typeset versions=$TEST_BASE_DIR/zpool-versions.$$

57

58 log_must zpool upgrade -v

zfs_mount_011_neg.ksh (https://github.com/adilger/zfs.git) Korn Shell · 81 lines

46 function cleanup

47 {

48 if snapexists $TESTPOOL/$TESTFS@$TESTSNAP; then

49 log_must_busy zfs destroy $TESTPOOL/$TESTFS@$TESTSNAP

50 fi

51

52 if is_global_zone && datasetexists $TESTPOOL/$TESTVOL; then

53 log_must_busy zfs destroy $TESTPOOL/$TESTVOL

58 log_onexit cleanup

59

60 fs=$TESTPOOL/$TESTFS

61 set -A badargs "A" "-A" "-" "-x" "-?" "=" "-o *" "-a"

62

71

72 #verify that zfs mount fails with volume and snapshot

73 log_must zfs snapshot $TESTPOOL/$TESTFS@$TESTSNAP

74 log_mustnot eval "zfs mount $TESTPOOL/$TESTFS@$TESTSNAP >/dev/null 2>&1"

zfs_create_004_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 73 lines

49 function cleanup

50 {

51 datasetexists $TESTPOOL/$TESTFS1 && \

52 log_must zfs destroy -f $TESTPOOL/$TESTFS1

61 typeset -i i=0

62 while (( $i < ${#RW_FS_PROP[*]} )); do

63 log_must zfs create -o ${RW_FS_PROP[$i]} $TESTPOOL/$TESTFS1

64 datasetexists $TESTPOOL/$TESTFS1 || \

65 log_fail "zfs create $TESTPOOL/$TESTFS1 fail."

66 propertycheck $TESTPOOL/$TESTFS1 ${RW_FS_PROP[i]} || \

67 log_fail "${RW_FS_PROP[i]} is failed to set."

68 log_must zfs destroy -f $TESTPOOL/$TESTFS1

69 (( i = i + 1 ))

70 done

zfs_create_003_pos.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 81 lines

29 # ident "@(#)zfs_create_003_pos.ksh 1.2 07/01/09 SMI"

30 #

31 . $STF_SUITE/include/libtest.kshlib

32

33 ################################################################################

45 # 2. Verify the volume created successfully

46 #

47 # TESTABILITY: explicit

48 #

49 # TEST_AUTOMATION_LEVEL: automated

67

68 set -A options "" "-b 1k" "-b 1K" "-b 1024" "-b 1024b"

69 vol=$TESTPOOL/$TESTVOL

70

71 typeset -i i=0

jbiadmin01602.ksh (https://bitbucket.org/ldassonville/openesb-core.git) Korn Shell · 99 lines

47 JBI_ANT_CMD="$JBI_ANT_NEG -Djbi.component.name=$COMPONENT_NAME -Djbi.target=$TARGET"

48

49 # Test : Test the application configuration operations for a component which is not installed - should get back an error.

50 $JBI_ANT_CMD list-application-configurations

51 $JBI_ANT_CMD -Djbi.app.config.name=testConfig -Djbi.app.config.params.file=$NEW_APP_CONFIG_FILE create-application-configuration

56 $JBI_ANT_NEG -Djbi.install.file=$COMPONENT_ARCHIVE -Djbi.target="server" install-component

57

58 # Test : Test the application configuration for a component which is not started - should get back an error.

59 $JBI_ANT_CMD list-application-configurations

60 $JBI_ANT_CMD -Djbi.app.config.name=testConfig -Djbi.app.config.params.file=$NEW_APP_CONFIG_FILE create-application-configuration

71 $JBI_ANT_CMD -Djbi.app.config.name=testConfig delete-application-configuration

72

73 # Test setting a non-existing application configuration

74 $JBI_ANT_CMD -Djbi.app.config.name=someConfig -Djbi.app.config.params.file=$INCORRECT_APP_CONFIG_FILE update-application-configuration

75

jbiadmin00135.ksh (https://bitbucket.org/ldassonville/openesb-core.git) Korn Shell · 96 lines

32

33 #############################################################################################

34 # Tests starting a service assembly which has a service unit in the Stopped state #

35 # and start fails, the service unit state should be rolled back to Stopped #

36 # #

37 # #

38 # A test component used throws an exception on start and shutDown of a service unit #

39 # #

40 # The test : #

74 $JBI_ANT -Djbi.component.name=$COMPONENT_NAME_2 start-component

75

76 # Test (c) : Deploy and start the test service assembly

77 $JBI_ANT -Djbi.deploy.file=$SA_ARCHIVE deploy-service-assembly

78 $JBI_ANT -Djbi.service.assembly.name=$SA_NAME start-service-assembly

zfs_acl_chmod_inherit_001_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 193 lines

30 #

31

32 . $STF_SUITE/tests/acl/acl_common.kshlib

33

34 #################################################################################

43 #

44 # STRATEGY:

45 # 1. Loop super user and non-super user to run the test case.

46 # 2. Create basedir and a set of subdirectores and files within it.

47 # 3. Separately chmod basedir with different inherite options.

97

98 # Defile the based directory and file

99 basedir=$TESTDIR/basedir; basefile=$TESTDIR/basefile

100

101 test_requires ZFS_ACL

redacted_incrementals.ksh (https://github.com/adilger/zfs.git) Korn Shell · 152 lines

16 #

17

18 . $STF_SUITE/tests/functional/redacted_send/redacted.kshlib

19

20 #

23 #

24 # Strategy:

25 # 1. Test normal incrementals from the original snap to a subset of the

26 # redaction list.

27 # 2. Test receipt of intermediate clones, and their children.

28 # 3. Test receipt with origin snap specified by '-o origin='.

29 # 4. Test incrementals from redaction bookmarks.

104 log_must zfs destroy -R $POOL2/rfs

105

106 # Write some data for tests of incremental sends from bookmarks

107 log_must zfs snapshot $sendfs@snap1

108 log_must zfs clone $sendfs@snap1 $POOL/hole1

jbi-admin-cli00016.ksh (https://bitbucket.org/ssteinmetz/openesb-core.git) Korn Shell · 199 lines

31

32 #----------------------------------------------------------------------------------

33 # Main function called that will run the test

34 #----------------------------------------------------------------------------------

35 run_test()

104

105 echo "upgrade-jbi-component fred"

106 $TEST_ASADMIN upgrade-jbi-component --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS --upgradefile=fred cli_test_engine4 ; echo $?

107

108 echo "set-jbi-runtime-logger fred.com.sun.jbi.messaging=WARNING"

140

141 echo "delete-jbi-application-configuration FirstName,LastName"

142 $TEST_ASADMIN delete-jbi-application-configuration --port $ADMIN_PORT --target server --user $ADMIN_USER $ASADMIN_PW_OPTS --component=sun-http-binding testConfigBad ; echo $?

143

144 echo "list-jbi-application-configurations --component=fred"

192 TEST_NAME="jbi-admin-cli00016"

193 TEST_DESCRIPTION="Test exit code"

194 . ./regress_defs.ksh

195 run_test

inuse_003_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 168 lines

32 . $STF_SUITE/include/libtest.shlib

33 . $STF_SUITE/tests/functional/inuse/inuse.cfg

34

35 #

53 function cleanup

54 {

55 poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1

56

57 poolexists $TESTPOOL2 && destroy_pool $TESTPOOL2

77

78 rm -rf $UFSMP

79 rm -rf $TESTDIR

80

81 #

133 unset NOINUSE_CHECK

134 log_note "Attempt to zpool the source device in use by ufsdump"

135 log_mustnot zpool create $TESTPOOL1 "$disk1"

136 log_mustnot poolexists $TESTPOOL1

jbi-admin-cli00013.ksh (https://bitbucket.org/ldassonville/openesb-core.git) Korn Shell · 251 lines

45 initilize_test

46 build_test_engine_with_endpoints_artifacts

47 test_cleanup

140 echo "start-jbi-component SimpleTestEngine"

141 $AS8BASE/bin/asadmin start-jbi-component --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS SimpleTestEngine

142

143 echo ""

145 echo " Show the stats for the Component SimpleTestEngine"

146 echo "-------------------------------------------------------------------"

147 echo "show-jbi-statistics --component=SimpleTestEngine"

148 $AS8BASE/bin/asadmin show-jbi-statistics --component=SimpleTestEngine --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS

244 TEST_NAME="jbi-admin-cli00013"

245 TEST_DESCRIPTION="Test Show Statistics"

246 . ./regress_defs.ksh

247 run_test

resilver_restart_001.ksh (https://github.com/adilger/zfs.git) Korn Shell · 187 lines

107 log_must truncate -s $VDEV_FILE_SIZE ${VDEV_FILES[@]} $SPARE_VDEV_FILE

108

109 log_must zpool create -f -o feature@resilver_defer=disabled $TESTPOOL1 \

110 raidz ${VDEV_FILES[@]}

111

128 for test in "without" "with"

129 do

130 log_note "Testing $test deferred resilvers"

131

132 if [[ $test == "with" ]]

133 then

134 log_must zpool set feature@resilver_defer=enabled $TESTPOOL1

135 RESTARTS=( "${DEFER_RESTARTS[@]}" )

136 VDEVS=( "${DEFER_VDEVS[@]}" )

filesystem_limit.ksh (https://github.com/adilger/zfs.git) Korn Shell · 139 lines

80 log_onexit cleanup

81

82 DATASET_TEST="$TESTPOOL/$TESTFS/filesystem_limit_test"

83 DATASET_UTIL="$TESTPOOL/$TESTFS/filesystem_limit_util"

99 log_mustnot datasetexists "$DATASET_TEST/clone_exceed"

100 log_must test "$(get_prop 'filesystem_count' "$DATASET_TEST")" == "2"

101 # Verify filesystem_limit is *not* enforced for users allowed to change it

102 log_must zfs create "$DATASET_TEST/create_notenforced_root"

104 log_must user_run $STAFF1 zfs create -o canmount=off "$DATASET_TEST/create_notenforced_user"

105 log_must test "$(get_prop 'filesystem_count' "$DATASET_TEST")" == "4"

106 cleanup

107

130 log_mustnot datasetexists "$DATASET_TEST/received"

131 log_must test "$(get_prop 'filesystem_count' "$DATASET_TEST")" == "0"

132 # Verify filesystem_limit is *not* enforced for users allowed to change it

133 log_must eval "zfs receive $DATASET_TEST/received < $ZSTREAM"

auto_offline_001_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 191 lines

19 #

20

21 . $STF_SUITE/include/libtest.shlib

22 . $STF_SUITE/tests/functional/events/events_common.kshlib

23 . $STF_SUITE/tests/functional/fault/fault.cfg

24

25 #

26 # DESCRIPTION:

27 # Testing Fault Management Agent ZED Logic - Physically removed device is

28 # made unavail and onlined when reattached

29 #

34 # 4. Reattach the device

35 # 5. Verify the device is onlined

36 # 6. Repeat the same tests with a spare device:

37 # zed will use the spare to handle the removed data device

38 # 7. Repeat the same tests again with a faulted spare device:

zpool_import_missing_002_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 197 lines

75 log_must zpool import -d $DEVICE_DIR $TESTPOOL1

76

77 cleanup_filesystem $TESTPOOL1 $TESTFS

78

79 destroy_pool $TESTPOOL1

127

128 setup_filesystem "$DEVICE_FILES" \

129 $TESTPOOL1 $TESTFS $TESTDIR1 \

130 "" ${vdevs[i]}

131

133 backup=""

134

135 log_must cp $MYTESTFILE $TESTDIR1/$TESTFILE0

136

137 log_must zfs umount $TESTDIR1

tst.remotesctpstate.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 149 lines

26

27 #

28 # Test sctp:::state-change and sctp:::{send,receive} by connecting to

29 # the remote http service.

30 # A number of state transition events along with sctp send and receive

34 #

35 # 1. A change to the ip stack breaking expected probe behavior,

36 # which is the reason we are testing.

37 # 2. The lo0 interface missing or not up.

38 # 3. The remote ssh service is not online.

40 # variables to be corrupted.

41 #

42 # This test performs a SCTP association to the http service (port 80) and

43 # checks that at least the following packet counts were traced:

44 #

jbiadmin00136.ksh (https://bitbucket.org/ldassonville/openesb-core.git) Korn Shell · 88 lines

29 #

30

31 echo "jbiadmin00136 : Test partial service assembly deployment ( Fix for CR 6514320 )"

32

33 #############################################################################################

34 # Tests deploying a service assembly. One component fails deploy, the #

35 # deployment result should show the error for the failed deployment. #

36 # #

37 # A test component used throws an exception on deploy of a service unit #

38 # #

39 # The test : #

jbi-admin-cli00009.ksh (https://bitbucket.org/ldassonville/openesb-core.git) Korn Shell · 186 lines

31

32 #----------------------------------------------------------------------------------

33 # Main function called that will run the test

34 #----------------------------------------------------------------------------------

35 run_test()

36 {

37 initilize_test

38

39 #--------------------------------------------------------------------------------

43

44 #--------------------------------------------------------------------------------

45 # Test setting and showing the component configuration values

46 #--------------------------------------------------------------------------------

47

179 TEST_NAME="jbi-admin-cli00009"

180 TEST_DESCRIPTION="Test Show and Set for Component configuration and loggers"

181 . ./regress_defs.ksh

182 run_test

jbiadmin02001.ksh (https://bitbucket.org/ldassonville/openesb-core.git) Korn Shell · 212 lines

49

50 # Install a component

51 $JBI_ANT_NEG -Djbi.install.file=$JV_SVC_TEST_CLASSES/dist/component-with-custom-mbean.jar -Djbi.target="sccfg-cluster" install-component

52 installComponentDelay

53

134

135 # Add an application configuration

136 $JBI_ANT_NEG -Djbi.app.config.name=testConfig -Djbi.app.config.params.file=$JV_SVC_REGRESS/deploytest/new-app-config.properties -Djbi.component.name=manage-binding-1 -Djbi.target="sccfg-cluster" create-application-configuration

137

138 $JBI_ANT_NEG -Djbi.app.variables.file=$JV_SVC_REGRESS/deploytest/new-app-var.properties -Djbi.component.name=manage-binding-1 -Djbi.target="sccfg-cluster" create-application-variable

157

158 #Update application configuration

159 $JBI_ANT_NEG -Djbi.app.config.name=testConfig -Djbi.app.config.params.file=$JV_SVC_REGRESS/deploytest/updated-app-config.properties -Djbi.component.name=manage-binding-1 -Djbi.target="sccfg-cluster" update-application-configuration

160

161 #Update application variables

zpool_add_001_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 127 lines

29 # ident "@(#)zpool_add_001_pos.ksh 1.4 09/06/22 SMI"

30 #

31 . $STF_SUITE/include/libtest.kshlib

32 . $STF_SUITE/tests/cli_root/zpool_add/zpool_add.kshlib

47 # 3. Verify the devices are added to the pool successfully

48 #

49 # TESTABILITY: explicit

50 #

51 # TEST_AUTOMATION_LEVEL: automated

87 ""|spare)

88 for vdev in "${poolarray[@]}"; do

89 create_pool "$TESTPOOL" "${diskname3}"

90 log_must poolexists "$TESTPOOL"

91 log_must $ZPOOL add -f "$TESTPOOL" ${keywords[i]} \

92 $vdev

93 log_must iscontained "$TESTPOOL" "$vdev"

zpool_get_001_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 75 lines

30 #

31

32 . $STF_SUITE/include/libtest.kshlib

33

34 ################################################################################

47 # 3. Check usage message contains text "usage"

48 #

49 # TESTABILITY: explicit

50 #

51 # TEST_AUTOMATION_LEVEL: automated

zpool_create_001_neg.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 75 lines

29 # ident "@(#)zpool_create_001_neg.ksh 1.4 09/01/12 SMI"

30 #

31 . $STF_SUITE/include/libtest.kshlib

32

33 ################################################################################

45 # 3. Verify that an error is returned.

46 #

47 # TESTABILITY: explicit

48 #

49 # TEST_AUTOMATION_LEVEL: automated

63 log_fail "No spare disks available."

64

65 set -A args "create $TESTPOOL $ADD_DISK" "create -f $TESTPOOL $ADD_DISK"

66

67 log_assert "zpool create [-fn] pool_name vdev"

clean_mirror_003_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 67 lines

30 #

31

32 . $STF_SUITE/include/libtest.kshlib

33 . $STF_SUITE/tests/clean_mirror/clean_mirror_common.kshlib

48 # 3) verify that all the file contents are unchanged on the file system

49 #

50 # TESTABILITY: explicit

51 #

52 # TEST_AUTOMATION_LEVEL: automated

slog_replay_fs_002.ksh (https://github.com/adilger/zfs.git) Korn Shell · 137 lines

68 log_must mkdir /$TESTPOOL/$TESTFS/dir0

69 log_must eval 'for i in $(seq $NFILES); do zfs set dnodesize=${dnsize[$RANDOM % ${#dnsize[@]}]} $TESTPOOL/$TESTFS; touch /$TESTPOOL/$TESTFS/dir0/file.$i; done'

70

71 #

95 log_must eval 'rm -f /$TESTPOOL/$TESTFS/dir0/*'

96 log_must eval 'for i in $(seq $NFILES); do zfs set dnodesize=${dnsize[$RANDOM % ${#dnsize[@]}]} $TESTPOOL/$TESTFS; touch /$TESTPOOL/$TESTFS/dir0/file.$i; done'

97

98 #

101 log_must mkdir -p $TESTDIR/copy

102 log_must cp -a /$TESTPOOL/$TESTFS/* $TESTDIR/copy/

103

104 #

133

134 log_note "Verify working set diff:"

135 log_must diff -r /$TESTPOOL/$TESTFS $TESTDIR/copy

136

137 log_pass "Replay of intent log succeeds."

reservation_004_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 130 lines

70

71 if ! is_global_zone ; then

72 OBJ_LIST="$TESTPOOL/$TESTFS2"

73 else

74 OBJ_LIST="$TESTPOOL/$TESTFS2 \

75 $TESTPOOL/$TESTVOL $TESTPOOL/$TESTVOL2"

76

77 ((vol_set_size = space_avail / 4))

82 log_must zfs create -V $vol_set_size $TESTPOOL/$TESTVOL

83 log_must zfs set refreservation=none $TESTPOOL/$TESTVOL

84 log_must zfs set reservation=none $TESTPOOL/$TESTVOL

102 # of the volume itself.

103 #

104 [[ $obj == $TESTPOOL/$TESTVOL ]] && \

105 ((resv_size_set = vol_set_size - RESV_DELTA))

106

zfs_list_003_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 91 lines

29 # ident "@(#)zfs_list_003_pos.ksh 1.1 07/06/05 SMI"

30 #

31 . $STF_SUITE/include/libtest.kshlib

32 . $STF_SUITE/tests/cli_user/cli_user.kshlib

71 tmpfile=$TMPDIR/zfslist.out.${TESTCASE_ID}

72 children="$TESTPOOL/$TESTFS"

73

74 for fs in $DATASETS ; do

75 children="$children $TESTPOOL/$TESTFS/$fs"

76 done

77

78 cd /tmp

79

80 for path in $TESTPOOL/$TESTFS $TESTDIR ./../$TESTDIR ; do

81 run_unprivileged $ZFS list -rH -o name $path > $tmpfile

82 for fs in $children ; do

zfs_share_008_neg.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 88 lines

30 #

31

32 . $STF_SUITE/include/libtest.kshlib

33

34 #################################################################################

46 # 3. Verify that the invalid datasets are not shared.

47 #

48 # TESTABILITY: explicit

49 #

50 # TEST_AUTOMATION_LEVEL: automated

60 if is_global_zone ; then

61 set -A datasets \

62 "$TESTPOOL/$TESTVOL" "$TESTDIR"

63 fi

64

user_property_001_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 83 lines

30 #

31

32 . $STF_SUITE/tests/cli_root/zfs_set/zfs_set_common.kshlib

33

34 #################################################################################

49 # dataset in #1.

50 #

51 # TESTABILITY: explicit

52 #

53 # TEST_AUTOMATION_LEVEL: automated

73 typeset value=$(user_property_value $len)

74

75 for dtst in $TESTPOOL $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL; do

76 log_must eval "$ZFS set $user_prop='$value' $dtst"

77 log_must eval "check_user_prop $dtst $user_prop '$value'"

tst.noreapring.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 124 lines

57 exit 1

58 fi

59 $dtrace -G -s prov.d test.o

60 if [ $? -ne 0 ]; then

61 print -u2 "failed to create DOF"

62 exit 1

63 fi

64 cc -o test test.o prov.o

65 if [ $? -ne 0 ]; then

66 print -u2 "failed to link final executable"

71 {

72 $dtrace -Zwqs /dev/stdin <<EOF

73 test_prov*:::

74 {

75 probeid = id;

hotplug_011_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 84 lines

30 #

31

32 . $STF_SUITE/tests/hotplug/hotplug.kshlib

33

34 #################################################################################

51 # 7. Verify no FMA fault was generated.

52 #

53 # TESTABILITY: explicit

54 #

55 # TEST_AUTOMATION_LEVEL: automated

78

79 log_must create_gnop $DISK0

80 cleanup_testenv $TESTPOOL

81 done

82

reservation_004_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 131 lines

70 log_assert "Verify space released when a dataset with reservation is destroyed"

71

72 log_must $ZFS create $TESTPOOL/$TESTFS2

73

74 space_avail=`get_prop available $TESTPOOL`

79 OBJ_LIST="$TESTPOOL/$TESTFS2 \

80 $TESTPOOL/$TESTVOL $TESTPOOL/$TESTVOL2"

81

82 (( vol_set_size = space_avail / 4 ))

89 log_must $ZFS set refreservation=none $TESTPOOL/$TESTVOL

90 fi

91 log_must $ZFS set reservation=none $TESTPOOL/$TESTVOL

92 log_must $ZFS create -s -V $sparse_vol_set_size $TESTPOOL/$TESTVOL2

109 # of the volume itself.

110 #

111 [[ $obj == $TESTPOOL/$TESTVOL ]] && \

112 (( resv_size_set = vol_set_size - RESV_DELTA ))

113

reservation_001_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 132 lines

75 OBJ_LIST=""

76 else

77 OBJ_LIST="$TESTPOOL/$TESTVOL $TESTPOOL/$TESTVOL2"

78

79 (( vol_set_size = space_avail / 4 ))

87 # which we reset back to zero initially.

88 #

89 log_must $ZFS create -V $vol_set_size $TESTPOOL/$TESTVOL

90 log_must $ZFS set reservation=none $TESTPOOL/$TESTVOL

92 log_must $ZFS set refreservation=none $TESTPOOL/$TESTVOL

93 fi

94 log_must $ZFS create -s -V $sparse_vol_set_size $TESTPOOL/$TESTVOL2

95 fi

96

97

98 for obj in $TESTPOOL/$TESTFS $OBJ_LIST; do

99

100 space_avail=`get_prop available $TESTPOOL`

jbi-admin-cli00012.ksh (https://bitbucket.org/ldassonville/openesb-core.git) Korn Shell · 98 lines

51 echo "-------------------------------------------------------------------"

52 echo "verify-jbi-application-environment sa1.jar"

53 $AS8BASE/bin/asadmin verify-jbi-application-environment --templatedir=${JV_SVC_BLD}/regress/testdata/tmp --includedeploy --target server --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS ${JV_SVC_BLD}/regress/sa1.jar

54

55 echo ""

69 echo ""

70 echo "-------------------------------------------------------------------"

71 echo " Install test components test-component and test-component1"

72 echo "-------------------------------------------------------------------"

73 echo "install-jbi-component test-component.jar"

82 echo "verify-jbi-application-environment test-sa.jar"

83 $AS8BASE/bin/asadmin verify-jbi-application-environment --templatedir=${JV_SVC_BLD}/regress/testdata/tmp --includedeploy --target server --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS ${JV_SVC_BLD}/regress/test-sa.jar

84

85 }

91 TEST_NAME="jbi-admin-cli00012"

92 TEST_DESCRIPTION="Test Verify Command"

93 . ./regress_defs.ksh

94 run_test

random_readwrite_fixed.ksh (https://github.com/adilger/zfs.git) Korn Shell · 106 lines

26 #

27

28 . $STF_SUITE/include/libtest.shlib

29 . $STF_SUITE/tests/perf/perf.shlib

69 fi

70

71 # Layout the files to be used by the readwrite tests. Create as many files

72 # as the largest number of threads. An fio run with fewer threads will use

73 # a subset of the available files.

add_nested_replacing_spare.ksh (https://github.com/adilger/zfs.git) Korn Shell · 110 lines

25 #

26

27 . $STF_SUITE/include/libtest.shlib

28

29 #

45 zed_cleanup

46 log_must zinject -c all

47 destroy_pool $TESTPOOL

48 log_must rm -f $DATA_DEVS $SPARE_DEVS

49 }

52 log_onexit cleanup

53

54 FAULT_DEV="$TEST_BASE_DIR/fault-dev"

55 SAFE_DEV1="$TEST_BASE_DIR/safe-dev1"

56 SAFE_DEV2="$TEST_BASE_DIR/safe-dev2"

57 SAFE_DEV3="$TEST_BASE_DIR/safe-dev3"

tst.noreap.ksh (https://bitbucket.org/iorivur/freebsd-bhyve-with-suspend-resume.git) Korn Shell · 128 lines

42 main(int argc, char **argv)

43 {

44 DTRACE_PROBE(test_prov, probe1);

45 }

46 EOF

57 exit 1

58 fi

59 $dtrace -G -32 -s prov.d test.o

60 if [ $? -ne 0 ]; then

61 print -u2 "failed to create DOF"

62 exit 1

63 fi

64 gcc -o test test.o prov.o

65 if [ $? -ne 0 ]; then

66 print -u2 "failed to link final executable"

tst.exitcore.ksh (https://bitbucket.org/iorivur/freebsd-bhyve-with-suspend-resume.git) Korn Shell · 92 lines

27

28 #

29 # This script tests that the proc:::exit probe fires with the correct argument

30 # when the process core dumps. The problematic bit here is making sure that

31 # a process _can_ dump core -- if core dumps are disabled on both a global

32 # and per-process basis, this test will fail. Rather than having this test

33 # muck with coreadm(1M) settings, it will fail explicitly in this case and

34 # provide a hint as to the problem. In general, machines should never be

zfs_copies_006_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 91 lines

30 #

31

32 . $STF_SUITE/tests/cli_root/zfs_copies/zfs_copies.kshlib

33

34 ################################################################################

48 # 5. Verify that the volume space is charged as expected

49 #

50 # TESTABILITY: explicit

51 #

52 # TEST_AUTOMATION_LEVEL: automated

79 log_onexit cleanup

80 mntp=$UFS_MNTPOINT

81 vol=$TESTPOOL/$TESTVOL1

82

83 if [[ ! -d $mntp ]]; then

snapshot_002_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 129 lines

94 log_note "Create a tarball from $TESTDIR contents..."

95 CWD=$PWD

96 cd $TESTDIR || log_fail "Could not cd $TESTDIR"

97 log_must tar cf $TESTDIR/tarball.original.tar file*

114

115 CWD=$PWD

116 cd $TESTDIR/original || log_fail "Could not cd $TESTDIR/original"

117 log_must tar xf $TESTDIR/tarball.original.tar

118

119 cd $TESTDIR/snapshot || log_fail "Could not cd $TESTDIR/snapshot"

120 log_must tar xf $TESTDIR/tarball.snapshot.tar

122 cd $CWD || log_fail "Could not cd $CWD"

123

124 diff -q -r $TESTDIR/original $TESTDIR/snapshot > /dev/null 2>&1

125 if [[ $? -eq 1 ]]; then

126 log_fail "Directory structures differ."

zpool_import_013_neg.ksh (https://github.com/adilger/zfs.git) Korn Shell · 74 lines

30 #

31

32 . $STF_SUITE/include/libtest.shlib

33 . $STF_SUITE/tests/functional/cli_root/zpool_import/zpool_import.cfg

54 log_note "Creating pool from $POOL_FILE"

55 log_must bzcat \

56 $STF_SUITE/tests/functional/cli_root/zpool_import/blockfiles/$POOL_FILE.bz2 \

57 > /$TESTPOOL/$POOL_FILE

62 {

63 poolexists $POOL_NAME && destroy_pool $POOL_NAME

64 rm -f /$TESTPOOL/$POOL_FILE

65 }

66

69

70 uncompress_pool

71 log_mustnot zpool import -d /$TESTPOOL $POOL_NAME

72 log_must zpool import -d /$TESTPOOL -f $POOL_NAME

posix_003_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 60 lines

21 #

22

23 . $STF_SUITE/include/libtest.shlib

24

25 #

26 # DESCRIPTION:

27 # Verify that ACLs survive remount.

28 # Regression test for https://github.com/zfsonlinux/zfs/issues/4520

29 #

30 # STRATEGY:

31 # 1. Test presence of default and regular ACLs after remount

32 # a. Can set and list ACL before remount

33 # b. Can list ACL after remount

51

52 if [ "$?" -eq "0" ]; then

53 log_must zfs unmount $TESTPOOL/$TESTFS

54 log_must zfs mount $TESTPOOL/$TESTFS

zpool_trim_offline_export_import_online.ksh (https://github.com/adilger/zfs.git) Korn Shell · 62 lines

20 #

21

22 . $STF_SUITE/include/libtest.shlib

23 . $STF_SUITE/tests/functional/cli_root/zpool_trim/zpool_trim.kshlib

37 DISK2="$(echo $DISKS | cut -d' ' -f2)"

38

39 log_must zpool create -f $TESTPOOL mirror $DISK1 $DISK2

40

41 log_must zpool trim -r 128M $TESTPOOL $DISK1

42 log_must zpool offline $TESTPOOL $DISK1

43 progress="$(trim_progress $TESTPOOL $DISK1)"

44 [[ -z "$progress" ]] && log_fail "Trimming did not start"

45 log_mustnot eval "trim_prog_line $TESTPOOL $DISK1 | grep suspended"

46

47 log_must zpool export $TESTPOOL

zpool_import_missing_005_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 124 lines

28 #

29

30 . $STF_SUITE/include/libtest.kshlib

31

32 #################################################################################

38 # DESCRIPTION:

39 # Verify that a pool can still be imported even if its devices' names

40 # have changed, for all types of devices. This is a test of vdev_geom's

41 # import_by_guid functionality.

42 # STRATEGY:

47 # 5. Verify 'zpool import' can import it

48 #

49 # TESTABILITY: explicit

50 #

51 # TEST_AUTOMATION_LEVEL: automated

run_juicer.ksh (https://github.com/ikeji/openjdk7-jdk.git) Korn Shell · 79 lines

24 #!/bin/ksh

25 #

26 # Script to build and launch the juicer test as part of

27 # the RMI reliability test. This script is used to run

28 # the juicer test for a certain number of hours. This

29 # script is NOT used when running the juicer test as part

74 kill -9 $pid1

75

76 echo " Juicer test finished with exit value ${RETVAL}"

77

78 exit ${RETVAL}

jbiadmin01604.ksh (https://bitbucket.org/ldassonville/openesb-core.git) Korn Shell · 123 lines

45 JBI_ANT_CMD="$JBI_ANT_NEG -Djbi.component.name=$COMPONENT_NAME -Djbi.target=$TARGET"

46

47 # Test : Test the application configuration operations for a component which is not installed - should get back an error.

48 $JBI_ANT_CMD list-application-variables

49 $JBI_ANT_CMD -Djbi.app.variables.file=$NEW_APP_VAR_FILE create-application-variable

54 $JBI_ANT_NEG -Djbi.install.file=$COMPONENT_ARCHIVE -Djbi.target="server" install-component

55

56 # Test : Test the application configuration for a component which is not started - should get back an error.

57 $JBI_ANT_CMD list-application-variables

58 $JBI_ANT_CMD -Djbi.app.variables.file=$NEW_APP_VAR_FILE create-application-variable

84 asadmin delete-jbi-application-variable -u $AS_ADMIN_USER $ASADMIN_PW_OPTS --port $ASADMIN_PORT --component $COMPONENT_NAME myPassword

85

86 # Test adding a application variable with the type not specified / empty ( test fix for issue 148 )

87 $JBI_ANT_CMD -Djbi.app.variable.name=FirstName -Djbi.app.variable.value=John create-application-variable

88 $JBI_ANT_CMD list-application-variables

link_count_001.ksh (https://github.com/adilger/zfs.git) Korn Shell · 95 lines

30 #

31

32 . $STF_SUITE/include/libtest.shlib

33

34 #

71 rm -f ${TESTDIR}/tmp/x* >/dev/null 2>&1

72

73 rm_lnkcnt_zero_file ${TESTDIR}/tmp/test$$ > /dev/null 2>&1 &

74 PID=$!

75 log_note "rm_lnkcnt_zero_file ${TESTDIR}/tmp/test$$ pid: $PID"

91

92 log_must kill -TERM $PID

93 log_must rm -f ${TESTDIR}/tmp/test$$*

94

95 log_pass "Verify file link count is zero on zfs"

zfs_set_003_neg.ksh (https://github.com/adilger/zfs.git) Korn Shell · 77 lines

30 #

31

32 . $STF_SUITE/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib

33

34 #

49 rm -f $badpath

50 fi

51 if datasetexists $TESTPOOL/foo; then

52 log_must zfs destroy $TESTPOOL/foo

57 log_onexit cleanup

58

59 badpath=$TEST_BASE_DIR/foo1.$$

60 touch $badpath

61 longpath=$(gen_dataset_name 1030 "abcdefg")

62

63 log_must zfs create -o mountpoint=legacy $TESTPOOL/foo

64

65 # Do the negative testing about "property may be set but unable to remount filesystem"

inuse_008_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 97 lines

30 #

31

32 . $STF_SUITE/include/libtest.shlib

33 . $STF_SUITE/tests/functional/inuse/inuse.cfg

52 function cleanup

53 {

54 poolexists $TESTPOOL1 || zpool import $TESTPOOL1 >/dev/null 2>&1

55

56 poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1

88 # If this is for raidz2, use 3 disks for the pool.

89 [[ ${vdevs[i]} = "raidz2" ]] && spare="$sdisks"

90 create_pool $TESTPOOL1 ${vdevs[i]} $vdisks $spare

91 log_must zpool export $TESTPOOL1

zfs_reservation_002_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 88 lines

46 verify_runnable "both"

47

48 # Use a unique value so earlier test failures will not impact this test.

49 RESERVATION="reserve"-$$

50 RESERVATION2="reserve2"-$$

53 {

54 typeset FS

55 for FS in $TESTPOOL/$RESERVATION $TESTPOOL/$RESERVATION2

56 do

57 if datasetexists $FS ; then

72 log_must zfs set reservation=none $TESTPOOL/$RESERVATION2

73

74 for FS in $TESTPOOL/$RESERVATION $TESTPOOL/$RESERVATION2

75 do

76

send_encrypted_truncated_files.ksh (https://github.com/adilger/zfs.git) Korn Shell · 126 lines

42 function cleanup

43 {

44 datasetexists $TESTPOOL/$TESTFS2 && \

45 log_must zfs destroy -r $TESTPOOL/$TESTFS2

106 log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS2/truncated3 \

107 bs=128k count=3 iflag=fullblock

108 log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS2/truncated4 \

109 bs=512 count=1 iflag=fullblock

110

111 log_must zfs snapshot $TESTPOOL/$TESTFS2@snap2

112 expected_cksum=$(recursive_cksum /$TESTPOOL/$TESTFS2)

113

114 log_must eval "zfs send -wp $TESTPOOL/$TESTFS2@snap1 > $sendfile"

115 log_must eval "zfs send -wp -i @snap1 $TESTPOOL/$TESTFS2@snap2 > $sendfile2"

116

117 log_must eval "zfs recv -F $TESTPOOL/recv < $sendfile"

zfs_002_pos.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 127 lines

29 # ident "@(#)zfs_002_pos.ksh 1.3 09/06/22 SMI"

30 #

31 . $STF_SUITE/include/libtest.kshlib

32 . $STF_SUITE/tests/userquota/userquota_common.kshlib

46 # 3. Verify the command aborts and generate a core file

47 #

48 # TESTABILITY: explicit

49 #

50 # TEST_AUTOMATION_LEVEL: automated

75 log_onexit cleanup

76

77 #preparation work for testing

78 corepath=$TESTDIR/core

82 log_must $MKDIR $corepath

83

84 ctr=$TESTPOOL/$TESTCTR

85 log_must $ZFS create $ctr

86

jbiadmin01255.ksh (https://bitbucket.org/ldassonville/openesb-core.git) Korn Shell · 82 lines

46 createClusterDelay

47

48 asadmin create-instance --port $ASADMIN_PORT --user $AS_ADMIN_USER $ASADMIN_PW_OPTS --cluster testcluster1 --nodeagent agent1 testins1 1>&2

49 createInstanceDelay

50 asadmin start-instance --port $ASADMIN_PORT -u $AS_ADMIN_USER $ASADMIN_PW_OPTS testins1 1>&2

54 installComponentDelay

55

56 asadmin deploy-jbi-service-assembly -u $AS_ADMIN_USER $ASADMIN_PW_OPTS --port $ASADMIN_PORT --target=testcluster1 $JV_SVC_TEST_CLASSES/dist/system-comps-sa.jar 2>&1

57 deploySaDelay

58 asadmin start-jbi-service-assembly -u $AS_ADMIN_USER $ASADMIN_PW_OPTS --port $ASADMIN_PORT --target=testcluster1 system-comps-sa 2>&1

61 stopSaDelay

62

63 asadmin create-instance --port $ASADMIN_PORT --user $AS_ADMIN_USER $ASADMIN_PW_OPTS --cluster testcluster1 --nodeagent agent1 testins2 1>&2

64 createInstanceDelay

65 asadmin start-instance --port $ASADMIN_PORT -u $AS_ADMIN_USER $ASADMIN_PW_OPTS testins2 1>&2

ui00016.ksh (https://bitbucket.org/ldassonville/openesb-core.git) Korn Shell · 96 lines

30

31 ####

32 # Test for list-statistics

33 ####

34

42 SA_ARCHIVE=${JV_SVC_BLD}/regress/dist/ping-sa.jar

43 SA_NAME=PingApp

44 COMPONENT_ARCHIVE=${JV_SVC_BLD}/regress/dist/simpletestengine.jar

45 COMPONENT_NAME=SimpleTestEngine

46

47 run_test_against_server()

48 {

49

65 }

66

67 run_test()

68 {

69

zpool_export_001_neg.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 79 lines

30 #

31

32 . $STF_SUITE/include/libtest.kshlib

33 . $STF_SUITE/tests/cli_user/cli_user.kshlib

47 # 2. Verify the command fails

48 #

49 # TESTABILITY: explicit

50 #

51 # TEST_AUTOMATION_LEVEL: automated

59 function check_for_export

60 {

61 RESULT=$($ZPOOL list | $GREP $TESTPOOL.virt )

62 if [ -z "$RESULT" ]

63 then

71 log_assert "zpool export returns an error when run as a user"

72

73 log_mustnot run_unprivileged "$ZPOOL export $TESTPOOL.virt"

74 check_for_export

75

zpool_import_002_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 166 lines

64 verify_runnable "global"

65

66 set -A pools "$TESTPOOL" "$TESTPOOL1"

67 set -A devs "" "-d $DEVICE_DIR"

68 set -A options "" "-R $ALTER_ROOT"

101 log_assert "Verify that an exported pool cannot be imported more than once."

102

103 setup_filesystem "$DEVICE_FILES" $TESTPOOL1 $TESTFS $TESTDIR1

104

105 checksum1=$($SUM $MYTESTFILE | $AWK '{print $1}')

135

136 while (( i < ${#pools[*]} )); do

137 log_must $CP $MYTESTFILE ${mtpts[i]}/$TESTFILE0

138

139 log_must $ZFS umount ${mtpts[i]}

zpool_destroy_004_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 146 lines

49 log_must $MKDIR -p $TESTDIR

50 log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS

51 log_must dd if=/dev/zero of=$TESTDIR/f0 bs=1024k count=$datasz

68 # The pid of this pipe line is that of zfs receive

69 #

70 ( $ZFS send -RP $TESTPOOL/$TESTFS@snap1 | $ZFS receive -Fu $recv/d1 ) &

71 sndrcv_start=$(date '+%s')

72 rcvpid=$!

116 log_note "TEST: send|receive to different pools, destroy sender"

117 create_sender_and_receiver

118 send_recv_destroy $sleeptime $TESTPOOL1 $TESTPOOL SENDER

119

120 log_note "TEST: send|receive to different pools, destroy receiver"

121 create_sender_and_receiver

122 send_recv_destroy $sleeptime $TESTPOOL1 $TESTPOOL1 RECEIVER

123 }

124

reservation_022_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 82 lines

15 #

16

17 . $STF_SUITE/include/libtest.shlib

18 . $STF_SUITE/tests/functional/reservation/reservation.shlib

40 {

41 # Destroy first vol and descendants in one go.

42 destroy_dataset "$TESTPOOL/$TESTVOL" "-Rf"

43 }

44

51 (( vol_size = (space_avail / 4) & ~(1024 * 1024 - 1) ))

52

53 vol=$TESTPOOL/$TESTVOL

54 vol2=$TESTPOOL/$TESTVOL2

55 vol3=$TESTPOOL/$TESTVOL2-again

56

57 # Create sparse vol and verify

zpool_create_015_neg.ksh (https://github.com/adilger/zfs.git) Korn Shell · 91 lines

30 #

31

32 . $STF_SUITE/include/libtest.shlib

33 . $STF_SUITE/tests/functional/cli_root/zpool_create/zpool_create.shlib

56 fi

57

58 for pool in $TESTPOOL1 $TESTPOOL; do

59 poolexists $pool && destroy_pool $pool

60 done

62

63 unset NOINUSE_CHECK

64 typeset vol_name=$TESTPOOL/$TESTVOL

65

66 log_assert "'zpool create' should fail with zfs vol device in swap."

70 # use zfs vol device in swap to create pool which should fail.

71 #

72 create_pool $TESTPOOL $DISK0

73 log_must zfs create -V 100m $vol_name

74 block_device_wait

send-cpL_varied_recsize.ksh (https://github.com/adilger/zfs.git) Korn Shell · 203 lines

58 datasetexists $TESTPOOL/128k && log_must_busy zfs destroy $TESTPOOL/128k

59 datasetexists $TESTPOOL/1m && log_must_busy zfs destroy $TESTPOOL/1m

60 cleanup_pool $POOL2

61 destroy_pool $POOL3

68 typeset expected_file_bs=$2

69 typeset expected_recsize=$3

70 typeset file="$(get_prop mountpoint $recv_ds)/testfile"

71

72 [[ -f $file ]] || log_fail "file '$file' doesn't exist"

126 typeset expected_file_bs=${3-131072}

127 typeset expected_recsize=${4-131072}

128 typeset send_ds=$TESTPOOL/$recsize

129 typeset send_snap=$send_ds@snap

130 typeset recv_ds=$recv_pool/$recsize

157

158 check_recsize $recv_ds $expected_file_bs $expected_recsize

159 $do_size_test && verify_stream_size $stream $recv_ds

160 log_must_busy zfs destroy -r $recv_ds

161 }

zfsd_hotspare_004_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 108 lines

29 # ident "@(#)hotspare_replace_006_pos.ksh 1.0 12/08/10 SL"

30 #

31 . $STF_SUITE/tests/hotspare/hotspare.kshlib

32 . $STF_SUITE/tests/zfsd/zfsd.kshlib

51 # 5. Verify that the vdev gets resilvered and the spare gets removed

52 #

53 # TESTABILITY: explicit

54 #

55 # TEST_AUTOMATION_LEVEL: automated

73 # Check that the spare was activated

74 wait_for_pool_dev_state_change 20 $spare_dev INUSE

75 log_must $ZPOOL status $TESTPOOL

76

77 # Re-enable the missing disk

99 log_must create_gnop $REMOVAL_DISK $PHYSPATH

100 for keyword in "${MY_KEYWORDS[@]}" ; do

101 log_must create_pool $TESTPOOL $keyword $REMOVAL_NOP $OTHER_NOPS spare $SPARE_NOP

102 log_must $ZPOOL set autoreplace=on $TESTPOOL

zinject_001_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 147 lines

96 }

97

98 function test_zinject

99 {

100 typeset basedir=$1

120 $basedir/testdir.$maxnumber ; do

121

122 test_zinject_unit $etype $object \

123 ${errset[i]} "${errset[((i+1))]}"

124 done

138 log_must $ZFS create $TESTPOOL/$TESTFS

139 log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS

140

141 populate_test_env $TESTDIR $maxnumber

142 test_zinject $TESTDIR $type

143

144 cleanup_env

zpool_import_corrupt_001_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 130 lines

28 #

29

30 . $STF_SUITE/include/libtest.kshlib

31

32 #################################################################################

46 # 5. Verify 'zpool import' can import it

47 #

48 # TESTABILITY: explicit

49 #

50 # TEST_AUTOMATION_LEVEL: automated

101

102 for ((i=0; $i<$N_VDEV_LABELS; i=$i+1 )); do

103 log_must $ZPOOL create -f $TESTPOOL $DISK

104 log_must $ZPOOL export $TESTPOOL

124 fi

125

126 log_must $ZPOOL import $TESTPOOL

127 destroy_pool $TESTPOOL

tst.tailcall.ksh (https://github.com/buffygb/illumos-gate.git) Korn Shell · 131 lines

71

72 cat > prov.d <<EOF

73 provider test {

74 probe fire(int, int, int);

75 };

76 EOF

77

78 /usr/ccs/bin/as -xregsym=no -P -D_ASM -o test.o test.s

79 if [ $? -ne 0 ]; then

80 print -u2 "failed to compile test.s"

88 fi

89

90 gcc -o test test.o prov.o

91 if [ $? -ne 0 ]; then

92 print -u2 "failed to link final executable"

zfs_receive_001_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 176 lines

68 if [[ -d $TESTDIR1 ]] ; then

69 log_must rm -rf $TESTDIR1

70 fi

71 log_must zfs create $rst_root

76 log_onexit cleanup

77

78 typeset datasets="$TESTPOOL/$TESTFS $TESTPOOL"

79 set -A bkup "$TEST_BASE_DIR/fullbkup" "$TEST_BASE_DIR/incbkup"

91 set -A orig_snap "${orig_fs}@init_snap" "${orig_fs}@inc_snap"

92 typeset mntpnt=$(get_prop mountpoint ${orig_fs})

93 set -A orig_data "${mntpnt}/$TESTFILE1" "${mntpnt}/$TESTFILE2"

94

95 typeset relative_path=""

104 set -A rst_snap "$rst_root/$TESTFS@init_snap" "$rst_root/$TESTFS@inc_snap"

105 set -A rst_snap2 "${leaf_fs}@init_snap" "${leaf_fs}@inc_snap"

106 set -A rst_data "$TESTDIR1/$TESTFS/$TESTFILE1" "$TESTDIR1/$TESTFS/$TESTFILE2"

107 set -A rst_data2 "$TESTDIR1/${relative_path}/$TESTFILE1" "$TESTDIR1/${relative_path}/$TESTFILE2"

RecorderTest.html (http://mobicents.googlecode.com/svn/trunk/) HTML · 147 lines ✨ Summary

This HTML code generates a documentation page for a Java class, com.hp.opencall.jmsc.test.mandatory.functional.mediagroup.RecorderTest. It displays information about the class, including its usage, with no actual content provided. The page includes navigation bars at the top and bottom, as well as copyright information at the end.

5 <!-- Generated by javadoc (build 1.6.0_0) on Thu Oct 29 13:45:49 CET 2009 -->

6 <TITLE>

7 Uses of Class com.hp.opencall.jmsc.test.mandatory.functional.mediagroup.RecorderTest (Test Compatibility Kit for JSR309)

8 </TITLE>

9

16 {

17 if (location.href.indexOf('is-external=true') == -1) {

18 parent.document.title="Uses of Class com.hp.opencall.jmsc.test.mandatory.functional.mediagroup.RecorderTest (Test Compatibility Kit for JSR309)";

19 }

20 }

40 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>

41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>

42 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../../com/hp/opencall/jmsc/test/mandatory/functional/mediagroup/RecorderTest.html" title="class in com.hp.opencall.jmsc.test.mandatory.functional.mediagroup"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD>

43 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD>

44 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>

zfs_acl_cp_002_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 121 lines

65 function cleanup

66 {

67 if datasetexists $TESTPOOL/$TESTFS1; then

68 log_must $ZFS destroy -f $TESTPOOL/$TESTFS1

77 test_requires RUNAT ZFS_ACL ZFS_XATTR

78

79 log_note "Create the second zfs file system: $TESTPOOL/$TESTFS1."

80 log_must $ZFS create $TESTPOOL/$TESTFS1

81 log_must $ZFS set mountpoint=$TESTDIR1 $TESTPOOL/$TESTFS1

82 log_must $ZFS set aclmode=passthrough $TESTPOOL/$TESTFS1

96 log_must usr_exec $MKDIR $testdir $dstdir

97

98 log_must usr_exec $RUNAT $testfile $CP $MYTESTFILE attr.0

99 log_must usr_exec $RUNAT $testdir $CP $MYTESTFILE attr.0

zpool_destroy_002_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 117 lines

67 }

68

69 set -A datasets "$TESTPOOL/$TESTFS" "$TESTPOOL/$TESTCTR/$TESTFS1" \

70 "$TESTPOOL/$TESTCTR" "$TESTPOOL/$TESTVOL" \

78 log_must mkdir -p $TESTDIR

79 log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS

80 log_must zfs create $TESTPOOL/$TESTCTR

81 log_must zfs create $TESTPOOL/$TESTCTR/$TESTFS1

82 log_must zfs create -V $VOLSIZE $TESTPOOL/$TESTVOL

92 "while pool is busy."

93

94 for dir in $TESTDIR /$TESTPOOL/$TESTCTR /$TESTPOOL/$TESTCTR/$TESTFS1 ; do

95 log_must cd $dir

96 log_mustnot zpool destroy $TESTPOOL

zpool_add_003_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 97 lines

30 #

31

32 . $STF_SUITE/include/libtest.shlib

33 . $STF_SUITE/tests/functional/cli_root/zpool_add/zpool_add.kshlib

50 function cleanup

51 {

52 destroy_pool $TESTPOOL

53 rm -f $TMPFILE_PREFIX* $VDEV_PREFIX*

54 }

59 log_onexit cleanup

60

61 typeset TMPFILE_PREFIX="$TEST_BASE_DIR/zpool_add_003"

62 typeset STR_DRYRUN="would update '$TESTPOOL' to the following configuration:"

63 typeset VDEV_PREFIX="$TEST_BASE_DIR/filedev"

64 typeset -a VDEV_TYPES=("" "dedup" "special" "log" "cache")

65

zfs_snapshot_001_neg.ksh (https://github.com/adilger/zfs.git) Korn Shell · 117 lines

30 #

31

32 . $STF_SUITE/include/libtest.shlib

33 . $STF_SUITE/tests/functional/cli_root/zfs_snapshot/zfs_snapshot.cfg

58

59 set -A args "" \

60 "$TESTPOOL/$TESTFS@blah*" "$TESTPOOL/$TESTFS@blah?" \

61 "$TESTPOOL/$TESTVOL@blah*" "$TESTPOOL/$TESTVOL@blah?" \

62 "/$TESTPOOL/$TESTFS@$TESTSNAP" "/$TESTPOOL/$TESTVOL@$TESTSNAP" \

63 "@$TESTSNAP" "$TESTPOOL/$TESTFS@" "$TESTPOOL/$TESTVOL@" \

64 "$TESTPOOL//$TESTFS@$TESTSNAP" "$TESTPOOL//$TESTVOL@$TESTSNAP" \

65 "$TESTPOOL/$TESTFS/$TESTSNAP" "$TESTPOOL/$TESTVOL/$TESTSNAP" \

66 "$TESTPOOL/$TESTFS@$TESTSNAP@$TESTSNAP1" \

67 "$TESTPOOL/$TESTVOL@$TESTSNAP@$TESTSNAP1" \

rsend_011_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 120 lines

30 #

31

32 . $STF_SUITE/tests/functional/rsend/rsend.kshlib

33

34 #

49 log_must cleanup_pool $POOL2

50

51 log_must setup_test_model $POOL

52 }

53

history_009_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 114 lines

30 #

31

32 . $STF_SUITE/tests/functional/history/history_common.kshlib

33

34 #

37 #

38 # STRATEGY:

39 # 1. Create test group and user.

40 # 2. Define permission sets and verify the internal history correctly.

41 # 3. Separately verify the internal history above is correct.

53 log_onexit cleanup

54

55 testfs=$TESTPOOL/$TESTFS

56 # Create history test group and user and get user id and group id

108 options=${array[((i + 1))]}

109

110 run_and_verify "zfs $subcmd $options $testfs" "-i"

111 ((i += 2))

112 done

jbiadmin03001.ksh (https://bitbucket.org/ldassonville/openesb-core.git) Korn Shell · 98 lines

30

31 ####

32 #test to verify that event listeners for create registers the ComponentFacadeMBeans

33 #start domain

34 #create an instance before any JBI specific activity is done

39 echo "jbiadmin03001 : Test fix for CR 6532519 - not able to start system components in standalone instance"

40

41 my_test_domain=ESBTest

42 . ./regress_defs.ksh

43 . $AS8BASE/ESBTest_port.sh

69

70 echo Deleting instance esbinst1

71 cmd="asadmin delete-instance --port $ESBTest_admin_port $ASADMIN_PW_OPTS esbinst1"

72 1>&2 eval $cmd

73 status=$?

upgrade_projectquota_001_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 128 lines

50 log_onexit cleanup_upgrade

51

52 log_must zpool create -d -m $TESTDIR $TESTPOOL $TMPDEV

53

54 log_must mkfiles $TESTDIR/tf $((RANDOM % 100 + 1))

76

77 # 'chattr -p' should fail before upgrade

78 log_mustnot chattr -p 100 $TESTDIR/fs3/dir

79

80 # 'chattr +P' should fail before upgrade

85

86 # Double check project quota is disabled

87 zfs projectspace -o used $TESTPOOL | grep -q "USED" &&

88 log_fail "project quota should be disabled after pool upgrade"

89

canmount_001_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 123 lines

48

49 set -A dataset_pos \

50 "$TESTPOOL/$TESTFS" "$TESTPOOL/$TESTCTR" "$TESTPOOL/$TESTCLONE"

51

52 if is_global_zone ; then

53 set -A dataset_neg \

54 "$TESTPOOL/$TESTVOL" "$TESTPOOL/$TESTFS@$TESTSNAP" \

55 "$TESTPOOL/$TESTVOL@$TESTSNAP" "$TESTPOOL/$TESTCLONE1"

56 else

57 set -A dataset_neg \

58 "$TESTPOOL/$TESTFS@$TESTSNAP" "$TESTPOOL/$TESTVOL@$TESTSNAP"

59 fi

60

96 log_must zfs clone $TESTPOOL/$TESTFS@$TESTSNAP $TESTPOOL/$TESTCLONE

97 log_must zfs clone $TESTPOOL/$TESTVOL@$TESTSNAP $TESTPOOL/$TESTCLONE1

98

99 for dataset in "${dataset_pos[@]}" ; do

zpool_get_002_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 108 lines

30 #

31

32 . $STF_SUITE/include/libtest.kshlib

33 . $STF_SUITE/tests/cli_root/zpool_get/zpool_get.cfg

68

69 if ! is_global_zone ; then

70 TESTPOOL=${TESTPOOL%%/*}

71 fi

72

73 log_must $ZPOOL get all $TESTPOOL

74 $ZPOOL get all $TESTPOOL > $TMPDIR/values.${TESTCASE_ID}

75

76 log_note "Checking zpool get all output for a header."

85 do

86 log_note "Checking for ${properties[$i]} property"

87 $GREP "$TESTPOOL *${properties[$i]}" $TMPDIR/values.${TESTCASE_ID} > /dev/null 2>&1

88 if [ $? -ne 0 ]

89 then

zfsd_hotspare_008_neg.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 83 lines

27 # Use is subject to license terms.

28

29 . $STF_SUITE/tests/hotspare/hotspare.kshlib

30

31 verify_runnable "global"

33 function cleanup

34 {

35 $ZPOOL status $TESTPOOL

36 if poolexists $TESTPOOL ; then

37 destroy_pool $TESTPOOL

38 fi

39

43 function verify_assertion # damage_type

44 {

45 typeset mntp=$(get_prop mountpoint $TESTPOOL)

46

47 # Write some data to the pool so the replacing vdev doesn't complete

hotspare_replace_001_neg.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 112 lines

29 # ident "@(#)hotspare_replace_001_neg.ksh 1.4 09/06/22 SMI"

30 #

31 . $STF_SUITE/tests/hotspare/hotspare.kshlib

32

33 ################################################################################

49 # 4. Verify the the replace operation get failed

50 #

51 # TESTABILITY: explicit

52 #

53 # TEST_AUTOMATION_LEVEL: automated

63 function cleanup

64 {

65 poolexists $TESTPOOL && \

66 destroy_pool $TESTPOOL

74

75 for odev in ${pooldevs[@]} ; do

76 log_must $ZPOOL replace $TESTPOOL $odev $dev

77 log_mustnot $ZPOOL replace $TESTPOOL $odev $availdev

tst.noreap.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 128 lines

42 main(int argc, char **argv)

43 {

44 DTRACE_PROBE(test_prov, probe1);

45 }

46 EOF

57 exit 1

58 fi

59 $dtrace -G -s prov.d test.o

60 if [ $? -ne 0 ]; then

61 print -u2 "failed to create DOF"

62 exit 1

63 fi

64 cc -o test test.o prov.o

65 if [ $? -ne 0 ]; then

66 print -u2 "failed to link final executable"

tst.unpriv_funcs.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 79 lines

27

28 #

29 # Affirmative test of less privileged user operation. We do so by running

30 # this test case as root, then as a less privileged user. The output should

zfs_snapshot_007_neg.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 146 lines

59 function cleanup

60 {

61 for fs in $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL $TESTPOOL/$TESTCTR $TESTPOOL ; do

62 typeset fssnap=$fs@snap

63 if datasetexists $fssnap ; then

97

98

99 for fs in $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL $TESTPOOL/$TESTCTR $TESTPOOL ; do

100 typeset fssnap=$fs@snap

101 prop_name=$(valid_user_property 10)

126 log_must eval "$ZFS snapshot -r -o $prop_name='$value' $TESTPOOL@snap"

127 for fs in $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL $TESTPOOL/$TESTCTR $TESTPOOL ; do

128 typeset fssnap=$fs@snap

129 log_must snapexists $fssnap

138 log_must eval "$ZFS snapshot -r -o $prop_name='$value' -o $prop_name2='$value2' $TESTPOOL@snap"

139 for fs in $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL $TESTPOOL/$TESTCTR $TESTPOOL ; do

140 typeset fssnap=$fs@snap

141 log_must snapexists $fssnap

zfsd_replace_003_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 125 lines

33 # $FreeBSD$

34

35 . $STF_SUITE/include/libtest.kshlib

36 . $STF_SUITE/include/libgnop.kshlib

37 . $STF_SUITE/tests/hotspare/hotspare.kshlib

38 . $STF_SUITE/tests/zfsd/zfsd.kshlib

39

40 function cleanup

42 destroy_pool $TESTPOOL

43 [[ -e $TESTDIR ]] && log_must $RM -rf $TESTDIR/*

44 for md in $MD0 $MD1 $MD2 $MD3; do

45 gnop destroy -f $md

87 for type in "raidz2" "mirror"; do

88 # Create a pool on the supplied disks

89 create_pool $TESTPOOL $type ${MD0}.nop ${MD1}.nop ${MD2}.nop ${MD3}.nop

90

91 log_must destroy_gnop $MD0

reservation_003_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 137 lines

89 # of the volume itself.

90 #

91 [[ $obj == $TESTPOOL/$TESTVOL ]] && \

92 (( resv_size = ( vol_set_size - RESV_DELTA ) / RESV_ITER ))

93

117 OBJ_LIST=""

118 else

119 OBJ_LIST="$TESTPOOL/$TESTVOL $TESTPOOL/$TESTVOL2"

120

121 (( vol_set_size = space_avail / 4 ))

125

126

127 log_must $ZFS create -V $vol_set_size $TESTPOOL/$TESTVOL

128 log_must $ZFS set reservation=none $TESTPOOL/$TESTVOL

129 log_must $ZFS create -s -V $sparse_vol_set_size $TESTPOOL/$TESTVOL2

130 fi

131

framework00005.ksh (https://bitbucket.org/ldassonville/openesb-core.git) Korn Shell · 53 lines

32 . ./regress_defs.ksh

33

34 echo testing self first class loading for engines

35

36 # package components

38

39 # install engine

40 $JBI_ANT -Djbi.install.file=$JV_FRAMEWORK_BLD_DIR/dist/SelfFirstTestEngine.jar install-component

41

42 # start engine (this invokes the private lib API)

43 $JBI_ANT -Djbi.component.name="SelfFirstTestEngine" start-component

44

45 # shutdown engine

regress_defs.ksh (https://bitbucket.org/ldassonville/openesb-core.git) Korn Shell · 56 lines

29 #common definitions for regression tests.

30

31 #set this prop to the test domain. default is JBITest

32 #my_test_domain=domain1

37 export UI_REGRESS_DIST_DIR

38 if [ $OPENESB_BUILD -eq 1 ]; then

39 UI_REGRESS_DIST_DIR=$JV_SVC_TEST_CLASSES/testdata

40 else

41 UI_REGRESS_DIST_DIR=$JV_SVC_TEST_CLASSES/dist

46

47 #

48 # test cases

49 #

50

51 build_test_artifacts()

52 {

53 # package components

zfs_acl_chmod_rwacl_001_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 262 lines

30 #

31

32 . $STF_SUITE/tests/acl/acl_common.kshlib

33

34 #################################################################################

252 typeset func node

253 for func in ${func_name[@]}; do

254 for node in $testfile $testdir; do

255 eval $func \$node

256 done

257 done

258

259 log_must usr_exec $RM -rf $testfile $testdir

260 done

261

clone_001_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 143 lines

68 # i+3: mountpoint of the clone

69

70 set -A args "$SNAPFS" "$SNAPDIR" "$TESTPOOL/$TESTCLONE" "$TESTDIR.0" \

71 "$SNAPFS1" "$SNAPDIR3" "$TESTPOOL/$TESTCLONE1" "" \

72 "$SNAPFS2" "$SNAPDIR2" "$TESTPOOL1/$TESTCLONE2" "$TESTDIR.2"

73

74 function setup_all

75 {

76 create_pool $TESTPOOL1 /dev/zvol/$TESTPOOL/$TESTVOL

77 log_must $ZFS create $TESTPOOL1/$TESTFS

78 log_must $ZFS set mountpoint=$TESTDIR2 $TESTPOOL1/$TESTFS

79

80 return 0

tst.ipv4localsctp.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 153 lines

26

27 #

28 # Test {ip,sctp}:::{send,receive} of IPv4 SCTP to local host.

29 #

30 # This may fail due to:

31 #

32 # 1. A change to the ip stack breaking expected probe behavior,

33 # which is the reason we are testing.

34 # 2. The lo0 interface missing or not up.

35 # 3. An unlikely race causes the unlocked global send/receive

36 # variables to be corrupted.

37 #

38 # This test performs a SCTP association and checks that at least the

39 # following packet counts were traced:

40 #

zfs_mount_007_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 163 lines

30 #

31

32 . $STF_SUITE/tests/functional/cli_root/zfs_mount/zfs_mount.kshlib

33

34 #

54 function cleanup

55 {

56 if ! ismounted $TESTPOOL/$TESTFS; then

57 log_must zfs mount $TESTPOOL/$TESTFS

123 }

124

125 fs=$TESTPOOL/$TESTFS

126 cleanup

127

zfs_promote_004_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 140 lines

65 log_onexit cleanup

66

67 fs=$TESTPOOL/$TESTFS

68 clone=$TESTPOOL/$TESTCLONE

69 clone1=$TESTPOOL/$TESTCLONE1

70

71 # Define some arrays here to use loop to reduce code amount

72

73 # Array which stores the origin snapshots created in the origin filesystem

74 set -A snap "${fs}@$TESTSNAP" "${fs}@$TESTSNAP1" "${fs}@$TESTSNAP2" "${fs}@$TESTSNAP3"

75 # Array which stores the snapshots existing in the first clone

76 set -A csnap "${clone}@$TESTSNAP3" "${clone}@$TESTSNAP4" "${clone}@$TESTSNAP5"

78 set -A c1snap "${clone1}@$TESTSNAP3" "${clone1}@$TESTSNAP4" "${clone1}@$TESTSNAP5"

79 # The data will inject into the origin filesystem

80 set -A file "$TESTDIR/$TESTFILE0" "$TESTDIR/$TESTFILE1" "$TESTDIR/$TESTFILE2" \

81 "$TESTDIR/$TESTFILE3"

zpool_import_008_pos.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 112 lines

50 # TESTABILITY: explicit

51 #

52 # TEST_AUTOMATION_LEVEL: automated

53 #

54 # CODING_STATUS: COMPLETED (2006-06-12)

62 function cleanup

63 {

64 destroy_pool $TESTPOOL2

65 destroy_pool $TESTPOOL1

84 log_must $ZPOOL destroy $TESTPOOL1

85

86 log_must $ZPOOL destroy $TESTPOOL2

87 log_must $RM -rf $VDEV0 $VDEV1

88 log_must $ZPOOL import -d $DEVICE_DIR -D -f $target

104 log_must $ZPOOL create $TESTPOOL1 raidz2 $VDEV0 $VDEV1 $VDEV2 $VDEV3

105 perform_test $TESTPOOL1

106

107 log_note "Testing import by GUID."

zfs_receive_003_pos.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 107 lines

30 #

31

32 . $STF_SUITE/include/libtest.kshlib

33

34 #################################################################################

49 # 6. Verify 'zfs recv -F' can force rollback.

50 #

51 # TESTABILITY: explicit

52 #

53 # TEST_AUTOMATION_LEVEL: automated

76 ibackup=$TMPDIR/ibackup.${TESTCASE_ID}

77 fs=$TESTPOOL/$TESTFS; snap1=$fs@snap1; snap2=$fs@snap2

78

79 mntpnt=$(get_prop mountpoint $fs) || log_fail "get_prop mountpoint $fs"

mountpoint_002_pos.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 110 lines

61 verify_runnable "both"

62

63 set -A dataset "$TESTPOOL/$TESTFS" "$TESTPOOL/$TESTCTR"

64

65 set -A values "$TESTDIR2" "$TESTDIR_NOTEXISTING"

70 log_must $ZFS set mountpoint=$old_fs_mpt $TESTPOOL/$TESTFS

71 log_must $ZFS mount -a

72 [[ -d $TESTDIR2 ]] && log_must $RM -r $TESTDIR2

73 [[ -d $TESTDIR_NOTEXISTING ]] && log_must $RM -r $TESTDIR_NOTEXISTING

80 old_fs_mpt=$(get_prop mountpoint $TESTPOOL/$TESTFS)

81 [[ $? != 0 ]] && \

82 log_fail "Unable to get the mountpoint property for $TESTPOOL/$TESTFS"

83 old_ctr_mpt=$(get_prop mountpoint $TESTPOOL/$TESTCTR)

84 [[ $? != 0 ]] && \

85 log_fail "Unable to get the mountpoint property for $TESTPOOL/$TESTCTR"

86

87 if [[ ! -d $TESTDIR2 ]]; then

zfs_get_009_pos.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 105 lines

30 #

31

32 . $STF_SUITE/tests/cli_root/zfs_get/zfs_get_common.kshlib

33 . $STF_SUITE/tests/cli_root/zfs_get/zfs_get_list_d.kshlib

48 # 4. Compare the two outputs, they shoud be same.

49 #

50 # TESTABILITY: explicit

51 #

52 # TEST_AUTOMATION_LEVEL: automated

zfs_list_002_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 176 lines

102 if is_global_zone ; then

103 verify_sort \

104 "zfs list -H -r -o name -s creation -t volume $TESTPOOL/$TESTFS" \

105 "$vol_creation" "creation date"

106 fi

127 # sort by name

128 verify_sort \

129 "zfs list -H -r -o name -s name -t filesystem $TESTPOOL/$TESTFS" \

130 "$fs_name" "name"

131 if is_global_zone ; then

135 fi

136 verify_sort \

137 "zfs list -H -r -o name -s name -t snapshot $TESTPOOL/$TESTFS" \

138 "$snap_name" "name"

139

zfs_unmount_all_001_pos.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 209 lines

64 set -A fs "$TESTFS" "$TESTFS1"

65 set -A ctr "" "$TESTCTR" "$TESTCTR1" "$TESTCTR/$TESTCTR1"

66 set -A vol "$TESTVOL" "$TESTVOL1"

74 while (( i < ${#ctr[*]} )); do

75

76 path=${TEST_BASE_DIR%%/}/testroot${TESTCASE_ID}/$TESTPOOL

77 if [[ -n ${ctr[i]} ]]; then

78 path=$path/${ctr[i]}

139 [[ -d ${TEST_BASE_DIR%%/}/testroot${TESTCASE_ID} ]] && \

140 $RM -rf ${TEST_BASE_DIR%%/}/testroot${TESTCASE_ID}

141 }

142

188

189 if [[ $opt == "-fa" ]]; then

190 mntpnt=$(get_prop mountpoint ${TESTPOOL}/${TESTCTR}/${TESTFS})

191 cd $mntpnt

192 log_mustnot $ZFS unmount -a

rollback_003_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 111 lines

64 done

65

66 for fs in "$TESTPOOL/$TESTFILE/$TESTFILE.1" "$TESTPOOL/$TESTFILE"; do

67 if datasetexists $fs; then

68 destroy_dataset $fs -r

90

91 log_note "Verify rollback of multiple nested file systems succeeds."

92 log_must zfs snapshot $TESTPOOL/$TESTFILE@$TESTSNAP

93 log_must zfs snapshot $SNAPPOOL.1

94

98 unset __ZFS_POOL_RESTRICT

99

100 log_must touch /$TESTPOOL/$TESTFILE/$TESTFILE.1

101

102 log_must zfs rollback $SNAPPOOL.1

zpool_create_007_neg.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 97 lines

66 "-m" "-R" "-m -R" "-Rm" "-mR" "-m $TESTDIR $TESTPOOL" \

67 "-R $TESTDIR $TESTPOOL" "-m nodir $TESTPOOL $disk" \

68 "-R nodir $TESTPOOL $disk" "-m nodir -R nodir $TESTPOOL $disk" \

69 "-R nodir -m nodir $TESTPOOL $disk" "-R $TESTDIR -m nodir $TESTPOOL $disk" \

70 "-R nodir -m $TESTDIR $TESTPOOL $disk" \

71 "-blah" "$TESTPOOL" "$TESTPOOL blah" "$TESTPOOL c?t0d0" \

72 "$TESTPOOL c0txd0" "$TESTPOOL c0t0dx" "$TESTPOOL cxtxdx" \

73 "$TESTPOOL mirror" "$TESTPOOL raidz" "$TESTPOOL mirror raidz" \

74 "$TESTPOOL raidz1" "$TESTPOOL mirror raidz1" \

81 "$TESTPOOL RAIDZ1 ${disk}p1 ${disk}p2" \

82 "$TESTPOOL MIRROR $disk" "$TESTPOOL raidz $disk" \

83 "$TESTPOOL raidz1 $disk" \

zfs_copies_001_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 126 lines

30 #

31

32 . $STF_SUITE/include/libtest.kshlib

33 . $STF_SUITE/tests/cli_root/zfs_copies/zfs_copies.kshlib

47 # 2. Verify that the "copies" property has been set correctly

48 #

49 # TESTABILITY: explicit

50 #

51 # TEST_AUTOMATION_LEVEL: automated

73 log_onexit cleanup

74

75 fs=$TESTPOOL/$TESTFS

76 fs1=$TESTPOOL/$TESTFS1

77 fs2=$TESTPOOL/$TESTFS2

78 vol=$TESTPOOL/$TESTVOL

79 vol1=$TESTPOOL/$TESTVOL1

80 vol2=$TESTPOOL/$TESTVOL2

userquota_005_neg.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 108 lines

44 # 1. check the valid zfs set user|group quota to snapshots

45 #

46 # TESTABILITY: explicit

47 #

48 # TEST_AUTOMATION_LEVEL: automated

54 ###############################################################################

55

56 . $STF_SUITE/include/libtest.kshlib

57 . $STF_SUITE/tests/userquota/userquota_common.kshlib

zvol_misc_002_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 89 lines

60 function cleanup

61 {

62 snapexists $TESTPOOL/$TESTVOL@snap && \

63 $ZFS destroy $TESTPOOL/$TESTVOL@snap

65 ismounted $TESTDIR ufs && log_must $UMOUNT $TESTDIR

66 [[ -e $TESTDIR ]] && $RM -rf $TESTDIR

67 }

68

72 $NEWFS /dev/zvol/$TESTPOOL/$TESTVOL >/dev/null 2>&1

73 (( $? != 0 )) && log_fail "Unable to newfs(1M) $TESTPOOL/$TESTVOL"

74

75 log_must $MKDIR $TESTDIR

76 log_must $MOUNT /dev/zvol/$TESTPOOL/$TESTVOL $TESTDIR

77

78 typeset -i fn=0

devices_002_neg.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 79 lines

30 #

31

32 . $STF_SUITE/include/libtest.kshlib

33 . $STF_SUITE/tests/devices/devices_common.kshlib

66 log_onexit cleanup

67

68 log_must $ZFS set devices=off $TESTPOOL/$TESTFS

69

70 #

74 create_dev_file b $TESTDIR/$TESTFILE1

75 log_mustnot $DD if=$TESTDIR/$TESTFILE1 of=$TESTDIR/$TESTFILE1.out count=1

76 create_dev_file c $TESTDIR/$TESTFILE2

77 log_mustnot $DD if=$TESTDIR/$TESTFILE2 of=$TESTDIR/$TESTFILE2.out count=1

78

79 log_pass "Setting devices=off on file system and testing it pass."

zpool_export_002_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 94 lines

63 log_fail "Couldn't cd back to $olddir"

64

65 datasetexists "$TESTPOOL/$TESTFS" || \

66 log_must $ZPOOL import -d $dir $TESTPOOL

68 ismounted "$TESTPOOL/$TESTFS"

69 (( $? != 0 )) && \

70 log_must $ZFS mount $TESTPOOL/$TESTFS

71

72 [[ -e $TESTDIR/$TESTFILE0 ]] && \

73 log_must $RM -rf $TESTDIR/$TESTFILE0

74 }

75

80 log_assert "Verify a busy ZPOOL cannot be exported."

81

82 ismounted "$TESTPOOL/$TESTFS"

83 (( $? != 0 )) && \

84 log_fail "$TESTDIR not mounted. Unable to continue."

slog_010_neg.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 78 lines

30 #

31

32 . $STF_SUITE/tests/slog/slog.kshlib

33

34 #################################################################################

47 # 4. Verify slog device can not be replaced with hotspare device in pool2.

48 #

49 # TESTABILITY: explicit

50 #

51 # TEST_AUTOMATION_LEVEL: automated

62 log_onexit cleanup

63

64 log_must $ZPOOL create $TESTPOOL $VDEV spare $SDEV log $LDEV

65 sdev=$(random_get $SDEV)

66 ldev=$(random_get $LDEV)

enospc_001_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 81 lines

29 # ident "@(#)enospc_001_pos.ksh 1.2 07/01/09 SMI"

30 #

31 . $STF_SUITE/include/libtest.kshlib

32

33 ################################################################################

61

62 log_assert "ENOSPC is returned when file system is full."

63 log_must $ZFS set compression=off $TESTPOOL/$TESTFS

64

65 log_note "Writing file: $TESTFILE0 until ENOSPC."

66 $FILE_WRITE -o create -f $TESTDIR/$TESTFILE0 -b $BLOCKSZ \

67 -c $NUM_WRITES -d $DATA

68 ret=$?

73 log_note "Write another file: $TESTFILE1 but expect ENOSPC."

74 $FILE_WRITE -o create -f $TESTDIR/$TESTFILE1 -b $BLOCKSZ \

75 -c $NUM_WRITES -d $DATA

76 ret=$?

zpool_status_001_neg.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 79 lines

30 #

31

32 . $STF_SUITE/include/libtest.kshlib

33 . $STF_SUITE/tests/cli_user/cli_user.kshlib

48 # 2. Verify we get output

49 #

50 # TESTABILITY: explicit

51 #

52 # TEST_AUTOMATION_LEVEL: automated

66 log_must run_unprivileged "$ZPOOL status -v" | $GREP -q "pool:" || \

67 log_fail "No Pool: string found in zpool status output"

68 log_must run_unprivileged "$ZPOOL status $TESTPOOL" | $GREP -q "pool:" || \

69 log_fail "No Pool: string found in zpool status output"

70 log_must run_unprivileged "$ZPOOL status -v $TESTPOOL" | $GREP -q "pool:" || \

71 log_fail "No Pool: string found in zpool status output"

72

73 # $TESTPOOL.virt has an offline device, so -x will show it

74 log_must run_unprivileged "$ZPOOL status -x $TESTPOOL.virt" | \

reservation_005_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 118 lines

71 OBJ_LIST=""

72 else

73 OBJ_LIST="$TESTPOOL/$TESTVOL $TESTPOOL/$TESTVOL2"

74 ((vol_set_size = space_avail / 4))

75 vol_set_size=$(floor_volsize $vol_set_size)

78

79

80 log_must zfs create -V $vol_set_size $TESTPOOL/$TESTVOL

81 log_must zfs set reservation=none $TESTPOOL/$TESTVOL

82 log_must zfs create -s -V $sparse_vol_set_size $TESTPOOL/$TESTVOL2

83 fi

84

89 resv_size_set=`expr $space_avail - $RESV_DELTA`

90

91 for obj in $TESTPOOL/$TESTFS $OBJ_LIST ; do

92

93 #

zfs_destroy_001_pos.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 215 lines

44 #

45 # STRATEGY:

46 # 1. Create test environment according to options. There are three test

47 # models can be created. Only ctr, fs & vol; with snap; with clone.

48 # 2. According to option, make the dataset busy or not.

50 # 4. According to dataset and option, check if get the expected results.

51 #

52 # TESTABILITY: explicit

53 #

54 # TEST_AUTOMATION_LEVEL: automated

94 fi

95

96 # According to option create test compatible environment.

97 case $opt in

98 -r|-rf) setup_testenv snap ;;

99 -R|-Rf) setup_testenv clone ;;

100 -f) setup_testenv ;;

101 *) log_fail "Incorrect option: '$opt'." ;;

102 esac

l2arc_encrypted.ksh (https://github.com/adilger/zfs.git) Korn Shell · 103 lines

21 # under sponsorship from the FreeBSD Foundation.

22

23 . $STF_SUITE/include/libtest.shlib

24

25 export SIZE=1G

26 export VDIR=$TESTDIR/disk.persist_l2arc

27 export VDEV="$VDIR/a"

28 export VDEV_CACHE="$VDIR/b"

30

31 # fio options

32 export DIRECTORY=/$TESTPOOL-l2arc/encrypted

33 export NUMJOBS=4

34 export RUNTIME=30

zpool_create_018_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 98 lines

47 function cleanup

48 {

49 poolexists $TESTPOOL && destroy_pool $TESTPOOL

50 rm -f $CPATH

51 }

69 if [[ $RESULT != ${vals[$i]} ]]

70 then

71 zpool get all $TESTPOOL

72 log_fail "Pool was created without setting the ${props[$i]} " \

73 "property"

78

79 # Destroy our pool

80 poolexists $TESTPOOL && destroy_pool $TESTPOOL

81

82 # pick two properties, and verify we can create with those as well

zfs_share_006_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 105 lines

48 function cleanup

49 {

50 log_must zfs set sharenfs=off $TESTPOOL/$TESTCTR

51 if mounted $TESTDIR2; then

53 fi

54

55 datasetexists $TESTPOOL/$TESTCTR/$TESTFS2 && \

56 log_must zfs destroy $TESTPOOL/$TESTCTR/$TESTFS2

57

58 typeset fs=""

59 for fs in $mntp $TESTDIR1 $TESTDIR2

60 do

61 log_must unshare_fs $fs

101 typeset mntp=$(get_prop mountpoint $TESTPOOL/$TESTCTR)

102 test_ctr_share $mntp $TESTPOOL/$TESTCTR

103

104 log_pass "A dataset could not be shared, " \

zfs_multi_mount.ksh (https://github.com/adilger/zfs.git) Korn Shell · 109 lines

19 #

20

21 . $STF_SUITE/include/libtest.shlib

22

23 #

43 ismounted $MNTPFS4 && log_must umount $MNTPFS4

44 ismounted $RENAMEMNT && log_must umount $RENAMEMNT

45 datasetexists $TESTDS && log_must destroy_dataset "$TESTDS" "-f"

46 }

47 log_onexit cleanup

50

51 # 1. Create fs

52 TESTDS="$TESTPOOL/multi-mount-test"

53 log_must zfs create $TESTDS

54

55 # 2. Create and hold open file in filesystem

56 MNTPFS="$(get_prop mountpoint $TESTDS)"

57 FILENAME="$MNTPFS/file"

58 log_must mkfile 128k $FILENAME

persist_l2arc_006_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 98 lines

19 #

20

21 . $STF_SUITE/include/libtest.shlib

22 . $STF_SUITE/tests/functional/persist_l2arc/persist_l2arc.cfg

45 function cleanup

46 {

47 if poolexists $TESTPOOL ; then

48 destroy_pool $TESTPOOL

67 log_must truncate -s ${cache_sz}M $VDEV_CACHE

68

69 log_must zpool create -f $TESTPOOL $VDEV cache $VDEV_CACHE

70

71 log_must fio $FIO_SCRIPTS/mkfiles.fio

72 log_must fio $FIO_SCRIPTS/random_reads.fio

73

74 log_must zpool offline $TESTPOOL $VDEV_CACHE

75 log_must zpool export $TESTPOOL

ui00011.ksh (https://bitbucket.org/rsaqc/openesb-core.git) Korn Shell · 111 lines

33

34 #

35 # test runtime and components

36 #

37

38 test_configuration_tasks()

39 {

40

80 }

81

82 run_test()

83 {

84 build_test_artifacts

tst.ipv4remotetcp.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 131 lines

26

27 #

28 # Test {tcp,ip}:::{send,receive} of IPv4 TCP to a remote host.

29 #

30 # This may fail due to:

31 #

32 # 1. A change to the ip stack breaking expected probe behavior,

33 # which is the reason we are testing.

34 # 2. No physical network interface is plumbed and up.

35 # 3. No other hosts on this subnet are reachable and listening on ssh.

37 # variables to be corrupted.

38 #

39 # This test performs a TCP connection and checks that at least the

40 # following packet counts were traced:

41 #

zfs_inherit_002_neg.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 114 lines

30 #

31

32 . $STF_SUITE/include/libtest.kshlib

33

34 ################################################################################

60 function cleanup

61 {

62 if snapexists $TESTPOOL/$TESTFS@$TESTSNAP; then

63 log_must $ZFS destroy $TESTPOOL/$TESTFS@$TESTSNAP

74 set -A illprops "recordsiz" "mountpont" "sharen" "compres" "atme" "???" "***" "blah"

75

76 log_must $ZFS snapshot $TESTPOOL/$TESTFS@$TESTSNAP

77

78 typeset -i i=0

79 for ds in $TESTPOOL $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL \

80 $TESTPOOL/$TESTFS@$TESTSNAP; do

zfs_acl_cp_003_neg.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 138 lines

30 #

31

32 . $STF_SUITE/tests/acl/acl_common.kshlib

33

34 #################################################################################

48 # 4. Verify attribute files are not existing for non-root user.

49 #

50 # TESTABILITY: explicit

51 #

52 # TEST_AUTOMATION_LEVEL: automated

64 log_onexit cleanup

65

66 test_requires RUNAT ZFS_ACL ZFS_XATTR

67

68 function test_unreadable_attr

tst.func.ksh (https://github.com/okuoku/freebsd-head.git) Korn Shell · 74 lines

64 # output. This is most likely _not_ to show up in the output if the

65 # platform does not support arbitrary resolution interval timers -- but

66 # the above script was stress-tested down to 100 hertz and still ran

67 # successfully on all platforms, so one is hopeful that this test will pass

zfs_unmount_007_neg.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 124 lines

69 done

70

71 set -A args "$unmountall $TESTPOOL/$TESTFS" \

72 "$unmountcmd $datasets"

73

79 setup_filesystem "$DISKS" "$TESTPOOL" \

80 "$fs" \

81 "${TEST_BASE_DIR%%/}/testroot${TESTCASE_ID}/$TESTPOOL/$fs"

82 done

83 return 0

90 cleanup_filesystem "$TESTPOOL" "$TESTFS1"

91 log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS

92

93 [[ -d ${TEST_BASE_DIR%%/}/testroot${TESTCASE_ID} ]] && \

94 $RM -rf ${TEST_BASE_DIR%%/}/testroot${TESTCASE_ID}

95

96 return 0

xattr_008_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 112 lines

60 for file in $TMPDIR/output.${TESTCASE_ID} $TMPDIR/expected-output.${TESTCASE_ID} \

61 $TESTDIR/myfile.${TESTCASE_ID} ; do

62 log_must $RM -f $file

63 done

82 fi

83 # list the directory . long form

84 log_must eval "$RUNAT $TESTDIR/myfile.${TESTCASE_ID} $LS -a . > $TMPDIR/output.${TESTCASE_ID}"

85 # create a file that should be the same as the command above

86 create_expected_output $TMPDIR/expected-output.${TESTCASE_ID} . .. passwd

89 else

90 # listing the directory .

91 log_must eval "$RUNAT $TESTDIR/myfile.${TESTCASE_ID} $LS . > $TMPDIR/output.${TESTCASE_ID}"

92 create_expected_output $TMPDIR/expected-output.${TESTCASE_ID} \

94 log_must $DIFF $TMPDIR/output.${TESTCASE_ID} $TMPDIR/expected-output.${TESTCASE_ID}

95 # list the directory . long form

96 log_must eval "$RUNAT $TESTDIR/myfile.${TESTCASE_ID} $LS -a . > $TMPDIR/output.${TESTCASE_ID}"

97 create_expected_output $TMPDIR/expected-output.${TESTCASE_ID} . .. \

history_004_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 114 lines

42 #

43 # STRATEGY:

44 # 1. Create test pool and test fs.

45 # 2. Loop 100 times, set properties to test fs simultaneously.

75 $ZFS snapshot $TESTPOOL/$TESTFS1@snap &

76 $ZFS snapshot $TESTPOOL/$TESTFS2@snap &

77 $ZFS snapshot $TESTPOOL/$TESTFS3@snap &

79 wait

80

81 $ZFS clone $TESTPOOL/$TESTFS1@snap $TESTPOOL/clone1 &

82 $ZFS clone $TESTPOOL/$TESTFS2@snap $TESTPOOL/clone2 &

83 $ZFS clone $TESTPOOL/$TESTFS3@snap $TESTPOOL/clone3 &

84

85 wait

zfs_clone_004_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 107 lines

30 #

31

32 . $STF_SUITE/include/libtest.kshlib

33 . $STF_SUITE/tests/cli_root/zfs_create/zfs_create_common.kshlib

90 done

91

92 log_must $ZFS clone $opts $SNAPFS $TESTPOOL/$TESTCLONE

93 datasetexists $TESTPOOL/$TESTCLONE || \

94 log_fail "zfs create $TESTPOOL/$TESTCLONE fail."

95

96 i=0

98 if [[ $WRAPPER != *"crypto"* ]] || \

99 [[ ${RW_FS_PROP[$i]} != *"checksum"* ]]; then

100 propertycheck $TESTPOOL/$TESTCLONE ${RW_FS_PROP[i]} || \

101 log_fail "${RW_FS_PROP[i]} is failed to set."

102 fi

spell.ksh (https://github.com/avsm/src.git) Korn Shell · 120 lines

91 shift $(( $OPTIND - 1 ))

92

93 while test $# -ne 0; do

94 case "$1" in

95 +*) EXTRA="$EXTRA ${1#+}"

threadsappend_001_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 80 lines

54 #

55 typeset -i FILE_SIZE=1310720

56 TESTFILE='testfile-threadsappend'

57

58 #

68 # so that the resulting file is $FILE_SIZE bytes in size

69 #

70 log_must threadsappend ${TESTDIR}/${TESTFILE}

71

72 #

73 # Check the size of the resulting file

74 #

75 SIZE=`ls -l ${TESTDIR}/${TESTFILE} | awk '{print $5}'`

76 if [[ $SIZE -ne $FILE_SIZE ]]; then

77 log_fail "'The length of ${TESTDIR}/${TESTFILE}' doesn't equal 1310720."

removal_resume_export.ksh (https://github.com/adilger/zfs.git) Korn Shell · 100 lines

19 #

20

21 . $STF_SUITE/include/libtest.shlib

22 . $STF_SUITE/tests/functional/removal/removal.kshlib

26 #

27 # When a pool has an ongoing removal and it is exported ZFS

28 # suspends the removal thread beforehand. This test ensures

29 # that ZFS restarts the removal thread if the export fails

30 # for some reason.

80 # for the little time that this test runs.

81 #

82 log_must zfs set compression=off $TESTPOOL/$TESTFS

83

84 #

86 # we start the removal.

87 #

88 log_must dd if=/dev/urandom of=$TESTDIR/$TESTFILE0 bs=64M count=32

89

90 #

devices_002_neg.ksh (https://github.com/adilger/zfs.git) Korn Shell · 70 lines

53 log_onexit cleanup

54

55 log_must zfs set devices=off $TESTPOOL/$TESTFS

56

57 #

59 # Verify it cannot be opened, written, and read.

60 #

61 create_dev_file b $TESTDIR/$TESTFILE1 $ZVOL_DEVDIR/$TESTPOOL/$TESTVOL

62 log_mustnot dd if=/dev/urandom of=$TESTDIR/$TESTFILE1 count=1 bs=128k

63 log_mustnot dd if=$TESTDIR/$TESTFILE1 of=/dev/null count=1 bs=128k

64

65 # Create character device file backed by /dev/null

66 # Verify it cannot be opened and written.

67 create_dev_file c $TESTDIR/$TESTFILE2

68 log_mustnot dd if=/dev/urandom of=$TESTDIR/$TESTFILE2 count=1 bs=128k

zpool_initialize_split.ksh (https://github.com/adilger/zfs.git) Korn Shell · 64 lines

40 DISK1="$(echo $DISKS | cut -d' ' -f1)"

41 DISK2="$(echo $DISKS | cut -d' ' -f2)"

42 POOL2="${TESTPOOL}_split"

43

44 log_must zpool create -f $TESTPOOL mirror $DISK1 $DISK2

45

46 log_must zpool initialize $TESTPOOL $DISK1 $DISK2

47 orig_prog1="$(initialize_progress $TESTPOOL $DISK1)"

48 orig_prog2="$(initialize_progress $TESTPOOL $DISK2)"

49 [[ -z "$orig_prog1" ]] && log_fail "Initializing did not start"

50

51 log_must zpool split $TESTPOOL $TESTPOOL1 $DISK2

52

53 # Ensure initializing continued as expected on the original pool.

root_relatime_on.ksh (https://github.com/adilger/zfs.git) Korn Shell · 76 lines

30 #

31

32 . $STF_SUITE/tests/functional/atime/atime_common.kshlib

33

34 #

59 reset_atime

60

61 for dst in $TESTPOOL/$TESTFS $TESTPOOL/$TESTCLONE $TESTPOOL/$TESTFS@$TESTSNAP

62 do

63 typeset mtpt=$(get_prop mountpoint $dst)

64

65 if [[ $dst == $TESTPOOL/$TESTFS@$TESTSNAP ]]; then

66 mtpt=$(snapshot_mountpoint $dst)

67 log_mustnot check_atime_updated $mtpt/$TESTFILE

auto_spare_002_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 96 lines

25 #

26 # DESCRIPTION:

27 # Testing Fault Management Agent ZED Logic - Automated Auto-Spare Test when

28 # drive is faulted due to CHECKSUM ERRORS.

29 #

47 }

48

49 log_assert "Testing automated auto-spare FMA test"

50

51 log_onexit cleanup

57 fi

58

59 TESTFILE="/$TESTPOOL/$TESTFS/testfile"

60

61 for type in "mirror" "raidz" "raidz2"; do

67 log_must zfs create -o primarycache=none $TESTPOOL/$TESTFS

68 log_must zfs set recordsize=16k $TESTPOOL/$TESTFS

69

70 # 3. Write a file to the pool to be read back

zfs_allow_004_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 96 lines

30 #

31

32 . $STF_SUITE/tests/functional/delegate/delegate_common.kshlib

33

34 #

38 #

39 # STRATEGY:

40 # 1. Create descendent datasets of $ROOT_TESTFS

41 # 2. Select user, group and everyone and set descendent permission

42 # separately.

43 # 3. Set descendent permissions to $ROOT_TESTFS or $ROOT_TESTVOL.

44 # 4. Verify those permissions are allowed to $ROOT_TESTFS's

45 # descendent dataset.

46 # 5. Verify the permissions are not allowed to $ROOT_TESTFS or

47 # $ROOT_TESTVOL.

rsend_008_pos.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 142 lines

30 #

31

32 . $STF_SUITE/tests/rsend/rsend.kshlib

33

34 #################################################################################

46 # 3. Verify all the datesets and property be properly received.

47 #

48 # TESTABILITY: explicit

49 #

50 # TEST_AUTOMATION_LEVEL: automated

rsend_019_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 54 lines

16 #

17

18 . $STF_SUITE/include/libtest.shlib

19 . $STF_SUITE/tests/functional/rsend/rsend.kshlib

45

46 for sendfs in $POOL2/sendfs $POOL3; do

47 test_fs_setup $sendfs $recvfs $streamfs

48 resume_test "zfs send -v $sendfs@a" $streamfs $recvfs

49 resume_test "zfs send -v -i @a $sendfs@b" $streamfs $recvfs

50 file_check $sendfs $recvfs

51 done

nopwrite_volume.ksh (https://github.com/adilger/zfs.git) Korn Shell · 59 lines

16 #

17

18 . $STF_SUITE/include/libtest.shlib

19 . $STF_SUITE/tests/functional/nopwrite/nopwrite.shlib

30

31 verify_runnable "global"

32 origin="$TESTPOOL/$TESTVOL"

33 clone="$TESTPOOL/clone"

39 {

40 datasetexists $origin && log_must zfs destroy -R $origin

41 # No need to recreate the volume as no other tests expect it.

42 }

43

decompress_fault.ksh (https://github.com/adilger/zfs.git) Korn Shell · 58 lines

16 #

17

18 . $STF_SUITE/include/libtest.shlib

19 . $STF_SUITE/tests/functional/fault/fault.cfg

21 #

22 # DESCRIPTION:

23 # Test that injected decompression errors are handled correctly.

24 #

25 # STRATEGY:

26 # 1. Create an compressed dataset with a test file

27 # 2. Inject decompression errors on the file 20% of the time

28 # 3. Read the file to confirm that errors are handled correctly

30 #

31

32 log_assert "Testing that injected decompression errors are handled correctly"

33

34 function cleanup

zpool_get_001_neg.ksh (https://github.com/adilger/zfs.git) Korn Shell · 67 lines

30 #

31

32 . $STF_SUITE/include/libtest.shlib

33 . $STF_SUITE/tests/functional/cli_user/misc/misc.cfg

55 PROP=${props[$i]}

56 EXPECTED=${prop_vals[$i]}

57 ACTUAL=$( zpool get $PROP $TESTPOOL | grep $PROP | awk '{print $1}' )

58 if [ "$ACTUAL" != "$EXPECTED" ]

59 then

63 done

64

65 log_must zpool get all $TESTPOOL

66

67 log_pass "zpool get works when run as a user"

zpool_split_encryption.ksh (https://github.com/adilger/zfs.git) Korn Shell · 59 lines

15 #

16

17 . $STF_SUITE/include/libtest.shlib

18 . $STF_SUITE/tests/functional/cli_root/zpool_split/zpool_split.cfg

31 function cleanup

32 {

33 destroy_pool $TESTPOOL

34 destroy_pool $TESTPOOL2

52 # 2. Split and re-import the pool, verify altroot is mounted.

53 log_must eval "echo "$passphrase" | zpool split -l -R $altroot " \

54 "$TESTPOOL $TESTPOOL2"

55 log_must test "$(get_prop 'encryption' $TESTPOOL2)" == "aes-256-ccm"

56 log_must test "$(get_pool_prop 'altroot' $TESTPOOL2)" == "$altroot"

57 log_must mounted $altroot/$TESTPOOL2

insensitive_none_delete.ksh (https://github.com/adilger/zfs.git) Korn Shell · 71 lines

16 #

17

18 . $STF_SUITE/tests/functional/casenorm/casenorm.kshlib

19

20 # DESCRIPTION:

33 function cleanup

34 {

35 destroy_testfs

36 }

37

39 log_assert "CI-not-UN FS: delete succeeds if (norm=same)"

40

41 create_testfs "-o casesensitivity=insensitive -o normalization=none"

42

43 for name1 in $NAMES_C ; do

send-c_embedded_blocks.ksh (https://github.com/adilger/zfs.git) Korn Shell · 109 lines

16 #

17

18 . $STF_SUITE/tests/functional/rsend/rsend.kshlib

19 . $STF_SUITE/include/properties.shlib

20

refreserv_raidz.ksh (https://github.com/adilger/zfs.git) Korn Shell · 135 lines

58 log_onexit cleanup

59

60 poolexists "$TESTPOOL" && log_must_busy zpool destroy "$TESTPOOL"

61

62 # Testing tiny block sizes on ashift=12 pools causes so much size inflation

69 bps=$(lsblk -nrdo min-io /dev/${alldisks[0]})

70 fi

71 log_must test "$bps" -eq 512 -o "$bps" -eq 4096

72 case "$bps" in

73 512)

105 log_note "Testing $raid-$ndisks volblocksize=$vbs"

106

107 vol=$TESTPOOL/$TESTVOL

108 log_must zfs create -V ${volsize}m \

109 -o volblocksize=$vbs "$vol"

mmp_active_import.ksh (https://github.com/adilger/zfs.git) Korn Shell · 125 lines

37 . $STF_SUITE/tests/functional/mmp/mmp.cfg

38 . $STF_SUITE/tests/functional/mmp/mmp.kshlib

39

40 verify_runnable "both"

44 mmp_pool_destroy $MMP_POOL $MMP_DIR

45 log_must mmp_clear_hostid

46 ZTESTPID=$(pgrep ztest)

47 if [ -n "$ZTESTPID" ]; then

50 done

51 else

52 # if ztest not running and log present, ztest crashed

53 if [ -f $MMP_ZTEST_LOG ]; then

86 # 4. Kill ztest to make pool eligible for import. Poll with 'zpool status'.

87 ZTESTPID=$(pgrep ztest)

88 if [ -n "$ZTESTPID" ]; then

zpool_online_001_neg.ksh (https://github.com/adilger/zfs.git) Korn Shell · 66 lines

30 #

31

32 . $STF_SUITE/include/libtest.shlib

33 . $STF_SUITE/tests/functional/cli_user/misc/misc.cfg

46 function check_for_online

47 {

48 RESULT=$(zpool status -v $TESTPOOL.virt | grep disk-offline.dat \

49 | grep ONLINE )

50 if [ -n "$RESULT" ]

58 log_assert "zpool online returns an error when run as a user"

59

60 log_mustnot zpool online $TESTPOOL.virt /$TESTDIR/disk-offline.dat

61 check_for_online

62

63 log_mustnot zpool online -t $TESTPOOL.virt /$TESTDIR/disk-offline.dat

64 check_for_online

65

mixed_create_failure.ksh (https://github.com/adilger/zfs.git) Korn Shell · 136 lines

67 # $2 - test directory

68 #

69 function test_ops

70 {

71 typeset obj_type=$1

77

78 log_note "The op : $op"

79 log_note "testdir=$testdir obj_type=$obj_type"

80

81 test_path="$testdir/$obj_type"

82 mkdir $test_path

83 log_note "Created test dir $test_path"

84

85 if [[ $obj_type = "symlink" || $obj_type = "hardlink" ]]; then

132 log_note "Testing create of $obj_type"

133 test_ops $obj_type $TESTDIR

134 done

135

xattr_009_neg.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 78 lines

57 function cleanup {

58

59 log_must $RM $TESTDIR/myfile.${TESTCASE_ID}

60

61 }

67

68 # create a file, and an xattr on it

69 log_must $TOUCH $TESTDIR/myfile.${TESTCASE_ID}

70 create_xattr $TESTDIR/myfile.${TESTCASE_ID} passwd /etc/passwd

71

72 # Try to create a soft link from the xattr namespace to the default namespace

73 log_mustnot $RUNAT $TESTDIR/myfile.${TESTCASE_ID} $LN -s /etc/passwd foo

74

75 # Try to create a hard link from the xattr namespace to the default namespace

76 log_mustnot $RUNAT $TESTDIR/myfile.${TESTCASE_ID} $LN /etc/passwd foo

77

78 log_pass "links between xattr and normal file namespace fail"

zfs_allow_001_neg.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 82 lines

30 #

31

32 . $STF_SUITE/include/libtest.kshlib

33 . $STF_SUITE/tests/cli_user/cli_user.kshlib

67 log_assert "zfs allow returns an error when run as a user"

68

69 log_must run_unprivileged "$ZFS allow $TESTPOOL/$TESTFS"

70 log_mustnot run_unprivileged "$ZFS allow `$LOGNAME` create $TESTPOOL/$TESTFS"

73 # checking for any allow output. ( if no allows are granted,

74 # nothing should be output )

75 OUTPUT=$(run_unprivileged "$ZFS allow $TESTPOOL/$TESTFS" | $GREP "Local+Descendent" )

76 if [ -n "$OUTPUT" ]

77 then

78 log_fail "zfs allow permissions were granted on $TESTPOOL/$TESTFS"

79 fi

80

zpool_import_013_neg.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 87 lines

30 #

31

32 . $STF_SUITE/include/libtest.kshlib

33

34 #################################################################################

47 # 3. Verify 'zpool import -f' succeed.

48 #

49 # TESTABILITY: explicit

50 #

51 # TEST_AUTOMATION_LEVEL: automated

66 log_note "Creating pool from $POOL_FILE"

67 log_must $BZCAT \

68 $STF_SUITE/tests/cli_root/zpool_import/blockfiles/$POOL_FILE.bz2 \

69 > $TMPDIR/$POOL_FILE

70 return 0

zfs_unallow_008_neg.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 88 lines

30 #

31

32 . $STF_SUITE/tests/delegate/delegate_common.kshlib

33

34 #################################################################################

42 #

43 # STRATEGY:

44 # 1. Set up basic test environment.

45 # 2. Verify zfs unallow handle invalid arguments correctly.

46 #

47 # TESTABILITY: explicit

48 #

49 # TEST_AUTOMATION_LEVEL: automated

zfs_unmount_001_neg.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 78 lines

29 # ident "@(#)zfs_unmount_001_neg.ksh 1.2 07/01/09 SMI"

30 #

31 . $STF_SUITE/include/libtest.kshlib

32 . $STF_SUITE/tests/cli_user/cli_user.kshlib

59

60 set -A args "umount" "umount -f" "unmount" "unmount -f" \

61 "umount $TESTPOOL/$TESTFS" "umount -f $TESTPOOL/$TESTFS" \

62 "unmount $TESTPOOL/$TESTFS" "unmount -f $TESTPOOL/$TESTFS" \

63 "umount $TESTPOOL/$TESTFS@$TESTSNAP" \

64 "umount -f $TESTPOOL/$TESTFS@$TESTSNAP" \

65 "unmount $TESTPOOL/$TESTFS@$TESTSNAP" \

66 "unmount -f $TESTPOOL/$TESTFS@$TESTSNAP" \

67 "umount $TESTDIR" "umount -f $TESTDIR" \

68 "unmount $TESTDIR" "unmount -f $TESTDIR"

tst.MultipleInvalidProbeId.d.ksh (https://bitbucket.org/iorivur/freebsd-bhyve-with-suspend-resume.git) Korn Shell · 53 lines

31 #

32 # ASSERTION:

33 # Testing -i option with multiple valid and invalid probe identifiers.

34 #

35 # SECTION: dtrace Utility/-i Option

tst.InvalidTraceFunc7.d.ksh (https://bitbucket.org/iorivur/freebsd-bhyve-with-suspend-resume.git) Korn Shell · 53 lines

31 #

32 # ASSERTION:

33 # Testing -f option with an invalid function name.

34 #

35 # SECTION: dtrace Utility/-f Option

framework00002.ksh (https://bitbucket.org/openesb/openesb-core.git) Korn Shell · 52 lines

32 . ./regress_defs.ksh

33

34 echo testing private library invocation for engines/bindings

35

36 # package components

38

39 # install engine

40 $JBI_ANT -Djbi.install.file=$JV_FRAMEWORK_BLD_DIR/dist/PrivateLibraryTestEngine.jar install-component

41

42 # start engine (this invokes the private lib API)

43 $JBI_ANT -Djbi.component.name="PrivateLibraryTestEngine" start-component

44

45 # shutdown engine

50

51 echo Private Library Invocation

52 grep "SUN'S STOCK VALUE = 25.0" $JBI_DOMAIN_ROOT/logs/classloaderregresstests.privatelibtest.engine.rt.log | wc -l

53

zfs_rollback_003_neg.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 98 lines

78 # Create snapshot1 and snapshot2 for this file system.

79 #

80 create_snapshot $TESTPOOL/$TESTFS $TESTSNAP

81 create_snapshot $TESTPOOL/$TESTFS $TESTSNAP1

83 # Run 'zfs rollback ""|-f <snap>' and it should fail.

84 #

85 log_mustnot $ZFS rollback $TESTPOOL/$TESTFS@$TESTSNAP

86 log_mustnot $ZFS rollback -f $TESTPOOL/$TESTFS@$TESTSNAP

88 # Create 'clone1' based on 'snap1'.

89 #

90 create_clone $TESTPOOL/$TESTFS@$TESTSNAP1 $TESTPOOL/$TESTCLONE1

91

92 # Run 'zfs rollback -r|-rf <snap>' and it should fail.

93 #

94 log_mustnot $ZFS rollback -r $TESTPOOL/$TESTFS@$TESTSNAP

95 log_mustnot $ZFS rollback -rf $TESTPOOL/$TESTFS@$TESTSNAP

snapshot_007_pos.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 112 lines

29 # ident "@(#)snapshot_007_pos.ksh 1.2 07/01/09 SMI"

30 #

31 . $STF_SUITE/include/libtest.kshlib

32

33 ################################################################################

46 # 4) For each snapshot directory verify consistency

47 #

48 # TESTABILITY: explicit

49 #

50 # TEST_AUTOMATION_LEVEL: automated

78 fi

79

80 if [[ -e $TESTDIR ]]; then

81 log_must $RM -rf $TESTDIR/* > /dev/null 2>&1

87 log_onexit cleanup

88

89 [[ -n $TESTDIR ]] && \

90 log_must $RM -rf $TESTDIR/* > /dev/null 2>&1

link_count_001.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 102 lines

29 # ident "@(#)link_count_001.ksh 1.2 07/01/09 SMI"

30 #

31 . $STF_SUITE/include/libtest.kshlib

32

33 ################################################################################

79 $RM -f ${TESTDIR}/tmp/x* >/dev/null 2>&1

80

81 $RM_LNKCNT_ZERO_FILE ${TESTDIR}/tmp/test${TESTCASE_ID} > /dev/null 2>&1 &

82 PID=$!

83 log_note "$RM_LNKCNT_ZERO_FILE ${TESTDIR}/tmp/test${TESTCASE_ID} pid: $PID"

98 fi

99

100 log_must $RM -f ${TESTDIR}/tmp/test${TESTCASE_ID}*

101

102 log_pass "Verify file link count is zero on zfs"

zfs_allow_008_pos.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 92 lines

30 #

31

32 . $STF_SUITE/tests/delegate/delegate_common.kshlib

33

34 #################################################################################

47 # permission.

48 #

49 # TESTABILITY: explicit

50 #

51 # TEST_AUTOMATION_LEVEL: automated

64 perms1="snapshot,reservation"

65 perms2="send,compression,checksum,userprop"

66 childfs=$ROOT_TESTFS/childfs

67

68 log_must $ZFS create $childfs

zfs_promote_001_pos.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 139 lines

85 snapexists $ds@$TESTSNAP && \

86 log_fail "zfs promote cannot promote $ds@$TESTSNAP."

87 ! snapexists $c_ds@$TESTSNAP && \

108 log_onexit cleanup

109

110 fs=$TESTPOOL/$TESTFS

111 file0=$TESTDIR/$TESTFILE0

112 file1=$TESTDIR/$TESTFILE1

113 snap=$fs@$TESTSNAP

114 snapfile=$TESTDIR/$(get_snapdir_name)/$TESTSNAP/$TESTFILE0

115 clone=$TESTPOOL/$TESTCLONE

117 csnap=$clone@$TESTSNAP

118 csnapfile=/$clone/$(get_snapdir_name)/$TESTSNAP/$TESTFILE0

119

120 # setup for promte testing

jbi-admin-cli00022.ksh (https://bitbucket.org/ldassonville/openesb-core.git) Korn Shell · 81 lines

32 # Perform any necessary cleanup to restore the repository back to its initial state.

33 #----------------------------------------------------------------------------------

34 test_cleanup()

35 {

36 cleanup server

39

40 #----------------------------------------------------------------------------------

41 # Main function called that will run the test

42 #----------------------------------------------------------------------------------

43 run_test()

44 {

45 initilize_test

46 #build_test_application_artifacts

74 TEST_NAME="jbi-admin-cli00022"

75 TEST_DESCRIPTION="Negative Component loggers and configuration tests"

76 . ./regress_defs.ksh

77 run_test

readonly_001_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 172 lines

61 function cleanup

62 {

63 for dataset in $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL ; do

64 snapexists ${dataset}@$TESTSNAP && \

147 log_must $ZFS snapshot $TESTPOOL/$TESTFS@$TESTSNAP

148 log_must $ZFS clone $TESTPOOL/$TESTFS@$TESTSNAP $TESTPOOL/$TESTCLONE

149

150 if is_global_zone ; then

151 log_must $ZFS snapshot $TESTPOOL/$TESTVOL@$TESTSNAP

152 log_must $ZFS clone $TESTPOOL/$TESTVOL@$TESTSNAP $TESTPOOL/$TESTCLONE1

153 all_datasets="$TESTPOOL $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL $TESTPOOL/$TESTCLONE $TESTPOOL/$TESTCLONE1"

154 else

155 all_datasets="$TESTPOOL $TESTPOOL/$TESTFS $TESTPOOL/$TESTCLONE"

zpool_create_011_neg.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 140 lines

63 function cleanup

64 {

65 for pool in $TESTPOOL $TESTPOOL1

66 do

67 destroy_pool $pool

102 "$TESTPOOL1 $pooldev1" \

103 "$TESTPOOL1 $TESTDIR0/$FILEDISK0" \

104 "$TESTPOOL1 mirror mirror $mirror1 mirror $mirror2" \

107 "$TESTPOOL1 mirror raidz $raidz1 raidz $raidz2" \

108 "$TESTPOOL1 mirror raidz1 $raidz1 raidz1 $raidz2" \

109 "$TESTPOOL1 raidz mirror $mirror1 mirror $mirror2" \

130 log_must $ZPOOL create -f $TESTPOOL3 $disk

131 log_must $ZPOOL destroy -f $TESTPOOL3

132

133 log_must dumpon $specified_dump_dev

reservation_017_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 101 lines

30 #

31

32 . $STF_SUITE/include/libtest.shlib

33 . $STF_SUITE/tests/functional/reservation/reservation.shlib

67 # Create a regular and sparse volume for testing.

68 regvol=$TESTPOOL/$TESTVOL

69 sparsevol=$TESTPOOL/$TESTVOL2

71 log_must zfs create -s -V 64M $sparsevol

72

73 typeset vsize=$(get_prop available $TESTPOOL)

74 typeset iterate=10

75 typeset regreserv

zpool_online_001_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 124 lines

30 #

31

32 . $STF_SUITE/include/libtest.shlib

33

34 #

44 verify_runnable "global"

45

46 DISKLIST=$(get_disklist $TESTPOOL)

47

48 set -A args ""

54 #

55 for disk in $DISKLIST; do

56 log_must zpool online $TESTPOOL $disk

57 check_state $TESTPOOL $disk "online"

78 while [[ $i -lt ${#args[*]} ]]; do

79

80 log_must sync_pool $TESTPOOL

81 log_must zpool offline $TESTPOOL $disk

alloc_class_012_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 122 lines

69 log_must zpool create $TESTPOOL $ZPOOL_DISKS \

70 special $CLASS_DISK0 special $CLASS_DISK1

71 log_must display_status "$TESTPOOL"

72

73 #

81 $TESTPOOL/$TESTFS

82 for i in 1 2 3 4; do

83 log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/testfile.$i \

84 bs=1M count=$blocks

85 ((blocks = blocks + 25))

87 log_must sync_pool $TESTPOOL

88 log_must zpool list -v $TESTPOOL

89

90 # Verify the files were written in the special class vdevs

92 dataset="$TESTPOOL/$TESTFS"

93 inum="$(get_objnum /$TESTPOOL/$TESTFS/testfile.$i)"

94 log_must file_in_special_vdev $dataset $inum

95 done

procfs_list_basic.ksh (https://github.com/adilger/zfs.git) Korn Shell · 95 lines

25 #

26

27 . $STF_SUITE/include/libtest.shlib

28

29 #

30 # DESCRIPTION:

31 # Test that we can read from and write to a file in procfs whose contents is

32 # backed by a linked list.

33 #

49 {

50 typeset expected_count=$1

51 count=$(grep -E "command: (lt-)?zfs snapshot $FS@testsnapshot" | wc -l)

52 log_must eval "[[ $count -eq $expected_count ]]"

53 }

zfs_send_004_neg.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 123 lines

74 }

75

76 fs=$TESTPOOL/$TESTFS

77 snap1=$fs@snap1

78 snap2=$fs@snap2

101

102 log_must $ZFS snapshot $snap1

103 tmpfile1=$TESTDIR/testfile1.${TESTCASE_ID}

104 log_must $TOUCH $tmpfile1

105 log_must $ZFS snapshot $snap2

106 tmpfile2=$TESTDIR/testfile2.${TESTCASE_ID}

107 log_must $TOUCH $tmpfile2

108 log_must $ZFS snapshot $snap3

tst.ipv4remotesctp.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 130 lines

26

27 #

28 # Test {sctp,ip}:::{send,receive} of IPv4 SCTP to a remote host.

29 #

30 # This may fail due to:

31 #

32 # 1. A change to the ip stack breaking expected probe behavior,

33 # which is the reason we are testing.

34 # 2. No physical network interface is plumbed and up.

35 # 3. No other hosts on this subnet are reachable and listening on ssh.

37 # variables to be corrupted.

38 #

39 # This test performs an SCTP association and checks that at least the

40 # following packet counts were traced:

41 #

zpool_upgrade_008_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 99 lines

30 #

31

32 . $STF_SUITE/include/libtest.kshlib

33 . $STF_SUITE/tests/cli_root/zpool_upgrade/zpool_upgrade.kshlib

45 # STRATEGY:

46 # 1. For all versions pools that can be upgraded on a given OS version

47 # (latest pool version - 1)

48 # 2. Pick a version that's a random number, greater than the version

49 # we're running.

51 # 4. Check the pool was upgraded correctly.

52 #

53 # TESTABILITY: explicit

54 #

55 # TEST_AUTOMATION_LEVEL: automated

81 # enough to determine if upgrade works correctly. Also set a MAX_VER

82 # variable, which specifies the highest version that we should expect

83 # a zpool upgrade operation to succeed from. (latest version - 1)

84 CONFIGS="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 28"

85 MAX_VER=28

zfs_clone_006_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 105 lines

30 #

31

32 . $STF_SUITE/include/libtest.kshlib

33 . $STF_SUITE/tests/cli_root/zfs_create/zfs_create_common.kshlib

34 . $STF_SUITE/tests/cli_root/zfs_create/properties.kshlib

35

36 ################################################################################

90 done

91

92 log_must $ZFS clone $opts $SNAPFS1 $TESTPOOL/$TESTCLONE

93

94 i=0

96 if [[ $WRAPPER != *"crypto"* ]] || \

97 [[ ${RW_VOL_CLONE_PROP[$i]} != *"checksum"* ]]; then

98 propertycheck $TESTPOOL/$TESTCLONE ${RW_VOL_CLONE_PROP[i]} || \

99 log_fail "${RW_VOL_CLONE_PROP[i]} is failed to set."

100 fi

zfs_acl_pax_003_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 98 lines

30 #

31

32 . $STF_SUITE/tests/acl/acl_common.kshlib

33

34 #################################################################################

50 # 6. Verify the two records should be identical.

51 #

52 # TESTABILITY: explicit

53 #

54 # TEST_AUTOMATION_LEVEL: automated

86 #

87 [[ ! -d $TST_DIR ]] && log_must usr_exec $MKDIR -m 777 $TST_DIR

88 testout=$TMP_DIR/testout.${TESTCASE_ID}

89 cd $TST_DIR

90 log_must eval "usr_exec $CPIO -ivd@ < $paxout" > /dev/null 2>&1

rollback_003_pos.ksh (https://bitbucket.org/freebsd/freebsd-base.git) Korn Shell · 114 lines

75 done

76

77 for fs in "$TESTPOOL/$TESTFILE/$TESTFILE.1" "$TESTPOOL/$TESTFILE"

78 do

79 datasetexists $fs

102

103 log_note "Verify rollback of multiple nested file systems succeeds."

104 log_must $ZFS snapshot $TESTPOOL/$TESTFILE@$TESTSNAP

105 log_must $ZFS snapshot $SNAPPOOL.1

106

108 log_must $ZFS mount -a

109

110 log_must $TOUCH /$TESTPOOL/$TESTFILE/$TESTFILE.1

111

112 log_must $ZFS rollback $SNAPPOOL.1

migration_003_pos.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 80 lines

51 # TESTABILITY: explicit

52 #

53 # TEST_AUTOMATION_LEVEL: automated

54 #

55 # CODING_STATUS: COMPLETED (2005-07-04)

63 function cleanup

64 {

65 $RM -rf $NONZFS_TESTDIR/tar${TESTCASE_ID}.tar

66 $RM -rf $TESTDIR/$BNAME

71 log_onexit cleanup

72

73 prepare $DNAME "$TAR cf $NONZFS_TESTDIR/tar${TESTCASE_ID}.tar $BNAME"

74 (( $? != 0 )) && log_fail "Unable to create src archive"

75

76 migrate $TESTDIR $SUMA $SUMB "$TAR xvf $NONZFS_TESTDIR/tar${TESTCASE_ID}.tar"

77 (( $? != 0 )) && log_fail "Uable to successfully migrate test file from" \

slog_004_pos.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 82 lines

30 #

31

32 . $STF_SUITE/tests/slog/slog.kshlib

33

34 #################################################################################

47 # 4. Destroy and loop to create pool with different configuration.

48 #

49 # TESTABILITY: explicit

50 #

51 # TEST_AUTOMATION_LEVEL: automated

62 log_onexit cleanup

63

64 function test_attaching_slog # <pooltype> <sparetype> <logtype>

65 {

66 typeset pooltype=$1

nestedfs_001_pos.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 79 lines

29 # ident "@(#)nestedfs_001_pos.ksh 1.2 07/01/09 SMI"

30 #

31 . $STF_SUITE/include/libtest.kshlib

32

33 ################################################################################

68 log_assert "Verify a nested file system can be created/destroyed."

69

70 log_must $FILE_WRITE -o $OP -f $TESTDIR1/$TESTFILE0 -b $BLOCKSZ \

71 -c $NUM_WRITES -d $DATA

72

75 log_note "Verify that a nested file system with a mounted file system "\

76 "cannot be destroyed."

77 log_mustnot $ZFS destroy $TESTPOOL/$TESTCTR

78

79 log_pass "A nested file system was successfully populated."

mv_files_001_pos.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 84 lines

30 #

31

32 . $STF_SUITE/include/libtest.kshlib

33 . $STF_SUITE/tests/mv_files/mv_files_common.kshlib

54 # 8. verify the data integrity

55 #

56 # TESTABILITY: explicit

57 #

58 # TEST_AUTOMATION_LEVEL: automated

78 log_onexit cleanup

79

80 mv_test $OLDDIR $NEWDIR_IN_FS

81 (($? != 0 )) && \

82 log_fail "'mv' test failed to complete."

zpool_remove_002_pos.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 79 lines

29 # ident "@(#)zpool_remove_002_pos.ksh 1.1 07/07/31 SMI"

30 #

31 . $STF_SUITE/include/libtest.kshlib

32

33 ################################################################################

45 # 3. Verify that the remove succeed.

46 #

47 # TESTABILITY: explicit

48 #

49 # TEST_AUTOMATION_LEVEL: automated

57 function cleanup

58 {

59 destroy_pool $TESTPOOL

60 }

61

zpool_create_015_neg.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 90 lines

29 #ident "@(#)zpool_create_015_neg.ksh 1.2 09/06/22 SMI"

30 #

31 . $STF_SUITE/include/libtest.kshlib

32

33 ################################################################################

49 # 5. Verify the creation is failed.

50 #

51 # TESTABILITY: explicit

52 #

53 # TEST_AUTOMATION_LEVEL: automated

73

74 typeset pool_dev=${disk}

75 typeset vol_name=$TESTPOOL/$TESTVOL

76

77 log_assert "'zpool create' should fail with zfs vol device in swap."

zfs_unshare_004_neg.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 95 lines

60 set -A opts "" "$TESTPOOL/$NONEXISTFSNAME" "$NONEEXISTMOUNTPOINT" "-?" "-1" \

61 "-a blah" "$TESTPOOL/$TESTFS $TESTPOOL/$TESTFS1" \

62 "-f $TESTPOOL/$TESTFS $TESTPOOL/$TESTFS1" \

63 "$TESTPOOL/$TESTFS $TESTDIR" "-f $TESTPOOL/$TESTFS $TESTDIR" \

64 "${TESTDIR#/}" "-f ${TESTDIR#/}"

66 log_assert "Verify that '$ZFS unshare' issue error message with badly formed parameter."

67

68 shareval=$(get_prop sharenfs $TESTPOOL/$TESTFS)

69 if [[ $shareval == off ]]; then

70 log_must $ZFS set sharenfs=on $TESTPOOL/$TESTFS

82 log_must $ZFS unshare $TESTPOOL/$TESTFS

83 for opt in "" "-f"; do

84 log_mustnot eval "$ZFS unshare $opt $TESTPOOL/$TESTFS >/dev/null 2>&1"

85 log_mustnot eval "$ZFS unshare $opt $mpt >/dev/null 2>&1"

86 done

zfs_clone_005_pos.ksh (https://github.com/freebsd/freebsd.git) Korn Shell · 99 lines

30 #

31

32 . $STF_SUITE/include/libtest.kshlib

33 . $STF_SUITE/tests/cli_root/zfs_create/zfs_create_common.kshlib

86 fi

87

88 log_must $ZFS clone -o ${RW_VOL_CLONE_PROP[$i]} $SNAPFS1 $TESTPOOL/$TESTCLONE

89 datasetexists $TESTPOOL/$TESTCLONE || \

90 log_fail "zfs clone $TESTPOOL/$TESTCLONE fail."

91 propertycheck $TESTPOOL/$TESTCLONE ${RW_VOL_CLONE_PROP[i]} || \

92 log_fail "${RW_VOL_CLONE_PROP[i]} is failed to set."

93 log_must $ZFS destroy -f $TESTPOOL/$TESTCLONE

94

95 (( i = i + 1 ))

dbufstats_001_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 84 lines

25 #

26

27 . $STF_SUITE/include/libtest.shlib

28 . $STF_SUITE/include/math.shlib

29

41 #

42

43 DBUFSTATS_FILE=$(mktemp $TEST_BASE_DIR/dbufstats.out.XXXXXX)

44 DBUFS_FILE=$(mktemp $TEST_BASE_DIR/dbufs.out.XXXXXX)

46 function cleanup

47 {

48 log_must rm -f $TESTDIR/file $DBUFS_FILE $DBUFSTATS_FILE

49 }

50

51 function testdbufstat # stat_name dbufstat_filter

52 {

53 name=$1

zpool_reopen_005_pos.ksh (https://github.com/adilger/zfs.git) Korn Shell · 86 lines

20 #

21 # DESCRIPTION:

22 # Test zpool reopen -n while resilver is running.

23 # Checks if the resilver is restarted.

24 #

43 log_must zinject -c all

44 insert_disk $REMOVED_DISK $scsi_host

45 poolexists $TESTPOOL && destroy_pool $TESTPOOL

46 }

47

61 # 3. Write test file to pool.

62 log_must generate_random_file /$TESTPOOL/data $LARGE_FILE_SIZE

63 # 4. "Plug back" disk.

64 insert_disk $REMOVED_DISK $scsi_host

67 log_must zpool reopen $TESTPOOL

68 log_must check_state $TESTPOOL "$REMOVED_DISK_ID" "online"

69 # add delay to I/O requests for the reopened disk

70 log_must zinject -d $REMOVED_DISK_ID -D25:1 $TESTPOOL

zpool_initialize_attach_detach_add_remove.ksh (https://github.com/adilger/zfs.git) Korn Shell · 68 lines

24 # Copyright (c) 2016 by Delphix. All rights reserved.

25 #

26 . $STF_SUITE/include/libtest.shlib

27 . $STF_SUITE/tests/functional/cli_root/zpool_initialize/zpool_initialize.kshlib

43 DISK2="$(echo $DISKS | cut -d' ' -f2)"

44

45 log_must zpool create -f $TESTPOOL $DISK1

46

47 log_must zpool initialize $TESTPOOL $DISK1

48 progress="$(initialize_progress $TESTPOOL $DISK1)"

49 [[ -z "$progress" ]] && log_fail "Initializing did not start"

50

51 log_must zpool attach $TESTPOOL $DISK1 $DISK2

52 new_progress="$(initialize_progress $TESTPOOL $DISK1)"