]> git.proxmox.com Git - mirror_zfs.git/commitdiff
OpenZFS 7290 - ZFS test suite needs to control what utilities it can run
authorJohn Wren Kennedy <john.kennedy@delphix.com>
Thu, 6 Apr 2017 00:18:22 +0000 (20:18 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 6 Apr 2017 16:25:36 +0000 (09:25 -0700)
Authored by: John Wren Kennedy <john.kennedy@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Gordon Ross <gordon.w.ross@gmail.com>
Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
Ported-by: George Melikov <mail@gmelikov.ru>
Porting Notes:
- Utilities which aren't available under Linux have been removed.
- Because of sudo's default secure path behavior PATH must be
  explicitly reset at the top of libtest.shlib.  This avoids the
  need for all users to customize secure path on their system.
- Updated ZoL infrastructure to manage constrained path
- Updated all test cases
- Check permissions for usergroup tests
- When testing in-tree create links under bin/
- Update fault cleanup such that missing files during
  cleanup aren't fatal.
- Configure su environment with constrained path

OpenZFS-issue: https://www.illumos.org/issues/7290
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/1d32ba6
Closes #5903

798 files changed:
.gitignore
config/user-commands.m4 [deleted file]
config/user.m4
configure.ac
scripts/zfs-tests.sh
tests/test-runner/include/logapi.shlib
tests/zfs-tests/include/.gitignore [deleted file]
tests/zfs-tests/include/commands.cfg [new file with mode: 0644]
tests/zfs-tests/include/commands.cfg.in [deleted file]
tests/zfs-tests/include/default.cfg [new file with mode: 0644]
tests/zfs-tests/include/default.cfg.in [deleted file]
tests/zfs-tests/include/libtest.shlib
tests/zfs-tests/include/math.shlib
tests/zfs-tests/include/properties.shlib
tests/zfs-tests/tests/functional/acl/acl_common.kshlib
tests/zfs-tests/tests/functional/acl/posix/posix_001_pos.ksh
tests/zfs-tests/tests/functional/acl/posix/posix_002_pos.ksh
tests/zfs-tests/tests/functional/acl/posix/posix_003_pos.ksh
tests/zfs-tests/tests/functional/acl/posix/setup.ksh
tests/zfs-tests/tests/functional/atime/atime_001_pos.ksh
tests/zfs-tests/tests/functional/atime/atime_002_neg.ksh
tests/zfs-tests/tests/functional/atime/atime_003_pos.ksh
tests/zfs-tests/tests/functional/atime/atime_common.kshlib
tests/zfs-tests/tests/functional/bootfs/bootfs_001_pos.ksh
tests/zfs-tests/tests/functional/bootfs/bootfs_002_neg.ksh
tests/zfs-tests/tests/functional/bootfs/bootfs_003_pos.ksh
tests/zfs-tests/tests/functional/bootfs/bootfs_004_neg.ksh
tests/zfs-tests/tests/functional/bootfs/bootfs_005_neg.ksh
tests/zfs-tests/tests/functional/bootfs/bootfs_006_pos.ksh
tests/zfs-tests/tests/functional/bootfs/bootfs_007_neg.ksh
tests/zfs-tests/tests/functional/bootfs/bootfs_007_pos.ksh
tests/zfs-tests/tests/functional/bootfs/bootfs_008_neg.ksh
tests/zfs-tests/tests/functional/bootfs/cleanup.ksh
tests/zfs-tests/tests/functional/bootfs/setup.ksh
tests/zfs-tests/tests/functional/cache/cache.kshlib
tests/zfs-tests/tests/functional/cache/cache_001_pos.ksh
tests/zfs-tests/tests/functional/cache/cache_002_pos.ksh
tests/zfs-tests/tests/functional/cache/cache_003_pos.ksh
tests/zfs-tests/tests/functional/cache/cache_004_neg.ksh
tests/zfs-tests/tests/functional/cache/cache_005_neg.ksh
tests/zfs-tests/tests/functional/cache/cache_006_pos.ksh
tests/zfs-tests/tests/functional/cache/cache_007_neg.ksh
tests/zfs-tests/tests/functional/cache/cache_008_neg.ksh
tests/zfs-tests/tests/functional/cache/cache_009_pos.ksh
tests/zfs-tests/tests/functional/cache/cache_010_neg.ksh
tests/zfs-tests/tests/functional/cache/cache_011_pos.ksh
tests/zfs-tests/tests/functional/cache/cleanup.ksh
tests/zfs-tests/tests/functional/cache/setup.ksh
tests/zfs-tests/tests/functional/cachefile/cachefile.kshlib
tests/zfs-tests/tests/functional/cachefile/cachefile_001_pos.ksh
tests/zfs-tests/tests/functional/cachefile/cachefile_002_pos.ksh
tests/zfs-tests/tests/functional/cachefile/cachefile_003_pos.ksh
tests/zfs-tests/tests/functional/cachefile/cachefile_004_pos.ksh
tests/zfs-tests/tests/functional/casenorm/casenorm.cfg
tests/zfs-tests/tests/functional/casenorm/casenorm.kshlib
tests/zfs-tests/tests/functional/casenorm/norm_all_values.ksh
tests/zfs-tests/tests/functional/casenorm/setup.ksh
tests/zfs-tests/tests/functional/chattr/chattr_002_neg.ksh
tests/zfs-tests/tests/functional/checksum/cleanup.ksh
tests/zfs-tests/tests/functional/checksum/filetest_001_pos.ksh
tests/zfs-tests/tests/functional/checksum/run_edonr_test.ksh
tests/zfs-tests/tests/functional/checksum/run_sha2_test.ksh
tests/zfs-tests/tests/functional/checksum/run_skein_test.ksh
tests/zfs-tests/tests/functional/clean_mirror/clean_mirror_common.kshlib
tests/zfs-tests/tests/functional/clean_mirror/cleanup.ksh
tests/zfs-tests/tests/functional/clean_mirror/default.cfg
tests/zfs-tests/tests/functional/cli_root/cli_common.kshlib
tests/zfs-tests/tests/functional/cli_root/zdb/zdb_001_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zdb/zdb_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zdb/zdb_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zdb/zdb_004_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zdb/zdb_005_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs/zfs_001_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs/zfs_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs/zfs_003_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_001_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_004_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_005_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_006_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_007_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_008_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_009_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_010_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_copies/cleanup.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies.kshlib
tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_004_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_005_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_006_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_004_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_005_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_006_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_007_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_008_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_009_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_010_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_011_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_012_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_013_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_014_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_common.kshlib
tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_004_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_005_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_006_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_007_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_008_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_009_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_010_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_011_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_012_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_013_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_014_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_015_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_016_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_common.kshlib
tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_004_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_005_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_006_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_007_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_008_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_009_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_010_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_common.kshlib
tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_list_d.kshlib
tests/zfs-tests/tests/functional/cli_root/zfs_inherit/zfs_inherit_001_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_inherit/zfs_inherit_002_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_inherit/zfs_inherit_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount.kshlib
tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_004_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_005_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_006_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_007_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_008_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_009_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_010_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_011_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_012_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_all_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_004_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_005_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_006_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_007_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_008_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_property/zfs_written_property_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_004_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_005_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_006_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_007_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_008_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_009_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_010_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_011_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_012_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_013_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_014_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_015_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_rename/cleanup.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_rename/setup.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename.kshlib
tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_004_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_005_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_006_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_007_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_008_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_009_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_010_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_011_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_012_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_013_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_reservation/zfs_reservation_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_reservation/zfs_reservation_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_003_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_004_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_common.kshlib
tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_004_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_005_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_006_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_007_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/cache_002_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_004_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/mountpoint_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/mountpoint_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/mountpoint_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/onoffs_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/property_alias_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/readonly_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/reservation_001_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/ro_props_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/share_mount_001_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/snapdir_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_003_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_004_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/version_001_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_002_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_003_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_004_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_005_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_006_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_007_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_008_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_009_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_010_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_011_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_001_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_002_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_003_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_004_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_005_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_006_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_007_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_008_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_009_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount.kshlib
tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_004_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_005_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_006_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_007_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_008_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_009_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_all_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_004_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_005_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_006_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade.kshlib
tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_004_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_005_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_006_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_007_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool/zpool_001_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool/zpool_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool/zpool_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_add/add-o_ashift.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_add/setup.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add.kshlib
tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_004_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_005_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_006_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_007_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_008_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_009_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_attach/zpool_attach_001_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_002_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_003_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/setup.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create.shlib
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_004_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_005_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_006_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_007_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_008_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_009_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_010_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_011_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_012_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_014_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_015_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_016_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_017_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_018_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_019_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_020_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_021_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_022_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_023_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_024_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_004_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_005_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_003_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_detach/zpool_detach_001_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_003_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_003_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_004_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_004_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_history/zpool_history_001_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_history/zpool_history_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/cleanup.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/setup.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import.cfg
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_004_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_005_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_006_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_007_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_008_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_009_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_010_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_011_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_012_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_013_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_014_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_all_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_features_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_features_002_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_features_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_missing_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_missing_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_missing_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_rename_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_offline/zpool_offline_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_offline/zpool_offline_002_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_online/zpool_online_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_online/zpool_online_002_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove.cfg
tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_001_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_replace/zpool_replace_001_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_scrub/setup.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub.cfg
tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_001_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_004_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_005_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_002_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_003_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib
tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_004_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_005_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_006_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_008_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_009_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/arc_summary_001_pos.ksh
tests/zfs-tests/tests/functional/cli_user/misc/arcstat_001_pos.ksh
tests/zfs-tests/tests/functional/cli_user/misc/cleanup.ksh
tests/zfs-tests/tests/functional/cli_user/misc/dbufstat_001_pos.ksh
tests/zfs-tests/tests/functional/cli_user/misc/setup.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zdb_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_allow_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_clone_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_create_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_destroy_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_get_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_inherit_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_mount_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_promote_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_receive_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_rename_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_rollback_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_send_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_set_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_share_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_snapshot_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_unallow_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_unmount_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_unshare_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_upgrade_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_add_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_attach_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_clear_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_create_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_destroy_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_detach_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_export_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_get_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_history_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_import_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_import_002_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_offline_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_online_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_remove_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_replace_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_scrub_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_set_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_status_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_upgrade_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/zfs_list/setup.ksh
tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list.kshlib
tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_001_pos.ksh
tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_002_pos.ksh
tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_003_pos.ksh
tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_004_neg.ksh
tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_007_pos.ksh
tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_008_neg.ksh
tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_002_pos.ksh
tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_003_neg.ksh
tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_004_pos.ksh
tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_005_pos.ksh
tests/zfs-tests/tests/functional/cli_user/zpool_list/zpool_list_001_pos.ksh
tests/zfs-tests/tests/functional/cli_user/zpool_list/zpool_list_002_neg.ksh
tests/zfs-tests/tests/functional/compression/compress_001_pos.ksh
tests/zfs-tests/tests/functional/compression/compress_002_pos.ksh
tests/zfs-tests/tests/functional/compression/compress_003_pos.ksh
tests/zfs-tests/tests/functional/compression/compress_004_pos.ksh
tests/zfs-tests/tests/functional/delegate/cleanup.ksh
tests/zfs-tests/tests/functional/delegate/delegate_common.kshlib
tests/zfs-tests/tests/functional/delegate/setup.ksh
tests/zfs-tests/tests/functional/delegate/zfs_allow_001_pos.ksh
tests/zfs-tests/tests/functional/delegate/zfs_allow_002_pos.ksh
tests/zfs-tests/tests/functional/delegate/zfs_allow_003_pos.ksh
tests/zfs-tests/tests/functional/delegate/zfs_allow_004_pos.ksh
tests/zfs-tests/tests/functional/delegate/zfs_allow_005_pos.ksh
tests/zfs-tests/tests/functional/delegate/zfs_allow_006_pos.ksh
tests/zfs-tests/tests/functional/delegate/zfs_allow_007_pos.ksh
tests/zfs-tests/tests/functional/delegate/zfs_allow_008_pos.ksh
tests/zfs-tests/tests/functional/delegate/zfs_allow_009_neg.ksh
tests/zfs-tests/tests/functional/delegate/zfs_allow_010_pos.ksh
tests/zfs-tests/tests/functional/delegate/zfs_allow_011_neg.ksh
tests/zfs-tests/tests/functional/delegate/zfs_allow_012_neg.ksh
tests/zfs-tests/tests/functional/delegate/zfs_unallow_001_pos.ksh
tests/zfs-tests/tests/functional/delegate/zfs_unallow_002_pos.ksh
tests/zfs-tests/tests/functional/delegate/zfs_unallow_003_pos.ksh
tests/zfs-tests/tests/functional/delegate/zfs_unallow_004_pos.ksh
tests/zfs-tests/tests/functional/delegate/zfs_unallow_005_pos.ksh
tests/zfs-tests/tests/functional/delegate/zfs_unallow_006_pos.ksh
tests/zfs-tests/tests/functional/delegate/zfs_unallow_007_neg.ksh
tests/zfs-tests/tests/functional/delegate/zfs_unallow_008_neg.ksh
tests/zfs-tests/tests/functional/devices/devices_001_pos.ksh
tests/zfs-tests/tests/functional/devices/devices_002_neg.ksh
tests/zfs-tests/tests/functional/devices/devices_003_pos.ksh
tests/zfs-tests/tests/functional/devices/devices_common.kshlib
tests/zfs-tests/tests/functional/exec/exec_001_pos.ksh
tests/zfs-tests/tests/functional/exec/exec_002_neg.ksh
tests/zfs-tests/tests/functional/fault/auto_online_001_pos.ksh
tests/zfs-tests/tests/functional/fault/auto_replace_001_pos.ksh
tests/zfs-tests/tests/functional/fault/cleanup.ksh
tests/zfs-tests/tests/functional/fault/fault.cfg
tests/zfs-tests/tests/functional/fault/setup.ksh
tests/zfs-tests/tests/functional/features/async_destroy/async_destroy_001_pos.ksh
tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_001_pos.ksh
tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_002_pos.ksh
tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_003_pos.ksh
tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_004_neg.ksh
tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_005_pos.ksh
tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_006_pos.ksh
tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_007_neg.ksh
tests/zfs-tests/tests/functional/grow_pool/grow_pool_001_pos.ksh
tests/zfs-tests/tests/functional/grow_replicas/grow_replicas_001_pos.ksh
tests/zfs-tests/tests/functional/history/cleanup.ksh
tests/zfs-tests/tests/functional/history/history_001_pos.ksh
tests/zfs-tests/tests/functional/history/history_002_pos.ksh
tests/zfs-tests/tests/functional/history/history_003_pos.ksh
tests/zfs-tests/tests/functional/history/history_004_pos.ksh
tests/zfs-tests/tests/functional/history/history_005_neg.ksh
tests/zfs-tests/tests/functional/history/history_006_neg.ksh
tests/zfs-tests/tests/functional/history/history_007_pos.ksh
tests/zfs-tests/tests/functional/history/history_008_pos.ksh
tests/zfs-tests/tests/functional/history/history_009_pos.ksh
tests/zfs-tests/tests/functional/history/history_010_pos.ksh
tests/zfs-tests/tests/functional/history/history_common.kshlib
tests/zfs-tests/tests/functional/inheritance/cleanup.ksh
tests/zfs-tests/tests/functional/inheritance/inherit.kshlib
tests/zfs-tests/tests/functional/inheritance/inherit_001_pos.ksh
tests/zfs-tests/tests/functional/inuse/inuse.cfg
tests/zfs-tests/tests/functional/inuse/inuse_001_pos.ksh
tests/zfs-tests/tests/functional/inuse/inuse_003_pos.ksh
tests/zfs-tests/tests/functional/inuse/inuse_004_pos.ksh
tests/zfs-tests/tests/functional/inuse/inuse_005_pos.ksh
tests/zfs-tests/tests/functional/inuse/inuse_006_pos.ksh
tests/zfs-tests/tests/functional/inuse/inuse_007_pos.ksh
tests/zfs-tests/tests/functional/inuse/inuse_008_pos.ksh
tests/zfs-tests/tests/functional/inuse/inuse_009_pos.ksh
tests/zfs-tests/tests/functional/large_files/large_files_001_pos.ksh
tests/zfs-tests/tests/functional/large_files/large_files_002_pos.ksh
tests/zfs-tests/tests/functional/largest_pool/largest_pool_001_pos.ksh
tests/zfs-tests/tests/functional/link_count/link_count_001.ksh
tests/zfs-tests/tests/functional/migration/cleanup.ksh
tests/zfs-tests/tests/functional/migration/migration.cfg
tests/zfs-tests/tests/functional/migration/migration.kshlib
tests/zfs-tests/tests/functional/migration/migration_001_pos.ksh
tests/zfs-tests/tests/functional/migration/migration_002_pos.ksh
tests/zfs-tests/tests/functional/migration/migration_003_pos.ksh
tests/zfs-tests/tests/functional/migration/migration_004_pos.ksh
tests/zfs-tests/tests/functional/migration/migration_005_pos.ksh
tests/zfs-tests/tests/functional/migration/migration_006_pos.ksh
tests/zfs-tests/tests/functional/migration/migration_007_pos.ksh
tests/zfs-tests/tests/functional/migration/migration_008_pos.ksh
tests/zfs-tests/tests/functional/migration/migration_009_pos.ksh
tests/zfs-tests/tests/functional/migration/migration_010_pos.ksh
tests/zfs-tests/tests/functional/migration/migration_011_pos.ksh
tests/zfs-tests/tests/functional/migration/migration_012_pos.ksh
tests/zfs-tests/tests/functional/migration/setup.ksh
tests/zfs-tests/tests/functional/mmap/mmap_read_001_pos.ksh
tests/zfs-tests/tests/functional/mmap/mmap_write_001_pos.ksh
tests/zfs-tests/tests/functional/mount/cleanup.ksh
tests/zfs-tests/tests/functional/mount/setup.ksh
tests/zfs-tests/tests/functional/mount/umount_001.ksh
tests/zfs-tests/tests/functional/mount/umountall_001.ksh
tests/zfs-tests/tests/functional/mv_files/cleanup.ksh
tests/zfs-tests/tests/functional/mv_files/mv_files.cfg
tests/zfs-tests/tests/functional/mv_files/mv_files_001_pos.ksh
tests/zfs-tests/tests/functional/mv_files/mv_files_002_pos.ksh
tests/zfs-tests/tests/functional/mv_files/mv_files_common.kshlib
tests/zfs-tests/tests/functional/nestedfs/nestedfs_001_pos.ksh
tests/zfs-tests/tests/functional/no_space/cleanup.ksh
tests/zfs-tests/tests/functional/no_space/enospc.cfg
tests/zfs-tests/tests/functional/no_space/enospc_001_pos.ksh
tests/zfs-tests/tests/functional/no_space/enospc_002_pos.ksh
tests/zfs-tests/tests/functional/no_space/setup.ksh
tests/zfs-tests/tests/functional/nopwrite/nopwrite.shlib
tests/zfs-tests/tests/functional/nopwrite/nopwrite_copies.ksh
tests/zfs-tests/tests/functional/nopwrite/nopwrite_mtime.ksh
tests/zfs-tests/tests/functional/nopwrite/nopwrite_negative.ksh
tests/zfs-tests/tests/functional/nopwrite/nopwrite_promoted_clone.ksh
tests/zfs-tests/tests/functional/nopwrite/nopwrite_recsize.ksh
tests/zfs-tests/tests/functional/nopwrite/nopwrite_sync.ksh
tests/zfs-tests/tests/functional/nopwrite/nopwrite_varying_compression.ksh
tests/zfs-tests/tests/functional/nopwrite/nopwrite_volume.ksh
tests/zfs-tests/tests/functional/online_offline/online_offline.cfg
tests/zfs-tests/tests/functional/online_offline/online_offline_001_pos.ksh
tests/zfs-tests/tests/functional/online_offline/online_offline_002_neg.ksh
tests/zfs-tests/tests/functional/online_offline/online_offline_003_neg.ksh
tests/zfs-tests/tests/functional/pool_names/pool_names_001_pos.ksh
tests/zfs-tests/tests/functional/pool_names/pool_names_002_neg.ksh
tests/zfs-tests/tests/functional/poolversion/cleanup.ksh
tests/zfs-tests/tests/functional/poolversion/poolversion_001_pos.ksh
tests/zfs-tests/tests/functional/poolversion/poolversion_002_pos.ksh
tests/zfs-tests/tests/functional/poolversion/setup.ksh
tests/zfs-tests/tests/functional/privilege/cleanup.ksh
tests/zfs-tests/tests/functional/privilege/privilege_001_pos.ksh
tests/zfs-tests/tests/functional/privilege/privilege_002_pos.ksh
tests/zfs-tests/tests/functional/privilege/setup.ksh
tests/zfs-tests/tests/functional/quota/quota.kshlib
tests/zfs-tests/tests/functional/quota/quota_001_pos.ksh
tests/zfs-tests/tests/functional/quota/quota_002_pos.ksh
tests/zfs-tests/tests/functional/quota/quota_003_pos.ksh
tests/zfs-tests/tests/functional/quota/quota_004_pos.ksh
tests/zfs-tests/tests/functional/quota/quota_005_pos.ksh
tests/zfs-tests/tests/functional/quota/quota_006_neg.ksh
tests/zfs-tests/tests/functional/raidz/raidz_001_neg.ksh
tests/zfs-tests/tests/functional/raidz/raidz_002_pos.ksh
tests/zfs-tests/tests/functional/redundancy/redundancy.kshlib
tests/zfs-tests/tests/functional/redundancy/redundancy_004_neg.ksh
tests/zfs-tests/tests/functional/refquota/refquota_001_pos.ksh
tests/zfs-tests/tests/functional/refquota/refquota_002_pos.ksh
tests/zfs-tests/tests/functional/refquota/refquota_003_pos.ksh
tests/zfs-tests/tests/functional/refquota/refquota_004_pos.ksh
tests/zfs-tests/tests/functional/refquota/refquota_005_pos.ksh
tests/zfs-tests/tests/functional/refquota/refquota_006_neg.ksh
tests/zfs-tests/tests/functional/refreserv/refreserv_001_pos.ksh
tests/zfs-tests/tests/functional/refreserv/refreserv_002_pos.ksh
tests/zfs-tests/tests/functional/refreserv/refreserv_003_pos.ksh
tests/zfs-tests/tests/functional/refreserv/refreserv_004_pos.ksh
tests/zfs-tests/tests/functional/refreserv/refreserv_005_pos.ksh
tests/zfs-tests/tests/functional/rename_dirs/rename_dirs_001_pos.ksh
tests/zfs-tests/tests/functional/replacement/replacement_001_pos.ksh
tests/zfs-tests/tests/functional/replacement/replacement_002_pos.ksh
tests/zfs-tests/tests/functional/replacement/replacement_003_pos.ksh
tests/zfs-tests/tests/functional/reservation/reservation.shlib
tests/zfs-tests/tests/functional/reservation/reservation_001_pos.sh
tests/zfs-tests/tests/functional/reservation/reservation_002_pos.sh
tests/zfs-tests/tests/functional/reservation/reservation_003_pos.sh
tests/zfs-tests/tests/functional/reservation/reservation_004_pos.sh
tests/zfs-tests/tests/functional/reservation/reservation_005_pos.sh
tests/zfs-tests/tests/functional/reservation/reservation_006_pos.sh
tests/zfs-tests/tests/functional/reservation/reservation_007_pos.sh
tests/zfs-tests/tests/functional/reservation/reservation_008_pos.sh
tests/zfs-tests/tests/functional/reservation/reservation_009_pos.sh
tests/zfs-tests/tests/functional/reservation/reservation_010_pos.sh
tests/zfs-tests/tests/functional/reservation/reservation_011_pos.sh
tests/zfs-tests/tests/functional/reservation/reservation_012_pos.sh
tests/zfs-tests/tests/functional/reservation/reservation_013_pos.sh
tests/zfs-tests/tests/functional/reservation/reservation_014_pos.sh
tests/zfs-tests/tests/functional/reservation/reservation_015_pos.sh
tests/zfs-tests/tests/functional/reservation/reservation_016_pos.sh
tests/zfs-tests/tests/functional/reservation/reservation_017_pos.sh
tests/zfs-tests/tests/functional/reservation/reservation_018_pos.sh
tests/zfs-tests/tests/functional/rootpool/rootpool_002_neg.ksh
tests/zfs-tests/tests/functional/rootpool/rootpool_003_neg.ksh
tests/zfs-tests/tests/functional/rootpool/rootpool_007_neg.ksh
tests/zfs-tests/tests/functional/rsend/cleanup.ksh
tests/zfs-tests/tests/functional/rsend/rsend.cfg
tests/zfs-tests/tests/functional/rsend/rsend.kshlib
tests/zfs-tests/tests/functional/rsend/rsend_001_pos.ksh
tests/zfs-tests/tests/functional/rsend/rsend_002_pos.ksh
tests/zfs-tests/tests/functional/rsend/rsend_003_pos.ksh
tests/zfs-tests/tests/functional/rsend/rsend_004_pos.ksh
tests/zfs-tests/tests/functional/rsend/rsend_005_pos.ksh
tests/zfs-tests/tests/functional/rsend/rsend_006_pos.ksh
tests/zfs-tests/tests/functional/rsend/rsend_007_pos.ksh
tests/zfs-tests/tests/functional/rsend/rsend_008_pos.ksh
tests/zfs-tests/tests/functional/rsend/rsend_009_pos.ksh
tests/zfs-tests/tests/functional/rsend/rsend_010_pos.ksh
tests/zfs-tests/tests/functional/rsend/rsend_011_pos.ksh
tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh
tests/zfs-tests/tests/functional/rsend/rsend_013_pos.ksh
tests/zfs-tests/tests/functional/rsend/rsend_014_pos.ksh
tests/zfs-tests/tests/functional/rsend/rsend_019_pos.ksh
tests/zfs-tests/tests/functional/rsend/rsend_020_pos.ksh
tests/zfs-tests/tests/functional/rsend/rsend_021_pos.ksh
tests/zfs-tests/tests/functional/rsend/rsend_022_pos.ksh
tests/zfs-tests/tests/functional/rsend/rsend_024_pos.ksh
tests/zfs-tests/tests/functional/rsend/setup.ksh
tests/zfs-tests/tests/functional/scrub_mirror/cleanup.ksh
tests/zfs-tests/tests/functional/scrub_mirror/default.cfg
tests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_common.kshlib
tests/zfs-tests/tests/functional/slog/cleanup.ksh
tests/zfs-tests/tests/functional/slog/setup.ksh
tests/zfs-tests/tests/functional/slog/slog.kshlib
tests/zfs-tests/tests/functional/slog/slog_001_pos.ksh
tests/zfs-tests/tests/functional/slog/slog_002_pos.ksh
tests/zfs-tests/tests/functional/slog/slog_003_pos.ksh
tests/zfs-tests/tests/functional/slog/slog_004_pos.ksh
tests/zfs-tests/tests/functional/slog/slog_005_pos.ksh
tests/zfs-tests/tests/functional/slog/slog_006_pos.ksh
tests/zfs-tests/tests/functional/slog/slog_007_pos.ksh
tests/zfs-tests/tests/functional/slog/slog_008_neg.ksh
tests/zfs-tests/tests/functional/slog/slog_009_neg.ksh
tests/zfs-tests/tests/functional/slog/slog_010_neg.ksh
tests/zfs-tests/tests/functional/slog/slog_011_neg.ksh
tests/zfs-tests/tests/functional/slog/slog_012_neg.ksh
tests/zfs-tests/tests/functional/slog/slog_013_pos.ksh
tests/zfs-tests/tests/functional/slog/slog_014_pos.ksh
tests/zfs-tests/tests/functional/slog/slog_015_pos.ksh
tests/zfs-tests/tests/functional/snapshot/clone_001_pos.ksh
tests/zfs-tests/tests/functional/snapshot/rollback_001_pos.ksh
tests/zfs-tests/tests/functional/snapshot/rollback_002_pos.ksh
tests/zfs-tests/tests/functional/snapshot/rollback_003_pos.ksh
tests/zfs-tests/tests/functional/snapshot/snapshot_001_pos.ksh
tests/zfs-tests/tests/functional/snapshot/snapshot_002_pos.ksh
tests/zfs-tests/tests/functional/snapshot/snapshot_003_pos.ksh
tests/zfs-tests/tests/functional/snapshot/snapshot_004_pos.ksh
tests/zfs-tests/tests/functional/snapshot/snapshot_005_pos.ksh
tests/zfs-tests/tests/functional/snapshot/snapshot_006_pos.ksh
tests/zfs-tests/tests/functional/snapshot/snapshot_007_pos.ksh
tests/zfs-tests/tests/functional/snapshot/snapshot_008_pos.ksh
tests/zfs-tests/tests/functional/snapshot/snapshot_009_pos.ksh
tests/zfs-tests/tests/functional/snapshot/snapshot_010_pos.ksh
tests/zfs-tests/tests/functional/snapshot/snapshot_011_pos.ksh
tests/zfs-tests/tests/functional/snapshot/snapshot_012_pos.ksh
tests/zfs-tests/tests/functional/snapshot/snapshot_013_pos.ksh
tests/zfs-tests/tests/functional/snapshot/snapshot_014_pos.ksh
tests/zfs-tests/tests/functional/snapshot/snapshot_015_pos.ksh
tests/zfs-tests/tests/functional/snapshot/snapshot_016_pos.ksh
tests/zfs-tests/tests/functional/snapshot/snapshot_017_pos.ksh
tests/zfs-tests/tests/functional/snapused/snapused.kshlib
tests/zfs-tests/tests/functional/snapused/snapused_001_pos.ksh
tests/zfs-tests/tests/functional/snapused/snapused_002_pos.ksh
tests/zfs-tests/tests/functional/snapused/snapused_003_pos.ksh
tests/zfs-tests/tests/functional/snapused/snapused_004_pos.ksh
tests/zfs-tests/tests/functional/snapused/snapused_005_pos.ksh
tests/zfs-tests/tests/functional/sparse/sparse.cfg
tests/zfs-tests/tests/functional/sparse/sparse_001_pos.ksh
tests/zfs-tests/tests/functional/threadsappend/threadsappend_001_pos.ksh
tests/zfs-tests/tests/functional/truncate/truncate.cfg
tests/zfs-tests/tests/functional/truncate/truncate_001_pos.ksh
tests/zfs-tests/tests/functional/truncate/truncate_002_pos.ksh
tests/zfs-tests/tests/functional/upgrade/cleanup.ksh
tests/zfs-tests/tests/functional/upgrade/setup.ksh
tests/zfs-tests/tests/functional/upgrade/upgrade_userobj_001_pos.ksh
tests/zfs-tests/tests/functional/userquota/cleanup.ksh
tests/zfs-tests/tests/functional/userquota/groupspace_001_pos.ksh
tests/zfs-tests/tests/functional/userquota/groupspace_002_pos.ksh
tests/zfs-tests/tests/functional/userquota/groupspace_003_pos.ksh
tests/zfs-tests/tests/functional/userquota/setup.ksh
tests/zfs-tests/tests/functional/userquota/userquota_001_pos.ksh
tests/zfs-tests/tests/functional/userquota/userquota_002_pos.ksh
tests/zfs-tests/tests/functional/userquota/userquota_003_pos.ksh
tests/zfs-tests/tests/functional/userquota/userquota_004_pos.ksh
tests/zfs-tests/tests/functional/userquota/userquota_005_neg.ksh
tests/zfs-tests/tests/functional/userquota/userquota_006_pos.ksh
tests/zfs-tests/tests/functional/userquota/userquota_007_pos.ksh
tests/zfs-tests/tests/functional/userquota/userquota_008_pos.ksh
tests/zfs-tests/tests/functional/userquota/userquota_009_pos.ksh
tests/zfs-tests/tests/functional/userquota/userquota_010_pos.ksh
tests/zfs-tests/tests/functional/userquota/userquota_011_pos.ksh
tests/zfs-tests/tests/functional/userquota/userquota_012_neg.ksh
tests/zfs-tests/tests/functional/userquota/userquota_013_pos.ksh
tests/zfs-tests/tests/functional/userquota/userquota_common.kshlib
tests/zfs-tests/tests/functional/userquota/userspace_001_pos.ksh
tests/zfs-tests/tests/functional/userquota/userspace_002_pos.ksh
tests/zfs-tests/tests/functional/userquota/userspace_003_pos.ksh
tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps.kshlib
tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_001_pos.ksh
tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_002_pos.ksh
tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_003_pos.ksh
tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_004_pos.ksh
tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_005_pos.ksh
tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_006_pos.ksh
tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_007_pos.ksh
tests/zfs-tests/tests/functional/write_dirs/write_dirs.cfg
tests/zfs-tests/tests/functional/write_dirs/write_dirs_001_pos.ksh
tests/zfs-tests/tests/functional/write_dirs/write_dirs_002_pos.ksh
tests/zfs-tests/tests/functional/xattr/cleanup.ksh
tests/zfs-tests/tests/functional/xattr/setup.ksh
tests/zfs-tests/tests/functional/xattr/xattr_001_pos.ksh
tests/zfs-tests/tests/functional/xattr/xattr_002_neg.ksh
tests/zfs-tests/tests/functional/xattr/xattr_003_neg.ksh
tests/zfs-tests/tests/functional/xattr/xattr_004_pos.ksh
tests/zfs-tests/tests/functional/xattr/xattr_005_pos.ksh
tests/zfs-tests/tests/functional/xattr/xattr_006_pos.ksh
tests/zfs-tests/tests/functional/xattr/xattr_007_neg.ksh
tests/zfs-tests/tests/functional/xattr/xattr_008_pos.ksh
tests/zfs-tests/tests/functional/xattr/xattr_009_neg.ksh
tests/zfs-tests/tests/functional/xattr/xattr_010_neg.ksh
tests/zfs-tests/tests/functional/xattr/xattr_011_pos.ksh
tests/zfs-tests/tests/functional/xattr/xattr_012_pos.ksh
tests/zfs-tests/tests/functional/xattr/xattr_013_pos.ksh
tests/zfs-tests/tests/functional/xattr/xattr_common.kshlib
tests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/cleanup.ksh
tests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/setup.ksh
tests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/zvol_ENOSPC.cfg
tests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/zvol_ENOSPC_001_pos.ksh
tests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli.cfg
tests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli_001_pos.ksh
tests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli_002_pos.ksh
tests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli_003_neg.ksh
tests/zfs-tests/tests/functional/zvol/zvol_common.shlib
tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_001_neg.ksh
tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_002_pos.ksh
tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_003_neg.ksh
tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_004_pos.ksh
tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_005_neg.ksh
tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_006_pos.ksh
tests/zfs-tests/tests/functional/zvol/zvol_swap/cleanup.ksh
tests/zfs-tests/tests/functional/zvol/zvol_swap/setup.ksh
tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap.cfg
tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_001_pos.ksh
tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_002_pos.ksh
tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_003_pos.ksh
tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_004_pos.ksh
tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_005_pos.ksh
tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_006_pos.ksh
tests/zfs-tests/tests/perf/perf.shlib
tests/zfs-tests/tests/perf/regression/random_reads.ksh
tests/zfs-tests/tests/perf/regression/random_readwrite.ksh
tests/zfs-tests/tests/perf/regression/random_writes.ksh
tests/zfs-tests/tests/perf/regression/sequential_reads.ksh
tests/zfs-tests/tests/perf/regression/sequential_reads_cached.ksh
tests/zfs-tests/tests/perf/regression/sequential_reads_cached_clone.ksh
tests/zfs-tests/tests/perf/regression/sequential_writes.ksh
tests/zfs-tests/tests/perf/regression/setup.ksh
tests/zfs-tests/tests/perf/scripts/prefetch_io.sh

index 9bdb57abd94722f1e706003e7579145515587d20..1eb3b9b4d74a73e4595825ae0650d563981c971f 100644 (file)
@@ -30,6 +30,7 @@ Makefile.in
 #
 # Top level generated files specific to this top level dir
 #
+/bin
 /configure
 /config.log
 /config.status
diff --git a/config/user-commands.m4 b/config/user-commands.m4
deleted file mode 100644 (file)
index 01dbf34..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-dnl #
-dnl # Commands common to multiple platforms.  They generally behave
-dnl # in the same way and take similar options.
-dnl #
-AC_DEFUN([ZFS_AC_CONFIG_USER_COMMANDS_COMMON], [
-       AC_PATH_TOOL(AWK, awk, "")
-       AC_PATH_TOOL(BASENAME, basename, "")
-       AC_PATH_TOOL(BC, bc, "")
-       AC_PATH_TOOL(BUNZIP2, bunzip2, "")
-       AC_PATH_TOOL(BZCAT, bzcat, "")
-       AC_PATH_TOOL(CAT, cat, "")
-       AC_PATH_TOOL(CD, cd, "cd")              dnl # Builtin in bash
-       AC_PATH_TOOL(CHGRP, chgrp, "")
-       AC_PATH_TOOL(CHMOD, chmod, "")
-       AC_PATH_TOOL(CHOWN, chown, "")
-       AC_PATH_TOOL(CKSUM, cksum, "")
-       AC_PATH_TOOL(CMP, cmp, "")
-       AC_PATH_TOOL(CP, cp, "")
-       AC_PATH_TOOL(CPIO, cpio, "")
-       AC_PATH_TOOL(CUT, cut, "")
-       AC_PATH_TOOL(DATE, date, "")
-       AC_PATH_TOOL(DD, dd, "")
-       AC_PATH_TOOL(DF, df, "")
-       AC_PATH_TOOL(DIFF, diff, "")
-       AC_PATH_TOOL(DIRNAME, dirname, "")
-       AC_PATH_TOOL(DU, du, "")
-       AC_PATH_TOOL(ECHO, echo, "")
-       AC_PATH_TOOL(EGREP, egrep, "")
-       AC_PATH_TOOL(FALSE, false, "")
-       AC_PATH_TOOL(FDISK, fdisk, "")
-       AC_PATH_TOOL(FGREP, fgrep, "")
-       AC_PATH_TOOL(FILE, file, "")
-       AC_PATH_TOOL(FIND, find, "")
-       AC_PATH_TOOL(FIO, fio, "")
-       AC_PATH_TOOL(FSCK, fsck, "")
-       AC_PATH_TOOL(GNUDD, dd, "")
-       AC_PATH_TOOL(GETCONF, getconf, "")
-       AC_PATH_TOOL(GETENT, getent, "")
-       AC_PATH_TOOL(GREP, grep, "")
-       dnl # Due to permissions unpriviledged users may not detect group*.
-       AC_PATH_TOOL(GROUPADD, groupadd, "/usr/sbin/groupadd")
-       AC_PATH_TOOL(GROUPDEL, groupdel, "/usr/sbin/groupdel")
-       AC_PATH_TOOL(GROUPMOD, groupmod, "/usr/sbin/groupmod")
-       AC_PATH_TOOL(HEAD, head, "")
-       AC_PATH_TOOL(HOSTNAME, hostname, "")
-       AC_PATH_TOOL(ID, id, "")
-       AC_PATH_TOOL(KILL, kill, "")
-       AC_PATH_TOOL(KSH, ksh, "")
-       AC_PATH_TOOL(LOGNAME, logname, "")
-       AC_PATH_TOOL(LS, ls, "")
-       AC_PATH_TOOL(MD5SUM, md5sum, "")
-       AC_PATH_TOOL(MKDIR, mkdir, "")
-       AC_PATH_TOOL(MKNOD, mknod, "")
-       AC_PATH_TOOL(MKTEMP, mktemp, "")
-       AC_PATH_TOOL(MODINFO, modinfo, "")
-       AC_PATH_TOOL(MOUNT, mount, "")
-       AC_PATH_TOOL(MV, mv, "")
-       AC_PATH_TOOL(NAWK, nawk, "")
-       AC_PATH_TOOL(PGREP, pgrep, "")
-       AC_PATH_TOOL(PING, ping, "")
-       AC_PATH_TOOL(PKILL, pkill, "")
-       AC_PATH_TOOL(PRINTF, printf, "")
-       AC_PATH_TOOL(PS, ps, "")
-       AC_PATH_TOOL(PYTHON, python, "")
-       AC_PATH_TOOL(REBOOT, reboot, "")
-       AC_PATH_TOOL(RMDIR, rmdir, "")
-       AC_PATH_TOOL(RSH, rsh, "")
-       AC_PATH_TOOL(SED, sed, "")
-       AC_PATH_TOOL(SHUF, shuf, "")
-       AC_PATH_TOOL(SLEEP, sleep, "")
-       AC_PATH_TOOL(SORT, sort, "")
-       AC_PATH_TOOL(STAT, stat, "")
-       AC_PATH_TOOL(STRINGS, strings, "")
-       AC_PATH_TOOL(SU, su, "")
-       AC_PATH_TOOL(SUM, sum, "")
-       AC_PATH_TOOL(SYNC, sync, "")
-       AC_PATH_TOOL(TAIL, tail, "")
-       AC_PATH_TOOL(TAR, tar, "")
-       AC_PATH_TOOL(TIMEOUT, timeout, "")
-       AC_PATH_TOOL(TOUCH, touch, "")
-       AC_PATH_TOOL(TR, tr, "")
-       AC_PATH_TOOL(TRUNCATE, truncate, "")
-       AC_PATH_TOOL(TRUE, true, "")
-       AC_PATH_TOOL(UMASK, umask, "")
-       AC_PATH_TOOL(UMOUNT, umount, "")
-       AC_PATH_TOOL(UNAME, uname, "")
-       AC_PATH_TOOL(UNIQ, uniq, "")
-       dnl # Due to permissions unpriviledged users may not detect user*.
-       AC_PATH_TOOL(USERADD, useradd, "/usr/sbin/useradd")
-       AC_PATH_TOOL(USERDEL, userdel, "/usr/sbin/userdel")
-       AC_PATH_TOOL(USERMOD, usermod, "/usr/sbin/usermod")
-       AC_PATH_TOOL(UUIDGEN, uuidgen, "")
-       AC_PATH_TOOL(WAIT, wait, "wait") dnl # Builtin in bash
-       AC_PATH_TOOL(WC, wc, "")
-])
-
-dnl #
-dnl # Linux commands, used within 'is_linux' blocks of test scripts.
-dnl # These commands may take different command line arguments.
-dnl #
-AC_DEFUN([ZFS_AC_CONFIG_USER_COMMANDS_LINUX], [
-       AC_PATH_TOOL(BLOCKDEV, blockdev, "")
-       AC_PATH_TOOL(CHACL, chacl, "")
-       AC_PATH_TOOL(COMPRESS, gzip, "")
-       AC_PATH_TOOL(FORMAT, parted, "")
-       AC_PATH_TOOL(FREE, free, "")
-       AC_PATH_TOOL(GETFACL, getfacl, "")
-       AC_PATH_TOOL(IOSTAT, iostat, "")
-       AC_PATH_TOOL(LOCKFS, lsof, "")
-       AC_PATH_TOOL(LSBLK, lsblk, "")
-       AC_PATH_TOOL(LSMOD, lsmod, "")
-       AC_PATH_TOOL(LSSCSI, lsscsi, "")
-       AC_PATH_TOOL(MODLOAD, modprobe, "")
-       AC_PATH_TOOL(MODUNLOAD, rmmod, "")
-       AC_PATH_TOOL(MPSTAT, mpstat, "")
-       AC_PATH_TOOL(NEWFS, mke2fs, "")
-       AC_PATH_TOOL(NPROC, nproc, "")
-       AC_PATH_TOOL(PFEXEC, sudo, "")
-       AC_PATH_TOOL(READLINK, readlink, "")
-       AC_PATH_TOOL(SETFACL, setfacl, "")
-       AC_PATH_TOOL(SHARE, exportfs, "")
-       AC_PATH_TOOL(NET, net, "")
-       AC_PATH_TOOL(SWAP, swapon, "")
-       AC_PATH_TOOL(SWAPADD, swapon, "")
-       AC_PATH_TOOL(UDEVADM, udevadm, "")
-       AC_PATH_TOOL(UFSDUMP, dump, "")
-       AC_PATH_TOOL(UFSRESTORE, restore, "")
-       AC_PATH_TOOL(UNCOMPRESS, gunzip, "")
-       AC_PATH_TOOL(UNSHARE, exportfs, "")
-       AC_PATH_TOOL(VMSTAT, vmstat, "")
-
-       PAGESIZE=$($GETCONF PAGESIZE)
-       AC_SUBST(PAGESIZE)
-
-       MNTTAB=/proc/self/mounts
-       AC_SUBST(MNTTAB)
-])
-
-dnl #
-dnl # BSD style commands, these have been kept in case at some point
-dnl # we want to build these packages on a BSD style systems.  Otherwise
-dnl # they are unused and should be treated as such.
-dnl #
-AC_DEFUN([ZFS_AC_CONFIG_USER_COMMANDS_BSD], [
-       AC_PATH_TOOL(COMPRESS, compress, "")
-       AC_PATH_TOOL(COREADM, coreadm, "")
-       AC_PATH_TOOL(DIRCMP, dircmp, "")
-       AC_PATH_TOOL(DUMPADM, dumpadm, "")
-       AC_PATH_TOOL(FORMAT, format, "")
-       AC_PATH_TOOL(GETMAJOR, getmajor, "")
-       AC_PATH_TOOL(KSTAT, kstat, "")
-       AC_PATH_TOOL(LOCKFS, lockfs, "")
-       AC_PATH_TOOL(LOFIADM, lofiadm, "")
-       AC_PATH_TOOL(MODUNLOAD, modunload, "")
-       AC_PATH_TOOL(NEWFS, newfs, "")
-       AC_PATH_TOOL(PAGESIZE, pagesize, "")
-       AC_PATH_TOOL(PFEXEC, pfexec, "")
-       AC_PATH_TOOL(PKGINFO, pkginfo, "")
-       AC_PATH_TOOL(PRTVTOC, prtvtoc, "")
-       AC_PATH_TOOL(PSRINFO, psrinfo, "")
-       AC_PATH_TOOL(SHARE, share, "")
-       AC_PATH_TOOL(SVCADM, svcadm, "")
-       AC_PATH_TOOL(SVCS, svcs, "")
-       AC_PATH_TOOL(SWAP, swap, "")
-       AC_PATH_TOOL(SWAPADD, swapadd, "")
-       AC_PATH_TOOL(UFSDUMP, ufsdump, "")
-       AC_PATH_TOOL(UFSRESTORE, ufsrestore, "")
-       AC_PATH_TOOL(UMOUNTALL, umountall, "")
-       AC_PATH_TOOL(UNCOMPRESS, uncompress, "")
-       AC_PATH_TOOL(UNSHARE, unshare, "")
-       AC_PATH_TOOL(ZONEADM, zoneadm, "")
-       AC_PATH_TOOL(ZONECFG, zonecfg, "")
-       AC_PATH_TOOL(ZONENAME, zonename, "")
-])
-
-AC_DEFUN([ZFS_AC_CONFIG_USER_COMMANDS], [
-       ZFS_AC_CONFIG_USER_COMMANDS_COMMON
-
-       OS=$($UNAME -o)
-       AS_IF([test "$OS" == "GNU/Linux"], [
-               ZFS_AC_CONFIG_USER_COMMANDS_LINUX
-       ], [
-               ZFS_AC_CONFIG_USER_COMMANDS_BSD
-       ])
-])
index 0e3430757ee09e8b79dcd1fc167520f74bad0cae..079e2e73b6e5905725dd1f179f05686a35502447 100644 (file)
@@ -18,7 +18,6 @@ AC_DEFUN([ZFS_AC_CONFIG_USER], [
        ZFS_AC_CONFIG_USER_MAKEDEV_IN_SYSMACROS
        ZFS_AC_CONFIG_USER_MAKEDEV_IN_MKDEV
 
-       ZFS_AC_CONFIG_USER_COMMANDS
        ZFS_AC_TEST_FRAMEWORK
 
        AC_CHECK_FUNCS([mlockall])
index c86a2f63d5ec782d09e18c0906f31ed9a91b23c3..b533126afd10a32714beac4918822258f83506f4 100644 (file)
@@ -167,8 +167,6 @@ AC_CONFIG_FILES([
        tests/zfs-tests/cmd/threadsappend/Makefile
        tests/zfs-tests/cmd/xattrtest/Makefile
        tests/zfs-tests/include/Makefile
-       tests/zfs-tests/include/commands.cfg
-       tests/zfs-tests/include/default.cfg
        tests/zfs-tests/tests/Makefile
        tests/zfs-tests/tests/functional/Makefile
        tests/zfs-tests/tests/functional/acl/Makefile
index 72876a65b2374407785d1f911731d5365a9a689d..fe8f15f3fd9f32e6973392bb14ae2e5b2a7a19c0 100755 (executable)
@@ -29,11 +29,7 @@ else
 echo "Missing helper script ${SCRIPT_COMMON}" && exit 1
 fi
 
-. "$STF_SUITE/include/default.cfg"
-
 PROG=zfs-tests.sh
-SUDO=/usr/bin/sudo
-SETENFORCE=/usr/sbin/setenforce
 VERBOSE=
 QUIET=
 CLEANUP=1
@@ -59,16 +55,16 @@ cleanup() {
        if [ $LOOPBACK -eq 1 ]; then
                for TEST_LOOPBACK in ${LOOPBACKS}; do
                        LOOP_DEV=$(basename "$TEST_LOOPBACK")
-                       DM_DEV=$(${SUDO} "${DMSETUP}" ls 2>/dev/null | \
+                       DM_DEV=$(sudo "${DMSETUP}" ls 2>/dev/null | \
                            grep "${LOOP_DEV}" | cut -f1)
 
                        if [ -n "$DM_DEV" ]; then
-                               ${SUDO} "${DMSETUP}" remove "${DM_DEV}" ||
+                               sudo "${DMSETUP}" remove "${DM_DEV}" ||
                                    echo "Failed to remove: ${DM_DEV}"
                        fi
 
                        if [ -n "${TEST_LOOPBACK}" ]; then
-                               ${SUDO} "${LOSETUP}" -d "${TEST_LOOPBACK}" ||
+                               sudo "${LOSETUP}" -d "${TEST_LOOPBACK}" ||
                                    echo "Failed to remove: ${TEST_LOOPBACK}"
                        fi
                done
@@ -77,6 +73,11 @@ cleanup() {
        for TEST_FILE in ${FILES}; do
                rm -f "${TEST_FILE}" &>/dev/null
        done
+
+       # Preserve in-tree symlinks to aid debugging.
+       if [ -z "${INTREE}" -a -d "$STF_PATH" ]; then
+               rm -Rf "$STF_PATH"
+       fi
 }
 trap cleanup EXIT
 
@@ -88,9 +89,9 @@ trap cleanup EXIT
 #
 cleanup_all() {
        local TEST_POOLS
-       TEST_POOLS=$(${SUDO} "${ZPOOL}" list -H -o name | grep testpool)
+       TEST_POOLS=$(sudo $ZPOOL list -H -o name | grep testpool)
        local TEST_LOOPBACKS
-       TEST_LOOPBACKS=$(${SUDO} "${LOSETUP}" -a|grep file-vdev|cut -f1 -d:)
+       TEST_LOOPBACKS=$(sudo "${LOSETUP}" -a|grep file-vdev|cut -f1 -d:)
        local TEST_FILES
        TEST_FILES=$(ls /var/tmp/file-vdev* 2>/dev/null)
 
@@ -98,21 +99,21 @@ cleanup_all() {
        msg "--- Cleanup ---"
        msg "Removing pool(s):     $(echo "${TEST_POOLS}" | tr '\n' ' ')"
        for TEST_POOL in $TEST_POOLS; do
-               ${SUDO} "${ZPOOL}" destroy "${TEST_POOL}"
+               sudo $ZPOOL destroy "${TEST_POOL}"
        done
 
-       msg "Removing dm(s):       $(${SUDO} "${DMSETUP}" ls |
+       msg "Removing dm(s):       $(sudo "${DMSETUP}" ls |
            grep loop | tr '\n' ' ')"
-       ${SUDO} "${DMSETUP}" remove_all
+       sudo "${DMSETUP}" remove_all
 
        msg "Removing loopback(s): $(echo "${TEST_LOOPBACKS}" | tr '\n' ' ')"
        for TEST_LOOPBACK in $TEST_LOOPBACKS; do
-               ${SUDO} "${LOSETUP}" -d "${TEST_LOOPBACK}"
+               sudo "${LOSETUP}" -d "${TEST_LOOPBACK}"
        done
 
        msg "Removing files(s):    $(echo "${TEST_FILES}" | tr '\n' ' ')"
        for TEST_FILE in $TEST_FILES; do
-               ${SUDO} rm -f "${TEST_FILE}"
+               sudo rm -f "${TEST_FILE}"
        done
 }
 
@@ -151,6 +152,81 @@ find_runfile() {
        echo "$RESULT"
 }
 
+#
+# Symlink file if it appears under any of the given paths.
+#
+create_links() {
+       local dir_list="$1"
+       local file_list="$2"
+
+       [ -n $STF_PATH ] || fail "STF_PATH wasn't correctly set"
+
+       for i in $file_list; do
+               for j in $dir_list; do
+                       [ ! -e "$STF_PATH/$i" ] || continue
+
+                       if [ ! -d "$j/$i" -a -e "$j/$i" ]; then
+                               ln -s $j/$i $STF_PATH/$i || \
+                                   fail "Couldn't link $i"
+                               break
+                       fi
+               done
+
+               [ ! -e $STF_PATH/$i ] && STF_MISSING_BIN="$STF_MISSING_BIN$i "
+       done
+}
+
+#
+# Constrain the path to limit the available binaries to a known set.
+# When running in-tree a top level ./bin/ directory is created for
+# convenience, otherwise a temporary directory is used.
+#
+constrain_path() {
+       . $STF_SUITE/include/commands.cfg
+
+       if [ -n "${INTREE}" ]; then
+               STF_PATH="$BUILDDIR/bin"
+               if [ ! -d "$STF_PATH" ]; then
+                       mkdir "$STF_PATH"
+               fi
+       else
+               SYSTEMDIR=${SYSTEMDIR:-/var/tmp/constrained_path.XXXX}
+               STF_PATH=$(/bin/mktemp -d "$SYSTEMDIR")
+       fi
+
+       STF_MISSING_BIN=""
+       chmod 755 $STF_PATH || fail "Couldn't chmod $STF_PATH"
+
+       # Standard system utilities
+       create_links "/bin /usr/bin /sbin /usr/sbin" "$SYSTEM_FILES"
+
+       if [ -z "${INTREE}" ]; then
+               # Special case links for standard zfs utilities
+               create_links "/bin /usr/bin /sbin /usr/sbin" "$ZFS_FILES"
+
+               # Special case links for zfs test suite utilties
+               create_links "$TESTSDIR/bin" "$ZFSTEST_FILES"
+       else
+               # Special case links for standard zfs utilities
+               DIRS="$(find "$CMDDIR" -type d \( ! -name .deps -a \
+                   ! -name .libs \) -print | tr '\n' ' ')"
+               create_links "$DIRS" "$ZFS_FILES"
+
+               # Special case links for zfs test suite utilties
+               DIRS="$(find "$TESTSDIR" -type d \( ! -name .deps -a \
+                   ! -name .libs \) -print | tr '\n' ' ')"
+               create_links "$DIRS" "$ZFSTEST_FILES"
+       fi
+
+       # Exceptions
+       ln -fs $STF_PATH/awk $STF_PATH/nawk
+       ln -fs /sbin/mkfs.ext2 $STF_PATH/newfs
+       ln -fs $STF_PATH/gzip $STF_PATH/compress
+       ln -fs $STF_PATH/gunzip $STF_PATH/uncompress
+       ln -fs $STF_PATH/exportfs $STF_PATH/share
+       ln -fs $STF_PATH/exportfs $STF_PATH/unshare
+}
+
 #
 # Output a useful usage message.
 #
@@ -312,17 +388,20 @@ if [ "$(sudo whoami)" != "root" ]; then
        fail "Passwordless sudo access required."
 fi
 
+#
+# Constain the available binaries to a known set.
+#
+constrain_path
+
 #
 # Check if ksh exists
 #
-if [ -z "$(which ksh 2>/dev/null)" ]; then
-       fail "This test suite requires ksh."
-fi
+[ -e $STF_PATH/ksh ] || fail "This test suite requires ksh."
 
 #
 # Verify the ZFS module stack if loaded.
 #
-${SUDO} "${ZFS_SH}" &>/dev/null
+sudo "${ZFS_SH}" &>/dev/null
 
 #
 # Attempt to cleanup all previous state for a new test run.
@@ -335,7 +414,7 @@ fi
 # By default preserve any existing pools
 #
 if [ -z "${KEEP}" ]; then
-       KEEP=$(${SUDO} "${ZPOOL}" list -H -o name)
+       KEEP=$(sudo $ZPOOL list -H -o name)
        if [ -z "${KEEP}" ]; then
                KEEP="rpool"
        fi
@@ -343,11 +422,14 @@ fi
 
 __ZFS_POOL_EXCLUDE="$(echo $KEEP | sed ':a;N;s/\n/ /g;ba')"
 
+. $STF_SUITE/include/default.cfg
+
 msg
 msg "--- Configuration ---"
 msg "Runfile:         $RUNFILE"
 msg "STF_TOOLS:       $STF_TOOLS"
 msg "STF_SUITE:       $STF_SUITE"
+msg "STF_PATH:        $STF_PATH"
 
 #
 # No DISKS have been provided so a basic file or loopback based devices
@@ -373,8 +455,8 @@ if [ -z "${DISKS}" ]; then
                check_loop_utils
 
                for TEST_FILE in ${FILES}; do
-                       TEST_LOOPBACK=$(${SUDO} "${LOSETUP}" -f)
-                       ${SUDO} "${LOSETUP}" "${TEST_LOOPBACK}" "${TEST_FILE}" ||
+                       TEST_LOOPBACK=$(sudo "${LOSETUP}" -f)
+                       sudo "${LOSETUP}" "${TEST_LOOPBACK}" "${TEST_FILE}" ||
                            fail "Failed: ${TEST_FILE} -> ${TEST_LOOPBACK}"
                        LOOPBACKS="${LOOPBACKS}${TEST_LOOPBACK} "
                        BASELOOPBACKS=$(basename "$TEST_LOOPBACK")
@@ -389,8 +471,8 @@ NUM_DISKS=$(echo "${DISKS}" | $AWK '{print NF}')
 #
 # Disable SELinux until the ZFS Test Suite has been updated accordingly.
 #
-if [ -x ${SETENFORCE} ]; then
-       ${SUDO} ${SETENFORCE} permissive &>/dev/null
+if [ -x "$STF_PATH/setenforce" ]; then
+       sudo setenforce permissive &>/dev/null
 fi
 
 msg "FILEDIR:         $FILEDIR"
@@ -400,13 +482,16 @@ msg "DISKS:           $DISKS"
 msg "NUM_DISKS:       $NUM_DISKS"
 msg "FILESIZE:        $FILESIZE"
 msg "Keep pool(s):    $KEEP"
+msg "Missing util(s): $STF_MISSING_BIN"
 msg ""
 
 export STF_TOOLS
 export STF_SUITE
+export STF_PATH
 export DISKS
 export KEEP
 export __ZFS_POOL_EXCLUDE
+export PATH=$STF_PATH
 
 msg "${TEST_RUNNER} ${QUIET} -c ${RUNFILE} -i ${STF_SUITE}"
 ${TEST_RUNNER} ${QUIET} -c "${RUNFILE}" -i "${STF_SUITE}"
index b970e4eccce76ef642ce242b7d16565b8e92100a..10aaaf30ea50f3a465ebb54c9f037350da334279 100644 (file)
@@ -94,10 +94,10 @@ function log_must_retry
        while (( $retry > 0 )); do
                "$@" 2>$logfile
                status=$?
-               out="$CAT $logfile"
+               out="cat $logfile"
 
                if (( $status == 0 )); then
-                       $out | $EGREP -i "internal error|assertion failed" \
+                       $out | egrep -i "internal error|assertion failed" \
                                > /dev/null 2>&1
                        # internal error or assertion failed
                        if [[ $? -eq 0 ]]; then
@@ -111,11 +111,11 @@ function log_must_retry
                        fi
                        break
                else
-                       $out | $GREP -i "$expect" > /dev/null 2>&1
+                       $out | grep -i "$expect" > /dev/null 2>&1
                        if (( $? == 0 )); then
                                print -u2 $($out)
                                _printerror "$@" "Retry in $delay seconds"
-                               $SLEEP $delay
+                               sleep $delay
 
                                (( retry=retry - 1 ))
                                (( delay=delay * 2 ))
@@ -189,7 +189,7 @@ function log_neg_expect
 
        "$@" 2>$logfile
        typeset status=$?
-       out="$CAT $logfile"
+       out="cat $logfile"
 
        # unexpected status
        if (( $status == 0 )); then
@@ -208,7 +208,7 @@ function log_neg_expect
                print -u2 $($out)
                _printerror "$@" "unexpectedly exited $status (SEGV)"
        else
-               $out | $EGREP -i "internal error|assertion failed" \
+               $out | egrep -i "internal error|assertion failed" \
                        > /dev/null 2>&1
                # internal error or assertion failed
                if (( $? == 0 )); then
@@ -216,7 +216,7 @@ function log_neg_expect
                        _printerror "$@" "internal error or assertion failure" \
                                " exited $status"
                elif [[ -n $expect ]] ; then
-                       $out | $GREP -i "$expect" > /dev/null 2>&1
+                       $out | grep -i "$expect" > /dev/null 2>&1
                        if (( $? == 0 )); then
                                ret=0
                        else
@@ -253,13 +253,13 @@ function log_pos
 
        "$@" 2>$logfile
        typeset status=$?
-       out="$CAT $logfile"
+       out="cat $logfile"
 
        if (( $status != 0 )) ; then
                print -u2 $($out)
                _printerror "$@" "exited $status"
        else
-               $out | $EGREP -i "internal error|assertion failed" \
+               $out | egrep -i "internal error|assertion failed" \
                        > /dev/null 2>&1
                # internal error or assertion failed
                if [[ $? -eq 0 ]]; then
@@ -452,9 +452,9 @@ function _recursive_output #logfile
 
        while [[ -e $logfile ]]; do
                if [[ -z $2 || $logfile != $1 ]]; then
-                       $CAT $logfile
+                       cat $logfile
                fi
-               $RM -f $logfile
+               rm -f $logfile
                logfile="$logfile.$$"
         done
 }
diff --git a/tests/zfs-tests/include/.gitignore b/tests/zfs-tests/include/.gitignore
deleted file mode 100644 (file)
index 5de1b82..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/commands.cfg
-/default.cfg
diff --git a/tests/zfs-tests/include/commands.cfg b/tests/zfs-tests/include/commands.cfg
new file mode 100644 (file)
index 0000000..0776c53
--- /dev/null
@@ -0,0 +1,156 @@
+#
+# These variables are used by zfs-tests.sh to constrain which utilities
+# may be used by the suite. The suite will create a directory which is
+# the only element of $PATH and create symlinks from that dir to the
+# binaries listed below.
+#
+# Please keep the contents of each variable sorted for ease of reading
+# and maintenance.
+#
+export SYSTEM_FILES='arp
+    awk
+    attr
+    basename
+    bc
+    blockdev
+    bunzip2
+    bzcat
+    cat
+    chattr
+    chgrp
+    chmod
+    chown
+    cksum
+    cmp
+    cp
+    cpio
+    cut
+    date
+    dd
+    df
+    diff
+    dirname
+    du
+    echo
+    egrep
+    exportfs
+    expr
+    false
+    fdisk
+    file
+    find
+    fio
+    getconf
+    getent
+    getfacl
+    grep
+    groupadd
+    groupdel
+    groupmod
+    gunzip
+    gzip
+    head
+    hostname
+    id
+    iostat
+    kill
+    ksh
+    ln
+    logname
+    ls
+    lsblk
+    lsmod
+    lsscsi
+    md5sum
+    mkdir
+    mknod
+    mktemp
+    modprobe
+    mount
+    mpstat
+    mv
+    net
+    openssl
+    parted
+    pax
+    pgrep
+    ping
+    pkill
+    printf
+    ps
+    pwd
+    python
+    quotaon
+    readlink
+    rm
+    rmdir
+    sed
+    seq
+    setenforce
+    setfacl
+    setfattr
+    sh
+    sha256sum
+    shuf
+    sleep
+    sort
+    stat
+    strings
+    su
+    sudo
+    sum
+    swapon
+    sync
+    tail
+    tar
+    timeout
+    touch
+    tr
+    true
+    truncate
+    udevadm
+    umask
+    umount
+    uname
+    useradd
+    userdel
+    usermod
+    uuidgen
+    vmstat
+    wait
+    wc
+    which
+    xargs'
+
+export ZFS_FILES='zdb
+    zfs
+    zhack
+    zinject
+    zpool
+    ztest
+    zpios
+    raidz_test
+    arc_summary.py
+    arcstat.py
+    dbufstat.py
+    zed'
+
+export ZFSTEST_FILES='chg_usr_exec
+    devname2devid
+    dir_rd_update
+    file_check
+    file_trunc
+    file_write
+    largest_file
+    mkbusy
+    mkfile
+    mkfiles
+    mktree
+    mmap_exec
+    mmapwrite
+    randfree_file
+    readmmap
+    rename_dir
+    rm_lnkcnt_zero_file
+    threadsappend
+    xattrtest'
diff --git a/tests/zfs-tests/include/commands.cfg.in b/tests/zfs-tests/include/commands.cfg.in
deleted file mode 100644 (file)
index 39266d2..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-export AWK="@AWK@"
-export BLOCKDEV="@BLOCKDEV@"
-export BASENAME="@BASENAME@"
-export BC="@BC@"
-export BUNZIP2="@BUNZIP2@"
-export BZCAT="@BZCAT@"
-export CAT="@CAT@"
-export CD="@CD@"
-export CHACL="@CHACL@"
-export CHGRP="@CHGRP@"
-export CHMOD="@CHMOD@"
-export CHOWN="@CHOWN@"
-export CKSUM="@CKSUM@"
-export CMP="@CMP@"
-export COMPRESS="@COMPRESS@"
-export COREADM="@COREADM@"
-export CP="@CP@"
-export CPIO="@CPIO@"
-export CUT="@CUT@"
-export DATE="@DATE@"
-export DD="@DD@"
-export DF="@DF@"
-export DIFF="@DIFF@"
-export DIRCMP="@DIRCMP@"
-export DIRNAME="@DIRNAME@"
-export DU="@DU@"
-export DUMPADM="@DUMPADM@"
-export ECHO="@ECHO@"
-export EGREP="@EGREP@"
-export FALSE="@FALSE@"
-export FDISK="@FDISK@"
-export FGREP="@FGREP@"
-export FILE="@FILE@"
-export FIND="@FIND@"
-export FIO="@FIO@"
-export FORMAT="@FORMAT@"
-export FREE="@FREE@"
-export FSCK="@FSCK@"
-export GETENT="@GETENT@"
-export GETFACL="@GETFACL@"
-export GETMAJOR="@GETMAJOR@"
-export GNUDD="@GNUDD@"
-export GREP="@GREP@"
-export GROUPADD="@GROUPADD@"
-export GROUPDEL="@GROUPDEL@"
-export GROUPMOD="@GROUPMOD@"
-export HEAD="@HEAD@"
-export HOSTNAME="@HOSTNAME@"
-export ID="@ID@"
-export IOSTAT="@IOSTAT@"
-export KILL="@KILL@"
-export KSH="@KSH@"
-export KSTAT="@KSTAT@"
-export LOCKFS="@LOCKFS@"
-export LOFIADM="@LOFIADM@"
-export LOGNAME="@LOGNAME@"
-export LS="@LS@"
-export LSBLK="@LSBLK@"
-export LSMOD="@LSMOD@"
-export LSSCSI="@LSSCSI@"
-export MD5SUM="@MD5SUM@"
-export MKDIR="@MKDIR@"
-export MKNOD="@MKNOD@"
-export MKTEMP="@MKTEMP@"
-export MNTTAB="@MNTTAB@"
-export MODINFO="@MODINFO@"
-export MODLOAD="@MODLOAD@"
-export MODUNLOAD="@MODUNLOAD@"
-export MOUNT="@MOUNT@"
-export MPSTAT="@MPSTAT@"
-export MV="@MV@"
-export NAWK="@AWK@"
-export NET="@NET@"
-export NEWFS="@NEWFS@"
-export NPROC="@NPROC@"
-export PAGESIZE="@PAGESIZE@"
-export PFEXEC="@PFEXEC@"
-export PGREP="@PGREP@"
-export PING="@PING@"
-export PKGINFO="@PKGINFO@"
-export PKILL="@PKILL@"
-export PRINTF="@PRINTF@"
-export PRTVTOC="@PRTVTOC@"
-export PS="@PS@"
-export PSRINFO="@PSRINFO@"
-export PYTHON="@PYTHON@"
-export READLINK="@READLINK@"
-export REBOOT="@REBOOT@"
-export RM="@RM@"
-export RMDIR="@RMDIR@"
-export RSH="@RSH@"
-export SED="@SED@"
-export SETFACL="@SETFACL@"
-export SHARE="@SHARE@"
-export SHUF="@SHUF@"
-export SLEEP="@SLEEP@"
-export SORT="@SORT@"
-export STAT="@STAT@"
-export STRINGS="@STRINGS@"
-export SU="@SU@"
-export SUM="@SUM@"
-export SVCADM="@SVCADM@"
-export SVCS="@SVCS@"
-export SWAP="@SWAP@"
-export SWAPADD="@SWAPADD@"
-export SYNC="@SYNC@"
-export TAIL="@TAIL@"
-export TAR="@TAR@"
-export TIMEOUT="@TIMEOUT@"
-export TOUCH="@TOUCH@"
-export TR="@TR@"
-export TRUNCATE="@TRUNCATE@"
-export TRUE="@TRUE@"
-export UDEVADM="@UDEVADM@"
-export UFSDUMP="@UFSDUMP@"
-export UFSRESTORE="@UFSRESTORE@"
-export UMASK="@UMASK@"
-export UMOUNT="@UMOUNT@"
-export UMOUNTALL="@UMOUNTALL@"
-export UNAME="@UNAME@"
-export UNCOMPRESS="@UNCOMPRESS@"
-export UNIQ="@UNIQ@"
-export UNSHARE="@UNSHARE@"
-export USERADD="@USERADD@"
-export USERDEL="@USERDEL@"
-export USERMOD="@USERMOD@"
-export UUIDGEN="@UUIDGEN@"
-export VMSTAT="@VMSTAT@"
-export WAIT="@WAIT@"
-export WC="@WC@"
-export ZONEADM="@ZONEADM@"
-export ZONECFG="@ZONECFG@"
-export ZONENAME="@ZONENAME@"
diff --git a/tests/zfs-tests/include/default.cfg b/tests/zfs-tests/include/default.cfg
new file mode 100644 (file)
index 0000000..63104a8
--- /dev/null
@@ -0,0 +1,188 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+# Copyright (c) 2017 Lawrence Livermore National Security, LLC.
+#
+
+. $STF_SUITE/include/commands.cfg
+. $STF_SUITE/include/libtest.shlib
+
+# ZFS Directories
+export ZEDLETDIR=${ZEDLETDIR:-/etc/zfs/zed.d}
+
+# Define run length constants
+export RT_LONG="3"
+export RT_MEDIUM="2"
+export RT_SHORT="1"
+
+# Define macro for zone test
+export ZONE_POOL="zonepool"
+export ZONE_CTR="zonectr"
+
+# ensure we're running in the C locale, since
+# localised messages may result in test failures
+export LC_ALL="C"
+export LANG="C"
+
+#
+# pattern to ignore from 'zpool list'.
+#
+export NO_POOLS="no pools available"
+
+# pattern to ignore from 'zfs list'.
+export NO_DATASETS="no datasets available"
+
+export TEST_BASE_DIR="/var/tmp"
+
+# Default to compression ON
+export COMPRESSION_PROP=on
+
+# Default to using the checksum
+export CHECKSUM_PROP=on
+
+# some common variables used by test scripts :
+export FIO_SCRIPTS=$STF_SUITE/tests/perf/fio
+export PERF_SCRIPTS=$STF_SUITE/tests/perf/scripts
+
+# some test pool names
+export TESTPOOL=testpool.$$
+export TESTPOOL1=testpool1.$$
+export TESTPOOL2=testpool2.$$
+export TESTPOOL3=testpool3.$$
+export PERFPOOL=perfpool
+
+# some test file system names
+export TESTFS=testfs.$$
+export TESTFS1=testfs1.$$
+export TESTFS2=testfs2.$$
+export TESTFS3=testfs3.$$
+
+# some test directory names
+export TESTDIR=${TEST_BASE_DIR%%/}/testdir$$
+export TESTDIR0=${TEST_BASE_DIR%%/}/testdir0$$
+export TESTDIR1=${TEST_BASE_DIR%%/}/testdir1$$
+export TESTDIR2=${TEST_BASE_DIR%%/}/testdir2$$
+
+# some temp files
+export TEMPFILE=${TEST_BASE_DIR%%/}/tempfile$$
+export TEMPFILE0=${TEST_BASE_DIR%%/}/tempfile0$$
+export TEMPFILE1=${TEST_BASE_DIR%%/}/tempfile1$$
+export TEMPFILE2=${TEST_BASE_DIR%%/}/tempfile2$$
+
+export ZFSROOT=
+
+export TESTSNAP=testsnap$$
+export TESTSNAP1=testsnap1$$
+export TESTSNAP2=testsnap2$$
+export TESTCLONE=testclone$$
+export TESTCLONE1=testclone1$$
+export TESTCLONE2=testclone2$$
+export TESTCLCT=testclct$$
+export TESTCTR=testctr$$
+export TESTCTR1=testctr1$$
+export TESTCTR2=testctr2$$
+export TESTVOL=testvol$$
+export TESTVOL1=testvol1$$
+export TESTVOL2=testvol2$$
+export TESTFILE0=testfile0.$$
+export TESTFILE1=testfile1.$$
+export TESTFILE2=testfile2.$$
+export TESTBKMARK=testbkmark$$
+
+export LONGPNAME="poolname50charslong_012345678901234567890123456789"
+export LONGFSNAME="fsysname50charslong_012345678901234567890123456789"
+export SNAPFS="$TESTPOOL/$TESTFS@$TESTSNAP"
+export SNAPFS1="$TESTPOOL/$TESTVOL@$TESTSNAP"
+
+export VOLSIZE=150m
+export BIGVOLSIZE=1eb
+
+# Default to limit disks to be checked
+export MAX_FINDDISKSNUM=6
+
+# Default minimum size for file based vdevs in the test suite
+export MINVDEVSIZE=$((256 * 1024 * 1024))
+
+# Minimum vdev size possible as defined in the OS
+export SPA_MINDEVSIZE=$((64 * 1024 * 1024))
+
+# For iscsi target support
+export ISCSITGTFILE=/tmp/iscsitgt_file
+export ISCSITGT_FMRI=svc:/system/iscsitgt:default
+if ! is_linux; then
+export AUTO_SNAP=$(svcs -a | grep auto-snapshot | grep online | awk \
+    '{print $3}')
+fi
+
+#
+# finally, if we're running in a local zone
+# we take some additional actions
+if ! is_global_zone; then
+       reexport_pool
+fi
+
+export ZFS_VERSION=5
+export ZFS_ALL_VERSIONS="1 2 3 4 5"
+
+for i in $ZFS_ALL_VERSIONS; do
+       eval 'export ZFS_VERSION_$i="v${i}-fs"'
+done
+
+export MAX_PARTITIONS=8
+
+if is_linux; then
+       unpack_opts="--sparse -xf"
+       pack_opts="--sparse -cf"
+       verbose=" -v"
+       unpack_preserve=" -xpf"
+       pack_preserve=" -cpf"
+
+       ZVOL_DEVDIR="/dev/zvol"
+       ZVOL_RDEVDIR="/dev/zvol"
+       DEV_RDSKDIR="/dev"
+       DEV_MPATHDIR="/dev/mapper"
+       ZEDLET_DIR="/var/tmp/zed"
+
+       NEWFS_DEFAULT_FS="ext2"
+else
+       unpack_opts="xv"
+       pack_opts="cf"
+       verbose="v"
+       unpack_preserve="xpf"
+       pack_preserve="cpf"
+
+       ZVOL_DEVDIR="/dev/zvol/dsk"
+       ZVOL_RDEVDIR="/dev/zvol/rdsk"
+       DEV_DSKDIR="/dev/dsk"
+       DEV_RDSKDIR="/dev/rdsk"
+
+       NEWFS_DEFAULT_FS="ufs"
+fi
+export unpack_opts pack_opts verbose unpack_preserve pack_preserve \
+       ZVOL_DEVDIR ZVOL_RDEVDIR NEWFS_DEFAULT_FS DEV_RDSKDIR DEV_MPATHDIR \
+       ZEDLET_DIR
diff --git a/tests/zfs-tests/include/default.cfg.in b/tests/zfs-tests/include/default.cfg.in
deleted file mode 100644 (file)
index 4df1d84..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-#
-# Copyright (c) 2016 by Delphix. All rights reserved.
-# Copyright (c) 2017 Lawrence Livermore National Security, LLC.
-#
-
-. $STF_SUITE/include/commands.cfg
-
-# Common paths
-bindir=@bindir@
-sbindir=@sbindir@
-etcdir=@sysconfdir@
-
-# ZFS Directories
-export ZEDLETDIR=${ZEDLETDIR:-${etcdir}/zfs/zed.d}
-
-# ZFS Commands
-export ZDB=${ZDB:-${sbindir}/zdb}
-export ZFS=${ZFS:-${sbindir}/zfs}
-export ZHACK=${ZHACK:-${sbindir}/zhack}
-export ZINJECT=${ZINJECT:-${sbindir}/zinject}
-export ZPOOL=${ZPOOL:-${sbindir}/zpool}
-export ZTEST=${ZTEST:-${sbindir}/ztest}
-export ZPIOS=${ZPIOS:-${sbindir}/zpios}
-export RAIDZ_TEST=${RAIDZ_TEST:-${bindir}/raidz_test}
-export ARC_SUMMARY=${ARC_SUMMARY:-${bindir}/arc_summary.py}
-export ARCSTAT=${ARCSTAT:-${bindir}/arcstat.py}
-export DBUFSTAT=${DBUFSTAT:-${bindir}/dbufstat.py}
-export ZED=${ZED:-${sbindir}/zed}
-
-. $STF_SUITE/include/libtest.shlib
-
-# Optionally override the installed ZFS commands to run in-tree
-if [[ -f "$SRCDIR/zfs-script-config.sh" ]]; then
-       . $SRCDIR/zfs-script-config.sh
-fi
-
-# Define run length constants
-export RT_LONG="3"
-export RT_MEDIUM="2"
-export RT_SHORT="1"
-
-# Define macro for zone test
-export ZONE_POOL="zonepool"
-export ZONE_CTR="zonectr"
-
-# Test Suite Specific Commands
-helperdir=@datarootdir@/@PACKAGE@/zfs-tests/bin
-export CHG_USR_EXEC=${CHG_USR_EXEC:-${helperdir}/chg_usr_exec}
-export DEVNAME2DEVID=${DEVNAME2DEVID:-${helperdir}/devname2devid}
-export DIR_RD_UPDATE=${DIR_RD_UPDATE:-${helperdir}/dir_rd_update}
-export FILE_CHECK=${FILE_CHECK:-${helperdir}/file_check}
-export FILE_TRUNC=${FILE_TRUNC:-${helperdir}/file_trunc}
-export FILE_WRITE=${FILE_WRITE:-${helperdir}/file_write}
-export LARGEST_FILE=${LARGEST_FILE:-${helperdir}/largest_file}
-export MKBUSY=${MKBUSY:-${helperdir}/mkbusy}
-export MKFILE=${MKFILE:-${helperdir}/mkfile}
-export MKFILES=${MKFILES:-${helperdir}/mkfiles}
-export MKTREE=${MKTREE:-${helperdir}/mktree}
-export MMAP_EXEC=${MMAP_EXEC:-${helperdir}/mmap_exec}
-export MMAPWRITE=${MMAPWRITE:-${helperdir}/mmapwrite}
-export RANDFREE_FILE=${RANDFREE_FILE:-${helperdir}/randfree_file}
-export READMMAP=${READMMAP:-${helperdir}/readmmap}
-export RENAME_DIR=${RENAME_DIR:-${helperdir}/rename_dir}
-export RM_LNKCNT_ZERO_FILE=${RM_LNKCNT_ZERO_FILE:-${helperdir}/rm_lnkcnt_zero_file}
-export THREADSAPPEND=${THREADSAPPEND:-${helperdir}/threadsappend}
-export XATTRTEST=${XATTRTEST:-${helperdir}/xattrtest}
-
-# ensure we're running in the C locale, since
-# localised messages may result in test failures
-export LC_ALL="C"
-export LANG="C"
-
-#
-# pattern to ignore from 'zpool list'.
-#
-export NO_POOLS="no pools available"
-
-# pattern to ignore from 'zfs list'.
-export NO_DATASETS="no datasets available"
-
-export TEST_BASE_DIR="/var/tmp"
-
-# Default to compression ON
-export COMPRESSION_PROP=on
-
-# Default to using the checksum
-export CHECKSUM_PROP=on
-
-# some common variables used by test scripts :
-export FIO_SCRIPTS=$STF_SUITE/tests/perf/fio
-export PERF_SCRIPTS=$STF_SUITE/tests/perf/scripts
-
-# some test pool names
-export TESTPOOL=testpool.$$
-export TESTPOOL1=testpool1.$$
-export TESTPOOL2=testpool2.$$
-export TESTPOOL3=testpool3.$$
-export PERFPOOL=perfpool
-
-# some test file system names
-export TESTFS=testfs.$$
-export TESTFS1=testfs1.$$
-export TESTFS2=testfs2.$$
-export TESTFS3=testfs3.$$
-
-# some test directory names
-export TESTDIR=${TEST_BASE_DIR%%/}/testdir$$
-export TESTDIR0=${TEST_BASE_DIR%%/}/testdir0$$
-export TESTDIR1=${TEST_BASE_DIR%%/}/testdir1$$
-export TESTDIR2=${TEST_BASE_DIR%%/}/testdir2$$
-
-# some temp files
-export TEMPFILE=${TEST_BASE_DIR%%/}/tempfile$$
-export TEMPFILE0=${TEST_BASE_DIR%%/}/tempfile0$$
-export TEMPFILE1=${TEST_BASE_DIR%%/}/tempfile1$$
-export TEMPFILE2=${TEST_BASE_DIR%%/}/tempfile2$$
-
-export ZFSROOT=
-
-export TESTSNAP=testsnap$$
-export TESTSNAP1=testsnap1$$
-export TESTSNAP2=testsnap2$$
-export TESTCLONE=testclone$$
-export TESTCLONE1=testclone1$$
-export TESTCLONE2=testclone2$$
-export TESTCLCT=testclct$$
-export TESTCTR=testctr$$
-export TESTCTR1=testctr1$$
-export TESTCTR2=testctr2$$
-export TESTVOL=testvol$$
-export TESTVOL1=testvol1$$
-export TESTVOL2=testvol2$$
-export TESTFILE0=testfile0.$$
-export TESTFILE1=testfile1.$$
-export TESTFILE2=testfile2.$$
-export TESTBKMARK=testbkmark$$
-
-export LONGPNAME="poolname50charslong_012345678901234567890123456789"
-export LONGFSNAME="fsysname50charslong_012345678901234567890123456789"
-export SNAPFS="$TESTPOOL/$TESTFS@$TESTSNAP"
-export SNAPFS1="$TESTPOOL/$TESTVOL@$TESTSNAP"
-
-export VOLSIZE=150m
-export BIGVOLSIZE=1eb
-
-# Default to limit disks to be checked
-export MAX_FINDDISKSNUM=6
-
-# Default minimum size for file based vdevs in the test suite
-export MINVDEVSIZE=$((256 * 1024 * 1024))
-
-# Minimum vdev size possible as defined in the OS
-export SPA_MINDEVSIZE=$((64 * 1024 * 1024))
-
-# For iscsi target support
-export ISCSITGTFILE=/tmp/iscsitgt_file
-export ISCSITGT_FMRI=svc:/system/iscsitgt:default
-
-#
-# finally, if we're running in a local zone
-# we take some additional actions
-if ! is_global_zone; then
-       reexport_pool
-fi
-
-export ZFS_VERSION=5
-export ZFS_ALL_VERSIONS="1 2 3 4 5"
-
-for i in $ZFS_ALL_VERSIONS; do
-       eval 'export ZFS_VERSION_$i="v${i}-fs"'
-done
-
-export MAX_PARTITIONS=8
-
-if is_linux; then
-       unpack_opts="--sparse -xf"
-       pack_opts="--sparse -cf"
-       verbose=" -v"
-       unpack_preserve=" -xpf"
-       pack_preserve=" -cpf"
-
-       ZVOL_DEVDIR="/dev/zvol"
-       ZVOL_RDEVDIR="/dev/zvol"
-       DEV_RDSKDIR="/dev"
-       DEV_MPATHDIR="/dev/mapper"
-       ZEDLET_DIR="/var/tmp/zed"
-
-       NEWFS_DEFAULT_FS="ext2"
-else
-       unpack_opts="xv"
-       pack_opts="cf"
-       verbose="v"
-       unpack_preserve="xpf"
-       pack_preserve="cpf"
-
-       ZVOL_DEVDIR="/dev/zvol/dsk"
-       ZVOL_RDEVDIR="/dev/zvol/rdsk"
-       DEV_DSKDIR="/dev/dsk"
-       DEV_RDSKDIR="/dev/rdsk"
-
-       NEWFS_DEFAULT_FS="ufs"
-fi
-export unpack_opts pack_opts verbose unpack_preserve pack_preserve \
-       ZVOL_DEVDIR ZVOL_RDEVDIR NEWFS_DEFAULT_FS DEV_RDSKDIR DEV_MPATHDIR \
-       ZEDLET_DIR
index 159b4c79bd6c7f60d773d54c7ce53401f8314e35..4a6a15ec4325ac7bb63e86a29c3f333bc96afa97 100644 (file)
 #
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 # Copyright 2016 Nexenta Systems, Inc.
 # Copyright (c) 2017 Lawrence Livermore National Security, LLC.
 #
 
 . ${STF_TOOLS}/include/logapi.shlib
 
+#
+# Apply constrained path when available.  This is required since the
+# PATH may have been modified by sudo's secure_path behavior.
+#
+if [ -n "$STF_PATH" ]; then
+       PATH="$STF_PATH"
+fi
+
 # Determine if this is a Linux test system
 #
 # Return 0 if platform Linux, 1 if otherwise
 
 function is_linux
 {
-       if [[ $($UNAME -o) == "GNU/Linux" ]]; then
+       if [[ $(uname -o) == "GNU/Linux" ]]; then
                return 0
        else
                return 1
@@ -85,17 +93,17 @@ function ismounted
        case $fstype in
                zfs)
                        if [[ "$1" == "/"* ]] ; then
-                               for out in $($ZFS mount | $AWK '{print $2}'); do
+                               for out in $(zfs mount | awk '{print $2}'); do
                                        [[ $1 == $out ]] && return 0
                                done
                        else
-                               for out in $($ZFS mount | $AWK '{print $1}'); do
+                               for out in $(zfs mount | awk '{print $1}'); do
                                        [[ $1 == $out ]] && return 0
                                done
                        fi
                ;;
                ufs|nfs)
-                       out=$($DF -F $fstype $1 2>/dev/null)
+                       out=$(df -F $fstype $1 2>/dev/null)
                        ret=$?
                        (($ret != 0)) && return $ret
 
@@ -108,14 +116,14 @@ function ismounted
                        [[ "$1" == "$dir" || "$1" == "$name" ]] && return 0
                ;;
                ext2)
-                       out=$($DF -t $fstype $1 2>/dev/null)
+                       out=$(df -t $fstype $1 2>/dev/null)
                        return $?
                ;;
                zvol)
                        if [[ -L "$ZVOL_DEVDIR/$1" ]]; then
                                link=$(readlink -f $ZVOL_DEVDIR/$1)
                                [[ -n "$link" ]] && \
-                                       $MOUNT | $GREP -q "^$link" && \
+                                       mount | grep -q "^$link" && \
                                                return 0
                        fi
                ;;
@@ -154,7 +162,7 @@ function unmounted
 
 function splitline
 {
-       $ECHO $1 | $SED "s/,/ /g"
+       echo $1 | sed "s/,/ /g"
 }
 
 function default_setup
@@ -178,38 +186,37 @@ function default_setup_noexit
                if poolexists $TESTPOOL ; then
                        destroy_pool $TESTPOOL
                fi
-               [[ -d /$TESTPOOL ]] && $RM -rf /$TESTPOOL
-               log_note creating pool $TESTPOOL $disklist
-               log_must $ZPOOL create -f $TESTPOOL $disklist
+               [[ -d /$TESTPOOL ]] && rm -rf /$TESTPOOL
+               log_must zpool create -f $TESTPOOL $disklist
        else
                reexport_pool
        fi
 
-       $RM -rf $TESTDIR  || log_unresolved Could not remove $TESTDIR
-       $MKDIR -p $TESTDIR || log_unresolved Could not create $TESTDIR
+       rm -rf $TESTDIR  || log_unresolved Could not remove $TESTDIR
+       mkdir -p $TESTDIR || log_unresolved Could not create $TESTDIR
 
-       log_must $ZFS create $TESTPOOL/$TESTFS
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       log_must zfs create $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 
        if [[ -n $container ]]; then
-               $RM -rf $TESTDIR1  || \
+               rm -rf $TESTDIR1  || \
                        log_unresolved Could not remove $TESTDIR1
-               $MKDIR -p $TESTDIR1 || \
+               mkdir -p $TESTDIR1 || \
                        log_unresolved Could not create $TESTDIR1
 
-               log_must $ZFS create $TESTPOOL/$TESTCTR
-               log_must $ZFS set canmount=off $TESTPOOL/$TESTCTR
-               log_must $ZFS create $TESTPOOL/$TESTCTR/$TESTFS1
-               log_must $ZFS set mountpoint=$TESTDIR1 \
+               log_must zfs create $TESTPOOL/$TESTCTR
+               log_must zfs set canmount=off $TESTPOOL/$TESTCTR
+               log_must zfs create $TESTPOOL/$TESTCTR/$TESTFS1
+               log_must zfs set mountpoint=$TESTDIR1 \
                    $TESTPOOL/$TESTCTR/$TESTFS1
        fi
 
        if [[ -n $volume ]]; then
                if is_global_zone ; then
-                       log_must $ZFS create -V $VOLSIZE $TESTPOOL/$TESTVOL
+                       log_must zfs create -V $VOLSIZE $TESTPOOL/$TESTVOL
                        block_device_wait
                else
-                       log_must $ZFS create $TESTPOOL/$TESTVOL
+                       log_must zfs create $TESTPOOL/$TESTVOL
                fi
        fi
 }
@@ -268,7 +275,7 @@ function create_snapshot
        datasetexists $fs_vol || \
                log_fail "$fs_vol must exist."
 
-       log_must $ZFS snapshot $fs_vol@$snap
+       log_must zfs snapshot $fs_vol@$snap
 }
 
 #
@@ -287,7 +294,7 @@ function create_clone   # snapshot clone
        [[ -z $clone ]] && \
                log_fail "Clone name is undefined."
 
-       log_must $ZFS clone $snap $clone
+       log_must zfs clone $snap $clone
 }
 
 #
@@ -316,7 +323,7 @@ function create_bookmark
        snapexists $fs_vol@$snap || \
                log_fail "$fs_vol@$snap must exist."
 
-       log_must $ZFS bookmark $fs_vol@$snap $fs_vol#$bkmark
+       log_must zfs bookmark $fs_vol@$snap $fs_vol#$bkmark
 }
 
 function default_mirror_setup
@@ -341,10 +348,10 @@ function default_mirror_setup_noexit
                log_fail "$func: No parameters passed"
        [[ -z $secondary ]] && \
                log_fail "$func: No secondary partition passed"
-       [[ -d /$TESTPOOL ]] && $RM -rf /$TESTPOOL
-       log_must $ZPOOL create -f $TESTPOOL mirror $@
-       log_must $ZFS create $TESTPOOL/$TESTFS
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       [[ -d /$TESTPOOL ]] && rm -rf /$TESTPOOL
+       log_must zpool create -f $TESTPOOL mirror $@
+       log_must zfs create $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 }
 
 #
@@ -361,8 +368,8 @@ function setup_mirrors
        shift
        while ((nmirrors > 0)); do
                log_must test -n "$1" -a -n "$2"
-               [[ -d /$TESTPOOL$nmirrors ]] && $RM -rf /$TESTPOOL$nmirrors
-               log_must $ZPOOL create -f $TESTPOOL$nmirrors mirror $1 $2
+               [[ -d /$TESTPOOL$nmirrors ]] && rm -rf /$TESTPOOL$nmirrors
+               log_must zpool create -f $TESTPOOL$nmirrors mirror $1 $2
                shift 2
                ((nmirrors = nmirrors - 1))
        done
@@ -382,8 +389,8 @@ function setup_raidzs
        shift
        while ((nraidzs > 0)); do
                log_must test -n "$1" -a -n "$2"
-               [[ -d /$TESTPOOL$nraidzs ]] && $RM -rf /$TESTPOOL$nraidzs
-               log_must $ZPOOL create -f $TESTPOOL$nraidzs raidz $1 $2
+               [[ -d /$TESTPOOL$nraidzs ]] && rm -rf /$TESTPOOL$nraidzs
+               log_must zpool create -f $TESTPOOL$nraidzs raidz $1 $2
                shift 2
                ((nraidzs = nraidzs - 1))
        done
@@ -413,10 +420,10 @@ function default_raidz_setup
                log_fail "A raid-z requires a minimum of two disks."
        fi
 
-       [[ -d /$TESTPOOL ]] && $RM -rf /$TESTPOOL
-       log_must $ZPOOL create -f $TESTPOOL raidz $1 $2 $3
-       log_must $ZFS create $TESTPOOL/$TESTFS
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       [[ -d /$TESTPOOL ]] && rm -rf /$TESTPOOL
+       log_must zpool create -f $TESTPOOL raidz $1 $2 $3
+       log_must zfs create $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 
        log_pass
 }
@@ -445,11 +452,10 @@ function default_cleanup_noexit
        # filesystems it contains.
        #
        if is_global_zone; then
-               $ZFS unmount -a > /dev/null 2>&1
-               [[ -z "$KEEP" ]] && KEEP="rpool"
-               exclude=`eval $ECHO \"'(${KEEP})'\"`
-               ALL_POOLS=$($ZPOOL list -H -o name \
-                   | $GREP -v "$NO_POOLS" | $EGREP -vw "$exclude")
+               zfs unmount -a > /dev/null 2>&1
+               exclude=`eval echo \"'(${KEEP})'\"`
+               ALL_POOLS=$(zpool list -H -o name \
+                   | grep -v "$NO_POOLS" | egrep -v "$exclude")
                # Here, we loop through the pools we're allowed to
                # destroy, only destroying them if it's safe to do
                # so.
@@ -461,57 +467,57 @@ function default_cleanup_noexit
                                then
                                        destroy_pool $pool
                                fi
-                               ALL_POOLS=$($ZPOOL list -H -o name \
-                                   | $GREP -v "$NO_POOLS" \
-                                   | $EGREP -v "$exclude")
+                               ALL_POOLS=$(zpool list -H -o name \
+                                   | grep -v "$NO_POOLS" \
+                                   | egrep -v "$exclude")
                        done
                done
 
-               $ZFS mount -a
+               zfs mount -a
        else
                typeset fs=""
-               for fs in $($ZFS list -H -o name \
-                   | $GREP "^$ZONE_POOL/$ZONE_CTR[01234]/"); do
+               for fs in $(zfs list -H -o name \
+                   | grep "^$ZONE_POOL/$ZONE_CTR[01234]/"); do
                        datasetexists $fs && \
-                               log_must $ZFS destroy -Rf $fs
+                               log_must zfs destroy -Rf $fs
                done
 
                # Need cleanup here to avoid garbage dir left.
-               for fs in $($ZFS list -H -o name); do
+               for fs in $(zfs list -H -o name); do
                        [[ $fs == /$ZONE_POOL ]] && continue
-                       [[ -d $fs ]] && log_must $RM -rf $fs/*
+                       [[ -d $fs ]] && log_must rm -rf $fs/*
                done
 
                #
                # Reset the $ZONE_POOL/$ZONE_CTR[01234] file systems property to
                # the default value
                #
-               for fs in $($ZFS list -H -o name); do
+               for fs in $(zfs list -H -o name); do
                        if [[ $fs == $ZONE_POOL/$ZONE_CTR[01234] ]]; then
-                               log_must $ZFS set reservation=none $fs
-                               log_must $ZFS set recordsize=128K $fs
-                               log_must $ZFS set mountpoint=/$fs $fs
+                               log_must zfs set reservation=none $fs
+                               log_must zfs set recordsize=128K $fs
+                               log_must zfs set mountpoint=/$fs $fs
                                typeset enc=""
                                enc=$(get_prop encryption $fs)
                                if [[ $? -ne 0 ]] || [[ -z "$enc" ]] || \
                                        [[ "$enc" == "off" ]]; then
-                                       log_must $ZFS set checksum=on $fs
+                                       log_must zfs set checksum=on $fs
                                fi
-                               log_must $ZFS set compression=off $fs
-                               log_must $ZFS set atime=on $fs
-                               log_must $ZFS set devices=off $fs
-                               log_must $ZFS set exec=on $fs
-                               log_must $ZFS set setuid=on $fs
-                               log_must $ZFS set readonly=off $fs
-                               log_must $ZFS set snapdir=hidden $fs
-                               log_must $ZFS set aclmode=groupmask $fs
-                               log_must $ZFS set aclinherit=secure $fs
+                               log_must zfs set compression=off $fs
+                               log_must zfs set atime=on $fs
+                               log_must zfs set devices=off $fs
+                               log_must zfs set exec=on $fs
+                               log_must zfs set setuid=on $fs
+                               log_must zfs set readonly=off $fs
+                               log_must zfs set snapdir=hidden $fs
+                               log_must zfs set aclmode=groupmask $fs
+                               log_must zfs set aclinherit=secure $fs
                        fi
                done
        fi
 
        [[ -d $TESTDIR ]] && \
-               log_must $RM -rf $TESTDIR
+               log_must rm -rf $TESTDIR
 
        disk1=${DISKS%% *}
        if is_mpath_device $disk1; then
@@ -532,16 +538,16 @@ function default_container_cleanup
 
        ismounted $TESTPOOL/$TESTCTR/$TESTFS1
        [[ $? -eq 0 ]] && \
-           log_must $ZFS unmount $TESTPOOL/$TESTCTR/$TESTFS1
+           log_must zfs unmount $TESTPOOL/$TESTCTR/$TESTFS1
 
        datasetexists $TESTPOOL/$TESTCTR/$TESTFS1 && \
-           log_must $ZFS destroy -R $TESTPOOL/$TESTCTR/$TESTFS1
+           log_must zfs destroy -R $TESTPOOL/$TESTCTR/$TESTFS1
 
        datasetexists $TESTPOOL/$TESTCTR && \
-           log_must $ZFS destroy -Rf $TESTPOOL/$TESTCTR
+           log_must zfs destroy -Rf $TESTPOOL/$TESTCTR
 
        [[ -e $TESTDIR1 ]] && \
-           log_must $RM -rf $TESTDIR1 > /dev/null 2>&1
+           log_must rm -rf $TESTDIR1 > /dev/null 2>&1
 
        default_cleanup
 }
@@ -572,9 +578,9 @@ function destroy_snapshot
                        log_fail "get_prop mountpoint $snap failed."
        fi
 
-       log_must $ZFS destroy $snap
+       log_must zfs destroy $snap
        [[ $mtpt != "" && -d $mtpt ]] && \
-               log_must $RM -rf $mtpt
+               log_must rm -rf $mtpt
 }
 
 #
@@ -598,9 +604,9 @@ function destroy_clone
                        log_fail "get_prop mountpoint $clone failed."
        fi
 
-       log_must $ZFS destroy $clone
+       log_must zfs destroy $clone
        [[ $mtpt != "" && -d $mtpt ]] && \
-               log_must $RM -rf $mtpt
+               log_must rm -rf $mtpt
 }
 
 #
@@ -617,7 +623,7 @@ function destroy_bookmark
                log_fail "'$bkmarkp' does not existed."
        fi
 
-       log_must $ZFS destroy $bkmark
+       log_must zfs destroy $bkmark
 }
 
 # Return 0 if a snapshot exists; $? otherwise
@@ -626,7 +632,7 @@ function destroy_bookmark
 
 function snapexists
 {
-       $ZFS list -H -t snapshot "$1" > /dev/null 2>&1
+       zfs list -H -t snapshot "$1" > /dev/null 2>&1
        return $?
 }
 
@@ -637,7 +643,7 @@ function snapexists
 #
 function bkmarkexists
 {
-       $ZFS list -H -t bookmark "$1" > /dev/null 2>&1
+       zfs list -H -t bookmark "$1" > /dev/null 2>&1
        return $?
 }
 
@@ -662,7 +668,7 @@ function dataset_setprop
                return 1
        fi
        typeset output=
-       output=$($ZFS set $2=$3 $1 2>&1)
+       output=$(zfs set $2=$3 $1 2>&1)
        typeset rv=$?
        if ((rv != 0)); then
                log_note "Setting property on $1 failed."
@@ -694,7 +700,7 @@ function dataset_set_defaultproperties
 
        typeset confset=
        typeset -i found=0
-       for confset in $($ZFS list); do
+       for confset in $(zfs list); do
                if [[ $dataset = $confset ]]; then
                        found=1
                        break
@@ -736,7 +742,7 @@ function zero_partitions #<whole_disk_name>
        typeset i
 
        if is_linux; then
-               log_must $FORMAT $DEV_DSKDIR/$diskname -s -- mklabel gpt
+               log_must parted $DEV_DSKDIR/$diskname -s -- mklabel gpt
        else
                for i in 0 1 3 4 5 6 7
                do
@@ -775,10 +781,10 @@ function set_partition #<slice_num> <slice_start> <size_plus_units>  <whole_disk
 
                # Create GPT partition table when setting slice 0 or
                # when the device doesn't already contain a GPT label.
-               $FORMAT $DEV_DSKDIR/$disk -s -- print 1 >/dev/null
+               parted $DEV_DSKDIR/$disk -s -- print 1 >/dev/null
                typeset ret_val=$?
                if [[ $slicenum -eq 0 || $ret_val -ne 0 ]]; then
-                       log_must $FORMAT $DEV_DSKDIR/$disk -s -- mklabel gpt
+                       log_must parted $DEV_DSKDIR/$disk -s -- mklabel gpt
                fi
 
                # When no start is given align on the first cylinder.
@@ -789,34 +795,35 @@ function set_partition #<slice_num> <slice_start> <size_plus_units>  <whole_disk
                # Determine the cylinder size for the device and using
                # that calculate the end offset in cylinders.
                typeset -i cly_size_kb=0
-               cly_size_kb=$($FORMAT -m $DEV_DSKDIR/$disk -s -- \
-                       unit cyl print | $HEAD -3 | $TAIL -1 | \
-                       $AWK -F '[:k.]' '{print $4}')
+               cly_size_kb=$(parted -m $DEV_DSKDIR/$disk -s -- \
+                       unit cyl print | head -3 | tail -1 | \
+                       awk -F '[:k.]' '{print $4}')
                ((end = (size_mb * 1024 / cly_size_kb) + start))
 
-               log_must $FORMAT $DEV_DSKDIR/$disk -s -- \
+               log_must parted $DEV_DSKDIR/$disk -s -- \
                    mkpart part$slicenum ${start}cyl ${end}cyl
 
-               $BLOCKDEV --rereadpt $DEV_DSKDIR/$disk 2>/dev/null
+               blockdev --rereadpt $DEV_DSKDIR/$disk 2>/dev/null
                block_device_wait
        else
                typeset format_file=/var/tmp/format_in.$$
 
-               $ECHO "partition" >$format_file
-               $ECHO "$slicenum" >> $format_file
-               $ECHO "" >> $format_file
-               $ECHO "" >> $format_file
-               $ECHO "$start" >> $format_file
-               $ECHO "$size" >> $format_file
-               $ECHO "label" >> $format_file
-               $ECHO "" >> $format_file
-               $ECHO "q" >> $format_file
-               $ECHO "q" >> $format_file
+               echo "partition" >$format_file
+               echo "$slicenum" >> $format_file
+               echo "" >> $format_file
+               echo "" >> $format_file
+               echo "$start" >> $format_file
+               echo "$size" >> $format_file
+               echo "label" >> $format_file
+               echo "" >> $format_file
+               echo "q" >> $format_file
+               echo "q" >> $format_file
 
-               $FORMAT -e -s -d $disk -f $format_file
+               format -e -s -d $disk -f $format_file
        fi
+
        typeset ret_val=$?
-       $RM -f $format_file
+       rm -f $format_file
        [[ $ret_val -ne 0 ]] && \
            log_fail "Unable to format $disk slice $slicenum to $size"
        return 0
@@ -832,7 +839,7 @@ function delete_partitions
        typeset -i j=1
 
        if [[ -z $DISK_ARRAY_NUM ]]; then
-               DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
+               DISK_ARRAY_NUM=$(echo ${DISKS} | nawk '{print NF}')
        fi
        if [[ -z $DISKSARRAY ]]; then
                DISKSARRAY=$DISKS
@@ -841,9 +848,10 @@ function delete_partitions
        if is_linux; then
                if (( $DISK_ARRAY_NUM == 1 )); then
                        while ((j < MAX_PARTITIONS)); do
-                               $FORMAT $DEV_DSKDIR/$DISK -s rm $j > /dev/null 2>&1
+                               parted $DEV_DSKDIR/$DISK -s rm $j \
+                                   > /dev/null 2>&1
                                if (( $? == 1 )); then
-                                       $LSBLK | $EGREP ${DISK}${SLICE_PREFIX}${j} > /dev/null
+                                       lsblk | egrep ${DISK}${SLICE_PREFIX}${j} > /dev/null
                                                if (( $? == 1 )); then
                                                        log_note "Partitions for $DISK should be deleted"
                                                else
@@ -851,7 +859,7 @@ function delete_partitions
                                                fi
                                                return 0
                                else
-                                       $LSBLK | $EGREP ${DISK}${SLICE_PREFIX}${j} > /dev/null
+                                       lsblk | egrep ${DISK}${SLICE_PREFIX}${j} > /dev/null
                                                if (( $? == 0 )); then
                                                        log_fail "Partition for ${DISK}${SLICE_PREFIX}${j} not deleted"
                                                fi
@@ -859,11 +867,11 @@ function delete_partitions
                                ((j = j+1))
                        done
                else
-                       for disk in `$ECHO $DISKSARRAY`; do
+                       for disk in `echo $DISKSARRAY`; do
                                while ((j < MAX_PARTITIONS)); do
-                                       $FORMAT $DEV_DSKDIR/$disk -s rm $j > /dev/null 2>&1
+                                       parted $DEV_DSKDIR/$disk -s rm $j > /dev/null 2>&1
                                        if (( $? == 1 )); then
-                                               $LSBLK | $EGREP ${disk}${SLICE_PREFIX}${j} > /dev/null
+                                               lsblk | egrep ${disk}${SLICE_PREFIX}${j} > /dev/null
                                                if (( $? == 1 )); then
                                                        log_note "Partitions for $disk should be deleted"
                                                else
@@ -871,7 +879,7 @@ function delete_partitions
                                                fi
                                                j=7
                                        else
-                                               $LSBLK | $EGREP ${disk}${SLICE_PREFIX}${j} > /dev/null
+                                               lsblk | egrep ${disk}${SLICE_PREFIX}${j} > /dev/null
                                                if (( $? == 0 )); then
                                                        log_fail "Partition for ${disk}${SLICE_PREFIX}${j} not deleted"
                                                fi
@@ -897,10 +905,10 @@ function get_endslice #<disk> <slice>
        fi
 
        if is_linux; then
-               endcyl=$($FORMAT -s $DEV_DSKDIR/$disk -- unit cyl print | \
-                       $GREP "part${slice}" | \
-                       $AWK '{print $3}' | \
-                       $SED 's,cyl,,')
+               endcyl=$(parted -s $DEV_DSKDIR/$disk -- unit cyl print | \
+                       grep "part${slice}" | \
+                       awk '{print $3}' | \
+                       sed 's,cyl,,')
                ((endcyl = (endcyl + 1)))
        else
                disk=${disk#/dev/dsk/}
@@ -908,20 +916,20 @@ function get_endslice #<disk> <slice>
                disk=${disk%s*}
 
                typeset -i ratio=0
-               ratio=$($PRTVTOC /dev/rdsk/${disk}s2 | \
-                       $GREP "sectors\/cylinder" | \
-                       $AWK '{print $2}')
+               ratio=$(prtvtoc /dev/rdsk/${disk}s2 | \
+                   grep "sectors\/cylinder" | \
+                   awk '{print $2}')
 
                if ((ratio == 0)); then
                        return
                fi
 
-               typeset -i endcyl=$($PRTVTOC -h /dev/rdsk/${disk}s2 |
-                       $NAWK -v token="$slice" '{if ($1==token) print $6}')
+               typeset -i endcyl=$(prtvtoc -h /dev/rdsk/${disk}s2 |
+                   nawk -v token="$slice" '{if ($1==token) print $6}')
 
                ((endcyl = (endcyl + 1) / ratio))
        fi
-
+       
        echo $endcyl
 }
 
@@ -955,7 +963,7 @@ function partition_disk     #<slice_size> <whole_disk_name> <total_slices>
 
 #
 # This function continues to write to a filenum number of files into dirnum
-# number of directories until either $FILE_WRITE returns an error or the
+# number of directories until either file_write returns an error or the
 # maximum number of files per directory have been written.
 #
 # Usage:
@@ -991,13 +999,13 @@ function fill_fs # destdir dirnum filenum bytes num_writes data
        typeset -i fn=0
        typeset -i retval=0
 
-       log_must $MKDIR -p $destdir/$idirnum
+       log_must mkdir -p $destdir/$idirnum
        while (($odirnum > 0)); do
                if ((dirnum >= 0 && idirnum >= dirnum)); then
                        odirnum=0
                        break
                fi
-               $FILE_WRITE -o create -f $destdir/$idirnum/$TESTFILE.$fn \
+               file_write -o create -f $destdir/$idirnum/$TESTFILE.$fn \
                    -b $bytes -c $num_writes -d $data
                retval=$?
                if (($retval != 0)); then
@@ -1007,7 +1015,7 @@ function fill_fs # destdir dirnum filenum bytes num_writes data
                if (($fn >= $filenum)); then
                        fn=0
                        ((idirnum = idirnum + 1))
-                       log_must $MKDIR -p $destdir/$idirnum
+                       log_must mkdir -p $destdir/$idirnum
                else
                        ((fn = fn + 1))
                fi
@@ -1027,14 +1035,14 @@ function get_prop # property dataset
        typeset prop=$1
        typeset dataset=$2
 
-       prop_val=$($ZFS get -pH -o value $prop $dataset 2>/dev/null)
+       prop_val=$(zfs get -pH -o value $prop $dataset 2>/dev/null)
        if [[ $? -ne 0 ]]; then
                log_note "Unable to get $prop property for dataset " \
                "$dataset"
                return 1
        fi
 
-       $ECHO "$prop_val"
+       echo "$prop_val"
        return 0
 }
 
@@ -1051,8 +1059,8 @@ function get_pool_prop # property pool
        typeset pool=$2
 
        if poolexists $pool ; then
-               prop_val=$($ZPOOL get -pH $prop $pool 2>/dev/null | $TAIL -1 | \
-                       $AWK '{print $3}')
+               prop_val=$(zpool get -pH $prop $pool 2>/dev/null | tail -1 | \
+                       awk '{print $3}')
                if [[ $? -ne 0 ]]; then
                        log_note "Unable to get $prop property for pool " \
                        "$pool"
@@ -1063,7 +1071,7 @@ function get_pool_prop # property pool
                return 1
        fi
 
-       $ECHO "$prop_val"
+       echo "$prop_val"
        return 0
 }
 
@@ -1080,7 +1088,7 @@ function poolexists
                return 1
        fi
 
-       $ZPOOL get name "$pool" > /dev/null 2>&1
+       zpool get name "$pool" > /dev/null 2>&1
        return $?
 }
 
@@ -1095,7 +1103,7 @@ function datasetexists
        fi
 
        while (($# > 0)); do
-               $ZFS get name $1 > /dev/null 2>&1 || \
+               zfs get name $1 > /dev/null 2>&1 || \
                        return $?
                shift
        done
@@ -1114,7 +1122,7 @@ function datasetnonexists
        fi
 
        while (($# > 0)); do
-               $ZFS list -H -t filesystem,snapshot,volume $1 > /dev/null 2>&1 \
+               zfs list -H -t filesystem,snapshot,volume $1 > /dev/null 2>&1 \
                    && return 1
                shift
        done
@@ -1147,7 +1155,7 @@ function is_shared
        fi
 
        if is_linux; then
-               for mtpt in `$SHARE | $AWK '{print $1}'` ; do
+               for mtpt in `share | awk '{print $1}'` ; do
                        if [[ $mtpt == $fs ]] ; then
                                return 0
                        fi
@@ -1155,13 +1163,13 @@ function is_shared
                return 1
        fi
 
-       for mtpt in `$SHARE | $AWK '{print $2}'` ; do
+       for mtpt in `share | awk '{print $2}'` ; do
                if [[ $mtpt == $fs ]] ; then
                        return 0
                fi
        done
 
-       typeset stat=$($SVCS -H -o STA nfs/server:default)
+       typeset stat=$(svcs -H -o STA nfs/server:default)
        if [[ $stat != "ON" ]]; then
                log_note "Current nfs/server status: $stat"
        fi
@@ -1186,7 +1194,7 @@ function is_shared_smb
        fi
 
        if is_linux; then
-               for mtpt in `$NET usershare list | $AWK '{print $1}'` ; do
+               for mtpt in `net usershare list | awk '{print $1}'` ; do
                        if [[ $mtpt == $fs ]] ; then
                                return 0
                        fi
@@ -1241,7 +1249,7 @@ function unshare_fs #fs
 
        is_shared $fs || is_shared_smb $fs
        if (($? == 0)); then
-               log_must $ZFS unshare $fs
+               log_must zfs unshare $fs
        fi
 
        return 0
@@ -1257,12 +1265,12 @@ function share_nfs #fs
        if is_linux; then
                is_shared $fs
                if (($? != 0)); then
-                       log_must $SHARE "*:$fs"
+                       log_must share "*:$fs"
                fi
        else
                is_shared $fs
                if (($? != 0)); then
-                       log_must $SHARE -F nfs $fs
+                       log_must share -F nfs $fs
                fi
        fi
 
@@ -1279,12 +1287,12 @@ function unshare_nfs #fs
        if is_linux; then
                is_shared $fs
                if (($? == 0)); then
-                       log_must $UNSHARE -u "*:$fs"
+                       log_must unshare -u "*:$fs"
                fi
        else
                is_shared $fs
                if (($? == 0)); then
-                       log_must $UNSHARE -F nfs $fs
+                       log_must unshare -F nfs $fs
                fi
        fi
 
@@ -1297,9 +1305,9 @@ function unshare_nfs #fs
 function showshares_nfs
 {
        if is_linux; then
-               $SHARE -v
+               share -v
        else
-               $SHARE -F nfs
+               share -F nfs
        fi
 
        return 0
@@ -1311,9 +1319,9 @@ function showshares_nfs
 function showshares_smb
 {
        if is_linux; then
-               $NET usershare list
+               net usershare list
        else
-               $SHARE -F smb
+               share -F smb
        fi
 
        return 0
@@ -1337,7 +1345,7 @@ function setup_nfs_server
        fi
 
        typeset nfs_fmri="svc:/network/nfs/server:default"
-       if [[ $($SVCS -Ho STA $nfs_fmri) != "ON" ]]; then
+       if [[ $(svcs -Ho STA $nfs_fmri) != "ON" ]]; then
                #
                # Only really sharing operation can enable NFS server
                # to online permanently.
@@ -1345,11 +1353,11 @@ function setup_nfs_server
                typeset dummy=/tmp/dummy
 
                if [[ -d $dummy ]]; then
-                       log_must $RM -rf $dummy
+                       log_must rm -rf $dummy
                fi
 
-               log_must $MKDIR $dummy
-               log_must $SHARE $dummy
+               log_must mkdir $dummy
+               log_must share $dummy
 
                #
                # Waiting for fmri's status to be the final status.
@@ -1358,20 +1366,20 @@ function setup_nfs_server
                #
                # Waiting for 1's at least.
                #
-               log_must $SLEEP 1
+               log_must sleep 1
                timeout=10
-               while [[ timeout -ne 0 && $($SVCS -Ho STA $nfs_fmri) == *'*' ]]
+               while [[ timeout -ne 0 && $(svcs -Ho STA $nfs_fmri) == *'*' ]]
                do
-                       log_must $SLEEP 1
+                       log_must sleep 1
 
                        ((timeout -= 1))
                done
 
-               log_must $UNSHARE $dummy
-               log_must $RM -rf $dummy
+               log_must unshare $dummy
+               log_must rm -rf $dummy
        fi
 
-       log_note "Current NFS status: '$($SVCS -Ho STA,FMRI $nfs_fmri)'"
+       log_note "Current NFS status: '$(svcs -Ho STA,FMRI $nfs_fmri)'"
 }
 
 #
@@ -1381,11 +1389,15 @@ function setup_nfs_server
 #
 function is_global_zone
 {
-       typeset cur_zone=$($ZONENAME 2>/dev/null)
-       if [[ $cur_zone != "global" ]]; then
-               return 1
+       if is_linux; then
+               return 0
+       else
+               typeset cur_zone=$(zonename 2>/dev/null)
+               if [[ $cur_zone != "global" ]]; then
+                       return 1
+               fi
+               return 0
        fi
-       return 0
 }
 
 #
@@ -1453,8 +1465,8 @@ function create_pool #pool devs_list
        fi
 
        if is_global_zone ; then
-               [[ -d /$pool ]] && $RM -rf /$pool
-               log_must $ZPOOL create -f $pool $@
+               [[ -d /$pool ]] && rm -rf /$pool
+               log_must zpool create -f $pool $@
        fi
 
        return 0
@@ -1487,16 +1499,16 @@ function destroy_pool #pool
                        typeset -i wait_time=10 ret=1 count=0
                        must=""
                        while [[ $ret -ne 0 ]]; do
-                               $must $ZPOOL destroy -f $pool
+                               $must zpool destroy -f $pool
                                ret=$?
                                [[ $ret -eq 0 ]] && break
                                log_note "zpool destroy failed with $ret"
                                [[ count++ -ge 7 ]] && must=log_must
-                               $SLEEP $wait_time
+                               sleep $wait_time
                        done
 
                        [[ -d $mtpt ]] && \
-                               log_must $RM -rf $mtpt
+                               log_must rm -rf $mtpt
                else
                        log_note "Pool does not exist. ($pool)"
                        return 1
@@ -1527,15 +1539,15 @@ function zfs_zones_setup #zone_name zone_root zone_ip
 
        # Create pool and 5 container within it
        #
-       [[ -d /$pool_name ]] && $RM -rf /$pool_name
-       log_must $ZPOOL create -f $pool_name $DISKS
+       [[ -d /$pool_name ]] && rm -rf /$pool_name
+       log_must zpool create -f $pool_name $DISKS
        while ((i < cntctr)); do
-               log_must $ZFS create $pool_name/$prefix_ctr$i
+               log_must zfs create $pool_name/$prefix_ctr$i
                ((i += 1))
        done
 
        # create a zvol
-       log_must $ZFS create -V 1g $pool_name/zone_zvol
+       log_must zfs create -V 1g $pool_name/zone_zvol
        block_device_wait
 
        #
@@ -1543,81 +1555,81 @@ function zfs_zones_setup #zone_name zone_root zone_ip
        #
        if verify_slog_support ; then
                typeset sdevs="/var/tmp/sdev1 /var/tmp/sdev2"
-               log_must $MKFILE $MINVDEVSIZE $sdevs
-               log_must $ZPOOL add $pool_name log mirror $sdevs
+               log_must mkfile $MINVDEVSIZE $sdevs
+               log_must zpool add $pool_name log mirror $sdevs
        fi
 
        # this isn't supported just yet.
        # Create a filesystem. In order to add this to
        # the zone, it must have it's mountpoint set to 'legacy'
-       # log_must $ZFS create $pool_name/zfs_filesystem
-       # log_must $ZFS set mountpoint=legacy $pool_name/zfs_filesystem
+       # log_must zfs create $pool_name/zfs_filesystem
+       # log_must zfs set mountpoint=legacy $pool_name/zfs_filesystem
 
        [[ -d $zone_root ]] && \
-               log_must $RM -rf $zone_root/$zone_name
+               log_must rm -rf $zone_root/$zone_name
        [[ ! -d $zone_root ]] && \
-               log_must $MKDIR -p -m 0700 $zone_root/$zone_name
+               log_must mkdir -p -m 0700 $zone_root/$zone_name
 
        # Create zone configure file and configure the zone
        #
        typeset zone_conf=/tmp/zone_conf.$$
-       $ECHO "create" > $zone_conf
-       $ECHO "set zonepath=$zone_root/$zone_name" >> $zone_conf
-       $ECHO "set autoboot=true" >> $zone_conf
+       echo "create" > $zone_conf
+       echo "set zonepath=$zone_root/$zone_name" >> $zone_conf
+       echo "set autoboot=true" >> $zone_conf
        i=0
        while ((i < cntctr)); do
-               $ECHO "add dataset" >> $zone_conf
-               $ECHO "set name=$pool_name/$prefix_ctr$i" >> \
+               echo "add dataset" >> $zone_conf
+               echo "set name=$pool_name/$prefix_ctr$i" >> \
                        $zone_conf
-               $ECHO "end" >> $zone_conf
+               echo "end" >> $zone_conf
                ((i += 1))
        done
 
        # add our zvol to the zone
-       $ECHO "add device" >> $zone_conf
-       $ECHO "set match=$ZVOL_DEVDIR/$pool_name/zone_zvol" >> $zone_conf
-       $ECHO "end" >> $zone_conf
+       echo "add device" >> $zone_conf
+       echo "set match=/dev/zvol/dsk/$pool_name/zone_zvol" >> $zone_conf
+       echo "end" >> $zone_conf
 
        # add a corresponding zvol rdsk to the zone
-       $ECHO "add device" >> $zone_conf
-       $ECHO "set match=$ZVOL_RDEVDIR/$pool_name/zone_zvol" >> $zone_conf
-       $ECHO "end" >> $zone_conf
+       echo "add device" >> $zone_conf
+       echo "set match=$ZVOL_RDEVDIR/$pool_name/zone_zvol" >> $zone_conf
+       echo "end" >> $zone_conf
 
        # once it's supported, we'll add our filesystem to the zone
-       # $ECHO "add fs" >> $zone_conf
-       # $ECHO "set type=zfs" >> $zone_conf
-       # $ECHO "set special=$pool_name/zfs_filesystem" >> $zone_conf
-       # $ECHO "set dir=/export/zfs_filesystem" >> $zone_conf
-       # $ECHO "end" >> $zone_conf
+       # echo "add fs" >> $zone_conf
+       # echo "set type=zfs" >> $zone_conf
+       # echo "set special=$pool_name/zfs_filesystem" >> $zone_conf
+       # echo "set dir=/export/zfs_filesystem" >> $zone_conf
+       # echo "end" >> $zone_conf
 
-       $ECHO "verify" >> $zone_conf
-       $ECHO "commit" >> $zone_conf
-       log_must $ZONECFG -z $zone_name -f $zone_conf
-       log_must $RM -f $zone_conf
+       echo "verify" >> $zone_conf
+       echo "commit" >> $zone_conf
+       log_must zonecfg -z $zone_name -f $zone_conf
+       log_must rm -f $zone_conf
 
        # Install the zone
-       $ZONEADM -z $zone_name install
+       zoneadm -z $zone_name install
        if (($? == 0)); then
-               log_note "SUCCESS: $ZONEADM -z $zone_name install"
+               log_note "SUCCESS: zoneadm -z $zone_name install"
        else
-               log_fail "FAIL: $ZONEADM -z $zone_name install"
+               log_fail "FAIL: zoneadm -z $zone_name install"
        fi
 
        # Install sysidcfg file
        #
        typeset sysidcfg=$zone_root/$zone_name/root/etc/sysidcfg
-       $ECHO "system_locale=C" > $sysidcfg
-       $ECHO  "terminal=dtterm" >> $sysidcfg
-       $ECHO  "network_interface=primary {" >> $sysidcfg
-       $ECHO  "hostname=$zone_name" >> $sysidcfg
-       $ECHO  "}" >> $sysidcfg
-       $ECHO  "name_service=NONE" >> $sysidcfg
-       $ECHO  "root_password=mo791xfZ/SFiw" >> $sysidcfg
-       $ECHO  "security_policy=NONE" >> $sysidcfg
-       $ECHO  "timezone=US/Eastern" >> $sysidcfg
+       echo "system_locale=C" > $sysidcfg
+       echo  "terminal=dtterm" >> $sysidcfg
+       echo  "network_interface=primary {" >> $sysidcfg
+       echo  "hostname=$zone_name" >> $sysidcfg
+       echo  "}" >> $sysidcfg
+       echo  "name_service=NONE" >> $sysidcfg
+       echo  "root_password=mo791xfZ/SFiw" >> $sysidcfg
+       echo  "security_policy=NONE" >> $sysidcfg
+       echo  "timezone=US/Eastern" >> $sysidcfg
 
        # Boot this zone
-       log_must $ZONEADM -z $zone_name boot
+       log_must zoneadm -z $zone_name boot
 }
 
 #
@@ -1632,12 +1644,12 @@ function reexport_pool
                if ((i == 0)); then
                        TESTPOOL=$ZONE_POOL/$ZONE_CTR$i
                        if ! ismounted $TESTPOOL; then
-                               log_must $ZFS mount $TESTPOOL
+                               log_must zfs mount $TESTPOOL
                        fi
                else
                        eval TESTPOOL$i=$ZONE_POOL/$ZONE_CTR$i
                        if eval ! ismounted \$TESTPOOL$i; then
-                               log_must eval $ZFS mount \$TESTPOOL$i
+                               log_must eval zfs mount \$TESTPOOL$i
                        fi
                fi
                ((i += 1))
@@ -1660,10 +1672,10 @@ function check_state # pool disk state{online,offline,degraded}
 
        if [[ -z $disk ]]; then
                #check pool state only
-               $ZPOOL get -H -o value health $pool \
+               zpool get -H -o value health $pool \
                    | grep -i "$state" > /dev/null 2>&1
        else
-               $ZPOOL status -v $pool | grep "$disk"  \
+               zpool status -v $pool | grep "$disk"  \
                    | grep -i "$state" > /dev/null 2>&1
        fi
 
@@ -1682,14 +1694,14 @@ function scan_scsi_hosts
        if is_linux; then
                if [[ -z $hostnum ]]; then
                        for host in /sys/class/scsi_host/host*; do
-                               log_must eval "$ECHO '- - -' > $host/scan"
+                               log_must eval "echo '- - -' > $host/scan"
                        done
                else
                        log_must eval \
-                           "$ECHO /sys/class/scsi_host/host$hostnum/scan" \
+                           "echo /sys/class/scsi_host/host$hostnum/scan" \
                            > /dev/null
                        log_must eval \
-                           "$ECHO '- - -' > /sys/class/scsi_host/host$hostnum/scan"
+                           "echo '- - -' > /sys/class/scsi_host/host$hostnum/scan"
                fi
        fi
 }
@@ -1699,8 +1711,8 @@ function scan_scsi_hosts
 function block_device_wait
 {
        if is_linux; then
-               $UDEVADM trigger
-               $UDEVADM settle
+               udevadm trigger
+               udevadm settle
        fi
 }
 
@@ -1722,38 +1734,38 @@ function on_off_disk # disk state{online,offline} host
 
        if is_linux; then
                if [[ $state == "offline" ]] && ( is_mpath_device $disk ); then
-                       dm_name="$($READLINK $DEV_DSKDIR/$disk \
-                           | $NAWK -F / '{print $2}')"
-                       slave="$($LS /sys/block/${dm_name}/slaves \
-                           | $NAWK '{print $1}')"
+                       dm_name="$(readlink $DEV_DSKDIR/$disk \
+                           | nawk -F / '{print $2}')"
+                       slave="$(ls /sys/block/${dm_name}/slaves \
+                           | nawk '{print $1}')"
                        while [[ -n $slave ]]; do
                                #check if disk is online
-                               $LSSCSI | $EGREP $slave > /dev/null
+                               lsscsi | egrep $slave > /dev/null
                                if (($? == 0)); then
                                        slave_dir="/sys/block/${dm_name}"
                                        slave_dir+="/slaves/${slave}/device"
                                        ss="${slave_dir}/state"
                                        sd="${slave_dir}/delete"
-                                       log_must eval "$ECHO 'offline' > ${ss}"
-                                       log_must eval "$ECHO '1' > ${sd}"
-                                       $LSSCSI | $EGREP $slave > /dev/null
+                                       log_must eval "echo 'offline' > ${ss}"
+                                       log_must eval "echo '1' > ${sd}"
+                                       lsscsi | egrep $slave > /dev/null
                                                if (($? == 0)); then
                                                        log_fail "Offlining" \
                                                            "$disk failed"
                                                fi
                                fi
-                               slave="$($LS /sys/block/$dm_name/slaves \
-                                   2>/dev/null | $NAWK '{print $1}')"
+                               slave="$(ls /sys/block/$dm_name/slaves \
+                                   2>/dev/null | nawk '{print $1}')"
                        done
                elif [[ $state == "offline" ]] && ( is_real_device $disk ); then
                        #check if disk is online
-                       $LSSCSI | $EGREP $disk > /dev/null
+                       lsscsi | egrep $disk > /dev/null
                        if (($? == 0)); then
                                dev_state="/sys/block/$disk/device/state"
                                dev_delete="/sys/block/$disk/device/delete"
-                               log_must eval "$ECHO 'offline' > ${dev_state}"
-                               log_must eval "$ECHO '1' > ${dev_delete}"
-                               $LSSCSI | $EGREP $disk > /dev/null
+                               log_must eval "echo 'offline' > ${dev_state}"
+                               log_must eval "echo '1' > ${dev_delete}"
+                               lsscsi | egrep $disk > /dev/null
                                        if (($? == 0)); then
                                                log_fail "Offlining $disk" \
                                                    "failed"
@@ -1766,16 +1778,16 @@ function on_off_disk # disk state{online,offline} host
                        scan_scsi_hosts $host
                        block_device_wait
                        if is_mpath_device $disk; then
-                               dm_name="$($READLINK $DEV_DSKDIR/$disk \
-                                   | $NAWK -F / '{print $2}')"
-                               slave="$($LS /sys/block/$dm_name/slaves \
-                                   | $NAWK '{print $1}')"
-                               $LSSCSI | $EGREP $slave > /dev/null
+                               dm_name="$(readlink $DEV_DSKDIR/$disk \
+                                   | nawk -F / '{print $2}')"
+                               slave="$(ls /sys/block/$dm_name/slaves \
+                                   | nawk '{print $1}')"
+                               lsscsi | egrep $slave > /dev/null
                                if (($? != 0)); then
                                        log_fail "Onlining $disk failed"
                                fi
                        elif is_real_device $disk; then
-                               $LSSCSI | $EGREP $disk > /dev/null
+                               lsscsi | egrep $disk > /dev/null
                                if (($? != 0)); then
                                        log_fail "Onlining $disk failed"
                                fi
@@ -1808,7 +1820,7 @@ function snapshot_mountpoint
                log_fail "Error name of snapshot '$dataset'."
        fi
 
-       $ECHO $(get_prop mountpoint $fs)/.zfs/snapshot/$snap
+       echo $(get_prop mountpoint $fs)/.zfs/snapshot/$snap
 }
 
 #
@@ -1827,9 +1839,9 @@ function verify_filesys # pool filesystem dir
        typeset dirs=$@
        typeset search_path=""
 
-       log_note "Calling $ZDB to verify filesystem '$filesys'"
-       $ZFS unmount -a > /dev/null 2>&1
-       log_must $ZPOOL export $pool
+       log_note "Calling zdb to verify filesystem '$filesys'"
+       zfs unmount -a > /dev/null 2>&1
+       log_must zpool export $pool
 
        if [[ -n $dirs ]] ; then
                for dir in $dirs ; do
@@ -1837,17 +1849,17 @@ function verify_filesys # pool filesystem dir
                done
        fi
 
-       log_must $ZPOOL import $search_path $pool
+       log_must zpool import $search_path $pool
 
-       $ZDB -cudi $filesys > $zdbout 2>&1
+       zdb -cudi $filesys > $zdbout 2>&1
        if [[ $? != 0 ]]; then
-               log_note "Output: $ZDB -cudi $filesys"
-               $CAT $zdbout
-               log_fail "$ZDB detected errors with: '$filesys'"
+               log_note "Output: zdb -cudi $filesys"
+               cat $zdbout
+               log_fail "zdb detected errors with: '$filesys'"
        fi
 
-       log_must $ZFS mount -a
-       log_must $RM -rf $zdbout
+       log_must zfs mount -a
+       log_must rm -rf $zdbout
 }
 
 #
@@ -1857,11 +1869,11 @@ function get_disklist # pool
 {
        typeset disklist=""
 
-       disklist=$($ZPOOL iostat -v $1 | $NAWK '(NR >4) {print $1}' | \
-           $GREP -v "\-\-\-\-\-" | \
-           $EGREP -v -e "^(mirror|raidz1|raidz2|spare|log|cache)$")
+       disklist=$(zpool iostat -v $1 | nawk '(NR >4) {print $1}' | \
+           grep -v "\-\-\-\-\-" | \
+           egrep -v -e "^(mirror|raidz1|raidz2|spare|log|cache)$")
 
-       $ECHO $disklist
+       echo $disklist
 }
 
 #
@@ -1894,14 +1906,14 @@ function stress_timeout
 
        log_note "Waiting for child processes($cpids). " \
                "It could last dozens of minutes, please be patient ..."
-       log_must $SLEEP $TIMEOUT
+       log_must sleep $TIMEOUT
 
        log_note "Killing child processes after ${TIMEOUT} stress timeout."
        typeset pid
        for pid in $cpids; do
-               $PS -p $pid > /dev/null 2>&1
+               ps -p $pid > /dev/null 2>&1
                if (($? == 0)); then
-                       log_must $KILL -USR1 $pid
+                       log_must kill -USR1 $pid
                fi
        done
 }
@@ -1975,9 +1987,9 @@ function check_pool_status # pool token keyword
        typeset token=$2
        typeset keyword=$3
 
-       $ZPOOL status -v "$pool" 2>/dev/null | $NAWK -v token="$token:" '
+       zpool status -v "$pool" 2>/dev/null | nawk -v token="$token:" '
                ($1==token) {print $0}' \
-       | $GREP -i "$keyword" > /dev/null 2>&1
+       | grep -i "$keyword" > /dev/null 2>&1
 
        return $?
 }
@@ -2049,17 +2061,17 @@ function verify_rsh_connect #rhost, username
 {
        typeset rhost=$1
        typeset username=$2
-       typeset rsh_cmd="$RSH -n"
+       typeset rsh_cmd="rsh -n"
        typeset cur_user=
 
-       $GETENT hosts $rhost >/dev/null 2>&1
+       getent hosts $rhost >/dev/null 2>&1
        if (($? != 0)); then
                log_note "$rhost cannot be found from" \
                        "administrative database."
                return 1
        fi
 
-       $PING $rhost 3 >/dev/null 2>&1
+       ping $rhost 3 >/dev/null 2>&1
        if (($? != 0)); then
                log_note "$rhost is not reachable."
                return 1
@@ -2069,11 +2081,11 @@ function verify_rsh_connect #rhost, username
                rsh_cmd="$rsh_cmd -l $username"
                cur_user="given user \"$username\""
        else
-               cur_user="current user \"`$LOGNAME`\""
+               cur_user="current user \"`logname`\""
        fi
 
-        if ! $rsh_cmd $rhost $TRUE; then
-               log_note "$RSH to $rhost is not accessible" \
+        if ! $rsh_cmd $rhost true; then
+               log_note "rsh to $rhost is not accessible" \
                        "with $cur_user."
                return 1
        fi
@@ -2130,9 +2142,9 @@ function rsh_status
 
        err_file=/tmp/${rhost}.$$.err
        if ((${#ruser} == 0)); then
-               rsh_str="$RSH -n"
+               rsh_str="rsh -n"
        else
-               rsh_str="$RSH -n -l $ruser"
+               rsh_str="rsh -n -l $ruser"
        fi
 
        $rsh_str $rhost /bin/ksh -c "'$cmd_str; \
@@ -2140,16 +2152,16 @@ function rsh_status
                >/dev/null 2>$err_file
        ret=$?
        if (($ret != 0)); then
-               $CAT $err_file
-               $RM -f $std_file $err_file
-               log_fail  "$RSH itself failed with exit code $ret..."
+               cat $err_file
+               rm -f $std_file $err_file
+               log_fail  "rsh itself failed with exit code $ret..."
        fi
 
-        ret=$($GREP -v 'print -u 2' $err_file | $GREP 'status=' | \
-               $CUT -d= -f2)
-       (($ret != 0)) && $CAT $err_file >&2
+        ret=$(grep -v 'print -u 2' $err_file | grep 'status=' | \
+               cut -d= -f2)
+       (($ret != 0)) && cat $err_file >&2
 
-       $RM -f $err_file >/dev/null 2>&1
+       rm -f $err_file >/dev/null 2>&1
        return $ret
 }
 
@@ -2162,10 +2174,10 @@ function get_remote_pkgpath
        typeset rhost=$1
        typeset pkgpath=""
 
-       pkgpath=$($RSH -n $rhost "$PKGINFO -l SUNWstc-fs-zfs | $GREP BASEDIR: |\
-                       $CUT -d: -f2")
+       pkgpath=$(rsh -n $rhost "pkginfo -l SUNWstc-fs-zfs | grep BASEDIR: |\
+                       cut -d: -f2")
 
-       $ECHO $pkgpath
+       echo $pkgpath
 }
 
 #/**
@@ -2182,7 +2194,7 @@ function find_disks
 {
        # Trust provided list, no attempt is made to locate unused devices.
        if is_linux; then
-               $ECHO "$@"
+               echo "$@"
                return
        fi
 
@@ -2191,15 +2203,15 @@ function find_disks
        dmpi=/tmp/dumpdev.$$
        max_finddisksnum=${MAX_FINDDISKSNUM:-6}
 
-       $SWAP -l > $sfi
-       $DUMPADM > $dmpi 2>/dev/null
+       swap -l > $sfi
+       dumpadm > $dmpi 2>/dev/null
 
 # write an awk script that can process the output of format
 # to produce a list of disks we know about. Note that we have
 # to escape "$2" so that the shell doesn't interpret it while
 # we're creating the awk script.
 # -------------------
-       $CAT > /tmp/find_disks.awk <<EOF
+       cat > /tmp/find_disks.awk <<EOF
 #!/bin/nawk -f
        BEGIN { FS="."; }
 
@@ -2220,29 +2232,29 @@ function find_disks
 EOF
 #---------------------
 
-       $CHMOD 755 /tmp/find_disks.awk
-       disks=${@:-$($ECHO "" | $FORMAT -e 2>/dev/null | /tmp/find_disks.awk)}
-       $RM /tmp/find_disks.awk
+       chmod 755 /tmp/find_disks.awk
+       disks=${@:-$(echo "" | format -e 2>/dev/null | /tmp/find_disks.awk)}
+       rm /tmp/find_disks.awk
 
        unused=""
        for disk in $disks; do
        # Check for mounted
-               $GREP "${disk}[sp]" /etc/mnttab >/dev/null
+               grep "${disk}[sp]" /etc/mnttab >/dev/null
                (($? == 0)) && continue
        # Check for swap
-               $GREP "${disk}[sp]" $sfi >/dev/null
+               grep "${disk}[sp]" $sfi >/dev/null
                (($? == 0)) && continue
        # check for dump device
-               $GREP "${disk}[sp]" $dmpi >/dev/null
+               grep "${disk}[sp]" $dmpi >/dev/null
                (($? == 0)) && continue
        # check to see if this disk hasn't been explicitly excluded
        # by a user-set environment variable
-               $ECHO "${ZFS_HOST_DEVICES_IGNORE}" | $GREP "${disk}" > /dev/null
+               echo "${ZFS_HOST_DEVICES_IGNORE}" | grep "${disk}" > /dev/null
                (($? == 0)) && continue
                unused_candidates="$unused_candidates $disk"
        done
-       $RM $sfi
-       $RM $dmpi
+       rm $sfi
+       rm $dmpi
 
 # now just check to see if those disks do actually exist
 # by looking for a device pointing to the first slice in
@@ -2259,7 +2271,7 @@ EOF
        done
 
 # finally, return our disk list
-       $ECHO $unused
+       echo $unused
 }
 
 #
@@ -2279,14 +2291,17 @@ function add_user #<group_name> <user_name> <basedir>
                log_fail "group name or user name are not defined."
        fi
 
-       log_must $USERADD -g $gname -d $basedir/$uname -m $uname
+       log_must useradd -g $gname -d $basedir/$uname -m $uname
+       echo "export PATH=\"$STF_PATH\"" >>$basedir/$uname/.profile
+       echo "export PATH=\"$STF_PATH\"" >>$basedir/$uname/.bash_profile
+       echo "export PATH=\"$STF_PATH\"" >>$basedir/$uname/.login
 
        # Add new users to the same group and the command line utils.
        # This allows them to be run out of the original users home
        # directory as long as it permissioned to be group readable.
        if is_linux; then
-               cmd_group=$(stat --format="%G" $ZFS)
-               log_must $USERMOD -a -G $cmd_group $uname
+               cmd_group=$(stat --format="%G" $(which zfs))
+               log_must usermod -a -G $cmd_group $uname
        fi
 
        return 0
@@ -2307,11 +2322,11 @@ function del_user #<logname> <basedir>
                log_fail "login name is necessary."
        fi
 
-       if $ID $user > /dev/null 2>&1; then
-               log_must $USERDEL $user
+       if id $user > /dev/null 2>&1; then
+               log_must userdel $user
        fi
 
-       [[ -d $basedir/$user ]] && $RM -fr $basedir/$user
+       [[ -d $basedir/$user ]] && rm -fr $basedir/$user
 
        return 0
 }
@@ -2333,7 +2348,7 @@ function add_group #<group_name>
        # Linux because for many distributions 1000 and under are reserved.
        if is_linux; then
                while true; do
-                       $GROUPADD $group > /dev/null 2>&1
+                       groupadd $group > /dev/null 2>&1
                        typeset -i ret=$?
                        case $ret in
                                0) return 0 ;;
@@ -2342,9 +2357,8 @@ function add_group #<group_name>
                done
        else
                typeset -i gid=100
-
                while true; do
-                       $GROUPADD -g $gid $group > /dev/null 2>&1
+                       groupadd -g $gid $group > /dev/null 2>&1
                        typeset -i ret=$?
                        case $ret in
                                0) return 0 ;;
@@ -2369,23 +2383,23 @@ function del_group #<group_name>
        fi
 
        if is_linux; then
-               $GETENT group $grp > /dev/null 2>&1
+               getent group $grp > /dev/null 2>&1
                typeset -i ret=$?
                case $ret in
                        # Group does not exist.
                        2) return 0 ;;
                        # Name already exists as a group name
-                       0) log_must $GROUPDEL $grp ;;
+                       0) log_must groupdel $grp ;;
                        *) return 1 ;;
                esac
        else
-               $GROUPMOD -n $grp $grp > /dev/null 2>&1
+               groupmod -n $grp $grp > /dev/null 2>&1
                typeset -i ret=$?
                case $ret in
                        # Group does not exist.
                        6) return 0 ;;
                        # Name already exists as a group name
-                       9) log_must $GROUPDEL $grp ;;
+                       9) log_must groupdel $grp ;;
                        *) return 1 ;;
                esac
        fi
@@ -2408,29 +2422,29 @@ function safe_to_destroy_pool { # $1 the pool name
        # by looking at all other pools, ensuring that they
        # aren't built from files or zvols contained in this pool.
 
-       for pool in $($ZPOOL list -H -o name)
+       for pool in $(zpool list -H -o name)
        do
                ALTMOUNTPOOL=""
 
                # this is a list of the top-level directories in each of the
                # files that make up the path to the files the pool is based on
-               FILEPOOL=$($ZPOOL status -v $pool | $GREP /$1/ | \
-                       $AWK '{print $1}')
+               FILEPOOL=$(zpool status -v $pool | grep /$1/ | \
+                       awk '{print $1}')
 
                # this is a list of the zvols that make up the pool
-               ZVOLPOOL=$($ZPOOL status -v $pool | $GREP "$ZVOL_DEVDIR/$1$" \
-                   | $AWK '{print $1}')
+               ZVOLPOOL=$(zpool status -v $pool | grep "$ZVOL_DEVDIR/$1$" \
+                   | awk '{print $1}')
 
                # also want to determine if it's a file-based pool using an
                # alternate mountpoint...
-               POOL_FILE_DIRS=$($ZPOOL status -v $pool | \
-                                       $GREP / | $AWK '{print $1}' | \
-                                       $AWK -F/ '{print $2}' | $GREP -v "dev")
+               POOL_FILE_DIRS=$(zpool status -v $pool | \
+                                       grep / | awk '{print $1}' | \
+                                       awk -F/ '{print $2}' | grep -v "dev")
 
                for pooldir in $POOL_FILE_DIRS
                do
-                       OUTPUT=$($ZFS list -H -r -o mountpoint $1 | \
-                                       $GREP "${pooldir}$" | $AWK '{print $1}')
+                       OUTPUT=$(zfs list -H -r -o mountpoint $1 | \
+                                       grep "${pooldir}$" | awk '{print $1}')
 
                        ALTMOUNTPOOL="${ALTMOUNTPOOL}${OUTPUT}"
                done
@@ -2480,11 +2494,11 @@ function get_compress_opts
                COMPRESS_OPTS="on off lzjb"
        fi
        typeset valid_opts="$COMPRESS_OPTS"
-       $ZFS get 2>&1 | $GREP gzip >/dev/null 2>&1
+       zfs get 2>&1 | grep gzip >/dev/null 2>&1
        if [[ $? -eq 0 ]]; then
                valid_opts="$valid_opts $GZIP_OPTS"
        fi
-       $ECHO "$valid_opts"
+       echo "$valid_opts"
 }
 
 #
@@ -2537,15 +2551,15 @@ function verify_opt_p_ops
 
        # make sure the upper level filesystem does not exist
        if datasetexists ${newdataset%/*} ; then
-               log_must $ZFS destroy -rRf ${newdataset%/*}
+               log_must zfs destroy -rRf ${newdataset%/*}
        fi
 
        # without -p option, operation will fail
-       log_mustnot $ZFS $ops $dataset $newdataset
+       log_mustnot zfs $ops $dataset $newdataset
        log_mustnot datasetexists $newdataset ${newdataset%/*}
 
        # with -p option, operation should succeed
-       log_must $ZFS $ops -p $dataset $newdataset
+       log_must zfs $ops -p $dataset $newdataset
        block_device_wait
 
        if ! datasetexists $newdataset ; then
@@ -2554,7 +2568,7 @@ function verify_opt_p_ops
 
        # when $ops is create or clone, redo the operation still return zero
        if [[ $ops != "rename" ]]; then
-               log_must $ZFS $ops -p $dataset $newdataset
+               log_must zfs $ops -p $dataset $newdataset
        fi
 
        return 0
@@ -2574,12 +2588,12 @@ function get_config
        if ! poolexists "$pool" ; then
                return 1
        fi
-       alt_root=$($ZPOOL list -H $pool | $AWK '{print $NF}')
+       alt_root=$(zpool list -H $pool | awk '{print $NF}')
        if [[ $alt_root == "-" ]]; then
-               value=$($ZDB -C $pool | $GREP "$config:" | $AWK -F: \
+               value=$(zdb -C $pool | grep "$config:" | awk -F: \
                    '{print $2}')
        else
-               value=$($ZDB -e $pool | $GREP "$config:" | $AWK -F: \
+               value=$(zdb -e $pool | grep "$config:" | awk -F: \
                    '{print $2}')
        fi
        if [[ -n $value ]] ; then
@@ -2606,8 +2620,8 @@ function _random_get
        typeset -i ind
        ((ind = RANDOM % cnt + 1))
 
-       typeset ret=$($ECHO "$str" | $CUT -f $ind -d ' ')
-       $ECHO $ret
+       typeset ret=$(echo "$str" | cut -f $ind -d ' ')
+       echo $ret
 }
 
 #
@@ -2639,14 +2653,14 @@ function verify_slog_support
        typeset vdev=$dir/a
        typeset sdev=$dir/b
 
-       $MKDIR -p $dir
-       $MKFILE $MINVDEVSIZE $vdev $sdev
+       mkdir -p $dir
+       mkfile $MINVDEVSIZE $vdev $sdev
 
        typeset -i ret=0
-       if ! $ZPOOL create -n $pool $vdev log $sdev > /dev/null 2>&1; then
+       if ! zpool create -n $pool $vdev log $sdev > /dev/null 2>&1; then
                ret=1
        fi
-       $RM -r $dir
+       rm -r $dir
 
        return $ret
 }
@@ -2675,7 +2689,7 @@ function gen_dataset_name
                ((iter -= 1))
        done
 
-       $ECHO $l_name
+       echo $l_name
 }
 
 #
@@ -2690,10 +2704,10 @@ function gen_dataset_name
 function datasetcksum
 {
        typeset cksum
-       $SYNC
-       cksum=$($ZDB -vvv $1 | $GREP "^Dataset $1 \[" | $GREP "cksum" \
-               | $AWK -F= '{print $7}')
-       $ECHO $cksum
+       sync
+       cksum=$(zdb -vvv $1 | grep "^Dataset $1 \[" | grep "cksum" \
+               | awk -F= '{print $7}')
+       echo $cksum
 }
 
 #
@@ -2703,8 +2717,8 @@ function datasetcksum
 function checksum
 {
        typeset cksum
-       cksum=$($CKSUM $1 | $AWK '{print $1}')
-       $ECHO $cksum
+       cksum=$(cksum $1 | awk '{print $1}')
+       echo $cksum
 }
 
 #
@@ -2716,8 +2730,8 @@ function get_device_state #pool disk field("", "spares","logs")
        typeset disk=${2#$DEV_DSKDIR/}
        typeset field=${3:-$pool}
 
-       state=$($ZPOOL status -v "$pool" 2>/dev/null | \
-               $NAWK -v device=$disk -v pool=$pool -v field=$field \
+       state=$(zpool status -v "$pool" 2>/dev/null | \
+               nawk -v device=$disk -v pool=$pool -v field=$field \
                'BEGIN {startconfig=0; startfield=0; }
                /config:/ {startconfig=1}
                (startconfig==1) && ($1==field) {startfield=1; next;}
@@ -2745,7 +2759,7 @@ function get_fstype
        #  $ df -n /
        #  /              : ufs
        #
-       $DF -n $dir | $AWK '{print $3}'
+       df -n $dir | awk '{print $3}'
 }
 
 #
@@ -2759,7 +2773,7 @@ function labelvtoc
                log_fail "The disk name is unspecified."
        fi
        typeset label_file=/var/tmp/labelvtoc.$$
-       typeset arch=$($UNAME -p)
+       typeset arch=$(uname -p)
 
        if is_linux; then
                log_note "Currently unsupported by the test framework"
@@ -2767,33 +2781,33 @@ function labelvtoc
        fi
 
        if [[ $arch == "i386" ]]; then
-               $ECHO "label" > $label_file
-               $ECHO "0" >> $label_file
-               $ECHO "" >> $label_file
-               $ECHO "q" >> $label_file
-               $ECHO "q" >> $label_file
+               echo "label" > $label_file
+               echo "0" >> $label_file
+               echo "" >> $label_file
+               echo "q" >> $label_file
+               echo "q" >> $label_file
 
-               $FDISK -B $disk >/dev/null 2>&1
+               fdisk -B $disk >/dev/null 2>&1
                # wait a while for fdisk finishes
-               $SLEEP 60
+               sleep 60
        elif [[ $arch == "sparc" ]]; then
-               $ECHO "label" > $label_file
-               $ECHO "0" >> $label_file
-               $ECHO "" >> $label_file
-               $ECHO "" >> $label_file
-               $ECHO "" >> $label_file
-               $ECHO "q" >> $label_file
+               echo "label" > $label_file
+               echo "0" >> $label_file
+               echo "" >> $label_file
+               echo "" >> $label_file
+               echo "" >> $label_file
+               echo "q" >> $label_file
        else
                log_fail "unknown arch type"
        fi
 
-       $FORMAT -e -s -d $disk -f $label_file
+       format -e -s -d $disk -f $label_file
        typeset -i ret_val=$?
-       $RM -f $label_file
+       rm -f $label_file
        #
        # wait the format to finish
        #
-       $SLEEP 60
+       sleep 60
        if ((ret_val != 0)); then
                log_fail "unable to label $disk as VTOC."
        fi
@@ -2807,7 +2821,7 @@ function labelvtoc
 #
 function is_zfsroot
 {
-       $DF -n / | $GREP zfs > /dev/null 2>&1
+       df -n / | grep zfs > /dev/null 2>&1
        return $?
 }
 
@@ -2818,14 +2832,14 @@ function is_zfsroot
 function get_rootfs
 {
        typeset rootfs=""
-       rootfs=$($AWK '{if ($2 == "/" && $3 == "zfs") print $1}' \
+       rootfs=$(awk '{if ($2 == "/" && $3 == "zfs") print $1}' \
                /etc/mnttab)
        if [[ -z "$rootfs" ]]; then
                log_fail "Can not get rootfs"
        fi
-       $ZFS list $rootfs > /dev/null 2>&1
+       zfs list $rootfs > /dev/null 2>&1
        if (($? == 0)); then
-               $ECHO $rootfs
+               echo $rootfs
        else
                log_fail "This is not a zfsroot system."
        fi
@@ -2840,15 +2854,15 @@ function get_rootpool
 {
        typeset rootfs=""
        typeset rootpool=""
-       rootfs=$($AWK '{if ($2 == "/" && $3 =="zfs") print $1}' \
+       rootfs=$(awk '{if ($2 == "/" && $3 =="zfs") print $1}' \
                 /etc/mnttab)
        if [[ -z "$rootfs" ]]; then
                log_fail "Can not get rootpool"
        fi
-       $ZFS list $rootfs > /dev/null 2>&1
+       zfs list $rootfs > /dev/null 2>&1
        if (($? == 0)); then
-               rootpool=`$ECHO $rootfs | awk -F\/ '{print $1}'`
-               $ECHO $rootpool
+               rootpool=`echo $rootfs | awk -F\/ '{print $1}'`
+               echo $rootpool
        else
                log_fail "This is not a zfsroot system."
        fi
@@ -2867,7 +2881,7 @@ function is_physical_device #device
                [[ -f /sys/module/loop/parameters/max_part ]]
                return $?
        else
-               $ECHO $device | $EGREP "^c[0-F]+([td][0-F]+)+$" > /dev/null 2>&1
+               echo $device | egrep "^c[0-F]+([td][0-F]+)+$" > /dev/null 2>&1
                return $?
        fi
 }
@@ -2881,8 +2895,8 @@ function is_real_device #disk
        [[ -z $disk ]] && log_fail "No argument for disk given."
 
        if is_linux; then
-               ($LSBLK $DEV_RDSKDIR/$disk -o TYPE | $EGREP disk > /dev/null) \
-                   2>/dev/null
+               lsblk $DEV_RDSKDIR/$disk -o TYPE 2>/dev/null | \
+                   egrep disk >/dev/null
                return $?
        fi
 }
@@ -2896,8 +2910,8 @@ function is_loop_device #disk
        [[ -z $disk ]] && log_fail "No argument for disk given."
 
        if is_linux; then
-               ($LSBLK $DEV_RDSKDIR/$disk -o TYPE | $EGREP loop > /dev/null) \
-                   2>/dev/null
+               lsblk $DEV_RDSKDIR/$disk -o TYPE 2>/dev/null | \
+                   egrep loop >/dev/null
                return $?
        fi
 }
@@ -2913,10 +2927,10 @@ function is_mpath_device #disk
        [[ -z $disk ]] && log_fail "No argument for disk given."
 
        if is_linux; then
-               ($LSBLK $DEV_MPATHDIR/$disk -o TYPE | $EGREP mpath >/dev/null) \
-                    2>/dev/null
+               lsblk $DEV_MPATHDIR/$disk -o TYPE 2>/dev/null | \
+                  egrep mpath >/dev/null
                if (($? == 0)); then
-                       $READLINK $DEV_MPATHDIR/$disk > /dev/null 2>&1
+                       readlink $DEV_MPATHDIR/$disk > /dev/null 2>&1
                        return $?
                else
                        return $?
@@ -2936,10 +2950,9 @@ function set_slice_prefix
 
        if is_linux; then
                while (( i < $DISK_ARRAY_NUM )); do
-                       disk="$($ECHO $DISKS | $NAWK '{print $(i + 1)}')"
-                       if ( is_mpath_device $disk ) && [[ -z $($ECHO $disk \
-                           | awk 'substr($1,18,1) ~ /^[[:digit:]]+$/') ]] || \
-                           ( is_real_device $disk ); then
+                       disk="$(echo $DISKS | nawk '{print $(i + 1)}')"
+                       if ( is_mpath_device $disk ) && [[ -z $(echo $disk | awk 'substr($1,18,1)\
+                            ~ /^[[:digit:]]+$/') ]] || ( is_real_device $disk ); then
                                export SLICE_PREFIX=""
                                return 0
                        elif ( is_mpath_device $disk || is_loop_device \
@@ -2969,7 +2982,7 @@ function set_device_dir
 
        if is_linux; then
                while (( i < $DISK_ARRAY_NUM )); do
-                       disk="$($ECHO $DISKS | $NAWK '{print $(i + 1)}')"
+                       disk="$(echo $DISKS | nawk '{print $(i + 1)}')"
                        if is_mpath_device $disk; then
                                export DEV_DSKDIR=$DEV_MPATHDIR
                                return 0
@@ -2998,9 +3011,9 @@ function get_device_dir #device
                if [[ -b "$DEV_DSKDIR/$device" ]]; then
                        device="$DEV_DSKDIR"
                fi
-               $ECHO $device
+               echo $device
        else
-               $ECHO "$DEV_DSKDIR"
+               echo "$DEV_DSKDIR"
        fi
 }
 
@@ -3014,21 +3027,21 @@ function get_persistent_disk_name #device
 
        if is_linux; then
                if is_real_device $device; then
-                       dev_id="$($UDEVADM info -q all -n $DEV_DSKDIR/$device \
-                           | $EGREP disk/by-id | $NAWK '{print $2; exit}' \
-                           | $NAWK -F / '{print $3}')"
-                       $ECHO $dev_id
+                       dev_id="$(udevadm info -q all -n $DEV_DSKDIR/$device \
+                           | egrep disk/by-id | nawk '{print $2; exit}' \
+                           | nawk -F / '{print $3}')"
+                       echo $dev_id
                elif is_mpath_device $device; then
-                       dev_id="$($UDEVADM info -q all -n $DEV_DSKDIR/$device \
-                           | $EGREP disk/by-id/dm-uuid \
-                           | $NAWK '{print $2; exit}' \
-                           | $NAWK -F / '{print $3}')"
-                       $ECHO $dev_id
+                       dev_id="$(udevadm info -q all -n $DEV_DSKDIR/$device \
+                           | egrep disk/by-id/dm-uuid \
+                           | nawk '{print $2; exit}' \
+                           | nawk -F / '{print $3}')"
+                       echo $dev_id
                else
-                       $ECHO $device
+                       echo $device
                fi
        else
-               $ECHO $device
+               echo $device
        fi
 }
 
@@ -3046,19 +3059,19 @@ function load_scsi_debug # dev_size_mb add_host num_tgts max_luns
            [[ -z $luns ]] && log_fail "Arguments invalid or missing"
 
        if is_linux; then
-               $MODLOAD -n scsi_debug
+               modprobe -n scsi_debug
                if (($? != 0)); then
                        log_unsupported "Platform does not have scsi_debug"
                            "module"
                fi
-               $LSMOD | $EGREP scsi_debug > /dev/zero
+               lsmod | egrep scsi_debug > /dev/null
                if (($? == 0)); then
                        log_fail "scsi_debug module already installed"
                else
-                       log_must $MODLOAD scsi_debug dev_size_mb=$devsize \
+                       log_must modprobe scsi_debug dev_size_mb=$devsize \
                            add_host=$hosts num_tgts=$tgts max_luns=$luns
                        block_device_wait
-                       $LSSCSI | $EGREP scsi_debug > /dev/null
+                       lsscsi | egrep scsi_debug > /dev/null
                        if (($? == 1)); then
                                log_fail "scsi_debug module install failed"
                        fi
@@ -3081,7 +3094,7 @@ function get_package_name
 #
 function get_word_count
 {
-       $ECHO $1 | $WC -w
+       echo $1 | wc -w
 }
 
 #
@@ -3125,7 +3138,7 @@ function ds_is_snapshot
 #
 function is_te_enabled
 {
-       $SVCS -H -o state labeld 2>/dev/null | $GREP "enabled"
+       svcs -H -o state labeld 2>/dev/null | grep "enabled"
        if (($? != 0)); then
                return 1
        else
@@ -3137,9 +3150,9 @@ function is_te_enabled
 function is_mp
 {
        if is_linux; then
-               (($($NPROC) > 1))
+               (($(nproc) > 1))
        else
-               (($($PSRINFO | $WC -l) > 1))
+               (($(psrinfo | wc -l) > 1))
        fi
 
        return $?
@@ -3148,9 +3161,9 @@ function is_mp
 function get_cpu_freq
 {
        if is_linux; then
-               lscpu | $AWK '/CPU MHz/ { print $3 }'
+               lscpu | awk '/CPU MHz/ { print $3 }'
        else
-               $PSRINFO -v 0 | $AWK '/processor operates at/ {print $6}'
+               psrinfo -v 0 | awk '/processor operates at/ {print $6}'
        fi
 }
 
@@ -3161,7 +3174,7 @@ function user_run
        shift
 
        log_note "user:$user $@"
-       eval \$SU \$user -c \"$@\" > /tmp/out 2>/tmp/err
+       eval su - \$user -c \"$@\" > /tmp/out 2>/tmp/err
        return $?
 }
 
@@ -3186,14 +3199,14 @@ function vdevs_in_pool
 
        shift
 
-       typeset tmpfile=$($MKTEMP)
-       $ZPOOL list -Hv "$pool" >$tmpfile
+       typeset tmpfile=$(mktemp)
+       zpool list -Hv "$pool" >$tmpfile
        for vdev in $@; do
-               $GREP -w ${vdev##*/} $tmpfile >/dev/null 2>&1
+               grep -w ${vdev##*/} $tmpfile >/dev/null 2>&1
                [[ $? -ne 0 ]] && return 1
        done
 
-       $RM -f $tmpfile
+       rm -f $tmpfile
 
        return 0;
 }
@@ -3232,19 +3245,19 @@ function sync_pool #pool
        typeset pool=${1:-$TESTPOOL}
 
        log_must $SYNC
-       log_must $SLEEP 2
+       log_must sleep 2
        # Flush all the pool data.
        typeset -i ret
-       $ZPOOL scrub $pool >/dev/null 2>&1
+       zpool scrub $pool >/dev/null 2>&1
        ret=$?
        (( $ret != 0 )) && \
-       log_fail "$ZPOOL scrub $pool failed."
+       log_fail "zpool scrub $pool failed."
 
        while ! is_pool_scrubbed $pool; do
                if is_pool_resilvered $pool ; then
                        log_fail "$pool should not be resilver completed."
                fi
-               log_must $SLEEP 2
+               log_must sleep 2
        done
 }
 
@@ -3257,8 +3270,8 @@ function wait_freeing #pool
 {
        typeset pool=${1:-$TESTPOOL}
        while true; do
-               [[ "0" == "$($ZPOOL list -Ho freeing $pool)" ]] && break
-               log_must $SLEEP 1
+               [[ "0" == "$(zpool list -Ho freeing $pool)" ]] && break
+               log_must sleep 1
        done
 }
 
@@ -3270,21 +3283,22 @@ function zed_start
        if is_linux; then
                # ZEDLET_DIR=/var/tmp/zed
                if [[ ! -d $ZEDLET_DIR ]]; then
-                       log_must $MKDIR $ZEDLET_DIR
+                       log_must mkdir $ZEDLET_DIR
                fi
 
                # Verify the ZED is not already running.
-               $PGREP -x zed > /dev/null
+               pgrep -x zed > /dev/null
                if (($? == 0)); then
                        log_fail "ZED already running"
                fi
 
-               log_must $CP ${ZEDLETDIR}/all-syslog.sh $ZEDLET_DIR
+               # ZEDLETDIR=</etc/zfs/zed.d | ${SRCDIR}/cmd/zed/zed.d>
+               log_must cp ${ZEDLETDIR}/all-syslog.sh $ZEDLET_DIR
 
                log_note "Starting ZED"
                # run ZED in the background and redirect foreground logging
                # output to zedlog
-               log_must eval "$ZED -vF -d $ZEDLET_DIR -p $ZEDLET_DIR/zed.pid" \
+               log_must eval "zed -vF -d $ZEDLET_DIR -p $ZEDLET_DIR/zed.pid" \
                    "-s $ZEDLET_DIR/state 2>${ZEDLET_DIR}/zedlog &"
        fi
 }
@@ -3296,14 +3310,13 @@ function zed_stop
 {
        if is_linux; then
                if [[ -f ${ZEDLET_DIR}/zed.pid ]]; then
-                       zedpid=$($CAT ${ZEDLET_DIR}/zed.pid)
-                       log_must $KILL $zedpid
+                       zedpid=$(cat ${ZEDLET_DIR}/zed.pid)
+                       log_must kill $zedpid
                fi
-               log_must $RM -f ${ZEDLET_DIR}/all-syslog.sh
-               log_must $RM -f ${ZEDLET_DIR}/zed.pid
-               log_must $RM -f ${ZEDLET_DIR}/zedlog
-               log_must $RM -f ${ZEDLET_DIR}/state
-               log_must $RMDIR $ZEDLET_DIR
-
+               log_must rm -f ${ZEDLET_DIR}/all-syslog.sh
+               log_must rm -f ${ZEDLET_DIR}/zed.pid
+               log_must rm -f ${ZEDLET_DIR}/zedlog
+               log_must rm -f ${ZEDLET_DIR}/state
+               log_must rmdir $ZEDLET_DIR
        fi
 }
index 38479d3521c170dfc6cc25f48726c1c553084feb..ca1cbcb4e4a35964fea3f20ae626ecdeece7115f 100644 (file)
@@ -10,7 +10,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 #
@@ -30,14 +30,14 @@ function within_percent
        typeset percent=$3
 
        # Set $a or $b to $2 such that a >= b
-       [[ '1' = $($ECHO "if ($2 > $a) 1" | $BC) ]] && a=$2 || b=$2
+       [[ '1' = $(echo "if ($2 > $a) 1" | bc) ]] && a=$2 || b=$2
 
        # Prevent division by 0
        [[ $a =~ [1-9] ]] || return 1
 
-       typeset p=$($ECHO "scale=2; $b * 100 / $a" | $BC)
+       typeset p=$(echo "scale=2; $b * 100 / $a" | bc)
        log_note "Comparing $a and $b given $percent% (calculated: $p%)"
-       [[ '1' = $($ECHO "scale=2; if ($p >= $percent) 1" | $BC) ]] && return 0
+       [[ '1' = $(echo "scale=2; if ($p >= $percent) 1" | bc) ]] && return 0
 
        return 1
 }
index c495eecb477be8f473e0f0f77ffd7b730c579e23..8817b6f2cb3cbd24f80275494c07291c31cb89bd 100644 (file)
@@ -10,7 +10,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 typeset -a compress_props=('on' 'off' 'lzjb' 'gzip' 'gzip-1' 'gzip-2' 'gzip-3'
@@ -37,7 +37,7 @@ function get_rand_prop
 
        typeset prop_max=$((${#prop_array[@]} - 1))
        typeset -i i
-       for i in $($SHUF -i $start-$prop_max -n $num_props); do
+       for i in $(shuf -i $start-$prop_max -n $num_props); do
                retstr="${prop_array[$i]} $retstr"
        done
        echo $retstr
index 2a1fdcb75c34165263018d00fce0f0db1dba3d98..def25d390919196f224b6b481b87b09b1415fb19 100644 (file)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/acl/acl.cfg
 . $STF_SUITE/include/libtest.shlib
 
@@ -39,7 +43,7 @@ function get_mode #<obj>
                return 1
        fi
 
-       $LS -ld $obj | $AWK '{print $1}'
+       ls -ld $obj | awk '{print $1}'
 }
 
 #
@@ -54,7 +58,7 @@ function get_acl #<obj>
                return 1
        fi
 
-       $LS -vd $obj | $NAWK '(NR != 1) {print $0}'
+       ls -vd $obj | nawk '(NR != 1) {print $0}'
 }
 
 #
@@ -69,7 +73,7 @@ function get_compact_acl #<obj>
                return 1
        fi
 
-       $LS -Vd $obj | $NAWK '(NR != 1) {print $0}'
+       ls -Vd $obj | nawk '(NR != 1) {print $0}'
 }
 
 #
@@ -94,9 +98,9 @@ function compare_acls #<src> <tgt>
        get_acl $src > $tmpsrc
        get_acl $tgt > $tmptgt
        typeset -i ret=0
-       $DIFF $tmpsrc $tmptgt > /dev/null 2>&1
+       diff $tmpsrc $tmptgt > /dev/null 2>&1
        ret=$?
-       $RM -f $tmpsrc $tmptgt
+       rm -f $tmpsrc $tmptgt
 
        if (( ret != 0 )); then
                return $ret
@@ -104,9 +108,9 @@ function compare_acls #<src> <tgt>
 
        get_compact_acl $src > $tmpsrc
        get_compact_acl $tgt > $tmptgt
-       $DIFF $tmpsrc $tmptgt > /dev/null 2>&1
+       diff $tmpsrc $tmptgt > /dev/null 2>&1
        ret=$?
-       $RM -f $tmpsrc $tmptgt
+       rm -f $tmpsrc $tmptgt
 
        return $ret
 }
@@ -162,9 +166,9 @@ function compare_xattrs #<src> <tgt>
        get_xattr $src > $tmpsrc
        get_xattr $tgt > $tmptgt
        typeset -i ret=0
-       $DIFF $tmpsrc $tmptgt > /dev/null 2>&1
+       diff $tmpsrc $tmptgt > /dev/null 2>&1
        ret=$?
-       $RM -f $tmpsrc $tmptgt
+       rm -f $tmpsrc $tmptgt
 
         return $ret
 }
@@ -181,7 +185,7 @@ function plus_sign_check_l #<obj>
                return 1
        fi
 
-       $LS -ld $obj | $AWK '{print $1}' | $GREP "+\>" > /dev/null
+       ls -ld $obj | awk '{print $1}' | grep "+\>" > /dev/null
 
         return $?
 }
@@ -198,7 +202,7 @@ function plus_sign_check_v #<obj>
                return 1
        fi
 
-       $LS -vd $obj | $NAWK '(NR == 1) {print $1}' | $GREP "+\>" > /dev/null
+       ls -vd $obj | nawk '(NR == 1) {print $1}' | grep "+\>" > /dev/null
 
         return $?
 }
@@ -211,7 +215,7 @@ function plus_sign_check_v #<obj>
 #
 function chgusr_exec #<login_name> <commands> [...]
 {
-       $CHG_USR_EXEC $@
+       chg_usr_exec $@
        return $?
 }
 
@@ -232,7 +236,7 @@ function set_cur_usr #<login_name>
 #
 function usr_exec #<commands> [...]
 {
-       $CHG_USR_EXEC "$ZFS_ACL_CUR_USER" $@
+       chg_usr_exec "$ZFS_ACL_CUR_USER" $@
        return $?
 }
 
@@ -248,7 +252,7 @@ function count_ACE #<file or dir name>
                return 1
        fi
 
-       $LS -vd $1 | $NAWK 'BEGIN {count=0}
+       ls -vd $1 | nawk 'BEGIN {count=0}
                        (NR != 1)&&(/[0-9]:/) {count++}
                        END {print count}'
 
@@ -286,8 +290,8 @@ function get_ACE #<file or dir name> <specified number> <verbose|compact>
                        ;;
        esac
 
-       $LS $args $file > $tmpfile
-       (( $? != 0 )) && log_fail "FAIL: $LS $args $file > $tmpfile"
+       ls $args $file > $tmpfile
+       (( $? != 0 )) && log_fail "FAIL: ls $args $file > $tmpfile"
        while read line; do
                [[ -z $line ]] && continue
                if [[ $args == -vd ]]; then
@@ -308,8 +312,8 @@ function get_ACE #<file or dir name> <specified number> <verbose|compact>
                fi
        done < $tmpfile
 
-       $RM -f $tmpfile
-       (( $? != 0 )) && log_fail "FAIL: $RM -f $tmpfile"
+       rm -f $tmpfile
+       (( $? != 0 )) && log_fail "FAIL: rm -f $tmpfile"
 }
 
 #
@@ -337,7 +341,7 @@ function cleanup
 {
        if [[ -d $TESTDIR ]]; then
                cd $TESTDIR
-               $RM -rf $TESTDIR/*
+               rm -rf $TESTDIR/*
        fi
 }
 
@@ -363,26 +367,26 @@ function rwx_node #user node acl_spec|access
        if [[ -d $node ]]; then
                case $acl_spec in
                *:read_data:*|read_data)
-                       chgusr_exec $user $LS -l $node > /dev/null 2>&1
+                       chgusr_exec $user ls -l $node > /dev/null 2>&1
                        return $? ;;
                *:write_data:*|write_data)
                        if [[ -f ${node}/tmpfile ]]; then
-                               log_must $RM -f ${node}/tmpfile
+                               log_must rm -f ${node}/tmpfile
                        fi
-                       chgusr_exec $user $TOUCH ${node}/tmpfile > \
+                       chgusr_exec $user touch ${node}/tmpfile > \
                                /dev/null 2>&1
                        return $? ;;
                *"execute:"*|execute)
-                       chgusr_exec $user $FIND $node > /dev/null 2>&1
+                       chgusr_exec $user find $node > /dev/null 2>&1
                        return $? ;;
                esac
        else
                case $acl_spec in
                *:read_data:*|read_data)
-                       chgusr_exec $user $CAT $node > /dev/null 2>&1
+                       chgusr_exec $user cat $node > /dev/null 2>&1
                        return $? ;;
                *:write_data:*|write_data)
-                       chgusr_exec $user $DD if=/usr/bin/ls of=$node > \
+                       chgusr_exec $user dd if=/usr/bin/ls of=$node > \
                                /dev/null 2>&1
                        return $? ;;
                *"execute:"*|execute)
@@ -405,9 +409,9 @@ function get_xattr #<obj>
                return 1
        fi
 
-       for xattr in `$RUNAT $obj $LS | \
+       for xattr in `runat $obj ls | \
                /usr/xpg4/bin/egrep -v -e SUNWattr_ro -e SUNWattr_rw` ; do
-               $RUNAT $obj $SUM $xattr
+               runat $obj sum $xattr
        done
 }
 
@@ -424,12 +428,12 @@ function get_owner #node
        fi
 
        if [[ -d $node ]]; then
-               value=$($LS -dl $node | $AWK '{print $3}')
+               value=$(ls -dl $node | awk '{print $3}')
        elif [[ -e $node ]]; then
-               value=$($LS -l $node | $AWK '{print $3}')
+               value=$(ls -l $node | awk '{print $3}')
        fi
 
-       $ECHO $value
+       echo $value
 }
 
 #
@@ -445,12 +449,12 @@ function get_group #node
        fi
 
        if [[ -d $node ]]; then
-               value=$($LS -dl $node | $AWK '{print $4}')
+               value=$(ls -dl $node | awk '{print $4}')
        elif [[ -e $node ]]; then
-               value=$($LS -l $node | $AWK '{print $4}')
+               value=$(ls -l $node | awk '{print $4}')
        fi
 
-       $ECHO $value
+       echo $value
 }
 
 
@@ -471,7 +475,7 @@ function get_user_group #uid
        if [[ $? -eq 0 ]]; then
                value=${value##*\(}
                value=${value%%\)*}
-               $ECHO $value
+               echo $value
        else
                log_fail "Invalid UID (uid)."
        fi
@@ -509,17 +513,17 @@ function cksum_files #<dir> <file_array_name> <attribute_array_name>
        [[ ! -d $dir ]] && return
        typeset oldpwd=$PWD
        cd $dir
-       typeset files=$($LS file*)
+       typeset files=$(ls file*)
 
        typeset -i i=0
        typeset -i n=0
        while (( i < NUM_FILE )); do
                typeset f=$(getitem $i $files)
-               eval $farr_name[$i]=\$\(\$CKSUM $f\)
+               eval $farr_name[$i]=\$\(\cksum $f\)
 
                typeset -i j=0
                while (( j < NUM_ATTR )); do
-                       eval $aarr_name[$n]=\$\(\$RUNAT \$f \$CKSUM \
+                       eval $aarr_name[$n]=\$\(\runat \$f \cksum \
                                attribute.$j\)
 
                        (( j += 1 ))
@@ -571,12 +575,12 @@ function record_cksum #<outfile>
        typeset dir=$1
        typeset outfile=$2
 
-       [[ ! -d ${outfile%/*} ]] && usr_exec $MKDIR -p ${outfile%/*}
+       [[ ! -d ${outfile%/*} ]] && usr_exec mkdir -p ${outfile%/*}
 
-       usr_exec cd $dir ; $FIND . -depth -type f -exec cksum {} \\\; | \
-           $SORT > $outfile
-       usr_exec cd $dir ; $FIND . -depth -type f -xattr -exec runat {} \
-               cksum attribute* \\\; | $SORT >> $outfile
+       usr_exec cd $dir ; find . -depth -type f -exec cksum {} \\\; | \
+           sort > $outfile
+       usr_exec cd $dir ; find . -depth -type f -xattr -exec runat {} \
+               cksum attribute* \\\; | sort >> $outfile
 }
 
 #
@@ -589,20 +593,20 @@ function create_files #<directory>
 {
        typeset basedir=$1
 
-       [[ ! -d $basedir ]] && usr_exec $MKDIR -m 777 $basedir
-       [[ ! -d $RES_DIR  ]] && usr_exec $MKDIR -m 777 $RES_DIR
-       [[ ! -d $INI_DIR ]] && usr_exec $MKDIR -m 777 $INI_DIR
-       [[ ! -d $TST_DIR ]] && usr_exec $MKDIR -m 777 $TST_DIR
-       [[ ! -d $TMP_DIR  ]] && usr_exec $MKDIR -m 777 $TMP_DIR
+       [[ ! -d $basedir ]] && usr_exec mkdir -m 777 $basedir
+       [[ ! -d $RES_DIR  ]] && usr_exec mkdir -m 777 $RES_DIR
+       [[ ! -d $INI_DIR ]] && usr_exec mkdir -m 777 $INI_DIR
+       [[ ! -d $TST_DIR ]] && usr_exec mkdir -m 777 $TST_DIR
+       [[ ! -d $TMP_DIR  ]] && usr_exec mkdir -m 777 $TMP_DIR
 
        #
        # Create the original file and its attribute files.
        #
        [[ ! -a $RES_DIR/file ]] && \
-               usr_exec $FILE_WRITE -o create -f $RES_DIR/file \
+               usr_exec file_write -o create -f $RES_DIR/file \
                        -b 1024 -d 0 -c 1
        [[ ! -a $RES_DIR/attribute ]] && \
-               usr_exec $CP $RES_DIR/file $RES_DIR/attribute
+               usr_exec cp $RES_DIR/file $RES_DIR/attribute
 
        typeset oldpwd=$PWD
        cd $INI_DIR
@@ -610,12 +614,12 @@ function create_files #<directory>
        typeset -i i=0
        while (( i < NUM_FILE )); do
                typeset dstfile=$INI_DIR/file.$$.$i
-               usr_exec $CP $RES_DIR/file $dstfile
+               usr_exec cp $RES_DIR/file $dstfile
 
                typeset -i j=0
                while (( j < NUM_ATTR )); do
-                       usr_exec $RUNAT $dstfile \
-                               $CP $RES_DIR/attribute ./attribute.$j
+                       usr_exec runat $dstfile \
+                               cp $RES_DIR/attribute ./attribute.$j
                        (( j += 1 ))
                done
 
index 25c250f3fc9c741b2d83a2de0679f1e40119d848..1669dd6dac0017b4ad15efacafe866c6f1aa65e9 100755 (executable)
@@ -47,20 +47,20 @@ log_assert "Verify acltype=posixacl works on file"
 
 # Test access to FILE
 log_note "Testing access to FILE"
-log_must $TOUCH $TESTDIR/file.0
-log_must $SETFACL -m g:zfsgrp:rw $TESTDIR/file.0
-$GETFACL $TESTDIR/file.0 2> /dev/null | $EGREP -q "^group:zfsgrp:rw-$"
+log_must touch $TESTDIR/file.0
+log_must setfacl -m g:zfsgrp:rw $TESTDIR/file.0
+getfacl $TESTDIR/file.0 2> /dev/null | egrep -q "^group:zfsgrp:rw-$"
 if [ "$?" -eq "0" ]; then
        # Should be able to write to file
-       log_must $SU staff1 -c "$ECHO \"$ECHO test > /dev/null\" > $TESTDIR/file.0"
+       log_must su staff1 -c "echo \"echo test > /dev/null\" > $TESTDIR/file.0"
 
        # Should NOT be able to create new file
-       log_mustnot $SU staff1 -c "$TOUCH $TESTDIR/file.1"
+       log_mustnot su staff1 -c "touch $TESTDIR/file.1"
 
        # Root should be able to run file, but not user
        chmod +x $TESTDIR/file.0
        log_must $TESTDIR/file.0
-       log_mustnot $SU staff1 -c $TESTDIR/file.0
+       log_mustnot su staff1 -c $TESTDIR/file.0
 
        log_pass "POSIX ACL mode works on files"
 else
index fcd01149cb49776984117bdf25060d4dbc55d7f6..fec9efb10886debc23b7365424d7f7a73811e791 100755 (executable)
@@ -46,15 +46,15 @@ log_assert "Verify acltype=posixacl works on directory"
 
 # Test access to DIRECTORY
 log_note "Testing access to DIRECTORY"
-log_must $MKDIR $TESTDIR/dir.0
-log_must $SETFACL -m g:zfsgrp:wx $TESTDIR/dir.0
-$GETFACL $TESTDIR/dir.0 2> /dev/null | $EGREP -q "^group:zfsgrp:-wx$"
+log_must mkdir $TESTDIR/dir.0
+log_must setfacl -m g:zfsgrp:wx $TESTDIR/dir.0
+getfacl $TESTDIR/dir.0 2> /dev/null | egrep -q "^group:zfsgrp:-wx$"
 if [ "$?" -eq "0" ]; then
        # Should be able to create file in directory
-       log_must $SU staff1 -c "$TOUCH $TESTDIR/dir.0/file.0"
+       log_must su staff1 -c "touch $TESTDIR/dir.0/file.0"
 
        # Should NOT be able to list files in directory
-       log_mustnot $SU staff1 -c "$LS -l $TESTDIR/dir.0"
+       log_mustnot su staff1 -c "ls -l $TESTDIR/dir.0"
 
        log_pass "POSIX ACL mode works on directories"
 else
index 535214fbd2b54957d5a5379843ce059abc9b640a..9a56b3874e922b4ae7eec1ddd4d282e6444ace84 100755 (executable)
@@ -42,19 +42,19 @@ typeset acl_str2="^default:group:${ZFS_ACL_STAFF_GROUP}:-wx$"
 typeset ACLDIR="${TESTDIR}/dir.1"
 
 log_note "Testing access to DIRECTORY"
-log_must $MKDIR $ACLDIR
-log_must $SETFACL -m g:${ZFS_ACL_STAFF_GROUP}:wx $ACLDIR
-log_must $SETFACL -d -m g:${ZFS_ACL_STAFF_GROUP}:wx $ACLDIR
-$GETFACL $ACLDIR 2> /dev/null | $EGREP -q "${acl_str1}"
+log_must mkdir $ACLDIR
+log_must setfacl -m g:${ZFS_ACL_STAFF_GROUP}:wx $ACLDIR
+log_must setfacl -d -m g:${ZFS_ACL_STAFF_GROUP}:wx $ACLDIR
+getfacl $ACLDIR 2> /dev/null | egrep -q "${acl_str1}"
 if [ "$?" -eq "0" ]; then
-       $GETFACL $ACLDIR 2> /dev/null | $EGREP -q "${acl_str2}"
+       getfacl $ACLDIR 2> /dev/null | egrep -q "${acl_str2}"
 fi
 
 if [ "$?" -eq "0" ]; then
-       log_must $ZFS unmount $TESTPOOL/$TESTFS
-       log_must $ZFS mount $TESTPOOL/$TESTFS
-       log_must eval '$GETFACL $ACLDIR 2> /dev/null | $EGREP -q "${acl_str1}"'
-       log_must eval '$GETFACL $ACLDIR 2> /dev/null | $EGREP -q "${acl_str2}"'
+       log_must zfs unmount $TESTPOOL/$TESTFS
+       log_must zfs mount $TESTPOOL/$TESTFS
+       log_must eval 'getfacl $ACLDIR 2> /dev/null | egrep -q "${acl_str1}"'
+       log_must eval 'getfacl $ACLDIR 2> /dev/null | egrep -q "${acl_str2}"'
        log_pass "POSIX ACLs survive remount"
 else
        log_fail "Group '${ZFS_ACL_STAFF_GROUP}' does not have 'rwx'"
index dc17f7cd2f7cd493918dfce45be79003c0064d5e..5d6d15864134f59373b3c31f1a19909041eca72f 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/acl/acl_common.kshlib
 
-log_must $GETFACL --version
-log_must $SETFACL --version
+log_must getfacl --version
+log_must setfacl --version
 
 cleanup_user_group
 
@@ -39,10 +43,10 @@ log_must add_user $ZFS_ACL_STAFF_GROUP $ZFS_ACL_STAFF1
 
 DISK=${DISKS%% *}
 default_setup_noexit $DISK
-log_must $CHMOD 777 $TESTDIR
+log_must chmod 777 $TESTDIR
 
 # Use POSIX ACLs on filesystem
-log_must $ZFS set acltype=posixacl $TESTPOOL/$TESTFS
-log_must $ZFS set xattr=sa $TESTPOOL/$TESTFS
+log_must zfs set acltype=posixacl $TESTPOOL/$TESTFS
+log_must zfs set xattr=sa $TESTPOOL/$TESTFS
 
 log_pass
index 5db0eaf1433de1e4657f7806fdd5f377e54288af..274a4da0dcb95bdd1a7b9112a3cac22162abdd63 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/atime/atime_common.kshlib
 
 #
@@ -58,8 +62,11 @@ do
                mtpt=$(snapshot_mountpoint $dst)
                log_mustnot check_atime_updated $mtpt/$TESTFILE
        else
-               log_must $ZFS set atime=on $dst
-               log_must $ZFS set relatime=off $dst
+               if is_linux; then
+                       log_must zfs set relatime=off $dst
+               fi
+
+               log_must zfs set atime=on $dst
                log_must check_atime_updated $mtpt/$TESTFILE
                log_must check_atime_updated $mtpt/$TESTFILE
        fi
index 06a35cc117e79775255aa4b38ce9b2c1f0beb335..c8579337c053c9a9c3afdc625ec35b3cb433efe4 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/atime/atime_common.kshlib
 
 #
@@ -58,7 +62,7 @@ do
        if [[ $dst == $TESTPOOL/$TESTFS@$TESTSNAP ]]; then
                mtpt=$(snapshot_mountpoint $dst)
        else
-               log_must $ZFS set atime=off $dst
+               log_must zfs set atime=off $dst
        fi
 
        log_mustnot check_atime_updated $mtpt/$TESTFILE
index 359f4a055caa6361d9538d829067beeabdc8b385..d3eec92effbceaf32a1edf9152cf4a3df37d3648 100755 (executable)
@@ -60,8 +60,8 @@ do
                mtpt=$(snapshot_mountpoint $dst)
                log_mustnot check_atime_updated $mtpt/$TESTFILE
        else
-               log_must $ZFS set atime=on $dst
-               log_must $ZFS set relatime=on $dst
+               log_must zfs set atime=on $dst
+               log_must zfs set relatime=on $dst
                log_must check_atime_updated $mtpt/$TESTFILE
                log_mustnot check_atime_updated $mtpt/$TESTFILE
        fi
index c2f90eb4cb7d1b0c2f7c0a1ded4f3c4bd03b4000..47de4326700efabe18603ee48db10b7b04d93298 100644 (file)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/atime/atime.cfg
 . $STF_SUITE/include/libtest.shlib
 
@@ -44,15 +48,15 @@ function check_atime_updated
                typeset before=$(stat -c %X $filename)
                sleep 2
        else
-               typeset before=$($LS -Eu $filename | $AWK '{print $7}')
+               typeset before=$(ls -Eu $filename | awk '{print $7}')
        fi
 
-       log_must $CAT $filename
+       log_must cat $filename
 
        if is_linux; then
                typeset after=$(stat -c %X $filename)
        else
-               typeset after=$($LS -Eu $filename | $AWK '{print $7}')
+               typeset after=$(ls -Eu $filename | awk '{print $7}')
        fi
 
        if [[ $before != $after ]]; then
@@ -65,7 +69,7 @@ function check_atime_updated
 function setup_snap_clone
 {
        # Create two file to verify snapshot.
-       log_must $TOUCH $TESTDIR/$TESTFILE
+       log_must touch $TESTDIR/$TESTFILE
 
        create_snapshot $TESTPOOL/$TESTFS $TESTSNAP
        create_clone $TESTPOOL/$TESTFS@$TESTSNAP $TESTPOOL/$TESTCLONE
index 2d67258efb94317047a396a953934b8a590ac874..3f60d9eedadeb124404e0bc2b9abb066db81120a 100755 (executable)
@@ -28,7 +28,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,15 +47,15 @@ verify_runnable "global"
 
 function cleanup {
        if poolexists $TESTPOOL ; then
-               log_must $ZPOOL destroy $TESTPOOL
+               log_must zpool destroy $TESTPOOL
        fi
 
        if [[ -f $VDEV ]]; then
-               log_must $RM -f $VDEV
+               log_must rm -f $VDEV
        fi
 }
 
-$ZPOOL set 2>&1 | $GREP bootfs > /dev/null
+zpool set 2>&1 | grep bootfs > /dev/null
 if [ $? -ne 0 ]
 then
         log_unsupported "bootfs pool property not supported on this release."
@@ -66,17 +66,17 @@ log_onexit cleanup
 
 typeset VDEV=$TESTDIR/bootfs_001_pos_a.$$.dat
 
-log_must $MKFILE $MINVDEVSIZE $VDEV
+log_must mkfile $MINVDEVSIZE $VDEV
 create_pool "$TESTPOOL" "$VDEV"
-log_must $ZFS create $TESTPOOL/$TESTFS
+log_must zfs create $TESTPOOL/$TESTFS
 
-log_must $ZFS snapshot $TESTPOOL/$TESTFS@snap
-log_must $ZFS clone $TESTPOOL/$TESTFS@snap $TESTPOOL/clone
+log_must zfs snapshot $TESTPOOL/$TESTFS@snap
+log_must zfs clone $TESTPOOL/$TESTFS@snap $TESTPOOL/clone
 
-log_must $ZPOOL set bootfs=$TESTPOOL/$TESTFS $TESTPOOL
-log_must $ZPOOL set bootfs=$TESTPOOL/$TESTFS@snap $TESTPOOL
-log_must $ZPOOL set bootfs=$TESTPOOL/clone $TESTPOOL
+log_must zpool set bootfs=$TESTPOOL/$TESTFS $TESTPOOL
+log_must zpool set bootfs=$TESTPOOL/$TESTFS@snap $TESTPOOL
+log_must zpool set bootfs=$TESTPOOL/clone $TESTPOOL
 
-log_must $ZFS promote $TESTPOOL/clone
-log_must $ZPOOL set bootfs=$TESTPOOL/clone $TESTPOOL
+log_must zfs promote $TESTPOOL/clone
+log_must zpool set bootfs=$TESTPOOL/clone $TESTPOOL
 log_pass "Valid datasets are accepted as bootfs property values"
index cb1a1c9b9c7de46b21f00629ffd890366768250b..8ee48dba59fc5a0b4689cf0cb3b076b86ca2bf31 100755 (executable)
@@ -28,7 +28,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -49,19 +49,19 @@ verify_runnable "global"
 function cleanup {
        if datasetexists $TESTPOOL/vol
        then
-               log_must $ZFS destroy $TESTPOOL/vol
+               log_must zfs destroy $TESTPOOL/vol
        fi
        if poolexists $TESTPOOL
        then
-               log_must $ZPOOL destroy $TESTPOOL
+               log_must zpool destroy $TESTPOOL
        fi
        if [[ -f $VDEV ]]; then
-               log_must $RM -f $VDEV
+               log_must rm -f $VDEV
        fi
 }
 
 
-$ZPOOL set 2>&1 | $GREP bootfs > /dev/null
+zpool set 2>&1 | grep bootfs > /dev/null
 if [ $? -ne 0 ]
 then
        log_unsupported "bootfs pool property not supported on this release."
@@ -72,11 +72,11 @@ log_onexit cleanup
 
 typeset VDEV=$TESTDIR/bootfs_002_neg_a.$$.dat
 
-log_must $MKFILE 400m $VDEV
+log_must mkfile 400m $VDEV
 create_pool "$TESTPOOL" "$VDEV"
-log_must $ZFS create -V 10m $TESTPOOL/vol
+log_must zfs create -V 10m $TESTPOOL/vol
 block_device_wait
 
-log_mustnot $ZPOOL set bootfs=$TESTPOOL/vol $TESTPOOL
+log_mustnot zpool set bootfs=$TESTPOOL/vol $TESTPOOL
 
 log_pass "Invalid datasets are rejected as boot property values"
index 2ead6164022a696007211e0440bd80bc6802a45e..83a582396dab44fd4f092791a6c43d37fb6c7340 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,13 +48,13 @@ set -A pools "pool.$$" "pool123" "mypool"
 
 function cleanup {
        if poolexists $POOL ; then
-               log_must $ZPOOL destroy $POOL
+               log_must zpool destroy $POOL
        fi
-       $RM /bootfs_003.$$.dat
+       rm /bootfs_003.$$.dat
 }
 
 
-$ZPOOL set 2>&1 | $GREP bootfs > /dev/null
+zpool set 2>&1 | grep bootfs > /dev/null
 if [ $? -ne 0 ]
 then
         log_unsupported "bootfs pool property not supported on this release."
@@ -63,23 +63,23 @@ fi
 log_onexit cleanup
 
 log_assert "Valid pool names are accepted by zpool set bootfs"
-$MKFILE $MINVDEVSIZE $TESTDIR/bootfs_003.$$.dat
+mkfile $MINVDEVSIZE $TESTDIR/bootfs_003.$$.dat
 
 typeset -i i=0;
 
 while [ $i -lt "${#pools[@]}" ]
 do
        POOL=${pools[$i]}
-       log_must $ZPOOL create $POOL $TESTDIR/bootfs_003.$$.dat
-       log_must $ZFS create $POOL/$TESTFS
+       log_must zpool create $POOL $TESTDIR/bootfs_003.$$.dat
+       log_must zfs create $POOL/$TESTFS
 
-       log_must $ZPOOL set bootfs=$POOL/$TESTFS $POOL
-       RES=$($ZPOOL get bootfs $POOL | $TAIL -1 | $AWK '{print $3}' )
+       log_must zpool set bootfs=$POOL/$TESTFS $POOL
+       RES=$(zpool get bootfs $POOL | tail -1 | awk '{print $3}' )
        if [ $RES != "$POOL/$TESTFS" ]
        then
                log_fail "Expected $RES == $POOL/$TESTFS"
        fi
-       log_must $ZPOOL destroy $POOL
+       log_must zpool destroy $POOL
        i=$(( $i + 1 ))
 done
 
index 764147d0de7d076fddeb77b3fb58d49c6f2f76ee..9a5d7507a0380c0d840deee296dc751a26e541dd 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -49,13 +49,13 @@ set -A pools "pool//$$" "pool%d123" "mirror" "c0t0d0s0" "pool*23*" "*po!l" \
 
 function cleanup {
        if poolexists $POOL; then
-               log_must $ZPOOL destroy $POOL
+               log_must zpool destroy $POOL
        fi
-       $RM /bootfs_004.$$.dat
+       rm /bootfs_004.$$.dat
 }
 
 
-$ZPOOL set 2>&1 | $GREP bootfs > /dev/null
+zpool set 2>&1 | grep bootfs > /dev/null
 if [ $? -ne 0 ]
 then
         log_unsupported "bootfs pool property not supported on this release."
@@ -78,16 +78,16 @@ pools[${#pools[@]}]="$bigname"
 
 
 
-$MKFILE $MINVDEVSIZE $TESTDIR/bootfs_004.$$.dat
+mkfile $MINVDEVSIZE $TESTDIR/bootfs_004.$$.dat
 
 typeset -i i=0;
 
 while [ $i -lt "${#pools[@]}" ]
 do
        POOL=${pools[$i]}/$TESTFS
-       log_mustnot $ZPOOL create $POOL $TESTDIR/bootfs_004.$$.dat
-       log_mustnot $ZFS create $POOL/$TESTFS
-       log_mustnot $ZPOOL set bootfs=$POOL/$TESTFS $POOL
+       log_mustnot zpool create $POOL $TESTDIR/bootfs_004.$$.dat
+       log_mustnot zfs create $POOL/$TESTFS
+       log_mustnot zpool set bootfs=$POOL/$TESTFS $POOL
 
        i=$(( $i + 1 ))
 done
index 82932a7dcd161e1a9ba889ee1d022c24b18635c1..42c82b88fba6a1513f8c59f19ab9fe91c088eba6 100755 (executable)
@@ -52,7 +52,7 @@ function cleanup {
        #
        typeset pool_name
        for config in $CONFIGS; do
-               pool_name=$(eval $ECHO \$ZPOOL_VERSION_${config}_NAME)
+               pool_name=$(eval echo \$ZPOOL_VERSION_${config}_NAME)
                destroy_pool $pool_name
        done
 
@@ -65,14 +65,14 @@ log_assert "Boot properties cannot be set on pools with older versions"
 CONFIGS="1 2 3"
 
 log_onexit cleanup
-log_must $ZPOOL create -f $TESTPOOL $DISKS
+log_must zpool create -f $TESTPOOL $DISKS
 
 for config in $CONFIGS
 do
        create_old_pool $config
-       POOL_NAME=$(eval $ECHO \$ZPOOL_VERSION_${config}_NAME)
-       log_must $ZFS create $POOL_NAME/$TESTFS
-       log_mustnot $ZPOOL set bootfs=$POOL_NAME/$TESTFS $POOL_NAME
+       POOL_NAME=$(eval echo \$ZPOOL_VERSION_${config}_NAME)
+       log_must zfs create $POOL_NAME/$TESTFS
+       log_mustnot zpool set bootfs=$POOL_NAME/$TESTFS $POOL_NAME
        log_must destroy_upgraded_pool $config
 done
 
index ab6cae1ee347cd4885cb8f4c3e73046a580a1d9d..012b0a1cbf71288f567908a9ff1321a3fc2aa09a 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -44,7 +44,7 @@
 verify_runnable "global"
 
 
-$ZPOOL set 2>&1 | $GREP bootfs > /dev/null
+zpool set 2>&1 | grep bootfs > /dev/null
 if [ $? -ne 0 ]
 then
        log_unsupported "bootfs pool property not supported on this release."
@@ -57,38 +57,38 @@ VDEV4=$TESTDIR/bootfs_006_pos_d.$$.dat
 
 function verify_bootfs { # $POOL
        POOL=$1
-       log_must $ZFS create $POOL/$TESTFS
+       log_must zfs create $POOL/$TESTFS
 
-       log_must $ZPOOL set bootfs=$POOL/$TESTFS $POOL
-       VAL=$($ZPOOL get bootfs $POOL | $TAIL -1 | $AWK '{print $3}' )
+       log_must zpool set bootfs=$POOL/$TESTFS $POOL
+       VAL=$(zpool get bootfs $POOL | tail -1 | awk '{print $3}' )
        if [ $VAL != "$POOL/$TESTFS" ]
        then
-               log_must $ZPOOL status -v $POOL
+               log_must zpool status -v $POOL
                log_fail \
                    "set/get failed on $POOL - expected $VAL == $POOL/$TESTFS"
        fi
-       log_must $ZPOOL destroy $POOL
+       log_must zpool destroy $POOL
 }
 
 function verify_no_bootfs { # $POOL
        POOL=$1
-       log_must $ZFS create $POOL/$TESTFS
-       log_mustnot $ZPOOL set bootfs=$POOL/$TESTFS $POOL
-       VAL=$($ZPOOL get bootfs $POOL | $TAIL -1 | $AWK '{print $3}' )
+       log_must zfs create $POOL/$TESTFS
+       log_mustnot zpool set bootfs=$POOL/$TESTFS $POOL
+       VAL=$(zpool get bootfs $POOL | tail -1 | awk '{print $3}' )
        if [ $VAL == "$POOL/$TESTFS" ]
        then
-               log_must $ZPOOL status -v $POOL
+               log_must zpool status -v $POOL
                log_fail "set/get unexpectedly failed $VAL != $POOL/$TESTFS"
        fi
-       log_must $ZPOOL destroy $POOL
+       log_must zpool destroy $POOL
 }
 
 function cleanup {
        if poolexists $TESTPOOL
        then
-               log_must $ZPOOL destroy $TESTPOOL
+               log_must zpool destroy $TESTPOOL
        fi
-       log_must $RM $VDEV1 $VDEV2 $VDEV3 $VDEV4
+       log_must rm $VDEV1 $VDEV2 $VDEV3 $VDEV4
 }
 
 log_assert "Pools of correct vdev types accept boot property"
@@ -96,51 +96,51 @@ log_assert "Pools of correct vdev types accept boot property"
 
 
 log_onexit cleanup
-log_must $MKFILE $MINVDEVSIZE $VDEV1 $VDEV2 $VDEV3 $VDEV4
+log_must mkfile $MINVDEVSIZE $VDEV1 $VDEV2 $VDEV3 $VDEV4
 
 
 ## the following configurations are supported bootable pools
 
 # normal
-log_must $ZPOOL create $TESTPOOL $VDEV1
+log_must zpool create $TESTPOOL $VDEV1
 verify_bootfs $TESTPOOL
 
 # normal + hotspare
-log_must $ZPOOL create $TESTPOOL $VDEV1 spare $VDEV2
+log_must zpool create $TESTPOOL $VDEV1 spare $VDEV2
 verify_bootfs $TESTPOOL
 
 # mirror
-log_must $ZPOOL create $TESTPOOL mirror $VDEV1 $VDEV2
+log_must zpool create $TESTPOOL mirror $VDEV1 $VDEV2
 verify_bootfs $TESTPOOL
 
 # mirror + hotspare
-log_must $ZPOOL create $TESTPOOL mirror $VDEV1 $VDEV2 spare $VDEV3
+log_must zpool create $TESTPOOL mirror $VDEV1 $VDEV2 spare $VDEV3
 verify_bootfs $TESTPOOL
 
 ## the following configurations are not supported as bootable pools
 
 # stripe
-log_must $ZPOOL create $TESTPOOL $VDEV1 $VDEV2
+log_must zpool create $TESTPOOL $VDEV1 $VDEV2
 verify_no_bootfs $TESTPOOL
 
 # stripe + hotspare
-log_must $ZPOOL create $TESTPOOL $VDEV1 $VDEV2 spare $VDEV3
+log_must zpool create $TESTPOOL $VDEV1 $VDEV2 spare $VDEV3
 verify_no_bootfs $TESTPOOL
 
 # raidz
-log_must $ZPOOL create $TESTPOOL raidz $VDEV1 $VDEV2
+log_must zpool create $TESTPOOL raidz $VDEV1 $VDEV2
 verify_no_bootfs $TESTPOOL
 
 # raidz + hotspare
-log_must $ZPOOL create $TESTPOOL raidz $VDEV1 $VDEV2 spare $VDEV3
+log_must zpool create $TESTPOOL raidz $VDEV1 $VDEV2 spare $VDEV3
 verify_no_bootfs $TESTPOOL
 
 # raidz2
-log_must $ZPOOL create $TESTPOOL raidz2 $VDEV1 $VDEV2 $VDEV3
+log_must zpool create $TESTPOOL raidz2 $VDEV1 $VDEV2 $VDEV3
 verify_no_bootfs $TESTPOOL
 
 # raidz2 + hotspare
-log_must $ZPOOL create $TESTPOOL raidz2 $VDEV1 $VDEV2 $VDEV3 spare $VDEV4
+log_must zpool create $TESTPOOL raidz2 $VDEV1 $VDEV2 $VDEV3 spare $VDEV4
 verify_no_bootfs $TESTPOOL
 
 log_pass "Pools of correct vdev types accept boot property"
index 6f6bb403ccbbc08b6f5c309b61a89350fcdc3814..3ccbdc9752bdb54b00b07bbb8e1527df7f89a510 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -56,12 +60,12 @@ typeset assert_mesg="setting bootfs on a pool which was configured with the \
 
 log_assert $assert_mesg
 create_pool "$TESTPOOL" "$DISK"
-log_must $ZFS create $EFI_BOOTFS
+log_must zfs create $EFI_BOOTFS
 
 if is_linux; then
-       log_must $ZPOOL set bootfs=$EFI_BOOTFS $TESTPOOL
+       log_must zpool set bootfs=$EFI_BOOTFS $TESTPOOL
 else
-       log_mustnot $ZPOOL set bootfs=$EFI_BOOTFS $TESTPOOL
+       log_mustnot zpool set bootfs=$EFI_BOOTFS $TESTPOOL
 fi
 
 log_pass $assert_mesg
index 56235f3be73bc25cf013ecbc641290b0fd7b7d07..2e71df86c62be28dd66190dea204c14127d1d1a9 100644 (file)
 # Copyright 2015 Nexenta Systems, Inc.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -58,8 +62,8 @@ typeset assert_mesg="setting bootfs on a pool which was configured with the \
 
 log_assert $assert_mesg
 create_pool "$TESTPOOL" "$DISK"
-log_must $ZFS create $EFI_BOOTFS
+log_must zfs create $EFI_BOOTFS
 
-log_must $ZPOOL set bootfs=$EFI_BOOTFS $TESTPOOL
+log_must zpool set bootfs=$EFI_BOOTFS $TESTPOOL
 
 log_pass $assert_mesg
index 57da5a24b3dfbeb5f504f3a1ef71363ccd8e99ef..e0a767d4cd331097f82bc1cd88f1c1dc5ca14fc0 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -51,7 +51,7 @@ function cleanup {
        fi
 
        if [[ -f $VDEV ]]; then
-               log_must $RM -f $VDEV
+               log_must rm -f $VDEV
        fi
 }
 
@@ -64,18 +64,18 @@ typeset COMP_FS=$TESTPOOL/COMP_FS
 log_onexit cleanup
 log_assert $assert_msg
 
-log_must $MKFILE $MINVDEVSIZE $VDEV
-log_must $ZPOOL create $TESTPOOL $VDEV
-log_must $ZFS create $COMP_FS
+log_must mkfile $MINVDEVSIZE $VDEV
+log_must zpool create $TESTPOOL $VDEV
+log_must zfs create $COMP_FS
 
 typeset -i i=0
 set -A gtype "gzip" "gzip-1" "gzip-2" "gzip-3" "gzip-4" "gzip-5" \
             "gzip-6" "gzip-7" "gzip-8" "gzip-9"
 
 while (( i < ${#gtype[@]} )); do
-       log_must $ZFS set compression=${gtype[i]} $COMP_FS
-       log_mustnot $ZPOOL set bootfs=$COMP_FS $TESTPOOL
-       log_must $ZFS set compression=off $COMP_FS
+       log_must zfs set compression=${gtype[i]} $COMP_FS
+       log_mustnot zpool set bootfs=$COMP_FS $TESTPOOL
+       log_must zfs set compression=off $COMP_FS
        (( i += 1 ))
 done
 
index f481a704b8f120877baa5f3a67b62a83e4a10458..71d8ced18206d602eb61e305c735a701dbd2f870 100755 (executable)
@@ -29,6 +29,6 @@
 
 verify_runnable "global"
 
-[[ -e $TESTDIR ]] && $RM -rf $TESTDIR
+[[ -e $TESTDIR ]] && rm -rf $TESTDIR
 
 log_pass
index 694a8051053077b11ea623d3b691274499a08f07..273f239137b0601e9dd84b7ab01b3b98124638b0 100755 (executable)
@@ -29,6 +29,6 @@
 
 verify_runnable "global"
 
-log_must $MKDIR $TESTDIR
+log_must mkdir $TESTDIR
 
 log_pass
index ef367e1dba82106d246ba31f6859292b53221913..26b56f68e579a26af9c5b19f4cc502ca8bbecea9 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 function cleanup
 {
        if datasetexists $TESTPOOL ; then
-               log_must $ZPOOL destroy -f $TESTPOOL
+               log_must zpool destroy -f $TESTPOOL
        fi
        if datasetexists $TESTPOOL2 ; then
-               log_must $ZPOOL destroy -f $TESTPOOL2
+               log_must zpool destroy -f $TESTPOOL2
        fi
 }
 
@@ -50,17 +50,17 @@ function display_status
        typeset pool=$1
 
        typeset -i ret=0
-       $ZPOOL status -xv $pool > /dev/null 2>&1
+       zpool status -xv $pool > /dev/null 2>&1
        ret=$?
 
-       $ZPOOL iostat > /dev/null 2>&1
+       zpool iostat > /dev/null 2>&1
        ((ret |= $?))
 
        typeset mntpnt=$(get_prop mountpoint $pool)
-       $DD if=/dev/random of=$mntpnt/testfile.$$ &
+       dd if=/dev/random of=$mntpnt/testfile.$$ &
        typeset pid=$!
 
-       $ZPOOL iostat -v 1 3 > /dev/null
+       zpool iostat -v 1 3 > /dev/null
        ((ret |= $?))
 
        kill -9 $pid
@@ -93,7 +93,7 @@ function verify_cache_device
        #
        # mirror:/disks/d ONLINE mirror:/disks/e ONLINE stripe:/disks/f ONLINE
        #
-       set -A dev_stat_tab $($ZPOOL status -v $pool | $NAWK 'BEGIN {start=0} \
+       set -A dev_stat_tab $(zpool status -v $pool | nawk 'BEGIN {start=0} \
                                /\tcache/ {start=1}
                                /\tmirror/ || /\tspares/ || /^$/ {start=0}
                                (start==1) && /\t  (\/|[a-zA-Z])/ \
@@ -148,6 +148,6 @@ function verify_cache_device
 
 function verify_cache_support
 {
-       $ZPOOL upgrade -v | $GREP "Cache devices" > /dev/null 2>&1
+       zpool upgrade -v | grep "Cache devices" > /dev/null 2>&1
        return $?
 }
index 7b4f560c833539793388d52c0afde769a521ea22..955c9f12019f9af2d70383b274ffd2428dfb8881 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cache/cache.cfg
@@ -49,17 +49,17 @@ log_onexit cleanup
 
 for type in "" "mirror" "raidz" "raidz2"
 do
-       log_must $ZPOOL create $TESTPOOL $type $VDEV \
+       log_must zpool create $TESTPOOL $type $VDEV \
                cache $LDEV
        log_must display_status $TESTPOOL
 
        ldev=$(random_get $LDEV)
        log_must verify_cache_device $TESTPOOL $ldev 'ONLINE'
 
-       log_must $ZPOOL remove $TESTPOOL $ldev
+       log_must zpool remove $TESTPOOL $ldev
        log_must check_vdev_state $TESTPOOL $ldev ""
 
-       log_must $ZPOOL destroy -f $TESTPOOL
+       log_must zpool destroy -f $TESTPOOL
 done
 
 log_pass "Creating a pool with a cache device succeeds."
index 5c2c34e14b263c11992d22ec21759ff61622793e..888645c353e8d128728e448a1a126ea8dd1d8371 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cache/cache.cfg
@@ -50,16 +50,16 @@ log_onexit cleanup
 
 for type in "" "mirror" "raidz" "raidz2"
 do
-       log_must $ZPOOL create $TESTPOOL $type $VDEV
-       log_must $ZPOOL add $TESTPOOL cache $LDEV
+       log_must zpool create $TESTPOOL $type $VDEV
+       log_must zpool add $TESTPOOL cache $LDEV
        log_must display_status $TESTPOOL
        typeset ldev=$(random_get $LDEV)
        log_must verify_cache_device $TESTPOOL $ldev 'ONLINE'
 
-       log_must $ZPOOL remove $TESTPOOL $ldev
+       log_must zpool remove $TESTPOOL $ldev
        log_must check_vdev_state $TESTPOOL $ldev ""
 
-       log_must $ZPOOL destroy -f $TESTPOOL
+       log_must zpool destroy -f $TESTPOOL
 done
 
 log_pass "Adding a cache device to normal pool works."
index 73b5d34d544ad1288d14af6f8fe91d53ed22c91d..566c5c6ac67514d27ad6eb6c3df9f009f161f24b 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cache/cache.cfg
@@ -51,19 +51,19 @@ log_onexit cleanup
 
 for type in "" "mirror" "raidz" "raidz2"
 do
-       log_must $ZPOOL create $TESTPOOL $type $VDEV \
+       log_must zpool create $TESTPOOL $type $VDEV \
                cache $LDEV
-       log_must $ZPOOL add $TESTPOOL \
+       log_must zpool add $TESTPOOL \
                cache $LDEV2
 
        log_must display_status $TESTPOOL
        ldev=$(random_get $LDEV2)
        log_must verify_cache_device $TESTPOOL $ldev 'ONLINE'
 
-       log_must $ZPOOL remove $TESTPOOL $ldev
+       log_must zpool remove $TESTPOOL $ldev
        log_must check_vdev_state $TESTPOOL $ldev ""
 
-       log_must $ZPOOL destroy -f $TESTPOOL
+       log_must zpool destroy -f $TESTPOOL
 done
 
 log_pass "Adding an extra cache device works."
index e71d4d093a85657121261381d1f3747a32ee2701..38fee608bbc85e9ae2d5ca56f27529ad0ab7acd5 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cache/cache.cfg
@@ -50,15 +50,15 @@ log_onexit cleanup
 
 for type in "" "mirror" "raidz" "raidz2"
 do
-       log_must $ZPOOL create $TESTPOOL $type $VDEV \
+       log_must zpool create $TESTPOOL $type $VDEV \
                cache $LDEV
 
        ldev=$(random_get $LDEV)
        typeset ldev2=$(random_get $LDEV2)
-       log_mustnot $ZPOOL attach $TESTPOOL $ldev $ldev2
+       log_mustnot zpool attach $TESTPOOL $ldev $ldev2
        log_must check_vdev_state $TESTPOOL $ldev2 ""
 
-       log_must $ZPOOL destroy -f $TESTPOOL
+       log_must zpool destroy -f $TESTPOOL
 done
 
 log_pass "Attaching a cache device fails for an existing cache device."
index 6f61326fd99816f4c218c014850368e046143ad4..35e15abe2602d9612b536be8d5b2ff2a79667c30 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cache/cache.cfg
@@ -51,15 +51,15 @@ log_onexit cleanup
 
 for type in "" "mirror" "raidz" "raidz2"
 do
-       log_must $ZPOOL create $TESTPOOL $type $VDEV \
+       log_must zpool create $TESTPOOL $type $VDEV \
                cache $LDEV
        sdev=$(random_get $LDEV)
        tdev=$(random_get $LDEV2)
-       log_mustnot $ZPOOL replace $TESTPOOL $sdev $tdev
+       log_mustnot zpool replace $TESTPOOL $sdev $tdev
        log_must verify_cache_device $TESTPOOL $sdev 'ONLINE'
        log_must check_vdev_state $TESTPOOL $tdev ""
 
-       log_must $ZPOOL destroy -f $TESTPOOL
+       log_must zpool destroy -f $TESTPOOL
 done
 
 log_pass "Replacing a cache device fails."
index 1ced5abe013bc5167b9f5c309b4d5e4722213fb3..46bd5fc8b3ef800bdbf3d7f3869e058e35243058 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cache/cache.cfg
@@ -53,7 +53,7 @@ log_onexit cleanup
 
 for type in "" "mirror" "raidz" "raidz2"
 do
-       log_must $ZPOOL create $TESTPOOL $type $VDEV \
+       log_must zpool create $TESTPOOL $type $VDEV \
                cache $LDEV $LDEV2
        ldev=$(random_get $LDEV $LDEV2)
        log_must verify_cache_device \
@@ -62,8 +62,8 @@ do
        #
        # Nomal export/import operating
        #
-       log_must $ZPOOL export $TESTPOOL
-       log_must $ZPOOL import -d $VDIR $TESTPOOL
+       log_must zpool export $TESTPOOL
+       log_must zpool import -d $VDIR $TESTPOOL
        log_must display_status $TESTPOOL
        ldev=$(random_get $LDEV $LDEV2)
        log_must verify_cache_device \
@@ -72,14 +72,14 @@ do
        #
        # Destroy the pool and import again
        #
-       log_must $ZPOOL destroy $TESTPOOL
-       log_must $ZPOOL import -Df -d $VDIR $TESTPOOL
+       log_must zpool destroy $TESTPOOL
+       log_must zpool import -Df -d $VDIR $TESTPOOL
        log_must display_status $TESTPOOL
        ldev=$(random_get $LDEV $LDEV2)
        log_must verify_cache_device \
                $TESTPOOL $ldev 'ONLINE'
 
-       log_must $ZPOOL destroy -f $TESTPOOL
+       log_must zpool destroy -f $TESTPOOL
 done
 
 log_pass "Exporting and importing pool with cache devices passes."
index 3f204ef4bd13eebaa4530d7d82de0abfb1b5f12a..e2cdc0a28d38b2f082e0f9150ae096f48af99fd9 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cache/cache.cfg
@@ -51,7 +51,7 @@ for type in "" "mirror" "raidz" "raidz2"
 do
        for cachetype in "mirror" "raidz" "raidz1" "raidz2"
        do
-               log_mustnot $ZPOOL create $TESTPOOL $type $VDEV \
+               log_mustnot zpool create $TESTPOOL $type $VDEV \
                        cache $cachetype $LDEV $LDEV2
                ldev=$(random_get $LDEV $LDEV2)
                log_mustnot verify_cache_device \
index c251c5afbb2677a56b9c7f5521e756d8c153cf29..93866dd3097f6a2dd335349a0e71b7f52f18be87 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cache/cache.cfg
@@ -52,15 +52,15 @@ for type in "" "mirror" "raidz" "raidz2"
 do
        for cachetype in "mirror" "raidz" "raidz1" "raidz2"
        do
-               log_must $ZPOOL create $TESTPOOL $type $VDEV \
+               log_must zpool create $TESTPOOL $type $VDEV \
                        cache $LDEV
 
-               log_mustnot $ZPOOL add $TESTPOOL cache $cachetype $LDEV2
+               log_mustnot zpool add $TESTPOOL cache $cachetype $LDEV2
                ldev=$(random_get $LDEV2)
                log_mustnot verify_cache_device \
                        $TESTPOOL $ldev 'ONLINE' $cachetype
 
-               log_must $ZPOOL destroy $TESTPOOL
+               log_must zpool destroy $TESTPOOL
        done
 done
 
index f4c5f50d94a0feb3dced303c3c30ee22aea29cef..7a0586648f84e916d3af8ae3ab191a848d96cecb 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cache/cache.cfg
@@ -51,19 +51,19 @@ log_onexit cleanup
 
 for type in "" "mirror" "raidz" "raidz2"
 do
-       log_must $ZPOOL create $TESTPOOL $type $VDEV \
+       log_must zpool create $TESTPOOL $type $VDEV \
                cache $LDEV $LDEV2
 
        ldev=$(random_get $LDEV $LDEV2)
-       log_must $ZPOOL offline $TESTPOOL $ldev
+       log_must zpool offline $TESTPOOL $ldev
        log_must display_status $TESTPOOL
        log_must verify_cache_device $TESTPOOL $ldev 'OFFLINE' ''
 
-       log_must $ZPOOL online $TESTPOOL $ldev
+       log_must zpool online $TESTPOOL $ldev
        log_must display_status $TESTPOOL
        log_must verify_cache_device $TESTPOOL $ldev 'ONLINE' ''
 
-       log_must $ZPOOL destroy -f $TESTPOOL
+       log_must zpool destroy -f $TESTPOOL
 done
 
 log_pass "Offline and online a cache device succeed."
index 7aca7088904125b0cf14ca6239874ed61e76fea9..42fa0ebf66cf6a76f4f410d540f862c6f7e6dbd8 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cache/cache.cfg
@@ -48,7 +48,7 @@ function cleanup_testenv
 {
        cleanup
        if [[ -n $lofidev ]]; then
-               log_must $LOFIADM -d $lofidev
+               log_must lofiadm -d $lofidev
        fi
 }
 
@@ -57,7 +57,7 @@ log_onexit cleanup_testenv
 
 TESTVOL=testvol1$$
 dsk1=${DISKS%% *}
-log_must $ZPOOL create $TESTPOOL ${DISKS#$dsk1}
+log_must zpool create $TESTPOOL ${DISKS#$dsk1}
 
 if is_linux; then
        SLICE="p1"
@@ -66,25 +66,25 @@ else
 fi
 
 # Add nomal ${DEV_RDSKDIR} device
-log_mustnot $ZPOOL add $TESTPOOL cache ${DEV_RDSKDIR}/${dsk1}${SLICE}
+log_mustnot zpool add $TESTPOOL cache ${DEV_RDSKDIR}/${dsk1}${SLICE}
 #log_must verify_cache_device $TESTPOOL $dsk1 'ONLINE'
 
 # Add nomal file
-log_mustnot $ZPOOL add $TESTPOOL cache $VDEV2
+log_mustnot zpool add $TESTPOOL cache $VDEV2
 
 # Add /dev/rlofi device
 lofidev=${VDEV2%% *}
-log_must $LOFIADM -a $lofidev
-lofidev=$($LOFIADM $lofidev)
-log_mustnot $ZPOOL add $TESTPOOL cache "/dev/rlofi/${lofidev#/dev/lofi/}"
+log_must lofiadm -a $lofidev
+lofidev=$(lofiadm $lofidev)
+log_mustnot zpool add $TESTPOOL cache "/dev/rlofi/${lofidev#/dev/lofi/}"
 if [[ -n $lofidev ]]; then
-       log_must $LOFIADM -d $lofidev
+       log_must lofiadm -d $lofidev
        lofidev=""
 fi
 
 # Add ${ZVOL_RDEVDIR} device
-log_must $ZPOOL create $TESTPOOL2 $VDEV2
-log_must $ZFS create -V $SIZE $TESTPOOL2/$TESTVOL
-log_mustnot $ZPOOL add $TESTPOOL cache ${ZVOL_RDEVDIR}/$TESTPOOL2/$TESTVOL
+log_must zpool create $TESTPOOL2 $VDEV2
+log_must zfs create -V $SIZE $TESTPOOL2/$TESTVOL
+log_mustnot zpool add $TESTPOOL cache ${ZVOL_RDEVDIR}/$TESTPOOL2/$TESTVOL
 
 log_pass "Cache device can only be block devices."
index 5f9e6db278f408be47ba219a992b212bd75818e5..caa7e6e900b71e5a927dcf3c6b59c14a3c643fa0 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cache/cache.cfg
@@ -47,7 +47,7 @@ verify_disk_count "$LDEV2"
 
 function cleanup {
        if datasetexists $TESTPOOL ; then
-               log_must $ZPOOL destroy -f $TESTPOOL
+               log_must zpool destroy -f $TESTPOOL
        fi
 }
 
@@ -56,13 +56,13 @@ log_onexit cleanup
 
 for type in "" "mirror" "raidz" "raidz2"
 do
-       log_must $ZPOOL create $TESTPOOL $type $VDEV \
+       log_must zpool create $TESTPOOL $type $VDEV \
                cache $LDEV spare $LDEV2
 
-       log_must $ZPOOL remove $TESTPOOL $LDEV
+       log_must zpool remove $TESTPOOL $LDEV
        log_must display_status $TESTPOOL
 
-       log_must $ZPOOL destroy -f $TESTPOOL
+       log_must zpool destroy -f $TESTPOOL
 done
 
 log_pass "Remove cache device from pool with spare device should succeed"
index ea57d0dafce1492f5a3fa72a97a8a705865a52f2..258f92d19e0e2d55aea8fabeb50da32a4f06ef8d 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cache/cache.cfg
 verify_runnable "global"
 
 if datasetexists $TESTPOOL ; then
-       log_must $ZPOOL destroy -f $TESTPOOL
+       log_must zpool destroy -f $TESTPOOL
 fi
 if datasetexists $TESTPOOL2 ; then
-       log_must $ZPOOL destroy -f $TESTPOOL2
+       log_must zpool destroy -f $TESTPOOL2
 fi
 
-log_must $RM -rf $VDIR $VDIR2
+log_must rm -rf $VDIR $VDIR2
 
 log_pass
index 713eca9a2079da518f9fa56aa7cc383b6ec471b8..d5da5d9bb06181d3bc1c3d3fb60e5ac112de2dd6 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cache/cache.cfg
@@ -38,8 +38,8 @@ if ! is_physical_device $LDEV; then
        log_unsupported "Only physical disk could be cache device"
 fi
 
-log_must $RM -rf $VDIR $VDIR2
-log_must $MKDIR -p $VDIR $VDIR2
-log_must $MKFILE $SIZE $VDEV $VDEV2
+log_must rm -rf $VDIR $VDIR2
+log_must mkdir -p $VDIR $VDIR2
+log_must mkfile $SIZE $VDEV $VDEV2
 
 log_pass
index 27a36af4f22bd8fd828d7f8909d2410705a6743a..a88ac59c3a458e70d5d6b7a93c2428658ac3d3ea 100644 (file)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 #
@@ -38,7 +38,7 @@ function pool_in_cache {
        # the given cachefile, default is /etc/zfs/zpool.cache
        typeset cachefile=${2:-$CPATH}
 
-       RESULT=$($STRINGS $cachefile | $GREP -w $1)
+       RESULT=$(strings $cachefile | grep -w $1)
        if [ -z "$RESULT" ]
        then
                return 1
index 0023807160a9dc0e4672de630bc690344f81be0e..f164a1fad32f11bc22ccb6c52481c98772412bae 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -56,7 +56,7 @@ function cleanup
         fi
        for file in $CPATH1 $CPATH2 ; do
                if [[ -f $file ]] ; then
-                       log_must $RM $file
+                       log_must rm $file
                fi
        done
 }
@@ -74,7 +74,7 @@ set -A opts "none" "false" "none" \
 typeset -i i=0
 
 while (( i < ${#opts[*]} )); do
-       log_must $ZPOOL create -o cachefile=${opts[i]} $TESTPOOL $DISKS
+       log_must zpool create -o cachefile=${opts[i]} $TESTPOOL $DISKS
        case ${opts[((i+1))]} in
                false) log_mustnot pool_in_cache $TESTPOOL
                        ;;
@@ -87,7 +87,7 @@ while (( i < ${#opts[*]} )); do
                log_fail "cachefile property not set as expected. " \
                        "Expect: ${opts[((i+2))]}, Current: $PROP"
        fi
-       log_must $ZPOOL destroy $TESTPOOL
+       log_must zpool destroy $TESTPOOL
        (( i = i + 3 ))
 done
 
index 1680e66306e93651504389667350f9674d8b5d5b..9268f9786355fb64d559eb04eb6408b5cd3f5d5e 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -61,22 +61,22 @@ verify_runnable "global"
 log_assert "Importing a pool with \"cachefile\" set doesn't update zpool.cache"
 log_onexit cleanup
 
-log_must $ZPOOL create -o cachefile=none $TESTPOOL $DISKS
+log_must zpool create -o cachefile=none $TESTPOOL $DISKS
 typeset DEVICEDIR=$(get_device_dir $DISKS)
 log_mustnot pool_in_cache $TESTPOOL
 
-log_must $ZPOOL export $TESTPOOL
-log_must $ZPOOL import -d $DEVICEDIR $TESTPOOL
+log_must zpool export $TESTPOOL
+log_must zpool import -d $DEVICEDIR $TESTPOOL
 log_must pool_in_cache $TESTPOOL
 
-log_must $ZPOOL export $TESTPOOL
-log_must $ZPOOL import -o cachefile=none -d $DEVICEDIR $TESTPOOL
+log_must zpool export $TESTPOOL
+log_must zpool import -o cachefile=none -d $DEVICEDIR $TESTPOOL
 log_mustnot pool_in_cache $TESTPOOL
 
-log_must $ZPOOL export $TESTPOOL
-log_must $ZPOOL import -o cachefile=$CPATH -d $DEVICEDIR $TESTPOOL
+log_must zpool export $TESTPOOL
+log_must zpool import -o cachefile=$CPATH -d $DEVICEDIR $TESTPOOL
 log_must pool_in_cache $TESTPOOL
 
-log_must $ZPOOL destroy $TESTPOOL
+log_must zpool destroy $TESTPOOL
 
 log_pass "Importing a pool with \"cachefile\" set doesn't update zpool.cache"
index d79a1a74ea9b69ea9209fbc05442537c953317aa..a5f427cb4135d226ef7c0549bf4b377a1a8e7083 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -56,13 +56,13 @@ function cleanup
 
         for file in $CPATH1 $CPATH2 ; do
                 if [[ -f $file ]] ; then
-                        log_must $RM $file
+                        log_must rm $file
                 fi
         done
 
        if [ -d $TESTDIR ]
        then
-               $RMDIR $TESTDIR
+               rmdir $TESTDIR
        fi
 }
 
@@ -80,7 +80,7 @@ set -A opts "none" "none" \
 
 
 while (( i < ${#opts[*]} )); do
-       log_must $ZPOOL create -o altroot=$TESTDIR -o cachefile=${opts[i]} \
+       log_must zpool create -o altroot=$TESTDIR -o cachefile=${opts[i]} \
                $TESTPOOL $DISKS
        if [[ ${opts[i]} != none ]]; then
                log_must pool_in_cache $TESTPOOL ${opts[i]}
@@ -93,7 +93,7 @@ while (( i < ${#opts[*]} )); do
                log_fail "cachefile property not set as expected. " \
                        "Expect: ${opts[((i+1))]}, Current: $PROP"
        fi
-       log_must $ZPOOL destroy $TESTPOOL
+       log_must zpool destroy $TESTPOOL
        (( i = i + 2 ))
 done
 
index ea12cf2b6e86bedd270c64d9cff89c584fb907d1..ae54a9365f54668ba98841c91b42cebe3ded1d58 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -59,7 +59,7 @@ function cleanup
        typeset -i i=0
        while ((i < 2)); do
                if [[ -e $mntpnt/vdev$i ]]; then
-                       log_must $RM -f $mntpnt/vdev$i
+                       log_must rm -f $mntpnt/vdev$i
                fi
                ((i += 1))
        done
@@ -70,7 +70,7 @@ function cleanup
 
        for file in $CPATH1 $CPATH2 ; do
                if [[ -f $file ]] ; then
-                       log_must $RM $file
+                       log_must rm $file
                fi
        done
 }
@@ -79,44 +79,44 @@ function cleanup
 log_assert "Verify set, export and destroy when cachefile is set on pool."
 log_onexit cleanup
 
-log_must $ZPOOL create $TESTPOOL $DISKS
+log_must zpool create $TESTPOOL $DISKS
 
 mntpnt=$(get_prop mountpoint $TESTPOOL)
 typeset -i i=0
 while ((i < 2)); do
-       log_must $MKFILE $MINVDEVSIZE $mntpnt/vdev$i
+       log_must mkfile $MINVDEVSIZE $mntpnt/vdev$i
        eval vdev$i=$mntpnt/vdev$i
        ((i += 1))
 done
 
-log_must $ZPOOL create -o cachefile=$CPATH1 $TESTPOOL1 $vdev0
+log_must zpool create -o cachefile=$CPATH1 $TESTPOOL1 $vdev0
 log_must pool_in_cache $TESTPOOL1 $CPATH1
-log_must $ZPOOL create -o cachefile=$CPATH1 $TESTPOOL2 $vdev1
+log_must zpool create -o cachefile=$CPATH1 $TESTPOOL2 $vdev1
 log_must pool_in_cache $TESTPOOL2 $CPATH1
 
-log_must $ZPOOL set cachefile=$CPATH2 $TESTPOOL1
+log_must zpool set cachefile=$CPATH2 $TESTPOOL1
 log_must pool_in_cache $TESTPOOL1 $CPATH2
-log_must $ZPOOL set cachefile=$CPATH2 $TESTPOOL2
+log_must zpool set cachefile=$CPATH2 $TESTPOOL2
 log_must pool_in_cache $TESTPOOL2 $CPATH2
 if [[ -f $CPATH1 ]]; then
        log_fail "Verify set when cachefile is set on pool."
 fi
 
-log_must $ZPOOL export $TESTPOOL1
-log_must $ZPOOL export $TESTPOOL2
+log_must zpool export $TESTPOOL1
+log_must zpool export $TESTPOOL2
 if [[ -f $CPATH2 ]]; then
        log_fail "Verify export when cachefile is set on pool."
 fi
 
-log_must $ZPOOL import -d $mntpnt $TESTPOOL1
-log_must $ZPOOL set cachefile=$CPATH2 $TESTPOOL1
+log_must zpool import -d $mntpnt $TESTPOOL1
+log_must zpool set cachefile=$CPATH2 $TESTPOOL1
 log_must pool_in_cache $TESTPOOL1 $CPATH2
-log_must $ZPOOL import -d $mntpnt $TESTPOOL2
-log_must $ZPOOL set cachefile=$CPATH2 $TESTPOOL2
+log_must zpool import -d $mntpnt $TESTPOOL2
+log_must zpool set cachefile=$CPATH2 $TESTPOOL2
 log_must pool_in_cache $TESTPOOL2 $CPATH2
 
-log_must $ZPOOL destroy $TESTPOOL1
-log_must $ZPOOL destroy $TESTPOOL2
+log_must zpool destroy $TESTPOOL1
+log_must zpool destroy $TESTPOOL2
 if [[ -f $CPATH2 ]]; then
        log_fail "Verify destroy when cachefile is set on pool."
 fi
index ffad2fb9f949296c482c7759aaad5795b7b21664..9e8e456863b491164c22e9f7a5edb9ca9d478268 100644 (file)
 # Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
 #
 
-NAME_C_ORIG=$($ECHO 'F\0303\0257L\0303\0253N\0303\0204m\0303\0253')
-NAME_C_UPPER=$($ECHO 'F\0303\0217L\0303\0213N\0303\0204M\0303\0213')
-NAME_C_LOWER=$($ECHO 'f\0303\0257l\0303\0253n\0303\0244m\0303\0253')
-NAME_D_ORIG=$($ECHO 'Fi\0314\0210Le\0314\0210NA\0314\0210me\0314\0210')
-NAME_D_UPPER=$($ECHO 'FI\0314\0210LE\0314\0210NA\0314\0210ME\0314\0210')
-NAME_D_LOWER=$($ECHO 'fi\0314\0210le\0314\0210na\0314\0210me\0314\0210')
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
+NAME_C_ORIG=$(echo 'F\0303\0257L\0303\0253N\0303\0204m\0303\0253')
+NAME_C_UPPER=$(echo 'F\0303\0217L\0303\0213N\0303\0204M\0303\0213')
+NAME_C_LOWER=$(echo 'f\0303\0257l\0303\0253n\0303\0244m\0303\0253')
+NAME_D_ORIG=$(echo 'Fi\0314\0210Le\0314\0210NA\0314\0210me\0314\0210')
+NAME_D_UPPER=$(echo 'FI\0314\0210LE\0314\0210NA\0314\0210ME\0314\0210')
+NAME_D_LOWER=$(echo 'fi\0314\0210le\0314\0210na\0314\0210me\0314\0210')
 NAMES_ORIG="$NAME_C_ORIG $NAME_D_ORIG"
 NAMES_UPPER="$NAME_C_UPPER $NAME_D_UPPER"
 NAMES_LOWER="$NAME_C_LOWER $NAME_D_LOWER"
index ff1206fdb6da09d2312cbedde48e8b2e51ef957d..273522406b6fcd0e31c3a760232417d9c285bc58 100755 (executable)
 # Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/casenorm/casenorm.cfg
 
@@ -20,18 +24,18 @@ function create_testfs
 {
        typeset opts=$1
 
-       $RM -rf $TESTDIR || log_unresolved Could not remove $TESTDIR
-       $MKDIR -p $TESTDIR || log_unresolved Could not create $TESTDIR
+       rm -rf $TESTDIR || log_unresolved Could not remove $TESTDIR
+       mkdir -p $TESTDIR || log_unresolved Could not create $TESTDIR
 
-       log_must $ZFS create $opts $TESTPOOL/$TESTFS
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       log_must zfs create $opts $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 }
 
 function destroy_testfs
 {
        if datasetexists $TESTPOOL/$TESTFS ; then
-               log_must $ZFS destroy -f $TESTPOOL/$TESTFS
-               $RM -rf $TESTDIR || log_unresolved Could not remove $TESTDIR
+               log_must zfs destroy -f $TESTPOOL/$TESTFS
+               rm -rf $TESTDIR || log_unresolved Could not remove $TESTDIR
        fi
 }
 
@@ -39,14 +43,14 @@ function create_file
 {
        typeset name=$TESTDIR/$1
 
-       $ECHO $name > $name
+       echo $name > $name
 }
 
 function delete_file
 {
        typeset name=$TESTDIR/$1
 
-       $RM $name >/dev/null 2>&1
+       rm $name >/dev/null 2>&1
 
        if [[ $? -ne 0 ]] ; then
                return 1
@@ -61,14 +65,14 @@ function lookup_file
 {
        typeset name=$1
 
-       $ZLOOK -l $TESTDIR $name >/dev/null 2>&1
+       zlook -l $TESTDIR $name >/dev/null 2>&1
 }
 
 function lookup_file_ci
 {
        typeset name=$1
 
-       $ZLOOK -il $TESTDIR $name >/dev/null 2>&1
+       zlook -il $TESTDIR $name >/dev/null 2>&1
 }
 
 function lookup_any
index 90e625cd4143a0d66b3a359baf79726bca86add5..87779a710d16c13ead8cb397e003aed309463a8e 100755 (executable)
 # Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/casenorm/casenorm.kshlib
 
 # DESCRIPTION:
@@ -39,7 +43,7 @@ log_assert "Can create FS with all supported normalization forms"
 for form in none formC formD formKC formKD; do
        create_testfs "-o normalization=$form"
        if [[ $form != "none" ]] ; then
-               utf8only=$($ZFS get -H -o value utf8only $TESTPOOL/$TESTFS)
+               utf8only=$(zfs get -H -o value utf8only $TESTPOOL/$TESTFS)
                if [[ $utf8only != "on" ]]; then
                        log_fail "Turning on normalization didn't set " \
                            "utf8only to on"
@@ -49,7 +53,7 @@ for form in none formC formD formKC formKD; do
 done
 
 for form in formC formD formKC formKD; do
-       log_mustnot $ZFS create -o utf8only=off -o normalization=$form \
+       log_mustnot zfs create -o utf8only=off -o normalization=$form \
            $TESTPOOL/$TESTFS
        destroy_testfs
 done
index b6c8498b282c508bdded8a0f3160bbf71378faf9..9eee108195bd1b43f908241813c35953848e72e3 100755 (executable)
 # Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 verify_runnable "global"
 DISK=${DISKS%% *}
-log_must $ZPOOL create $TESTPOOL $DISK
+log_must zpool create $TESTPOOL $DISK
 log_pass
index 8712b7ed2eb68058c124c730953d65458127dd95..cad1b0a38a4d40fbc2f52cf9b4c40e1d2bd133a6 100755 (executable)
@@ -51,14 +51,14 @@ function cleanup
                log_must chattr -ia $TESTDIR/$i
                log_must rm -f $TESTDIR/$i
        done
-       log_must $CHMOD 0755 $TESTDIR
+       log_must chmod 0755 $TESTDIR
 }
 
 log_onexit cleanup
 
 log_assert "Check whether unprivileged user can chattr"
 
-log_must $CHMOD 0777 $TESTDIR
+log_must chmod 0777 $TESTDIR
 
 log_must user_run $QUSER1 touch $TESTDIR/writable
 log_must user_run $QUSER1 touch $TESTDIR/immutable
index da628bcd1ac857c0dc740b17fb365bd4dd077424..971ef2785b1f0a0104ff7e2f3517331f262045d2 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -35,8 +35,8 @@
 
 verify_runnable "global"
 
-$DF -F zfs -h | $GREP "$TESTFS " >/dev/null
-[[ $? == 0 ]] && log_must $ZFS umount -f $TESTDIR
+df -F zfs -h | grep "$TESTFS " >/dev/null
+[[ $? == 0 ]] && log_must zfs umount -f $TESTDIR
 destroy_pool $TESTPOOL
 
 # recreate and destroy a zpool over the disks to restore the partitions to
index a360dfd36dafd74d8c8a7ea7d167a0275efe0d1b..98187bf5b03f924602f93de2869a09618281cabe 100755 (executable)
@@ -51,16 +51,16 @@ verify_runnable "both"
 
 function cleanup
 {
-       $ECHO cleanup
+       echo cleanup
        [[ -e $TESTDIR ]] && \
-               log_must $RM -rf $TESTDIR/* > /dev/null 2>&1
+               log_must rm -rf $TESTDIR/* > /dev/null 2>&1
 }
 
 log_assert "Create and read back files with using different checksum algorithms"
 
 log_onexit cleanup
 
-FSSIZE=$($ZPOOL list -Hp -o size $TESTPOOL)
+FSSIZE=$(zpool list -Hp -o size $TESTPOOL)
 WRITESZ=1048576
 WRITECNT=$((($FSSIZE) / $WRITESZ ))
 # Skip the first and last 4MB
@@ -79,16 +79,16 @@ firstvdev=${array[0]}
 # errors.
 for ((count = 0; count < ${#checksum_props[*]} ; count++)); do
        i=${checksum_props[$count]}
-       $ZFS set checksum=$i $TESTPOOL
-       $FILE_WRITE -o overwrite -f $TESTDIR/test_$i -b $WRITESZ -c 5 -d R
+       zfs set checksum=$i $TESTPOOL
+       file_write -o overwrite -f $TESTDIR/test_$i -b $WRITESZ -c 5 -d R
 done
-$ZPOOL export $TESTPOOL
-$ZPOOL import $TESTPOOL
-$ZPOOL scrub $TESTPOOL
+zpool export $TESTPOOL
+zpool import $TESTPOOL
+zpool scrub $TESTPOOL
 while is_pool_scrubbing $TESTPOOL; do
-       $SLEEP 1
+       sleep 1
 done
-$ZPOOL status -P -v $TESTPOOL | grep $firstvdev | read -r name state rd wr cksum
+zpool status -P -v $TESTPOOL | grep $firstvdev | read -r name state rd wr cksum
 log_assert "Normal file write test saw $cksum checksum errors"
 log_must [ $cksum -eq 0 ]
 
@@ -97,29 +97,29 @@ rm -fr $TESTDIR/*
 log_assert "Test scrambling the disk and seeing checksum errors"
 for ((count = 0; count < ${#checksum_props[*]} ; count++)); do
        i=${checksum_props[$count]}
-       $ZFS set checksum=$i $TESTPOOL
-       $FILE_WRITE -o overwrite -f $TESTDIR/test_$i -b $WRITESZ -c 5 -d R
+       zfs set checksum=$i $TESTPOOL
+       file_write -o overwrite -f $TESTDIR/test_$i -b $WRITESZ -c 5 -d R
 
-       $ZPOOL export $TESTPOOL
+       zpool export $TESTPOOL
 
        # Scramble the data on the first vdev in our pool.
        # Skip the first and last 16MB of data, then scramble the rest after that
        #
-       $FILE_WRITE -o overwrite -f $firstvdev -s $SKIP -c $WRITECNT -b $WRITESZ -d R
+       file_write -o overwrite -f $firstvdev -s $SKIP -c $WRITECNT -b $WRITESZ -d R
 
-       $ZPOOL import $TESTPOOL
+       zpool import $TESTPOOL
 
        i=${checksum_props[$count]}
-       $ZPOOL scrub $TESTPOOL
+       zpool scrub $TESTPOOL
        while is_pool_scrubbing $TESTPOOL; do
-                $SLEEP 1
+                sleep 1
         done
 
-       $ZPOOL status -P -v $TESTPOOL | grep $firstvdev | read -r name state rd wr cksum
+       zpool status -P -v $TESTPOOL | grep $firstvdev | read -r name state rd wr cksum
 
        log_assert "Checksum '$i' caught $cksum checksum errors"
        log_must [ $cksum -ne 0 ]
 
        rm -f $TESTDIR/test_$i
-       $ZPOOL clear $TESTPOOL
+       zpool clear $TESTPOOL
 done
index 7bcb321f2cef99d3a57a056566738a8722ccddbe..42e88a8c8e3fdc03e4915b7694c9816d872c15bc 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2015 by Delphix. All rights reserved.
+# Copyright (c) 2015, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
index 589e28a7f66b95cda4fc67b5b7d18e11b3c3e701..e238d7a53e6d887db1e1777089ab811686146215 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2015 by Delphix. All rights reserved.
+# Copyright (c) 2015, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
index 4290bfc79834e2ddbc88b7dc058f7bb75eca42d5..b3a33c3ca8bceaf058a9f30c2bdc978148d80758 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2015 by Delphix. All rights reserved.
+# Copyright (c) 2015, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
index 328e940c263c4389edf211136830f462472ca029..7703c1241542ce6c7bf100dcda6d665ab1b2d375 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/clean_mirror/default.cfg
@@ -45,20 +45,20 @@ function sync_pool #pool
 {
        typeset pool=$1
 
-       log_must $SYNC
-       log_must $SLEEP 2
+       log_must sync
+       log_must sleep 2
        # Flush all the pool data.
        typeset -i ret
-       $ZPOOL scrub $pool >/dev/null 2>&1
+       zpool scrub $pool >/dev/null 2>&1
        ret=$?
        (( $ret != 0 )) && \
-               log_fail "$ZPOOL scrub $pool failed."
+               log_fail "zpool scrub $pool failed."
 
        while ! is_pool_scrubbed $pool; do
                if is_pool_resilvered $pool ; then
                        log_fail "$pool should not be resilver completed."
                fi
-               log_must $SLEEP 2
+               log_must sleep 2
        done
 }
 
@@ -74,14 +74,14 @@ function overwrite_verify_mirror
 
        while (( atfile < FILE_COUNT )); do
                files[$atfile]=$TESTDIR/file.$atfile
-               log_must $FILE_WRITE -o create -f $TESTDIR/file.$atfile \
+               log_must file_write -o create -f $TESTDIR/file.$atfile \
                        -b $FILE_SIZE -c 1
-               cksums[$atfile]=$($CKSUM ${files[$atfile]})
+               cksums[$atfile]=$(cksum ${files[$atfile]})
                (( atfile = atfile + 1 ))
        done
 
        # dd the primary side of the mirror
-       log_must $DD if=$OVERWRITING_DEVICE of=$AFFECTED_DEVICE \
+       log_must dd if=$OVERWRITING_DEVICE of=$AFFECTED_DEVICE \
                seek=8 bs=$DD_BLOCK count=$(( DD_COUNT - 128 )) conv=notrunc
 
        atfile=0
@@ -89,17 +89,17 @@ function overwrite_verify_mirror
        #
        # Flush out the cache so that we ensure we're reading from disk.
        #
-       log_must $ZPOOL export $TESTPOOL
-       log_must $ZPOOL import $TESTPOOL
+       log_must zpool export $TESTPOOL
+       log_must zpool import $TESTPOOL
 
        typeset -i failedcount=0
        while (( atfile < FILE_COUNT )); do
                files[$atfile]=$TESTDIR/file.$atfile
-               newcksum=$($CKSUM ${files[$atfile]})
+               newcksum=$(cksum ${files[$atfile]})
                if [[ $newcksum != ${cksums[$atfile]} ]]; then
                        (( failedcount = failedcount + 1 ))
                fi
-               $RM -f ${files[$atfile]}
+               rm -f ${files[$atfile]}
                (( atfile = atfile + 1 ))
        done
 
index 05ef9c16a7cead8da3eb575e7d91572a384c3f22..ac3bfbca8940728698eadf39afa18bd24cc38128 100755 (executable)
 
 verify_runnable "global"
 
-$DF -F zfs -h | $GREP "$TESTFS " >/dev/null
-[[ $? == 0 ]] && log_must $ZFS umount -f $TESTDIR
+df -F zfs -h | grep "$TESTFS " >/dev/null
+[[ $? == 0 ]] && log_must zfs umount -f $TESTDIR
 destroy_pool $TESTPOOL
 
 if is_mpath_device $MIRROR_PRIMARY; then
-       $FORMAT $DEV_DSKDIR/$MIRROR_PRIMARY -s rm 1
+       parted $DEV_DSKDIR/$MIRROR_PRIMARY -s rm 1
 fi
 if is_mpath_device $MIRROR_SECONDARY; then
-       $FORMAT $DEV_DSKDIR/$MIRROR_SECONDARY -s rm 1
+       parted $DEV_DSKDIR/$MIRROR_SECONDARY -s rm 1
 fi
 # recreate and destroy a zpool over the disks to restore the partitions to
 # normal
index 756ce2308029abcacee1c26768a5ad68f6794d40..d02d2b8bd4c1c98a28535b9145314d866522ff52 100644 (file)
@@ -49,7 +49,7 @@ if [[ -z $MIRROR_SECONDARY ]]; then
                else
                        export DEV_DSKDIR=$DEV_RDSKDIR
                fi
-               if ( is_mpath_device $SINGLE_DISK ) && [[ -z $($ECHO $SINGLE_DISK | awk 'substr($1,18,1)\
+               if ( is_mpath_device $SINGLE_DISK ) && [[ -z $(echo $SINGLE_DISK | awk 'substr($1,18,1)\
                    ~ /^[[:digit:]]+$/') ]] || ( is_real_device $SINGLE_DISK ); then
                        SIDE_PRIMARY=${SINGLE_DISK}1
                        SIDE_SECONDARY=${SINGLE_DISK}2
@@ -73,7 +73,7 @@ else
                else
                        export DEV_DSKDIR=$DEV_RDSKDIR
                fi
-               if ( is_mpath_device $MIRROR_PRIMARY ) && [[ -z $($ECHO $MIRROR_PRIMARY | awk 'substr($1,18,1)\
+               if ( is_mpath_device $MIRROR_PRIMARY ) && [[ -z $(echo $MIRROR_PRIMARY | awk 'substr($1,18,1)\
                    ~ /^[[:digit:]]+$/') ]] || ( is_real_device $MIRROR_PRIMARY ); then
                        SIDE_PRIMARY=${MIRROR_PRIMARY}1
                elif ( is_mpath_device $MIRROR_PRIMARY || is_loop_device $MIRROR_PRIMARY ); then
@@ -81,7 +81,7 @@ else
                else
                        log_fail "$MIRROR_PRIMARY not supported for partitioning."
                fi
-               if ( is_mpath_device $MIRROR_SECONDARY ) && [[ -z $($ECHO $MIRROR_SECONDARY | awk 'substr($1,18,1)\
+               if ( is_mpath_device $MIRROR_SECONDARY ) && [[ -z $(echo $MIRROR_SECONDARY | awk 'substr($1,18,1)\
                    ~ /^[[:digit:]]+$/') ]] || ( is_real_device $MIRROR_SECONDARY ); then
                        SIDE_SECONDARY=${MIRROR_SECONDARY}1
                elif ( is_mpath_device $MIRROR_SECONDARY || is_loop_device $MIRROR_SECONDARY ); then
index 06e794ed85c19b8500527db2484aaa4b7cc6a872..4788de59866393eac58a000fbd71d69e403e05c0 100644 (file)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -31,7 +35,7 @@
 #
 function get_cksum # <file path>
 {
-       return $($CKSUM $1 | $AWK '{print $1 $2}')
+       return $(cksum $1 | awk '{print $1 $2}')
 }
 
 #
index 15bf831e65a4a317888973a0401074f8e79754b7..f976cda72006190378a85828ec8fd0b33fd2f199 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -65,7 +65,7 @@ log_assert "Execute zdb using invalid parameters."
 
 typeset -i i=0
 while [[ $i -lt ${#args[*]} ]]; do
-       log_mustnot $ZDB ${args[i]}
+       log_mustnot zdb ${args[i]}
 
        ((i = i + 1))
 done
index 4f630ad46dd6d645d145c5eef8f34e103b674657..6d3e3ab454956897b5a67c171105fecd26a28354 100755 (executable)
@@ -42,7 +42,7 @@ function cleanup
 
 for opt in '' -d; do
        log_must zpool create -f $opt $TESTPOOL ${DISKS%% *}
-       log_must eval "$ZDB $TESTPOOL >$tmpfile"
+       log_must eval "zdb $TESTPOOL >$tmpfile"
        grep -q "$errstr" $tmpfile && \
            log_fail "Found feature refcount mismatches in zdb output."
        destroy_pool $TESTPOOL
index d801828c1f179049802571c1cae5fff15263c52d..4c57cb587a7bd5462d6cfd118df0cd49cb89b52d 100755 (executable)
@@ -43,10 +43,10 @@ config_count=(1 2)
 set -A DISK $DISKS
 
 default_mirror_setup_noexit $DISKS
-log_must $DD if=/dev/${DISK[0]} of=/dev/${DISK[1]} bs=1K count=256 conv=notrunc
+log_must dd if=/dev/${DISK[0]} of=/dev/${DISK[1]} bs=1K count=256 conv=notrunc
 
 for x in 0 1 ; do
-       config_count=$($ZDB -l $DEV_RDSKDIR/${DISK[$x]} | $GREP -c features_for_read)
+       config_count=$(zdb -l $DEV_RDSKDIR/${DISK[$x]} | grep -c features_for_read)
        (( $? != 0)) && log_fail "failed to get config_count from DISK[$x]"
        log_note "vdev $x: message_count $config_count"
        [ $config_count -ne ${config_count[$x]} ] && \
index 09e2194d812de298e48cb9464e2a2a16f7b82f19..2b4057aa76bb594fb0feec602af18aa0806c5abd 100755 (executable)
@@ -38,7 +38,7 @@ function cleanup
 {
        datasetexists $TESTPOOL && destroy_pool $TESTPOOL
        for DISK in $DISKS; do
-               $ZPOOL labelclear -f $DEV_RDSKDIR/$DISK
+               zpool labelclear -f $DEV_RDSKDIR/$DISK
        done
 }
 
@@ -47,16 +47,16 @@ verify_disk_count "$DISKS" 2
 set -A DISK $DISKS
 
 default_mirror_setup_noexit $DISKS
-log_must $ZPOOL offline $TESTPOOL ${DISK[0]}
-log_must $DD if=/dev/urandom of=$TESTDIR/testfile bs=1K count=2
-log_must $ZPOOL export $TESTPOOL
-log_must $DD if=$DEV_RDSKDIR/${DISK[0]} of=$DEV_RDSKDIR/${DISK[1]} bs=1K count=256 conv=notrunc
+log_must zpool offline $TESTPOOL ${DISK[0]}
+log_must dd if=/dev/urandom of=$TESTDIR/testfile bs=1K count=2
+log_must zpool export $TESTPOOL
+log_must dd if=$DEV_RDSKDIR/${DISK[0]} of=$DEV_RDSKDIR/${DISK[1]} bs=1K count=256 conv=notrunc
 
-ubs=$($ZDB -lu $DEV_RDSKDIR/${DISK[1]} | $GREP -e LABEL -e Uberblock -e 'labels = ')
+ubs=$(zdb -lu $DEV_RDSKDIR/${DISK[1]} | grep -e LABEL -e Uberblock -e 'labels = ')
 log_note "vdev 1: ubs $ubs"
 
-ub_dump_counts=$($ZDB -lu $DEV_RDSKDIR/${DISK[1]} | \
-       $AWK '  /LABEL/ {label=$NF; blocks[label]=0};
+ub_dump_counts=$(zdb -lu $DEV_RDSKDIR/${DISK[1]} | \
+       awk '   /LABEL/ {label=$NF; blocks[label]=0};
                /Uberblock/ {blocks[label]++};
                END {print blocks[0],blocks[1],blocks[2],blocks[3]}')
 (( $? != 0)) && log_fail "failed to get ub_dump_counts from DISK[1]"
index ba97885107317843f773ab01421176fd2735ef16..60bbb5615602be68d30b74ce96fb3d2828e9f54c 100755 (executable)
@@ -44,18 +44,18 @@ verify_disk_count "$DISKS" 2
 set -A DISK $DISKS
 
 default_mirror_setup_noexit $DISKS
-log_must $DD if=/dev/zero of=$DEV_RDSKDIR/${DISK[1]} bs=1K count=256 conv=notrunc
-log_must $TRUNCATE -s 0 $TEMPFILE
+log_must dd if=/dev/zero of=$DEV_RDSKDIR/${DISK[1]} bs=1K count=256 conv=notrunc
+log_must truncate -s 0 $TEMPFILE
 
-$ZDB -l $DEV_RDSKDIR/${DISK[0]}
+zdb -l $DEV_RDSKDIR/${DISK[0]}
 [[ $? -ne 0 ]] &&
        log_fail "zdb -l exit codes are incorrect."
 
-$ZDB -l $DEV_RDSKDIR/${DISK[1]}
+zdb -l $DEV_RDSKDIR/${DISK[1]}
 [[ $? -ne 1 ]] &&
        log_fail "zdb -l exit codes are incorrect."
 
-$ZDB -l $TEMPFILE
+zdb -l $TEMPFILE
 [[ $? -ne 2 ]] &&
        log_fail "zdb -l exit codes are incorrect."
 
index bfcc8649132654323aa69d2343b7928e266d8976..c8fafc339df5f37f39dc30569cd85bebc8ca28c4 100755 (executable)
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -65,7 +70,7 @@ log_assert "Badly-formed zfs sub-command should return an error."
 
 typeset -i i=0
 while (( $i < ${#args[*]} )); do
-       log_mustnot $ZFS ${args[i]}
+       log_mustnot zfs ${args[i]}
        ((i = i + 1))
 done
 
index 473bc65a252cfa9b61c7e791caacfb19af85cff5..27a429db82195cd83b63fc08f65e24b71c11c3dd 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -49,11 +49,11 @@ function cleanup
        unset ZFS_ABORT
 
        if [[ -d $corepath ]]; then
-               $RM -rf $corepath
+               rm -rf $corepath
        fi
        for ds in $fs1 $fs $ctr; do
                if datasetexists $ds; then
-                       log_must $ZFS destroy -rRf $ds
+                       log_must zfs destroy -rRf $ds
                fi
        done
 }
@@ -65,12 +65,12 @@ log_onexit cleanup
 #preparation work for testing
 corepath=$TESTDIR/core
 if [[ -d $corepath ]]; then
-       $RM -rf $corepath
+       rm -rf $corepath
 fi
-log_must $MKDIR $corepath
+log_must mkdir $corepath
 
 ctr=$TESTPOOL/$TESTCTR
-log_must $ZFS create $ctr
+log_must zfs create $ctr
 
 fs=$ctr/$TESTFS
 fs1=$ctr/$TESTFS1
@@ -94,19 +94,19 @@ if is_linux; then
        echo "$corepath/core.zfs" >/proc/sys/kernel/core_pattern
        echo 0 >/proc/sys/kernel/core_uses_pid
 else
-       log_must $COREADM -p ${corepath}/core.%f
+       log_must coreadm -p ${corepath}/core.%f
 fi
 
 log_must export ZFS_ABORT=yes
 
 for subcmd in "${cmds[@]}" "${badparams[@]}"; do
-       $ZFS $subcmd >/dev/null 2>&1 && log_fail "$subcmd passed incorrectly."
+       zfs $subcmd >/dev/null 2>&1 && log_fail "$subcmd passed incorrectly."
        corefile=${corepath}/core.zfs
        if [[ ! -e $corefile ]]; then
-               log_fail "$ZFS $subcmd cannot generate core file with " \
+               log_fail "zfs $subcmd cannot generate core file with " \
                    "ZFS_ABORT set."
        fi
-       log_must $RM -f $corefile
+       log_must rm -f $corefile
 done
 
 log_pass "With ZFS_ABORT set, zfs command can abort and generate core file " \
index 63c735f3138ddfdbf6579e11bfbb853e486bc168..0438bae8f6ce9df40ce7e11489cac3be15d212ef 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -52,12 +57,12 @@ fi
 
 for file in $ZFS_DEV $MNTTAB; do
        if [[ -e $file ]]; then
-               $MV $file ${file}.bak
+               mv $file ${file}.bak
        fi
        for cmd in "" "list" "get all" "mount"; do
-               log_mustnot eval "$ZFS $cmd >/dev/null 2>&1"
+               log_mustnot eval "zfs $cmd >/dev/null 2>&1"
        done
-       $MV ${file}.bak $file
+       mv ${file}.bak $file
 done
 
 log_pass "zfs fails with unexpected scenario as expected."
index 54c3b00ba0b9176548681c2b40daabc71bf2f33e..b83ccdf48c7996a149a172a31503e5194a22a4f5 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -90,7 +90,7 @@ function setup_all
 
        for snap in $SNAPFS $SNAPFS1 ; do
                if ! snapexists $snap ; then
-                       log_must $ZFS snapshot $snap
+                       log_must zfs snapshot $snap
                fi
        done
 
@@ -100,11 +100,11 @@ function setup_all
 function cleanup_all
 {
        for fs in $targets; do
-               datasetexists $fs && log_must $ZFS destroy -f $fs
+               datasetexists $fs && log_must zfs destroy -f $fs
        done
 
        for snap in $SNAPFS $SNAPFS1 ; do
-               snapexists $snap && log_must $ZFS destroy -Rf $snap
+               snapexists $snap && log_must zfs destroy -Rf $snap
        done
 
        return 0
@@ -118,7 +118,7 @@ setup_all
 
 typeset -i i=0
 while (( i < ${#args[*]} )); do
-       log_mustnot $ZFS clone ${args[i]}
+       log_mustnot zfs clone ${args[i]}
        ((i = i + 1))
 done
 
index 1b376eb00d79fd541ebf0a6ebe3160703c4f68c3..8e69a7adcc3d423f0331de4aea90906916222bb9 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -50,7 +50,7 @@ function setup_all
 
        for snap in $SNAPFS $SNAPFS1 ; do
                if ! snapexists $snap ; then
-                       log_must $ZFS snapshot $snap
+                       log_must zfs snapshot $snap
                fi
        done
 
@@ -61,12 +61,12 @@ function cleanup_all
 {
 
        if datasetexists $TESTPOOL/notexist ; then
-               log_must $ZFS destroy -rRf $TESTPOOL/notexist
+               log_must zfs destroy -rRf $TESTPOOL/notexist
        fi
 
        for snap in $SNAPFS $SNAPFS1 ; do
                if snapexists $snap ; then
-                       log_must $ZFS destroy -Rf $snap
+                       log_must zfs destroy -Rf $snap
                fi
        done
 
index 103f2d3ab2e148e9a5d0ebdd22105d658f185384..5222757598801525781dd84b1e41e5fb1000d1cd 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -49,7 +49,7 @@ verify_runnable "both"
 function cleanup
 {
        if snapexists $SNAPFS ; then
-               log_must $ZFS destroy -Rf $SNAPFS
+               log_must zfs destroy -Rf $SNAPFS
        fi
 }
 
@@ -59,16 +59,16 @@ log_onexit cleanup
 log_assert "'zfs clone -o property=value filesystem' can successfully create" \
           "a ZFS clone filesystem with correct property set."
 
-log_must $ZFS snapshot $SNAPFS
+log_must zfs snapshot $SNAPFS
 
 typeset -i i=0
 while (( $i < ${#RW_FS_PROP[*]} )); do
-       log_must $ZFS clone -o ${RW_FS_PROP[$i]} $SNAPFS $TESTPOOL/$TESTCLONE
+       log_must zfs clone -o ${RW_FS_PROP[$i]} $SNAPFS $TESTPOOL/$TESTCLONE
        datasetexists $TESTPOOL/$TESTCLONE || \
                log_fail "zfs clone $TESTPOOL/$TESTCLONE fail."
        propertycheck $TESTPOOL/$TESTCLONE ${RW_FS_PROP[i]} || \
                log_fail "${RW_FS_PROP[i]} is failed to set."
-       log_must $ZFS destroy -f $TESTPOOL/$TESTCLONE
+       log_must zfs destroy -f $TESTPOOL/$TESTCLONE
        (( i = i + 1 ))
 done
 
index 03bf7d7652d228929b0d4dadc72c156052885035..8d86f5501863c956696199499901301cc904bdf5 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -49,7 +49,7 @@ verify_runnable "both"
 function cleanup
 {
        if snapexists $SNAPFS ; then
-               log_must $ZFS destroy -Rf $SNAPFS
+               log_must zfs destroy -Rf $SNAPFS
        fi
 }
 
@@ -61,7 +61,7 @@ log_assert "'zfs clone -o property=value filesystem' can successfully create" \
 typeset -i i=0
 typeset opts=""
 
-log_must $ZFS snapshot $SNAPFS
+log_must zfs snapshot $SNAPFS
 
 while (( $i < ${#RW_FS_PROP[*]} )); do
         if [[ ${RW_FS_PROP[$i]} != *"checksum"* ]]; then
@@ -70,7 +70,7 @@ while (( $i < ${#RW_FS_PROP[*]} )); do
        (( i = i + 1 ))
 done
 
-log_must $ZFS clone $opts $SNAPFS $TESTPOOL/$TESTCLONE
+log_must zfs clone $opts $SNAPFS $TESTPOOL/$TESTCLONE
 datasetexists $TESTPOOL/$TESTCLONE || \
        log_fail "zfs create $TESTPOOL/$TESTCLONE fail."
 
index 776dfd5c28d03046f62799a8da29b4c171b5a33f..879f837a6688bc569d3b5921e68214c667e63fd2 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -49,7 +49,7 @@ verify_runnable "global"
 function cleanup
 {
        if snapexists $SNAPFS1 ; then
-               log_must $ZFS destroy -Rf $SNAPFS1
+               log_must zfs destroy -Rf $SNAPFS1
        fi
 }
 
@@ -58,15 +58,15 @@ log_onexit cleanup
 log_assert "'zfs clone -o property=value -V size volume' can successfully" \
           "create a ZFS clone volume with correct property set."
 
-log_must $ZFS snapshot $SNAPFS1
+log_must zfs snapshot $SNAPFS1
 typeset -i i=0
 while (( $i < ${#RW_VOL_CLONE_PROP[*]} )); do
-       log_must $ZFS clone -o ${RW_VOL_CLONE_PROP[$i]} $SNAPFS1 $TESTPOOL/$TESTCLONE
+       log_must zfs clone -o ${RW_VOL_CLONE_PROP[$i]} $SNAPFS1 $TESTPOOL/$TESTCLONE
        datasetexists $TESTPOOL/$TESTCLONE || \
                log_fail "zfs clone $TESTPOOL/$TESTCLONE fail."
        propertycheck $TESTPOOL/$TESTCLONE ${RW_VOL_CLONE_PROP[i]} || \
                log_fail "${RW_VOL_CLONE_PROP[i]} is failed to set."
-       log_must $ZFS destroy -f $TESTPOOL/$TESTCLONE
+       log_must zfs destroy -f $TESTPOOL/$TESTCLONE
 
        (( i = i + 1 ))
 done
index 84f55c8447d64f87b2c4a9871243d57a1b9557ee..fd790674e15c496c2ea6ea3687bb78983f1946e3 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 
@@ -50,7 +50,7 @@ verify_runnable "global"
 function cleanup
 {
        if snapexists $SNAPFS1 ; then
-               log_must $ZFS destroy -Rf $SNAPFS1
+               log_must zfs destroy -Rf $SNAPFS1
        fi
 }
 
@@ -62,7 +62,7 @@ log_assert "'zfs clone -o property=value volume' can successfully" \
 typeset -i i=0
 typeset opts=""
 
-log_must $ZFS snapshot $SNAPFS1
+log_must zfs snapshot $SNAPFS1
 
 while (( $i < ${#RW_VOL_CLONE_PROP[*]} )); do
        if [[ ${RW_VOL_CLONE_PROP[$i]} != *"checksum"* ]]; then
@@ -71,7 +71,7 @@ while (( $i < ${#RW_VOL_CLONE_PROP[*]} )); do
        (( i = i + 1 ))
 done
 
-log_must $ZFS clone $opts $SNAPFS1 $TESTPOOL/$TESTCLONE
+log_must zfs clone $opts $SNAPFS1 $TESTPOOL/$TESTCLONE
 
 i=0
 while (( $i < ${#RW_VOL_CLONE_PROP[*]} )); do
index 370a98f4def8b3a4c59c823e385fc9eae2d4800c..6fba72b580673716b20770caacbdbe84c3842984 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 # 2. Verify it succeed while upgrade, but fails while the version downgraded.
 #
 
-ZFS_VERSION=$($ZFS upgrade | $HEAD -1 | $AWK '{print $NF}' \
-       | $SED -e 's/\.//g')
+ZFS_VERSION=$(zfs upgrade | head -1 | awk '{print $NF}' \
+       | sed -e 's/\.//g')
 
 verify_runnable "both"
 
 function cleanup
 {
        if snapexists $SNAPFS ; then
-                       log_must $ZFS destroy -Rf $SNAPFS
+                       log_must zfs destroy -Rf $SNAPFS
        fi
 }
 
@@ -57,7 +57,7 @@ log_onexit cleanup
 log_assert "'zfs clone -o version=' could upgrade version," \
        "but downgrade is denied."
 
-log_must $ZFS snapshot $SNAPFS
+log_must zfs snapshot $SNAPFS
 
 typeset -i ver
 
@@ -67,14 +67,14 @@ fi
 
 (( ver = ZFS_TEST_VERSION ))
 while (( ver <= ZFS_VERSION )); do
-       log_must $ZFS clone -o version=$ver $SNAPFS $TESTPOOL/$TESTCLONE
+       log_must zfs clone -o version=$ver $SNAPFS $TESTPOOL/$TESTCLONE
        cleanup
        (( ver = ver + 1 ))
 done
 
 (( ver = 0 ))
 while (( ver < ZFS_TEST_VERSION  )); do
-       log_mustnot $ZFS clone -o version=$ver \
+       log_mustnot zfs clone -o version=$ver \
                $SNAPFS $TESTPOOL/$TESTCLONE
        log_mustnot datasetexists $TESTPOOL/$TESTCLONE
        cleanup
index d54c87dfaae2de94c1dd9309ee1c7775d8e3f34f..8e306fd445ea3f592d4c76a2e511b7f5097333b5 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -49,7 +49,7 @@ verify_runnable "both"
 function cleanup
 {
        if snapexists $SNAPFS ; then
-               log_must $ZFS destroy -Rf $SNAPFS
+               log_must zfs destroy -Rf $SNAPFS
        fi
 }
 
@@ -57,22 +57,22 @@ log_onexit cleanup
 
 log_assert "Verify 'zfs clone -o <filesystem>' fails with bad <filesystem> argument."
 
-log_must $ZFS snapshot $SNAPFS
+log_must zfs snapshot $SNAPFS
 
 typeset -i i=0
 while (( $i < ${#RW_FS_PROP[*]} )); do
-       log_mustnot $ZFS clone -o ${RW_FS_PROP[i]} -o ${RW_FS_PROP[i]} \
+       log_mustnot zfs clone -o ${RW_FS_PROP[i]} -o ${RW_FS_PROP[i]} \
                $SNAPFS $TESTPOOL/$TESTCLONE
-       log_mustnot $ZFS clone -p -o ${RW_FS_PROP[i]} -o ${RW_FS_PROP[i]} \
+       log_mustnot zfs clone -p -o ${RW_FS_PROP[i]} -o ${RW_FS_PROP[i]} \
                $SNAPFS $TESTPOOL/$TESTCLONE
        ((i = i + 1))
 done
 
 i=0
 while (( $i < ${#VOL_ONLY_PROP[*]} )); do
-       log_mustnot $ZFS clone -o ${VOL_ONLY_PROP[i]} \
+       log_mustnot zfs clone -o ${VOL_ONLY_PROP[i]} \
                $SNAPFS $TESTPOOL/$TESTCLONE
-       log_mustnot $ZFS clone -p -o ${VOL_ONLY_PROP[i]} \
+       log_mustnot zfs clone -p -o ${VOL_ONLY_PROP[i]} \
                $SNAPFS $TESTPOOL/$TESTCLONE
        ((i = i + 1))
 done
index 286cbf85346824a976ac3718b2f86e116bc09707..030c6af7ae682272fa68ce87a73d421de1a233ae 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -49,7 +49,7 @@ verify_runnable "global"
 function cleanup
 {
        if snapexists $SNAPFS1 ; then
-               log_must $ZFS destroy -Rf $SNAPFS1
+               log_must zfs destroy -Rf $SNAPFS1
        fi
 }
 
@@ -57,22 +57,22 @@ log_onexit cleanup
 
 log_assert "Verify 'zfs clone -o <volume>' fails with bad <volume> argument."
 
-log_must $ZFS snapshot $SNAPFS1
+log_must zfs snapshot $SNAPFS1
 
 typeset -i i=0
 while (( $i < ${#RW_VOL_PROP[*]} )); do
-       log_mustnot $ZFS clone -o ${RW_VOL_PROP[i]} -o ${RW_VOL_PROP[i]} \
+       log_mustnot zfs clone -o ${RW_VOL_PROP[i]} -o ${RW_VOL_PROP[i]} \
                $SNAPFS1 $TESTPOOL/$TESTCLONE
-       log_mustnot $ZFS clone -p -o ${RW_VOL_PROP[i]} -o ${RW_VOL_PROP[i]} \
+       log_mustnot zfs clone -p -o ${RW_VOL_PROP[i]} -o ${RW_VOL_PROP[i]} \
                $SNAPFS1 $TESTPOOL/$TESTCLONE
        ((i = i + 1))
 done
 
 i=0
 while (( $i < ${#FS_ONLY_PROP[*]} )); do
-       log_mustnot $ZFS clone  -o ${FS_ONLY_PROP[i]} \
+       log_mustnot zfs clone  -o ${FS_ONLY_PROP[i]} \
                $SNAPFS1 $TESTPOOL/$TESTCLONE
-       log_mustnot $ZFS clone -p -o ${FS_ONLY_PROP[i]} \
+       log_mustnot zfs clone -p -o ${FS_ONLY_PROP[i]} \
                $SNAPFS1 $TESTPOOL/$TESTCLONE
        ((i = i + 1))
 done
index c38d04d2f8eeb7a8238b34c769a6e9c236573a3e..8b72d47a0bbcc09f622a6f8ef9160fd046502e1f 100755 (executable)
@@ -15,7 +15,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -39,8 +39,8 @@ function local_cleanup
        typeset -i i=1
        for ds in $datasets; do
                 datasetexists $ds/$TESTCLONE.$i && \
-                   log_must $ZFS destroy -rf $ds/$TESTCLONE.$i
-                datasetexists $ds && log_must $ZFS destroy -Rf $ds
+                   log_must zfs destroy -rf $ds/$TESTCLONE.$i
+                datasetexists $ds && log_must zfs destroy -Rf $ds
                ((i=i+1))
        done
 }
@@ -50,7 +50,7 @@ function setup_ds
 {
        typeset -i i=1
        # create nested datasets
-       log_must $ZFS create -p $TESTPOOL/$TESTFS1/$TESTFS2/$TESTFS3
+       log_must zfs create -p $TESTPOOL/$TESTFS1/$TESTFS2/$TESTFS3
 
        # verify dataset creation
        for ds in $datasets; do
@@ -58,14 +58,14 @@ function setup_ds
        done
 
        # create recursive nested snapshot
-       log_must $ZFS snapshot -r $TESTPOOL/$TESTFS1@snap
+       log_must zfs snapshot -r $TESTPOOL/$TESTFS1@snap
        for ds in $datasets; do
                datasetexists $ds@snap || \
                    log_fail "Create $ds@snap snapshot fail."
        done
        for ds in $datasets; do
                for fs in $datasets; do
-                       log_must $ZFS clone $ds@snap $fs/$TESTCLONE.$i
+                       log_must zfs clone $ds@snap $fs/$TESTCLONE.$i
                done
                ((i=i+1))
        done
@@ -82,8 +82,8 @@ function verify_clones
                if [[ -n $clone_snap ]]; then
                        clone_snap=/$TESTCLONE.$i
                fi
-               snapshot=$($ECHO "$names" | $GREP $ds$clone_snap@snap)
-               actual_clone=$($ZFS list -t all -o clones $snapshot | $TAIL -1)
+               snapshot=$(echo "$names" | grep $ds$clone_snap@snap)
+               actual_clone=$(zfs list -t all -o clones $snapshot | tail -1)
                save=$IFS
                IFS=','
                typeset -a clones=()
@@ -147,16 +147,16 @@ i=1
 log_must setup_ds
 
 log_note "Verify zfs clone property for multiple clones"
-names=$($ZFS list -rt all -o name $TESTPOOL)
+names=$(zfs list -rt all -o name $TESTPOOL)
 log_must verify_clones 3 0
 
 log_note "verfify clone property for clone deletion"
 i=1
 for ds in $datasets; do
-       log_must $ZFS destroy $ds/$TESTCLONE.$i
+       log_must zfs destroy $ds/$TESTCLONE.$i
        ((i=i+1))
 done
-names=$($ZFS list -rt all -o name $TESTPOOL)
+names=$(zfs list -rt all -o name $TESTPOOL)
 i=1
 log_must verify_clones 2 1
 
@@ -165,9 +165,9 @@ log_must setup_ds
 
 log_note "verify zfs deferred destroy on clones property"
 i=1
-names=$($ZFS list -rt all -o name $TESTPOOL)
+names=$(zfs list -rt all -o name $TESTPOOL)
 for ds in $datasets; do
-       log_must $ZFS destroy -d $ds@snap
+       log_must zfs destroy -d $ds@snap
        deferred_snaps=( "${deferred_snaps[@]}" "$ds@snap" )
        ((i=i+1))
 done
@@ -178,20 +178,20 @@ d_clones=()
 i=1
 for ds in $datasets; do
        for fs in $datasets; do
-               log_must $ZFS destroy $fs/$TESTCLONE.$i
+               log_must zfs destroy $fs/$TESTCLONE.$i
                d_clones=( "${d_clones[@]}" "$fs/$TESTCLONE.$i" )
        done
        ((i=i+1))
 done
-names=$($ZFS list -rtall -o name $TESTPOOL)
+names=$(zfs list -rtall -o name $TESTPOOL)
 for snap in ${deferred_snaps[@]}; do
-       status=$($ECHO "$names" | $GREP $snap)
+       status=$(echo "$names" | grep $snap)
        [[ -z $status ]] || \
            log_fail "$snap exist after deferred destroy"
 done
 for dclone in ${d_clones[@]}; do
        log_note "D CLONE = $dclone"
-       status=$($ECHO "$names" | $GREP $dclone)
+       status=$(echo "$names" | grep $dclone)
        [[ -z $status ]] || \
            log_fail "$dclone exist after deferred destroy"
 done
@@ -201,14 +201,14 @@ log_must setup_ds
 log_note "verify clone property for zfs promote"
 i=1
 for ds in $datasets; do
-       log_must $ZFS promote $ds/$TESTCLONE.$i
+       log_must zfs promote $ds/$TESTCLONE.$i
        ((i=i+1))
 done
-names=$($ZFS list -rt all -o name,clones $TESTPOOL)
+names=$(zfs list -rt all -o name,clones $TESTPOOL)
 log_must verify_clones 3 1 $TESTCLONE
 i=1
 for ds in $datasets; do
-       log_must $ZFS promote $ds
+       log_must zfs promote $ds
        ((i=i+1))
 done
 log_must local_cleanup
@@ -222,16 +222,16 @@ if is_linux; then
 else
        ZFS_MAXPROPLEN=1024
 fi
-log_must $ZFS create $fs
-log_must $ZFS snapshot $fs@snap
-while((i <= $(( $ZFS_MAXPROPLEN/200+1 )))); do
-       log_must $ZFS clone $fs@snap $fs/$TESTCLONE$(python -c 'print "x" * 200').$i
+log_must zfs create $fs
+log_must zfs snapshot $fs@snap
+while((i <= $(( ZFS_MAXPROPLEN/200+1 )))); do
+       log_must zfs clone $fs@snap $fs/$TESTCLONE$(python -c 'print "x" * 200').$i
        ((i=i+1))
        ((j=j+200))
 done
-clone_list=$($ZFS list -o clones $fs@snap)
-char_count=$($ECHO "$clone_list" | $TAIL -1 | wc | $AWK '{print $3}')
-[[ $char_count -eq $ZFS_MAXPROPLEN ]] || \
+clone_list=$(zfs list -o clones $fs@snap)
+char_count=$(echo "$clone_list" | tail -1 | wc | awk '{print $3}')
+[[ $char_count -eq ZFS_MAXPROPLEN ]] || \
     log_fail "Clone list not truncated correctly. Unexpected character count" \
         "$char_count"
 
index 39b52a889ef247293388b99bcd9adc90d6f82b10..b89456041e5f2fd83dc0737d267eec14b56bfac0 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cli_root/zfs_copies/zfs_copies.kshlib
@@ -37,8 +37,8 @@
 #
 
 if ismounted $FS_MNTPOINT $NEWFS_DEFAULT_FS ; then
-       log_must $UMOUNT -f $FS_MNTPOINT
-       $RM -fr $FS_MNTPOINT
+       log_must umount -f $FS_MNTPOINT
+       rm -fr $FS_MNTPOINT
 fi
 
 default_cleanup
index 4957c0f966b0541c3d44145e3bbca80fd1dd34f0..5114a1c61bff448b261c062a3f971315f848a854 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -58,12 +58,12 @@ function get_used_prop
        typeset ds=$1
        typeset used
 
-       used=`$ZFS list -H -o used $ds`
+       used=`zfs list -H -o used $ds`
        used=${used%[m|M]}
        if [[ $used == *K ]]; then
                used=0
        fi
-       $ECHO $used
+       echo $used
 }
 
 #
@@ -102,19 +102,19 @@ function do_vol_test
        vol_b_path=$ZVOL_DEVDIR/$TESTPOOL/$TESTVOL1
        vol_r_path=$ZVOL_RDEVDIR/$TESTPOOL/$TESTVOL1
 
-       log_must $ZFS create -V $VOLSIZE -o copies=$copy $vol
-       log_must $ZFS set refreservation=none $vol
+       log_must zfs create -V $VOLSIZE -o copies=$copy $vol
+       log_must zfs set refreservation=none $vol
        block_device_wait
 
        if [[ $type == "ufs" ]]; then
-               log_must $ECHO y | $NEWFS $vol_r_path >/dev/null 2>&1
-               log_must $MOUNT -F ufs -o rw $vol_b_path $mntp
+               log_must echo y | newfs $vol_r_path >/dev/null 2>&1
+               log_must mount -F ufs -o rw $vol_b_path $mntp
        elif [[ $type == "ext2" ]]; then
-               log_must $ECHO y | $NEWFS $vol_r_path >/dev/null 2>&1
-               log_must $MOUNT -o rw $vol_b_path $mntp
+               log_must echo y | newfs $vol_r_path >/dev/null 2>&1
+               log_must mount -o rw $vol_b_path $mntp
        else
-               log_must $ZPOOL create $TESTPOOL1 $vol_b_path
-               log_must $ZFS create $TESTPOOL1/$TESTFS1
+               log_must zpool create $TESTPOOL1 $vol_b_path
+               log_must zfs create $TESTPOOL1/$TESTFS1
        fi
 
        ((nfilesize = copy * ${FILESIZE%m}))
@@ -122,11 +122,11 @@ function do_vol_test
        ((target_size = pre_used + nfilesize))
 
        if [[ $type == "ufs" ]]; then
-               log_must $MKFILE $FILESIZE $mntp/$FILE
+               log_must mkfile $FILESIZE $mntp/$FILE
        elif [[ $type == "ext2" ]]; then
-               log_must $MKFILE $FILESIZE $mntp/$FILE
+               log_must mkfile $FILESIZE $mntp/$FILE
        else
-               log_must $MKFILE $FILESIZE /$TESTPOOL1/$TESTFS1/$FILE
+               log_must mkfile $FILESIZE /$TESTPOOL1/$TESTFS1/$FILE
        fi
 
        post_used=$(get_used_prop $vol)
@@ -142,12 +142,12 @@ function do_vol_test
        fi
 
        if [[ $type == "ufs" ]]; then
-               $UMOUNT $mntp
+               umount $mntp
        elif [[ $type == "ext2" ]]; then
-               $UMOUNT $mntp
+               umount $mntp
        else
-               log_must $ZPOOL destroy $TESTPOOL1
+               log_must zpool destroy $TESTPOOL1
        fi
 
-       log_must $ZFS destroy $vol
+       log_must zfs destroy $vol
 }
index 79ec39c69ab2c0da19b01e1323e63f5141a352ea..2ed881a367066e78ae94651691e66c77d56dbd39 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_copies/zfs_copies.kshlib
 
@@ -46,7 +50,7 @@ function cleanup
 
        for ds in $fs1 $fs2 $vol1 $vol2; do
                if datasetexists $ds; then
-                       log_must $ZFS destroy $ds
+                       log_must zfs destroy $ds
                fi
        done
 }
@@ -69,34 +73,34 @@ for ds in $fs $vol; do
 done
 
 for val in 1 2 3; do
-       log_must $ZFS create -o copies=$val $fs1
+       log_must zfs create -o copies=$val $fs1
        if is_global_zone; then
-               log_must $ZFS create -V $VOLSIZE -o copies=$val $vol1
+               log_must zfs create -V $VOLSIZE -o copies=$val $vol1
                block_device_wait
        else
-               log_must $ZFS create -o copies=$val $vol1
+               log_must zfs create -o copies=$val $vol1
        fi
        for ds in $fs1 $vol1; do
                cmp_prop $ds $val
        done
 
        for val2 in 3 2 1; do
-               log_must $ZFS create -o copies=$val2 $fs2
+               log_must zfs create -o copies=$val2 $fs2
                if is_global_zone; then
-                       log_must $ZFS create -V $VOLSIZE -o copies=$val2 $vol2
+                       log_must zfs create -V $VOLSIZE -o copies=$val2 $vol2
                        block_device_wait
                else
-                       log_must $ZFS create -o copies=$val2 $vol2
+                       log_must zfs create -o copies=$val2 $vol2
                fi
                for ds in $fs2 $vol2; do
                        cmp_prop $ds $val2
-                       log_must $ZFS destroy $ds
+                       log_must zfs destroy $ds
                        block_device_wait
                done
        done
 
        for ds in $fs1 $vol1; do
-               log_must $ZFS destroy $ds
+               log_must zfs destroy $ds
                block_device_wait
        done
 
@@ -104,7 +108,7 @@ done
 
 for val in 3 2 1; do
        for ds in $fs $vol; do
-               log_must $ZFS set copies=$val $ds
+               log_must zfs set copies=$val $ds
                cmp_prop $ds $val
        done
 done
index 45ebd2bd79a0df592a3995c17980d19c465e161d..68f907e0b05a99450b06e354e7e364f0e2d6aee5 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_copies/zfs_copies.kshlib
 
@@ -47,7 +51,7 @@ function cleanup
 
        for val in 1 2 3; do
                if datasetexists $TESTPOOL/fs_$val; then
-                       log_must $ZFS destroy $TESTPOOL/fs_$val
+                       log_must zfs destroy $TESTPOOL/fs_$val
                fi
        done
 }
@@ -56,15 +60,15 @@ log_assert "Verify that the space used by multiple copies is charged correctly."
 log_onexit cleanup
 
 for val in 1 2 3; do
-       log_must $ZFS create -o copies=$val $TESTPOOL/fs_$val
+       log_must zfs create -o copies=$val $TESTPOOL/fs_$val
 
-       log_must $MKFILE $FILESIZE /$TESTPOOL/fs_$val/$FILE
+       log_must mkfile $FILESIZE /$TESTPOOL/fs_$val/$FILE
 done
 
 #
 # Sync up the filesystem
 #
-$SYNC
+sync
 
 #
 # Verify 'zfs list' can correctly list the space charged
@@ -83,21 +87,21 @@ else
        blksize=512
 fi
 for val in 1 2 3; do
-       blks=`$LS -ls /$TESTPOOL/fs_$val/$FILE | $AWK '{print $1}'`
+       blks=`ls -ls /$TESTPOOL/fs_$val/$FILE | awk '{print $1}'`
        (( used = blks * $blksize / (1024 * 1024) ))
        check_used $used $val
 done
 
 log_note "Verify df(1M) can corectly display the space charged."
 for val in 1 2 3; do
-       used=`$DF -F zfs -h /$TESTPOOL/fs_$val/$FILE | $GREP $TESTPOOL/fs_$val \
-               | $AWK '{print $3}'`
+       used=`df -F zfs -h /$TESTPOOL/fs_$val/$FILE | grep $TESTPOOL/fs_$val \
+               | awk '{print $3}'`
        check_used $used $val
 done
 
 log_note "Verify du(1) can correctly display the space charged."
 for val in 1 2 3; do
-       used=`$DU -h /$TESTPOOL/fs_$val/$FILE | $AWK '{print $1}'`
+       used=`du -h /$TESTPOOL/fs_$val/$FILE | awk '{print $1}'`
        check_used $used $val
 done
 
index 4b67e691a4d0c955c4331f4d91e48a870ebd5b70..98420cb7f2ab6800b5f6f16301c23bfc063372e3 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/zfs_copies/zfs_copies.kshlib
 
 #
@@ -48,7 +52,7 @@ function cleanup
        fi
 
        if datasetexists $vol; then
-               log_must $ZFS destroy $vol
+               log_must zfs destroy $vol
        fi
 }
 
index f98b9d546974e16f3a822f905e62ebd075a1d84c..dc007b11160d678c7e416529d5dabd32d46535c2 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_copies/zfs_copies.kshlib
 
@@ -44,10 +48,10 @@ log_assert "Verify that copies property cannot be set to any value other than 1,
 set -A badval 0 01 02 03 0 -1 -2 -3 10 20 30 4 5 6 blah
 
 for val in ${badval[@]}; do
-       log_mustnot $ZFS create -o copies=$val $TESTPOOL/$TESTFS1
-       log_mustnot $ZFS create -V $VOLSIZE -o copies=$val $TESTPOOL/$TESTVOL1
-       log_mustnot $ZFS set copies=$val $TESTPOOL/$TESTFS
-       log_mustnot $ZFS set copies=$val $TESTPOOL/$TESTVOL
+       log_mustnot zfs create -o copies=$val $TESTPOOL/$TESTFS1
+       log_mustnot zfs create -V $VOLSIZE -o copies=$val $TESTPOOL/$TESTVOL1
+       log_mustnot zfs set copies=$val $TESTPOOL/$TESTFS
+       log_mustnot zfs set copies=$val $TESTPOOL/$TESTVOL
        block_device_wait
 done
 
index a10ca594e97e482ead11a33306632fe97b338307..ae81ae964e7bd0812f64f83b7a7eccbefeec7f50 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_copies/zfs_copies.kshlib
 
@@ -53,18 +57,18 @@ function cleanup
 log_assert "Verify that copies cannot be set with pool version 1"
 log_onexit cleanup
 
-$CP $STF_SUITE/tests/functional/cli_root/zpool_upgrade/blockfiles/$ZPOOL_VERSION_1_FILES $TESTDIR
-$BUNZIP2 $TESTDIR/$ZPOOL_VERSION_1_FILES
-log_must $ZPOOL import -d $TESTDIR $ZPOOL_VERSION_1_NAME
-log_must $ZFS create $ZPOOL_VERSION_1_NAME/$TESTFS
-log_must $ZFS create -V 1m $ZPOOL_VERSION_1_NAME/$TESTVOL
+cp $STF_SUITE/tests/functional/cli_root/zpool_upgrade/blockfiles/$ZPOOL_VERSION_1_FILES $TESTDIR
+bunzip2 $TESTDIR/$ZPOOL_VERSION_1_FILES
+log_must zpool import -d $TESTDIR $ZPOOL_VERSION_1_NAME
+log_must zfs create $ZPOOL_VERSION_1_NAME/$TESTFS
+log_must zfs create -V 1m $ZPOOL_VERSION_1_NAME/$TESTVOL
 
 for val in 3 2 1; do
        for ds in $ZPOOL_VERSION_1_NAME/$TESTFS $ZPOOL_VERSION_1_NAME/$TESTVOL; do
-               log_mustnot $ZFS set copies=$val $ds
+               log_mustnot zfs set copies=$val $ds
        done
        for ds in $ZPOOL_VERSION_1_NAME/$TESTFS1 $ZPOOL_VERSION_1_NAME/$TESTVOL1; do
-               log_mustnot $ZFS create -o copies=$val $ds
+               log_mustnot zfs create -o copies=$val $ds
        done
 done
 
index 40a83281cb62dbf1f82635203abd7027a5f6d462..5946bf59679ce4dde807bd1466e2ef1446fc6b61 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/zfs_copies/zfs_copies.kshlib
 
 #
@@ -44,15 +48,15 @@ verify_runnable "global"
 function cleanup
 {
        if ismounted $mntp $NEWFS_DEFAULT_FS ; then
-               log_must $UMOUNT $mntp
+               log_must umount $mntp
        fi
 
        if datasetexists $vol; then
-               log_must $ZFS destroy $vol
+               log_must zfs destroy $vol
        fi
 
        if [[ -d $mntp ]]; then
-                $RM -rf $mntp
+                rm -rf $mntp
         fi
 }
 
@@ -63,7 +67,7 @@ mntp=$FS_MNTPOINT
 vol=$TESTPOOL/$TESTVOL1
 
 if [[ ! -d $mntp ]]; then
-       $MKDIR -p $mntp
+       mkdir -p $mntp
 fi
 
 for val in 1 2 3; do
index 63cf619dcf7a60c491add464bbfed13cd68dce1c..0e580a8474cade6669c44e3119980d695cd6500c 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -43,7 +48,7 @@ function cleanup
        typeset -i i=0
        while (( $i < ${#datasets[*]} )); do
                datasetexists ${datasets[$i]} && \
-                       log_must $ZFS destroy -f ${datasets[$i]}
+                       log_must zfs destroy -f ${datasets[$i]}
                ((i = i + 1))
        done
 }
@@ -57,7 +62,7 @@ log_assert "'zfs create <filesystem>' can create a ZFS filesystem in the namespa
 
 typeset -i i=0
 while (( $i < ${#datasets[*]} )); do
-       log_must $ZFS create ${datasets[$i]}
+       log_must zfs create ${datasets[$i]}
        datasetexists ${datasets[$i]} || \
                log_fail "zfs create ${datasets[$i]} fail."
        ((i = i + 1))
index bb066467e6756c64fe4ca0040aca61a709739100..2498e4a4c9f42bf8b6a5564041cb4b2bdf0085de 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_create/zfs_create.cfg
 
@@ -43,7 +48,7 @@ function cleanup
        typeset -i j=0
        while [[ $j -lt ${#size[*]} ]]; do
                if datasetexists $TESTPOOL/${TESTVOL}${size[j]}; then
-                       log_must $ZFS destroy $TESTPOOL/${TESTVOL}${size[j]}
+                       log_must zfs destroy $TESTPOOL/${TESTVOL}${size[j]}
                fi
                ((j = j + 1))
        done
@@ -56,7 +61,7 @@ log_assert "'zfs create -s -V <size> <volume>' succeeds"
 
 typeset -i j=0
 while (( $j < ${#size[*]} )); do
-       typeset cmdline="$ZFS create -s -V ${size[j]}  \
+       typeset cmdline="zfs create -s -V ${size[j]}  \
                         $TESTPOOL/${TESTVOL}${size[j]}"
 
        str=$(eval $cmdline 2>&1)
index dbb380e7253054f82a4141880de8819f3d83bcaa..2906e32dab8cc86473e3405d4b9b7196e09b62d3 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,7 +47,7 @@ verify_runnable "global"
 function cleanup
 {
        datasetexists $vol && \
-               log_must $ZFS destroy -f $vol
+               log_must zfs destroy -f $vol
 }
 
 log_assert "Verify creating volume with specified blocksize works."
@@ -58,11 +58,11 @@ vol=$TESTPOOL/$TESTVOL
 
 typeset -i i=0
 while (( i < ${#options[*]} )); do
-       log_must $ZFS create ${options[i]} -V $VOLSIZE $vol
+       log_must zfs create ${options[i]} -V $VOLSIZE $vol
        datasetexists $vol || \
                log_fail "zfs create ${options[i]} -V $VOLSIZE $vol fail."
 
-       log_must_busy $ZFS destroy -f $vol
+       log_must_busy zfs destroy -f $vol
        ((i = i + 1))
 done
 
index 5d2a21a8d665c04513483efd4cd59f398e803c42..200b4a091567f0124052439dab930288b1b43e68 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_create/zfs_create_common.kshlib
 . $STF_SUITE/tests/functional/cli_root/zfs_create/properties.kshlib
@@ -45,7 +49,7 @@ verify_runnable "both"
 function cleanup
 {
        datasetexists $TESTPOOL/$TESTFS1 && \
-               log_must $ZFS destroy -f $TESTPOOL/$TESTFS1
+               log_must zfs destroy -f $TESTPOOL/$TESTFS1
 }
 
 log_onexit cleanup
@@ -56,12 +60,12 @@ log_assert "'zfs create -o property=value filesystem' can successfully create \
 
 typeset -i i=0
 while (( $i < ${#RW_FS_PROP[*]} )); do
-       log_must $ZFS create -o ${RW_FS_PROP[$i]} $TESTPOOL/$TESTFS1
+       log_must zfs create -o ${RW_FS_PROP[$i]} $TESTPOOL/$TESTFS1
        datasetexists $TESTPOOL/$TESTFS1 || \
                log_fail "zfs create $TESTPOOL/$TESTFS1 fail."
        propertycheck $TESTPOOL/$TESTFS1 ${RW_FS_PROP[i]} || \
                log_fail "${RW_FS_PROP[i]} is failed to set."
-       log_must $ZFS destroy -f $TESTPOOL/$TESTFS1
+       log_must zfs destroy -f $TESTPOOL/$TESTFS1
        (( i = i + 1 ))
 done
 
index ce84a5c7b28bcc1029acbe26587ab050f9803b4a..e953c65ded952e8361bb1ed9940beda43ed2291b 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_create/zfs_create_common.kshlib
 . $STF_SUITE/tests/functional/cli_root/zfs_create/properties.kshlib
@@ -45,7 +49,7 @@ verify_runnable "both"
 function cleanup
 {
        datasetexists $TESTPOOL/$TESTFS1 && \
-               log_must $ZFS destroy -f $TESTPOOL/$TESTFS1
+               log_must zfs destroy -f $TESTPOOL/$TESTFS1
 }
 
 log_onexit cleanup
@@ -64,7 +68,7 @@ while (( $i < ${#RW_FS_PROP[*]} )); do
        (( i = i + 1 ))
 done
 
-log_must $ZFS create $opts $TESTPOOL/$TESTFS1
+log_must zfs create $opts $TESTPOOL/$TESTFS1
 datasetexists $TESTPOOL/$TESTFS1 || \
        log_fail "zfs create $TESTPOOL/$TESTFS1 fail."
 
index 20a44cee7cb41433166a9ab7112cec20e1bb3bc7..2a664a4246192398f8ab9beb6022458f7f7bacbc 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -50,7 +50,7 @@ verify_runnable "global"
 function cleanup
 {
        datasetexists $TESTPOOL/$TESTVOL1 && \
-               log_must $ZFS destroy -f $TESTPOOL/$TESTVOL1
+               log_must zfs destroy -f $TESTPOOL/$TESTVOL1
 }
 
 log_onexit cleanup
@@ -61,21 +61,21 @@ log_assert "'zfs create -o property=value -V size volume' can successfully \
 
 typeset -i i=0
 while (( $i < ${#RW_VOL_PROP[*]} )); do
-       log_must $ZFS create -o ${RW_VOL_PROP[$i]} -V $VOLSIZE \
+       log_must zfs create -o ${RW_VOL_PROP[$i]} -V $VOLSIZE \
                $TESTPOOL/$TESTVOL1
        datasetexists $TESTPOOL/$TESTVOL1 || \
                log_fail "zfs create -V size $TESTPOOL/$TESTVOL1 fail."
        propertycheck $TESTPOOL/$TESTVOL1 ${RW_VOL_PROP[i]} || \
                log_fail "${RW_VOL_PROP[i]} is failed to set."
-       log_must_busy $ZFS destroy -f $TESTPOOL/$TESTVOL1
+       log_must_busy zfs destroy -f $TESTPOOL/$TESTVOL1
 
-       log_must $ZFS create -s -o ${RW_VOL_PROP[$i]} -V $VOLSIZE \
+       log_must zfs create -s -o ${RW_VOL_PROP[$i]} -V $VOLSIZE \
                $TESTPOOL/$TESTVOL1
        datasetexists $TESTPOOL/$TESTVOL1 || \
                log_fail "zfs create -s -V $TESTPOOL/$TESTVOL1 fail."
        propertycheck $TESTPOOL/$TESTVOL1 ${RW_VOL_PROP[i]} || \
                log_fail "${RW_VOL_PROP[i]} is failed to set."
-       log_must_busy $ZFS destroy -f $TESTPOOL/$TESTVOL1
+       log_must_busy zfs destroy -f $TESTPOOL/$TESTVOL1
 
        (( i = i + 1 ))
 done
index a34b46d02f62f57e26e58f6c98be13c7d763eb8c..747f6d2f0ead18bdd1d1fd718251ab7c2313a9b8 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -50,9 +50,9 @@ verify_runnable "global"
 function cleanup
 {
         datasetexists $TESTPOOL/$TESTVOL && \
-                log_must $ZFS destroy -f $TESTPOOL/$TESTVOL
+                log_must zfs destroy -f $TESTPOOL/$TESTVOL
        datasetexists $TESTPOOL/$TESTVOL1 && \
-               log_must $ZFS destroy -f $TESTPOOL/$TESTVOL1
+               log_must zfs destroy -f $TESTPOOL/$TESTVOL1
 }
 
 log_onexit cleanup
@@ -71,10 +71,10 @@ while (( $i < ${#RW_VOL_PROP[*]} )); do
        (( i = i + 1 ))
 done
 
-log_must $ZFS create $opts -V $VOLSIZE $TESTPOOL/$TESTVOL
+log_must zfs create $opts -V $VOLSIZE $TESTPOOL/$TESTVOL
 datasetexists $TESTPOOL/$TESTVOL || \
        log_fail "zfs create $TESTPOOL/$TESTVOL fail."
-log_must $ZFS create -s $opts -V $VOLSIZE $TESTPOOL/$TESTVOL1
+log_must zfs create -s $opts -V $VOLSIZE $TESTPOOL/$TESTVOL1
 datasetexists $TESTPOOL/$TESTVOL1 || \
        log_fail "zfs create $TESTPOOL/$TESTVOL1 fail."
 
index 27b5f9cb861df182fcc7943374989b3e0bb493d8..08ede0592fa20cda8d2853694cf499c5ea93d723 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,7 +47,7 @@ verify_runnable "both"
 function cleanup
 {
        if datasetexists $TESTPOOL/$TESTFS1 ; then
-               log_must $ZFS destroy -f $TESTPOOL/$TESTFS1
+               log_must zfs destroy -f $TESTPOOL/$TESTFS1
        fi
 }
 
@@ -93,8 +93,8 @@ log_assert "'zfs create' should return an error with badly-formed parameters."
 
 typeset -i i=0
 while [[ $i -lt ${#args[*]} ]]; do
-       log_mustnot $ZFS create ${args[i]} $TESTPOOL/$TESTFS1
-       log_mustnot $ZFS create -p ${args[i]} $TESTPOOL/$TESTFS1
+       log_mustnot zfs create ${args[i]} $TESTPOOL/$TESTFS1
+       log_mustnot zfs create -p ${args[i]} $TESTPOOL/$TESTFS1
        ((i = i + 1))
 done
 
index ed8195c940067ceb04d4a4c23f3b680bf805b287..28c6f0cc2dd6194d447af6d3a9e1bde20a3089c4 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -61,8 +61,8 @@ function cleanup
        # check to see if there is any new fs created during the test
        # if so destroy it.
        #
-       for dset in $($ZFS list -H | \
-               $AWK '{print $1}' | $GREP / ); do
+       for dset in $(zfs list -H | \
+               awk '{print $1}' | grep / ); do
                found=false
                i=0
                while (( $i < ${#existed_fs[*]} )); do
@@ -76,8 +76,8 @@ function cleanup
                #
                # new fs created during the test, cleanup it
                #
-               if [[ $found == "true" ]]; then
-                       log_must $ZFS destroy -f $dset
+               if [[ $found == "false" ]]; then
+                       log_must zfs destroy -f $dset
                fi
        done
 }
@@ -94,33 +94,33 @@ set -A args  "$TESTPOOL/" "$TESTPOOL//blah" "$TESTPOOL/@blah" \
 log_assert "Verify 'zfs create <filesystem>' fails with bad <filesystem> argument."
 
 datasetexists $TESTPOOL/$TESTFS || \
-       log_must $ZFS create $TESTPOOL/$TESTFS
+       log_must zfs create $TESTPOOL/$TESTFS
 
-set -A existed_fs $($ZFS list -H | $AWK '{print $1}' | $GREP / )
+set -A existed_fs $(zfs list -H | awk '{print $1}' | grep / )
 
-log_mustnot $ZFS create $TESTPOOL
-log_mustnot $ZFS create $TESTPOOL/$TESTFS
+log_mustnot zfs create $TESTPOOL
+log_mustnot zfs create $TESTPOOL/$TESTFS
 
 typeset -i i=0
 while (( $i < ${#args[*]} )); do
-       log_mustnot $ZFS create ${args[$i]}
-       log_mustnot $ZFS create -p ${args[$i]}
+       log_mustnot zfs create ${args[$i]}
+       log_mustnot zfs create -p ${args[$i]}
        ((i = i + 1))
 done
 
 i=0
 while (( $i < ${#RW_FS_PROP[*]} )); do
-       log_mustnot $ZFS create -o ${RW_FS_PROP[i]} -o ${RW_FS_PROP[i]} \
+       log_mustnot zfs create -o ${RW_FS_PROP[i]} -o ${RW_FS_PROP[i]} \
                $TESTPOOL/$TESTFS1
-       log_mustnot $ZFS create -p -o ${RW_FS_PROP[i]} -o ${RW_FS_PROP[i]} \
+       log_mustnot zfs create -p -o ${RW_FS_PROP[i]} -o ${RW_FS_PROP[i]} \
                $TESTPOOL/$TESTFS1
        ((i = i + 1))
 done
 
 i=0
 while (( $i < ${#VOL_ONLY_PROP[*]} )); do
-       log_mustnot $ZFS create -o ${VOL_ONLY_PROP[i]} $TESTPOOL/$TESTFS1
-       log_mustnot $ZFS create -p -o ${VOL_ONLY_PROP[i]} $TESTPOOL/$TESTFS1
+       log_mustnot zfs create -o ${VOL_ONLY_PROP[i]} $TESTPOOL/$TESTFS1
+       log_mustnot zfs create -p -o ${VOL_ONLY_PROP[i]} $TESTPOOL/$TESTFS1
        ((i = i + 1))
 done
 
index b54203dd3486ad1c0e9db632e3bc20914b213ade..4b1401d8649bee8616380d42c1e6a51c9c88213d 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -62,8 +62,8 @@ function cleanup
        # check to see if there is any new fs created during the test
        # if so destroy it.
        #
-       for dset in $($ZFS list -H | \
-               $AWK '{print $1}' | $GREP / ); do
+       for dset in $(zfs list -H | \
+               awk '{print $1}' | grep / ); do
                found=false
                i=0
                while (( $i < ${#existed_fs[*]} )); do
@@ -77,8 +77,8 @@ function cleanup
                #
                # new fs created during the test, cleanup it
                #
-               if [[ $found == "true" ]]; then
-                       log_must $ZFS destroy -f $dset
+               if [[ $found == "false" ]]; then
+                       log_must zfs destroy -f $dset
                fi
        done
 }
@@ -106,12 +106,12 @@ set -A args "$VOLSIZE" "$TESTVOL1" \
 set -A options "" "-s"
 
 datasetexists $TESTPOOL/$TESTVOL || \
-               log_must $ZFS create -V $VOLSIZE $TESTPOOL/$TESTVOL
+               log_must zfs create -V $VOLSIZE $TESTPOOL/$TESTVOL
 
-set -A existed_fs $($ZFS list -H | $AWK '{print $1}' | $GREP / )
+set -A existed_fs $(zfs list -H | awk '{print $1}' | grep / )
 
-log_mustnot $ZFS create -V $VOLSIZE $TESTPOOL/$TESTVOL
-log_mustnot $ZFS create -s -V $VOLSIZE $TESTPOOL/$TESTVOL
+log_mustnot zfs create -V $VOLSIZE $TESTPOOL/$TESTVOL
+log_mustnot zfs create -s -V $VOLSIZE $TESTPOOL/$TESTVOL
 
 typeset -i i=0
 typeset -i j=0
@@ -119,26 +119,26 @@ while (( i < ${#options[*]} )); do
 
        j=0
        while (( j < ${#args[*]} )); do
-               log_mustnot $ZFS create ${options[$i]} -V ${args[$j]}
-               log_mustnot $ZFS create -p ${options[$i]} -V ${args[$j]}
+               log_mustnot zfs create ${options[$i]} -V ${args[$j]}
+               log_mustnot zfs create -p ${options[$i]} -V ${args[$j]}
 
                ((j = j + 1))
        done
 
        j=0
        while (( $j < ${#RW_VOL_PROP[*]} )); do
-               log_mustnot $ZFS create ${options[$i]} -o ${RW_VOL_PROP[j]} \
+               log_mustnot zfs create ${options[$i]} -o ${RW_VOL_PROP[j]} \
                    -o ${RW_VOL_PROP[j]} -V $VOLSIZE $TESTPOOL/$TESTVOL1
-               log_mustnot $ZFS create -p ${options[$i]} -o ${RW_VOL_PROP[j]} \
+               log_mustnot zfs create -p ${options[$i]} -o ${RW_VOL_PROP[j]} \
                    -o ${RW_VOL_PROP[j]} -V $VOLSIZE $TESTPOOL/$TESTVOL1
                ((j = j + 1))
        done
 
        j=0
        while (( $j < ${#FS_ONLY_PROP[*]} )); do
-               log_mustnot $ZFS create ${options[$i]} -o ${FS_ONLY_PROP[j]} \
+               log_mustnot zfs create ${options[$i]} -o ${FS_ONLY_PROP[j]} \
                    -V $VOLSIZE $TESTPOOL/$TESTVOL1
-               log_mustnot $ZFS create -p ${options[$i]} -o ${FS_ONLY_PROP[j]} \
+               log_mustnot zfs create -p ${options[$i]} -o ${FS_ONLY_PROP[j]} \
                    -V $VOLSIZE $TESTPOOL/$TESTVOL1
                ((j = j + 1))
        done
index ba2e55f583ac6c79528d91cbfa9509f67321b06e..0144b050d7d73fe68fc73e0edab94cf4a4e62873 100755 (executable)
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -44,7 +49,7 @@ verify_runnable "both"
 function cleanup
 {
        if datasetexists $TESTPOOL/$TESTFS1 ; then
-               log_must $ZFS destroy -rf $TESTPOOL/$TESTFS1
+               log_must zfs destroy -rf $TESTPOOL/$TESTFS1
        fi
 }
 
index fe50460615bd65a8140015044e4fc60757c599d0..d8aa06407755c0bdb4c801a9eb79661da4d236c0 100755 (executable)
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_upgrade/zfs_upgrade.kshlib
 
 # 2. Verify only the leaf filesystem to be version=1, others use the current version
 #
 
-ZFS_VERSION=$($ZFS upgrade | $HEAD -1 | $AWK '{print $NF}' \
-       | $SED -e 's/\.//g')
+ZFS_VERSION=$(zfs upgrade | head -1 | awk '{print $NF}' \
+       | sed -e 's/\.//g')
 
 verify_runnable "both"
 
 function cleanup
 {
        if datasetexists $TESTPOOL/$TESTFS1 ; then
-               log_must $ZFS destroy -rf $TESTPOOL/$TESTFS1
+               log_must zfs destroy -rf $TESTPOOL/$TESTFS1
        fi
 }
 
@@ -55,7 +60,7 @@ typeset newdataset1="$TESTPOOL/$TESTFS1/$TESTFS/$TESTFS1"
 
 log_assert "'zfs create -p -o version=1' only cause the leaf filesystem to be version=1."
 
-log_must $ZFS create -p -o version=1 $newdataset1
+log_must zfs create -p -o version=1 $newdataset1
 log_must datasetexists $newdataset1
 
 log_must check_fs_version $TESTPOOL/$TESTFS1/$TESTFS/$TESTFS1 1
index 460ee8fd249faa035e2ad3241b043622f169f241..b24d39fd402226d9aecd71d9e3071ed888ebb88a 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_create/zfs_create.cfg
 
@@ -44,7 +49,7 @@ function cleanup
        typeset -i j=0
        while [[ $j -lt ${#size[*]} ]]; do
                datasetexists $TESTPOOL/${LONGFSNAME}${size[j]} && \
-                   log_must $ZFS destroy $TESTPOOL/${LONGFSNAME}${size[j]}
+                   log_must zfs destroy $TESTPOOL/${LONGFSNAME}${size[j]}
                ((j = j + 1))
        done
 }
@@ -56,7 +61,7 @@ log_assert "'zfs create -s -V <size> <volume>' succeeds"
 
 typeset -i j=0
 while (( $j < ${#size[*]} )); do
-       typeset cmdline="$ZFS create -s -V ${size[j]} \
+       typeset cmdline="zfs create -s -V ${size[j]} \
                         $TESTPOOL/${LONGFSNAME}${size[j]}"
 
        str=$(eval $cmdline 2>&1)
index b58f8f2a03aa7764d74b6f561d652851356c1ddf..d1a8153d60e5b7ae398865049b33e48b4e5e4a75 100755 (executable)
@@ -44,16 +44,16 @@ TESTFS2=$(for i in $(seq $((255 - ${#TESTPOOL}))); do echo z ; done | tr -d '\n'
 function cleanup
 {
        datasetexists $TESTPOOL/$TESTFS1 &&
-               log_must $ZFS destroy $TESTPOOL/$TESTFS1
+               log_must zfs destroy $TESTPOOL/$TESTFS1
 }
 
 log_onexit cleanup
 
 log_assert "'zfs create <filesystem>' can create a ZFS filesystem with name length 255."
 
-log_must $ZFS create $TESTPOOL/$TESTFS1
-log_mustnot $ZFS create $TESTPOOL/$TESTFS2
-log_must $ZPOOL export $TESTPOOL
-log_must $ZPOOL import $TESTPOOL
+log_must zfs create $TESTPOOL/$TESTFS1
+log_mustnot zfs create $TESTPOOL/$TESTFS2
+log_must zpool export $TESTPOOL
+log_must zpool import $TESTPOOL
 
 log_pass "'zfs create <filesystem>' works as expected."
index bbc1273daac6da012ecbaf895797d7a8d037f617..222b8e8f571e1fefdedbd67181e7f5d07ab346e5 100644 (file)
 # CDDL HEADER END
 #
 
-#!/bin/ksh -p
 #
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -38,9 +41,9 @@ function propertycheck
        typeset dtst=$1
        typeset propstr=$2
 
-       typeset prop=$($ECHO $propstr | $AWK -F= '{print $1}')
-       typeset expect_value=$($ECHO $propstr | $AWK -F= '{print $2}')
-       typeset value=$($ZFS get -H -o value $prop $dtst)
+       typeset prop=$(echo $propstr | awk -F= '{print $1}')
+       typeset expect_value=$(echo $propstr | awk -F= '{print $2}')
+       typeset value=$(zfs get -H -o value $prop $dtst)
 
 
        if [[ "$expect_value" == "$value" ]]; then
index e942eaebf4b804f72960493ea745829b844d74ae..a5222dea0ee542918e77e08d5f28b7db53330c7a 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -78,7 +78,7 @@ function test_n_check
 
        # Clean the test environment and make it clear.
        if datasetexists $CTR; then
-               log_must $ZFS destroy -Rf $CTR
+               log_must zfs destroy -Rf $CTR
        fi
 
        # According to option create test compatible environment.
@@ -98,50 +98,50 @@ function test_n_check
                $CTR|$FS)
                        if [[ $opt == *f* ]]; then
                                mpt_dir=$(get_prop mountpoint $FS)
-                               pidlist="$pidlist $($MKBUSY \
+                               pidlist="$pidlist $(mkbusy \
                                    $mpt_dir/$TESTFILE0)"
-                               log_note "$MKBUSY $mpt_dir/$TESTFILE0 " \
+                               log_note "mkbusy $mpt_dir/$TESTFILE0 " \
                                    "(pidlist: $pidlist)"
                                [[ -z $pidlist ]] && \
-                                   log_fail "Failure from $MKBUSY"
-                               log_mustnot $ZFS destroy -rR $dtst
+                                   log_fail "Failure from mkbusy"
+                               log_mustnot zfs destroy -rR $dtst
                        fi
                        ;;
                $VOL)
                        if [[ $opt == *f* ]]; then
-                               pidlist="$pidlist $($MKBUSY \
+                               pidlist="$pidlist $(mkbusy \
                                    $TESTDIR1/$TESTFILE0)"
-                               log_note "$MKBUSY $TESTDIR1/$TESTFILE0 " \
+                               log_note "mkbusy $TESTDIR1/$TESTFILE0 " \
                                    "(pidlist: $pidlist)"
                                [[ -z $pidlist ]] && \
-                                   log_fail "Failure from $MKBUSY"
-                               log_mustnot $ZFS destroy -rR $dtst
+                                   log_fail "Failure from mkbusy"
+                               log_mustnot zfs destroy -rR $dtst
                        fi
                        ;;
                $VOLSNAP)
                        if [[ $opt == *f* ]]; then
-                               pidlist="$pidlist $($MKBUSY \
+                               pidlist="$pidlist $(mkbusy \
                                    $TESTDIR1/$TESTFILE0)"
-                               log_note "$MKBUSY $TESTDIR1/$TESTFILE0 " \
+                               log_note "mkbusy $TESTDIR1/$TESTFILE0 " \
                                    "(pidlist: $pidlist)"
                                [[ -z $pidlist ]] && \
-                                   log_fail "Failure from $MKBUSY"
-                               log_must_busy $ZFS destroy -rR $dtst
-                               log_must $ZFS snapshot $dtst
+                                   log_fail "Failure from mkbusy"
+                               log_must_busy zfs destroy -rR $dtst
+                               log_must zfs snapshot $dtst
                        fi
                        ;;
                $FSSNAP)
                        if [[ $opt == *f* ]]; then
                                mpt_dir=$(snapshot_mountpoint $dtst)
-                               pidlist="$pidlist $($MKBUSY $mpt_dir)"
-                               log_note "$MKBUSY $mpt_dir (pidlist: $pidlist)"
+                               pidlist="$pidlist $(mkbusy $mpt_dir)"
+                               log_note "mkbusy $mpt_dir (pidlist: $pidlist)"
                                [[ -z $pidlist ]] && \
-                                   log_fail "Failure from $MKBUSY"
+                                   log_fail "Failure from mkbusy"
                                if is_linux ; then
-                                       log_mustnot $ZFS destroy -rR $dtst
+                                       log_mustnot zfs destroy -rR $dtst
                                else
-                                       log_must $ZFS destroy -rR $dtst
-                                       log_must $ZFS snapshot $dtst
+                                       log_must zfs destroy -rR $dtst
+                                       log_must zfs snapshot $dtst
                                fi
                        fi
                        ;;
@@ -150,24 +150,24 @@ function test_n_check
 
        # Kill any lingering instances of mkbusy, and clear the list.
        if is_linux ; then
-               [[ -z $pidlist ]] || log_must $KILL -TERM $pidlist
+               [[ -z $pidlist ]] || log_must kill -TERM $pidlist
                pidlist=""
-               log_mustnot $PGREP -fl $MKBUSY
+               log_mustnot pgrep -fl mkbusy
        fi
 
        # Firstly, umount ufs filesystem which was created by zfs volume.
        if is_global_zone; then
-               log_must $UMOUNT -f $TESTDIR1
+               log_must umount -f $TESTDIR1
        fi
 
        # Invoke 'zfs destroy [-rRf] <dataset>'
-       log_must $ZFS destroy $opt $dtst
+       log_must zfs destroy $opt $dtst
 
        # Kill any lingering instances of mkbusy, and clear the list.
        if ! is_linux ; then
-               [[ -z $pidlist ]] || log_must $KILL -TERM $pidlist
+               [[ -z $pidlist ]] || log_must kill -TERM $pidlist
                pidlist=""
-               log_mustnot $PGREP -fl $MKBUSY
+               log_mustnot pgrep -fl mkbusy
        fi
 
        case $dtst in
@@ -214,7 +214,7 @@ function test_n_check
                        ;;
        esac
 
-       log_note "'$ZFS destroy $opt $dtst' passed."
+       log_note "'zfs destroy $opt $dtst' passed."
 }
 
 log_assert "'zfs destroy -r|-R|-f|-rf|-Rf <fs|ctr|vol|snap>' should " \
@@ -226,7 +226,7 @@ typeset opt=""
 typeset pidlist=""
 for dtst in $CTR $FS $VOL $FSSNAP $VOLSNAP; do
        for opt in "-r" "-R" "-f" "-rf" "-Rf"; do
-               log_note "Starting test: $ZFS destroy $opt $dtst"
+               log_note "Starting test: zfs destroy $opt $dtst"
                test_n_check $opt $dtst
        done
 done
index 9c4e67e62ee582c9939f2a7d4cf7a00dd3421362..594e3ad952835e58d213173eb5079a1464b2d0ab 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -50,7 +50,7 @@ function cleanup
        typeset -i i=0
        while (( $i < ${#data_objs[*]} )); do
                datasetexists "${data_objs[i]}" && \
-                       $ZFS destroy -rf ${data_objs[i]}
+                       zfs destroy -rf ${data_objs[i]}
                ((i = i + 1))
        done
 }
@@ -66,16 +66,16 @@ else
        set -A data_objs "$TESTPOOL/$TESTFS@$TESTSNAP" "$TESTPOOL/$TESTFS1"
 fi
 
-log_must $ZFS create $TESTPOOL/$TESTFS1
-log_must $ZFS snapshot $TESTPOOL/$TESTFS@$TESTSNAP
+log_must zfs create $TESTPOOL/$TESTFS1
+log_must zfs snapshot $TESTPOOL/$TESTFS@$TESTSNAP
 
 if is_global_zone ; then
-       log_must $ZFS create -V $VOLSIZE $TESTPOOL/$TESTVOL
+       log_must zfs create -V $VOLSIZE $TESTPOOL/$TESTVOL
 
        # Max volume size is 1TB on 32-bit systems
        [[ is_32bit ]] && \
                BIGVOLSIZE=1Tb
-       log_must $ZFS create -sV $BIGVOLSIZE $TESTPOOL/$TESTVOL1
+       log_must zfs create -sV $BIGVOLSIZE $TESTPOOL/$TESTVOL1
 fi
 
 typeset -i i=0
@@ -87,7 +87,7 @@ done
 
 i=0
 while (( $i < ${#data_objs[*]} )); do
-       log_must $ZFS destroy ${data_objs[i]}
+       log_must zfs destroy ${data_objs[i]}
        datasetexists ${data_objs[i]} && \
                log_fail "'zfs destroy <filesystem>|<volume>|<snapshot>' fail."
        ((i = i + 1))
index 9c48359a3cc0fc104c41587dbd3f07408ccdea45..3c909e458e74962c2bf2c55532c859cd501f09b5 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -51,12 +51,12 @@ function cleanup
 {
        for obj in $ctr2 $ctr1 $ctr; do
                datasetexists $obj && \
-                       log_must $ZFS destroy -Rf $obj
+                       log_must zfs destroy -Rf $obj
        done
 
        for mntp in $TESTDIR1 $TESTDIR2; do
                [[ -d $mntp ]] && \
-                       log_must $RM -rf $mntp
+                       log_must rm -rf $mntp
        done
 }
 
@@ -69,7 +69,7 @@ log_onexit cleanup
 #
 for dir in $TESTDIR1 $TESTDIR2; do
        [[ ! -d $dir ]] && \
-               log_must $MKDIR -p $dir
+               log_must mkdir -p $dir
 done
 
 ctr=$TESTPOOL/$TESTCTR
@@ -93,46 +93,46 @@ child_fs1_snap_clone1=$ctr/${TESTCLONE1}_across_ctr
 #
 # Create two datasets in the storage pool
 #
-log_must $ZFS create $ctr
-log_must $ZFS create $ctr1
+log_must zfs create $ctr
+log_must zfs create $ctr1
 
 #
 # Create children datasets fs,vol,snapshot in the datasets, and
 # clones across two datasets
 #
-log_must $ZFS create $ctr2
+log_must zfs create $ctr2
 
 for fs in $child_fs $child_fs1; do
-       log_must $ZFS create $fs
+       log_must zfs create $fs
 done
 
-log_must $ZFS set mountpoint=$child_fs_mntp $child_fs
-log_must $ZFS set mountpoint=$child_fs1_mntp $child_fs1
+log_must zfs set mountpoint=$child_fs_mntp $child_fs
+log_must zfs set mountpoint=$child_fs1_mntp $child_fs1
 
 for snap in $child_fs_snap $child_fs1_snap; do
-       log_must $ZFS snapshot $snap
+       log_must zfs snapshot $snap
 done
 
 if is_global_zone ; then
        for vol in $child_vol $child_vol1; do
-               log_must $ZFS create -V $VOLSIZE $vol
+               log_must zfs create -V $VOLSIZE $vol
        done
 fi
 
 for clone in $child_fs_snap_clone $child_fs_snap_clone1; do
-       log_must $ZFS clone $child_fs_snap $clone
+       log_must zfs clone $child_fs_snap $clone
 done
 
 
 for clone in $child_fs1_snap_clone $child_fs1_snap_clone1; do
-       log_must $ZFS clone $child_fs1_snap $clone
+       log_must zfs clone $child_fs1_snap $clone
 done
 
 log_note "Verify that 'zfs destroy -r' fails to destroy dataset " \
        "with dependent clone outside it."
 
 for obj in $child_fs $child_fs1 $ctr $ctr1; do
-       log_mustnot $ZFS destroy -r $obj
+       log_mustnot zfs destroy -r $obj
        datasetexists $obj || \
                log_fail "'zfs destroy -r' fails to keep dependent " \
                        "clone outside the hirearchy."
@@ -142,14 +142,14 @@ done
 log_note "Verify that 'zfs destroy -R' succeeds to destroy dataset " \
        "with dependent clone outside it."
 
-log_must $ZFS destroy -R $ctr1
+log_must zfs destroy -R $ctr1
 datasetexists $ctr1 && \
        log_fail "'zfs destroy -R' fails to destroy dataset with clone outside it."
 
 log_note "Verify that 'zfs destroy -r' succeeds to destroy dataset " \
        "without dependent clone outside it."
 
-log_must $ZFS destroy -r $ctr
+log_must zfs destroy -r $ctr
 datasetexists $ctr && \
        log_fail "'zfs destroy -r' fails to destroy dataset with clone outside it."
 
index 317e37869073ccd92a82cce0dda449be71d393e9..3db1331ff57e003b6e575fd6aa86687f8ff714a2 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -50,19 +50,19 @@ function cleanup
        cd $olddir
 
        datasetexists $clone && \
-               log_must $ZFS destroy -f $clone
+               log_must zfs destroy -f $clone
 
        snapexists $snap && \
-               log_must $ZFS destroy -f $snap
+               log_must zfs destroy -f $snap
 
        for fs in $fs1 $fs2; do
                datasetexists $fs && \
-                       log_must $ZFS destroy -f $fs
+                       log_must zfs destroy -f $fs
        done
 
        for dir in $TESTDIR1 $TESTDIR2; do
                [[ -d $dir ]] && \
-                       log_must $RM -rf $dir
+                       log_must rm -rf $dir
        done
 }
 
@@ -77,7 +77,7 @@ olddir=$PWD
 
 for dir in $TESTDIR1 $TESTDIR2; do
        [[ ! -d $dir ]] && \
-               log_must $MKDIR -p $dir
+               log_must mkdir -p $dir
 done
 
 fs1=$TESTPOOL/$TESTFS1
@@ -92,30 +92,30 @@ mntp2=$TESTDIR2
 # make the mountpoint busy
 #
 for fs in $fs1 $fs2; do
-       log_must $ZFS create $fs
+       log_must zfs create $fs
 done
 
-log_must $ZFS snapshot $snap
-log_must $ZFS clone $snap $clone
+log_must zfs snapshot $snap
+log_must zfs clone $snap $clone
 
-log_must $ZFS set mountpoint=$mntp1 $fs1
-log_must $ZFS set mountpoint=$mntp2 $clone
+log_must zfs set mountpoint=$mntp1 $fs1
+log_must zfs set mountpoint=$mntp2 $clone
 
 for arg in "$fs1 $mntp1" "$clone $mntp2"; do
-       fs=`$ECHO $arg | $AWK '{print $1}'`
-       mntp=`$ECHO $arg | $AWK '{print $2}'`
+       fs=`echo $arg | awk '{print $1}'`
+       mntp=`echo $arg | awk '{print $2}'`
 
        log_note "Verify that 'zfs destroy' fails to" \
                        "destroy filesystem when it is busy."
        cd $mntp
-       log_mustnot $ZFS destroy $fs
+       log_mustnot zfs destroy $fs
 
        if is_linux; then
-               log_mustnot $ZFS destroy -f $fs
+               log_mustnot zfs destroy -f $fs
                datasetnonexists $fs && \
                    log_fail "'zfs destroy -f' destroyed busy filesystem."
        else
-               log_must $ZFS destroy -f $fs
+               log_must zfs destroy -f $fs
                datasetexists $fs && \
                    log_fail "'zfs destroy -f' fail to destroy busy filesystem."
        fi
index 5e3619ee10878aac6a2e94fccb9ae2b47787493b..3a9370977758df15f11fa1b6e7057bf582a5d9f7 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -76,7 +76,7 @@ function negative_test
                        fi
                fi
                for opt in $options; do
-                       log_mustnot $ZFS destroy $opt $dtst
+                       log_mustnot zfs destroy $opt $dtst
                done
        done
 }
@@ -101,8 +101,8 @@ negative_test "-r -rf" "$CTR $FS $VOL"
 # an explanation of what 'correct' means for this test.
 #
 mntpt=$(get_prop mountpoint $FS)
-pidlist=$($MKBUSY $mntpt/$TESTFILE0)
-log_note "$MKBUSY $mntpt/$TESTFILE0 (pidlist: $pidlist)"
+pidlist=$(mkbusy $mntpt/$TESTFILE0)
+log_note "mkbusy $mntpt/$TESTFILE0 (pidlist: $pidlist)"
 [[ -z $pidlist ]] && log_fail "Failure from mkbusy"
 negative_test "-R -rR" $CTR
 
@@ -124,7 +124,7 @@ elif datasetexists $FSSNAP && datasetnonexists $VOLSNAP; then
        check_dataset datasetnonexists $VOLSNAP $VOLCLONE
        check_dataset datasetexists $FSSNAP $FSCLONE
 else
-       log_must $ZFS list -rtall
+       log_must zfs list -rtall
        log_fail "Unexpected datasets remaining"
 fi
 
@@ -138,8 +138,8 @@ negative_test "-R -rR" $FS
 check_dataset datasetexists $CTR $FS $VOL $VOLSNAP $VOLCLONE
 check_dataset datasetnonexists $FSSNAP $FSCLONE
 
-log_must $KILL $pidlist
-log_mustnot $PGREP -fl $MKBUSY
+log_must kill $pidlist
+log_mustnot pgrep -fl mkbusy
 pidlist=""
 
 #
@@ -150,8 +150,8 @@ pidlist=""
 #
 if is_global_zone; then
        setup_testenv clone
-       pidlist=$($MKBUSY $TESTDIR1/$TESTFILE0)
-       log_note "$MKBUSY $TESTDIR1/$TESTFILE0 (pidlist: $pidlist)"
+       pidlist=$(mkbusy $TESTDIR1/$TESTFILE0)
+       log_note "mkbusy $TESTDIR1/$TESTFILE0 (pidlist: $pidlist)"
        [[ -z $pidlist ]] && log_fail "Failure from mkbusy"
        negative_test "-R -rR" $CTR
        check_dataset datasetexists $CTR $VOL
@@ -181,8 +181,8 @@ if is_global_zone; then
        check_dataset datasetnonexists $VOLSNAP $VOLCLONE
 fi
 
-log_must $KILL $pidlist
-log_mustnot $PGREP -fl $MKBUSY
+log_must kill $pidlist
+log_mustnot pgrep -fl mkbusy
 pidlist=""
 
 #
@@ -193,19 +193,19 @@ pidlist=""
 #
 
 mntpt=$(snapshot_mountpoint $FSSNAP)
-pidlist=$($MKBUSY $mntpt)
-log_note "$MKBUSY $mntpt (pidlist: $pidlist)"
+pidlist=$(mkbusy $mntpt)
+log_note "mkbusy $mntpt (pidlist: $pidlist)"
 [[ -z $pidlist ]] && log_fail "Failure from mkbusy"
 
 for option in -R -rR ; do
        setup_testenv clone
-       log_must $ZFS destroy $option $FSSNAP
+       log_must zfs destroy $option $FSSNAP
        check_dataset datasetexists $CTR $FS $VOL
        check_dataset datasetnonexists $FSSNAP $FSCLONE
 done
 
-log_must $KILL $pidlist
-log_mustnot $PGREP -fl $MKBUSY
+log_must kill $pidlist
+log_mustnot pgrep -fl mkbusy
 pidlist=""
 
 log_pass "zfs destroy -f|-r|-rf|-R|-rR <dataset>' failed in different " \
index 7e383c26a7d8ea45ead217e7c398416e0beb9972..7dbcb242041d04ddbc6c2cd61afd84ae01500f47 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -60,7 +60,7 @@ log_assert "'zfs destroy' should return an error with badly-formed parameters."
 
 typeset -i i=0
 while (( $i < ${#args[*]} )); do
-       log_mustnot $ZFS destroy ${args[i]}
+       log_mustnot zfs destroy ${args[i]}
        ((i = i + 1))
 done
 
index 72272a5c901e47edf3f1b576855d68cd8d47cd79..70ad45af0488ea8f137fff2d48097f3d29e5770b 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -49,10 +49,10 @@ verify_runnable "both"
 function cleanup
 {
        if datasetexists $clonesnap; then
-               log_must $ZFS promote $fs
+               log_must zfs promote $fs
        fi
-       datasetexists $clone && log_must $ZFS destroy $clone
-       datasetexists $fssnap && log_must $ZFS destroy $fssnap
+       datasetexists $clone && log_must zfs destroy $clone
+       datasetexists $fssnap && log_must zfs destroy $fssnap
 }
 
 log_assert "Destroy dataset which is namespace-parent of origin should failed."
@@ -67,10 +67,10 @@ clonesnap=$fs/clone@snap
 # Define key word for expected failure.
 KEY_WORDS="filesystem has children"
 
-log_must $ZFS snapshot $fssnap
-log_must $ZFS clone $fssnap $clone
-log_must $ZFS promote $clone
-log_mustnot_expect "$KEY_WORDS" $ZFS destroy $fs
-log_mustnot_expect "$KEY_WORDS" $ZFS destroy $clone
+log_must zfs snapshot $fssnap
+log_must zfs clone $fssnap $clone
+log_must zfs promote $clone
+log_mustnot_expect "$KEY_WORDS" zfs destroy $fs
+log_mustnot_expect "$KEY_WORDS" zfs destroy $clone
 
 log_pass "Destroy dataset which is namespace-parent of origin passed."
index 3efc9c9754cb18e365c9b7a3977a2c21daa0c743..f8b8f90055140959e94de72afb7e4c4ab6ee61ca 100755 (executable)
@@ -21,7 +21,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -42,7 +42,7 @@ function test_s_run
 {
     typeset snap=$1
 
-    log_must $ZFS destroy -d $snap
+    log_must zfs destroy -d $snap
     log_mustnot datasetexists $snap    
 }
 
index 510776e6e1a6e723c3902ac96c07d9615463bc61..57e5761bc064fcc28283fa1e694e6893bb6460d2 100755 (executable)
@@ -21,7 +21,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,10 +47,10 @@ function test_c_run
 
     snap=$(eval echo \$${dstype}SNAP)
     clone=$(eval echo \$${dstype}CLONE)
-    log_must $ZFS destroy -d $snap
+    log_must zfs destroy -d $snap
     log_must datasetexists $snap
     log_must eval "[[ $(get_prop defer_destroy $snap) == 'on' ]]"
-    log_must $ZFS destroy $clone
+    log_must zfs destroy $clone
     log_mustnot datasetexists $snap
     log_mustnot datasetexists $clone
 }
index b848e8a82a7a3029c80fe321a4133e61048a71a8..05debb5a087fd7111f765a8473dbc5c81f2593cb 100755 (executable)
@@ -21,7 +21,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,9 +52,9 @@ function test_clone_run
     ds=$(eval echo \$${dstype})
     snap=$(eval echo \$${dstype}SNAP)
     clone=$(eval echo \$${dstype}CLONE)
-    log_must $ZFS destroy -d $snap
+    log_must zfs destroy -d $snap
     log_must datasetexists $snap
-    log_must $ZFS destroy -R $clone
+    log_must zfs destroy -R $clone
     log_mustnot datasetexists $snap
     log_mustnot datasetexists $clone
 }
index b59fc9bdac2dc31b9880f0f19af649f95fe5fa08..634bfc20c1676400b5a14bd8f5f922076ecada5f 100755 (executable)
@@ -11,7 +11,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -37,11 +37,11 @@ function test_snap_run
     typeset dstype=$1
 
     snap=$(eval echo \$${dstype}SNAP)
-    log_must $ZFS hold zfstest $snap
-    log_must $ZFS destroy -d $snap
+    log_must zfs hold zfstest $snap
+    log_must zfs destroy -d $snap
     log_must datasetexists $snap
     log_must eval "[[ $(get_prop defer_destroy $snap) == 'on' ]]"
-    log_must $ZFS release zfstest $snap
+    log_must zfs release zfstest $snap
     log_mustnot datasetexists $snap
 }
 
index d543f124b28aef29cdcbcee26db0a506682aa069..d4b64cf4cf14e2b0b767a22ac487701c6b4932ae 100755 (executable)
@@ -11,7 +11,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -37,23 +37,23 @@ function test_snap_run
     typeset dstype=$1
 
     snap=$(eval echo \$${dstype}SNAP)
-    log_must $ZFS hold zfstest1 $snap
-    log_must $ZFS destroy -d $snap
+    log_must zfs hold zfstest1 $snap
+    log_must zfs destroy -d $snap
     log_must datasetexists $snap
     log_must eval "[[ $(get_prop defer_destroy $snap) == 'on' ]]"
 
-    log_must $ZFS hold zfstest2 $snap
-    log_mustnot $ZFS hold zfstest1 $snap
-    log_mustnot $ZFS hold zfstest2 $snap
+    log_must zfs hold zfstest2 $snap
+    log_mustnot zfs hold zfstest1 $snap
+    log_mustnot zfs hold zfstest2 $snap
 
-    log_must $ZFS release zfstest1 $snap
+    log_must zfs release zfstest1 $snap
     log_must datasetexists $snap
-    log_mustnot $ZFS release zfstest1 $snap
+    log_mustnot zfs release zfstest1 $snap
     log_must datasetexists $snap
-    log_mustnot $ZFS release zfstest3 $snap
+    log_mustnot zfs release zfstest3 $snap
     log_must datasetexists $snap
 
-    log_must $ZFS release zfstest2 $snap
+    log_must zfs release zfstest2 $snap
     log_mustnot datasetexists $snap
 }
 
index 2a7ee209e143911ad530a9e458adcd7299da2ef5..406c9d43fff9e6c425cf6ec7146b847a8e6b9b73 100755 (executable)
@@ -11,7 +11,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -36,11 +36,11 @@ function test_snap_run
     typeset dstype=$1
 
     snap=$(eval echo \$${dstype}SNAP)
-    log_must $ZFS hold zfstest $snap
-    log_mustnot $ZFS destroy $snap
+    log_must zfs hold zfstest $snap
+    log_mustnot zfs destroy $snap
     log_must datasetexists $snap
-    log_must $ZFS release zfstest $snap
-    log_must $ZFS destroy $snap
+    log_must zfs release zfstest $snap
+    log_must zfs destroy $snap
     log_mustnot datasetexists $snap
 }
 
index 56257859868813384020865874701162ad4a5eca..df7cfcf5271dbddf2cf35a6333732e9fd312e54c 100755 (executable)
@@ -15,7 +15,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,12 +45,12 @@ datasets="$TESTPOOL/$TESTFS1 $TESTPOOL/$TESTFS1/$TESTFS2
 function cleanup
 {
        for ds in $datasets; do
-               datasetexists $ds && $ZFS destroy -rf $ds
+               datasetexists $ds && zfs destroy -rf $ds
        done
 }
 
 # create nested datasets
-log_must $ZFS create -p $TESTPOOL/$TESTFS1/$TESTFS2/$TESTFS3
+log_must zfs create -p $TESTPOOL/$TESTFS1/$TESTFS2/$TESTFS3
 
 # verify dataset creation
 for ds in $datasets; do
@@ -58,13 +58,13 @@ for ds in $datasets; do
 done
 
 # create recursive nestedd snapshot
-log_must $ZFS snapshot -r $TESTPOOL/$TESTFS1@snap
+log_must zfs snapshot -r $TESTPOOL/$TESTFS1@snap
 for ds in $datasets; do
        datasetexists $ds@snap || log_fail "Create $ds@snap snapshot fail."
 done
 
 # destroy nested snapshot recursively
-log_must $ZFS destroy -R $TESTPOOL/$TESTFS1@snap
+log_must zfs destroy -R $TESTPOOL/$TESTFS1@snap
 
 # verify snapshot destroy
 for ds in $datasets; do
index f2e5ce6cfd53c396e98ddafe73d0e046e937e121..487c7a64227e4d3346aa66f7a1fe26817137d38e 100755 (executable)
@@ -11,7 +11,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 # DESCRIPTION
 
 function cleanup
 {
-       datasetexists $TESTPOOL/$TESTFS1 && $ZFS destroy -R $TESTPOOL/$TESTFS1
-       datasetexists $TESTPOOL/$TESTFS2 && $ZFS destroy -R $TESTPOOL/$TESTFS2
-       poolexists $TESTPOOL2 && $ZPOOL destroy $TESTPOOL2
-       $RM -rf $VIRTUAL_DISK
+       datasetexists $TESTPOOL/$TESTFS1 && zfs destroy -R $TESTPOOL/$TESTFS1
+       datasetexists $TESTPOOL/$TESTFS2 && zfs destroy -R $TESTPOOL/$TESTFS2
+       poolexists $TESTPOOL2 && zpool destroy $TESTPOOL2
+       rm -rf $VIRTUAL_DISK
 }
 
 log_assert "zfs destroy for multiple snapshot is handled correctly"
 log_onexit cleanup
 
-$ZFS create $TESTPOOL/$TESTFS1
+zfs create $TESTPOOL/$TESTFS1
 typeset -i i=1
 snaplist=""
 log_note "zfs destroy on valid snapshot names"
 for i in 1 2 3 4 5; do
-       log_must $ZFS snapshot $TESTPOOL/$TESTFS1@snap$i
+       log_must zfs snapshot $TESTPOOL/$TESTFS1@snap$i
        snaplist=$snaplist,snap$i
 done
 snaplist=${snaplist#,}
-log_must $ZFS destroy $TESTPOOL/$TESTFS1@$snaplist
+log_must zfs destroy $TESTPOOL/$TESTFS1@$snaplist
 for i in 1 2 3 4 5; do
        log_mustnot snapexists $TESTPOOL/$TESFS1@snap$i
 done
 
 log_note "zfs destroy with all bogus snapshot names"
-log_mustnot $ZFS destroy $TESTPOOL/$TESTFS1@snap12,snap21,sna@pple1@,s""nappy2
+log_mustnot zfs destroy $TESTPOOL/$TESTFS1@snap12,snap21,sna@pple1@,s""nappy2
 
 log_note "zfs destroy with some bogus snapshot names"
 for i in 1 2 3; do
-       log_must $ZFS snapshot $TESTPOOL/$TESTFS1@snap$i
+       log_must zfs snapshot $TESTPOOL/$TESTFS1@snap$i
 done
-log_must $ZFS destroy $TESTPOOL/$TESTFS1@snap1,snap2,snapple1,snappy2,snap3
+log_must zfs destroy $TESTPOOL/$TESTFS1@snap1,snap2,snapple1,snappy2,snap3
 for i in 1 2 3; do
        log_mustnot snapexists $TESTPOOL/$TESTFS1@snap$i
 done
 
 log_note "zfs destroy with some snapshot names having special characters"
 for i in 1 2 3; do
-       log_must $ZFS snapshot $TESTPOOL/$TESTFS1@snap$i
+       log_must zfs snapshot $TESTPOOL/$TESTFS1@snap$i
 done
-log_must $ZFS destroy $TESTPOOL/$TESTFS1@snap1,@,snap2,,,,snap3,
+log_must zfs destroy $TESTPOOL/$TESTFS1@snap1,@,snap2,,,,snap3,
 for i in 1 2 3; do
        log_mustnot snapexists $TESTPOOL/$TESTFS1@snap$i
 done
 log_note "zfs destroy for too many snapshots"
 snaplist=""
 for i in {1..100}; do
-       log_must $ZFS snapshot $TESTPOOL/$TESTFS1@snap$i
+       log_must zfs snapshot $TESTPOOL/$TESTFS1@snap$i
        snaplist=$snaplist,snap$i
 done
 snaplist=${snaplist#,}
-log_must $ZFS destroy $TESTPOOL/$TESTFS1@$snaplist
+log_must zfs destroy $TESTPOOL/$TESTFS1@$snaplist
 for i in {1..100}; do
        log_mustnot snapexists $TESTPOOL/$TESTFS1@snap$i
 done
 log_note "zfs destroy multiple snapshots with hold"
 snaplist=""
 for i in 1 2 3 4 5; do
-       log_must $ZFS snapshot $TESTPOOL/$TESTFS1@snap$i
-       log_must $ZFS hold keep $TESTPOOL/$TESTFS1@snap$i
+       log_must zfs snapshot $TESTPOOL/$TESTFS1@snap$i
+       log_must zfs hold keep $TESTPOOL/$TESTFS1@snap$i
        snaplist=$snaplist,snap$i
 done
 snaplist=${snaplist#,}
-log_mustnot $ZFS destroy $TESTPOOL/$TESTFS1@$snaplist
+log_mustnot zfs destroy $TESTPOOL/$TESTFS1@$snaplist
 for i in 1 2 3 4 5; do
-       log_must $ZFS release keep $TESTPOOL/$TESTFS1@snap$i
+       log_must zfs release keep $TESTPOOL/$TESTFS1@snap$i
 done
-log_must $ZFS destroy $TESTPOOL/$TESTFS1@$snaplist
+log_must zfs destroy $TESTPOOL/$TESTFS1@$snaplist
 
 log_note "zfs destroy for multiple snapshots having clones"
 for i in 1 2 3 4 5; do
-       log_must $ZFS snapshot $TESTPOOL/$TESTFS1@snap$i
+       log_must zfs snapshot $TESTPOOL/$TESTFS1@snap$i
 done
 snaplist=""
 for i in 1 2 3 4 5; do
-       log_must $ZFS clone $TESTPOOL/$TESTFS1@snap$i $TESTPOOL/$TESTFS1/clone$i
+       log_must zfs clone $TESTPOOL/$TESTFS1@snap$i $TESTPOOL/$TESTFS1/clone$i
        snaplist=$snaplist,snap$i
 done
 snaplist=${snaplist#,}
-log_mustnot $ZFS destroy $TESTPOOL/$TESTFS1@$snaplist
+log_mustnot zfs destroy $TESTPOOL/$TESTFS1@$snaplist
 for i in 1 2 3 4 5; do
        log_must snapexists $TESTPOOL/$TESTFS1@snap$i
-       log_must $ZFS destroy $TESTPOOL/$TESTFS1/clone$i
+       log_must zfs destroy $TESTPOOL/$TESTFS1/clone$i
 done
 
 log_note "zfs destroy for snapshots for different datasets"
-log_must $ZFS create $TESTPOOL/$TESTFS2
-log_must $ZFS snapshot $TESTPOOL/$TESTFS2@fs2snap
-log_must $ZFS create $TESTPOOL/$TESTFS1/$TESTFS2
-log_must $ZFS snapshot $TESTPOOL/$TESTFS1/$TESTFS2@fs12snap
+log_must zfs create $TESTPOOL/$TESTFS2
+log_must zfs snapshot $TESTPOOL/$TESTFS2@fs2snap
+log_must zfs create $TESTPOOL/$TESTFS1/$TESTFS2
+log_must zfs snapshot $TESTPOOL/$TESTFS1/$TESTFS2@fs12snap
 
 long_arg=$TESTPOOL/$TESTFS1@snap1,$TESTPOOL/$TESTFS2@fs2snap,
 long_arg=$long_arg$TESTPOOL/$TESTFS1/$TESTFS2@fs12snap
-log_must $ZFS destroy $long_arg
+log_must zfs destroy $long_arg
 log_mustnot snapexists $TESTPOOL/$TESTFS1@snap1
 log_must snapexists $TESTPOOL/$TESTFS2@fs2snap
 log_must snapexists $TESTPOOL/$TESTFS1/$TESTFS2@fs12snap
 
-log_must $ZFS destroy $TESTPOOL/$TESTFS1@fs2snap,fs12snap,snap2
+log_must zfs destroy $TESTPOOL/$TESTFS1@fs2snap,fs12snap,snap2
 log_must snapexists $TESTPOOL/$TESTFS2@fs2snap
 log_must snapexists $TESTPOOL/$TESTFS1/$TESTFS2@fs12snap
 log_mustnot snapexists $TESTPOOL/$TESTFS1@snap2
 
-log_must $ZFS destroy $TESTPOOL/$TESTFS2@fs2snap,fs12snap,snap3
+log_must zfs destroy $TESTPOOL/$TESTFS2@fs2snap,fs12snap,snap3
 log_mustnot snapexists $TESTPOOL/$TESTFS2@fs2snap
 log_must snapexists $TESTPOOL/$TESTFS1/$TESTFS2@fs12snap
 log_must snapexists $TESTPOOL/$TESTFS1@snap3
 
 log_note "zfs destroy for snapshots from different pools"
 VIRTUAL_DISK=/var/tmp/disk
-log_must $MKFILE $MINVDEVSIZE $VIRTUAL_DISK
-log_must $ZPOOL create $TESTPOOL2 $VIRTUAL_DISK
+log_must mkfile $MINVDEVSIZE $VIRTUAL_DISK
+log_must zpool create $TESTPOOL2 $VIRTUAL_DISK
 log_must poolexists $TESTPOOL2
 
-log_must $ZFS create $TESTPOOL2/$TESTFS1
-log_must $ZFS snapshot $TESTPOOL2/$TESTFS1@snap
+log_must zfs create $TESTPOOL2/$TESTFS1
+log_must zfs snapshot $TESTPOOL2/$TESTFS1@snap
 long_arg=$TESTPOOL2/$TESTFS1@snap,$TESTPOOL/$TESTFS1@snap3,
 long_arg=$long_arg$TESTPOOL/$TESTFS1@snap5
-log_must $ZFS destroy $long_arg
+log_must zfs destroy $long_arg
 log_mustnot snapexists $TESTPOOL2/$TESTFS1@snap
 log_must snapexists $TESTPOOL/$TESTFS1@snap3
 log_must snapexists $TESTPOOL/$TESTFS1@snap5
 
-log_must $ZFS snapshot $TESTPOOL2/$TESTFS1@snap
-log_must $ZFS destroy $TESTPOOL2/$TESTFS1@snap5,snap3,snap
+log_must zfs snapshot $TESTPOOL2/$TESTFS1@snap
+log_must zfs destroy $TESTPOOL2/$TESTFS1@snap5,snap3,snap
 log_mustnot snapexists $TESTPOOL2/$TESTFS1@snap
 log_must snapexists $TESTPOOL/$TESTFS1@snap3
 log_must snapexists $TESTPOOL/$TESTFS1@snap5
index 2a7b8120ec0dc1a595656ef4a3951d5b6ea76c2d..83cd0a27c300093fb97cc1ff6b0fd054e1010ba2 100755 (executable)
@@ -11,7 +11,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 # DESCRIPTION
 function cleanup
 {
        datasetexists $TESTPOOL/$TESTFS1 && \
-           log_must $ZFS destroy -R $TESTPOOL/$TESTFS1
+           log_must zfs destroy -R $TESTPOOL/$TESTFS1
        datasetexists $TESTPOOL/$TESTVOL && \
-           log_must $ZFS destroy -Rf $TESTPOOL/$TESTVOL
+           log_must zfs destroy -Rf $TESTPOOL/$TESTVOL
 }
 
 function setup_snapshots
 {
        for i in $snaps; do
                datasetexists $TESTPOOL/$TESTFS1@snap$i && \
-                   log_must $ZFS destroy $TESTPOOL/$TESTFS1@snap$i
+                   log_must zfs destroy $TESTPOOL/$TESTFS1@snap$i
                datasetexists $TESTPOOL/$TESTVOL@snap$i && \
-                   log_must $ZFS destroy $TESTPOOL/$TESTVOL@snap$i
-               log_must $ZFS snapshot $TESTPOOL/$TESTFS1@snap$i
-               log_must $ZFS snapshot $TESTPOOL/$TESTVOL@snap$i
+                   log_must zfs destroy $TESTPOOL/$TESTVOL@snap$i
+               log_must zfs snapshot $TESTPOOL/$TESTFS1@snap$i
+               log_must zfs snapshot $TESTPOOL/$TESTVOL@snap$i
        done
 }
 
@@ -78,30 +78,30 @@ valid_args="@snap1%snap5 @%"
 log_assert "zfs destroy deletes ranges of snapshots"
 log_onexit cleanup
 
-log_must $ZFS create $TESTPOOL/$TESTFS1
-log_must $ZFS create -V $VOLSIZE $TESTPOOL/$TESTVOL
+log_must zfs create $TESTPOOL/$TESTFS1
+log_must zfs create -V $VOLSIZE $TESTPOOL/$TESTVOL
 snaps="1 2 3 4 5"
 log_note "Verify the valid arguments"
 range="1 2 3 4 5"
 for args in $valid_args; do
        setup_snapshots
-       log_must $ZFS destroy $TESTPOOL/$TESTFS1$args
-       log_must $ZFS destroy $TESTPOOL/$TESTVOL$args
+       log_must zfs destroy $TESTPOOL/$TESTFS1$args
+       log_must zfs destroy $TESTPOOL/$TESTVOL$args
        verify_snapshots
 done
 
 log_note "Verify invalid arguments"
 setup_snapshots
 for args in $invalid_args; do
-       log_mustnot $ZFS destroy $TESTPOOL/$TESTFS1$args
-       log_mustnot $ZFS destroy $TESTPOOL/$TESTVOL$args
+       log_mustnot zfs destroy $TESTPOOL/$TESTFS1$args
+       log_mustnot zfs destroy $TESTPOOL/$TESTVOL$args
        log_must verify_snapshots 1
 done
 
 log_note "Destroy the beginning range"
 
-log_must $ZFS destroy $TESTPOOL/$TESTFS1@%snap3
-log_must $ZFS destroy $TESTPOOL/$TESTVOL@%snap3
+log_must zfs destroy $TESTPOOL/$TESTFS1@%snap3
+log_must zfs destroy $TESTPOOL/$TESTVOL@%snap3
 range="1 2 3"
 verify_snapshots
 range="4 5"
@@ -109,19 +109,19 @@ verify_snapshots 1
 
 setup_snapshots
 log_note "Destroy the mid range"
-log_must $ZFS destroy $TESTPOOL/$TESTFS1@snap2%snap4
-log_must $ZFS destroy $TESTPOOL/$TESTVOL@snap2%snap4
+log_must zfs destroy $TESTPOOL/$TESTFS1@snap2%snap4
+log_must zfs destroy $TESTPOOL/$TESTVOL@snap2%snap4
 range="2 3 4"
 verify_snapshots
-log_must $ZFS destroy $TESTPOOL/$TESTFS1@snap1%snap5
-log_must $ZFS destroy $TESTPOOL/$TESTVOL@snap1%snap5
+log_must zfs destroy $TESTPOOL/$TESTFS1@snap1%snap5
+log_must zfs destroy $TESTPOOL/$TESTVOL@snap1%snap5
 range="1 5"
 verify_snapshots
 
 setup_snapshots
 log_note "Destroy the end range"
-log_must $ZFS destroy $TESTPOOL/$TESTFS1@snap3%
-log_must $ZFS destroy $TESTPOOL/$TESTVOL@snap3%
+log_must zfs destroy $TESTPOOL/$TESTFS1@snap3%
+log_must zfs destroy $TESTPOOL/$TESTVOL@snap3%
 range="1 2"
 verify_snapshots 1
 range="3 4 5"
@@ -129,8 +129,8 @@ verify_snapshots
 
 setup_snapshots
 log_note "Destroy a simple list"
-log_must $ZFS destroy $TESTPOOL/$TESTFS1@snap2,snap4
-log_must $ZFS destroy $TESTPOOL/$TESTVOL@snap2,snap4
+log_must zfs destroy $TESTPOOL/$TESTFS1@snap2,snap4
+log_must zfs destroy $TESTPOOL/$TESTVOL@snap2,snap4
 range="2 4"
 verify_snapshots
 range="1 3 5"
@@ -138,8 +138,8 @@ verify_snapshots 1
 
 setup_snapshots
 log_note "Destroy a list and range together"
-log_must $ZFS destroy $TESTPOOL/$TESTFS1@snap1%snap3,snap5
-log_must $ZFS destroy $TESTPOOL/$TESTVOL@snap1%snap3,snap5
+log_must zfs destroy $TESTPOOL/$TESTFS1@snap1%snap3,snap5
+log_must zfs destroy $TESTPOOL/$TESTVOL@snap1%snap3,snap5
 range="1 2 3 5"
 verify_snapshots
 range=4
@@ -148,8 +148,8 @@ verify_snapshots 1
 snaps="1 2 3 5 6 7 8 9 10"
 setup_snapshots
 log_note "Destroy a list of ranges"
-log_must $ZFS destroy $TESTPOOL/$TESTFS1@snap1%snap3,snap5
-log_must $ZFS destroy $TESTPOOL/$TESTVOL@snap1%snap3,snap5
+log_must zfs destroy $TESTPOOL/$TESTFS1@snap1%snap3,snap5
+log_must zfs destroy $TESTPOOL/$TESTVOL@snap1%snap3,snap5
 range="1 2 3 5"
 verify_snapshots
 range=4
@@ -160,27 +160,27 @@ setup_snapshots
 log_note "Snapshot destory with hold"
 range="1 2 3 4 5"
 for i in 1 2 3 4 5; do
-       log_must $ZFS hold keep $TESTPOOL/$TESTFS1@snap$i
-       log_must $ZFS hold keep $TESTPOOL/$TESTVOL@snap$i
+       log_must zfs hold keep $TESTPOOL/$TESTFS1@snap$i
+       log_must zfs hold keep $TESTPOOL/$TESTVOL@snap$i
 done
-log_mustnot $ZFS destroy $TESTPOOL/$TESTFS1@snap1%snap5
-log_mustnot $ZFS destroy $TESTPOOL/$TESTVOL@snap1%snap5
+log_mustnot zfs destroy $TESTPOOL/$TESTFS1@snap1%snap5
+log_mustnot zfs destroy $TESTPOOL/$TESTVOL@snap1%snap5
 verify_snapshots 1
 for i in 1 2 3 4 5; do
-       log_must $ZFS release keep $TESTPOOL/$TESTFS1@snap$i
-       log_must $ZFS release keep $TESTPOOL/$TESTVOL@snap$i
+       log_must zfs release keep $TESTPOOL/$TESTFS1@snap$i
+       log_must zfs release keep $TESTPOOL/$TESTVOL@snap$i
 done
-log_must $ZFS destroy $TESTPOOL/$TESTFS1@snap1%snap5
-log_must $ZFS destroy $TESTPOOL/$TESTVOL@snap1%snap5
+log_must zfs destroy $TESTPOOL/$TESTFS1@snap1%snap5
+log_must zfs destroy $TESTPOOL/$TESTVOL@snap1%snap5
 verify_snapshots
 
 log_note "Range destroy for snapshots having clones"
 setup_snapshots
 for i in 1 2 3 4 5; do
-       log_must $ZFS clone $TESTPOOL/$TESTFS1@snap$i $TESTPOOL/$TESTFS1/clone$i
+       log_must zfs clone $TESTPOOL/$TESTFS1@snap$i $TESTPOOL/$TESTFS1/clone$i
 done
-log_must $ZFS destroy -R $TESTPOOL/$TESTFS1@snap1%snap5
-log_must $ZFS destroy $TESTPOOL/$TESTVOL@snap1%snap5
+log_must zfs destroy -R $TESTPOOL/$TESTFS1@snap1%snap5
+log_must zfs destroy $TESTPOOL/$TESTVOL@snap1%snap5
 verify_snapshots
 
 log_pass "'zfs destroy' successfully destroys ranges of snapshots"
index 47996eb01626fa227a72027562eee0442acdb3eb..b88276a1eee0bb161208521a60799d60d0d9d4bf 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -51,44 +51,44 @@ function setup_testenv #[dtst]
        typeset dtst=$1
 
        if ! datasetexists $CTR; then
-               log_must $ZFS create $CTR
+               log_must zfs create $CTR
        fi
        if ! datasetexists $FS; then
-               log_must $ZFS create $FS
+               log_must zfs create $FS
        fi
        # Volume test is only availible on globle zone
        if ! datasetexists $VOL && is_global_zone; then
-               log_must $ZFS create -V $VOLSIZE $VOL
+               log_must zfs create -V $VOLSIZE $VOL
                block_device_wait
 
-               $ECHO "y" | $NEWFS $ZVOL_DEVDIR/$VOL > /dev/null 2>&1
+               echo "y" | newfs $ZVOL_DEVDIR/$VOL > /dev/null 2>&1
                if (( $? == 0 )); then
-                       log_note "SUCCESS: $NEWFS $ZVOL_DEVDIR/$VOL>/dev/null"
+                       log_note "SUCCESS: newfs $ZVOL_DEVDIR/$VOL>/dev/null"
                else
-                       log_fail "$NEWFS $ZVOL_DEVDIR/$VOL > /dev/null"
+                       log_fail "newfs $ZVOL_DEVDIR/$VOL > /dev/null"
                fi
 
                if [[ ! -d $TESTDIR1 ]]; then
-                       log_must $MKDIR $TESTDIR1
+                       log_must mkdir $TESTDIR1
                fi
-               log_must $MOUNT $ZVOL_DEVDIR/$VOL $TESTDIR1
+               log_must mount $ZVOL_DEVDIR/$VOL $TESTDIR1
        fi
 
        if [[ $dtst == snap || $dtst == clone ]]; then
                if ! datasetexists $FSSNAP; then
-                       log_must $ZFS snapshot $FSSNAP
+                       log_must zfs snapshot $FSSNAP
                fi
                if ! datasetexists $VOLSNAP && is_global_zone; then
-                       log_must $ZFS snapshot $VOLSNAP
+                       log_must zfs snapshot $VOLSNAP
                fi
        fi
 
        if [[ $dtst == clone ]]; then
                if ! datasetexists $FSCLONE; then
-                       log_must $ZFS clone $FSSNAP $FSCLONE
+                       log_must zfs clone $FSSNAP $FSCLONE
                fi
                if ! datasetexists $VOLCLONE && is_global_zone; then
-                       log_must $ZFS clone $VOLSNAP $VOLCLONE
+                       log_must zfs clone $VOLSNAP $VOLCLONE
                fi
        fi
 }
@@ -98,16 +98,16 @@ function setup_testenv #[dtst]
 function cleanup_testenv
 {
        if is_global_zone && ismounted "$TESTDIR1" "$NEWFS_DEFAULT_FS" ; then
-               log_must $UMOUNT -f $TESTDIR1
+               log_must umount -f $TESTDIR1
        fi
        if [[ -d $TESTDIR1 ]]; then
-               log_must $RM -rf $TESTDIR1
+               log_must rm -rf $TESTDIR1
        fi
 
-       $PKILL $MKBUSY
+       pkill mkbusy
 
        if datasetexists $CTR; then
-               log_must $ZFS destroy -Rf $CTR
+               log_must zfs destroy -Rf $CTR
        fi
 }
 
index e62482d3fb08b3bd004f7ece14cad46f6f80465d..92d51944f28d00b81eee5ac8362933ef32cfe478 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/zfs_get/zfs_get_common.kshlib
 . $STF_SUITE/tests/functional/cli_root/zfs_get/zfs_get_list_d.kshlib
 
@@ -89,7 +93,7 @@ function check_return_value
 
                while read line; do
                        typeset item
-                       item=$($ECHO $line | $AWK '{print $2}' 2>&1)
+                       item=$(echo $line | awk '{print $2}' 2>&1)
 
                        if [[ $item == $p ]]; then
                                ((found += 1))
@@ -103,7 +107,7 @@ function check_return_value
                fi
        done
 
-       log_note "SUCCESS: '$ZFS get $opt $prop $dst'."
+       log_note "SUCCESS: 'zfs get $opt $prop $dst'."
 }
 
 log_assert "Setting the valid options and properties 'zfs get' should return " \
@@ -122,11 +126,11 @@ typeset -i i=0
 while ((i < ${#dataset[@]})); do
        for opt in "${options[@]}"; do
                for prop in ${all_props[@]}; do
-                       eval "$ZFS get $opt $prop ${dataset[i]} > \
+                       eval "zfs get $opt $prop ${dataset[i]} > \
                            $TESTDIR/$TESTFILE0"
                        ret=$?
                        if [[ $ret != 0 ]]; then
-                               log_fail "$ZFS get returned: $ret"
+                               log_fail "zfs get returned: $ret"
                        fi
                        check_return_value ${dataset[i]} "$prop" "$opt"
                done
@@ -138,11 +142,11 @@ i=0
 while ((i < ${#bookmark[@]})); do
        for opt in "${options[@]}"; do
                for prop in ${bookmark_props[@]}; do
-                       eval "$ZFS get $opt $prop ${bookmark[i]} > \
+                       eval "zfs get $opt $prop ${bookmark[i]} > \
                            $TESTDIR/$TESTFILE0"
                        ret=$?
                        if [[ $ret != 0 ]]; then
-                               log_fail "$ZFS get returned: $ret"
+                               log_fail "zfs get returned: $ret"
                        fi
                        check_return_value ${bookmark[i]} "$prop" "$opt"
                done
index d425a261aa49faa88aa2d07b06ab667e7bad86d6..f49f58e8ce7ec86b2237d444f2d824ba190d6569 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/zfs_get/zfs_get_common.kshlib
 
 #
@@ -75,10 +79,10 @@ for dst in ${dataset[@]}; do
        for opt in "" $(gen_option_str "${options[*]}" "-" "" $opt_numb); do
                for prop in $(gen_option_str "${props[*]}" "" "," $prop_numb)
                do
-                       $ZFS get $opt $prop $dst > /dev/null 2>&1
+                       zfs get $opt $prop $dst > /dev/null 2>&1
                        ret=$?
                        if [[ $ret != 0 ]]; then
-                               log_fail "$ZFS get $opt $prop $dst (Code: $ret)"
+                               log_fail "zfs get $opt $prop $dst (Code: $ret)"
                        fi
                done
        done
index 77a58e10f63df59bd3c629d160395d4f45475fb5..2ea5aa0cb4cfb6ac80a529e612fe47c9b456207c 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -42,18 +46,18 @@ verify_runnable "both"
 
 function cleanup
 {
-       log_must $ZFS mount -o remount,atime $TESTPOOL/$TESTFS
+       log_must zfs mount -o remount,atime $TESTPOOL/$TESTFS
 }
 
 log_assert "'zfs get' should get consistent report with different option."
 log_onexit cleanup
 
-log_must $ZFS set atime=on $TESTPOOL/$TESTFS
-log_must $ZFS mount -o remount,noatime $TESTPOOL/$TESTFS
+log_must zfs set atime=on $TESTPOOL/$TESTFS
+log_must zfs mount -o remount,noatime $TESTPOOL/$TESTFS
 
-value1=$($ZFS get -H atime $TESTPOOL/$TESTFS | $AWK '{print $3}')
-value2=$($ZFS get -H all $TESTPOOL/$TESTFS | $AWK '{print $2 " " $3}' | \
-       $GREP ^atime | $AWK '{print $2}')
+value1=$(zfs get -H atime $TESTPOOL/$TESTFS | awk '{print $3}')
+value2=$(zfs get -H all $TESTPOOL/$TESTFS | awk '{print $2 " " $3}' | \
+       grep ^atime | awk '{print $2}')
 if [[ $value1 != $value2 ]]; then
        log_fail "value1($value1) != value2($value2)"
 fi
index 566da2272a682b4e2b6d1270d72f1bec4ffc84c3..f57628c163f5bd61aac2e1d25b50ffcf0716f8de 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,27 +45,27 @@ verify_runnable "both"
 
 function cleanup
 {
-       [[ -e $propfile ]] && $RM -f $propfile
+       [[ -e $propfile ]] && rm -f $propfile
 
        datasetexists $clone  && \
-               log_must $ZFS destroy $clone
+               log_must zfs destroy $clone
        for snap in $fssnap $volsnap ; do
                snapexists $snap && \
-                       log_must $ZFS destroy $snap
+                       log_must zfs destroy $snap
        done
 
        if [[ -n $globalzone ]] ; then
                for pool in $TESTPOOL1 $TESTPOOL2 $TESTPOOL3; do
                        poolexists $pool && \
-                               log_must $ZPOOL destroy -f $pool
+                               log_must zpool destroy -f $pool
                done
-               for file in `$LS $TESTDIR1/poolfile*`; do
-                       $RM -f $file
+               for file in `ls $TESTDIR1/poolfile*`; do
+                       rm -f $file
                done
        else
                for fs in $TESTPOOL/$TESTFS1 $TESTPOOL/$TESTFS2 $TESTPOOL/$TESTFS3; do
                        datasetexists $fs && \
-                               log_must $ZFS destroy -rf $fs
+                               log_must zfs destroy -rf $fs
                done
        fi
 }
@@ -92,12 +92,12 @@ volsnap=$TESTPOOL/$TESTVOL@$TESTSNAP
 
 #set user defined properties for $TESTPOOL
 for usrprop in ${usrprops[@]}; do
-       log_must $ZFS set $usrprop $TESTPOOL
+       log_must zfs set $usrprop $TESTPOOL
 done
 # create snapshot and clone in $TESTPOOL
-log_must $ZFS snapshot $fssnap
-log_must $ZFS clone $fssnap $clone
-log_must $ZFS snapshot $volsnap
+log_must zfs snapshot $fssnap
+log_must zfs clone $fssnap $clone
+log_must zfs snapshot $volsnap
 
 # collect datasets which can be set user defined properties
 usrpropds="$clone $fs"
@@ -120,31 +120,31 @@ while (( availspace > DFILESIZE )) && (( i < 3 )) ; do
        (( i += 1 ))
 
        if [[ -n $globalzone ]] ; then
-               log_must $MKFILE $FILESIZE ${file}$i
+               log_must mkfile $FILESIZE ${file}$i
                eval pool=\$TESTPOOL$i
-               log_must $ZPOOL create $pool ${file}$i
+               log_must zpool create $pool ${file}$i
        else
                eval pool=$TESTPOOL/\$TESTFS$i
-               log_must $ZFS create $pool
+               log_must zfs create $pool
        fi
 
        #set user defined properties for testing
        for usrprop in ${usrprops[@]}; do
-               log_must $ZFS set $usrprop $pool
+               log_must zfs set $usrprop $pool
        done
 
        #create datasets in pool
-       log_must $ZFS create $pool/$TESTFS
-       log_must $ZFS snapshot $pool/$TESTFS@$TESTSNAP
-       log_must $ZFS clone $pool/$TESTFS@$TESTSNAP $pool/$TESTCLONE
+       log_must zfs create $pool/$TESTFS
+       log_must zfs snapshot $pool/$TESTFS@$TESTSNAP
+       log_must zfs clone $pool/$TESTFS@$TESTSNAP $pool/$TESTCLONE
 
        if [[ -n $globalzone ]] ; then
-               log_must $ZFS create -V $VOLSIZE $pool/$TESTVOL
+               log_must zfs create -V $VOLSIZE $pool/$TESTVOL
        else
-               log_must $ZFS create $pool/$TESTVOL
+               log_must zfs create $pool/$TESTVOL
        fi
 
-       ds=`$ZFS list -H -r -o name -t filesystem,volume $pool`
+       ds=`zfs list -H -r -o name -t filesystem,volume $pool`
        usrpropds="$usrpropds $pool/$TESTFS $pool/$TESTCLONE $pool/$TESTVOL"
        allds="$allds $pool/$TESTFS $pool/$TESTCLONE $pool/$TESTVOL \
                $pool/$TESTFS@$TESTSNAP"
@@ -162,18 +162,18 @@ typeset -i i=0
 typeset -i propnum=0
 typeset -i failflag=0
 while (( i < ${#opts[*]} )); do
-       [[ -e $propfile ]] && $RM -f $propfile
-       log_must eval "$ZFS get ${opts[i]} all >$propfile"
+       [[ -e $propfile ]] && rm -f $propfile
+       log_must eval "zfs get ${opts[i]} all >$propfile"
 
        for ds in $allds; do
-               $GREP $ds $propfile >/dev/null 2>&1
+               grep $ds $propfile >/dev/null 2>&1
                (( $? != 0 )) && \
                        log_fail "There is no property for" \
                                "dataset $ds in 'get all' output."
 
-               propnum=`$CAT $propfile | $AWK '{print $1}' | \
-                       $GREP "${ds}$" | $WC -l`
-               ds_type=`$ZFS get -H -o value type $ds`
+               propnum=`cat $propfile | awk '{print $1}' | \
+                       grep "${ds}$" | wc -l`
+               ds_type=`zfs get -H -o value type $ds`
                case $ds_type in
                        filesystem )
                                (( propnum < fspropnum )) && \
@@ -208,7 +208,7 @@ function do_particular_prop_test #<property> <suitable datasets>
        typeset ds="$2"
 
        for prop in ${commprops[*]}; do
-               ds=`$ZFS get -H -o name $prop`
+               ds=`zfs get -H -o name $prop`
 
                [[ "$ds" != "$allds" ]] && \
                        log_fail "The result datasets are $ds, but all suitable" \
index 4380e38520bcac11b9b1ced897eb6e21ec74e077..2de640f871184cdcab2bfacb42644461e6345ef4 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/zfs_get/zfs_get_common.kshlib
 
 #
@@ -83,10 +87,10 @@ function test_options
        for dst in ${dataset[@]}; do
                for opt in $opts; do
                        for prop in $props; do
-                               $ZFS get $opt -- $prop $dst > /dev/null 2>&1
+                               zfs get $opt -- $prop $dst > /dev/null 2>&1
                                ret=$?
                                if [[ $ret == 0 ]]; then
-                                       log_fail "$ZFS get $opt -- $prop " \
+                                       log_fail "zfs get $opt -- $prop " \
                                            "$dst unexpectedly succeeded."
                                fi
                        done
@@ -108,10 +112,10 @@ function test_options_bookmarks
        for dst in ${bookmark[@]}; do
                for opt in $opts; do
                        for prop in $props; do
-                               $ZFS get $opt -- $prop $dst > /dev/null 2>&1
+                               zfs get $opt -- $prop $dst > /dev/null 2>&1
                                ret=$?
                                if [[ $ret == 0 ]]; then
-                                       log_fail "$ZFS get $opt -- $prop " \
+                                       log_fail "zfs get $opt -- $prop " \
                                            "$dst unexpectedly succeeded."
                                fi
                        done
index 58b08261d2242233558f7c8579d3a94a9e467777..d006748e55aba1e15affb2d93df971c49cd9aac6 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/zfs_get/zfs_get_common.kshlib
 
 #
@@ -52,7 +56,7 @@ set -A  bad_combine "ALL" "\-R all" "-P all" "-h all" "-rph all" "-RpH all" "-Pr
 typeset -i i=0
 while (( i < ${#bad_combine[*]} ))
 do
-       log_mustnot eval "$ZFS get ${bad_combine[i]} >/dev/null"
+       log_mustnot eval "zfs get ${bad_combine[i]} >/dev/null"
 
        (( i = i + 1 ))
 done
index 850c1ca2483aa8b5f82ee81a08c50e7e07b9aaec..9bb00807f1b0f27b801255e3972977ddddd68a6f 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/zfs_get/zfs_get_common.kshlib
 
 #
@@ -52,7 +56,7 @@ set -A  badargs "o name,property,value,resource" "o name" \
 typeset -i i=0
 while (( i < ${#badargs[*]} ))
 do
-       log_mustnot eval "$ZFS get \"${badargs[i]}\" >/dev/null 2>&1"
+       log_mustnot eval "zfs get \"${badargs[i]}\" >/dev/null 2>&1"
 
        (( i = i + 1 ))
 done
index 9d54625623157582998fee427b811c6cbaef5916..29bd10d4832a007d9f2636e1115225af41e4add9 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/zfs_get/zfs_get_common.kshlib
 . $STF_SUITE/tests/functional/cli_root/zfs_get/zfs_get_list_d.kshlib
 
@@ -53,7 +57,7 @@ set -A props type used available creation volsize referenced compressratio \
        usedbychildren usedbydataset usedbyrefreservation usedbysnapshots \
        userquota@root groupquota@root userused@root groupused@root
 
-$ZFS upgrade -v > /dev/null 2>&1
+zfs upgrade -v > /dev/null 2>&1
 if [[ $? -eq 0 ]]; then
        set -A all_props ${all_props[*]} version
 fi
@@ -88,7 +92,7 @@ for dst in ${dataset[@]}; do
                (( depth_item = $RANDOM % ${#depth_options[@]} ))
                for prop in $(gen_option_str "${props[*]}" "" "," $prop_numb)
                do
-                       log_must eval "$ZFS get -${depth_options[depth_item]} ${options[item]} $prop $dst > /dev/null 2>&1"
+                       log_must eval "zfs get -${depth_options[depth_item]} ${options[item]} $prop $dst > /dev/null 2>&1"
                done
                (( i += 1 ))
        done
@@ -99,7 +103,7 @@ for dst in ${bookmark[@]}; do
        while (( i < opt_numb )); do
                (( item = $RANDOM % ${#options[@]} ))
                (( depth_item = $RANDOM % ${#depth_options[@]} ))
-               log_must eval "$ZFS get -${depth_options[depth_item]} ${options[item]} $bookmark_props $dst > /dev/null 2>&1"
+               log_must eval "zfs get -${depth_options[depth_item]} ${options[item]} $bookmark_props $dst > /dev/null 2>&1"
                (( i += 1 ))
        done
 done
index 0adb5c1cb31279bac9f687f61292216e44906261..43748ae35ca162d9449f2eb7eb3fcd640dd5ccf2 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/zfs_get/zfs_get_common.kshlib
 . $STF_SUITE/tests/functional/cli_root/zfs_get/zfs_get_list_d.kshlib
 
@@ -56,7 +60,7 @@ set -A all_props type used available creation volsize referenced \
        usedbychildren usedbydataset usedbyrefreservation usedbysnapshots \
        userquota@root groupquota@root userused@root groupused@root
 
-$ZFS upgrade -v > /dev/null 2>&1
+zfs upgrade -v > /dev/null 2>&1
 if [[ $? -eq 0 ]]; then
        set -A all_props ${all_props[*]} version
 fi
@@ -77,9 +81,9 @@ for dp in ${depth_array[@]}; do
                (( j+=1 ))
        done
        for prop in $(gen_option_str "${all_props[*]}" "" "," $prop_numb); do
-               log_must eval "$ZFS get -H -d $dp -o name $prop $DEPTH_FS > $DEPTH_OUTPUT"
-               log_must eval "$ZFS get -rH -o name $prop $DEPTH_FS | $EGREP -e '$eg_opt' > $EXPECT_OUTPUT"
-               log_must $DIFF $DEPTH_OUTPUT $EXPECT_OUTPUT
+               log_must eval "zfs get -H -d $dp -o name $prop $DEPTH_FS > $DEPTH_OUTPUT"
+               log_must eval "zfs get -rH -o name $prop $DEPTH_FS | egrep -e '$eg_opt' > $EXPECT_OUTPUT"
+               log_must diff $DEPTH_OUTPUT $EXPECT_OUTPUT
        done
        (( old_val=dp ))
 done
index e8c36073a96eb4f0a4e2e383a2c8638006783f39..e1f53845fd9cbfadffced2e383f44d40cf88f14c 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/zfs_get/zfs_get_common.kshlib
 . $STF_SUITE/tests/functional/cli_root/zfs_get/zfs_get_list_d.kshlib
 
@@ -46,7 +50,7 @@ set -A  badargs "a" "AB" "aBc" "2A" "a2b" "aB2" "-1" "-32" "-999"
 typeset -i i=0
 while (( i < ${#badargs[*]} ))
 do
-       log_mustnot eval "$ZFS get -d ${badargs[i]} $TESTPOOL/$TESTFS >/dev/null 2>&1"
+       log_mustnot eval "zfs get -d ${badargs[i]} $TESTPOOL/$TESTFS >/dev/null 2>&1"
        (( i = i + 1 ))
 done
 
index 965686b935dd93bb550d8077f59da958532ad3b1..d8cb9af028e5d3a29309a78e60b554147b99dd8a 100644 (file)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -98,5 +102,5 @@ function cleanup
        bkmarkexists $TESTPOOL/$TESTFS#$TESTBKMARK && \
                destroy_bookmark $TESTPOOL/$TESTFS#$TESTBKMARK
 
-       [[ -e $TESTFILE0 ]] && log_must $RM $TESTFILE0
+       [[ -e $TESTFILE0 ]] && log_must rm $TESTFILE0
 }
index 874cfa3b5eb22a594b594caf4bbc42836e57d29a..8ef8d9aa160d9af84d4e485e7df577a928f22071 100644 (file)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 DEPTH_FS=$TESTPOOL/depth_fs
@@ -40,7 +44,7 @@ function depth_fs_setup
        typeset -i i j k
        typeset fslist
 
-       log_must $ZFS create $DEPTH_FS
+       log_must zfs create $DEPTH_FS
 
        (( i=1 ))
        while (( i<=MAX_DEPTH )); do
@@ -48,7 +52,7 @@ function depth_fs_setup
                        fslist=$DEPTH_FS
                else
                        (( k=i-1 ))
-                       fslist=$($ZFS list -rH -t filesystem -o name $DEPTH_FS|$GREP depth"$k"$)
+                       fslist=$(zfs list -rH -t filesystem -o name $DEPTH_FS|grep depth"$k"$)
                        if (( $? != 0 )); then
                                log_fail "No depth$k filesystem"
                        fi
@@ -56,11 +60,11 @@ function depth_fs_setup
                for fs in $fslist; do
                        (( j=1 ))
                        while (( j<=DS_COUNT )); do
-                               log_must $ZFS create $fs/fs_"$j"_depth"$i"
+                               log_must zfs create $fs/fs_"$j"_depth"$i"
                                if is_global_zone ; then
-                                       log_must $ZFS create -V 8M $fs/vol_"$j"_depth"$i"
+                                       log_must zfs create -V 8M $fs/vol_"$j"_depth"$i"
                                fi
-                               log_must $ZFS snapshot $fs@snap_"$j"_depth"$i"
+                               log_must zfs snapshot $fs@snap_"$j"_depth"$i"
                                (( j=j+1 ))
                        done
                done
@@ -73,7 +77,7 @@ function depth_fs_setup
 #
 function depth_fs_cleanup
 {
-       log_must $ZFS destroy -rR $DEPTH_FS
+       log_must zfs destroy -rR $DEPTH_FS
 }
 
 
index 891e0e9df09649d862400a51254d2d948fc259c0..62f255ca38b771fdb05cd471dcda54ed4185eb95 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -45,7 +49,7 @@ typeset props_str="type used available avail creation referenced refer \
                compressratio ratio mounted origin quota reservation \
                reserv volsize volblocksize volblock"
 
-$ZFS upgrade -v > /dev/null 2>&1
+zfs upgrade -v > /dev/null 2>&1
 if [[ $? -eq 0 ]]; then
        props_str="$props_str version"
 fi
@@ -62,7 +66,7 @@ for obj in $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL; do
        while [[ $i -lt ${#prop[*]} ]]; do
                orig_val=$(get_prop ${prop[i]} $obj)
 
-               log_mustnot $ZFS inherit ${prop[i]} $obj
+               log_mustnot zfs inherit ${prop[i]} $obj
 
                new_val=$(get_prop ${prop[i]} $obj)
 
index 3fefa316c39163d0d60dcfb7c6a7e6a1fce4a25d..584039f543c68af42f3e333048cff3249b83c1e7 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2011 by Delphix. All rights reserved.
+# Copyright (c) 2011, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -46,7 +46,7 @@ verify_runnable "both"
 function cleanup
 {
        if snapexists $TESTPOOL/$TESTFS@$TESTSNAP; then
-               log_must $ZFS destroy $TESTPOOL/$TESTFS@$TESTSNAP
+               log_must zfs destroy $TESTPOOL/$TESTFS@$TESTSNAP
        fi
 }
 
@@ -60,7 +60,7 @@ set -A props "recordsize" "mountpoint" "sharenfs" "checksum" "compression" \
     "aclinherit" "xattr" "copies"
 set -A illprops "recordsiz" "mountpont" "sharen" "compres" "atme" "blah"
 
-log_must $ZFS snapshot $TESTPOOL/$TESTFS@$TESTSNAP
+log_must zfs snapshot $TESTPOOL/$TESTFS@$TESTSNAP
 
 typeset -i i=0
 for ds in $TESTPOOL $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL \
@@ -69,23 +69,23 @@ for ds in $TESTPOOL $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL \
        # zfs inherit should fail with bad options
        for opt in ${badopts[@]}; do
                for prop in ${props[@]}; do
-                       log_mustnot eval "$ZFS inherit $opt $prop $ds \
+                       log_mustnot eval "zfs inherit $opt $prop $ds \
                            >/dev/null 2>&1"
                done
        done
 
        # zfs inherit should fail with invalid properties
        for prop in "${illprops[@]}"; do
-               log_mustnot eval "$ZFS inherit $prop $ds >/dev/null 2>&1"
-               log_mustnot eval "$ZFS inherit -r $prop $ds >/dev/null 2>&1"
+               log_mustnot eval "zfs inherit $prop $ds >/dev/null 2>&1"
+               log_mustnot eval "zfs inherit -r $prop $ds >/dev/null 2>&1"
        done
 
        # zfs inherit should fail with too many arguments
        (( i = 0 ))
        while (( i < ${#props[*]} -1 )); do
-               log_mustnot eval "$ZFS inherit ${props[(( i ))]} \
+               log_mustnot eval "zfs inherit ${props[(( i ))]} \
                                ${props[(( i + 1 ))]} $ds >/dev/null 2>&1"
-               log_mustnot eval "$ZFS inherit -r ${props[(( i ))]} \
+               log_mustnot eval "zfs inherit -r ${props[(( i ))]} \
                                ${props[(( i + 1 ))]} $ds >/dev/null 2>&1"
 
                (( i = i + 2 ))
@@ -95,8 +95,8 @@ done
 
 # zfs inherit should fail with missing datasets
 for prop in ${props[@]}; do
-       log_mustnot eval "$ZFS inherit $prop >/dev/null 2>&1"
-       log_mustnot eval "$ZFS inherit -r $prop >/dev/null 2>&1"
+       log_mustnot eval "zfs inherit $prop >/dev/null 2>&1"
+       log_mustnot eval "zfs inherit -r $prop >/dev/null 2>&1"
 done
 
 log_pass "'zfs inherit' failed as expected when passing illegal arguments."
index b2f09dba7e74c60505490fe1d8f691d85fa091d3..bc0d8c59c0cdf1af173a768070977da1ea8b79a1 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
 
@@ -44,7 +48,7 @@ function cleanup
 {
        for ds in $TESTPOOL $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL ; do
                if snapexists $ds@$TESTSNAP; then
-                       log_must $ZFS destroy $ds@$TESTSNAP
+                       log_must zfs destroy $ds@$TESTSNAP
                fi
        done
        cleanup_user_prop $TESTPOOL
@@ -57,9 +61,9 @@ for ds in $TESTPOOL $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL ; do
         typeset prop_name=$(valid_user_property 10)
         typeset value=$(user_property_value 16)
 
-       log_must eval "$ZFS set $prop_name='$value' $ds"
+       log_must eval "zfs set $prop_name='$value' $ds"
 
-       log_must $ZFS snapshot $ds@$TESTSNAP
+       log_must zfs snapshot $ds@$TESTSNAP
 
        typeset snapvalue=$(get_prop $prop_name $ds@$TESTSNAP)
 
@@ -69,9 +73,9 @@ for ds in $TESTPOOL $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL ; do
        fi
 
        snapvalue=$(user_property_value 16)
-       log_must eval "$ZFS set $prop_name='$snapvalue' $ds@$TESTSNAP"
+       log_must eval "zfs set $prop_name='$snapvalue' $ds@$TESTSNAP"
 
-       log_must $ZFS inherit $prop_name $ds@$TESTSNAP
+       log_must zfs inherit $prop_name $ds@$TESTSNAP
 
        snapvalue=$(get_prop $prop_name $ds@$TESTSNAP)
 
index 2f6194e7c899cfd3f572da88dc3b1a40c11a63c0..2a7cf6ef735bdf5967f2f49f38d6f6c523ebf04c 100644 (file)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_mount/zfs_mount.cfg
 
@@ -33,7 +37,7 @@ function force_unmount #dev
 
        ismounted $dev
        if (( $? == 0 )); then
-               log_must $ZFS $unmountforce $dev
+               log_must zfs $unmountforce $dev
        fi
        return 0
 }
@@ -74,20 +78,20 @@ function setup_filesystem #disklist #pool #fs #mntpoint #type #vdev
        datasetexists $pool/$fs && \
                log_must cleanup_filesystem $pool $fs
 
-       $RMDIR $mntpoint > /dev/null 2>&1
+       rmdir $mntpoint > /dev/null 2>&1
        if [[ ! -d $mntpoint ]]; then
-               log_must $MKDIR -p $mntpoint
+               log_must mkdir -p $mntpoint
        fi
 
        case "$type" in
-               'ctr')  log_must $ZFS create $pool/$fs
-                       log_must $ZFS set mountpoint=$mntpoint $pool/$fs
+               'ctr')  log_must zfs create $pool/$fs
+                       log_must zfs set mountpoint=$mntpoint $pool/$fs
                        ;;
-               'vol')  log_must $ZFS create -V $VOLSIZE $pool/$fs
+               'vol')  log_must zfs create -V $VOLSIZE $pool/$fs
                        block_device_wait
                        ;;
-               *)      log_must $ZFS create $pool/$fs
-                       log_must $ZFS set mountpoint=$mntpoint $pool/$fs
+               *)      log_must zfs create $pool/$fs
+                       log_must zfs set mountpoint=$mntpoint $pool/$fs
                        ;;
        esac
 
@@ -108,10 +112,10 @@ function cleanup_filesystem #pool #fs
 
        if datasetexists "$pool/$fs" ; then
                mtpt=$(get_prop mountpoint "$pool/$fs")
-               log_must $ZFS destroy -r $pool/$fs
+               log_must zfs destroy -r $pool/$fs
 
                [[ -d $mtpt ]] && \
-                       log_must $RM -rf $mtpt
+                       log_must rm -rf $mtpt
        else
                return 1
        fi
@@ -125,7 +129,7 @@ function verify_mount_display
 {
        typeset fs
 
-       for fs in $($ZFS $mountcmd | $AWK '{print $1}') ; do
+       for fs in $(zfs $mountcmd | awk '{print $1}') ; do
                log_must mounted $fs
        done
        return 0
index b474dc8e1f2ef397245ba42553d440a7f2ff0b1a..c46a35695492433b1b5ee78c257749bcf48d6c25 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_mount/zfs_mount.kshlib
 
@@ -47,17 +51,17 @@ function cleanup
        return 0
 }
 
-log_assert "Verify that '$ZFS $mountcmd <filesystem>' succeeds as root."
+log_assert "Verify that 'zfs $mountcmd <filesystem>' succeeds as root."
 
 log_onexit cleanup
 
 unmounted $TESTPOOL/$TESTFS || \
        log_must cleanup
 
-log_must $ZFS $mountcmd $TESTPOOL/$TESTFS
+log_must zfs $mountcmd $TESTPOOL/$TESTFS
 
 log_note "Make sure the filesystem $TESTPOOL/$TESTFS is mounted"
 mounted $TESTPOOL/$TESTFS || \
        log_fail Filesystem $TESTPOOL/$TESTFS is unmounted
 
-log_pass "'$ZFS $mountcmd <filesystem>' succeeds as root."
+log_pass "'zfs $mountcmd <filesystem>' succeeds as root."
index 8b39306fbdd137405299dc0fbe23c3ebc4bb98ed..8ee3e029fb4a1ad37742d0cdfd5663d3cfee36bf 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_mount/zfs_mount.kshlib
 
@@ -50,25 +54,25 @@ function cleanup
 }
 
 
-log_assert "Verify that '$ZFS $mountcmd' with a filesystem " \
+log_assert "Verify that 'zfs $mountcmd' with a filesystem " \
        "whose name is not in 'zfs list' will fail with return code 1."
 
 log_onexit cleanup
 
 log_note "Make sure the filesystem $TESTPOOL/$NONEXISTFSNAME " \
        "is not in 'zfs list'"
-log_mustnot $ZFS list $TESTPOOL/$NONEXISTFSNAME
+log_mustnot zfs list $TESTPOOL/$NONEXISTFSNAME
 
 typeset -i ret=0
-$ZFS $mountcmd $TESTPOOL/$NONEXISTFSNAME
+zfs $mountcmd $TESTPOOL/$NONEXISTFSNAME
 ret=$?
 (( ret == 1 )) || \
-       log_fail "'$ZFS $mountcmd $TESTPOOL/$NONEXISTFSNAME' " \
+       log_fail "'zfs $mountcmd $TESTPOOL/$NONEXISTFSNAME' " \
                "unexpected return code of $ret."
 
 log_note "Make sure the filesystem $TESTPOOL/$NONEXISTFSNAME is unmounted"
 unmounted $TESTPOOL/$NONEXISTFSNAME || \
        log_fail Filesystem $TESTPOOL/$NONEXISTFSNAME is mounted
 
-log_pass "'$ZFS $mountcmd' with a filesystem " \
+log_pass "'zfs $mountcmd' with a filesystem " \
        "whose name is not in 'zfs list' failed with return code 1."
index 2dd14daecdef7514c60794f7849d465b76782016..59d8c235f8fed4fce3181692d357787c658a9cf3 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_mount/zfs_mount.kshlib
 
@@ -46,12 +50,12 @@ verify_runnable "both"
 
 function cleanup
 {
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
        log_must force_unmount $TESTPOOL/$TESTFS
        return 0
 }
 
-log_assert "Verify that '$ZFS $mountcmd' with a filesystem " \
+log_assert "Verify that 'zfs $mountcmd' with a filesystem " \
        "whose mountpoint property is 'legacy' or 'none' " \
        "will fail with return code 1."
 
@@ -66,12 +70,12 @@ while (( i < ${#mopt[*]} )); do
        unmounted $TESTPOOL/$TESTFS || \
                log_must cleanup
 
-       log_must $ZFS set mountpoint=${mopt[i]} $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=${mopt[i]} $TESTPOOL/$TESTFS
 
-       $ZFS $mountcmd $TESTPOOL/$TESTFS
+       zfs $mountcmd $TESTPOOL/$TESTFS
        ret=$?
        (( ret == 1)) || \
-               log_fail "'$ZFS $mountcmd $TESTPOOL/$TESTFS' " \
+               log_fail "'zfs $mountcmd $TESTPOOL/$TESTFS' " \
                        "unexpected return code of $ret."
 
        log_note "Make sure the filesystem $TESTPOOL/$TESTFS is unmounted"
@@ -81,6 +85,6 @@ while (( i < ${#mopt[*]} )); do
        ((i = i + 1))
 done
 
-log_pass "Verify that '$ZFS $mountcmd' with a filesystem " \
+log_pass "Verify that 'zfs $mountcmd' with a filesystem " \
        "whose mountpoint property is 'legacy' or 'none' " \
        "will fail with return code 1."
index 524aed185528242dd5aa33a17948be12407ad0ee..4874c6d6530ae7d905a09f22ff75a63a2e65a3bb 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_mount/zfs_mount.kshlib
 
@@ -52,7 +56,7 @@ function cleanup
 
 typeset -i ret=0
 
-log_assert "Verify that '$ZFS $mountcmd <filesystem>' " \
+log_assert "Verify that 'zfs $mountcmd <filesystem>' " \
        "with a mounted filesystem will fail with return code 1."
 
 log_onexit cleanup
@@ -60,20 +64,20 @@ log_onexit cleanup
 unmounted $TESTPOOL/$TESTFS || \
        log_must cleanup
 
-log_must $ZFS $mountcmd $TESTPOOL/$TESTFS
+log_must zfs $mountcmd $TESTPOOL/$TESTFS
 
 mounted $TESTPOOL/$TESTFS || \
        log_unresolved "Filesystem $TESTPOOL/$TESTFS is unmounted"
 
-$ZFS $mountcmd $TESTPOOL/$TESTFS
+zfs $mountcmd $TESTPOOL/$TESTFS
 ret=$?
 (( ret == 1 )) || \
-       log_fail "'$ZFS $mountcmd $TESTPOOL/$TESTFS' " \
+       log_fail "'zfs $mountcmd $TESTPOOL/$TESTFS' " \
                "unexpected return code of $ret."
 
 log_note "Make sure the filesystem $TESTPOOL/$TESTFS is mounted"
 mounted $TESTPOOL/$TESTFS || \
        log_fail Filesystem $TESTPOOL/$TESTFS is unmounted
 
-log_pass "'$ZFS $mountcmd <filesystem>' with a mounted filesystem " \
+log_pass "'zfs $mountcmd <filesystem>' with a mounted filesystem " \
        "will fail with return code 1."
index 7e9f13834eb4ca94e1b92aa9e07e6b5de006db6f..fc97520f57db5445485ee179d2ccb9ae5b95d67b 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_mount/zfs_mount.kshlib
 
@@ -47,14 +51,14 @@ verify_runnable "both"
 
 function cleanup
 {
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
        log_must force_unmount $TESTPOOL/$TESTFS
        return 0
 }
 
 typeset -i ret=0
 
-log_assert "Verify that '$ZFS $mountcmd' with a filesystem " \
+log_assert "Verify that 'zfs $mountcmd' with a filesystem " \
        "whose mountpoint is currently in use will fail with return code 1."
 
 log_onexit cleanup
@@ -63,20 +67,20 @@ unmounted $TESTPOOL/$TESTFS || \
        log_must cleanup
 
 [[ -d $TESTDIR ]] || \
-       log_must $MKDIR -p $TESTDIR
+       log_must mkdir -p $TESTDIR
 
 cd $TESTDIR || \
        log_unresolved "Unable change directory to $TESTDIR"
 
-$ZFS $mountcmd $TESTPOOL/$TESTFS
+zfs $mountcmd $TESTPOOL/$TESTFS
 ret=$?
 if is_linux; then
     (( ret == 0 )) || \
-        log_fail "'$ZFS $mountcmd $TESTPOOL/$TESTFS' " \
+        log_fail "'zfs $mountcmd $TESTPOOL/$TESTFS' " \
             "unexpected return code of $ret."
 else
     (( ret == 1 )) || \
-        log_fail "'$ZFS $mountcmd $TESTPOOL/$TESTFS' " \
+        log_fail "'zfs $mountcmd $TESTPOOL/$TESTFS' " \
             "unexpected return code of $ret."
 fi
 
@@ -89,5 +93,5 @@ else
         log_fail Filesystem $TESTPOOL/$TESTFS is mounted
 fi
 
-log_pass "'$ZFS $mountcmd' with a filesystem " \
+log_pass "'zfs $mountcmd' with a filesystem " \
        "whose mountpoint is currently in use failed with return code 1."
index f8b40219bdd3a3f1b111c8bb4415c5ce54d29387..d1e89616bf4f98e9f2372fb4cf09f4c5087c8fb3 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_mount/zfs_mount.kshlib
 
@@ -53,8 +57,8 @@ function cleanup
                cleanup_filesystem $TESTPOOL $TESTFS1
 
        [[ -d $TESTDIR ]] && \
-               log_must $RM -rf $TESTDIR
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+               log_must rm -rf $TESTDIR
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
        log_must force_unmount $TESTPOOL/$TESTFS
 
        return 0
@@ -62,7 +66,7 @@ function cleanup
 
 typeset -i ret=0
 
-log_assert "Verify that '$ZFS $mountcmd <filesystem>' " \
+log_assert "Verify that 'zfs $mountcmd <filesystem>' " \
        "which mountpoint be the identical or the top of an existing one " \
        "will fail with return code 1."
 
@@ -72,7 +76,7 @@ unmounted $TESTPOOL/$TESTFS || \
        log_must force_unmount $TESTPOOL/$TESTFS
 
 [[ -d $TESTDIR ]] && \
-       log_must $RM -rf $TESTDIR
+       log_must rm -rf $TESTDIR
 
 typeset -i MAXDEPTH=3
 typeset -i depth=0
@@ -83,25 +87,25 @@ while (( depth < MAXDEPTH )); do
        (( depth = depth + 1))
 done
 
-log_must $ZFS set mountpoint=$mtpt $TESTPOOL/$TESTFS
-log_must $ZFS $mountcmd $TESTPOOL/$TESTFS
+log_must zfs set mountpoint=$mtpt $TESTPOOL/$TESTFS
+log_must zfs $mountcmd $TESTPOOL/$TESTFS
 
 mounted $TESTPOOL/$TESTFS || \
        log_unresolved "Filesystem $TESTPOOL/$TESTFS is unmounted"
 
-log_must $ZFS create $TESTPOOL/$TESTFS1
+log_must zfs create $TESTPOOL/$TESTFS1
 
 unmounted $TESTPOOL/$TESTFS1 || \
        log_must force_unmount $TESTPOOL/$TESTFS1
 
 while [[ -n $mtpt ]] ; do
        (( depth == MAXDEPTH )) && \
-               log_note "Verify that '$ZFS $mountcmd <filesystem>' " \
+               log_note "Verify that 'zfs $mountcmd <filesystem>' " \
                "which mountpoint be the identical of an existing one " \
                "will fail with return code 1."
 
-       log_must $ZFS set mountpoint=$mtpt $TESTPOOL/$TESTFS1
-       log_mustnot $ZFS $mountcmd $TESTPOOL/$TESTFS1
+       log_must zfs set mountpoint=$mtpt $TESTPOOL/$TESTFS1
+       log_mustnot zfs $mountcmd $TESTPOOL/$TESTFS1
 
        unmounted $TESTPOOL/$TESTFS1 || \
                log_fail "Filesystem $TESTPOOL/$TESTFS1 is mounted."
@@ -109,12 +113,12 @@ while [[ -n $mtpt ]] ; do
        mtpt=${mtpt%/*}
 
        (( depth == MAXDEPTH )) && \
-               log_note "Verify that '$ZFS $mountcmd <filesystem>' " \
+               log_note "Verify that 'zfs $mountcmd <filesystem>' " \
                "which mountpoint be the top of an existing one " \
                "will fail with return code 1."
        (( depth = depth - 1 ))
 done
 
-log_pass "'$ZFS $mountcmd <filesystem>' " \
+log_pass "'zfs $mountcmd <filesystem>' " \
        "which mountpoint be the identical or the top of an existing one " \
        "will fail with return code 1."
index 577de0957915a60c115e15944a65e8c48c84255e..fe275672e32b3adcf1d298544748c7dd630822f5 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/zfs_mount/zfs_mount.kshlib
 
 #
@@ -50,7 +54,7 @@
 function cleanup
 {
        if ! ismounted $TESTPOOL/$TESTFS; then
-               log_must $ZFS mount $TESTPOOL/$TESTFS
+               log_must zfs mount $TESTPOOL/$TESTFS
        fi
 }
 
@@ -99,7 +103,7 @@ function get_reverse_option
                (( ind = i * 2 + 1 ))
        fi
 
-       $ECHO ${values[$ind]}
+       echo ${values[$ind]}
 }
 
 fs=$TESTPOOL/$TESTFS
@@ -111,7 +115,7 @@ for property in ${properties[@]}; do
 
        # Set filesystem property temporarily
        reverse_opt=$(get_reverse_option $fs $property)
-       log_must $ZFS mount -o remount,$reverse_opt $fs
+       log_must zfs mount -o remount,$reverse_opt $fs
 
        cur_val=$(get_prop $property $fs)
        (($? != 0)) && log_fail "get_prop $property $fs"
@@ -128,8 +132,8 @@ for property in ${properties[@]}; do
        fi
 
        # unmount & mount will revert property to the original value
-       log_must $ZFS unmount $fs
-       log_must $ZFS mount $fs
+       log_must zfs unmount $fs
+       log_must zfs mount $fs
 
        cur_val=$(get_prop $property $fs)
        (($? != 0)) && log_fail "get_prop $property $fs"
index c1210b29c8d34aae0b89b7ef69c4adf52f1ba60c..5f88b611002a49914be1bb0e582caef23a3464f6 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/zfs_mount/zfs_mount.kshlib
 
 #
 
 function cleanup
 {
-       ! ismounted $fs && log_must $ZFS mount $fs
+       ! ismounted $fs && log_must zfs mount $fs
 
        if datasetexists $fs1; then
-               log_must $ZFS destroy $fs1
+               log_must zfs destroy $fs1
        fi
 
        if [[ -f $testfile ]]; then
-               log_must $RM -f $testfile
+               log_must rm -f $testfile
        fi
 }
 
@@ -61,32 +65,32 @@ cleanup
 
 # Get the original mountpoint of $fs and $fs1
 mntpnt=$(get_prop mountpoint $fs)
-log_must $ZFS create $fs1
+log_must zfs create $fs1
 mntpnt1=$(get_prop mountpoint $fs1)
 
 testfile=$mntpnt/$TESTFILE0; testfile1=$mntpnt1/$TESTFILE1
-log_must $MKFILE 1M $testfile $testfile1
+log_must mkfile 1M $testfile $testfile1
 
-log_must $ZFS unmount $fs1
-log_must $ZFS set mountpoint=$mntpnt $fs1
-log_mustnot $ZFS mount $fs1
-log_must $ZFS mount -O $fs1
+log_must zfs unmount $fs1
+log_must zfs set mountpoint=$mntpnt $fs1
+log_mustnot zfs mount $fs1
+log_must zfs mount -O $fs1
 
 # Create new file in override mountpoint
-log_must $MKFILE 1M $mntpnt/$TESTFILE2
+log_must mkfile 1M $mntpnt/$TESTFILE2
 
 # Verify the underlying file system inaccessible
-log_mustnot $LS $testfile
-log_must $LS $mntpnt/$TESTFILE1 $mntpnt/$TESTFILE2
+log_mustnot ls $testfile
+log_must ls $mntpnt/$TESTFILE1 $mntpnt/$TESTFILE2
 
 # Verify $TESTFILE2 was created in $fs1, rather then $fs
-log_must $ZFS unmount $fs1
-log_must $ZFS set mountpoint=$mntpnt1 $fs1
-log_must $ZFS mount $fs1
-log_must $LS $testfile1 $mntpnt1/$TESTFILE2
+log_must zfs unmount $fs1
+log_must zfs set mountpoint=$mntpnt1 $fs1
+log_must zfs mount $fs1
+log_must ls $testfile1 $mntpnt1/$TESTFILE2
 
 # Verify $TESTFILE2 was not created in $fs, and $fs is accessible again.
-log_mustnot $LS $mntpnt/$TESTFILE2
-log_must $LS $testfile
+log_mustnot ls $mntpnt/$TESTFILE2
+log_must ls $testfile
 
 log_pass "Verify 'zfs mount -O' override mount point passed."
index c6a372ac66623ee1bc89480e08d1e87d28cb997b..978a5a4f2eea179afc01c95a19f519fe4bf8ec4c 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -72,10 +72,10 @@ function cleanup_all
        typeset fs
 
        cleanup_filesystem "$TESTPOOL" "$TESTFS1"
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 
        [[ -d ${TEST_BASE_DIR%%/}/testroot$$ ]] && \
-               $RM -rf ${TEST_BASE_DIR%%/}/testroot$$
+               rm -rf ${TEST_BASE_DIR%%/}/testroot$$
 
 
        return 0
@@ -97,11 +97,11 @@ log_onexit cleanup_all
 
 log_must setup_all
 
-log_must $ZFS $unmountall
+log_must zfs $unmountall
 
 typeset -i i=0
 while (( i < ${#args[*]} )); do
-       log_mustnot $ZFS ${args[i]}
+       log_mustnot zfs ${args[i]}
        ((i = i + 1))
 done
 
index b6ab6d8f21565eec4c0c43a5cbb482b462727573..963ad626c2d0388ee467e9e3767b552b4e99fd91 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -43,7 +47,7 @@ verify_runnable "both"
 function cleanup
 {
        if ! ismounted $fs; then
-               log_must $ZFS mount $fs
+               log_must zfs mount $fs
        fi
 }
 
@@ -52,19 +56,19 @@ log_onexit cleanup
 
 fs=$TESTPOOL/$TESTFS
 if ! ismounted $fs; then
-       log_must $ZFS mount $fs
+       log_must zfs mount $fs
 fi
 
-log_mustnot $ZFS mount $fs
+log_mustnot zfs mount $fs
 
 mpt=$(get_prop mountpoint $fs)
-log_must $ZFS umount $fs
-curpath=`$DIRNAME $0`
+log_must zfs umount $fs
+curpath=`dirname $0`
 cd $mpt
 if is_linux; then
-    log_must $ZFS mount $fs
+    log_must zfs mount $fs
 else
-    log_mustnot $ZFS mount $fs
+    log_mustnot zfs mount $fs
 fi
 cd $curpath
 
index 97fc4b3b0dcb0334413b821f56160f17088be190..795fc3114205b0f5a117821408291ff62515e3ca 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -42,11 +46,11 @@ verify_runnable "both"
 function cleanup
 {
        if snapexists $TESTPOOL/$TESTFS@$TESTSNAP; then
-               log_must $ZFS destroy $TESTPOOL/$TESTFS@$TESTSNAP
+               log_must zfs destroy $TESTPOOL/$TESTFS@$TESTSNAP
        fi
 
        if is_global_zone && datasetexists $TESTPOOL/$TESTVOL; then
-               log_must $ZFS destroy $TESTPOOL/$TESTVOL
+               log_must zfs destroy $TESTPOOL/$TESTVOL
        fi
 }
 
@@ -57,21 +61,21 @@ fs=$TESTPOOL/$TESTFS
 set -A badargs "A" "-A" "-" "-x" "-?" "=" "-o *" "-a"
 
 for arg in "${badargs[@]}"; do
-       log_mustnot eval "$ZFS mount $arg $fs >/dev/null 2>&1"
+       log_mustnot eval "zfs mount $arg $fs >/dev/null 2>&1"
 done
 
 #verify that zfs mount fails with invalid dataset
 for opt in "-o abc" "-O"; do
-       log_mustnot eval "$ZFS mount $opt /$fs >/dev/null 2>&1"
+       log_mustnot eval "zfs mount $opt /$fs >/dev/null 2>&1"
 done
 
 #verify that zfs mount fails with volume and snapshot
-log_must $ZFS snapshot $TESTPOOL/$TESTFS@$TESTSNAP
-log_mustnot eval "$ZFS mount $TESTPOOL/$TESTFS@$TESTSNAP >/dev/null 2>&1"
+log_must zfs snapshot $TESTPOOL/$TESTFS@$TESTSNAP
+log_mustnot eval "zfs mount $TESTPOOL/$TESTFS@$TESTSNAP >/dev/null 2>&1"
 
 if is_global_zone; then
-       log_must $ZFS create -V 10m $TESTPOOL/$TESTVOL
-       log_mustnot eval "$ZFS mount $TESTPOOL/$TESTVOL >/dev/null 2>&1"
+       log_must zfs create -V 10m $TESTPOOL/$TESTVOL
+       log_mustnot eval "zfs mount $TESTPOOL/$TESTVOL >/dev/null 2>&1"
 fi
 
 log_pass "zfs mount fails with bad parameters as expected."
index ec1ff433a5484261347c517b492e3e4b47c3ff50..19fb3b259692c80772015e49d0e52841d91aafd2 100755 (executable)
@@ -38,13 +38,13 @@ log_assert "zfs mount fails with non-empty directory"
 
 fs=$TESTPOOL/$TESTFS
 
-log_must $ZFS umount $fs
+log_must zfs umount $fs
 log_must mkdir -p $TESTDIR
-log_must $ZFS set mountpoint=$TESTDIR $fs
-log_must $ZFS mount $fs
-log_must $ZFS umount $fs
+log_must zfs set mountpoint=$TESTDIR $fs
+log_must zfs mount $fs
+log_must zfs umount $fs
 log_must touch $TESTDIR/testfile.$$
-log_mustnot $ZFS mount $fs
+log_mustnot zfs mount $fs
 log_must rm -rf $TESTDIR
 
 log_pass "zfs mount fails non-empty directory as expected."
index 89735585338bbdfe2c1f91a22ea28adab18f8fa7..765e242796b84e0cd70c895d9294de58de5c5679 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_mount/zfs_mount.kshlib
 
@@ -119,7 +124,7 @@ function cleanup_all
        done
 
        [[ -d ${TEST_BASE_DIR%%/}/testroot$$ ]] && \
-               $RM -rf ${TEST_BASE_DIR%%/}/testroot$$
+               rm -rf ${TEST_BASE_DIR%%/}/testroot$$
 }
 
 #
@@ -177,13 +182,13 @@ log_onexit cleanup_all
 log_must setup_all
 
 export __ZFS_POOL_RESTRICT="$TESTPOOL"
-log_must $ZFS $unmountall
+log_must zfs $unmountall
 unset __ZFS_POOL_RESTRICT
 
 verify_all false
 
 export __ZFS_POOL_RESTRICT="$TESTPOOL"
-log_must $ZFS $mountall
+log_must zfs $mountall
 unset __ZFS_POOL_RESTRICT
 
 verify_all true
index 2c2b9a5bffb00c00ccca6464c88d62b2645b5270..0bf7c5b6a1765d571d311b60945041122b6abd19 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cli_root/zfs_promote/zfs_promote.cfg
@@ -48,14 +48,14 @@ verify_runnable "both"
 function cleanup
 {
        if snapexists $csnap; then
-               log_must $ZFS promote $fs
+               log_must zfs promote $fs
        fi
        snapexists $snap && \
-               log_must $ZFS destroy -rR $snap
+               log_must zfs destroy -rR $snap
 
        typeset data
        for data in $file0 $file1; do
-               [[ -e $data ]] && $RM -f $data
+               [[ -e $data ]] && rm -f $data
        done
 }
 
@@ -89,7 +89,7 @@ function testing_verify
                log_fail "There exists data file losing after zfs promote."
        fi
 
-       log_mustnot $ZFS destroy -r $c_ds
+       log_mustnot zfs destroy -r $c_ds
 }
 
 log_assert "'zfs promote' can promote a clone filesystem."
@@ -106,19 +106,19 @@ csnap=$clone@$TESTSNAP
 csnapfile=/$clone/.zfs/snapshot/$TESTSNAP/$TESTFILE0
 
 # setup for promte testing
-log_must $MKFILE $FILESIZE $file0
-log_must $ZFS snapshot $snap
-log_must $MKFILE $FILESIZE $file1
-log_must $RM -f $file0
-log_must $ZFS clone $snap $clone
-log_must $MKFILE $FILESIZE $cfile
-
-log_must $ZFS promote $clone
+log_must mkfile $FILESIZE $file0
+log_must zfs snapshot $snap
+log_must mkfile $FILESIZE $file1
+log_must rm -f $file0
+log_must zfs clone $snap $clone
+log_must mkfile $FILESIZE $cfile
+
+log_must zfs promote $clone
 # verify the 'promote' operation
 testing_verify $fs $file1 $snapfile $clone $cfile $csnapfile
 
 log_note "Verify 'zfs promote' can change back the dependency relationship."
-log_must $ZFS promote $fs
+log_must zfs promote $fs
 #verify the result
 testing_verify $clone $cfile $csnapfile $fs $file1 $snapfile
 
index b6ff94b5201795a5a531a4958ea6385268193e0f..1a774da2c15c11eac7dc3526ee5a4d90c19fb0f1 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cli_root/zfs_promote/zfs_promote.cfg
@@ -47,16 +47,16 @@ verify_runnable "both"
 function cleanup
 {
        if snapexists $csnap1; then
-               log_must $ZFS promote $fs
+               log_must zfs promote $fs
        fi
 
        typeset ds
        typeset data
        for ds in $snap $snap1; do
-               log_must $ZFS destroy -rR $ds
+               log_must zfs destroy -rR $ds
        done
        for file in $TESTDIR/$TESTFILE0 $TESTDIR/$TESTFILE1; do
-               [[ -e $file ]] && $RM -f $file
+               [[ -e $file ]] && rm -f $file
        done
 }
 
@@ -71,15 +71,15 @@ csnap=$clone@$TESTSNAP
 csnap1=$clone@$TESTSNAP1
 
 # setup for promote testing
-log_must $MKFILE $FILESIZE $TESTDIR/$TESTFILE0
-log_must $ZFS snapshot $snap
-log_must $MKFILE $FILESIZE $TESTDIR/$TESTFILE1
-log_must $RM -f $testdir/$TESTFILE0
-log_must $ZFS snapshot $snap1
-log_must $ZFS clone $snap1 $clone
-log_must $MKFILE $FILESIZE /$clone/$CLONEFILE
+log_must mkfile $FILESIZE $TESTDIR/$TESTFILE0
+log_must zfs snapshot $snap
+log_must mkfile $FILESIZE $TESTDIR/$TESTFILE1
+log_must rm -f $testdir/$TESTFILE0
+log_must zfs snapshot $snap1
+log_must zfs clone $snap1 $clone
+log_must mkfile $FILESIZE /$clone/$CLONEFILE
 
-log_must $ZFS promote $clone
+log_must zfs promote $clone
 
 # verify the 'promote' operation
 for ds in $csnap $csnap1; do
index 95794985e56040d568992a810e2525265efa16b6..e0d0e8457a2619837932a842b8528acaf93622e5 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cli_root/zfs_promote/zfs_promote.cfg
@@ -48,17 +48,17 @@ verify_runnable "both"
 function cleanup
 {
        if snapexists ${csnap[2]}; then
-               log_must $ZFS promote $fs
+               log_must zfs promote $fs
        fi
 
        typeset ds
        typeset data
        for ds in ${snap[*]}; do
                snapexists $ds && \
-                       log_must $ZFS destroy -rR $ds
+                       log_must zfs destroy -rR $ds
        done
        for data in ${file[*]}; do
-               [[ -e $data ]] && $RM -f $data
+               [[ -e $data ]] && rm -f $data
        done
 
 }
@@ -91,18 +91,18 @@ set -A csnapfile "${csnapdir}/$TESTSNAP/$TESTFILE0" "${csnapdir}/$TESTSNAP1/$TES
 # setup for promote testing
 typeset -i i=0
 while (( i < 4 )); do
-       log_must $MKFILE $FILESIZE ${file[i]}
-       (( i>0 )) && log_must $RM -f ${file[((i-1))]}
-       log_must $ZFS snapshot ${snap[i]}
+       log_must mkfile $FILESIZE ${file[i]}
+       (( i>0 )) && log_must rm -f ${file[((i-1))]}
+       log_must zfs snapshot ${snap[i]}
 
        (( i = i + 1 ))
 done
-log_must $ZFS clone ${snap[2]} $clone
-log_must $MKFILE $FILESIZE /$clone/$CLONEFILE
-log_must $RM -f /$clone/$TESTFILE2
-log_must $ZFS snapshot ${csnap[3]}
+log_must zfs clone ${snap[2]} $clone
+log_must mkfile $FILESIZE /$clone/$CLONEFILE
+log_must rm -f /$clone/$TESTFILE2
+log_must zfs snapshot ${csnap[3]}
 
-log_must $ZFS promote $clone
+log_must zfs promote $clone
 
 # verify the 'promote' operation
 for ds in ${snap[3]} ${csnap[*]}; do
index a90da8ebb1920a3432b3abd9c1e5f3eeb7ea36af..23b5991084f8a8d5a86f6584c154528933483083 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cli_root/zfs_promote/zfs_promote.cfg
@@ -47,17 +47,17 @@ verify_runnable "both"
 function cleanup
 {
        if snapexists ${c1snap[1]}; then
-               log_must $ZFS promote $clone
+               log_must zfs promote $clone
        fi
 
        typeset ds
        typeset data
        for ds in ${snap[*]}; do
                snapexists $ds && \
-                       log_must $ZFS destroy -rR $ds
+                       log_must zfs destroy -rR $ds
        done
        for data in ${file[*]}; do
-               [[ -e $data ]] && $RM -f $data
+               [[ -e $data ]] && rm -f $data
        done
 }
 
@@ -91,30 +91,30 @@ set -A c1snapfile "${c1snapdir}/$TESTSNAP3/$CLONEFILE" \
 # setup for promote testing
 typeset -i i=0
 while (( i < 4 )); do
-       log_must $MKFILE $FILESIZE ${file[i]}
-       (( i>0 )) && log_must $RM -f ${file[((i-1))]}
-       log_must $ZFS snapshot ${snap[i]}
+       log_must mkfile $FILESIZE ${file[i]}
+       (( i>0 )) && log_must rm -f ${file[((i-1))]}
+       log_must zfs snapshot ${snap[i]}
 
        (( i = i + 1 ))
 done
-log_must $ZFS clone ${snap[2]} $clone
+log_must zfs clone ${snap[2]} $clone
 
-log_must $RM -f /$clone/$TESTFILE2
+log_must rm -f /$clone/$TESTFILE2
 i=0
 while (( i < 3 )); do
-       log_must $MKFILE $FILESIZE ${cfile[i]}
-       (( i>0 )) && log_must $RM -f ${cfile[(( i-1 ))]}
-       log_must $ZFS snapshot ${csnap[i]}
+       log_must mkfile $FILESIZE ${cfile[i]}
+       (( i>0 )) && log_must rm -f ${cfile[(( i-1 ))]}
+       log_must zfs snapshot ${csnap[i]}
 
        (( i = i + 1 ))
 done
 
-log_must $ZFS clone ${csnap[1]} $clone1
-log_must $MKFILE $FILESIZE /$clone1/$CLONEFILE2
-log_must $RM -f /$clone1/$CLONEFILE1
-log_must $ZFS snapshot ${c1snap[2]}
+log_must zfs clone ${csnap[1]} $clone1
+log_must mkfile $FILESIZE /$clone1/$CLONEFILE2
+log_must rm -f /$clone1/$CLONEFILE1
+log_must zfs snapshot ${c1snap[2]}
 
-log_must $ZFS promote $clone1
+log_must zfs promote $clone1
 
 # verify the 'promote' operation
 for ds in ${snap[*]} ${csnap[2]} ${c1snap[*]}; do
index e50595122239a5673d8c7947e97f45b64f79ab66..c669a44eb0961ac728a5345794ec3b67b48da715 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -42,13 +46,13 @@ verify_runnable "both"
 function cleanup
 {
        if datasetexists $fssnap ; then
-               datasetexists $clone && log_must $ZFS destroy $clone
-               log_must $ZFS destroy $fssnap
+               datasetexists $clone && log_must zfs destroy $clone
+               log_must zfs destroy $fssnap
        fi
        if datasetexists $clone ; then
-               log_must $ZFS promote $fs
-               log_must $ZFS destroy $clone
-               log_must $ZFS destroy $fssnap
+               log_must zfs promote $fs
+               log_must zfs destroy $clone
+               log_must zfs destroy $fssnap
        fi
 }
 
@@ -59,11 +63,11 @@ fs=$TESTPOOL/$TESTFS
 clone=$TESTPOOL/$TESTCLONE
 fssnap=$fs@fssnap
 
-log_must $ZFS snapshot $fssnap
-log_must $ZFS clone $fssnap $clone
-log_must $ZFS unmount $fs
-log_must $ZFS promote $clone
-log_must $ZFS unmount $clone
-log_must $ZFS promote $fs
+log_must zfs snapshot $fssnap
+log_must zfs clone $fssnap $clone
+log_must zfs unmount $fs
+log_must zfs promote $clone
+log_must zfs unmount $clone
+log_must zfs promote $fs
 
 log_pass "Unmount original fs, 'zfs promote' passed."
index 9c1fb3e96fba09b5b3917d1e0ad9e34c760a6635..ffe2c4356164290960f33c744c11630e26e8b331 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -54,7 +59,7 @@ set -A args "" \
 function cleanup
 {
        if datasetexists $clone; then
-               log_must $ZFS destroy $clone
+               log_must zfs destroy $clone
        fi
 
        if snapexists $snap; then
@@ -67,12 +72,12 @@ log_onexit cleanup
 
 snap=$TESTPOOL/$TESTFS@$TESTSNAP
 clone=$TESTPOOL/$TESTCLONE
-log_must $ZFS snapshot $snap
-log_must $ZFS clone $snap $clone
+log_must zfs snapshot $snap
+log_must zfs clone $snap $clone
 
 typeset -i i=0
 while (( i < ${#args[*]} )); do
-       log_mustnot $ZFS promote ${args[i]}
+       log_mustnot zfs promote ${args[i]}
 
        (( i = i + 1 ))
 done
index 83a523110529752d67d46e5691ee6246d33ed943..3f8ee1941ddea2f20c10784634629082d0d97d32 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cli_root/zfs_promote/zfs_promote.cfg
@@ -48,11 +48,11 @@ verify_runnable "both"
 function cleanup
 {
        snapexists $snap && \
-               log_must $ZFS destroy -rR $snap
+               log_must zfs destroy -rR $snap
 
        typeset data
        for data in $TESTDIR/$TESTFILE0 $TESTDIR/$TESTFILE1; do
-               [[ -e $data ]] && $RM -f $data
+               [[ -e $data ]] && rm -f $data
        done
 }
 
@@ -64,15 +64,15 @@ clone=$TESTPOOL/$TESTCLONE
 clonesnap=$TESTPOOL/$TESTCLONE@$TESTSNAP
 
 # setup for promte testing
-log_must $MKFILE $FILESIZE $TESTDIR/$TESTFILE0
-log_must $ZFS snapshot $snap
-log_must $MKFILE $FILESIZE $TESTDIR/$TESTFILE1
-log_must $RM -f $TESTDIR/$TESTFILE0
-log_must $ZFS clone $snap $clone
-log_must $MKFILE $FILESIZE /$clone/$CLONEFILE
-log_must $ZFS snapshot $clonesnap
+log_must mkfile $FILESIZE $TESTDIR/$TESTFILE0
+log_must zfs snapshot $snap
+log_must mkfile $FILESIZE $TESTDIR/$TESTFILE1
+log_must rm -f $TESTDIR/$TESTFILE0
+log_must zfs clone $snap $clone
+log_must mkfile $FILESIZE /$clone/$CLONEFILE
+log_must zfs snapshot $clonesnap
 
-log_mustnot $ZFS promote $clone
+log_mustnot zfs promote $clone
 
 log_pass "'zfs promote' deals with name conflicts as expected."
 
index e4e6aa601187cc9a4e6989f0a06eb767879665d4..05d482c405387a003036cb883c77ab2167d17919 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -41,10 +46,10 @@ verify_runnable "global"
 function cleanup
 {
        if snapexists $csnap; then
-               log_must $ZFS promote $vol
+               log_must zfs promote $vol
        fi
 
-       log_must $ZFS destroy -rR $snap
+       log_must zfs destroy -rR $snap
 }
 
 log_assert "'zfs promote' can promote a volume clone."
@@ -56,11 +61,11 @@ clone=$TESTPOOL/volclone
 csnap=$clone@$TESTSNAP
 
 if ! snapexists $snap ; then
-       log_must $ZFS snapshot $snap
-       log_must $ZFS clone $snap $clone
+       log_must zfs snapshot $snap
+       log_must zfs clone $snap $clone
 fi
 
-log_must $ZFS promote $clone
+log_must zfs promote $clone
 
 # verify the 'promote' operation
 ! snapexists $csnap && \
index 23763608efbb7e1e13bf46cf0a70199a569cca35..6d6365ddb001421a0e55e6d7be1da749a7b77e52 100755 (executable)
@@ -11,7 +11,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 #
@@ -36,7 +36,7 @@
 function cleanup
 {
        for ds in $datasets; do
-               datasetexists $ds && log_must $ZFS destroy -R $TESTPOOL/$TESTFS1
+               datasetexists $ds && log_must zfs destroy -R $TESTPOOL/$TESTFS1
        done
 }
 function get_prop_mb
@@ -45,7 +45,7 @@ function get_prop_mb
        typeset dataset=$2
        typeset -l value=$(get_prop $prop $dataset)
        ((value = value / mb_block))
-       $ECHO $value
+       echo $value
 }
 
 datasets="$TESTPOOL/$TESTFS1 $TESTPOOL/$TESTFS1/$TESTFS2 \
@@ -67,13 +67,13 @@ typeset -l mb_block=0
 ((mb_block = 1024 * 1024))
 
 log_note "verify written property statistics for dataset"
-log_must $ZFS create -p $TESTPOOL/$TESTFS1/$TESTFS2/$TESTFS3
+log_must zfs create -p $TESTPOOL/$TESTFS1/$TESTFS2/$TESTFS3
 for i in 1 2 3; do
-       log_must $ZFS snapshot $TESTPOOL/$TESTFS1@snap$i
-       log_must $DD if=/dev/urandom of=/$TESTPOOL/$TESTFS1/testfile.$i bs=1M \
+       log_must zfs snapshot $TESTPOOL/$TESTFS1@snap$i
+       log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS1/testfile.$i bs=1M \
            count=$blocks
-       log_must $SYNC
-       log_must $SLEEP 10
+       log_must sync
+       log_must sleep 10
        written=$(get_prop written $TESTPOOL/$TESTFS1)
        ((expected_written=blocks * mb_block))
        within_percent $written $expected_written 99.5 || \
@@ -115,10 +115,10 @@ for i in 1 2 3; do
 done
 log_note "delete data"
 before_written=$(get_prop written $TESTPOOL/$TESTFS1)
-log_must $RM /$TESTPOOL/$TESTFS1/testfile.3
+log_must rm /$TESTPOOL/$TESTFS1/testfile.3
 snap3_size=0
-log_must $SYNC
-log_must $SLEEP 10
+log_must sync
+log_must sleep 10
 written=$(get_prop written $TESTPOOL/$TESTFS1)
 writtenat3=$(get_prop written@snap3 $TESTPOOL/$TESTFS1)
 [[ $written -eq $writtenat3 ]] || \
@@ -138,10 +138,10 @@ within_percent $writtenat $expected_writtenat 99.5 || \
 
 log_note "write data"
 blocks=20
-log_must $DD if=/dev/urandom of=/$TESTPOOL/$TESTFS1/testfile.3 bs=1M \
+log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS1/testfile.3 bs=1M \
     count=$blocks
-log_must $SYNC
-log_must $SLEEP 10
+log_must sync
+log_must sleep 10
 written=$(get_prop written $TESTPOOL/$TESTFS1)
 writtenat1=$(get_prop written@snap1 $TESTPOOL/$TESTFS1)
 writtenat2=$(get_prop written@snap2 $TESTPOOL/$TESTFS1)
@@ -163,8 +163,8 @@ within_percent $writtenat1 $expected_writtenat 99.5 || \
 
 log_note "write data to a clone"
 before_clone=$(get_prop written $TESTPOOL/$TESTFS1)
-log_must $ZFS clone $TESTPOOL/$TESTFS1@snap1 $TESTPOOL/$TESTFS1/snap1.clone
-log_must $DD if=/dev/urandom of=/$TESTPOOL/$TESTFS1/snap1.clone/testfile bs=1M \
+log_must zfs clone $TESTPOOL/$TESTFS1@snap1 $TESTPOOL/$TESTFS1/snap1.clone
+log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS1/snap1.clone/testfile bs=1M \
     count=40
 after_clone=$(get_prop written $TESTPOOL/$TESTFS1)
 [[ $before_clone -eq $after_clone ]] || \
@@ -175,10 +175,10 @@ typeset -l before_written1=$(get_prop_mb written@snap1 $TESTPOOL/$TESTFS1)
 typeset -l before_written3=$(get_prop_mb written@snap3 $TESTPOOL/$TESTFS1)
 typeset -l snap_before_written2=$(get_prop_mb written $TESTPOOL/$TESTFS1@snap2)
 typeset -l snap_before_written3=$(get_prop_mb written $TESTPOOL/$TESTFS1@snap3)
-log_must $ZFS destroy $TESTPOOL/$TESTFS1@snap2
+log_must zfs destroy $TESTPOOL/$TESTFS1@snap2
 log_mustnot snapexists $TESTPOOL/$TESTFS1@snap2
-log_must $SYNC
-log_must $SLEEP 10
+log_must sync
+log_must sleep 10
 written1=$(get_prop_mb written@snap1 $TESTPOOL/$TESTFS1)
 written3=$(get_prop_mb written@snap3 $TESTPOOL/$TESTFS1)
 [[ $before_written1 -eq $written1 && $before_written3 -eq $written3 ]] || \
@@ -189,7 +189,7 @@ prev_written=$(get_prop_mb written $TESTPOOL/$TESTFS1@snap3)
 within_percent $prev_written $expected_written3 99.5 || \
     log_fail "unexpected written value $prev_written $expected_written3"
 
-log_must $ZFS destroy $TESTPOOL/$TESTFS1@snap3
+log_must zfs destroy $TESTPOOL/$TESTFS1@snap3
 log_mustnot snapexists $TESTPOOL/$TESTFS1@snap3
 written=$(get_prop written $TESTPOOL/$TESTFS1)
 writtenat1=$(get_prop written@snap1 $TESTPOOL/$TESTFS1)
@@ -198,14 +198,14 @@ writtenat1=$(get_prop written@snap1 $TESTPOOL/$TESTFS1)
 
 log_note "verify written@ property for recursive datasets"
 blocks=10
-log_must $ZFS snapshot -r $TESTPOOL/$TESTFS1@now
+log_must zfs snapshot -r $TESTPOOL/$TESTFS1@now
 for ds in $datasets; do
        writtenat=$(get_prop written@now $ds)
        [[ $writtenat -ne 0 ]] && \
            log_fail "Unexpected written@ value"
-       log_must $DD if=/dev/urandom of=/$ds/testfile bs=1M count=$blocks
-       log_must $SYNC
-       log_must $SLEEP 10
+       log_must dd if=/dev/urandom of=/$ds/testfile bs=1M count=$blocks
+       log_must sync
+       log_must sleep 10
        writtenat=$(get_prop written@now $ds)
        ((expected_writtenat = blocks * mb_block))
        within_percent $writtenat $expected_writtenat 0.1 || \
@@ -216,19 +216,19 @@ done
 log_note "verify written@ output for recursive datasets"
 blocks=20
 for ds in $datasets; do
-       log_must $ZFS snapshot $ds@current
-       log_must $DD if=/dev/urandom of=/$ds/testfile bs=1M \
+       log_must zfs snapshot $ds@current
+       log_must dd if=/dev/urandom of=/$ds/testfile bs=1M \
            count=$blocks
-       log_must $SYNC
-       log_must $SLEEP 10
+       log_must sync
+       log_must sleep 10
 done
-recursive_output=$($ZFS get -r written@current $TESTPOOL | \
-    $GREP -v $TESTFS1@ | $GREP -v $TESTFS2@ | $GREP -v $TESTFS3@ | \
-    $GREP -v "VALUE" | $GREP -v "-")
+recursive_output=$(zfs get -r written@current $TESTPOOL | \
+    grep -v $TESTFS1@ | grep -v $TESTFS2@ | grep -v $TESTFS3@ | \
+    grep -v "VALUE" | grep -v "-")
 expected="20.0M"
 for ds in $datasets; do
-       writtenat=$($ECHO "$recursive_output" | $GREP -v $ds/)
-       writtenat=$($ECHO "$writtenat" | $GREP $ds | $AWK '{print $3}')
+       writtenat=$(echo "$recursive_output" | grep -v $ds/)
+       writtenat=$(echo "$writtenat" | grep $ds | awk '{print $3}')
        [[ $writtenat == $expected ]] || \
            log_fail "recursive written property output mismatch"
 done
index 288372a6e01667b8fe7d1a14186bde6ded7a77ee..96cc0aae81af7138f5f35fb3781f444d125b40a4 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cli_root/cli_common.kshlib
@@ -49,27 +49,27 @@ function cleanup
        typeset -i i=0
 
        datasetexists $rst_root && \
-               log_must $ZFS destroy -Rf $rst_root
+               log_must zfs destroy -Rf $rst_root
        while (( i < 2 )); do
                snapexists ${orig_snap[$i]} && \
-                       log_must $ZFS destroy -f ${orig_snap[$i]}
-               log_must $RM -f ${bkup[$i]}
+                       log_must zfs destroy -f ${orig_snap[$i]}
+               log_must rm -f ${bkup[$i]}
 
                (( i = i + 1 ))
        done
 
-       log_must $RM -rf $TESTDIR1
+       log_must rm -rf $TESTDIR1
 }
 
 function recreate_root
 {
        datasetexists $rst_root && \
-               log_must $ZFS destroy -Rf $rst_root
+               log_must zfs destroy -Rf $rst_root
        if [[ -d $TESTDIR1 ]] ; then
-               log_must $RM -rf $TESTDIR1
+               log_must rm -rf $TESTDIR1
        fi
-       log_must $ZFS create $rst_root
-       log_must $ZFS set mountpoint=$TESTDIR1 $rst_root
+       log_must zfs create $rst_root
+       log_must zfs set mountpoint=$TESTDIR1 $rst_root
 }
 
 log_assert "Verifying 'zfs receive [<filesystem|snapshot>] -d <filesystem>' works."
@@ -108,15 +108,15 @@ for orig_fs in $datasets ; do
 
        typeset -i i=0
        while (( i < ${#orig_snap[*]} )); do
-               $FILE_WRITE -o create -f ${orig_data[$i]} -b 512 \
+               file_write -o create -f ${orig_data[$i]} -b 512 \
                    -c 8 >/dev/null 2>&1
                (( $? != 0 )) && \
                        log_fail "Writing data into zfs filesystem fails."
-               log_must $ZFS snapshot ${orig_snap[$i]}
+               log_must zfs snapshot ${orig_snap[$i]}
                if (( i < 1 )); then
-                       log_must eval "$ZFS send ${orig_snap[$i]} > ${bkup[$i]}"
+                       log_must eval "zfs send ${orig_snap[$i]} > ${bkup[$i]}"
                else
-                       log_must eval "$ZFS send -i ${orig_snap[(( i - 1 ))]} \
+                       log_must eval "zfs send -i ${orig_snap[(( i - 1 ))]} \
                                ${orig_snap[$i]} > ${bkup[$i]}"
                fi
 
@@ -127,9 +127,9 @@ for orig_fs in $datasets ; do
        i=0
        while (( i < ${#bkup[*]} )); do
                if (( i > 0 )); then
-                       log_must $ZFS rollback ${rst_snap[0]}
+                       log_must zfs rollback ${rst_snap[0]}
                fi
-               log_must eval "$ZFS receive $rst_fs < ${bkup[$i]}"
+               log_must eval "zfs receive $rst_fs < ${bkup[$i]}"
                snapexists ${rst_snap[$i]} || \
                        log_fail "Restoring filesystem fails. ${rst_snap[$i]} not exist"
                compare_cksum ${orig_data[$i]} ${rst_data[$i]}
@@ -137,15 +137,15 @@ for orig_fs in $datasets ; do
                (( i = i + 1 ))
        done
 
-       log_must $ZFS destroy -Rf $rst_fs
+       log_must zfs destroy -Rf $rst_fs
 
        log_note "Verifying 'zfs receive <snapshot>' works."
        i=0
        while (( i < ${#bkup[*]} )); do
                if (( i > 0 )); then
-                       log_must $ZFS rollback ${rst_snap[0]}
+                       log_must zfs rollback ${rst_snap[0]}
                fi
-               log_must eval "$ZFS receive ${rst_snap[$i]} <${bkup[$i]}"
+               log_must eval "zfs receive ${rst_snap[$i]} <${bkup[$i]}"
                snapexists ${rst_snap[$i]} || \
                        log_fail "Restoring filesystem fails. ${rst_snap[$i]} not exist"
                compare_cksum ${orig_data[$i]} ${rst_data[$i]}
@@ -153,16 +153,16 @@ for orig_fs in $datasets ; do
                (( i = i + 1 ))
        done
 
-       log_must $ZFS destroy -Rf $rst_fs
+       log_must zfs destroy -Rf $rst_fs
 
        log_note "Verfiying 'zfs receive -d <filesystem>' works."
 
        i=0
        while (( i < ${#bkup[*]} )); do
                if (( i > 0 )); then
-                       log_must $ZFS rollback ${rst_snap2[0]}
+                       log_must zfs rollback ${rst_snap2[0]}
                fi
-               log_must eval "$ZFS receive -d -F $rst_root <${bkup[$i]}"
+               log_must eval "zfs receive -d -F $rst_root <${bkup[$i]}"
                snapexists ${rst_snap2[$i]} || \
                        log_fail "Restoring filesystem fails. ${rst_snap2[$i]} not exist"
                compare_cksum ${orig_data[$i]} ${rst_data2[$i]}
index 27f9ae2e2e70820b790cc85c06049309c19a6ca0..e33112ea15500c4b4b7ce0993d34149ab3628ecb 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/cli_common.kshlib
 
 #
@@ -47,18 +51,18 @@ function cleanup
 
        while (( i < ${#orig_snap[*]} )); do
                snapexists ${rst_snap[$i]} && \
-                       log_must $ZFS destroy -f ${rst_snap[$i]}
+                       log_must zfs destroy -f ${rst_snap[$i]}
                snapexists ${orig_snap[$i]} && \
-                       log_must $ZFS destroy -f ${orig_snap[$i]}
+                       log_must zfs destroy -f ${orig_snap[$i]}
                [[ -e ${bkup[$i]} ]] && \
-                       log_must $RM -rf ${bkup[$i]}
+                       log_must rm -rf ${bkup[$i]}
 
                (( i = i + 1 ))
        done
 
        for ds in $rst_vol $rst_root; do
                datasetexists $ds && \
-                       log_must $ZFS destroy -Rf $ds
+                       log_must zfs destroy -Rf $ds
        done
 }
 
@@ -74,18 +78,18 @@ set -A rst_snap "${rst_vol}@init_snap" "${rst_vol}@inc_snap"
 #
 # Preparations for testing
 #
-log_must $ZFS create $rst_root
+log_must zfs create $rst_root
 [[ ! -d $TESTDIR1 ]] && \
-       log_must $MKDIR -p $TESTDIR1
-log_must $ZFS set mountpoint=$TESTDIR1 $rst_root
+       log_must mkdir -p $TESTDIR1
+log_must zfs set mountpoint=$TESTDIR1 $rst_root
 
 typeset -i i=0
 while (( i < ${#orig_snap[*]} )); do
-       log_must $ZFS snapshot ${orig_snap[$i]}
+       log_must zfs snapshot ${orig_snap[$i]}
        if (( i < 1 )); then
-               log_must eval "$ZFS send ${orig_snap[$i]} > ${bkup[$i]}"
+               log_must eval "zfs send ${orig_snap[$i]} > ${bkup[$i]}"
        else
-               log_must eval "$ZFS send -i ${orig_snap[(( i - 1 ))]} \
+               log_must eval "zfs send -i ${orig_snap[(( i - 1 ))]} \
                                ${orig_snap[$i]} > ${bkup[$i]}"
        fi
 
@@ -94,7 +98,7 @@ done
 
 i=0
 while (( i < ${#bkup[*]} )); do
-       log_must eval "$ZFS receive $rst_vol < ${bkup[$i]}"
+       log_must eval "zfs receive $rst_vol < ${bkup[$i]}"
        ! datasetexists $rst_vol || ! snapexists ${rst_snap[$i]} && \
                log_fail "Restoring volume fails."
 
index e7d4bf4a16cc0a9b50191a196ca03ee89813d06c..a6935acc7b01a75e45b2c21b97adce72fc0740c6 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -45,10 +49,10 @@ verify_runnable "both"
 function cleanup
 {
        for snap in $snap2 $snap1; do
-               datasetexists $snap && log_must $ZFS destroy -rf $snap
+               datasetexists $snap && log_must zfs destroy -rf $snap
        done
        for file in $ibackup $mntpnt/file1 $mntpnt/file2; do
-               [[ -f $file ]] && log_must $RM -f $file
+               [[ -f $file ]] && log_must rm -f $file
        done
 }
 
@@ -59,31 +63,31 @@ ibackup=/var/tmp/ibackup.$$
 fs=$TESTPOOL/$TESTFS; snap1=$fs@snap1; snap2=$fs@snap2
 
 mntpnt=$(get_prop mountpoint $fs) || log_fail "get_prop mountpoint $fs"
-log_must $MKFILE 10m $mntpnt/file1
-log_must $ZFS snapshot $snap1
-log_must $MKFILE 10m $mntpnt/file2
-log_must $ZFS snapshot $snap2
+log_must mkfile 10m $mntpnt/file1
+log_must zfs snapshot $snap1
+log_must mkfile 10m $mntpnt/file2
+log_must zfs snapshot $snap2
 
-log_must eval "$ZFS send -i $snap1 $snap2 > $ibackup"
+log_must eval "zfs send -i $snap1 $snap2 > $ibackup"
 
 log_note "Verify 'zfs receive' succeed, if filesystem was not modified."
-log_must $ZFS rollback -r $snap1
-log_must eval "$ZFS receive $fs < $ibackup"
+log_must zfs rollback -r $snap1
+log_must eval "zfs receive $fs < $ibackup"
 if [[ ! -f $mntpnt/file1 || ! -f $mntpnt/file2 ]]; then
-       log_fail "'$ZFS receive' failed."
+       log_fail "'zfs receive' failed."
 fi
 
 log_note "Verify 'zfs receive' failed if filesystem was modified."
-log_must $ZFS rollback -r $snap1
-log_must $RM -rf $mntpnt/file1
-log_mustnot eval "$ZFS receive $fs < $ibackup"
+log_must zfs rollback -r $snap1
+log_must rm -rf $mntpnt/file1
+log_mustnot eval "zfs receive $fs < $ibackup"
 
 # Verify 'zfs receive -F' to force rollback whatever filesystem was modified.
-log_must $ZFS rollback -r $snap1
-log_must $RM -rf $mntpnt/file1
-log_must eval "$ZFS receive -F $fs < $ibackup"
+log_must zfs rollback -r $snap1
+log_must rm -rf $mntpnt/file1
+log_must eval "zfs receive -F $fs < $ibackup"
 if [[ ! -f $mntpnt/file1 || ! -f $mntpnt/file2 ]]; then
-       log_fail "'$ZFS receive -F' failed."
+       log_fail "'zfs receive -F' failed."
 fi
 
 log_pass "'zfs recv -F' to force rollback passed."
index 7f1c053ac55ab503902ccbfa66270839f0329564..ad73c585acf33098f8c10f6f5b0c3b78292813f4 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cli_root/cli_common.kshlib
@@ -50,12 +50,12 @@ function cleanup
 
        for snap in $init_snap $inc_snap $init_topsnap $inc_topsnap ; do
                snapexists $snap && \
-                       log_must $ZFS destroy -Rf $snap
+                       log_must zfs destroy -Rf $snap
        done
 
        for bkup in $full_bkup $inc_bkup $full_topbkup $inc_topbkup; do
                [[ -e $bkup ]] && \
-                       log_must $RM -f $bkup
+                       log_must rm -f $bkup
        done
 }
 
@@ -72,23 +72,23 @@ inc_topsnap=$TESTPOOL@incsnap
 full_topbkup=/var/tmp/full_topbkup.$$
 inc_topbkup=/var/tmp/inc_topbkup.$$
 
-log_must $ZFS snapshot $init_topsnap
-log_must eval "$ZFS send $init_topsnap > $full_topbkup"
-log_must $TOUCH /$TESTPOOL/foo
+log_must zfs snapshot $init_topsnap
+log_must eval "zfs send $init_topsnap > $full_topbkup"
+log_must touch /$TESTPOOL/foo
 
-log_must $ZFS snapshot $inc_topsnap
-log_must eval "$ZFS send -i $init_topsnap $inc_topsnap > $inc_topbkup"
-log_must $TOUCH /$TESTPOOL/bar
+log_must zfs snapshot $inc_topsnap
+log_must eval "zfs send -i $init_topsnap $inc_topsnap > $inc_topbkup"
+log_must touch /$TESTPOOL/bar
 
-log_must $ZFS snapshot $init_snap
-log_must eval "$ZFS send $init_snap > $full_bkup"
-log_must $TOUCH /$TESTDIR/foo
+log_must zfs snapshot $init_snap
+log_must eval "zfs send $init_snap > $full_bkup"
+log_must touch /$TESTDIR/foo
 
-log_must $ZFS snapshot $inc_snap
-log_must eval "$ZFS send -i $init_snap $inc_snap > $inc_bkup"
-log_must $TOUCH /$TESTDIR/bar
+log_must zfs snapshot $inc_snap
+log_must eval "zfs send -i $init_snap $inc_snap > $inc_bkup"
+log_must touch /$TESTDIR/bar
 
-$SYNC
+sync
 
 set -A badargs \
     "" "nonexistent-snap" "blah@blah" "-d" "-d nonexistent-dataset" \
@@ -106,7 +106,7 @@ typeset -i i=0
 while (( i < ${#badargs[*]} ))
 do
        for bkup in $full_bkup $inc_bkup $full_topbkup $inc_topbkup ; do
-               log_mustnot eval "$ZFS receive ${badargs[i]} < $bkup"
+               log_mustnot eval "zfs receive ${badargs[i]} < $bkup"
        done
 
        (( i = i + 1 ))
index 86bd9441ce9123595cd91afca2cb76bcc6b4a554..17d9be911469d1690cf2f8b19104fbfe2bae6d11 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/cli_common.kshlib
 
 #
@@ -50,15 +54,15 @@ function cleanup
 
        for snap in $init_snap $inc_snap; do
                snapexists $snap && \
-                       log_must $ZFS destroy -f $snap
+                       log_must zfs destroy -f $snap
        done
 
        datasetexists $rst_root && \
-               log_must $ZFS destroy -Rf $rst_root
+               log_must zfs destroy -Rf $rst_root
 
        for bkup in $full_bkup $inc_bkup; do
                [[ -e $bkup ]] && \
-                       log_must $RM -f $bkup
+                       log_must rm -f $bkup
        done
 }
 
@@ -73,23 +77,23 @@ rst_inc_snap=$rst_root/$TESTFS@inc_snap
 full_bkup=/var/tmp/full_bkup.$$
 inc_bkup=/var/tmp/inc_bkup.$$
 
-log_must $ZFS create $rst_root
-log_must $ZFS snapshot $init_snap
-log_must eval "$ZFS send $init_snap > $full_bkup"
+log_must zfs create $rst_root
+log_must zfs snapshot $init_snap
+log_must eval "zfs send $init_snap > $full_bkup"
 
 log_note "'zfs receive' fails with invalid send streams."
-log_mustnot eval "$ZFS receive $rst_init_snap < /dev/zero"
-log_mustnot eval "$ZFS receive -d $rst_root </dev/zero"
+log_mustnot eval "zfs receive $rst_init_snap < /dev/zero"
+log_mustnot eval "zfs receive -d $rst_root </dev/zero"
 
-log_must eval "$ZFS receive $rst_init_snap < $full_bkup"
+log_must eval "zfs receive $rst_init_snap < $full_bkup"
 
 log_note "Unmatched send stream with restoring filesystem" \
        " cannot be received."
-log_must $ZFS snapshot $inc_snap
-log_must eval "$ZFS send -i $init_snap $inc_snap > $inc_bkup"
+log_must zfs snapshot $inc_snap
+log_must eval "zfs send -i $init_snap $inc_snap > $inc_bkup"
 #make changes on the restoring filesystem
-log_must $TOUCH $ZFSROOT/$rst_root/$TESTFS/tmpfile
-log_mustnot eval "$ZFS receive $rst_inc_snap < $inc_bkup"
-log_mustnot eval "$ZFS receive -d $rst_root < $inc_bkup"
+log_must touch $ZFSROOT/$rst_root/$TESTFS/tmpfile
+log_mustnot eval "zfs receive $rst_inc_snap < $inc_bkup"
+log_mustnot eval "zfs receive -d $rst_root < $inc_bkup"
 
 log_pass "Unsupported scenarios to 'zfs receive' fail as expected."
index 8f973b10683b971bdb917cf1e7009af102fd9cca..eeeea4e9b29598ecfeb57a972c78d6c059ed6801 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -47,18 +51,18 @@ verify_runnable "both"
 function cleanup
 {
        for snap in $snap2 $snap1; do
-               datasetexists $snap && log_must $ZFS destroy -rf $snap
+               datasetexists $snap && log_must zfs destroy -rf $snap
        done
        for file in $fbackup1 $fbackup2 $mntpnt/file1 $mntpnt/file2; do
-               [[ -f $file ]] && log_must $RM -f $file
+               [[ -f $file ]] && log_must rm -f $file
        done
 
        if is_global_zone; then
                datasetexists $TESTPOOL/$TESTFS/$TESTFS1 && \
-                       log_must $ZFS destroy -rf $TESTPOOL/$TESTFS/$TESTFS1
+                       log_must zfs destroy -rf $TESTPOOL/$TESTFS/$TESTFS1
        else
                datasetexists $TESTPOOL/${ZONE_CTR}0 && \
-                       log_must $ZFS destroy -rf $TESTPOOL/${ZONE_CTR}0
+                       log_must zfs destroy -rf $TESTPOOL/${ZONE_CTR}0
        fi
 
 }
@@ -75,30 +79,30 @@ fbackup1=/var/tmp/fbackup1.$$
 fbackup2=/var/tmp/fbackup2.$$
 
 datasetexists $ancestor_fs || \
-       log_must $ZFS create $ancestor_fs
-log_must $ZFS create $fs
+       log_must zfs create $ancestor_fs
+log_must zfs create $fs
 
 mntpnt=$(get_prop mountpoint $fs) || log_fail "get_prop mountpoint $fs"
-log_must $MKFILE 10m $mntpnt/file1
-log_must $ZFS snapshot $snap1
-log_must $MKFILE 10m $mntpnt/file2
-log_must $ZFS snapshot $snap2
+log_must mkfile 10m $mntpnt/file1
+log_must zfs snapshot $snap1
+log_must mkfile 10m $mntpnt/file2
+log_must zfs snapshot $snap2
 
-log_must eval "$ZFS send $snap1 > $fbackup1"
-log_must eval "$ZFS send $snap2 > $fbackup2"
+log_must eval "zfs send $snap1 > $fbackup1"
+log_must eval "zfs send $snap2 > $fbackup2"
 
 log_note "Verify 'zfs receive -d' succeed and create ancestor filesystem \
         if it did not exist. "
-log_must $ZFS destroy -rf $ancestor_fs
-log_must eval "$ZFS receive -d $TESTPOOL < $fbackup1"
+log_must zfs destroy -rf $ancestor_fs
+log_must eval "zfs receive -d $TESTPOOL < $fbackup1"
 is_global_zone || ancestor_fs=$TESTPOOL/${ZONE_CTR}0/$TESTFS
 datasetexists $ancestor_fs || \
        log_fail "ancestor filesystem is not created"
 
 log_note "Verify 'zfs receive -d' still succeed if ancestor filesystem exists"
 is_global_zone || fs=$TESTPOOL/${ZONE_CTR}0/$TESTFS/$TESTFS1
-log_must $ZFS destroy -rf $fs
-log_must eval "$ZFS receive -d $TESTPOOL < $fbackup2"
+log_must zfs destroy -rf $fs
+log_must eval "zfs receive -d $TESTPOOL < $fbackup2"
 
 log_pass "'zfs recv -d <fs>' should succeed no matter ancestor filesystem \
        exists."
index b2f6dc673dafabd4b19025e2542bdb4568971c18..b7b92800d5ba3a8a72cb7ab96e30f30cbecd8e49 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -43,10 +47,10 @@ verify_runnable "both"
 function cleanup
 {
        for snap in $snap2 $snap1; do
-               datasetexists $snap && log_must $ZFS destroy -rf $snap
+               datasetexists $snap && log_must zfs destroy -rf $snap
        done
        for file in $ibackup $mntpnt/file1 $mntpnt/file2; do
-               [[ -f $file ]] && log_must $RM -f $file
+               [[ -f $file ]] && log_must rm -f $file
        done
 }
 
@@ -58,23 +62,23 @@ snap1=$fs@snap1
 snap2=$fs@snap2
 ibackup=/var/tmp/ibackup.$$
 
-datasetexists $fs || log_must $ZFS create $fs
+datasetexists $fs || log_must zfs create $fs
 
 mntpnt=$(get_prop mountpoint $fs) || log_fail "get_prop mountpoint $fs"
-log_must $MKFILE 10m $mntpnt/file1
-log_must $ZFS snapshot $snap1
-log_must $MKFILE 10m $mntpnt/file2
-log_must $ZFS snapshot $snap2
+log_must mkfile 10m $mntpnt/file1
+log_must zfs snapshot $snap1
+log_must mkfile 10m $mntpnt/file2
+log_must zfs snapshot $snap2
 
-log_must eval "$ZFS send -i $snap1 $snap2 > $ibackup"
+log_must eval "zfs send -i $snap1 $snap2 > $ibackup"
 
-log_must $ZFS destroy $snap1
-log_must $ZFS destroy $snap2
-log_mustnot eval "$ZFS receive -F $fs < $ibackup"
+log_must zfs destroy $snap1
+log_must zfs destroy $snap2
+log_mustnot eval "zfs receive -F $fs < $ibackup"
 
-log_must $MKFILE 20m $mntpnt/file1
-log_must $RM -rf $mntpnt/file2
-log_must $ZFS snapshot $snap1
-log_mustnot eval "$ZFS receive -F $snap2 < $ibackup"
+log_must mkfile 20m $mntpnt/file1
+log_must rm -rf $mntpnt/file2
+log_must zfs snapshot $snap1
+log_mustnot eval "zfs receive -F $snap2 < $ibackup"
 
 log_pass "'zfs recv -F' should fail if the incremental stream does not match"
index 6d9081e9f9a007e8e1ce001b87b4b6480d71f601..82fceeab22f683fab1218085469dd1efc1b215a0 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/cli_common.kshlib
 
 #
@@ -44,20 +48,20 @@ function cleanup
 {
        for dset in $rst_snap $rst_fs $orig_snap; do
                if datasetexists $dset; then
-                       log_must $ZFS destroy -fr $dset
+                       log_must zfs destroy -fr $dset
                fi
        done
 
        for file in $fbackup $mnt_file $tmp_out; do
                if [[ -f $file ]]; then
-                       log_must $RM -f $file
+                       log_must rm -f $file
                fi
        done
 
        if datasetexists $TESTPOOL/$TESTFS; then
-               log_must $ZFS destroy -Rf $TESTPOOL/$TESTFS
-               log_must $ZFS create $TESTPOOL/$TESTFS
-               log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+               log_must zfs destroy -Rf $TESTPOOL/$TESTFS
+               log_must zfs create $TESTPOOL/$TESTFS
+               log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
        fi
 }
 
@@ -79,7 +83,7 @@ for orig_fs in $datasets ; do
        typeset dryrun_msg="would receive full stream of ${orig_snap} into ${rst_snap}"
 
        if ! datasetexists $orig_fs; then
-               log_must $ZFS create $orig_fs
+               log_must zfs create $orig_fs
        fi
 
        typeset mntpnt
@@ -90,24 +94,24 @@ for orig_fs in $datasets ; do
 
        typeset mnt_file=$mntpnt/file1
 
-       log_must $MKFILE 100m $mnt_file
-       log_must $ZFS snapshot $orig_snap
-       log_must eval "$ZFS send $orig_snap > $fbackup"
+       log_must mkfile 100m $mnt_file
+       log_must zfs snapshot $orig_snap
+       log_must eval "zfs send $orig_snap > $fbackup"
 
        for opt in "-v"  "-vn"; do
                if datasetexists $rst_fs; then
-                       log_must $ZFS destroy -fr $rst_fs
+                       log_must zfs destroy -fr $rst_fs
                fi
                log_note "Check ZFS receive $opt [<filesystem|snapshot>]"
-               log_must eval "$ZFS receive $opt $rst_fs < $fbackup > $tmp_out 2>&1"
+               log_must eval "zfs receive $opt $rst_fs < $fbackup > $tmp_out 2>&1"
                if [[ $opt == "-v" ]]; then
-                       log_must eval "$GREP \"$verb_msg\" $tmp_out >/dev/null 2>&1"
+                       log_must eval "grep \"$verb_msg\" $tmp_out >/dev/null 2>&1"
                        if ! datasetexists $rst_snap; then
                                log_fail "dataset was not received, even though the"\
                                        " -v flag was used."
                        fi
                else
-                       log_must eval "$GREP \"$dryrun_msg\" $tmp_out >/dev/null 2>&1"
+                       log_must eval "grep \"$dryrun_msg\" $tmp_out >/dev/null 2>&1"
                        if datasetexists $rst_snap; then
                                log_fail "dataset was received, even though the -nv"\
                                        " flag was used."
@@ -117,9 +121,9 @@ for orig_fs in $datasets ; do
 
        log_note "Check ZFS receive -vn -d <filesystem>"
        if ! datasetexists $rst_fs; then
-               log_must $ZFS create $rst_fs
+               log_must zfs create $rst_fs
        fi
-       log_must eval "$ZFS receive -vn -d -F $rst_fs <$fbackup >$tmp_out 2>&1"
+       log_must eval "zfs receive -vn -d -F $rst_fs <$fbackup >$tmp_out 2>&1"
        typeset relative_path=""
        if [[ ${orig_fs} == *"/"* ]]; then
                relative_path=${orig_fs#*/}
@@ -130,12 +134,12 @@ for orig_fs in $datasets ; do
        rst_snap=${leaf_fs}@snap
        dryrun_msg="would receive full stream of ${orig_snap} into ${rst_snap}"
 
-       log_must eval "$GREP \"$dryrun_msg\" $tmp_out > /dev/null 2>&1"
+       log_must eval "grep \"$dryrun_msg\" $tmp_out > /dev/null 2>&1"
 
        if datasetexists $rst_snap; then
                log_fail "dataset $rst_snap should not existed."
        fi
-       log_must $ZFS destroy -Rf $rst_fs
+       log_must zfs destroy -Rf $rst_fs
 
        cleanup
 done
index 8d4b89b4845720d4955bb4f909a634e9e6b9f949..d028acafada0adcce0e804bf6b714830927f69f6 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/cli_common.kshlib
 
 #
@@ -45,15 +49,15 @@ function cleanup
        typeset ds
 
        if snapexists $snap; then
-               log_must $ZFS destroy $snap
+               log_must zfs destroy $snap
        fi
        for ds in $ctr1 $ctr2 $fs1; do
                if datasetexists $ds; then
-                       log_must $ZFS destroy -rf $ds
+                       log_must zfs destroy -rf $ds
                fi
        done
        if [[ -d $TESTDIR2 ]]; then
-               $RM -rf $TESTDIR2
+               rm -rf $TESTDIR2
        fi
 }
 
@@ -74,28 +78,28 @@ bkup=$TESTDIR2/bkup.$$
 
 # Preparations for negative testing
 for ctr in $ctr1 $ctr2; do
-       log_must $ZFS create $ctr
+       log_must zfs create $ctr
 done
 if [[ -d $TESTDIR2 ]]; then
-       $RM -rf $TESTDIR2
+       rm -rf $TESTDIR2
 fi
-log_must $ZFS create -o mountpoint=$TESTDIR2 $fs1
-log_must $ZFS snapshot $snap
-log_must eval "$ZFS send $snap > $bkup"
+log_must zfs create -o mountpoint=$TESTDIR2 $fs1
+log_must zfs snapshot $snap
+log_must eval "zfs send $snap > $bkup"
 
 #Testing zfs receive fails with input from terminal
-log_mustnot eval "$ZFS recv $fs3 </dev/console"
+log_mustnot eval "zfs recv $fs3 </dev/console"
 
 # Testing with missing argument and too many arguments
 typeset -i i=0
 while (( i < ${#validopts[*]} )); do
-       log_mustnot eval "$ZFS recv < $bkup"
+       log_mustnot eval "zfs recv < $bkup"
 
-       $ECHO ${validopts[i]} | $GREP "d" >/dev/null 2>&1
+       echo ${validopts[i]} | grep "d" >/dev/null 2>&1
        if (( $? != 0 )); then
-               log_mustnot eval "$ZFS recv ${validopts[i]} $fs2 $fs3 < $bkup"
+               log_mustnot eval "zfs recv ${validopts[i]} $fs2 $fs3 < $bkup"
        else
-               log_mustnot eval "$ZFS recv ${validopts[i]} $ctr1 $ctr2 < $bkup"
+               log_mustnot eval "zfs recv ${validopts[i]} $ctr1 $ctr2 < $bkup"
        fi
 
        (( i += 1 ))
@@ -105,8 +109,8 @@ done
 i=0
 while (( i < ${#badopts[*]} ))
 do
-       log_mustnot eval "$ZFS recv ${badopts[i]} $ctr1 < $bkup"
-       log_mustnot eval "$ZFS recv ${badopts[i]} $fs2 < $bkup"
+       log_mustnot eval "zfs recv ${badopts[i]} $ctr1 < $bkup"
+       log_mustnot eval "zfs recv ${badopts[i]} $fs2 < $bkup"
 
        (( i = i + 1 ))
 done
index 511463f3312fdf14566f31069d1fc71b40c19b21..1be4799d948ef892f60c0b11b901a2a6a034832f 100755 (executable)
@@ -51,15 +51,15 @@ function make_object
        local mntpnt=$2
        local type=$3
        if [[ $type == "file" ]]; then
-               $DD if=/dev/urandom of=${mntpnt}/f$objnum bs=512 count=16
+               dd if=/dev/urandom of=${mntpnt}/f$objnum bs=512 count=16
        elif [[ $type == "hole1" ]]; then
-               $DD if=/dev/urandom of=${mntpnt}/fh$objnum bs=512 count=5 stride=4
+               dd if=/dev/urandom of=${mntpnt}/fh$objnum bs=512 count=5 stride=4
        elif [[ $type == "hole2" ]]; then
-               $DD if=/dev/urandom of=${mntpnt}/fh$objnum bs=512 count=4 stride=5
+               dd if=/dev/urandom of=${mntpnt}/fh$objnum bs=512 count=4 stride=5
        elif [[ $type == "directory" ]]; then
-               $MKDIR ${mntpnt}/d$objnum
+               mkdir ${mntpnt}/d$objnum
        elif [[ $type == "missing" ]]; then
-               $TOUCH ${mntpnt}/h$objnum
+               touch ${mntpnt}/h$objnum
        fi
 }
 
@@ -76,17 +76,17 @@ function create_pair
 
 function cleanup
 {
-       $ZFS destroy -Rf $TESTPOOL/$TESTFS/base
+       zfs destroy -Rf $TESTPOOL/$TESTFS/base
        rm /tmp/zr010p*
 }
 
 log_assert "zfs receive of full send as clone should work"
 log_onexit cleanup
-log_must $ZFS create -o checksum=sha256 -o compression=gzip -o recordsize=512 \
+log_must zfs create -o checksum=sha256 -o compression=gzip -o recordsize=512 \
        $TESTPOOL/$TESTFS/base
 
-log_must $ZFS create $fs
-log_must $ZFS create $fs2
+log_must zfs create $fs
+log_must zfs create $fs2
 mntpnt=$(get_prop mountpoint $fs)
 mntpnt2=$(get_prop mountpoint $fs2)
 
@@ -129,49 +129,49 @@ create_pair 16 $mntpnt $mntpnt2 "directory" "missing"
 create_pair 17 $mntpnt $mntpnt2 "missing" "missing"
 
 # Receive a file with a different record size onto a file (and vice versa).
-log_must $ZFS set recordsize=128k $fs
-$DD if=/dev/urandom of=$mntpnt/f18 bs=128k count=64
-$TOUCH $mntpnt2/f18
+log_must zfs set recordsize=128k $fs
+dd if=/dev/urandom of=$mntpnt/f18 bs=128k count=64
+touch $mntpnt2/f18
 
 # Remove objects that are intended to be missing.
-$RM $mntpnt/h17
-$RM $mntpnt2/h*
+rm $mntpnt/h17
+rm $mntpnt2/h*
 
 # Add empty objects to $fs to exercise dmu_traverse code
 for i in {1..100}; do
        log_must touch $mntpnt/uf$i
 done
 
-log_must $ZFS snapshot $fs@s1
-log_must $ZFS snapshot $fs2@s1
+log_must zfs snapshot $fs@s1
+log_must zfs snapshot $fs2@s1
 
-log_must $ZFS send $fs@s1 > /tmp/zr010p
-log_must $ZFS send $fs2@s1 > /tmp/zr010p2
+log_must zfs send $fs@s1 > /tmp/zr010p
+log_must zfs send $fs2@s1 > /tmp/zr010p2
 
 
 #
 # Test that, when we receive a full send as a clone of itself,
 # nop-write saves us all the space used by data blocks.
 #
-cat /tmp/zr010p | log_must $ZFS receive -o origin=$fs@s1 $rfs
+cat /tmp/zr010p | log_must zfs receive -o origin=$fs@s1 $rfs
 size=$(get_prop used $rfs)
 size2=$(get_prop used $fs)
 if [[ $size -ge $(($size2 / 10)) ]] then
         log_fail "nop-write failure; expected usage less than "\
                "$(($size2 / 10)), but is using $size"
 fi
-log_must $ZFS destroy -fr $rfs
+log_must zfs destroy -fr $rfs
 
 # Correctness testing: receive each full send as a clone of the other fiesystem.
-cat /tmp/zr010p | log_must $ZFS receive -o origin=$fs2@s1 $rfs
+cat /tmp/zr010p | log_must zfs receive -o origin=$fs2@s1 $rfs
 mntpnt_old=$(get_prop mountpoint $fs)
 mntpnt_new=$(get_prop mountpoint $rfs)
-log_must $DIFF -r $mntpnt_old $mntpnt_new
-log_must $ZFS destroy -r $rfs
+log_must diff -r $mntpnt_old $mntpnt_new
+log_must zfs destroy -r $rfs
 
-cat /tmp/zr010p2 | log_must $ZFS receive -o origin=$fs@s1 $rfs
+cat /tmp/zr010p2 | log_must zfs receive -o origin=$fs@s1 $rfs
 mntpnt_old=$(get_prop mountpoint $fs2)
 mntpnt_new=$(get_prop mountpoint $rfs)
-log_must $DIFF -r $mntpnt_old $mntpnt_new
+log_must diff -r $mntpnt_old $mntpnt_new
 
 log_pass "zfs receive of full send as clone works"
index b905a87c64a5e32e175969dd7a6878a43c148feb..6e312d8ea94f0d37526554bbb7dba4a791141648 100755 (executable)
 # Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -43,9 +47,9 @@ typeset streamfile=/var/tmp/streamfile.$$
 
 function cleanup
 {
-       log_must $RM $streamfile
-       log_must $ZFS destroy -rf $TESTPOOL/$TESTFS1
-       log_must $ZFS destroy -rf $TESTPOOL/$TESTFS2
+       log_must rm $streamfile
+       log_must zfs destroy -rf $TESTPOOL/$TESTFS1
+       log_must zfs destroy -rf $TESTPOOL/$TESTFS2
 }
 
 log_assert "refquota is properly sent-and-received, regardless of any " \
@@ -55,30 +59,30 @@ log_onexit cleanup
 orig=$TESTPOOL/$TESTFS1
 dest=$TESTPOOL/$TESTFS2
 #      1. Create a filesystem.
-log_must $ZFS create $orig
+log_must zfs create $orig
 origdir=$(get_prop mountpoint $orig)
 
 #      2. Create two equal-sized large files.
-log_must $MKFILE 5M $origdir/file1
-log_must $MKFILE 5M $origdir/file2
-log_must $SYNC
+log_must mkfile 5M $origdir/file1
+log_must mkfile 5M $origdir/file2
+log_must sync
 
 #      3. Snapshot the filesystem.
-log_must $ZFS snapshot $orig@1
+log_must zfs snapshot $orig@1
 
 #      4. Remove one of the two large files.
-log_must $RM $origdir/file2
-log_must $SYNC
+log_must rm $origdir/file2
+log_must sync
 
 #      5. Create a refquota larger than one file, but smaller than both.
-log_must $ZFS set refquota=8M $orig
+log_must zfs set refquota=8M $orig
 
 #      6. Snapshot the filesystem again.
-log_must $ZFS snapshot $orig@2
+log_must zfs snapshot $orig@2
 
 #      7. Send a replication stream of the second snapshot to a new filesystem.
-log_must eval "$ZFS send -R $orig@2 > $streamfile"
-log_must eval "$ZFS recv $dest < $streamfile"
+log_must eval "zfs send -R $orig@2 > $streamfile"
+log_must eval "zfs recv $dest < $streamfile"
 
 log_pass "refquota is properly sent-and-received, regardless of any " \
        "intermediate snapshots sent by a replication stream."
index af9f91e61c0e1c8573d942f13ccb4feb8814699e..70afe419fc1e4c761669b503b013a5889088c966 100755 (executable)
@@ -44,9 +44,9 @@ typeset streamfile=/var/tmp/streamfile.$$
 
 function cleanup
 {
-       log_must $RM $streamfile
-       log_must $ZFS destroy -rf $TESTPOOL/$TESTFS1
-       log_must $ZFS destroy -rf $TESTPOOL/$TESTFS2
+       log_must rm $streamfile
+       log_must zfs destroy -rf $TESTPOOL/$TESTFS1
+       log_must zfs destroy -rf $TESTPOOL/$TESTFS2
 }
 
 log_assert "The allowable slight refquota overage is properly sent-and-" \
@@ -57,27 +57,27 @@ orig=$TESTPOOL/$TESTFS1
 dest=$TESTPOOL/$TESTFS2
 
 #      1. Create a filesystem.
-log_must $ZFS create $orig
+log_must zfs create $orig
 origdir=$(get_prop mountpoint $orig)
 
 #      2. Set a refquota.
-log_must $ZFS set refquota=50M $orig
+log_must zfs set refquota=50M $orig
 
 #      3. Snapshot the filesystem.
-log_must $ZFS snapshot $orig@1
+log_must zfs snapshot $orig@1
 
 #      4. Send a replication stream to a new filesystem.
-log_must eval "$ZFS send -R $orig@1 > $streamfile"
-log_must eval "$ZFS recv $dest < $streamfile"
+log_must eval "zfs send -R $orig@1 > $streamfile"
+log_must eval "zfs recv $dest < $streamfile"
 
 #      5. On the original filesystem, fill it up to its quota.
 cat < /dev/urandom > $origdir/fill-it-up
 
 #      6. Snapshot the original filesystem again.
-log_must $ZFS snapshot $orig@2
+log_must zfs snapshot $orig@2
 
 #      7. Send an incremental stream to the same new filesystem.
-log_must eval "$ZFS send -I 1 -R $orig@2 > $streamfile"
-log_must eval "$ZFS recv $dest < $streamfile"
+log_must eval "zfs send -I 1 -R $orig@2 > $streamfile"
+log_must eval "zfs recv $dest < $streamfile"
 
 log_pass "Verified receiving a slightly-over-refquota stream succeeds."
index f70d0f4bfa45c71aefc332d4a85c85e1e3ee4c96..9879282ea26fe39a582802c7888bfef09cbac01a 100755 (executable)
@@ -15,7 +15,7 @@
 #
 
 #
-# Copyright (c) 2015 by Delphix. All rights reserved.
+# Copyright (c) 2015, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cli_root/cli_common.kshlib
@@ -39,34 +39,34 @@ tpoolfile=/temptank.$$
 function cleanup
 {
     for fs in $src_fs $dst_fs; do
-        datasetexists $fs && log_must $ZFS destroy -rf $fs
+        datasetexists $fs && log_must zfs destroy -rf $fs
     done
-    $ZPOOL destroy $temppool
-    [[ -f $streamfile ]] && log_must $RM -f $streamfile
-    [[ -f $tpoolfile ]] && log_must $RM -f $tpoolfile
+    zpool destroy $temppool
+    [[ -f $streamfile ]] && log_must rm -f $streamfile
+    [[ -f $tpoolfile ]] && log_must rm -f $tpoolfile
 }
 
 log_assert "Verifying 'zfs receive' works correctly on deduplicated streams"
 log_onexit cleanup
 
 truncate -s 100M $tpoolfile
-log_must $ZPOOL create $temppool $tpoolfile
-log_must $ZFS create $src_fs
+log_must zpool create $temppool $tpoolfile
+log_must zfs create $src_fs
 src_mnt=$(get_prop mountpoint $src_fs) || log_fail "get_prop mountpoint $src_fs"
 
 echo blah > $src_mnt/blah
-$ZFS snapshot $src_fs@base
+zfs snapshot $src_fs@base
 
 echo grumble > $src_mnt/grumble
 echo blah > $src_mnt/blah2
-$ZFS snapshot $src_fs@snap2
+zfs snapshot $src_fs@snap2
 
 echo grumble > $src_mnt/mumble
 echo blah > $src_mnt/blah3
-$ZFS snapshot $src_fs@snap3
+zfs snapshot $src_fs@snap3
 
-log_must eval "$ZFS send -D -R $src_fs@snap3 > $streamfile"
-log_must eval "$ZFS receive -v $dst_fs < $streamfile"
+log_must eval "zfs send -D -R $src_fs@snap3 > $streamfile"
+log_must eval "zfs receive -v $dst_fs < $streamfile"
 
 cleanup
 
index d00efaf4f6f483b8714b884a34b13e3ff2e9076a..b92e712e9e32aa8200c9657f9791dae5f35ac6de 100755 (executable)
@@ -48,11 +48,11 @@ typeset streamfile_trun=/var/tmp/streamfile_trun.$$
 
 function cleanup
 {
-       log_must $RM $streamfile_full
-       log_must $RM $streamfile_incr
-       log_must $RM $streamfile_trun
-       log_must $ZFS destroy -rf $orig
-       log_must $ZFS destroy -rf $dest
+       log_must rm $streamfile_full
+       log_must rm $streamfile_incr
+       log_must rm $streamfile_trun
+       log_must zfs destroy -rf $orig
+       log_must zfs destroy -rf $dest
 }
 
 #
@@ -84,38 +84,38 @@ log_assert "ZFS successfully receive and restore properties."
 log_onexit cleanup
 
 # 1. Create a filesystem.
-log_must eval "$ZFS create $orig"
+log_must eval "zfs create $orig"
 mntpnt=$(get_prop mountpoint $orig)
 
 # 2. Create a full stream with properties and receive it.
-log_must eval "$ZFS set compression='gzip-1' $orig"
-log_must eval "$ZFS set '$userprop'='$userval' $orig"
-log_must eval "$ZFS snapshot $orig@snap1"
-log_must eval "$ZFS send -p $orig@snap1 > $streamfile_full"
-log_must eval "$ZFS recv $dest < $streamfile_full"
+log_must eval "zfs set compression='gzip-1' $orig"
+log_must eval "zfs set '$userprop'='$userval' $orig"
+log_must eval "zfs snapshot $orig@snap1"
+log_must eval "zfs send -p $orig@snap1 > $streamfile_full"
+log_must eval "zfs recv $dest < $streamfile_full"
 log_must eval "check_prop_source $dest compression 'gzip-1' received"
 log_must eval "check_prop_source $dest '$userprop' '$userval' received"
 
 # 3. Create also an incremental stream without some properties and a truncated
 #    stream.
-log_must eval "$ZFS set compression='gzip-2' $orig"
-log_must eval "$ZFS inherit '$userprop' $orig"
-log_must eval "$DD if=/dev/urandom of=$mntpnt/file bs=1024k count=10"
-log_must eval "$ZFS snapshot $orig@snap2"
-log_must eval "$ZFS send -p -i $orig@snap1 $orig@snap2 > $streamfile_incr"
-log_must eval "$DD if=$streamfile_incr of=$streamfile_trun bs=1024k count=9"
-log_must eval "$ZFS snapshot $orig@snap3"
-log_must eval "$ZFS send -p -i $orig@snap1 $orig@snap3 > $streamfile_incr"
+log_must eval "zfs set compression='gzip-2' $orig"
+log_must eval "zfs inherit '$userprop' $orig"
+log_must eval "dd if=/dev/urandom of=$mntpnt/file bs=1024k count=10"
+log_must eval "zfs snapshot $orig@snap2"
+log_must eval "zfs send -p -i $orig@snap1 $orig@snap2 > $streamfile_incr"
+log_must eval "dd if=$streamfile_incr of=$streamfile_trun bs=1024k count=9"
+log_must eval "zfs snapshot $orig@snap3"
+log_must eval "zfs send -p -i $orig@snap1 $orig@snap3 > $streamfile_incr"
 
 # 4. Fail to receive the truncated incremental stream and verify previously
 #    received properties are still present.
-log_mustnot eval "$ZFS recv -F $dest < $streamfile_trun"
+log_mustnot eval "zfs recv -F $dest < $streamfile_trun"
 log_must eval "check_prop_source $dest compression 'gzip-1' received"
 log_must eval "check_prop_source $dest '$userprop' '$userval' received"
 
 # 5. Receive the complete incremental send stream and verify that sent
 #    properties are successfully received.
-log_must eval "$ZFS recv -F $dest < $streamfile_incr"
+log_must eval "zfs recv -F $dest < $streamfile_incr"
 log_must eval "check_prop_source $dest compression 'gzip-2' received"
 log_must eval "check_prop_source $dest '$userprop' '-' '-'"
 
index 11081bb7f1e106a97d423dae0c0198a90c37650c..b540ead5ac2ed9c1a7e8f5c806006f55f6f99628 100755 (executable)
@@ -45,38 +45,38 @@ typeset value=$(user_property_value 8)
 
 function cleanup
 {
-       log_must $RM $streamfile_full
-       log_must $RM $streamfile_incr
-       log_must $ZFS destroy -rf $TESTPOOL/$TESTFS1
-       log_must $ZFS destroy -rf $TESTPOOL/$TESTFS2
+       log_must rm $streamfile_full
+       log_must rm $streamfile_incr
+       log_must zfs destroy -rf $TESTPOOL/$TESTFS1
+       log_must zfs destroy -rf $TESTPOOL/$TESTFS2
 }
 
 log_assert "ZFS can receive custom properties."
 log_onexit cleanup
 
 #      1. Create a filesystem.
-log_must $ZFS create $orig
+log_must zfs create $orig
 
 #      2. Snapshot the filesystem.
-log_must $ZFS snapshot $orig@snap1
-log_must $ZFS snapshot $orig@snap2
-log_must $ZFS snapshot $orig@snap3
+log_must zfs snapshot $orig@snap1
+log_must zfs snapshot $orig@snap2
+log_must zfs snapshot $orig@snap3
 
 #      3. Set custom properties on both the fs and snapshots.
-log_must eval "$ZFS set '$user_prop'='$value' $orig"
-log_must eval "$ZFS set '$user_prop:snap1'='$value:snap1' $orig@snap1"
-log_must eval "$ZFS set '$user_prop:snap2'='$value:snap2' $orig@snap2"
-log_must eval "$ZFS set '$user_prop:snap3'='$value:snap3' $orig@snap3"
+log_must eval "zfs set '$user_prop'='$value' $orig"
+log_must eval "zfs set '$user_prop:snap1'='$value:snap1' $orig@snap1"
+log_must eval "zfs set '$user_prop:snap2'='$value:snap2' $orig@snap2"
+log_must eval "zfs set '$user_prop:snap3'='$value:snap3' $orig@snap3"
 
 #      4. Create different send streams with the properties.
-log_must eval "$ZFS send -p $orig@snap1 > $streamfile_full"
-log_must eval "$ZFS send -p -I $orig@snap1 $orig@snap3 > $streamfile_incr"
+log_must eval "zfs send -p $orig@snap1 > $streamfile_full"
+log_must eval "zfs send -p -I $orig@snap1 $orig@snap3 > $streamfile_incr"
 
 #      5. Receive the send streams and verify the properties.
-log_must eval "$ZFS recv $dest < $streamfile_full"
+log_must eval "zfs recv $dest < $streamfile_full"
 log_must eval "check_user_prop $dest $user_prop '$value'"
 log_must eval "check_user_prop $dest@snap1 '$user_prop:snap1' '$value:snap1'"
-log_must eval "$ZFS recv $dest < $streamfile_incr"
+log_must eval "zfs recv $dest < $streamfile_incr"
 log_must eval "check_user_prop $dest@snap2 '$user_prop:snap2' '$value:snap2'"
 log_must eval "check_user_prop $dest@snap3 '$user_prop:snap3' '$value:snap3'"
 
index 9316154249e510a6e27f8744fbd10533fe831d59..4638b63d72eaf182f401af92bf591e9c9bbd8ad5 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 default_cleanup_noexit
 
 if [[ -d $TESTDIR2 ]]; then
-        $RM -rf $TESTDIR2
+        rm -rf $TESTDIR2
         if (( $? != 0 )); then
                 log_unresolved Could not remove $TESTDIR2
         fi
index dee3af85321a49103d63b03094a70e6f5876b73e..60acbe07acbed1c346ad508b21f04465d887e89f 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -37,13 +37,13 @@ DISK=${DISKS%% *}
 default_setup_noexit "$DISK" "true" "true"
 
 if [[ -d $TESTDIR2 ]]; then
-       $RM -rf $TESTDIR2
+       rm -rf $TESTDIR2
        if (( $? != 0 )); then
                log_unresolved Could not remove $TESTDIR2
        fi
 fi
-log_must $ZFS create $TESTPOOL/$DATAFS
-log_must $ZFS set mountpoint=$TESTDIR2 $TESTPOOL/$DATAFS
-log_must eval "$DD if=$IF of=$OF bs=$BS count=$CNT >/dev/null 2>&1"
+log_must zfs create $TESTPOOL/$DATAFS
+log_must zfs set mountpoint=$TESTDIR2 $TESTPOOL/$DATAFS
+log_must eval "dd if=$IF of=$OF bs=$BS count=$CNT >/dev/null 2>&1"
 
 log_pass
index d2a6a2225a15d21ad81876c0c38cca535a4240d1..f408d712052aaec38664067c4046165292fd77b2 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cli_root/zfs_rename/zfs_rename.cfg
 function additional_setup
 {
        # Create testfile
-       log_must $CP $DATA $TESTDIR/$TESTFILE0
-       log_must $CP $DATA $TESTDIR1/$TESTFILE0
+       log_must cp $DATA $TESTDIR/$TESTFILE0
+       log_must cp $DATA $TESTDIR1/$TESTFILE0
 
        # Create snapshot
        if ! snapexists $TESTPOOL/$TESTFS@snapshot; then
-               log_must $ZFS snapshot $TESTPOOL/$TESTFS@snapshot
-               log_must $ZFS clone $TESTPOOL/$TESTFS@snapshot \
+               log_must zfs snapshot $TESTPOOL/$TESTFS@snapshot
+               log_must zfs clone $TESTPOOL/$TESTFS@snapshot \
                    $TESTPOOL/$TESTFS-clone
        fi
 
        # Create file system
        datasetexists $TESTPOOL/$TESTFS1 || \
-               log_must $ZFS create $TESTPOOL/$TESTFS1
+               log_must zfs create $TESTPOOL/$TESTFS1
 
        # Create testfile
-       log_must $CP $DATA $(get_prop mountpoint $TESTPOOL/$TESTFS1)/$TESTFILE0
+       log_must cp $DATA $(get_prop mountpoint $TESTPOOL/$TESTFS1)/$TESTFILE0
 
        # Create container
        datasetexists $TESTPOOL/$TESTCTR1 || \
-               log_must $ZFS create $TESTPOOL/$TESTCTR1
-       log_must $CP $DATA $(get_prop mountpoint $TESTPOOL/$TESTCTR1)/$TESTFILE0
+               log_must zfs create $TESTPOOL/$TESTCTR1
+       log_must cp $DATA $(get_prop mountpoint $TESTPOOL/$TESTCTR1)/$TESTFILE0
 
        # Create data in zvol
        if is_global_zone; then
-               log_must eval "$DD if=$DATA of=$VOL_R_PATH bs=$BS count=$CNT \
+               log_must eval "dd if=$DATA of=$VOL_R_PATH bs=$BS count=$CNT \
                                >/dev/null 2>&1"
        else
-               log_must $CP $DATA $(get_prop mountpoint $TESTPOOL/$TESTVOL)/$TESTFILE0
+               log_must cp $DATA $(get_prop mountpoint $TESTPOOL/$TESTVOL)/$TESTFILE0
        fi
 
 }
@@ -70,7 +70,7 @@ function rename_dataset # src dest
        typeset src=$1
        typeset dest=$2
 
-       log_must $ZFS rename $src $dest
+       log_must zfs rename $src $dest
        block_device_wait
 
        #
@@ -90,24 +90,24 @@ function cleanup
                fi
 
                 if [[ ${dataset[i]}-new != *@* ]] ; then
-                        $ZFS rename ${dataset[i]}-new ${dataset[i]}
+                        zfs rename ${dataset[i]}-new ${dataset[i]}
                         if [[ $? -ne 0 ]]; then
                                 typeset newfs=${dataset[i]}-new
                                 typeset oldfs=${dataset[i]}
                                 typeset mntp=$(get_prop mountpoint  $newfs)
-                                log_must $ZFS destroy -f $newfs
-                                log_must $ZFS create -p $oldfs
-                                log_must $ZFS set mountpoint=$mntp $oldfs
+                                log_must zfs destroy -f $newfs
+                                log_must zfs create -p $oldfs
+                                log_must zfs set mountpoint=$mntp $oldfs
                         fi
                 else
-                        log_must $ZFS destroy -fR ${dataset[i]}-new
+                        log_must zfs destroy -fR ${dataset[i]}-new
                 fi
 
                 ((i = i + 1))
        done
 
        if snapexists $TESTPOOL/$TESTFS@snapshot; then
-               log_must $ZFS destroy -fR $TESTPOOL/$TESTFS@snapshot
+               log_must zfs destroy -fR $TESTPOOL/$TESTFS@snapshot
        fi
 
 }
@@ -117,7 +117,7 @@ function cmp_data #<$1 src data, $2 tgt data>
         typeset src=$1
         typeset tgt=$2
 
-        $CMP $src $tgt >/dev/null 2>&1
+        cmp $src $tgt >/dev/null 2>&1
 
         return $?
 }
index dc178c420038dff4f7dc5fb997dc0c59bbf8410c..c76b5a2fe5c31941b3e573cf3f71560480ea0fd9 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_rename/zfs_rename.kshlib
 
@@ -86,7 +91,7 @@ done
 
 #verify the data integrity in zvol
 if is_global_zone; then
-       log_must eval "$DD if=${VOL_R_PATH}-new of=$VOLDATA bs=$BS count=$CNT >/dev/null 2>&1"
+       log_must eval "dd if=${VOL_R_PATH}-new of=$VOLDATA bs=$BS count=$CNT >/dev/null 2>&1"
        if ! cmp_data $VOLDATA $DATA ; then
                log_fail "$VOLDATA gets corrupted after rename operation."
        fi
@@ -96,7 +101,7 @@ fi
 typeset -i i=0
 while ((i < ${#dataset[*]} )); do
        if datasetexists ${dataset[i]}-new ; then
-                log_must $ZFS rename ${dataset[i]}-new ${dataset[i]}
+                log_must zfs rename ${dataset[i]}-new ${dataset[i]}
        fi
         ((i = i + 1))
 done
index 6646df5aa6be93c6f76580ac9bd9bb43e87b99fd..6d51f612b311a202e251148766012c528094be8c 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_rename/zfs_rename.kshlib
 
@@ -71,7 +76,7 @@ while ((i < ${#dataset[*]} )); do
        if [[ ${dataset[i]} == *@* ]]; then
                data=$(snapshot_mountpoint ${dataset[i]})/$TESTFILE0
        elif [[ ${dataset[i]} == "$TESTPOOL/$TESTVOL" ]] && is_global_zone; then
-               log_must eval "$DD if=$VOL_R_PATH of=$VOLDATA bs=$BS count=$CNT >/dev/null 2>&1"
+               log_must eval "dd if=$VOL_R_PATH of=$VOLDATA bs=$BS count=$CNT >/dev/null 2>&1"
                data=$VOLDATA
        else
                data=$(get_prop mountpoint ${dataset[i]})/$TESTFILE0
index 9660641048c9a1cd03987656e10666b5c83ed6cf..56c06cfe857d56a01723871b3cdd4a9201434ba9 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -40,7 +44,7 @@ verify_runnable "both"
 
 function cleanup
 {
-       datasetexists $snap && log_must $ZFS destroy $snap
+       datasetexists $snap && log_must zfs destroy $snap
 }
 
 log_assert "'zfs rename' can address the abbreviated snapshot name."
@@ -49,14 +53,14 @@ log_onexit cleanup
 fs=$TESTPOOL/$TESTFS; snap=$fs@snap
 set -A newname "$fs@new-snap" "@new-snap" "new-snap"
 
-log_must $ZFS snapshot $snap
+log_must zfs snapshot $snap
 log_must datasetexists $snap
 
 typeset -i i=0
 while ((i < ${#newname[*]} )); do
-        log_must $ZFS rename $snap ${newname[$i]}
+        log_must zfs rename $snap ${newname[$i]}
        log_must datasetexists ${snap%%@*}@${newname[$i]##*@}
-       log_must $ZFS rename ${snap%%@*}@${newname[$i]##*@} $snap
+       log_must zfs rename ${snap%%@*}@${newname[$i]##*@} $snap
 
        ((i += 1))
 done
index 19f8a80adc3f1141c8b825356a62cc6840ca1d89..cafa74366d096adf3dd84854011fed43470c39d4 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_rename/zfs_rename.kshlib
 
@@ -86,10 +91,10 @@ additional_setup
 
 typeset -i i=0
 while ((i < ${#bad_dataset[*]} )); do
-        log_mustnot $ZFS rename ${bad_dataset[i]} ${bad_dataset[((i + 1))]}
+        log_mustnot zfs rename ${bad_dataset[i]} ${bad_dataset[((i + 1))]}
         log_must datasetexists ${bad_dataset[i]}
 
-        log_mustnot $ZFS rename -p ${bad_dataset[i]} ${bad_dataset[((i + 1))]}
+        log_mustnot zfs rename -p ${bad_dataset[i]} ${bad_dataset[((i + 1))]}
         log_must datasetexists ${bad_dataset[i]}
 
        ((i = i + 2))
@@ -97,10 +102,10 @@ done
 
 #verify 'rename -p' can not work with snapshots
 
-log_mustnot $ZFS rename -p $TESTPOOL/$TESTFS@snapshot \
+log_mustnot zfs rename -p $TESTPOOL/$TESTFS@snapshot \
                $TESTPOOL/$TESTFS@snapshot2
 log_must datasetexists $TESTPOOL/$TESTFS@snapshot
-log_mustnot $ZFS rename -p $TESTPOOL/$TESTFS@snapshot \
+log_mustnot zfs rename -p $TESTPOOL/$TESTFS@snapshot \
                $TESTPOOL/$TESTFS/$TESTFS@snapshot2
 log_must datasetexists $TESTPOOL/$TESTFS@snapshot
 
index b3f1b39671d41b96c6442d2e1e4a6d275628471d..5ef77de0c75102b85bb249a4c01d76dd3b8cf26c 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -50,7 +50,7 @@ function my_cleanup
        poolexists $TESTPOOL1 && \
                destroy_pool $TESTPOOL1
        [[ -e $TESTDIR/$TESTFILE1 ]] && \
-               log_must $RM -f $TESTDIR/$TESTFILE1
+               log_must rm -f $TESTDIR/$TESTFILE1
        cleanup
 }
 
@@ -68,7 +68,7 @@ log_assert "'zfs rename' should fail while datasets are within different pool."
 
 additional_setup
 
-log_must $MKFILE $MINVDEVSIZE $TESTDIR/$TESTFILE1
+log_must mkfile $MINVDEVSIZE $TESTDIR/$TESTFILE1
 create_pool $TESTPOOL1 $TESTDIR/$TESTFILE1
 
 for src in ${src_dataset[@]} ; do
@@ -79,8 +79,8 @@ for src in ${src_dataset[@]} ; do
        else
                dest=${TESTPOOL1}/$dest
        fi
-       log_mustnot $ZFS rename $src $dest
-       log_mustnot $ZFS rename -p $src $dest
+       log_mustnot zfs rename $src $dest
+       log_mustnot zfs rename -p $src $dest
 
        #
        # Verify original dataset name still in use
index 32223b621bf7422a775ce5ae900240ded2ec8892..a7cba349f1a29556e40316782cda33cba9f112c4 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2015 by Delphix. All rights reserved.
+# Copyright (c) 2015, 2016 by Delphix. All rights reserved.
 #
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_rename/zfs_rename.kshlib
@@ -57,9 +57,9 @@ log_assert "'zfs rename' can successfully rename a volume snapshot."
 vol=$TESTPOOL/$TESTVOL
 snap=$TESTSNAP
 
-log_must eval "$DD if=$DATA of=$VOL_R_PATH bs=$BS count=$CNT >/dev/null 2>&1"
+log_must eval "dd if=$DATA of=$VOL_R_PATH bs=$BS count=$CNT >/dev/null 2>&1"
 if ! snapexists $vol@$snap; then
-       log_must $ZFS snapshot $vol@$snap
+       log_must zfs snapshot $vol@$snap
 fi
 
 rename_dataset $vol@$snap $vol@${snap}-new
@@ -72,13 +72,13 @@ create_clone $vol@$snap $clone
 
 #verify data integrity
 for input in $VOL_R_PATH $ZVOL_RDEVDIR/$clone; do
-       log_must eval "$DD if=$input of=$VOLDATA bs=$BS count=$CNT >/dev/null 2>&1"
+       log_must eval "dd if=$input of=$VOLDATA bs=$BS count=$CNT >/dev/null 2>&1"
        if ! cmp_data $VOLDATA $DATA ; then
                log_fail "$input gets corrupted after rename operation."
        fi
 done
 
 destroy_clone $clone
-log_must $ZFS destroy $vol@$snap
+log_must zfs destroy $vol@$snap
 
 log_pass "'zfs rename' can rename volume snapshot as expected."
index 5985eac4e4cc4a65a331b62d3e7e70b1009bfeca..f7faa3b36afca0a0b5a788b2e7e92e3c7f641cd9 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,12 +47,12 @@ verify_runnable "both"
 function cleanup
 {
        if datasetexists $TESTPOOL/$TESTFS ; then
-               log_must $ZFS destroy -Rf $TESTPOOL/$TESTFS
+               log_must zfs destroy -Rf $TESTPOOL/$TESTFS
        fi
-       log_must $ZFS create $TESTPOOL/$TESTFS
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       log_must zfs create $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 
-       $RM -f $SRC_FILE $DST_FILE
+       rm -f $SRC_FILE $DST_FILE
 }
 
 function target_obj
@@ -78,78 +78,78 @@ log_onexit cleanup
 BS=512 ; CNT=2048
 SRC_FILE=/tmp/srcfile.$$
 DST_FILE=/tmp/dstfile.$$
-log_must $DD if=/dev/urandom of=$SRC_FILE bs=$BS count=$CNT
+log_must dd if=/dev/urandom of=$SRC_FILE bs=$BS count=$CNT
 
 fs=$TESTPOOL/$TESTFS/fs.$$
 fsclone=$TESTPOOL/$TESTFS/fsclone.$$
-log_must $ZFS create $fs
+log_must zfs create $fs
 
 obj=$(target_obj $fs)
-log_must $CP $SRC_FILE $obj
+log_must cp $SRC_FILE $obj
 
 snap=${fs}@snap.$$
-log_must $ZFS snapshot $snap
-log_must $ZFS clone $snap $fsclone
+log_must zfs snapshot $snap
+log_must zfs clone $snap $fsclone
 
 # Rename dataset & clone
 #
-log_must $ZFS rename $fs ${fs}-new
-log_must $ZFS rename $fsclone ${fsclone}-new
+log_must zfs rename $fs ${fs}-new
+log_must zfs rename $fsclone ${fsclone}-new
 
 # Compare source file and target file
 #
 obj=$(target_obj ${fs}-new)
-log_must $DIFF $SRC_FILE $obj
+log_must diff $SRC_FILE $obj
 obj=$(target_obj ${fsclone}-new)
-log_must $DIFF $SRC_FILE $obj
+log_must diff $SRC_FILE $obj
 
 # Rename snapshot and re-clone dataset
 #
-log_must $ZFS rename ${fs}-new $fs
-log_must $ZFS rename $snap ${snap}-new
-log_must $ZFS clone ${snap}-new $fsclone
+log_must zfs rename ${fs}-new $fs
+log_must zfs rename $snap ${snap}-new
+log_must zfs clone ${snap}-new $fsclone
 
 # Compare source file and target file
 #
 obj=$(target_obj $fsclone)
-log_must $DIFF $SRC_FILE $obj
+log_must diff $SRC_FILE $obj
 
 if is_global_zone; then
        vol=$TESTPOOL/$TESTFS/vol.$$ ;  volclone=$TESTPOOL/$TESTFS/volclone.$$
-       log_must $ZFS create -V 100M $vol
+       log_must zfs create -V 100M $vol
        block_device_wait
 
        obj=$(target_obj $vol)
-       log_must $DD if=$SRC_FILE of=$obj bs=$BS count=$CNT
+       log_must dd if=$SRC_FILE of=$obj bs=$BS count=$CNT
 
        snap=${vol}@snap.$$
-       log_must $ZFS snapshot $snap
-       log_must $ZFS clone $snap $volclone
+       log_must zfs snapshot $snap
+       log_must zfs clone $snap $volclone
        block_device_wait
 
        # Rename dataset & clone
-       log_must $ZFS rename $vol ${vol}-new
-       log_must $ZFS rename $volclone ${volclone}-new
+       log_must zfs rename $vol ${vol}-new
+       log_must zfs rename $volclone ${volclone}-new
        block_device_wait
 
        # Compare source file and target file
        obj=$(target_obj ${vol}-new)
-       log_must $DD if=$obj of=$DST_FILE bs=$BS count=$CNT
-       log_must $DIFF $SRC_FILE $DST_FILE
+       log_must dd if=$obj of=$DST_FILE bs=$BS count=$CNT
+       log_must diff $SRC_FILE $DST_FILE
        obj=$(target_obj ${volclone}-new)
-       log_must $DD if=$obj of=$DST_FILE bs=$BS count=$CNT
-       log_must $DIFF $SRC_FILE $DST_FILE
+       log_must dd if=$obj of=$DST_FILE bs=$BS count=$CNT
+       log_must diff $SRC_FILE $DST_FILE
 
        # Rename snapshot and re-clone dataset
-       log_must $ZFS rename ${vol}-new $vol
-       log_must $ZFS rename $snap ${snap}-new
-       log_must $ZFS clone ${snap}-new $volclone
+       log_must zfs rename ${vol}-new $vol
+       log_must zfs rename $snap ${snap}-new
+       log_must zfs clone ${snap}-new $volclone
        block_device_wait
 
        # Compare source file and target file
        obj=$(target_obj $volclone)
-       log_must $DD if=$obj of=$DST_FILE bs=$BS count=$CNT
-       log_must $DIFF $SRC_FILE $DST_FILE
+       log_must dd if=$obj of=$DST_FILE bs=$BS count=$CNT
+       log_must diff $SRC_FILE $DST_FILE
 fi
 
 log_pass "Rename dataset, the data haven't changed passed."
index 2552acce3c19258737bcc4ff673a08bf34d4f414..3fc099d79f8a96781517f94f40ade169652bf6cd 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,10 +48,10 @@ function cleanup
        typeset -i i=0
        while ((i < ${#datasets[@]})); do
                if datasetexists ${datasets[$i]}@snap ; then
-                       log_must $ZFS destroy ${datasets[$i]}@snap
+                       log_must zfs destroy ${datasets[$i]}@snap
                fi
                if datasetexists ${datasets[$i]}@snap-new ; then
-                       log_must $ZFS destroy ${datasets[$i]}@snap-new
+                       log_must zfs destroy ${datasets[$i]}@snap-new
                fi
 
                ((i += 1))
@@ -67,7 +67,7 @@ if is_global_zone; then
        datasets[${#datasets[@]}]=$TESTPOOL/$TESTVOL
 fi
 
-log_must $ZFS snapshot -r ${TESTPOOL}@snap
+log_must zfs snapshot -r ${TESTPOOL}@snap
 typeset -i i=0
 while ((i < ${#datasets[@]})); do
        log_must datasetexists ${datasets[$i]}@snap
@@ -75,7 +75,7 @@ while ((i < ${#datasets[@]})); do
        ((i += 1))
 done
 
-log_must $ZFS rename -r ${TESTPOOL}@snap ${TESTPOOL}@snap-new
+log_must zfs rename -r ${TESTPOOL}@snap ${TESTPOOL}@snap-new
 i=0
 while ((i < ${#datasets[@]})); do
        log_must datasetexists ${datasets[$i]}@snap-new
@@ -83,6 +83,6 @@ while ((i < ${#datasets[@]})); do
        ((i += 1))
 done
 
-log_must $ZFS destroy -rf ${TESTPOOL}@snap-new
+log_must zfs destroy -rf ${TESTPOOL}@snap-new
 
 log_pass "Verify zfs rename -r passed."
index 16d306dd3813791bc70902f361b844a231e048d7..d19c9485e652d908d770b859dc851254c7241c16 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,24 +47,24 @@ verify_runnable "both"
 
 function cleanup
 {
-       typeset snaps=$($ZFS list -H -t snapshot -o name)
+       typeset snaps=$(zfs list -H -t snapshot -o name)
        typeset exclude
        typeset snap
        typeset pool_name
 
        if [[ -n $KEEP ]]; then
-               exclude=`eval $ECHO \"'(${KEEP})'\"`
+               exclude=`eval echo \"'(${KEEP})'\"`
        fi
 
        for snap in $snaps; do
-               pool_name=$($ECHO "$snap" | $AWK -F/ '{print $1}')
+               pool_name=$(echo "$snap" | awk -F/ '{print $1}')
                if [[ -n $exclude ]]; then
-                       $ECHO "$pool_name" | $EGREP -v "$exclude" > /dev/null 2>&1
+                       echo "$pool_name" | egrep -v "$exclude" > /dev/null 2>&1
                        if [[ $? -eq 0 ]]; then
-                               log_must $ZFS destroy $snap
+                               log_must zfs destroy $snap
                        fi
                else
-                       log_must $ZFS destroy $snap
+                       log_must zfs destroy $snap
                fi
        done
 }
@@ -78,13 +78,13 @@ if is_global_zone; then
        datasets[${#datasets[@]}]=$TESTPOOL/$TESTVOL
 fi
 
-log_must $ZFS snapshot -r ${TESTPOOL}@snap
+log_must zfs snapshot -r ${TESTPOOL}@snap
 typeset -i i=0
 while ((i < ${#datasets[@]})); do
        # Create one more snapshot
-       log_must $ZFS snapshot ${datasets[$i]}@snap2
-       log_mustnot $ZFS rename -r ${TESTPOOL}@snap ${TESTPOOL}@snap2
-       log_must $ZFS destroy ${datasets[$i]}@snap2
+       log_must zfs snapshot ${datasets[$i]}@snap2
+       log_mustnot zfs rename -r ${TESTPOOL}@snap ${TESTPOOL}@snap2
+       log_must zfs destroy ${datasets[$i]}@snap2
 
        # Check datasets, make sure none of them was renamed.
        typeset -i j=0
index 2b96662ebc40e10d961c4f4d1cb3b5b860a0a81c..171770fa32a1c18d562ac8740f6260baa38511d6 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -54,7 +54,7 @@ fi
 for opts in "-r" "-r -p"; do
        typeset -i i=0
        while ((i < ${#datasets[@]})); do
-               log_mustnot $ZFS rename $opts ${datasets[$i]} \
+               log_mustnot zfs rename $opts ${datasets[$i]} \
                        ${datasets[$i]}-new
 
                # Check datasets, make sure none of them was renamed.
index e453e83865e25462edb4477e043c8689aefd5513..2d1220e334c9596177fc8da8d6fd095ff541281a 100755 (executable)
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_rename/zfs_rename.kshlib
 
@@ -42,19 +47,19 @@ verify_runnable "both"
 function additional_cleanup
 {
        if datasetexists $TESTPOOL/notexist ; then
-               log_must $ZFS destroy -Rf $TESTPOOL/notexist
+               log_must zfs destroy -Rf $TESTPOOL/notexist
        fi
 
        if datasetexists $TESTPOOL/$TESTFS ; then
-               log_must $ZFS destroy -Rf $TESTPOOL/$TESTFS
+               log_must zfs destroy -Rf $TESTPOOL/$TESTFS
        fi
-       log_must $ZFS create $TESTPOOL/$TESTFS
+       log_must zfs create $TESTPOOL/$TESTFS
 
        if is_global_zone ; then
                if datasetexists $TESTPOOL/$TESTVOL ; then
-                       log_must $ZFS destroy -Rf $TESTPOOL/$TESTVOL
+                       log_must zfs destroy -Rf $TESTPOOL/$TESTVOL
                fi
-               log_must $ZFS create -V $VOLSIZE $TESTPOOL/$TESTVOL
+               log_must zfs create -V $VOLSIZE $TESTPOOL/$TESTVOL
        fi
 }
 
index 495f663ef79e5f82d0a0551693fc63ba4a3a6e8f..6daf001797e621a716ae1e53c7a861d68ed47a6b 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -54,14 +54,14 @@ datasets=("$TESTPOOL" "$TESTPOOL/$TESTFS" "$TESTPOOL/$TESTFS@$TESTSNAP"
 
 longname="$(gen_dataset_name 260 abcdefg)"
 
-log_must $ZFS snapshot $TESTPOOL/$TESTFS@$TESTSNAP
+log_must zfs snapshot $TESTPOOL/$TESTFS@$TESTSNAP
 for ds in ${datasets[@]}; do
        for opt in ${badopts[@]}; do
-               log_mustnot $ZFS rename $opt $ds ${ds}-new
+               log_mustnot zfs rename $opt $ds ${ds}-new
        done
-       log_mustnot $ZFS rename $ds
-       log_mustnot $ZFS rename $ds ${ds}-new ${ds}-new1
-       log_mustnot $ZFS rename $ds ${ds}.$longname
+       log_mustnot zfs rename $ds
+       log_mustnot zfs rename $ds ${ds}-new ${ds}-new1
+       log_mustnot zfs rename $ds ${ds}.$longname
 done
 
 log_pass "'zfs rename' fails with illegal scenarios as expected."
index 3189be5fd0f4af80fdb964b372147b74cea7e715..b2e01006fdd1556a10549236996c62cd891ac764 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,19 +47,19 @@ verify_runnable "both"
 function cleanup
 {
        if datasetexists $TESTPOOL/$TESTCTR@snap-new ; then
-               log_must $ZFS destroy -f $TESTPOOL/$TESTCTR@snap-new
+               log_must zfs destroy -f $TESTPOOL/$TESTCTR@snap-new
        fi
 
        if datasetexists $TESTPOOL/$TESTCTR@snap ; then
-               log_must $ZFS destroy -f $TESTPOOL/$TESTCTR@snap
+               log_must zfs destroy -f $TESTPOOL/$TESTCTR@snap
        fi
 
        if datasetexists $TESTPOOL@snap-new ; then
-               log_must $ZFS destroy -f $TESTPOOL@snap-new
+               log_must zfs destroy -f $TESTPOOL@snap-new
        fi
 
        if datasetexists $TESTPOOL@snap ; then
-               log_must $ZFS destroy -f $TESTPOOL@snap
+               log_must zfs destroy -f $TESTPOOL@snap
        fi
 }
 
@@ -68,17 +68,17 @@ log_assert "zfs rename -r can rename snapshot when child datasets" \
 
 log_onexit cleanup
 
-log_must $ZFS snapshot $TESTPOOL/$TESTCTR@snap
-log_must $ZFS rename -r $TESTPOOL/$TESTCTR@snap $TESTPOOL/$TESTCTR@snap-new
+log_must zfs snapshot $TESTPOOL/$TESTCTR@snap
+log_must zfs rename -r $TESTPOOL/$TESTCTR@snap $TESTPOOL/$TESTCTR@snap-new
 log_must datasetexists $TESTPOOL/$TESTCTR@snap-new
 
-log_must $ZFS snapshot $TESTPOOL@snap
-log_must $ZFS rename -r $TESTPOOL@snap $TESTPOOL@snap-new
+log_must zfs snapshot $TESTPOOL@snap
+log_must zfs rename -r $TESTPOOL@snap $TESTPOOL@snap-new
 log_must datasetexists $TESTPOOL/$TESTCTR@snap-new
 log_must datasetexists $TESTPOOL@snap-new
 
-log_must $ZFS destroy -f $TESTPOOL/$TESTCTR@snap-new
-log_must $ZFS destroy -f $TESTPOOL@snap-new
+log_must zfs destroy -f $TESTPOOL/$TESTCTR@snap-new
+log_must zfs destroy -f $TESTPOOL@snap-new
 
 log_pass "Verify zfs rename -r passed when child datasets" \
        "don't have a snapshot of the given name."
index d3a6a00ec64d5e0695dcade559b6dec0c2df2ea8..7ec55ce0f3d2dc2bc02e577a1d6486ab08aebadd 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -43,8 +48,8 @@ RESERVATION="reserve"
 function cleanup
 {
        if datasetexists $TESTPOOL/$RESERVATION ; then
-               log_must $ZFS unmount $TESTPOOL/$RESERVATION
-               log_must $ZFS destroy $TESTPOOL/$RESERVATION
+               log_must zfs unmount $TESTPOOL/$RESERVATION
+               log_must zfs destroy $TESTPOOL/$RESERVATION
        fi
 }
 
@@ -52,8 +57,8 @@ log_onexit cleanup
 
 log_assert "Verify that a reservation > 2^64 -1 fails."
 
-log_must $ZFS create $TESTPOOL/$RESERVATION
+log_must zfs create $TESTPOOL/$RESERVATION
 
-log_mustnot $ZFS set reservation=18446744073709551615 $TESTPOOL/$RESERVATION
+log_mustnot zfs set reservation=18446744073709551615 $TESTPOOL/$RESERVATION
 
 log_pass "Unable to set a reservation > 2^64 - 1"
index d308f75df63be72719c8053c320b71c3b0976ebf..c482f9c3c7df55067c0cb9980abf5252396727fc 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -50,8 +55,8 @@ function cleanup
        for FS in $TESTPOOL/$RESERVATION $TESTPOOL/$RESERVATION2
        do
                if datasetexists $FS ; then
-                       log_must $ZFS unmount $FS
-                       log_must $ZFS destroy $FS
+                       log_must zfs unmount $FS
+                       log_must zfs destroy $FS
                fi
        done
 }
@@ -60,21 +65,21 @@ log_onexit cleanup
 
 log_assert "Ensure a reservation of 0 or 'none' is allowed."
 
-log_must $ZFS create $TESTPOOL/$RESERVATION
-log_must $ZFS create $TESTPOOL/$RESERVATION2
+log_must zfs create $TESTPOOL/$RESERVATION
+log_must zfs create $TESTPOOL/$RESERVATION2
 
-log_must $ZFS set reservation=0 $TESTPOOL/$RESERVATION
-log_must $ZFS set reservation=none $TESTPOOL/$RESERVATION2
+log_must zfs set reservation=0 $TESTPOOL/$RESERVATION
+log_must zfs set reservation=none $TESTPOOL/$RESERVATION2
 
 for FS in $TESTPOOL/$RESERVATION $TESTPOOL/$RESERVATION2
 do
 
-       reserve=`$ZFS get -pH reservation $FS | $AWK '{print $3}'`
+       reserve=`zfs get -pH reservation $FS | awk '{print $3}'`
        if [[ $reserve -ne 0 ]]; then
                log_fail "ZFS get -p reservation did not return 0"
        fi
 
-       reserve=`$ZFS get -H reservation $FS | $AWK '{print $3}'`
+       reserve=`zfs get -H reservation $FS | awk '{print $3}'`
        if [[ $reserve != "none" ]]; then
                log_fail "ZFS get reservation did not return 'none'"
        fi
index 1697f628eed49ab2837042ba6861f49b8e7584c2..90e7b8340a039d98d0780e2c9d706b41904bcecd 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_rollback/zfs_rollback_common.kshlib
 
@@ -68,12 +72,12 @@ function test_n_check #opt num_snap_clone num_rollback
                log_fail "Unsupported testing condition."
 
        # Clean up the test environment
-       datasetexists $FS && log_must $ZFS destroy -Rf $FS
+       datasetexists $FS && log_must zfs destroy -Rf $FS
        if datasetexists $VOL; then
-               $DF -lhF ufs "$ZVOL_DEVDIR/$VOL" > /dev/null 2>&1
-               (( $? == 0 )) && log_must $UMOUNT -f $TESTDIR1
+               df -lhF ufs "$ZVOL_DEVDIR/$VOL" > /dev/null 2>&1
+               (( $? == 0 )) && log_must umount -f $TESTDIR1
 
-               log_must $ZFS destroy -Rf $VOL
+               log_must zfs destroy -Rf $VOL
        fi
 
        # Create specified test environment
@@ -113,12 +117,12 @@ function test_n_check #opt num_snap_clone num_rollback
                fi
 
                if [[ $dtst == $VOL ]]; then
-                       log_must $UMOUNT -f $TESTDIR1
-                       log_must $ZFS rollback $opt $dtst@$snap_point
-                       log_must $MOUNT \
+                       log_must umount -f $TESTDIR1
+                       log_must zfs rollback $opt $dtst@$snap_point
+                       log_must mount \
                                $ZVOL_DEVDIR/$TESTPOOL/$TESTVOL $TESTDIR1
                else
-                       log_must $ZFS rollback $opt $dtst@$snap_point
+                       log_must zfs rollback $opt $dtst@$snap_point
                fi
 
                for snap in $all_snap; do
index 8da658934ed91beae226ae5f024af177a0db8278..659660dc0fe796e0129b958d3770a02289c7cecd 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_rollback/zfs_rollback_common.kshlib
 
@@ -53,11 +57,11 @@ setup_snap_env 1
 #
 write_mountpoint_dir ${FSSNAP0%%@*}
 
-log_must $ZFS rollback $FSSNAP0
-log_must $ZFS rollback -f $FSSNAP0
+log_must zfs rollback $FSSNAP0
+log_must zfs rollback -f $FSSNAP0
 log_must datasetexists $FSSNAP0
 
-$PKILL ${DD##*/}
+pkill ${DD##*/}
 
 check_files $FSSNAP0
 
index 2c768fcbbdf24afd526b6ca570a1c8883a56c53e..0ae13d3a9bad8bf5390a5796107c710dfa665957 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_rollback/zfs_rollback_common.kshlib
 
@@ -45,10 +49,10 @@ verify_runnable "both"
 
 function cleanup
 {
-       $PKILL ${DD##*/}
+       pkill ${DD##*/}
        for snap in $FSSNAP0 $FSSNAP1 $FSSNAP2; do
                if snapexists $snap; then
-                       log_must $ZFS destroy -Rf $snap
+                       log_must zfs destroy -Rf $snap
                fi
        done
 }
@@ -64,8 +68,8 @@ create_snapshot $TESTPOOL/$TESTFS $TESTSNAP1
 
 # Run 'zfs rollback ""|-f <snap>' and it should fail.
 #
-log_mustnot $ZFS rollback $TESTPOOL/$TESTFS@$TESTSNAP
-log_mustnot $ZFS rollback -f $TESTPOOL/$TESTFS@$TESTSNAP
+log_mustnot zfs rollback $TESTPOOL/$TESTFS@$TESTSNAP
+log_mustnot zfs rollback -f $TESTPOOL/$TESTFS@$TESTSNAP
 
 # Create 'clone1' based on 'snap1'.
 #
@@ -73,8 +77,8 @@ create_clone $TESTPOOL/$TESTFS@$TESTSNAP1 $TESTPOOL/$TESTCLONE1
 
 # Run 'zfs rollback -r|-rf <snap>' and it should fail.
 #
-log_mustnot $ZFS rollback -r $TESTPOOL/$TESTFS@$TESTSNAP
-log_mustnot $ZFS rollback -rf $TESTPOOL/$TESTFS@$TESTSNAP
+log_mustnot zfs rollback -r $TESTPOOL/$TESTFS@$TESTSNAP
+log_mustnot zfs rollback -rf $TESTPOOL/$TESTFS@$TESTSNAP
 
 log_pass "zfs rollback ''|-f|-r|-rf will fail in different conditions " \
        "passed."
index a0aab0789996c7496eebf49a6112f625d5f11596..0c1bb730e77c6085e1e20ac5b8dd411fa97f16fe 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_rollback/zfs_rollback_common.kshlib
 
@@ -48,7 +52,7 @@ function cleanup
 
        for ds in $TESTPOOL $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL; do
                if snapexists ${ds}@$TESTSNAP; then
-                       log_must $ZFS destroy ${ds}@$TESTSNAP
+                       log_must zfs destroy ${ds}@$TESTSNAP
                fi
        done
 }
@@ -60,21 +64,21 @@ log_onexit cleanup
 set -A badopts "r" "R" "f" "-F" "-rF" "-RF" "-fF" "-?" "-*" "-blah" "-1" "-2"
 
 for ds in $TESTPOOL $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL; do
-       log_must $ZFS snapshot ${ds}@$TESTSNAP
+       log_must zfs snapshot ${ds}@$TESTSNAP
 done
 
 for ds in $TESTPOOL $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL; do
        for opt in "" "-r" "-R" "-f" "-rR" "-rf" "-rRf"; do
-               log_mustnot eval "$ZFS rollback $opt $ds >/dev/null 2>&1"
-               log_mustnot eval "$ZFS rollback $opt ${ds}@$TESTSNAP \
+               log_mustnot eval "zfs rollback $opt $ds >/dev/null 2>&1"
+               log_mustnot eval "zfs rollback $opt ${ds}@$TESTSNAP \
                        ${ds}@$TESTSNAP >/dev/null 2>&1"
-               log_mustnot eval "$ZFS rollback $opt >/dev/null 2>&1"
+               log_mustnot eval "zfs rollback $opt >/dev/null 2>&1"
                # zfs rollback should fail with non-existen snapshot
-               log_mustnot eval "$ZFS rollback $opt ${ds}@nosnap >/dev/null 2>&1"
+               log_mustnot eval "zfs rollback $opt ${ds}@nosnap >/dev/null 2>&1"
        done
 
        for badopt in ${badopts[@]}; do
-               log_mustnot eval "$ZFS rollback $badopt ${ds}@$TESTSNAP \
+               log_mustnot eval "zfs rollback $badopt ${ds}@$TESTSNAP \
                                >/dev/null 2>&1"
        done
 done
index f9b930195edfcb668da413fa29fb39c96d694be8..9faf8dfcc0103393b54a91c6b0aafaef02b6f14b 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -38,7 +38,7 @@ function getsum #fname
 {
        (( ${#1} == 0 )) && \
                log_fail "Need give file name."
-       return $($SUM $1 | $AWK '{print $1}')
+       return $(sum $1 | awk '{print $1}')
 }
 
 # Define global variable checksum, get the original file sum.
@@ -58,12 +58,12 @@ function setup_snap_env
        typeset createclone=${2:-"false"}
 
        if datasetnonexists $FS; then
-               log_must $ZFS create $FS
-               log_must $ZFS set mountpoint=$TESTDIR $FS
+               log_must zfs create $FS
+               log_must zfs set mountpoint=$TESTDIR $FS
        fi
        # Volume can't be created in Local Zone.
        if datasetnonexists $VOL && is_global_zone; then
-               log_must $ZFS create -V $VOLSIZE $VOL
+               log_must zfs create -V $VOLSIZE $VOL
                block_device_wait
        fi
 
@@ -76,15 +76,15 @@ function setup_snap_env
                # mount it. Otherwise, only check if this ufs|ext2 file system
                # was mounted.
                #
-               log_must eval "$ECHO "y" | \
-                       $NEWFS -v $ZVOL_DEVDIR/$VOL > /dev/null 2>&1"
+               log_must eval "echo "y" | \
+                       newfs -v $ZVOL_DEVDIR/$VOL > /dev/null 2>&1"
 
-               [[ ! -d $TESTDIR1 ]] && log_must $MKDIR $TESTDIR1
+               [[ ! -d $TESTDIR1 ]] && log_must mkdir $TESTDIR1
 
                # Make sure the ufs|ext2 filesystem hasn't been mounted,
                # then mount the new ufs|ext2 filesystem.
                if ! ismounted "$ZVOL_DEVDIR/$VOL" $NEWFS_DEFAULT_FS; then
-                       log_must $MOUNT \
+                       log_must mount \
                                $ZVOL_DEVDIR/$TESTPOOL/$TESTVOL $TESTDIR1
                fi
        fi
@@ -116,9 +116,9 @@ function setup_snap_env
                        esac
 
                        if datasetnonexists $snap; then
-                               log_must $CP /etc/passwd $fname
+                               log_must cp /etc/passwd $fname
                                if is_linux; then
-                                       log_must $SYNC
+                                       log_must sync
                                else
                                        #
                                        # using 'lockfs -f' to flush the writes
@@ -128,11 +128,11 @@ function setup_snap_env
                                                log_must $LOCKFS -f $TESTDIR1
                                        fi
                                fi
-                               log_must $ZFS snapshot $snap
+                               log_must zfs snapshot $snap
                        fi
                        if [[ $createclone == "true" ]]; then
                                if datasetnonexists $clone; then
-                                       log_must $ZFS clone $snap $clone
+                                       log_must zfs clone $snap $clone
                                fi
                        fi
                        (( ind += 1 ))
@@ -157,32 +157,32 @@ function cleanup_env
        typeset dtst
        typeset snap
 
-       $PKILL ${DD##*/}
+       pkill ${DD##*/}
 
        if ismounted $TESTDIR1 $NEWFS_DEFAULT_FS; then
-               log_must $UMOUNT -f $TESTDIR1
+               log_must umount -f $TESTDIR1
        fi
 
-       [[ -d $TESTDIR ]] && log_must $RM -rf $TESTDIR/*
-       [[ -d $TESTDIR1 ]] && log_must $RM -rf $TESTDIR1/*
+       [[ -d $TESTDIR ]] && log_must rm -rf $TESTDIR/*
+       [[ -d $TESTDIR1 ]] && log_must rm -rf $TESTDIR1/*
 
        for dtst in $FS $VOL; do
                for snap in $TESTSNAP $TESTSNAP1 $TESTSNAP2; do
                        if snapexists $dtst@$snap; then
-                                log_must $ZFS destroy -Rf $dtst@$snap
+                                log_must zfs destroy -Rf $dtst@$snap
                        fi
                done
        done
 
        # Restore original test environment
        if datasetnonexists $FS ; then
-               log_must $ZFS create $FS
+               log_must zfs create $FS
        fi
        if datasetnonexists $VOL ; then
                if is_global_zone ; then
-                       log_must $ZFS create -V $VOLSIZE $VOL
+                       log_must zfs create -V $VOLSIZE $VOL
                else
-                       log_must $ZFS create $VOL
+                       log_must zfs create $VOL
                fi
        fi
 }
@@ -303,6 +303,6 @@ function write_mountpoint_dir
                dir=$TESTDIR1
                log_must ismounted $dir $NEWFS_DEFAULT_FS
        fi
-       $DD if=/dev/urandom of=$dir/$TESTFILE1 &
-       log_must $SLEEP 3
+       dd if=/dev/urandom of=$dir/$TESTFILE1 &
+       log_must sleep 3
 }
index 0f3ae6143f5c4dec2effab25a306bd21e4a7d203..f28ce06fd7af828d81ac601d0b9e013961e3b7e7 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cli_root/cli_common.kshlib
@@ -51,21 +51,21 @@ function cleanup
 {
        for snap in $init_snap $inc_snap $rst_snap $rst_inc_snap; do
                 snapexists $snap && \
-                        log_must $ZFS destroy -f $snap
+                        log_must zfs destroy -f $snap
         done
 
        datasetexists $rst_root && \
-               log_must $ZFS destroy -Rf $rst_root
+               log_must zfs destroy -Rf $rst_root
 
        for file in $full_bkup $inc_bkup \
                        $init_data $inc_data
        do
                [[ -e $file ]] && \
-                       log_must $RM -f $file
+                       log_must rm -f $file
        done
 
        [[ -d $TESTDIR1 ]] && \
-               log_must $RM -rf $TESTDIR1
+               log_must rm -rf $TESTDIR1
 
 }
 
@@ -90,37 +90,37 @@ rst_inc_data=$TESTDIR1/$TESTFS/$TESTFILE2
 log_note "Verify 'zfs send' can create full send stream."
 
 #Pre-paration
-log_must $ZFS create $rst_root
+log_must zfs create $rst_root
 [[ ! -d $TESTDIR1 ]] && \
-       log_must $MKDIR -p $TESTDIR1
-log_must $ZFS set mountpoint=$TESTDIR1 $rst_root
+       log_must mkdir -p $TESTDIR1
+log_must zfs set mountpoint=$TESTDIR1 $rst_root
 
-$FILE_WRITE -o create -f $init_data -b $BLOCK_SIZE -c $WRITE_COUNT
+file_write -o create -f $init_data -b $BLOCK_SIZE -c $WRITE_COUNT
 
-log_must $ZFS snapshot $init_snap
-$ZFS send $init_snap > $full_bkup
+log_must zfs snapshot $init_snap
+zfs send $init_snap > $full_bkup
 (( $? != 0 )) && \
-       log_fail "'$ZFS send' fails to create full send"
+       log_fail "'zfs send' fails to create full send"
 
 log_note "Verify the send stream is valid to receive."
 
-log_must $ZFS receive $rst_snap <$full_bkup
+log_must zfs receive $rst_snap <$full_bkup
 receive_check $rst_snap ${rst_snap%%@*}
 compare_cksum $init_data $rst_data
 
 log_note "Verify 'zfs send -i' can create incremental send stream."
 
-$FILE_WRITE -o create -f $inc_data -b $BLOCK_SIZE -c $WRITE_COUNT -d 0
+file_write -o create -f $inc_data -b $BLOCK_SIZE -c $WRITE_COUNT -d 0
 
-log_must $ZFS snapshot $inc_snap
-$ZFS send -i $init_snap $inc_snap > $inc_bkup
+log_must zfs snapshot $inc_snap
+zfs send -i $init_snap $inc_snap > $inc_bkup
 (( $? != 0 )) && \
-       log_fail "'$ZFS send -i' fails to create incremental send"
+       log_fail "'zfs send -i' fails to create incremental send"
 
 log_note "Verify the incremental send stream is valid to receive."
 
-log_must $ZFS rollback $rst_snap
-log_must $ZFS receive $rst_inc_snap <$inc_bkup
+log_must zfs rollback $rst_snap
+log_must zfs receive $rst_inc_snap <$inc_bkup
 receive_check $rst_inc_snap
 compare_cksum $inc_data $rst_inc_data
 
index b542bf9dac5839af415d85e34af5be52e4e673ce..0c21e4175f1016ee8654a9918e989031812e33d9 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cli_root/cli_common.kshlib
@@ -49,16 +49,16 @@ verify_runnable "both"
 function cleanup
 {
        snapexists $snap && \
-               log_must $ZFS destroy $snap
+               log_must zfs destroy $snap
 
        datasetexists $ctr && \
-               log_must $ZFS destroy -r $ctr
+               log_must zfs destroy -r $ctr
 
        [[ -e $origfile ]] && \
-               log_must $RM -f $origfile
+               log_must rm -f $origfile
 
        [[ -e $stream ]] && \
-               log_must $RM -f $stream
+               log_must rm -f $stream
 }
 
 function do_testing # <prop> <prop_value>
@@ -66,21 +66,21 @@ function do_testing # <prop> <prop_value>
        typeset property=$1
        typeset prop_val=$2
 
-       log_must $ZFS set $property=$prop_val $fs
-       $FILE_WRITE -o create -f $origfile -b $BLOCK_SIZE -c $WRITE_COUNT
-       log_must $ZFS snapshot $snap
-       $ZFS send $snap > $stream
+       log_must zfs set $property=$prop_val $fs
+       file_write -o create -f $origfile -b $BLOCK_SIZE -c $WRITE_COUNT
+       log_must zfs snapshot $snap
+       zfs send $snap > $stream
        (( $? != 0 )) && \
-               log_fail "'$ZFS send' fails to create send streams."
-       $ZFS receive -d $ctr <$stream
+               log_fail "'zfs send' fails to create send streams."
+       zfs receive -d $ctr <$stream
        (( $? != 0 )) && \
-               log_fail "'$ZFS receive' fails to receive send streams."
+               log_fail "'zfs receive' fails to receive send streams."
 
        #verify receive result
        ! datasetexists $rstfs && \
-               log_fail "'$ZFS receive' fails to restore $rstfs"
+               log_fail "'zfs receive' fails to restore $rstfs"
        ! snapexists $rstfssnap && \
-               log_fail "'$ZFS receive' fails to restore $rstfssnap"
+               log_fail "'zfs receive' fails to restore $rstfssnap"
        if [[ ! -e $rstfile ]] || [[ ! -e $rstsnapfile ]]; then
                log_fail " Data lost after receiving stream"
        fi
@@ -89,13 +89,13 @@ function do_testing # <prop> <prop_value>
        compare_cksum $origsnapfile $rstsnapfile
 
        #Destroy datasets and stream for next testing
-       log_must $ZFS destroy $snap
+       log_must zfs destroy $snap
        if is_global_zone ; then
-               log_must $ZFS destroy -r $rstfs
+               log_must zfs destroy -r $rstfs
        else
-               log_must $ZFS destroy -r $ds_path
+               log_must zfs destroy -r $ds_path
        fi
-       log_must $RM -f $stream
+       log_must rm -f $stream
 }
 
 log_assert "Verify 'zfs send' generates valid streams with a property setup"
@@ -123,7 +123,7 @@ set -A propval "on lzjb" "on fletcher2 fletcher4 sha256" \
        "512 1k 4k 8k 16k 32k 64k 128k"
 
 #Create a dataset to receive the send stream
-log_must $ZFS create $ctr
+log_must zfs create $ctr
 
 typeset -i i=0
 while (( i < ${#props[*]} ))
index 749f0740f1282f70d354ca1f5e96d488f00b1a5d..825a10d0f8a2b5722bdae41650103a382c271af9 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -40,8 +44,8 @@ verify_runnable "both"
 
 function cleanup
 {
-       datasetexists $snap1 && log_must $ZFS destroy $snap1
-       datasetexists $snap2 && log_must $ZFS destroy $snap2
+       datasetexists $snap1 && log_must zfs destroy $snap1
+       datasetexists $snap2 && log_must zfs destroy $snap2
 }
 
 log_assert "'zfs send -i' can deal with abbreviated snapshot name."
@@ -52,12 +56,12 @@ snap1=$TESTPOOL/$TESTFS@snap1; snap2=$TESTPOOL/$TESTFS@snap2
 set -A args "$snap1 $snap2" \
        "${snap1##*@} $snap2" "@${snap1##*@} $snap2"
 
-log_must $ZFS snapshot $snap1
-log_must $ZFS snapshot $snap2
+log_must zfs snapshot $snap1
+log_must zfs snapshot $snap2
 
 typeset -i i=0
 while (( i < ${#args[*]} )); do
-       log_must eval "$ZFS send -i ${args[i]} > /dev/null"
+       log_must eval "zfs send -i ${args[i]} > /dev/null"
 
        (( i += 1 ))
 done
index 4f0bf2b5c3dc6582ea8bcca0300df9e746b78eb4..da14fa2fa62c7387d553002cac945527e9c64e41 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/cli_common.kshlib
 
 #
@@ -45,12 +49,12 @@ function cleanup
 
        for snap in $snap1 $snap2 $snap3; do
                snapexists $snap && \
-                       log_must $ZFS destroy -f $snap
+                       log_must zfs destroy -f $snap
        done
 
        for f in $tmpfile1 $tmpfile2; do
                if [[ -e $f ]]; then
-                       $RM -f $f
+                       rm -f $f
                fi
        done
 }
@@ -81,25 +85,25 @@ set -A badargs \
 log_assert "Verify that invalid parameters to 'zfs send' are caught."
 log_onexit cleanup
 
-log_must $ZFS snapshot $snap1
+log_must zfs snapshot $snap1
 tmpfile1=$TESTDIR/testfile1.$$
-log_must $TOUCH $tmpfile1
-log_must $ZFS snapshot $snap2
+log_must touch $tmpfile1
+log_must zfs snapshot $snap2
 tmpfile2=$TESTDIR/testfile2.$$
-log_must $TOUCH $tmpfile2
-log_must $ZFS snapshot $snap3
+log_must touch $tmpfile2
+log_must zfs snapshot $snap3
 
 typeset -i i=0
 while (( i < ${#badargs[*]} ))
 do
-       log_mustnot eval "$ZFS send ${badargs[i]} >/dev/null"
+       log_mustnot eval "zfs send ${badargs[i]} >/dev/null"
 
        (( i = i + 1 ))
 done
 
 #Testing zfs send fails by send backup stream to terminal
 for arg in "$snap1" "-i $snap1 $snap2"; do
-       log_mustnot eval "$ZFS send $arg >/dev/console"
+       log_mustnot eval "zfs send $arg >/dev/console"
 done
 
 log_pass "Invalid parameters to 'zfs send' are caught as expected."
index ffabfe180071d24dbbad5bc9e2f82514410eabf0..f24ce7f922ca06a93827dbe5a5bb2ad15b80aa52 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -46,21 +46,21 @@ verify_runnable "both"
 
 function cleanup
 {
-       poolexists $TESTPOOL && log_must $ZPOOL export $TESTPOOL
-       log_must $ZPOOL import $TESTPOOL
+       poolexists $TESTPOOL && log_must zpool export $TESTPOOL
+       log_must zpool import $TESTPOOL
 
        datasetexists $TESTPOOL@snap && \
-           log_must $ZFS destroy -r $TESTPOOL@snap
+           log_must zfs destroy -r $TESTPOOL@snap
 }
 
 log_assert "'zfs send -R' can send from read-only pools"
 log_onexit cleanup
 
-log_must $ZFS snapshot -r $TESTPOOL@snap
+log_must zfs snapshot -r $TESTPOOL@snap
 
-log_must $ZPOOL export $TESTPOOL
-log_must $ZPOOL import -o readonly=on $TESTPOOL
+log_must zpool export $TESTPOOL
+log_must zpool import -o readonly=on $TESTPOOL
 
-log_must eval "$ZFS send -R $TESTPOOL@snap >/dev/null"
+log_must eval "zfs send -R $TESTPOOL@snap >/dev/null"
 
 log_pass "'zfs send -R' can send from read-only pools"
index 7580c6d6f40a68a5969ee61310a32e1892ca36b3..801633e1fed61a86e0169bc2928e394cd44438a8 100755 (executable)
@@ -15,7 +15,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -37,15 +37,15 @@ verify_runnable "both"
 function cleanup
 {
        for ds in $datasets; do
-                datasetexists $ds && $ZFS destroy -rf $ds
+                datasetexists $ds && zfs destroy -rf $ds
        done
 }
 
 function cal_percentage
 {
        typeset value=$1
-       return=$($ECHO "$PERCENT * $value" | bc)
-       return=$($ECHO "$return / 100" | bc)
+       return=$(echo "$PERCENT * $value" | bc)
+       return=$(echo "$return / 100" | bc)
        echo $return
 }
 
@@ -55,19 +55,19 @@ function get_estimate_size
        typeset option=$2
        typeset base_snapshot=${3:-""}
        if [[ -z $3 ]];then
-               typeset total_size=$($ZFS send $option $snapshot 2>&1 | $TAIL -1)
+               typeset total_size=$(zfs send $option $snapshot 2>&1 | tail -1)
        else
-               typeset total_size=$($ZFS send $option $base_snapshot $snapshot \
-                    2>&1 | $TAIL -1)
+               typeset total_size=$(zfs send $option $base_snapshot $snapshot \
+                    2>&1 | tail -1)
        fi
        if [[ $options == *"P"* ]]; then
-               total_size=$($ECHO "$total_size" | $AWK '{print $2}')
+               total_size=$(echo "$total_size" | awk '{print $2}')
        else
-               total_size=$($ECHO "$total_size" | $AWK '{print $5}')
+               total_size=$(echo "$total_size" | awk '{print $5}')
                total_size=${total_size%M}
-               total_size=$($ECHO "$total_size * $block_count" | bc)
+               total_size=$(echo "$total_size * $block_count" | bc)
        fi
-       $ECHO $total_size
+       echo $total_size
 
 }
 
@@ -75,12 +75,12 @@ function verify_size_estimates
 {
        typeset options=$1
        typeset file_size=$2
-       typeset refer_diff=$($ECHO "$refer_size - $estimate_size" | bc)
-       refer_diff=$($ECHO "$refer_diff / 1" | bc)
-       refer_diff=$($ECHO "$refer_diff" | $NAWK '{print ($1 < 0) ? ($1 * -1): $1'})
-       typeset file_diff=$($ECHO "$file_size - $estimate_size" | bc)
-       file_diff=$($ECHO "$file_diff / 1" | bc)
-       file_diff=$($ECHO "$file_diff" | $NAWK '{print ($1 < 0) ? ($1 * -1):$1'})
+       typeset refer_diff=$(echo "$refer_size - $estimate_size" | bc)
+       refer_diff=$(echo "$refer_diff / 1" | bc)
+       refer_diff=$(echo "$refer_diff" | nawk '{print ($1 < 0) ? ($1 * -1): $1'})
+       typeset file_diff=$(echo "$file_size - $estimate_size" | bc)
+       file_diff=$(echo "$file_diff / 1" | bc)
+       file_diff=$(echo "$file_diff" | nawk '{print ($1 < 0) ? ($1 * -1):$1'})
        typeset expected_diff=$(cal_percentage $refer_size)
 
        [[ -z $refer_diff && -z $file_diff && -z $expected_diff ]] && \
@@ -99,21 +99,21 @@ typeset -i PERCENT=1
 ((block_count=1024*1024))
 
 # create dataset
-log_must $ZFS create $TESTPOOL/$TESTFS1
+log_must zfs create $TESTPOOL/$TESTFS1
 
 # create multiple snapshot for the dataset with data
 for block_size in 64 128 256; do
-       log_must $DD if=/dev/urandom of=/$TESTPOOL/$TESTFS1/file$block_size \
+       log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS1/file$block_size \
            bs=1M count=$block_size
-       log_must $ZFS snapshot $TESTPOOL/$TESTFS1@snap$block_size
+       log_must zfs snapshot $TESTPOOL/$TESTFS1@snap$block_size
 done
 
 full_snapshot="$TESTPOOL/$TESTFS1@snap64"
 increamental_snapshot="$TESTPOOL/$TESTFS1@snap256"
 
-full_size=$($ZFS send $full_snapshot 2>&1 | wc -c)
-increamental_size=$($ZFS send $increamental_snapshot 2>&1 | wc -c)
-increamental_send=$($ZFS send -i $full_snapshot $increamental_snapshot 2>&1 | wc -c)
+full_size=$(zfs send $full_snapshot 2>&1 | wc -c)
+increamental_size=$(zfs send $increamental_snapshot 2>&1 | wc -c)
+increamental_send=$(zfs send -i $full_snapshot $increamental_snapshot 2>&1 | wc -c)
 
 log_note "verify zfs send -nv"
 options="-nv"
@@ -144,7 +144,7 @@ log_note "verify zfs send -inv for increamental send"
 options="-nvi"
 refer_size=$(get_prop refer $increamental_snapshot)
 deduct_size=$(get_prop refer $full_snapshot)
-refer_size=$($ECHO "$refer_size - $deduct_size" | bc)
+refer_size=$(echo "$refer_size - $deduct_size" | bc)
 
 estimate_size=$(get_estimate_size $increamental_snapshot $options $full_snapshot)
 log_must verify_size_estimates $options $increamental_send
@@ -155,33 +155,33 @@ options="-vPni"
 estimate_size=$(get_estimate_size $increamental_snapshot $options $full_snapshot)
 log_must verify_size_estimates $options $increamental_send
 
-log_must $ZFS destroy -r $TESTPOOL/$TESTFS1
+log_must zfs destroy -r $TESTPOOL/$TESTFS1
 
 #setup_recursive_send
 datasets="$TESTPOOL/$TESTFS1 $TESTPOOL/$TESTFS1/$TESTFS2
     $TESTPOOL/$TESTFS1/$TESTFS2/$TESTFS3"
 # create nested datasets
-log_must $ZFS create -p $TESTPOOL/$TESTFS1/$TESTFS2/$TESTFS3
+log_must zfs create -p $TESTPOOL/$TESTFS1/$TESTFS2/$TESTFS3
 
 # verify dataset creation
 for ds in $datasets; do
         datasetexists $ds || log_fail "Create $ds dataset fail."
 done
 for ds in $datasets; do
-       log_must $DD if=/dev/urandom of=/$ds/file64 \
+       log_must dd if=/dev/urandom of=/$ds/file64 \
            bs=1M count=64
 done
 
 # create recursive nested snapshot
-log_must $ZFS snapshot -r $TESTPOOL/$TESTFS1@snap64
+log_must zfs snapshot -r $TESTPOOL/$TESTFS1@snap64
 for ds in $datasets; do
         datasetexists $ds@snap64 || log_fail "Create $ds@snap64 snapshot fail."
 done
-recursive_size=$($ZFS send -R $full_snapshot 2>&1 | wc -c)
+recursive_size=$(zfs send -R $full_snapshot 2>&1 | wc -c)
 log_note "verify zfs send -Rnv for recursive send"
 options="-Rnv"
 refer_size=$(get_prop refer $full_snapshot)
-refer_size=$($ECHO "$refer_size * 3" | bc)
+refer_size=$(echo "$refer_size * 3" | bc)
 
 estimate_size=$(get_estimate_size $full_snapshot $options)
 log_must verify_size_estimates $options $recursive_size
index 308903d9700e756e14441a6639f668f74d5b38a1..3147a7a14a549fa2d6b88587baf0658b469fe14c 100755 (executable)
@@ -38,11 +38,11 @@ verify_runnable "both"
 
 function cleanup
 {
-       $ZFS destroy -rf $TESTPOOL/fs
-       $ZFS destroy -rf $TESTPOOL/recvfs
-       $RM $streamfile
-       $RM $vdev
-       $ZPOOL destroy testpool
+       zfs destroy -rf $TESTPOOL/fs
+       zfs destroy -rf $TESTPOOL/recvfs
+       rm $streamfile
+       rm $vdev
+       zpool destroy testpool
 }
 
 
@@ -55,45 +55,45 @@ vdev=$(mktemp /var/tmp/file.XXXXXX)
 test_pool ()
 {
        POOL=$1
-       log_must $ZFS create -o recordsize=512 $POOL/fs
+       log_must zfs create -o recordsize=512 $POOL/fs
        mntpnt=$(get_prop mountpoint "$POOL/fs")
-       log_must $DD if=/dev/urandom of=${mntpnt}/file bs=512 count=1 2>/dev/null
+       log_must dd if=/dev/urandom of=${mntpnt}/file bs=512 count=1 2>/dev/null
        first_object=$(ls -i $mntpnt | awk '{print $1}')
-       log_must $ZFS snapshot $POOL/fs@a
+       log_must zfs snapshot $POOL/fs@a
        while true; do
-               log_must $FIND $mntpnt/* -delete
+               log_must find $mntpnt/* -delete
                sync
-               log_must $MKFILES "$mntpnt/" 4000
+               log_must mkfiles "$mntpnt/" 4000
                FILE=$(ls -i $mntpnt | awk \
                        '{if ($1 == '$first_object') {print $2}}')
                if [[ -n "$FILE" ]]; then
                        break
                fi
        done
-       $DD if=/dev/urandom of=${mntpnt}/$FILE bs=512 count=1 seek=1 2>/dev/null
+       dd if=/dev/urandom of=${mntpnt}/$FILE bs=512 count=1 seek=1 2>/dev/null
 
-       log_must $ZFS snapshot $POOL/fs@b
+       log_must zfs snapshot $POOL/fs@b
 
-       log_must eval "$ZFS send $POOL/fs@a > $streamfile"
-       $CAT $streamfile | log_must $ZFS receive $POOL/recvfs
+       log_must eval "zfs send $POOL/fs@a > $streamfile"
+       cat $streamfile | log_must zfs receive $POOL/recvfs
 
-       log_must eval "$ZFS send -i @a $POOL/fs@b > $streamfile"
-       $CAT $streamfile | log_must $ZFS receive $POOL/recvfs
+       log_must eval "zfs send -i @a $POOL/fs@b > $streamfile"
+       cat $streamfile | log_must zfs receive $POOL/recvfs
 
        recv_mntpnt=$(get_prop mountpoint "$POOL/recvfs")
-       log_must $DIFF -r $mntpnt $recv_mntpnt
-       log_must $ZFS destroy -rf $POOL/fs
-       log_must $ZFS destroy -rf $POOL/recvfs
+       log_must diff -r $mntpnt $recv_mntpnt
+       log_must zfs destroy -rf $POOL/fs
+       log_must zfs destroy -rf $POOL/recvfs
 }
 
 test_pool $TESTPOOL
-log_must $TRUNCATE --size=1G $vdev
-log_must $ZPOOL create -o version=1 testpool $vdev
+log_must truncate --size=1G $vdev
+log_must zpool create -o version=1 testpool $vdev
 test_pool testpool
-log_must $ZPOOL destroy testpool
-log_must $ZPOOL create -d testpool $vdev
+log_must zpool destroy testpool
+log_must zpool create -d testpool $vdev
 test_pool testpool
-log_must $ZPOOL destroy testpool
+log_must zpool destroy testpool
 
 
 log_pass "'zfs send' drills appropriate holes"
index 653f31acd08e277632becefe13d6bbfd1ae84220..5fbc8bf71657e4662f61cc2269cff2d31bc80bd7 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
 
@@ -53,7 +57,7 @@ do
        while (( i < ${#dataset[@]} )); do
                j=0
                while (( j < ${#values[@]} )); do
-                       log_mustnot $ZFS set $propname=${values[j]} ${dataset[i]}
+                       log_mustnot zfs set $propname=${values[j]} ${dataset[i]}
                        (( j += 1 ))
                done
                (( i += 1 ))
index de219c4f1858cff08b3bd1569408d960d914ecbf..dd3397f01579f6449f56926496590b8e0d1aa620 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
 
@@ -60,19 +64,19 @@ set -A values "on" "off"
 function cleanup
 {
        if snapexists $TESTPOOL/$TESTFS@$TESTSNAP ; then
-               log_must $ZFS destroy -R $TESTPOOL/$TESTFS@$TESTSNAP
+               log_must zfs destroy -R $TESTPOOL/$TESTFS@$TESTSNAP
        fi
        if snapexists $TESTPOOL/$TESTVOL@$TESTSNAP ; then
-               log_must $ZFS destroy -R $TESTPOOL/$TESTVOL@$TESTSNAP
+               log_must zfs destroy -R $TESTPOOL/$TESTVOL@$TESTSNAP
        fi
 
        [[ -n $old_ctr_canmount ]] && \
-               log_must $ZFS set canmount=$old_ctr_canmount $TESTPOOL/$TESTCTR
+               log_must zfs set canmount=$old_ctr_canmount $TESTPOOL/$TESTCTR
        [[ -n $old_fs_canmount ]] && \
-               log_must $ZFS set canmount=$old_fs_canmount $TESTPOOL/$TESTFS
+               log_must zfs set canmount=$old_fs_canmount $TESTPOOL/$TESTFS
 
-       $ZFS unmount -a > /dev/null 2>&1
-       log_must $ZFS mount -a
+       zfs unmount -a > /dev/null 2>&1
+       log_must zfs mount -a
 }
 
 log_assert "Setting a valid property of canmount to file system, it must be successful."
@@ -87,21 +91,21 @@ old_ctr_canmount=$(get_prop canmount $TESTPOOL/$TESTCTR)
 [[ $? != 0 ]] && \
        log_fail "Get the $TESTPOOL/$TESTCTR canmount error."
 
-log_must $ZFS snapshot $TESTPOOL/$TESTFS@$TESTSNAP
-log_must $ZFS snapshot $TESTPOOL/$TESTVOL@$TESTSNAP
-log_must $ZFS clone $TESTPOOL/$TESTFS@$TESTSNAP $TESTPOOL/$TESTCLONE
-log_must $ZFS clone $TESTPOOL/$TESTVOL@$TESTSNAP $TESTPOOL/$TESTCLONE1
+log_must zfs snapshot $TESTPOOL/$TESTFS@$TESTSNAP
+log_must zfs snapshot $TESTPOOL/$TESTVOL@$TESTSNAP
+log_must zfs clone $TESTPOOL/$TESTFS@$TESTSNAP $TESTPOOL/$TESTCLONE
+log_must zfs clone $TESTPOOL/$TESTVOL@$TESTSNAP $TESTPOOL/$TESTCLONE1
 
 for dataset in "${dataset_pos[@]}" ; do
        for value in "${values[@]}" ; do
                set_n_check_prop "$value" "canmount" "$dataset"
                if [[ $value == "off" ]]; then
                        log_mustnot ismounted $dataset
-                       log_mustnot $ZFS mount $dataset
+                       log_mustnot zfs mount $dataset
                        log_mustnot ismounted $dataset
                else
                        if ! ismounted $dataset ; then
-                               log_must $ZFS mount $dataset
+                               log_must zfs mount $dataset
                        fi
                        log_must ismounted $dataset
                fi
index 447a9e8034ebd4caaaa0a8fdc840e159cbdc7435..7cbcf7903e33fd2ffb759faead6ceaf22303eb73 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -65,8 +65,8 @@ function cleanup
        while (( i < ${#dataset_pos[*]} )); do
                ds=${dataset_pos[i]}
                if datasetexists $ds; then
-                       log_must $ZFS set mountpoint=${old_mnt[i]} $ds
-                       log_must $ZFS set canmount=${old_canmount[i]} $ds
+                       log_must zfs set mountpoint=${old_mnt[i]} $ds
+                       log_must zfs set canmount=${old_canmount[i]} $ds
                fi
                (( i = i + 1 ))
        done
@@ -74,24 +74,24 @@ function cleanup
        ds=$TESTPOOL/$TESTCLONE
        if datasetexists $ds; then
                mntp=$(get_prop mountpoint $ds)
-               log_must $ZFS destroy $ds
+               log_must zfs destroy $ds
                if [[ -d $mntp ]]; then
-                       $RM -fr $mntp
+                       rm -fr $mntp
                fi
        fi
 
        if snapexists $TESTPOOL/$TESTFS@$TESTSNAP ; then
-               log_must $ZFS destroy -R $TESTPOOL/$TESTFS@$TESTSNAP
+               log_must zfs destroy -R $TESTPOOL/$TESTFS@$TESTSNAP
        fi
        if snapexists $TESTPOOL/$TESTVOL@$TESTSNAP ; then
-               log_must $ZFS destroy -R $TESTPOOL/$TESTVOL@$TESTSNAP
+               log_must zfs destroy -R $TESTPOOL/$TESTVOL@$TESTSNAP
        fi
 
-       $ZFS unmount -a > /dev/null 2>&1
-       log_must $ZFS mount -a
+       zfs unmount -a > /dev/null 2>&1
+       log_must zfs mount -a
 
        if [[ -d $tmpmnt ]]; then
-               $RM -fr $tmpmnt
+               rm -fr $tmpmnt
        fi
 }
 
@@ -103,10 +103,10 @@ set -A old_canmount
 typeset tmpmnt=/tmpmount$$
 typeset ds
 
-log_must $ZFS snapshot $TESTPOOL/$TESTFS@$TESTSNAP
-log_must $ZFS snapshot $TESTPOOL/$TESTVOL@$TESTSNAP
-log_must $ZFS clone $TESTPOOL/$TESTFS@$TESTSNAP $TESTPOOL/$TESTCLONE
-log_must $ZFS clone $TESTPOOL/$TESTVOL@$TESTSNAP $TESTPOOL/$TESTCLONE1
+log_must zfs snapshot $TESTPOOL/$TESTFS@$TESTSNAP
+log_must zfs snapshot $TESTPOOL/$TESTVOL@$TESTSNAP
+log_must zfs clone $TESTPOOL/$TESTFS@$TESTSNAP $TESTPOOL/$TESTCLONE
+log_must zfs clone $TESTPOOL/$TESTVOL@$TESTSNAP $TESTPOOL/$TESTCLONE1
 
 typeset -i i=0
 while (( i < ${#dataset_pos[*]} )); do
@@ -120,25 +120,25 @@ i=0
 while (( i < ${#dataset_pos[*]} )) ; do
        dataset=${dataset_pos[i]}
        set_n_check_prop "noauto" "canmount" "$dataset"
-       log_must $ZFS set mountpoint=$tmpmnt $dataset
+       log_must zfs set mountpoint=$tmpmnt $dataset
        if  ismounted $dataset; then
-               $ZFS unmount -a > /dev/null 2>&1
+               zfs unmount -a > /dev/null 2>&1
                log_must mounted $dataset
-               log_must $ZFS unmount $dataset
+               log_must zfs unmount $dataset
                log_must unmounted $dataset
-               log_must $ZFS mount -a
+               log_must zfs mount -a
                log_must unmounted $dataset
        else
-               log_must $ZFS mount -a
+               log_must zfs mount -a
                log_must unmounted $dataset
-               $ZFS unmount -a > /dev/null 2>&1
+               zfs unmount -a > /dev/null 2>&1
                log_must unmounted $dataset
        fi
 
-       log_must $ZFS mount $dataset
+       log_must zfs mount $dataset
        log_must mounted $dataset
-       log_must $ZFS set canmount="${old_canmount[i]}" $dataset
-       log_must $ZFS set mountpoint="${old_mnt[i]}" $dataset
+       log_must zfs set canmount="${old_canmount[i]}" $dataset
+       log_must zfs set mountpoint="${old_mnt[i]}" $dataset
        (( i = i + 1 ))
 done
 
index 886b120f2fa4d609d0aea1c5a62e7e98fbd3eb10..a11cfb40884b16718603e07831b2b67fd8eee5ba 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -54,8 +54,8 @@ function cleanup
        while (( i < ${#dataset_pos[*]} )); do
                ds=${dataset_pos[i]}
                if datasetexists $ds; then
-                       log_must $ZFS set mountpoint=${old_mnt[i]} $ds
-                       log_must $ZFS set canmount=${old_canmount[i]} $ds
+                       log_must zfs set mountpoint=${old_mnt[i]} $ds
+                       log_must zfs set canmount=${old_canmount[i]} $ds
                fi
                (( i = i + 1 ))
        done
@@ -63,18 +63,18 @@ function cleanup
        ds=$TESTPOOL/$TESTCLONE
        if datasetexists $ds; then
                mntp=$(get_prop mountpoint $ds)
-               log_must $ZFS destroy $ds
+               log_must zfs destroy $ds
                if [[ -d $mntp ]]; then
-                       log_must $RM -fr $mntp
+                       log_must rm -fr $mntp
                fi
        fi
 
        if snapexists $TESTPOOL/$TESTFS@$TESTSNAP ; then
-               log_must $ZFS destroy -R $TESTPOOL/$TESTFS@$TESTSNAP
+               log_must zfs destroy -R $TESTPOOL/$TESTFS@$TESTSNAP
        fi
 
-       $ZFS unmount -a > /dev/null 2>&1
-       log_must $ZFS mount -a
+       zfs unmount -a > /dev/null 2>&1
+       log_must zfs mount -a
 }
 
 log_assert "While canmount=noauto and  the dataset is mounted,"\
@@ -86,8 +86,8 @@ set -A old_canmount
 typeset ds
 typeset pwd=$PWD
 
-log_must $ZFS snapshot $TESTPOOL/$TESTFS@$TESTSNAP
-log_must $ZFS clone $TESTPOOL/$TESTFS@$TESTSNAP $TESTPOOL/$TESTCLONE
+log_must zfs snapshot $TESTPOOL/$TESTFS@$TESTSNAP
+log_must zfs clone $TESTPOOL/$TESTFS@$TESTSNAP $TESTPOOL/$TESTCLONE
 
 typeset -i i=0
 while (( i < ${#dataset_pos[*]} )); do
index bc8e279045ee2c00eec4b9724bcc03e083c7e0e2..11be1af3cf2285ab04887c676224604b1005ee6a 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -45,7 +49,7 @@ set -A sharesmb_prop "off" "on"
 
 function cleanup
 {
-       log_must $ZFS destroy -rR $CS_FS
+       log_must zfs destroy -rR $CS_FS
 }
 
 function assert_unmounted
@@ -68,21 +72,21 @@ CS_FS=$TESTPOOL/$TESTFS/cs_fs.$$
 oldmpt=$TESTDIR/old_cs_fs.$$
 newmpt=$TESTDIR/new_cs_fs.$$
 
-log_must $ZFS create -o canmount=noauto -o mountpoint=$oldmpt $CS_FS
+log_must zfs create -o canmount=noauto -o mountpoint=$oldmpt $CS_FS
 assert_unmounted
 
 for n in ${sharenfs_prop[@]}; do
-       log_must $ZFS set sharenfs="$n" $CS_FS
+       log_must zfs set sharenfs="$n" $CS_FS
        assert_unmounted
        for s in ${sharesmb_prop[@]}; do
-               log_must $ZFS set sharesmb="$s" $CS_FS
+               log_must zfs set sharesmb="$s" $CS_FS
                assert_unmounted
 
                mntpt=$(get_prop mountpoint $CS_FS)
                if [[ "$mntpt" == "$oldmpt" ]]; then
-                       log_must $ZFS set mountpoint="$newmpt" $CS_FS
+                       log_must zfs set mountpoint="$newmpt" $CS_FS
                else
-                       log_must $ZFS set mountpoint="$oldmpt" $CS_FS
+                       log_must zfs set mountpoint="$oldmpt" $CS_FS
                fi
                assert_unmounted
        done
index eaf9a629e5dc200cd6bf09c7b2e42c13e52ca3e3..1255ae5f56669cfe118c0aa33e436aebdf47c665 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -59,10 +59,10 @@ set -A values "$TESTDIR2" "legacy" "none" "$TESTDIR_NOTEXISTING"
 
 function cleanup
 {
-       log_must $ZFS set mountpoint=$old_ctr_mpt $TESTPOOL/$TESTCTR
-       log_must $ZFS set mountpoint=$old_fs_mpt $TESTPOOL/$TESTFS
-       [[ -d $TESTDIR2 ]] && log_must $RM -r $TESTDIR2
-       [[ -d $TESTDIR_NOTEXISTING ]] && log_must $RM -r $TESTDIR_NOTEXISTING
+       log_must zfs set mountpoint=$old_ctr_mpt $TESTPOOL/$TESTCTR
+       log_must zfs set mountpoint=$old_fs_mpt $TESTPOOL/$TESTFS
+       [[ -d $TESTDIR2 ]] && log_must rm -r $TESTDIR2
+       [[ -d $TESTDIR_NOTEXISTING ]] && log_must rm -r $TESTDIR_NOTEXISTING
 }
 
 log_assert "Setting a valid mountpoint to file system, it must be successful."
@@ -76,7 +76,7 @@ old_ctr_mpt=$(get_prop mountpoint $TESTPOOL/$TESTCTR)
        log_fail "Get the $TESTPOOL/$TESTCTR mountpoint error."
 
 if [[ ! -d $TESTDIR2 ]]; then
-       log_must $MKDIR $TESTDIR2
+       log_must mkdir $TESTDIR2
 fi
 
 typeset -i i=0
index d827fbe82f3ecf65b05ef10ac384dd1b3d9f7573..ad33e18fbb24896b64a6347007f71cb5d9fa11be 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -54,11 +54,11 @@ set -A values "$TESTDIR2" "$TESTDIR_NOTEXISTING"
 
 function cleanup
 {
-       log_must $ZFS set mountpoint=$old_ctr_mpt $TESTPOOL/$TESTCTR
-       log_must $ZFS set mountpoint=$old_fs_mpt $TESTPOOL/$TESTFS
-       log_must $ZFS mount -a
-       [[ -d $TESTDIR2 ]] && log_must $RM -r $TESTDIR2
-       [[ -d $TESTDIR_NOTEXISTING ]] && log_must $RM -r $TESTDIR_NOTEXISTING
+       log_must zfs set mountpoint=$old_ctr_mpt $TESTPOOL/$TESTCTR
+       log_must zfs set mountpoint=$old_fs_mpt $TESTPOOL/$TESTFS
+       log_must zfs mount -a
+       [[ -d $TESTDIR2 ]] && log_must rm -r $TESTDIR2
+       [[ -d $TESTDIR_NOTEXISTING ]] && log_must rm -r $TESTDIR_NOTEXISTING
 }
 
 log_assert "Setting a valid mountpoint for an unmounted file system, \
@@ -73,7 +73,7 @@ old_ctr_mpt=$(get_prop mountpoint $TESTPOOL/$TESTCTR)
        log_fail "Unable to get the mountpoint property for $TESTPOOL/$TESTCTR"
 
 if [[ ! -d $TESTDIR2 ]]; then
-       log_must $MKDIR $TESTDIR2
+       log_must mkdir $TESTDIR2
 fi
 
 typeset -i i=0
@@ -81,7 +81,7 @@ typeset -i j=0
 while (( i < ${#dataset[@]} )); do
        j=0
        if ismounted ${dataset[i]} ; then
-               log_must $ZFS unmount ${dataset[i]}
+               log_must zfs unmount ${dataset[i]}
        fi
        log_mustnot ismounted ${dataset[i]}
        while (( j < ${#values[@]} )); do
index b160c8104cc9709c0c4432bc3ab3d21b3a8dd3f1..dcba41919e9783a74cfd9884f5017c3ab7639f08 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -43,10 +47,10 @@ verify_runnable "both"
 
 function cleanup
 {
-       ismounted $tmpmnt && log_must $UMOUNT $tmpmnt
-       [[ -d $tmpmnt ]] && log_must $RM -rf $tmpmnt
-       [[ -n $oldmpt ]] && log_must $ZFS set mountpoint=$oldmpt $testfs
-       ! ismounted $oldmpt && log_must $ZFS mount $testfs
+       ismounted $tmpmnt && log_must umount $tmpmnt
+       [[ -d $tmpmnt ]] && log_must rm -rf $tmpmnt
+       [[ -n $oldmpt ]] && log_must zfs set mountpoint=$oldmpt $testfs
+       ! ismounted $oldmpt && log_must zfs mount $testfs
 }
 
 log_assert "With legacy mount, FSType-specific option works well."
@@ -80,48 +84,48 @@ else
 fi
 
 tmpmnt=/tmpmnt.$$
-[[ -d $tmpmnt ]] && $RM -rf $tmpmnt
+[[ -d $tmpmnt ]] && rm -rf $tmpmnt
 testfs=$TESTPOOL/$TESTFS
-log_must $MKDIR $tmpmnt
+log_must mkdir $tmpmnt
 oldmpt=$(get_prop mountpoint $testfs)
-log_must $ZFS set mountpoint=legacy $testfs
+log_must zfs set mountpoint=legacy $testfs
 
 typeset i=0
 while ((i < ${#args[@]})); do
        if is_linux; then
-               log_must $MOUNT -t zfs -o ${args[$i]} $testfs $tmpmnt
+               log_must mount -t zfs -o ${args[$i]} $testfs $tmpmnt
                
-               msg=$($MOUNT | $GREP "$tmpmnt ")
+               msg=$(mount | grep "$tmpmnt ")
                
-               $ECHO $msg | $GREP "${args[((i))]}" > /dev/null 2>&1
+               echo $msg | grep "${args[((i))]}" > /dev/null 2>&1
                if (($? != 0)) ; then
-                       $ECHO $msg | $GREP "${args[((i-1))]}" > /dev/null 2>&1
+                       echo $msg | grep "${args[((i-1))]}" > /dev/null 2>&1
                        if (($? == 0)) ; then
                                log_fail "Expected option: ${args[((i))]} \n" \
                                         "Real option: $msg"
                        fi
                fi
 
-               log_must $UMOUNT $tmpmnt
+               log_must umount $tmpmnt
                ((i += 1))
        else
-               log_must $MOUNT -F zfs -o ${args[$i]} $testfs $tmpmnt
+               log_must mount -F zfs -o ${args[$i]} $testfs $tmpmnt
 
-               msg=$($MOUNT | $GREP "^$tmpmnt ")
+               msg=$(mount | grep "^$tmpmnt ")
 
                # In LZ, a user with all zone privileges can never "devices"
                if ! is_global_zone && [[ ${args[$i]} == devices ]] ; then
                        args[((i+1))]="/nodevices/"
                fi
 
-               $ECHO $msg | $GREP "${args[((i+1))]}" > /dev/null 2>&1
+               echo $msg | grep "${args[((i+1))]}" > /dev/null 2>&1
                if (($? != 0)) ; then
                        log_fail "Expected option: ${args[((i+1))]} \n" \
                                 "Real option: $msg"
                fi
 
 
-               log_must $UMOUNT $tmpmnt
+               log_must umount $tmpmnt
                ((i += 2))
        fi
 done
index 41ff4b7eaaaca4c91f57efa42c557c392250a199..498567fdd36acaec3498330754f2002918bff9af 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
 
@@ -42,7 +46,7 @@ verify_runnable "both"
 
 function cleanup
 {
-       log_must $ZFS mount -a
+       log_must zfs mount -a
 }
 
 log_onexit cleanup
index 5d24515b50c45b4dec74b4002d8648dad5181d74..19e636be05a963b9415ca683e34f1c2d40cb2368 100755 (executable)
@@ -52,7 +52,7 @@ function set_and_check #<dataset><set_prop_name><set_value><check_prop_name>
        typeset chkprop=$4
        typeset getval
 
-       log_must $ZFS set $setprop=$setval $ds
+       log_must zfs set $setprop=$setval $ds
        if [[ $setval == "gzip-6" ]]; then
                setval="gzip"
        fi
@@ -93,7 +93,7 @@ typeset -i i=0
 
 for ds in $pool $fs $vol; do
        for propname in ${ro_prop[*]}; do
-               $ZFS get -pH -o value $propname $ds >/dev/null 2>&1
+               zfs get -pH -o value $propname $ds >/dev/null 2>&1
                (( $? != 0 )) && \
                        log_fail "Get the property $proname of $ds failed."
        done
@@ -122,7 +122,7 @@ for ds in $pool $fs $vol; do
        done
        if [[ $ds == $vol ]]; then
                for propname in "volblocksize" "volblock" ; do
-                       $ZFS get -pH -o value $propname $ds >/dev/null 2>&1
+                       zfs get -pH -o value $propname $ds >/dev/null 2>&1
                        (( $? != 0 )) && \
                                log_fail "Get the property $propname of $ds failed."
                done
index a4c04a8702fb65e2e97e740348f72dbe8679f84c..9af8811e4567d06a38a5df96294d6d36c9d6c8d7 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2014 by Delphix. All rights reserved.
+# Copyright (c) 2014, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
@@ -48,7 +48,7 @@ function cleanup
 {
        for dataset in $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL ; do
                snapexists ${dataset}@$TESTSNAP && \
-                       log_must $ZFS destroy -R ${dataset}@$TESTSNAP
+                       log_must zfs destroy -R ${dataset}@$TESTSNAP
        done
 }
 
@@ -60,8 +60,8 @@ function initial_dataset # $1 dataset
 
        if [[ $fstype == "filesystem" ]] ; then
                typeset mtpt=$(get_prop mountpoint $dataset)
-               log_must $TOUCH $mtpt/$TESTFILE0
-               log_must $MKDIR -p $mtpt/$TESTDIR0
+               log_must touch $mtpt/$TESTFILE0
+               log_must mkdir -p $mtpt/$TESTDIR0
        fi
 }
 
@@ -74,8 +74,8 @@ function cleanup_dataset # $1 dataset
 
        if [[ $fstype == "filesystem" ]] ; then
                typeset mtpt=$(get_prop mountpoint $dataset)
-               log_must $RM -f $mtpt/$TESTFILE0
-               log_must $RM -rf $mtpt/$TESTDIR0
+               log_must rm -f $mtpt/$TESTFILE0
+               log_must rm -rf $mtpt/$TESTDIR0
        fi
 }
 
@@ -100,20 +100,20 @@ function verify_readonly # $1 dataset, $2 on|off
        case $fstype in
                filesystem)
                        typeset mtpt=$(get_prop mountpoint $dataset)
-                       $expect $TOUCH $mtpt/$TESTFILE1
-                       $expect $MKDIR -p $mtpt/$TESTDIR1
-                       $expect eval "$ECHO 'y' | $RM $mtpt/$TESTFILE0"
-                       $expect $RMDIR $mtpt/$TESTDIR0
+                       $expect touch $mtpt/$TESTFILE1
+                       $expect mkdir -p $mtpt/$TESTDIR1
+                       $expect eval "echo 'y' | rm $mtpt/$TESTFILE0"
+                       $expect rmdir $mtpt/$TESTDIR0
 
                        if [[ $expect == "log_must" ]] ; then
-                               log_must eval "$ECHO 'y' | $RM $mtpt/$TESTFILE1"
-                               log_must $RMDIR $mtpt/$TESTDIR1
-                               log_must $TOUCH $mtpt/$TESTFILE0
-                               log_must $MKDIR -p $mtpt/$TESTDIR0
+                               log_must eval "echo 'y' | rm $mtpt/$TESTFILE1"
+                               log_must rmdir $mtpt/$TESTDIR1
+                               log_must touch $mtpt/$TESTFILE0
+                               log_must mkdir -p $mtpt/$TESTDIR0
                        fi
                        ;;
                volume)
-                       $expect eval "$ECHO 'y' | $NEWFS \
+                       $expect eval "echo 'y' | newfs \
                            ${ZVOL_DEVDIR}/$dataset > /dev/null 2>&1"
                        ;;
                *)
@@ -129,14 +129,14 @@ log_assert "Setting a valid readonly property on a dataset succeeds."
 
 typeset all_datasets
 
-log_must $ZFS mount -a
+log_must zfs mount -a
 
-log_must $ZFS snapshot $TESTPOOL/$TESTFS@$TESTSNAP
-log_must $ZFS clone $TESTPOOL/$TESTFS@$TESTSNAP $TESTPOOL/$TESTCLONE
+log_must zfs snapshot $TESTPOOL/$TESTFS@$TESTSNAP
+log_must zfs clone $TESTPOOL/$TESTFS@$TESTSNAP $TESTPOOL/$TESTCLONE
 
 if is_global_zone ; then
-       log_must $ZFS snapshot $TESTPOOL/$TESTVOL@$TESTSNAP
-       log_must $ZFS clone $TESTPOOL/$TESTVOL@$TESTSNAP $TESTPOOL/$TESTCLONE1
+       log_must zfs snapshot $TESTPOOL/$TESTVOL@$TESTSNAP
+       log_must zfs clone $TESTPOOL/$TESTVOL@$TESTSNAP $TESTPOOL/$TESTCLONE1
        all_datasets="$TESTPOOL $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL "
        all_datasets+="$TESTPOOL/$TESTCLONE $TESTPOOL/$TESTCLONE1"
 else
index 511a506ab9cfa22f98ebebfd05fb4852b9b9097e..de6d83d2270ca3da72e6c99f902da7be20a06710 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -66,12 +70,12 @@ function set_n_check # data-set
                j=0
                while (( $j < ${#suffix[*]} )); do
 
-                       $ZFS set \
+                       zfs set \
                                reservation=${values[$i]}${suffix[$j]} $obj \
                                > /dev/null 2>&1
                        if [ $? -eq 0 ]
                        then
-                               log_note "$ZFS set \
+                               log_note "zfs set \
                                reservation=${values[$i]}${suffix[$j]} $obj"
                                log_fail "The above reservation set returned 0!"
                        fi
index d22c757f4c65e241005eea7d91013ee6f8ab4dbd..67de2e822fc01b42db862f43c6dce34f141d4587 100755 (executable)
@@ -57,7 +57,7 @@ typeset snap_ro_props="volsize recordsize recsize quota reservation reserv mount
        sharenfs checksum compression compress atime devices exec readonly rdonly \
        setuid zoned"
 
-$ZFS upgrade -v > /dev/null 2>&1
+zfs upgrade -v > /dev/null 2>&1
 if [[ $? -eq 0 ]]; then
        snap_ro_props="$snap_ro_props version"
 fi
@@ -77,7 +77,7 @@ log_onexit cleanup
 create_snapshot $TESTPOOL/$TESTFS $TESTSNAP
 create_snapshot $TESTPOOL/$TESTVOL $TESTSNAP
 sync_pool $TESTPOOL
-$SLEEP 5
+sleep 5
 
 typeset -i i=0
 typeset -i j=0
@@ -104,7 +104,7 @@ while (( i < ${#dataset[@]} )); do
                        # equal to values[j].
                        #
                        if [[ $cur_value == ${values[j]} ]]; then
-                               log_mustnot $ZFS set $prop=${values[j]} \
+                               log_mustnot zfs set $prop=${values[j]} \
                                        ${dataset[i]}
                        else
                                set_n_check_prop ${values[j]} $prop \
index 05c8b637e58408e230ec9a88c5e94b7ef2f5b24d..fa32c2774f8b4d7daa297065fc8ab4a0114d66c1 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
 
 #
@@ -41,7 +45,7 @@ verify_runnable "both"
 
 function cleanup
 {
-       log_must $ZFS set mountpoint=$oldmpt $fs
+       log_must zfs set mountpoint=$oldmpt $fs
 }
 
 log_assert "Verify that we cannot share or mount legacy filesystems."
@@ -51,10 +55,10 @@ fs=$TESTPOOL/$TESTFS
 oldmpt=$(get_prop mountpoint $fs)
 
 for propval in "legacy" "none"; do
-       log_must $ZFS set mountpoint=$propval $fs
+       log_must zfs set mountpoint=$propval $fs
 
-       log_mustnot $ZFS mount $fs
-       log_mustnot $ZFS share $fs
+       log_mustnot zfs mount $fs
+       log_mustnot zfs share $fs
 done
 
 log_pass "We cannot share or mount legacy filesystems as expected."
index 9abd0ec8e8bc5bde6b13547ebc9aefdff3b2cb9b..079fc770a6fe8e8ccc2c82462e11ef5170fdebc5 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
 
 #
@@ -45,7 +49,7 @@ function cleanup
 {
        for dataset in $all_datasets; do
                snapexists ${dataset}@snap && \
-                       log_must $ZFS destroy ${dataset}@snap
+                       log_must zfs destroy ${dataset}@snap
        done
 }
 
@@ -56,7 +60,7 @@ function verify_snapdir_visible # $1 dataset, $2 hidden|visible
        typeset mtpt=$(get_prop mountpoint $dataset)
        typeset name
 
-       for name in `$LS -a $mtpt`; do
+       for name in `ls -a $mtpt`; do
                if [[ $name == ".zfs" ]]; then
                        if [[ $value == "visible" ]]; then
                                return 0
@@ -85,7 +89,7 @@ fi
 log_onexit cleanup
 
 for dataset in $all_datasets; do
-       log_must $ZFS snapshot ${dataset}@snap
+       log_must zfs snapshot ${dataset}@snap
 done
 
 log_assert "Setting a valid snapdir property on a dataset succeeds."
index be8c88c0cabd91efe2e99fa8be7866e205d18d45..fb03d7c9716a9f80d84f8ec8a6cade08e7ba2b73 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
 
 #
@@ -55,7 +59,7 @@ while ((i < 10)); do
        typeset value=$(user_property_value $len)
 
        for dtst in $TESTPOOL $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL; do
-               log_must eval "$ZFS set $user_prop='$value' $dtst"
+               log_must eval "zfs set $user_prop='$value' $dtst"
                log_must eval "check_user_prop $dtst $user_prop '$value'"
        done
 
index 24fecfba1f84a02902fd7a566ea65374df5200d1..310d1540a0966027136bbd31367c97739cd1c208 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
 
 #
@@ -44,13 +48,13 @@ verify_runnable "both"
 
 function cleanup
 {
-       datasetexists $new_vol && log_must $ZFS rename $new_vol $vol
+       datasetexists $new_vol && log_must zfs rename $new_vol $vol
 
        typeset dtst
        for dtst in $new_fsclone $new_volclone $fsclone $volclone \
            $fssnap $volsnap; do
                if datasetexists $dtst; then
-                       log_must $ZFS destroy -f $dtst
+                       log_must zfs destroy -f $dtst
                fi
        done
 
@@ -92,26 +96,26 @@ log_onexit cleanup
 
 pool=$TESTPOOL; fs=$pool/$TESTFS; vol=$pool/$TESTVOL
 fssnap=$fs@snap; volsnap=$vol@snap;
-log_must $ZFS snapshot $fssnap
-log_must $ZFS snapshot $volsnap
+log_must zfs snapshot $fssnap
+log_must zfs snapshot $volsnap
 fsclone=$pool/fsclone; volclone=$pool/volclone
-log_must $ZFS clone $fssnap $fsclone
-log_must $ZFS clone $volsnap $volclone
+log_must zfs clone $fssnap $fsclone
+log_must zfs clone $volsnap $volclone
 
 prop_name=$(valid_user_property 10)
 value=$(user_property_value 16)
-log_must eval "$ZFS set $prop_name='$value' $pool"
+log_must eval "zfs set $prop_name='$value' $pool"
 log_must eval "check_user_prop $pool $prop_name '$value'"
 log_must inherit_check $prop_name $pool $fs $vol $fsclone $volclone
 
 new_fsclone=$fs/fsclone; new_volclone=$fs/volclone
-log_must $ZFS rename $fsclone $new_fsclone
-log_must $ZFS rename $volclone $new_volclone
+log_must zfs rename $fsclone $new_fsclone
+log_must zfs rename $volclone $new_volclone
 log_must inherit_check $prop_name $pool $fs $new_fsclone $new_volclone
 
 log_note "Set intermediate dataset will change the inherited relationship."
 new_value=$(user_property_value 16)
-log_must eval "$ZFS set $prop_name='$new_value' $fs"
+log_must eval "zfs set $prop_name='$new_value' $fs"
 log_must eval "check_user_prop $fs $prop_name '$new_value'"
 log_must inherit_check $prop_name $fs $new_fsclone $new_volclone
 
index 4c1c1bca82448e2f0cff79016a018ba1c046b539..6a90665f4b5fdd5d51852ea865d9b7da23453753 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
 
 #
@@ -53,7 +57,7 @@ while ((i < 10)); do
        typeset value=$(user_property_value $len)
 
        for dtst in $TESTPOOL $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL ; do
-               log_mustnot $ZFS set $user_prop=$value $dtst
+               log_mustnot zfs set $user_prop=$value $dtst
                log_mustnot check_user_prop $dtst \"$user_prop\" \"$value\"
        done
 
index 1bce7a75c953f0040e0ff2ec7b54afc17157154f..1d197fa25fbd723cd39bf2a5aa63ce18ef37243e 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
 
 #
@@ -43,7 +47,7 @@ function cleanup
        for fs in $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL $TESTPOOL ; do
                typeset fssnap=$fs@snap
                if datasetexists $fssnap ; then
-                       log_must $ZFS destroy -f $fssnap
+                       log_must zfs destroy -f $fssnap
                fi
        done
        cleanup_user_prop $TESTPOOL
@@ -68,7 +72,7 @@ log_onexit cleanup
 
 typeset snap_property=
 
-$ZPOOL upgrade -v | $GREP "Snapshot properties" > /dev/null 2>&1
+zpool upgrade -v | grep "Snapshot properties" > /dev/null 2>&1
 if (( $? == 0 )) ; then
        snap_property="true"
 fi
@@ -77,19 +81,19 @@ for fs in $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL $TESTPOOL ; do
        typeset fssnap=$fs@snap
        prop_name=$(valid_user_property 10)
        value=$(user_property_value 16)
-       log_must eval "$ZFS set $prop_name='$value' $fs"
+       log_must eval "zfs set $prop_name='$value' $fs"
        log_must eval "check_user_prop $fs $prop_name '$value'"
 
-       log_must $ZFS snapshot $fssnap
+       log_must zfs snapshot $fssnap
 
        if [[ -n $snap_property ]] ; then
                log_mustnot nonexist_user_prop $prop_name $fssnap
 
-               log_must eval "$ZFS set $prop_name='$value' $fssnap"
+               log_must eval "zfs set $prop_name='$value' $fssnap"
                log_mustnot nonexist_user_prop $prop_name $fssnap
        else
                log_must nonexist_user_prop $prop_name $fssnap
-               log_mustnot eval "$ZFS set $prop_name='$value' $fssnap"
+               log_mustnot eval "zfs set $prop_name='$value' $fssnap"
                log_must nonexist_user_prop $prop_name $fssnap
        fi
 done
index 40a541a9e8ec6c292b0b7d8d021716be24725dce..cf5ef5116e904dd5f1f6855fa99bbf173eaa5241 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_upgrade/zfs_upgrade.kshlib
 
@@ -62,9 +66,9 @@ function set_n_check # data-set
        orig_val=$(get_prop version $obj)
 
        while (($i < ${#values[*]})); do
-               $ZFS set version=${values[$i]} $obj  > /dev/null 2>&1
+               zfs set version=${values[$i]} $obj  > /dev/null 2>&1
                if [[ $? -eq 0 ]]; then
-                       log_note "$ZFS set version=${values[$i]} $obj"
+                       log_note "zfs set version=${values[$i]} $obj"
                        log_fail "The above version set returned 0!"
                fi
 
index 619a1ee01185629eeac37eed35a593b21d165d80..b9044041cb1aa02375e94902930b6647c7a523b5 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2011 by Delphix. All rights reserved.
+# Copyright (c) 2011, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
@@ -54,7 +54,7 @@ for ds in $TESTPOOL $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL \
        $TESTPOOL/$TESTFS@$TESTSNAP; do
        for badarg in "" "-" "-?"; do
                for prop in ${editable_props[@]}; do
-                       log_mustnot eval "$ZFS set $badarg $prop= $ds >/dev/null 2>&1"
+                       log_mustnot eval "zfs set $badarg $prop= $ds >/dev/null 2>&1"
                done
        done
 done
index 13260f1623ea64499e199ca4b4350687329e6b54..16bb38802c26707a9606b60dc6d93ba4380f38d3 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
 
 #
@@ -42,10 +46,10 @@ verify_runnable "both"
 function cleanup
 {
        if [ -e $badpath ]; then
-               $RM -f $badpath
+               rm -f $badpath
        fi
        if datasetexists $TESTPOOL/foo; then
-               log_must $ZFS destroy $TESTPOOL/foo
+               log_must zfs destroy $TESTPOOL/foo
        fi
 }
 
@@ -53,21 +57,21 @@ log_assert "'zfs set mountpoint/sharenfs' fails with invalid scenarios"
 log_onexit cleanup
 
 badpath=/tmp/foo1.$$
-$TOUCH $badpath
+touch $badpath
 longpath=$(gen_dataset_name 1030 "abcdefg")
 
-log_must $ZFS create -o mountpoint=legacy $TESTPOOL/foo
+log_must zfs create -o mountpoint=legacy $TESTPOOL/foo
 
 # Do the negative testing about "property may be set but unable to remount filesystem"
-log_mustnot eval "$ZFS set mountpoint=$badpath $TESTPOOL/foo >/dev/null 2>&1"
+log_mustnot eval "zfs set mountpoint=$badpath $TESTPOOL/foo >/dev/null 2>&1"
 
 # Do the negative testing about "property may be set but unable to reshare filesystem"
-log_mustnot eval "$ZFS set sharenfs=on $TESTPOOL/foo >/dev/null 2>&1"
+log_mustnot eval "zfs set sharenfs=on $TESTPOOL/foo >/dev/null 2>&1"
 
 # Do the negative testing about "sharenfs property can not be set to null"
-log_mustnot eval "$ZFS set sharenfs= $TESTPOOL/foo >/dev/null 2>&1"
+log_mustnot eval "zfs set sharenfs= $TESTPOOL/foo >/dev/null 2>&1"
 
 # Do the too long pathname testing (>1024)
-log_mustnot eval "$ZFS set mountpoint=/$longpath $TESTPOOL/foo >/dev/null 2>&1"
+log_mustnot eval "zfs set mountpoint=/$longpath $TESTPOOL/foo >/dev/null 2>&1"
 
 log_pass "'zfs set mountpoint/sharenfs' fails with invalid scenarios as expected."
index f818b754d248d47f3c37099aac20afe216ab0b08..d4e51dcbdfa11b7835926325d493b9065793bb00 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2014 by Delphix. All rights reserved.
+# Copyright (c) 2014, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -62,7 +62,7 @@ function set_n_check_prop
                [[ -z $prop || -z $dataset ]] && \
                        log_fail "property or dataset isn't defined."
 
-               log_must $ZFS set $prop=$expect_value $dataset
+               log_must zfs set $prop=$expect_value $dataset
                if [[ $expect_value == "gzip-6" ]]; then
                        expect_value="gzip"
                fi
@@ -89,7 +89,7 @@ function set_n_check_prop
                esac
 
        else
-               log_mustnot $ZFS set $prop=$expect_value $dataset
+               log_mustnot zfs set $prop=$expect_value $dataset
 
                [[ -n $prop ]] && cur_value=$(get_prop $prop $dataset)
                
@@ -111,16 +111,16 @@ function set_n_check_prop
 function cleanup_user_prop
 {
        typeset pool=$1
-       typeset dtst=$($ZFS list -H -r -o name -t filesystem,volume $pool)
+       typeset dtst=$(zfs list -H -r -o name -t filesystem,volume $pool)
 
        typeset user_prop
        for dt in $dtst; do
-               user_prop=$($ZFS get -H -o property all $dtst | grep ":")
+               user_prop=$(zfs get -H -o property all $dtst | grep ":")
 
                typeset prop
                for prop in $user_prop; do
-                       $ZFS inherit $prop $dt
-                       (($? != 0)) && log_must $ZFS inherit $prop $dt
+                       zfs inherit $prop $dt
+                       (($? != 0)) && log_must zfs inherit $prop $dt
                done
        done
 }
@@ -152,7 +152,7 @@ function random_string
                ((i += 1))
        done
 
-       $ECHO "$str"
+       echo "$str"
 }
 
 #
@@ -185,7 +185,7 @@ function valid_user_property
                break
        done
 
-       $ECHO "${part1}:${part2}"
+       echo "${part1}:${part2}"
 }
 
 #
@@ -213,7 +213,7 @@ function invalid_user_property
                break
        done
 
-       $ECHO "${part1}${part2}"
+       echo "${part1}${part2}"
 }
 
 #
@@ -227,7 +227,7 @@ function user_property_value
 
        typeset value=$(random_string ALL_CHAR $len)
 
-       $ECHO "$value"
+       echo "$value"
 }
 
 #
@@ -242,7 +242,7 @@ function check_user_prop
        typeset dtst=$1
        typeset user_prop="$2"
        typeset expect_value="$3"
-       typeset value=$($ZFS get -p -H -o value "$user_prop" $dtst 2>&1)
+       typeset value=$(zfs get -p -H -o value "$user_prop" $dtst 2>&1)
 
        if [[ "$expect_value" == "$value" ]]; then
                return 0
@@ -260,10 +260,10 @@ function get_source
        typeset dataset=$2
        typeset source
 
-       source=$($ZFS get -H -o source $prop $dataset)
+       source=$(zfs get -H -o source $prop $dataset)
         if (($? != 0)); then
                 log_fail "Unable to get $prop source for dataset $dataset"
         fi
 
-       $ECHO "$source"
+       echo "$source"
 }
index 084b18d1f17281907a251087606b14455ab8fe80..7638660e3d8f7314265c8518f21796b9d1b98635 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -51,21 +55,21 @@ function cleanup
 {
        typeset -i i=0
        while (( i < ${#fs[*]} )); do
-               log_must $ZFS set sharenfs=off ${fs[((i+1))]}
+               log_must zfs set sharenfs=off ${fs[((i+1))]}
                unshare_fs ${fs[i]}
 
                ((i = i + 2))
        done
 
        if mounted $TESTPOOL/$TESTFS-clone; then
-               log_must $ZFS unmount $TESTDIR2
+               log_must zfs unmount $TESTDIR2
        fi
 
        datasetexists $TESTPOOL/$TESTFS-clone && \
-               log_must $ZFS destroy -f $TESTPOOL/$TESTFS-clone
+               log_must zfs destroy -f $TESTPOOL/$TESTFS-clone
 
        if snapexists "$TESTPOOL/$TESTFS@snapshot"; then
-               log_must $ZFS destroy -f $TESTPOOL/$TESTFS@snapshot
+               log_must zfs destroy -f $TESTPOOL/$TESTFS@snapshot
        fi
 }
 
@@ -84,31 +88,31 @@ function test_share # mntp filesystem
        not_shared $mntp || \
            log_fail "File system $filesystem is already shared."
 
-       log_must $ZFS set sharenfs=on $filesystem
+       log_must zfs set sharenfs=on $filesystem
        is_shared $mntp || \
            log_fail "File system $filesystem is not shared (set sharenfs)."
 
        #
        # Verify 'zfs share' works as well.
        #
-       log_must $ZFS unshare $filesystem
+       log_must zfs unshare $filesystem
        is_shared $mntp && \
            log_fail "File system $filesystem is still shared."
 
-       log_must $ZFS share $filesystem
+       log_must zfs share $filesystem
        is_shared $mntp || \
            log_fail "file system $filesystem is not shared (zfs share)."
 
        log_note "Sharing a shared file system fails."
-       log_mustnot $ZFS share $filesystem
+       log_mustnot zfs share $filesystem
 }
 
 log_assert "Verify that 'zfs share' succeeds as root."
 log_onexit cleanup
 
-log_must $ZFS snapshot $TESTPOOL/$TESTFS@snapshot
-log_must $ZFS clone $TESTPOOL/$TESTFS@snapshot $TESTPOOL/$TESTFS-clone
-log_must $ZFS set mountpoint=$TESTDIR2 $TESTPOOL/$TESTFS-clone
+log_must zfs snapshot $TESTPOOL/$TESTFS@snapshot
+log_must zfs clone $TESTPOOL/$TESTFS@snapshot $TESTPOOL/$TESTFS-clone
+log_must zfs set mountpoint=$TESTDIR2 $TESTPOOL/$TESTFS-clone
 
 typeset -i i=0
 while (( i < ${#fs[*]} )); do
@@ -132,7 +136,7 @@ done
 #
 # Try a zfs share -a and verify all file systems are shared.
 #
-log_must $ZFS share -a
+log_must zfs share -a
 
 i=0
 while (( i < ${#fs[*]} )); do
@@ -142,4 +146,4 @@ while (( i < ${#fs[*]} )); do
        ((i = i + 2))
 done
 
-log_pass "'$ZFS share [ -a ] <filesystem>' succeeds as root."
+log_pass "'zfs share [ -a ] <filesystem>' succeeds as root."
index 4005bf056cecf0bfc58f023b3359dcf2f72fe362..588a30f46de9e0e5df729a9c80ae7088696f2902 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -58,16 +58,16 @@ log_assert "Verify that "zfs share" with a non-existent file system fails."
 
 log_onexit cleanup
 
-log_mustnot $ZFS list $TESTPOOL/$NONEXISTFSNAME
+log_mustnot zfs list $TESTPOOL/$NONEXISTFSNAME
 
-$ZFS share $TESTPOOL/$NONEXISTFSNAME
+zfs share $TESTPOOL/$NONEXISTFSNAME
 ret=$?
 (( ret == 1)) || \
-       log_fail "'$ZFS share $TESTPOOL/$NONEXISTFSNAME' " \
+       log_fail "'zfs share $TESTPOOL/$NONEXISTFSNAME' " \
                "failed with an unexpected return code of $ret."
 
 log_note "Make sure the file system $TESTPOOL/$NONEXISTFSNAME is unshared"
 not_shared $TESTPOOL/$NONEXISTFSNAME || \
        log_fail "File system $TESTPOOL/$NONEXISTFSNAME is unexpectedly shared."
 
-log_pass "'$ZFS share' with a non-existent file system fails."
+log_pass "'zfs share' with a non-existent file system fails."
index e4ab8c6f5b2f939c1d443f050e1dabd3c557cfb8..b99c72ca14e5895f93de39e226a4b861ee19db88 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -51,7 +55,7 @@ function cleanup
 {
        typeset -i i=0
        while (( i < ${#fs[*]} )); do
-               log_must $ZFS inherit -r sharenfs ${fs[((i + 1))]}
+               log_must zfs inherit -r sharenfs ${fs[((i + 1))]}
                log_must unshare_fs ${fs[i]}
 
                ((i = i + 2))
@@ -75,22 +79,22 @@ function test_legacy_share # mntp filesystem
            log_fail "File system $filesystem is already shared."
 
        if is_global_zone ; then
-               log_must $ZFS set sharenfs=off $filesystem
+               log_must zfs set sharenfs=off $filesystem
                not_shared $mntp || \
                    log_fail "File system $filesystem is still shared (set sharenfs)."
        fi
 
-       $ZFS share $filesystem
+       zfs share $filesystem
        ret=$?
        (( ret == 1)) || \
-           log_fail "'$ZFS share $filesystem' " \
+           log_fail "'zfs share $filesystem' " \
                "unexpected return code of $ret."
 
        not_shared $mntp || \
            log_fail "file system $filesystem is shared (zfs share)."
 }
 
-log_assert "Verify that '$ZFS share' with a file system " \
+log_assert "Verify that 'zfs share' with a file system " \
         "whose sharenfs property is 'off'  " \
         "will fail with return code 1."
 log_onexit cleanup
@@ -102,5 +106,5 @@ while (( i < ${#fs[*]} )); do
        ((i = i + 2))
 done
 
-log_pass "Verify that '$ZFS share' with a file system " \
+log_pass "Verify that 'zfs share' with a file system " \
         "whose sharenfs property is 'off' fails."
index 04cf72efcdad121f875b21e9cbe401539b330789..baa5f4e41695606ab4c34967628b3cc2d1ee9077 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,10 +48,10 @@ verify_runnable "global"
 function cleanup
 {
        if snapexists $TESTPOOL/$TESTFS@snapshot; then
-               log_must $ZFS destroy $TESTPOOL/$TESTFS@snapshot
+               log_must zfs destroy $TESTPOOL/$TESTFS@snapshot
        fi
 
-       log_must $ZFS set sharenfs=off $TESTPOOL/$TESTFS
+       log_must zfs set sharenfs=off $TESTPOOL/$TESTFS
        log_must unshare_fs $TESTPOOL/$TESTFS
 }
 
@@ -70,27 +70,27 @@ function test_snap_share # mntp filesystem
         not_shared $mntp || \
             log_fail "File system $filesystem is already shared."
 
-        log_must $ZFS set sharenfs=on $filesystem
+        log_must zfs set sharenfs=on $filesystem
         is_shared $mntp || \
             log_fail "File system $filesystem is not shared (set sharenfs)."
 
-       log_must $LS -l  $mntp/$SNAPROOT/snapshot
+       log_must ls -l  $mntp/$SNAPROOT/snapshot
         #
         # Verify 'zfs share' works as well.
         #
-        log_must $ZFS unshare $filesystem
-        log_must $ZFS share $filesystem
+        log_must zfs unshare $filesystem
+        log_must zfs share $filesystem
 
         is_shared $mntp || \
             log_fail "file system $filesystem is not shared (zfs share)."
 
-       log_must $LS -l  $mntp/$SNAPROOT/snapshot
+       log_must ls -l  $mntp/$SNAPROOT/snapshot
 }
 
 log_assert "Verify that a file system and its snapshot are shared."
 log_onexit cleanup
 
-log_must $ZFS snapshot $TESTPOOL/$TESTFS@snapshot
+log_must zfs snapshot $TESTPOOL/$TESTFS@snapshot
 test_snap_share $TESTDIR $TESTPOOL/$TESTFS
 
 log_pass "A file system and its snapshot are both shared as expected."
index 9fec7e3abfefe89c03a8170a4920152334303b21..006517d01e8a8c3b31a6672d1fe09891429ada16 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -41,7 +45,7 @@ verify_runnable "global"
 
 function cleanup
 {
-       log_must $ZFS set sharenfs=off $TESTPOOL/$TESTFS
+       log_must zfs set sharenfs=off $TESTPOOL/$TESTFS
        is_shared $TESTPOOL/$TESTFS && \
                log_must unshare_fs $TESTPOOL/$TESTFS
 }
@@ -61,14 +65,14 @@ cleanup
 typeset -i i=0
 while (( i < ${#shareopts[*]} ))
 do
-       log_must $ZFS set sharenfs="${shareopts[i]}" $TESTPOOL/$TESTFS
+       log_must zfs set sharenfs="${shareopts[i]}" $TESTPOOL/$TESTFS
 
        option=`get_prop sharenfs $TESTPOOL/$TESTFS`
        if [[ $option != ${shareopts[i]} ]]; then
                log_fail "get sharenfs failed. ($option != ${shareopts[i]})"
        fi
 
-       showshares_nfs | $GREP $option > /dev/null 2>&1
+       showshares_nfs | grep $option > /dev/null 2>&1
        if (( $? != 0 )); then
                log_fail "The '$option' option was not found in share output."
        fi
index 20884899bc2e9374a5b40606d1d34e3448da98f4..6b06589b69e291195deaebe3239fb7a7d884c12a 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -43,13 +47,13 @@ verify_runnable "global"
 
 function cleanup
 {
-       log_must $ZFS set sharenfs=off $TESTPOOL/$TESTCTR
+       log_must zfs set sharenfs=off $TESTPOOL/$TESTCTR
        if mounted $TESTDIR2; then
-               log_must $ZFS unmount $TESTDIR2
+               log_must zfs unmount $TESTDIR2
        fi
 
        datasetexists $TESTPOOL/$TESTCTR/$TESTFS2 && \
-               log_must $ZFS destroy $TESTPOOL/$TESTCTR/$TESTFS2
+               log_must zfs destroy $TESTPOOL/$TESTCTR/$TESTFS2
 
        typeset fs=""
        for fs in $mntp $TESTDIR1 $TESTDIR2
@@ -74,7 +78,7 @@ function test_ctr_share # mntp ctr
        not_shared $mntp || \
            log_fail "Mountpoint: $mntp is already shared."
 
-       log_must $ZFS set sharenfs=on $ctr
+       log_must zfs set sharenfs=on $ctr
 
        not_shared $mntp || \
                log_fail "File system $mntp is shared (set sharenfs)."
@@ -83,8 +87,8 @@ function test_ctr_share # mntp ctr
        # Add a new file system to the dataset and verify it is shared.
        #
        typeset mntp2=$TESTDIR2
-       log_must $ZFS create $ctr/$TESTFS2
-       log_must $ZFS set mountpoint=$mntp2 $ctr/$TESTFS2
+       log_must zfs create $ctr/$TESTFS2
+       log_must zfs set mountpoint=$mntp2 $ctr/$TESTFS2
 
        is_shared $mntp2 || \
            log_fail "File system $mntp2 was not shared (set sharenfs)."
index de13bc559467d16eb49b5f812cd07f22b378d60b..29ca9a143a276395d189cd471f67100daffe707c 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -41,7 +45,7 @@ verify_runnable "both"
 
 function cleanup {
        if is_global_zone; then
-               log_must $ZFS set sharenfs=off $TESTPOOL/$TESTFS
+               log_must zfs set sharenfs=off $TESTPOOL/$TESTFS
        fi
 }
 
@@ -57,9 +61,9 @@ typeset -i i=0
 while (( i < ${#badopts[*]} ))
 do
        log_note "Setting sharenfs=${badopts[i]} $i "
-       log_mustnot $ZFS set sharenfs="${badopts[i]}" $TESTPOOL/$TESTFS
+       log_mustnot zfs set sharenfs="${badopts[i]}" $TESTPOOL/$TESTFS
 
-       showshares_nfs | $GREP $option > /dev/null 2>&1
+       showshares_nfs | grep $option > /dev/null 2>&1
        if (( $? == 0 )); then
                log_fail "An invalid setting '$option' was propagated."
        fi
@@ -72,7 +76,7 @@ do
        #
        if is_global_zone; then
                log_note "Resetting sharenfs option"
-               log_must $ZFS set sharenfs=off $TESTPOOL/$TESTFS
+               log_must zfs set sharenfs=off $TESTPOOL/$TESTFS
        fi
 
        ((i = i + 1))
index a945ddd2cf872ff71c1f634be44f5ba4b25705b7..34fbd389949d010511066dc9404f8850c05eb523 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -49,7 +53,7 @@ log_assert "Verify that sharing a dataset other than filesystem fails."
 typeset -i i=0
 while (( i < ${#datasets[*]} ))
 do
-       log_mustnot $ZFS set sharenfs=on ${datasets[i]}
+       log_mustnot zfs set sharenfs=on ${datasets[i]}
 
        option=`get_prop sharenfs ${datasets[i]}`
        if [[ $option == ${datasets[i]} ]]; then
@@ -59,7 +63,7 @@ do
        not_shared ${datasets[i]} || \
            log_fail "An invalid setting '$option' was propagated."
 
-       log_mustnot $ZFS share ${datasets[i]}
+       log_mustnot zfs share ${datasets[i]}
 
        not_shared ${datasets[i]} || \
            log_fail "An invalid dataset '${datasets[i]}' was shared."
index 0eb8625213b75bebc9875d5203ff4c9f28ba035a..cf8c84cfe301d2b4ef3cf3b5c7ab0968bbc2728e 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -45,7 +49,7 @@ function cleanup
 
        val=$(get_prop sharenfs $fs)
        if [[ $val == on ]]; then
-               log_must $ZFS set sharenfs=off $fs
+               log_must zfs set sharenfs=off $fs
        fi
 }
 
@@ -56,14 +60,14 @@ fs=$TESTPOOL/$TESTFS
 sharenfs_val=$(get_prop sharenfs $fs)
 mpt=$(get_prop mountpoint $fs)
 if [[ $sharenfs_val == off ]]; then
-       log_must $ZFS set sharenfs=on $fs
+       log_must zfs set sharenfs=on $fs
 fi
 
-showshares_nfs | $GREP $mpt >/dev/null 2>&1
+showshares_nfs | grep $mpt >/dev/null 2>&1
 if (( $? != 0 )); then
-       log_must $ZFS share $fs
+       log_must zfs share $fs
 fi
 
-log_mustnot $ZFS share $fs
+log_mustnot zfs share $fs
 
 log_pass "zfs share fails with shared filesystem as expected."
index a56761e82c227d5ed3265f6ef1cac8e4788c14db..238a5862920b0362aec38873396b1dfb80787885 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -45,12 +49,12 @@ fs=$TESTPOOL/$TESTFS
 set -A badargs "A" "-A" "-" "-x" "-?" "=" "-a *" "-a"
 
 for arg in "${badargs[@]}"; do
-       log_mustnot eval "$ZFS share $arg $fs >/dev/null 2>&1"
+       log_mustnot eval "zfs share $arg $fs >/dev/null 2>&1"
 done
 
 #zfs share failed when missing arguments or invalid datasetname
 for obj in "" "/$fs"; do
-       log_mustnot eval "$ZFS share $obj >/dev/null 2>&1"
+       log_mustnot eval "zfs share $obj >/dev/null 2>&1"
 done
 
 log_pass "zfs share fails with bad parameters as expected."
index 8f519b3808f8430db9f1da49ec2f6ac08de64d71..f75877ee89db2253b13c3a7138079397cc3d5691 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -44,15 +48,15 @@ function cleanup
 {
        log_must cd $origdir
 
-       log_must $ZFS set sharenfs=off $TESTPOOL/$TESTFS
+       log_must zfs set sharenfs=off $TESTPOOL/$TESTFS
        unshare_fs $TESTPOOL/$TESTFS
 
        if snapexists "$TESTPOOL/$TESTFS@snapshot"; then
-               log_must $ZFS destroy -f $TESTPOOL/$TESTFS@snapshot
+               log_must zfs destroy -f $TESTPOOL/$TESTFS@snapshot
        fi
 
        if datasetexists $TESTPOOL/$TESTFS/fs2 ; then
-               log_must $ZFS destroy -f $TESTPOOL/$TESTFS/fs2
+               log_must zfs destroy -f $TESTPOOL/$TESTFS/fs2
        fi
 }
 
@@ -63,19 +67,19 @@ log_onexit cleanup
 typeset origdir=$PWD
 
 # unmount fails will not unshare the shared filesystem
-log_must $ZFS set sharenfs=on $TESTPOOL/$TESTFS
+log_must zfs set sharenfs=on $TESTPOOL/$TESTFS
 log_must is_shared $TESTDIR
 if cd $TESTDIR ; then
-       log_mustnot $ZFS umount $TESTPOOL/$TESTFS
+       log_mustnot zfs umount $TESTPOOL/$TESTFS
 else
        log_fail "cd $TESTDIR fails"
 fi
 log_must is_shared $TESTDIR
 
 # destroy fails will not unshare the shared filesystem
-log_must $ZFS create $TESTPOOL/$TESTFS/fs2
+log_must zfs create $TESTPOOL/$TESTFS/fs2
 if cd $TESTDIR/fs2 ; then
-       log_mustnot $ZFS destroy $TESTPOOL/$TESTFS/fs2
+       log_mustnot zfs destroy $TESTPOOL/$TESTFS/fs2
 else
        log_fail "cd $TESTDIR/fs2 fails"
 fi
index 860dd6ca43975e396a75a180b8e8bfb12e0b3e66..8708d8b62432c7303b82057f7bd47d426acdabf4 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -76,7 +76,7 @@ function setup_all
 
        for snap in $SNAPFS $SNAPFS1; do
                if ! snapexists $snap; then
-                       log_must $ZFS snapshot $snap
+                       log_must zfs snapshot $snap
                fi
        done
 
@@ -89,13 +89,13 @@ function cleanup_all
 
        while (( i < ${#args[*]} )); do
                for snap in ${args[i]}; do
-                       snapexists $snap && log_must $ZFS destroy -f $snap
+                       snapexists $snap && log_must zfs destroy -f $snap
                done
                (( i = i + 1 ))
        done
 
        for mtpt in $SNAPDIR $SNAPDIR1; do
-               [[ -d $mtpt ]] && log_must $RM -rf $mtpt
+               [[ -d $mtpt ]] && log_must rm -rf $mtpt
        done
 
        return 0
@@ -109,7 +109,7 @@ setup_all
 
 typeset -i i=0
 while (( i < ${#args[*]} )); do
-       log_mustnot $ZFS snapshot ${args[i]}
+       log_mustnot zfs snapshot ${args[i]}
        ((i = i + 1))
 done
 
index 907d0dd12adffbd20353cf6ca946813d9ea94a5f..2efcf1cceb7ebf7af733bcb77215e1d1d56c37b2 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -49,11 +54,11 @@ function cleanup
                $TESTPOOL/$TESTCTR/$TESTVOL@$TESTSNAP;
        do
                snapexists $snap && \
-                       log_must $ZFS destroy $snap
+                       log_must zfs destroy $snap
        done
 
        datasetexists $TESTPOOL/$TESTCTR/$TESTVOL && \
-               log_must $ZFS destroy -rf $TESTPOOL/$TESTCTR/$TESTVOL
+               log_must zfs destroy -rf $TESTPOOL/$TESTCTR/$TESTVOL
 
 }
 
@@ -67,12 +72,12 @@ set -A args "" \
     "$TESTPOOL/$TESTCTR@$TESTSNAP@$TESTSNAP"
 
 # setup preparations
-log_must $ZFS snapshot $TESTPOOL/$TESTCTR/$TESTFS1@$TESTSNAP
+log_must zfs snapshot $TESTPOOL/$TESTCTR/$TESTFS1@$TESTSNAP
 
 # testing
 typeset -i i=0
 while (( i < ${#args[*]} )); do
-       log_mustnot $ZFS snapshot -r ${args[i]}
+       log_mustnot zfs snapshot -r ${args[i]}
 
        ((i = i + 1))
 done
@@ -80,14 +85,14 @@ done
 # Testing the invalid senario: the child volume already has an
 # identical name snapshot, zfs snapshot -r should fail when
 # creating snapshot with -r for the parent
-log_must $ZFS destroy $TESTPOOL/$TESTCTR/$TESTFS1@$TESTSNAP
+log_must zfs destroy $TESTPOOL/$TESTCTR/$TESTFS1@$TESTSNAP
 if is_global_zone; then
-       log_must $ZFS create -V $VOLSIZE $TESTPOOL/$TESTCTR/$TESTVOL
+       log_must zfs create -V $VOLSIZE $TESTPOOL/$TESTCTR/$TESTVOL
 else
-       log_must $ZFS create $TESTPOOL/$TESTCTR/$TESTVOL
+       log_must zfs create $TESTPOOL/$TESTCTR/$TESTVOL
 fi
-log_must $ZFS snapshot $TESTPOOL/$TESTCTR/$TESTVOL@$TESTSNAP
+log_must zfs snapshot $TESTPOOL/$TESTCTR/$TESTVOL@$TESTSNAP
 
-log_mustnot $ZFS snapshot -r $TESTPOOL/$TESTCTR@$TESTSNAP
+log_mustnot zfs snapshot -r $TESTPOOL/$TESTCTR@$TESTSNAP
 
 log_pass "'zfs snapshot -r' fails with invalid arguments or scenarios as expected."
index e424b9b811055399fa70b91ed2686af7b159c7aa..ca8ff8ca4357d6c2aed2ca4801aca99d54852a7a 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -48,14 +53,14 @@ l_name="$(gen_dataset_name 260 abcdefg)"
 
 for ds in $TESTPOOL/$TESTFS $TESTPOOL/$TESTCTR $TESTPOOL/$TESTVOL; do
        for opt in ${badopts[@]}; do
-               log_mustnot $ZFS snapshot $opt $ds@$TESTSNAP
+               log_mustnot zfs snapshot $opt $ds@$TESTSNAP
        done
 
-       log_mustnot $ZFS snapshot $ds@snap $ds@snap1
-       log_mustnot $ZFS snapshot -r $ds@snap $ds@snap1
+       log_mustnot zfs snapshot $ds@snap $ds@snap1
+       log_mustnot zfs snapshot -r $ds@snap $ds@snap1
 
-       log_mustnot $ZFS snapshot $ds@$l_name
-       log_mustnot $ZFS snapshot -r $ds@$l_name
+       log_mustnot zfs snapshot $ds@$l_name
+       log_mustnot zfs snapshot -r $ds@$l_name
 done
 
 log_pass "'zfs snapshot' fails with bad options or too many arguments as expected."
index 319e5c44c57104507ed2c5290e9df047b070bee1..96121f1c136d06b19f602456fdf80fa32275bda8 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -41,7 +45,7 @@ verify_runnable "both"
 function cleanup
 {
        if datasetexists $initfs ; then
-               log_must $ZFS destroy -rf $initfs
+               log_must zfs destroy -rf $initfs
        fi
 }
 
@@ -52,12 +56,12 @@ initfs=$TESTPOOL/$TESTFS/$TESTFS
 basefs=$initfs
 typeset -i ret=0 len snaplen
 while ((ret == 0)); do
-       $ZFS create $basefs
-       $ZFS snapshot $basefs@snap1
+       zfs create $basefs
+       zfs snapshot $basefs@snap1
        ret=$?
 
        if ((ret != 0)); then
-               len=$($ECHO $basefs| $WC -c)
+               len=$(echo $basefs| wc -c)
                log_note "The deeply-nested filesystem len: $len"
 
                #
@@ -67,10 +71,10 @@ while ((ret == 0)); do
                #
                if ((len >= 255)); then
                        if datasetexists $basefs; then
-                               log_must $ZFS destroy -r $basefs
+                               log_must zfs destroy -r $basefs
                        fi
                        basefs=${basefs%/*}
-                       len=$($ECHO $basefs| $WC -c)
+                       len=$(echo $basefs| wc -c)
                fi
                break
        fi
@@ -81,7 +85,7 @@ done
 # Make snapshot name is longer than the max length
 ((snaplen = 256 - len + 10))
 snap=$(gen_dataset_name $snaplen "s")
-log_mustnot $ZFS snapshot -r $TESTPOOL@$snap
+log_mustnot zfs snapshot -r $TESTPOOL@$snap
 
 log_must datasetnonexists $TESTPOOL@$snap
 while [[ $basefs != $TESTPOOL ]]; do
index 8794cba84f02d291780dc58f1c59afc7df19b30f..d97dc0f8226518d34baa0374e147c67951681d4f 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -42,7 +46,7 @@ verify_runnable "both"
 function cleanup
 {
        if datasetexists $initfs ; then
-               log_must $ZFS destroy -rf $initfs
+               log_must zfs destroy -rf $initfs
        fi
 }
 
@@ -53,12 +57,12 @@ initfs=$TESTPOOL/$TESTFS/$TESTFS
 basefs=$initfs
 typeset -i ret=0 len snaplen
 while ((ret == 0)); do
-       $ZFS create $basefs
-       $ZFS snapshot $basefs@snap1
+       zfs create $basefs
+       zfs snapshot $basefs@snap1
        ret=$?
 
        if ((ret != 0)); then
-               len=$($ECHO $basefs | $WC -c)
+               len=$(echo $basefs | wc -c)
                log_note "The deeply-nested filesystem len: $len"
 
                #
@@ -68,10 +72,10 @@ while ((ret == 0)); do
                #
                if ((len >= 255)); then
                        if datasetexists $basefs; then
-                               log_must $ZFS destroy -r $basefs
+                               log_must zfs destroy -r $basefs
                        fi
                        basefs=${basefs%/*}
-                       len=$($ECHO $basefs| $WC -c)
+                       len=$(echo $basefs| wc -c)
                fi
                break
        fi
@@ -82,11 +86,11 @@ done
 # Make snapshot name length match the longest one
 ((snaplen = 256 - len - 1)) # 1: @
 snap=$(gen_dataset_name $snaplen "s")
-log_must $ZFS snapshot $basefs@$snap
+log_must zfs snapshot $basefs@$snap
 
-log_mustnot $ZFS rename $basefs ${basefs}a
-log_mustnot $ZFS rename $basefs ${basefs}-new
-log_mustnot $ZFS rename $initfs ${initfs}-new
-log_mustnot $ZFS rename $TESTPOOL/$TESTFS $TESTPOOL/$TESTFS-new
+log_mustnot zfs rename $basefs ${basefs}a
+log_mustnot zfs rename $basefs ${basefs}-new
+log_mustnot zfs rename $initfs ${initfs}-new
+log_mustnot zfs rename $TESTPOOL/$TESTFS $TESTPOOL/$TESTFS-new
 
 log_pass "Verify long name filesystem with snapshot should not break ZFS."
index 6d5f03cb85ea9ee24f3081eaa1f2c54542756793..089ebdb97924d0fd38cc20672d7ef62f87967258 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
@@ -47,7 +47,7 @@ function cleanup
        for fs in $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL $TESTPOOL ; do
                typeset fssnap=$fs@snap
                if datasetexists $fssnap ; then
-                       log_must $ZFS destroy -rf $fssnap
+                       log_must zfs destroy -rf $fssnap
                fi
        done
        cleanup_user_prop $TESTPOOL
@@ -77,16 +77,16 @@ for fs in $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL $TESTPOOL ; do
        prop_name=$(valid_user_property 10)
        value=$(user_property_value 16)
 
-       log_must eval "$ZFS snapshot -o $prop_name='$value' $fssnap"
+       log_must eval "zfs snapshot -o $prop_name='$value' $fssnap"
        log_must snapexists $fssnap
        log_mustnot nonexist_user_prop $prop_name $fssnap
 
-       log_must $ZFS destroy -f $fssnap
+       log_must zfs destroy -f $fssnap
 
        prop_name2=$(valid_user_property 10)
        value2=$(user_property_value 16)
 
-       log_must eval "$ZFS snapshot -o $prop_name='$value' -o $prop_name2='$value2' $fssnap"
+       log_must eval "zfs snapshot -o $prop_name='$value' -o $prop_name2='$value2' $fssnap"
        log_must snapexists $fssnap
        log_mustnot nonexist_user_prop $prop_name $fssnap
        log_mustnot nonexist_user_prop $prop_name2 $fssnap
@@ -97,13 +97,13 @@ cleanup
 prop_name=$(valid_user_property 10)
 value=$(user_property_value 16)
 
-log_must eval "$ZFS snapshot -r -o $prop_name='$value' $TESTPOOL@snap"
+log_must eval "zfs snapshot -r -o $prop_name='$value' $TESTPOOL@snap"
 for fs in $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL $TESTPOOL ; do
        typeset fssnap=$fs@snap
        log_must snapexists $fssnap
        log_mustnot nonexist_user_prop $prop_name $fssnap
 
-       log_must $ZFS destroy -rf $fssnap
+       log_must zfs destroy -rf $fssnap
 done
 
 cleanup
@@ -111,14 +111,14 @@ cleanup
 prop_name2=$(valid_user_property 10)
 value2=$(user_property_value 16)
 
-log_must eval "$ZFS snapshot -r -o $prop_name='$value' -o $prop_name2='$value2' $TESTPOOL@snap"
+log_must eval "zfs snapshot -r -o $prop_name='$value' -o $prop_name2='$value2' $TESTPOOL@snap"
 for fs in $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL $TESTPOOL ; do
        typeset fssnap=$fs@snap
        log_must snapexists $fssnap
        log_mustnot nonexist_user_prop $prop_name $fssnap
        log_mustnot nonexist_user_prop $prop_name2 $fssnap
 
-       log_must $ZFS destroy -rf $fssnap
+       log_must zfs destroy -rf $fssnap
 done
 
 log_pass "User property could be set upon snapshot via 'zfs snapshot -o'."
index 1a80e4f58bee62db295e1b75b5db85534e0d16bd..590d56ec80657455644730e7bb699de291e4c883 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
 
 #
@@ -43,7 +47,7 @@ function cleanup
        for fs in $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL $TESTPOOL/$TESTCTR $TESTPOOL ; do
                typeset fssnap=$fs@snap
                if datasetexists $fssnap ; then
-                       log_must $ZFS destroy -rf $fssnap
+                       log_must zfs destroy -rf $fssnap
                fi
        done
        cleanup_user_prop $TESTPOOL
@@ -72,7 +76,7 @@ typeset snap_ro_props="volsize recordsize recsize quota reservation reserv mount
        sharenfs checksum compression compress atime devices exec readonly rdonly \
        setuid zoned"
 
-$ZFS upgrade -v > /dev/null 2>&1
+zfs upgrade -v > /dev/null 2>&1
 if [[ $? -eq 0 ]]; then
        snap_ro_props="$snap_ro_props version"
 fi
@@ -83,21 +87,21 @@ for fs in $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL $TESTPOOL/$TESTCTR $TESTPOOL ; do
        prop_name=$(valid_user_property 10)
        value=$(user_property_value 16)
 
-       log_must eval "$ZFS snapshot -o $prop_name='$value' $fssnap"
+       log_must eval "zfs snapshot -o $prop_name='$value' $fssnap"
        log_must snapexists $fssnap
        log_mustnot nonexist_user_prop $prop_name $fssnap
 
-       log_must $ZFS destroy -f $fssnap
+       log_must zfs destroy -f $fssnap
 
        prop_name2=$(valid_user_property 10)
        value2=$(user_property_value 16)
 
-       log_must eval "$ZFS snapshot -o $prop_name='$value' -o $prop_name2='$value2' $fssnap"
+       log_must eval "zfs snapshot -o $prop_name='$value' -o $prop_name2='$value2' $fssnap"
        log_must snapexists $fssnap
        log_mustnot nonexist_user_prop $prop_name $fssnap
        log_mustnot nonexist_user_prop $prop_name2 $fssnap
 
-       log_must $ZFS destroy -f $fssnap
+       log_must zfs destroy -f $fssnap
 done
 
 cleanup
@@ -105,7 +109,7 @@ cleanup
 prop_name=$(valid_user_property 10)
 value=$(user_property_value 16)
 
-log_must eval "$ZFS snapshot -r -o $prop_name='$value' $TESTPOOL@snap"
+log_must eval "zfs snapshot -r -o $prop_name='$value' $TESTPOOL@snap"
 for fs in $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL $TESTPOOL/$TESTCTR $TESTPOOL ; do
        typeset fssnap=$fs@snap
        log_must snapexists $fssnap
@@ -117,7 +121,7 @@ cleanup
 prop_name2=$(valid_user_property 10)
 value2=$(user_property_value 16)
 
-log_must eval "$ZFS snapshot -r -o $prop_name='$value' -o $prop_name2='$value2' $TESTPOOL@snap"
+log_must eval "zfs snapshot -r -o $prop_name='$value' -o $prop_name2='$value2' $TESTPOOL@snap"
 for fs in $TESTPOOL/$TESTFS $TESTPOOL/$TESTVOL $TESTPOOL/$TESTCTR $TESTPOOL ; do
        typeset fssnap=$fs@snap
        log_must snapexists $fssnap
index 935e277d14f7a8ab0e78db101ba69fe1aee3a340..3779100132716c809ce6e28beddd9adffc044b47 100755 (executable)
@@ -21,7 +21,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cli_root/zfs_snapshot/zfs_snapshot.cfg
@@ -43,7 +43,7 @@ function cleanup
 {
        for pool in $SNAPPOOL1 $SNAPPOOL2 ; do
                if poolexists $pool ; then
-                       log_must $ZPOOL destroy -f $pool
+                       log_must zpool destroy -f $pool
                fi
        done
 
@@ -57,12 +57,12 @@ function cleanup
 log_assert "'zfs snapshot pool1@snap1 pool2@snap2' should fail since snapshots are in different pools."
 log_onexit cleanup
 
-log_must $MKFILE $MINVDEVSIZE $SNAPDEV1
-log_must $MKFILE $MINVDEVSIZE $SNAPDEV2
+log_must mkfile $MINVDEVSIZE $SNAPDEV1
+log_must mkfile $MINVDEVSIZE $SNAPDEV2
 
-log_must $ZPOOL create $SNAPPOOL1 $SNAPDEV1
-log_must $ZPOOL create $SNAPPOOL2 $SNAPDEV2
+log_must zpool create $SNAPPOOL1 $SNAPDEV1
+log_must zpool create $SNAPPOOL2 $SNAPDEV2
 
-log_mustnot $ZFS snapshot $SNAPPOOL1@snap1 $SNAPPOOL2@snap2
+log_mustnot zfs snapshot $SNAPPOOL1@snap1 $SNAPPOOL2@snap2
 
 log_pass "'zfs snapshot pool1@snap1 pool2@snap2' should fail since snapshots are in different pools."
index ff0cdf1296ad85bbf6b33d65a88162db428ff196..df9c49b9f0d45eafb5fb58ef6b39810aa2cb2bc2 100755 (executable)
@@ -11,7 +11,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 #
@@ -31,9 +31,9 @@ ZFS_MAX_DATASET_NAME_LEN=256
 function cleanup
 {
        for ds in $datasets; do
-               datasetexists $ds && log_must $ZFS destroy -r $ds
+               datasetexists $ds && log_must zfs destroy -r $ds
        done
-       $ZFS destroy -r $TESTPOOL/TESTFS4
+       zfs destroy -r $TESTPOOL/TESTFS4
 }
 datasets="$TESTPOOL/$TESTFS1 $TESTPOOL/$TESTFS2
     $TESTPOOL/$TESTFS3"
@@ -59,38 +59,38 @@ test_data=$STF_SUITE/tests/functional/cli_root/zpool_upgrade/*.bz2
 
 log_note "destroy a list of valid snapshots"
 for ds in $datasets; do
-       log_must $ZFS create $ds
-       log_must $CP -r $test_data /$ds
+       log_must zfs create $ds
+       log_must cp -r $test_data /$ds
 done
 i=0
 while (( i < ${#valid_args[*]} )); do
-       log_must $ZFS snapshot ${valid_args[i]}
+       log_must zfs snapshot ${valid_args[i]}
        for token in ${valid_args[i]}; do
                log_must snapexists $token && \
-                   log_must $ZFS destroy $token
+                   log_must zfs destroy $token
        done
        ((i = i + 1))
 done
 log_note "destroy a list of invalid snapshots"
 i=0
 while (( i < ${#invalid_args[*]} )); do
-       log_mustnot $ZFS snapshot ${invalid_args[i]}
+       log_mustnot zfs snapshot ${invalid_args[i]}
        for token in ${invalid_args[i]}; do
                log_mustnot snapexists $token
        done
        ((i = i + 1))
 done
 log_note "verify multiple snapshot transaction group"
-txg_group=$($ZDB -Pd $TESTPOOL | $GREP snap | $AWK '{print $7}')
+txg_group=$(zdb -Pd $TESTPOOL | grep snap | awk '{print $7}')
 for i in 1 2 3; do
-       txg_tag=$($ECHO "$txg_group" | $NAWK -v j=$i 'FNR == j {print}')
-       [[ $txg_tag != $($ECHO "$txg_group" | \
-           $NAWK -v j=$i 'FNR == j {print}') ]] \
+       txg_tag=$(echo "$txg_group" | nawk -v j=$i 'FNR == j {print}')
+       [[ $txg_tag != $(echo "$txg_group" | \
+           nawk -v j=$i 'FNR == j {print}') ]] \
            && log_fail "snapshots belong to differnt transaction groups"
 done
 log_note "verify snapshot contents"
 for ds in $datasets; do
-       status=$($DIRCMP /$ds /$ds/.zfs/snapshot/snap | $GREP "different")
+       status=$(dircmp /$ds /$ds/.zfs/snapshot/snap | grep "different")
        [[ -z $status ]] || log_fail "snapshot contents are different from" \
            "the filesystem"
 done
@@ -101,13 +101,13 @@ DATASET_XXX=$(printf 'x%.0s' \
     {1..$(($ZFS_MAX_DATASET_NAME_LEN - ${#TESTPOOL} - ${#TESTFS3} - 18))})
 
 log_note "verify multiple snapshot with -r option"
-log_must $ZFS create $TESTPOOL/TESTFS4
-log_must $ZFS create -p $TESTPOOL/$TESTFS3/TESTFSA$DATASET_XXX/TESTFSB
-log_mustnot $ZFS snapshot -r $TESTPOOL/$TESTFS1@snap1 $TESTPOOL/$TESTFS2@snap1 \
+log_must zfs create $TESTPOOL/TESTFS4
+log_must zfs create -p $TESTPOOL/$TESTFS3/TESTFSA$DATASET_XXX/TESTFSB
+log_mustnot zfs snapshot -r $TESTPOOL/$TESTFS1@snap1 $TESTPOOL/$TESTFS2@snap1 \
         $TESTPOOL/$TESTFS3@snap1 $TESTPOOL/TESTFS4@snap1
-log_must $ZFS rename $TESTPOOL/$TESTFS3/TESTFSA$DATASET_XXX \
+log_must zfs rename $TESTPOOL/$TESTFS3/TESTFSA$DATASET_XXX \
     $TESTPOOL/$TESTFS3/TESTFSA
-log_must $ZFS snapshot -r $TESTPOOL/$TESTFS1@snap1 $TESTPOOL/$TESTFS2@snap1 \
+log_must zfs snapshot -r $TESTPOOL/$TESTFS1@snap1 $TESTPOOL/$TESTFS2@snap1 \
         $TESTPOOL/$TESTFS3@snap1 $TESTPOOL/TESTFS4@snap1
 
 log_pass "zfs multiple snapshot verified correctly"
index 9c9cb71ba90b6ae3719851114598a68c96b0d5b0..525dfd162957e338b365c7edd57b38cfd2ea04c7 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cli_root/zfs_unmount/zfs_unmount.cfg
@@ -42,19 +42,19 @@ function do_unmount #cmd #opt #mnt #expect
        mounted $mnt || wasmounted=0
 
        if (( expect == 0 )) ; then
-               log_must $ZFS $cmd $opt $mnt
+               log_must zfs $cmd $opt $mnt
 
                log_must unmounted $mnt
 
-               log_note "Successfully $ZFS $cmd $opt $mnt"
+               log_note "Successfully zfs $cmd $opt $mnt"
 
        else
-               log_note "$ZFS $cmd $opt $mnt"
+               log_note "zfs $cmd $opt $mnt"
 
-               $ZFS $cmd $opt $mnt
+               zfs $cmd $opt $mnt
                ret=$?
                if (( ret != expect)); then
-                       log_fail "'$ZFS $cmd $opt $mnt' " \
+                       log_fail "'zfs $cmd $opt $mnt' " \
                                "unexpected return code of $ret."
                fi
 
@@ -71,7 +71,7 @@ function cleanup
 {
        [[ -n $cwd ]] && cd $cwd
 
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
        mounted $TESTPOOL/$TESTFS || \
-               log_must $ZFS $mountcmd $TESTPOOL/$TESTFS
+               log_must zfs $mountcmd $TESTPOOL/$TESTFS
 }
index 924e6ac179dd34bf8c64ebc7e5be61854d14d87c..fb4d1d937895132d57bf2d98d77e70af4b5a8a7c 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -47,13 +52,13 @@ verify_runnable "both"
 function cleanup
 {
        mounted $TESTDIR2 && \
-               log_must $ZFS umount -f $TESTDIR2
+               log_must zfs umount -f $TESTDIR2
 
        datasetexists $TESTPOOL/$TESTFS2 && \
-               log_must $ZFS destroy $TESTPOOL/$TESTFS2
+               log_must zfs destroy $TESTPOOL/$TESTFS2
 
        [[ -d $TESTDIR2 ]] && \
-               log_must $RM -rf $TESTDIR2
+               log_must rm -rf $TESTDIR2
 }
 function do_unmount
 {
@@ -62,18 +67,18 @@ function do_unmount
        typeset mnt=$3
 
        [[ ! -d $TESTDIR2 ]] && \
-           log_must $MKDIR $TESTDIR2
+           log_must mkdir $TESTDIR2
 
        if ! datasetexists $TESTPOOL/$TESTFS2 ; then
-               log_must $ZFS create $TESTPOOL/$TESTFS2
-               log_must $ZFS set mountpoint=$TESTDIR2 \
+               log_must zfs create $TESTPOOL/$TESTFS2
+               log_must zfs set mountpoint=$TESTDIR2 \
                    $TESTPOOL/$TESTFS2
        fi
 
        unmounted $TESTPOOL/$TESTFS2 && \
-               log_must $ZFS mount $TESTPOOL/$TESTFS2
+               log_must zfs mount $TESTPOOL/$TESTFS2
 
-       log_must $ZFS $cmd $options $mnt
+       log_must zfs $cmd $options $mnt
 
        unmounted "$mnt" || \
                log_fail "Unable to unmount $options $mnt"
index 1b0e6213457bf053dc8f0074dc1ae31511ce7252..b8a50785868f46b3fa925b1b62c60d7453d029bd 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_unmount/zfs_unmount.kshlib
 
@@ -66,7 +70,7 @@ function do_unmount_multiple #options #expect
                j=0
                while (( j < ${#dev[*]} )); do
                        log_note "Make sure ${dev[j]} is not in 'zfs list'"
-                       log_mustnot $ZFS list ${dev[j]}
+                       log_mustnot zfs list ${dev[j]}
 
                        do_unmount "${cmd[i]}" "$opt" \
                                "${dev[j]}" $expect
@@ -78,7 +82,7 @@ function do_unmount_multiple #options #expect
        done
 }
 
-log_assert "Verify that '$ZFS $unmountcmd [-f] <filesystem|mountpoint>' " \
+log_assert "Verify that 'zfs $unmountcmd [-f] <filesystem|mountpoint>' " \
        "whose name is not in 'zfs list' will fail with return code 1."
 
 log_onexit cleanup
@@ -90,5 +94,5 @@ while (( i <  ${#options[*]} )); do
        ((i = i + 1))
 done
 
-log_pass "'$ZFS $unmountcmd [-f] <filesystem|mountpoint>' " \
+log_pass "'zfs $unmountcmd [-f] <filesystem|mountpoint>' " \
        "whose name is not in 'zfs list' failed with return code 1."
index 8f1b9497e8214d480362b5b1ed4438cfc6a0a2fd..985c3d2b1fe20b53fec11f5859acea3d246ac67c 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_unmount/zfs_unmount.kshlib
 
@@ -68,7 +72,7 @@ function do_unmount_multiple #options #expect #mountpoint
                j=0
                while (( j < ${#dev[*]} )); do
                        [[ -n $mopt ]] && \
-                               log_must $ZFS set mountpoint=$mopt ${dev[0]}
+                               log_must zfs set mountpoint=$mopt ${dev[0]}
 
                        do_unmount "${cmd[i]}" "$opt" \
                                "${dev[j]}" $expect
@@ -82,7 +86,7 @@ function do_unmount_multiple #options #expect #mountpoint
        done
 }
 
-log_assert "Verify that '$ZFS $unmountcmd [-f] <filesystem|mountpoint>' " \
+log_assert "Verify that 'zfs $unmountcmd [-f] <filesystem|mountpoint>' " \
        "whose mountpoint property is 'legacy' or 'none' " \
        "will fail with return code 1."
 
@@ -100,6 +104,6 @@ while (( i < ${#mopts[*]} )); do
        ((i = i + 1))
 done
 
-log_pass "'$ZFS $unmountcmd [-f] <filesystem|mountpoint>' " \
+log_pass "'zfs $unmountcmd [-f] <filesystem|mountpoint>' " \
        "whose mountpoint property is 'legacy' or 'none' " \
        "will fail with return code 1."
index 8f3def6e5a0929606c157f96ab49b543cadaa43b..bcc25ccd0f8014f3c0797bbc9d3a0d83322e6b6b 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_unmount/zfs_unmount.kshlib
 
@@ -67,7 +71,7 @@ function do_unmount_multiple #options #expect
                j=0
                while (( j < ${#dev[*]} )); do
                        unmounted ${dev[j]} || \
-                               log_must $ZFS $unmountforce ${dev[j]}
+                               log_must zfs $unmountforce ${dev[j]}
 
                        do_unmount "${cmd[i]}" "$opt" \
                                "${dev[j]}" $expect
@@ -79,7 +83,7 @@ function do_unmount_multiple #options #expect
        done
 }
 
-log_assert "Verify that '$ZFS $unmountcmd [-f] <filesystem|mountpoint>' " \
+log_assert "Verify that 'zfs $unmountcmd [-f] <filesystem|mountpoint>' " \
        "with an unmounted filesystem will fail with return code 1."
 
 log_onexit cleanup
@@ -91,5 +95,5 @@ while (( i <  ${#options[*]} )); do
        ((i = i + 1))
 done
 
-log_pass "'$ZFS $unmountcmd [-f] <filesystem|mountpoint>' " \
+log_pass "'zfs $unmountcmd [-f] <filesystem|mountpoint>' " \
        "with an unmounted filesystem failed with return code 1."
index ac2de65ae7e639895e267f74dadf7bfdfcda91ff..e21a2954d0c61f6f004d59955591707752af9244 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_unmount/zfs_unmount.kshlib
 
@@ -68,7 +72,7 @@ function do_unmount_multiple #options #expect
                j=0
                while (( j < ${#dev[*]} )); do
                        mounted ${dev[j]} || \
-                               log_must $ZFS $mountcmd ${dev[0]}
+                               log_must zfs $mountcmd ${dev[0]}
 
                        cd $TESTDIR || \
                                log_unresolved "Unable change dir to $TESTDIR"
@@ -85,7 +89,7 @@ function do_unmount_multiple #options #expect
        done
 }
 
-log_assert "Verify that '$ZFS $unmountcmd <filesystem|mountpoint>' " \
+log_assert "Verify that 'zfs $unmountcmd <filesystem|mountpoint>' " \
        "with a filesystem which mountpoint is currently in use " \
        "will fail with return code 1, and forcefully will succeeds as root."
 
@@ -104,6 +108,6 @@ while (( i <  ${#options[*]} )); do
         ((i = i + 1))
 done
 
-log_pass "'$ZFS $unmountcmd <filesystem|mountpoint>' " \
+log_pass "'zfs $unmountcmd <filesystem|mountpoint>' " \
        "with a filesystem which mountpoint is currently in use " \
        "will fail with return code 1, and forcefully will succeeds as root."
index 3e2ac07b2d53ffb6f4a6acbb12e14c4030880586..8b70e8868a02ad7e03948660776bfd8760314c7c 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -42,7 +46,7 @@ verify_runnable "both"
 function cleanup
 {
        if ! ismounted $TESTPOOL/$TESTFS ; then
-               log_must $ZFS mount $TESTPOOL/$TESTFS
+               log_must zfs mount $TESTPOOL/$TESTFS
        fi
 }
 
@@ -56,12 +60,12 @@ mntpnt=$(get_prop mountpoint $TESTPOOL/$TESTFS)
 
 typeset -i i=0
 while (( i < 10000 )); do
-       $CP $STF_SUITE/include/libtest.shlib $mntpnt
+       cp $STF_SUITE/include/libtest.shlib $mntpnt
 
        (( i += 1 ))
 done
 log_note "Recreating zfs files for 10000 times."
 
-log_must $ZFS unmount $TESTPOOL/$TESTFS
+log_must zfs unmount $TESTPOOL/$TESTFS
 
 log_pass "Re-creating zfs files, 'zfs unmount' passed."
index c1000e85ecf05f40756e924afb1f944bf116573c..cdf4a5a2666160ec71d60496e2523281a785385a 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/zfs_mount/zfs_mount.kshlib
 . $STF_SUITE/tests/functional/cli_root/zfs_unmount/zfs_unmount.kshlib
 
@@ -70,10 +74,10 @@ function cleanup_all
        typeset fs
 
        cleanup_filesystem "$TESTPOOL" "$TESTFS1"
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 
        [[ -d ${TEST_BASE_DIR%%/}/testroot$$ ]] && \
-               $RM -rf ${TEST_BASE_DIR%%/}/testroot$$
+               rm -rf ${TEST_BASE_DIR%%/}/testroot$$
 
        return 0
 }
@@ -96,7 +100,7 @@ log_must setup_all
 
 typeset -i i=0
 while (( i < ${#args[*]} )); do
-       log_mustnot $ZFS ${args[i]}
+       log_mustnot zfs ${args[i]}
        ((i = i + 1))
 done
 
index 04a7e560866e6f19b6117d06d9f3cd56a36b679b..e83e8d5165eb296cee7bcafb5e6403fdb158939b 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -50,19 +54,19 @@ function cleanup
 {
        for ds in $vol $fs1; do
                if datasetexists $ds; then
-                       log_must $ZFS destroy -f $ds
+                       log_must zfs destroy -f $ds
                fi
        done
 
        if snapexists $snap; then
-               log_must $ZFS destroy $snap
+               log_must zfs destroy $snap
        fi
 
        if [[ -e /tmp/$file ]]; then
-               $RM -f /tmp/$file
+               rm -f /tmp/$file
        fi
        if [[ -d /tmp/$dir ]]; then
-               $RM -rf /tmp/$dir
+               rm -rf /tmp/$dir
        fi
 
 }
@@ -76,26 +80,26 @@ snap=$TESTPOOL/$TESTFS@snap.$$
 set -A badargs "A" "-A" "F" "-F" "-" "-x" "-?"
 
 if ! ismounted $fs; then
-       log_must $ZFS mount $fs
+       log_must zfs mount $fs
 fi
 
-log_must $ZFS snapshot $snap
+log_must zfs snapshot $snap
 if is_global_zone; then
-       log_must $ZFS create -V 10m $vol
+       log_must zfs create -V 10m $vol
 else
        vol=""
 fi
 
 # Testing bad options
 for arg in ${badargs[@]}; do
-       log_mustnot eval "$ZFS unmount $arg $fs >/dev/null 2>&1"
+       log_mustnot eval "zfs unmount $arg $fs >/dev/null 2>&1"
 done
 
 
 #Testing invalid datasets
 for ds in $snap $vol "blah"; do
        for opt in "" "-f"; do
-               log_mustnot eval "$ZFS unmount $opt $ds >/dev/null 2>&1"
+               log_mustnot eval "zfs unmount $opt $ds >/dev/null 2>&1"
        done
 done
 
@@ -103,41 +107,41 @@ done
 dir=foodir.$$
 file=foo.$$
 fs1=$TESTPOOL/fs.$$
-$MKDIR /tmp/$dir
-$TOUCH /tmp/$file
-log_must $ZFS create -o mountpoint=/tmp/$dir $fs1
-curpath=`$DIRNAME $0`
+mkdir /tmp/$dir
+touch /tmp/$file
+log_must zfs create -o mountpoint=/tmp/$dir $fs1
+curpath=`dirname $0`
 cd /tmp
 for mpt in "./$dir" "./$file" "/tmp"; do
        for opt in "" "-f"; do
-               log_mustnot eval "$ZFS unmount $opt $mpt >/dev/null 2>&1"
+               log_mustnot eval "zfs unmount $opt $mpt >/dev/null 2>&1"
        done
 done
 cd $curpath
 
 #Testing null argument and too many arguments
 for opt in "" "-f"; do
-       log_mustnot eval "$ZFS unmount $opt >/dev/null 2>&1"
-       log_mustnot eval "$ZFS unmount $opt $fs $fs1 >/dev/null 2>&1"
+       log_mustnot eval "zfs unmount $opt >/dev/null 2>&1"
+       log_mustnot eval "zfs unmount $opt $fs $fs1 >/dev/null 2>&1"
 done
 
 #Testing already unmounted filesystem
-log_must $ZFS unmount $fs1
+log_must zfs unmount $fs1
 for opt in "" "-f"; do
-       log_mustnot eval "$ZFS unmount $opt $fs1 >/dev/null 2>&1"
-       log_mustnot eval "$ZFS unmount /tmp/$dir >/dev/null 2>&1"
+       log_mustnot eval "zfs unmount $opt $fs1 >/dev/null 2>&1"
+       log_mustnot eval "zfs unmount /tmp/$dir >/dev/null 2>&1"
 done
 
 #Testing legacy mounted filesystem
-log_must $ZFS set mountpoint=legacy $fs1
+log_must zfs set mountpoint=legacy $fs1
 if is_linux; then
-       log_must $MOUNT -t zfs $fs1 /tmp/$dir
+       log_must mount -t zfs $fs1 /tmp/$dir
 else
-       log_must $MOUNT -F zfs $fs1 /tmp/$dir
+       log_must mount -F zfs $fs1 /tmp/$dir
 fi
 for opt in "" "-f"; do
-       log_mustnot eval "$ZFS unmount $opt $fs1 >/dev/null 2>&1"
+       log_mustnot eval "zfs unmount $opt $fs1 >/dev/null 2>&1"
 done
-$UMOUNT /tmp/$dir
+umount /tmp/$dir
 
 log_pass "zfs unmount fails with bad parameters or scenarios as expected."
index 79c6fdabf03b27c706784c2cffa20e3c183977c8..b1d98e68bc4f7148e952e363389edc77317140db 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -52,28 +56,28 @@ function cleanup
        for fs in $TESTPOOL/$TESTFS $TESTPOOL ; do
                typeset snap=$fs@$TESTSNAP
                if snapexists $snap; then
-                       log_must $ZFS destroy $snap
+                       log_must zfs destroy $snap
                fi
        done
 
        if ! poolexists $TESTPOOL && is_global_zone; then
-               log_must $ZPOOL create $TESTPOOL $DISK
+               log_must zpool create $TESTPOOL $DISK
        fi
 
        if ! datasetexists $TESTPOOL/$TESTFS; then
-               log_must $ZFS create $TESTPOOL/$TESTFS
-               log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+               log_must zfs create $TESTPOOL/$TESTFS
+               log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
        fi
 }
 
 function restore_dataset
 {
        if ! datasetexists $TESTPOOL/$TESTFS ; then
-               log_must $ZFS create $TESTPOOL/$TESTFS
-               log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+               log_must zfs create $TESTPOOL/$TESTFS
+               log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
                log_must cd $TESTDIR
-               $ECHO hello > world
-               log_must $ZFS snapshot $TESTPOOL/$TESTFS@$TESTSNAP
+               echo hello > world
+               log_must zfs snapshot $TESTPOOL/$TESTFS@$TESTSNAP
                log_must cd .zfs/snapshot/$TESTSNAP
        fi
 }
@@ -87,22 +91,22 @@ for fs in $TESTPOOL/$TESTFS $TESTPOOL ; do
        typeset mtpt=$(get_prop mountpoint $fs)
 
        log_must cd $mtpt
-       $ECHO hello > world
-       log_must $ZFS snapshot $snap
+       echo hello > world
+       log_must zfs snapshot $snap
        log_must cd .zfs/snapshot/$TESTSNAP
 
-       log_mustnot $ZFS unmount -a
-       log_must $ZFS unmount -fa
-       log_mustnot $LS
+       log_mustnot zfs unmount -a
+       log_must zfs unmount -fa
+       log_mustnot ls
        log_must cd /
 
-       log_must $ZFS mount -a
+       log_must zfs mount -a
        log_must cd $mtpt
        log_must cd .zfs/snapshot/$TESTSNAP
 
        if is_global_zone || [[ $fs != $TESTPOOL ]] ; then
-               log_must $ZFS destroy -rf $fs
-               log_mustnot $LS
+               log_must zfs destroy -rf $fs
+               log_mustnot ls
                log_must cd /
        fi
 
@@ -110,14 +114,14 @@ for fs in $TESTPOOL/$TESTFS $TESTPOOL ; do
 done
 
 if is_global_zone ; then
-       log_must $ZPOOL destroy -f $TESTPOOL
-       log_mustnot $LS
+       log_must zpool destroy -f $TESTPOOL
+       log_mustnot ls
        log_must cd /
 fi
 
-log_must eval $ZFS list > /dev/null 2>&1
-log_must eval $ZPOOL list > /dev/null 2>&1
-log_must eval $ZPOOL status > /dev/null 2>&1
-$ZPOOL iostat > /dev/null 2>&1
+log_must eval zfs list > /dev/null 2>&1
+log_must eval zpool list > /dev/null 2>&1
+log_must eval zpool status > /dev/null 2>&1
+zpool iostat > /dev/null 2>&1
 
 log_pass "zfs fource unmount and destroy in snapshot directory will not cause error."
index 454293f01ac2508500b66afd344773401f0b357a..b1be2093eda8894204d021deec6ee05ff269206c 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/cli_root/zfs_mount/zfs_mount.kshlib
 . $STF_SUITE/tests/functional/cli_root/zfs_unmount/zfs_unmount.kshlib
 
@@ -119,7 +123,7 @@ function cleanup_all
        done
 
        [[ -d ${TEST_BASE_DIR%%/}/testroot$$ ]] && \
-               $RM -rf ${TEST_BASE_DIR%%/}/testroot$$
+               rm -rf ${TEST_BASE_DIR%%/}/testroot$$
 }
 
 function verify_all
@@ -167,17 +171,17 @@ log_must setup_all
 typeset opt
 for opt in "-a" "-fa"; do
        export __ZFS_POOL_RESTRICT="$TESTPOOL"
-       log_must $ZFS $mountall
+       log_must zfs $mountall
        unset __ZFS_POOL_RESTRICT
 
        if [[ $opt == "-fa" ]]; then
                mntpnt=$(get_prop mountpoint ${TESTPOOL}/${TESTCTR}/${TESTFS})
                cd $mntpnt
-               log_mustnot $ZFS unmount -a
+               log_mustnot zfs unmount -a
        fi
 
        export __ZFS_POOL_RESTRICT="$TESTPOOL"
-       log_must $ZFS unmount $opt
+       log_must zfs unmount $opt
        unset __ZFS_POOL_RESTRICT
 
        if [[ $opt == "-fa" ]]; then
index 11044e5d3e32c422fcf5e178f106c6e33745025b..7bb1cd4a37cafa2ff4c0d0658919f7c228a65d3a 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -46,28 +50,28 @@ function cleanup
 {
        typeset -i i=0
        while (( i < ${#mntp_fs[*]} )); do
-               log_must $ZFS set sharenfs=off ${mntp_fs[((i+1))]}
+               log_must zfs set sharenfs=off ${mntp_fs[((i+1))]}
 
                ((i = i + 2))
        done
 
        if mounted $TESTPOOL/$TESTCLONE; then
-               log_must $ZFS unmount $TESTDIR2
+               log_must zfs unmount $TESTDIR2
        fi
 
        [[ -d $TESTDIR2 ]] && \
-               log_must $RM -rf $TESTDIR2
+               log_must rm -rf $TESTDIR2
 
        if datasetexists "$TESTPOOL/$TESTCLONE"; then
-               log_must $ZFS destroy -f $TESTPOOL/$TESTCLONE
+               log_must zfs destroy -f $TESTPOOL/$TESTCLONE
        fi
 
        if snapexists "$TESTPOOL/$TESTFS2@snapshot"; then
-               log_must $ZFS destroy -f $TESTPOOL/$TESTFS2@snapshot
+               log_must zfs destroy -f $TESTPOOL/$TESTFS2@snapshot
        fi
 
        if datasetexists "$TESTPOOL/$TESTFS2"; then
-               log_must $ZFS destroy -f $TESTPOOL/$TESTFS2
+               log_must zfs destroy -f $TESTPOOL/$TESTFS2
        fi
 }
 
@@ -89,28 +93,28 @@ function test_unshare # <mntp> <filesystem>
        if [[ $prop_value == "off" ]]; then
                not_shared $mntp ||
                        log_must eval "unshare_nfs $mntp"
-               log_must $ZFS set sharenfs=on $filesystem
+               log_must zfs set sharenfs=on $filesystem
                is_shared $mntp || \
-                       log_fail "'$ZFS set sharenfs=on' fails to make" \
+                       log_fail "'zfs set sharenfs=on' fails to make" \
                                "file system $filesystem shared."
        fi
 
-       is_shared $mntp || log_must $ZFS share $filesystem
+       is_shared $mntp || log_must zfs share $filesystem
 
         #
        # Verify 'zfs unshare <filesystem>' works as well.
        #
-       log_must $ZFS unshare $filesystem
+       log_must zfs unshare $filesystem
        not_shared $mntp || log_fail "'zfs unshare <filesystem>' fails"
 
-       log_must $ZFS share $filesystem
+       log_must zfs share $filesystem
 
-       log_must $ZFS unshare $mntp
+       log_must zfs unshare $mntp
        not_shared $mntp || log_fail "'zfs unshare <mountpoint>' fails"
 
         log_note "Unsharing an unshared file system fails."
-        log_mustnot $ZFS unshare $filesystem
-       log_mustnot $ZFS unshare $mntp
+        log_mustnot zfs unshare $filesystem
+       log_mustnot zfs unshare $mntp
 }
 
 set -A mntp_fs \
@@ -121,10 +125,10 @@ set -A mntp_fs \
 log_assert "Verify that 'zfs unshare [-a] <filesystem|mountpoint>' succeeds as root."
 log_onexit cleanup
 
-log_must $ZFS create $TESTPOOL/$TESTFS2
-log_must $ZFS snapshot $TESTPOOL/$TESTFS2@snapshot
-log_must $ZFS clone $TESTPOOL/$TESTFS2@snapshot $TESTPOOL/$TESTCLONE
-log_must $ZFS set mountpoint=$TESTDIR2 $TESTPOOL/$TESTCLONE
+log_must zfs create $TESTPOOL/$TESTFS2
+log_must zfs snapshot $TESTPOOL/$TESTFS2@snapshot
+log_must zfs clone $TESTPOOL/$TESTFS2@snapshot $TESTPOOL/$TESTCLONE
+log_must zfs set mountpoint=$TESTDIR2 $TESTPOOL/$TESTCLONE
 
 #
 # Invoke 'test_unshare' routine to test 'zfs unshare <filesystem|mountpoint>'.
@@ -136,7 +140,7 @@ while (( i < ${#mntp_fs[*]} )); do
        ((i = i + 2))
 done
 
-log_note "Verify '$ZFS unshare -a' succeds as root."
+log_note "Verify 'zfs unshare -a' succeds as root."
 
 i=0
 typeset sharenfs_val
@@ -144,11 +148,11 @@ while (( i < ${#mntp_fs[*]} )); do
        sharenfs_val=$(get_prop "sharenfs" ${mntp_fs[((i+1))]})
        if [[ $sharenfs_val == "on" ]]; then
                not_shared ${mntp_fs[i]} && \
-                       log_must $ZFS share ${mntp_fs[((i+1))]}
+                       log_must zfs share ${mntp_fs[((i+1))]}
        else
-               log_must $ZFS set sharenfs=on ${mntp_fs[((i+1))]}
+               log_must zfs set sharenfs=on ${mntp_fs[((i+1))]}
                is_shared ${mntp_fs[i]} || \
-                       log_fail "'$ZFS set sharenfs=on' fails to share filesystem."
+                       log_fail "'zfs set sharenfs=on' fails to share filesystem."
        fi
 
         ((i = i + 2))
@@ -157,7 +161,7 @@ done
 #
 # test 'zfs unshare -a '
 #
-log_must $ZFS unshare -a
+log_must zfs unshare -a
 
 #
 # verify all shared filesystems become unshared
@@ -165,9 +169,9 @@ log_must $ZFS unshare -a
 i=0
 while (( i < ${#mntp_fs[*]} )); do
         not_shared ${mntp_fs[i]} || \
-                log_fail "'$ZFS unshare -a' fails to unshare all shared zfs filesystems."
+                log_fail "'zfs unshare -a' fails to unshare all shared zfs filesystems."
 
         ((i = i + 2))
 done
 
-log_pass "'$ZFS unshare [-a] <filesystem|mountpoint>' succeeds as root."
+log_pass "'zfs unshare [-a] <filesystem|mountpoint>' succeeds as root."
index abe91843442732c1ef10a2c7b3847a238444b1cf..1620c0bd7161d2bcefda9e76393952245cc57a38 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -51,22 +55,22 @@ function cleanup
        done
 
        if mounted $TESTPOOL/$TESTCLONE; then
-               log_must $ZFS unmount $TESTDIR2
+               log_must zfs unmount $TESTDIR2
        fi
 
        [[ -d $TESTDIR2 ]] && \
-               log_must $RM -rf $TESTDIR2
+               log_must rm -rf $TESTDIR2
 
        if datasetexists "$TESTPOOL/$TESTCLONE"; then
-               log_must $ZFS destroy -f $TESTPOOL/$TESTCLONE
+               log_must zfs destroy -f $TESTPOOL/$TESTCLONE
        fi
 
        if snapexists "$TESTPOOL/$TESTFS2@snapshot"; then
-               log_must $ZFS destroy -f $TESTPOOL/$TESTFS2@snapshot
+               log_must zfs destroy -f $TESTPOOL/$TESTFS2@snapshot
        fi
 
        if datasetexists "$TESTPOOL/$TESTFS2"; then
-               log_must $ZFS destroy -f $TESTPOOL/$TESTFS2
+               log_must zfs destroy -f $TESTPOOL/$TESTFS2
        fi
 }
 
@@ -81,7 +85,7 @@ function test_legacy_unshare # <mntp> <filesystem>
         typeset mntp=$1
         typeset filesystem=$2
 
-       log_must $ZFS set sharenfs=off $filesystem
+       log_must zfs set sharenfs=off $filesystem
        not_shared $mntp || \
            log_fail "'zfs set sharenfs=off' fails to make ZFS " \
            "filesystem $filesystem unshared."
@@ -92,7 +96,7 @@ function test_legacy_unshare # <mntp> <filesystem>
        #
        # Verify 'zfs unshare <filesystem>' is aware of legacy share.
        #
-       log_mustnot $ZFS unshare $filesystem
+       log_mustnot zfs unshare $filesystem
        is_shared $mntp || \
            log_fail "'zfs unshare <filesystem>' fails to be aware" \
            "of legacy share."
@@ -100,7 +104,7 @@ function test_legacy_unshare # <mntp> <filesystem>
        #
        # Verify 'zfs unshare <filesystem>' is aware of legacy share.
        #
-       log_mustnot $ZFS unshare $mntp
+       log_mustnot zfs unshare $mntp
        is_shared $mntp || \
            log_fail "'zfs unshare <mountpoint>' fails to be aware" \
            "of legacy share."
@@ -115,10 +119,10 @@ set -A mntp_fs \
 log_assert "Verify that 'zfs unshare [-a]' is aware of legacy share."
 log_onexit cleanup
 
-log_must $ZFS create $TESTPOOL/$TESTFS2
-log_must $ZFS snapshot $TESTPOOL/$TESTFS2@snapshot
-log_must $ZFS clone $TESTPOOL/$TESTFS2@snapshot $TESTPOOL/$TESTCLONE
-log_must $ZFS set mountpoint=$TESTDIR2 $TESTPOOL/$TESTCLONE
+log_must zfs create $TESTPOOL/$TESTFS2
+log_must zfs snapshot $TESTPOOL/$TESTFS2@snapshot
+log_must zfs clone $TESTPOOL/$TESTFS2@snapshot $TESTPOOL/$TESTCLONE
+log_must zfs set mountpoint=$TESTDIR2 $TESTPOOL/$TESTCLONE
 
 #
 # Invoke 'test_legacy_unshare' routine to verify.
@@ -131,16 +135,16 @@ while (( i < ${#mntp_fs[*]} )); do
 done
 
 
-log_note "Verify '$ZFS unshare -a' is aware of legacy share."
+log_note "Verify 'zfs unshare -a' is aware of legacy share."
 
 #
 # set the 'sharenfs' property to 'off' for each filesystem
 #
 i=0
 while (( i < ${#mntp_fs[*]} )); do
-        log_must $ZFS set sharenfs=off ${mntp_fs[((i + 1))]}
+        log_must zfs set sharenfs=off ${mntp_fs[((i + 1))]}
         not_shared ${mntp_fs[i]} || \
-                log_fail "'$ZFS set sharenfs=off' unshares file system failed."
+                log_fail "'zfs set sharenfs=off' unshares file system failed."
 
         ((i = i + 2))
 done
@@ -152,7 +156,7 @@ i=0
 while (( i < ${#mntp_fs[*]} )); do
         share_nfs ${mntp_fs[i]}
         is_shared ${mntp_fs[i]} || \
-                log_fail "'$SHARE' shares ZFS filesystem failed."
+                log_fail "'share' shares ZFS filesystem failed."
 
         ((i = i + 2))
 done
@@ -160,7 +164,7 @@ done
 #
 # Verify that 'zfs unshare -a' is aware of legacy share
 #
-log_must $ZFS unshare -a
+log_must zfs unshare -a
 
 #
 # verify ZFS filesystems are still shared
@@ -168,10 +172,10 @@ log_must $ZFS unshare -a
 i=0
 while (( i < ${#mntp_fs[*]} )); do
         is_shared ${mntp_fs[i]} || \
-            log_fail "'$ZFS  unshare -a' fails to be aware of legacy share."
+            log_fail "'zfs  unshare -a' fails to be aware of legacy share."
 
         ((i = i + 2))
 done
 
-log_pass "'$ZFS unshare [-a]' succeeds to be aware of legacy share."
+log_pass "'zfs unshare [-a]' succeeds to be aware of legacy share."
 
index aa319650719315c7949d36d2037e1be04527db3a..66a7e80eb783762858ea9e457fc6a5364237927f 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -46,10 +50,10 @@ verify_runnable "global"
 function cleanup
 {
        if snapexists $TESTPOOL/$TESTFS@snapshot; then
-               log_must $ZFS destroy $TESTPOOL/$TESTFS@snapshot
+               log_must zfs destroy $TESTPOOL/$TESTFS@snapshot
        fi
 
-       log_must $ZFS set sharenfs=off $TESTPOOL/$TESTFS
+       log_must zfs set sharenfs=off $TESTPOOL/$TESTFS
 }
 
 #
@@ -69,10 +73,10 @@ function test_snap_unshare # <mntp> <filesystem>
 
        if [[ $prop_value == "off" ]]; then
                is_shared $mntp || unshare_nfs $mntp
-               log_must $ZFS set sharenfs=on $filesystem
+               log_must zfs set sharenfs=on $filesystem
        fi
 
-       log_must $ZFS set sharenfs=off $filesystem
+       log_must zfs set sharenfs=off $filesystem
 
        not_shared $mntp || \
                log_fail "File system $filesystem is shared (set sharenfs)."
@@ -84,7 +88,7 @@ function test_snap_unshare # <mntp> <filesystem>
 log_assert "Verify that a file system and its dependent are unshared."
 log_onexit cleanup
 
-log_must $ZFS snapshot $TESTPOOL/$TESTFS@snapshot
+log_must zfs snapshot $TESTPOOL/$TESTFS@snapshot
 test_snap_unshare $TESTDIR $TESTPOOL/$TESTFS
 
 log_pass "A file system and its dependent are both unshared as expected."
index 29c5fb93954334c71dbc035e61d890ca51e1a4bf..e92581c7c9bf2cbe6c33a20bca1c18466b6e9d45 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,33 +52,33 @@ set -A opts "" "$TESTPOOL/$NONEXISTFSNAME" "$NONEEXISTMOUNTPOINT" "-?" "-1" \
                "$TESTPOOL/$TESTFS $TESTDIR" "-f $TESTPOOL/$TESTFS $TESTDIR" \
                "${TESTDIR#/}" "-f ${TESTDIR#/}"
 
-log_assert "Verify that '$ZFS unshare' issue error message with badly formed parameter."
+log_assert "Verify that 'zfs unshare' issue error message with badly formed parameter."
 
 shareval=$(get_prop sharenfs $TESTPOOL/$TESTFS)
 if [[ $shareval == off ]]; then
-       log_must $ZFS set sharenfs=on $TESTPOOL/$TESTFS
+       log_must zfs set sharenfs=on $TESTPOOL/$TESTFS
 fi
 
 typeset -i i=0
 while [[ $i -lt ${#args[*]} ]]; do
-        log_mustnot $ZFS unshare ${args[i]}
+        log_mustnot zfs unshare ${args[i]}
 
         ((i = i + 1))
 done
 
 #Testing that unsharing unshared filesystem fails.
 mpt=$(get_prop mountpoint $TESTPOOL/$TESTFS)
-log_must $ZFS unshare $TESTPOOL/$TESTFS
+log_must zfs unshare $TESTPOOL/$TESTFS
 for opt in "" "-f"; do
-       log_mustnot eval "$ZFS unshare $opt $TESTPOOL/$TESTFS >/dev/null 2>&1"
-       log_mustnot eval "$ZFS unshare $opt $mpt >/dev/null 2>&1"
+       log_mustnot eval "zfs unshare $opt $TESTPOOL/$TESTFS >/dev/null 2>&1"
+       log_mustnot eval "zfs unshare $opt $mpt >/dev/null 2>&1"
 done
 
 #Testing zfs unshare fails with legacy share set
-log_must $ZFS set sharenfs=off $TESTPOOL/$TESTFS
+log_must zfs set sharenfs=off $TESTPOOL/$TESTFS
 for opt in "" "-f"; do
-       log_mustnot eval "$ZFS unshare $opt $TESTPOOL/$TESTFS >/dev/null 2>&1"
-       log_mustnot eval "$ZFS unshare $opt $mpt >/dev/null 2>&1"
+       log_mustnot eval "zfs unshare $opt $TESTPOOL/$TESTFS >/dev/null 2>&1"
+       log_mustnot eval "zfs unshare $opt $mpt >/dev/null 2>&1"
 done
 
-log_pass "'$ZFS unshare' fails as expected with badly-formed parameters."
+log_pass "'zfs unshare' fails as expected with badly-formed parameters."
index fb582b99c46b7a83517342d2ac91a2ac6212dfb5..7df3136dd6b4e592aeed25d341b7d75c9953bd4a 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -48,7 +52,7 @@ log_assert "Verify that unsharing a dataset other than filesystem fails."
 typeset -i i=0
 while (( i < ${#datasets[*]} ))
 do
-       log_mustnot $ZFS unshare ${datasets[i]}
+       log_mustnot zfs unshare ${datasets[i]}
 
        ((i = i + 1))
 done
index 7c3f6cd3aefb5e889ee2ca81ca93202185e3b26f..a6ff2010234d0904949cd2aa330ed085d22dacf2 100755 (executable)
@@ -43,31 +43,31 @@ verify_runnable "global"
 
 function cleanup
 {
-       log_must $ZFS unshare -a
-       log_must $ZFS destroy -f $TESTPOOL/$TESTFS/shared1
-       log_must $ZFS destroy -f $TESTPOOL/$TESTFS/shared2
-       log_must $ZFS destroy -f $TESTPOOL/$TESTFS/shared3
+       log_must zfs unshare -a
+       log_must zfs destroy -f $TESTPOOL/$TESTFS/shared1
+       log_must zfs destroy -f $TESTPOOL/$TESTFS/shared2
+       log_must zfs destroy -f $TESTPOOL/$TESTFS/shared3
 }
 
-log_assert "Verify '$ZFS unshare [nfs|smb] -a' only works on the specified "\
+log_assert "Verify 'zfs unshare [nfs|smb] -a' only works on the specified "\
        "protocol."
 log_onexit cleanup
 
 # 1. Share filesystems with different protocols.
-log_must $ZFS create $TESTPOOL/$TESTFS/shared1
-log_must $ZFS create $TESTPOOL/$TESTFS/shared2
-log_must $ZFS create $TESTPOOL/$TESTFS/shared3
-log_must $ZFS set mountpoint=$TESTDIR/1 $TESTPOOL/$TESTFS/shared1
-log_must $ZFS set mountpoint=$TESTDIR/2 $TESTPOOL/$TESTFS/shared2
-log_must $ZFS set mountpoint=$TESTDIR/3 $TESTPOOL/$TESTFS/shared3
-log_must $ZFS set sharenfs=on $TESTPOOL/$TESTFS/shared1
-log_must $ZFS set sharenfs=on $TESTPOOL/$TESTFS/shared2
-log_must $ZFS set sharesmb=on $TESTPOOL/$TESTFS/shared2
-log_must $ZFS set sharesmb=on $TESTPOOL/$TESTFS/shared3
-log_must $ZFS share -a
+log_must zfs create $TESTPOOL/$TESTFS/shared1
+log_must zfs create $TESTPOOL/$TESTFS/shared2
+log_must zfs create $TESTPOOL/$TESTFS/shared3
+log_must zfs set mountpoint=$TESTDIR/1 $TESTPOOL/$TESTFS/shared1
+log_must zfs set mountpoint=$TESTDIR/2 $TESTPOOL/$TESTFS/shared2
+log_must zfs set mountpoint=$TESTDIR/3 $TESTPOOL/$TESTFS/shared3
+log_must zfs set sharenfs=on $TESTPOOL/$TESTFS/shared1
+log_must zfs set sharenfs=on $TESTPOOL/$TESTFS/shared2
+log_must zfs set sharesmb=on $TESTPOOL/$TESTFS/shared2
+log_must zfs set sharesmb=on $TESTPOOL/$TESTFS/shared3
+log_must zfs share -a
 
 # 2. Invoke 'zfs unshare nfs -a' to unshare filesystems.
-log_must $ZFS unshare nfs -a
+log_must zfs unshare nfs -a
 
 # 3. Verify that only nfs filesystems are unshared.
 log_must eval "not_shared $TESTPOOL/$TESTFS/shared1"
@@ -76,13 +76,13 @@ log_must eval "is_shared_smb $TESTPOOL/$TESTFS/shared2"
 log_must eval "is_shared_smb $TESTPOOL/$TESTFS/shared3"
 
 # 4. Share all filesystems again.
-log_must $ZFS share -a
+log_must zfs share -a
 
 # 5. Invoke 'zfs unshare smb -a' and verify only smb filesystems are unshared.
-log_must $ZFS unshare smb -a
+log_must zfs unshare smb -a
 log_must eval "is_shared $TESTPOOL/$TESTFS/shared1"
 log_must eval "is_shared $TESTPOOL/$TESTFS/shared2"
 log_must eval "not_shared_smb $TESTPOOL/$TESTFS/shared2"
 log_must eval "not_shared_smb $TESTPOOL/$TESTFS/shared3"
 
-log_pass "'$ZFS unshare [nfs|smb] -a' only works on the specified protocol."
+log_pass "'zfs unshare [nfs|smb] -a' only works on the specified protocol."
index b622c94e4e9f24a44fb5ba1063e1396261d685ff..b74811b7f79f62b159ebebf4edd74bdf01264f0d 100644 (file)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -66,12 +70,12 @@ function default_setup_datasets #rootfs
                        (( m+=1 ))
                done
                if (( spa_version != 0 )) && (( vp < spa_version )); then
-                       log_mustnot $ZFS create -o version=${version} ${current_fs}
+                       log_mustnot zfs create -o version=${version} ${current_fs}
                        continue
                fi
-               log_must $ZFS create -o version=${version} ${current_fs}
-               log_must $ZFS snapshot ${current_snap}
-               log_must $ZFS clone ${current_snap} ${current_clone}
+               log_must zfs create -o version=${version} ${current_fs}
+               log_must zfs snapshot ${current_snap}
+               log_must zfs clone ${current_snap} ${current_clone}
 
                for subversion in $ZFS_ALL_VERSIONS ; do
                        typeset subverfs
@@ -88,10 +92,10 @@ function default_setup_datasets #rootfs
                                (( m+=1 ))
                        done
                        if (( spa_version != 0 )) && (( vp < spa_version )); then
-                               log_mustnot $ZFS create -o \
+                               log_mustnot zfs create -o \
                                version=${subversion} ${current_fs}/$subverfs
                        else
-                               log_must $ZFS create -o \
+                               log_must zfs create -o \
                                version=${subversion} ${current_fs}/$subverfs
                        fi
                done
@@ -103,11 +107,11 @@ function default_cleanup_datasets #rootfs
        typeset rootfs=$1
 
        if datasetexists $rootfs ; then
-               log_must $ZFS destroy -Rf $rootfs
+               log_must zfs destroy -Rf $rootfs
        fi
 
        if datasetnonexists $rootfs ; then
-               log_must $ZFS create $rootfs
+               log_must zfs create $rootfs
        fi
 }
 
@@ -122,7 +126,7 @@ function default_check_zfs_upgrade #rootfs
        typeset newv
        typeset -i df_ret
 
-       $DF -F zfs / > /dev/null 2>&1
+       df -F zfs / > /dev/null 2>&1
        df_ret=$?
 
        for newv in "" $ZFS_VERSION; do
@@ -146,14 +150,14 @@ function default_check_zfs_upgrade #rootfs
 
                if (( df_ret != 0 )); then
                        if (( spa_version != 0 )) && (( vp < spa_version )); then
-                               log_mustnot eval '$ZFS upgrade $opt -a > /dev/null 2>&1'
-                               log_must eval '$ZPOOL upgrade $pool > /dev/null 2>&1'
+                               log_mustnot eval 'zfs upgrade $opt -a > /dev/null 2>&1'
+                               log_must eval 'zpool upgrade $pool > /dev/null 2>&1'
                                vp=$(get_pool_prop version $pool)
                        fi
 
-                       log_must eval '$ZFS upgrade $opt -a > /dev/null 2>&1'
+                       log_must eval 'zfs upgrade $opt -a > /dev/null 2>&1'
 
-                       for fs in $($ZFS list -rH -t filesystem -o name $rootfs) ; do
+                       for fs in $(zfs list -rH -t filesystem -o name $rootfs) ; do
                                log_must check_fs_version $fs $newv
                        done
                fi
index 32e76ff02e78b7ed9b92ee73669288a3a3adafdb..f23ad6e5e12fe3946b636edb7873cf97465cfc42 100755 (executable)
 #
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
+
 #
+# Copyright (c) 2016 by Delphix. All rights reserved.
 #
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_upgrade/zfs_upgrade.kshlib
 
@@ -48,13 +51,13 @@ verify_runnable "both"
 function cleanup
 {
        if datasetexists $rootfs ; then
-               log_must $ZFS destroy -Rf $rootfs
+               log_must zfs destroy -Rf $rootfs
        fi
-       log_must $ZFS create $rootfs
+       log_must zfs create $rootfs
 
        for file in $output $oldoutput ; do
                if [[ -f $file ]]; then
-                       log_must $RM -f $file
+                       log_must rm -f $file
                fi
        done
 }
@@ -70,8 +73,8 @@ typeset expect_str2="All filesystems are formatted with the current version"
 typeset expect_str3="The following filesystems are out of date, and can be upgraded"
 typeset -i COUNT OLDCOUNT
 
-$ZFS upgrade | $NAWK '$1 ~ "^[0-9]+$" {print $2}'> $oldoutput
-OLDCOUNT=$( $WC -l $oldoutput | $AWK '{print $1}' )
+zfs upgrade | nawk '$1 ~ "^[0-9]+$" {print $2}'> $oldoutput
+OLDCOUNT=$( wc -l $oldoutput | awk '{print $1}' )
 
 old_datasets=""
 for version in $ZFS_ALL_VERSIONS ; do
@@ -80,9 +83,9 @@ for version in $ZFS_ALL_VERSIONS ; do
        typeset current_fs=$rootfs/$verfs
        typeset current_snap=${current_fs}@snap
        typeset current_clone=$rootfs/clone$verfs
-       log_must $ZFS create -o version=${version} ${current_fs}
-       log_must $ZFS snapshot ${current_snap}
-       log_must $ZFS clone ${current_snap} ${current_clone}
+       log_must zfs create -o version=${version} ${current_fs}
+       log_must zfs snapshot ${current_snap}
+       log_must zfs clone ${current_snap} ${current_clone}
 
        if (( version != $ZFS_VERSION )); then
                old_datasets="$old_datasets ${current_fs} ${current_clone}"
@@ -90,46 +93,46 @@ for version in $ZFS_ALL_VERSIONS ; do
 done
 
 if is_global_zone; then
-       log_must $ZFS create -V 100m $rootfs/$TESTVOL
+       log_must zfs create -V 100m $rootfs/$TESTVOL
 fi
 
-log_must eval '$ZFS upgrade > $output 2>&1'
+log_must eval 'zfs upgrade > $output 2>&1'
 
 # we also check that the usage message contains at least a description
 # of the current ZFS version.
-log_must eval '$GREP "${expect_str1} $ZFS_VERSION" $output > /dev/null 2>&1'
-$ZFS upgrade | $NAWK '$1 ~ "^[0-9]+$" {print $2}'> $output
-COUNT=$( $WC -l $output | $AWK '{print $1}' )
+log_must eval 'grep "${expect_str1} $ZFS_VERSION" $output > /dev/null 2>&1'
+zfs upgrade | nawk '$1 ~ "^[0-9]+$" {print $2}'> $output
+COUNT=$( wc -l $output | awk '{print $1}' )
 
 typeset -i i=0
 for fs in ${old_datasets}; do
-       log_must $GREP "^$fs$" $output
+       log_must grep "^$fs$" $output
        (( i = i + 1 ))
 done
 
 if (( i != COUNT - OLDCOUNT )); then
-       $CAT $output
+       cat $output
        log_fail "More old-version filesystems print out than expect."
 fi
 
 for fs in $old_datasets ; do
        if datasetexists $fs ; then
-               log_must $ZFS destroy -Rf $fs
+               log_must zfs destroy -Rf $fs
        fi
 done
 
-log_must eval '$ZFS upgrade > $output 2>&1'
-log_must eval '$GREP "${expect_str1} $ZFS_VERSION" $output > /dev/null 2>&1'
+log_must eval 'zfs upgrade > $output 2>&1'
+log_must eval 'grep "${expect_str1} $ZFS_VERSION" $output > /dev/null 2>&1'
 if (( OLDCOUNT == 0 )); then
-       log_must eval '$GREP "${expect_str2}" $output > /dev/null 2>&1'
+       log_must eval 'grep "${expect_str2}" $output > /dev/null 2>&1'
 else
-       log_must eval '$GREP "${expect_str3}" $output > /dev/null 2>&1'
+       log_must eval 'grep "${expect_str3}" $output > /dev/null 2>&1'
 fi
-$ZFS upgrade | $NAWK '$1 ~ "^[0-9]+$" {print $2}'> $output
-COUNT=$( $WC -l $output | $AWK '{print $1}' )
+zfs upgrade | nawk '$1 ~ "^[0-9]+$" {print $2}'> $output
+COUNT=$( wc -l $output | awk '{print $1}' )
 
 if (( COUNT != OLDCOUNT )); then
-       $CAT $output
+       cat $output
        log_fail "Unexpect old-version filesystems print out."
 fi
 
index 2de2ed3897e3444dba88c67cba474af67b97a3e7..dcddcc10a15465dcb4f55da1b19a74c4c68fc478 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
 #
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_upgrade/zfs_upgrade.kshlib
 
@@ -43,7 +47,7 @@ verify_runnable "both"
 function cleanup
 {
        if [[ -f $output ]]; then
-               log_must $RM -f $output
+               log_must rm -f $output
        fi
 }
 
@@ -54,10 +58,10 @@ typeset output=/tmp/zfs-versions.$$
 typeset expect_str1="Initial ZFS filesystem version"
 typeset expect_str2="Enhanced directory entries"
 
-log_must eval '$ZFS upgrade -v > /dev/null 2>&1'
+log_must eval 'zfs upgrade -v > /dev/null 2>&1'
 
-$ZFS upgrade -v | $NAWK '$1 ~ "^[0-9]+$" {print $0}'> $output
-log_must eval '$GREP "${expect_str1}" $output > /dev/null 2>&1'
-log_must eval '$GREP "${expect_str2}" $output > /dev/null 2>&1'
+zfs upgrade -v | nawk '$1 ~ "^[0-9]+$" {print $0}'> $output
+log_must eval 'grep "${expect_str1}" $output > /dev/null 2>&1'
+log_must eval 'grep "${expect_str2}" $output > /dev/null 2>&1'
 
 log_pass "Executing 'zfs upgrade -v' command succeeds."
index 24fac02d3d6bb6658aa2fd65a56f2a02b241476a..6df47b450d00f05ee3b0fde46bcdd3ee11c1f02b 100755 (executable)
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
 #
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_upgrade/zfs_upgrade.kshlib
 
@@ -44,9 +48,9 @@ verify_runnable "both"
 function cleanup
 {
        if datasetexists $rootfs ; then
-               log_must $ZFS destroy -Rf $rootfs
+               log_must zfs destroy -Rf $rootfs
        fi
-       log_must $ZFS create $rootfs
+       log_must zfs create $rootfs
 }
 
 function setup_datasets
@@ -58,9 +62,9 @@ function setup_datasets
                typeset current_fs=$rootfs/$verfs
                typeset current_snap=${current_fs}@snap
                typeset current_clone=$rootfs/clone$verfs
-               log_must $ZFS create -o version=${version} ${current_fs}
-               log_must $ZFS snapshot ${current_snap}
-               log_must $ZFS clone ${current_snap} ${current_clone}
+               log_must zfs create -o version=${version} ${current_fs}
+               log_must zfs snapshot ${current_snap}
+               log_must zfs clone ${current_snap} ${current_clone}
                datasets="$datasets ${current_fs} ${current_clone}"
        done
 }
@@ -87,10 +91,10 @@ for newv in "" "current" $ZFS_ALL_VERSIONS; do
                fi
 
                if (( newv >= oldv )); then
-                       log_must eval '$ZFS upgrade $opt $fs > /dev/null 2>&1'
+                       log_must eval 'zfs upgrade $opt $fs > /dev/null 2>&1'
                        log_must check_fs_version $fs $newv
                else
-                       log_mustnot eval '$ZFS upgrade $opt $fs > /dev/null 2>&1'
+                       log_mustnot eval 'zfs upgrade $opt $fs > /dev/null 2>&1'
                        log_must check_fs_version $fs $oldv
                fi
        done
index 47cff6ea530ef6f4c5ed707dee1f6973e8e37fd2..e3ff4f4b9073b35e6beb4b1f08df67f6af5eb44a 100755 (executable)
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
 #
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_upgrade/zfs_upgrade.kshlib
 
@@ -44,9 +48,9 @@ verify_runnable "both"
 function cleanup
 {
        if datasetexists $rootfs ; then
-               log_must $ZFS destroy -Rf $rootfs
+               log_must zfs destroy -Rf $rootfs
        fi
-       log_must $ZFS create $rootfs
+       log_must zfs create $rootfs
 }
 
 function setup_datasets
@@ -58,14 +62,14 @@ function setup_datasets
                typeset current_fs=$rootfs/$verfs
                typeset current_snap=${current_fs}@snap
                typeset current_clone=$rootfs/clone$verfs
-               log_must $ZFS create -o version=${version} ${current_fs}
-               log_must $ZFS snapshot ${current_snap}
-               log_must $ZFS clone ${current_snap} ${current_clone}
+               log_must zfs create -o version=${version} ${current_fs}
+               log_must zfs snapshot ${current_snap}
+               log_must zfs clone ${current_snap} ${current_clone}
 
                for subversion in $ZFS_ALL_VERSIONS ; do
                        typeset subverfs
                        eval subverfs=\$ZFS_VERSION_$subversion
-                       log_must $ZFS create -o version=${subversion} \
+                       log_must zfs create -o version=${subversion} \
                                ${current_fs}/$subverfs
                done
                datasets="$datasets ${current_fs}"
@@ -92,9 +96,9 @@ for newv in "" "current" $ZFS_VERSION; do
                        newv=$ZFS_VERSION
                fi
 
-               log_must eval '$ZFS upgrade -r $opt $topfs > /dev/null 2>&1'
+               log_must eval 'zfs upgrade -r $opt $topfs > /dev/null 2>&1'
 
-               for fs in $($ZFS list -rH -t filesystem -o name $topfs) ; do
+               for fs in $(zfs list -rH -t filesystem -o name $topfs) ; do
                        log_must check_fs_version $fs $newv
                done
        done
index 764727c60d72f38dcf75fc522a5aeca211ed4497..1a929918bf109245fb7212eca0a63cabfe955d92 100755 (executable)
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
 #
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_upgrade/zfs_upgrade.kshlib
 
@@ -44,9 +48,9 @@ verify_runnable "both"
 function cleanup
 {
        if datasetexists $rootfs ; then
-               log_must $ZFS destroy -Rf $rootfs
+               log_must zfs destroy -Rf $rootfs
        fi
-       log_must $ZFS create $rootfs
+       log_must zfs create $rootfs
 }
 
 function setup_datasets
@@ -58,14 +62,14 @@ function setup_datasets
                typeset current_fs=$rootfs/$verfs
                typeset current_snap=${current_fs}@snap
                typeset current_clone=$rootfs/clone$verfs
-               log_must $ZFS create -o version=${version} ${current_fs}
-               log_must $ZFS snapshot ${current_snap}
-               log_must $ZFS clone ${current_snap} ${current_clone}
+               log_must zfs create -o version=${version} ${current_fs}
+               log_must zfs snapshot ${current_snap}
+               log_must zfs clone ${current_snap} ${current_clone}
 
                for subversion in $ZFS_ALL_VERSIONS ; do
                        typeset subverfs
                        eval subverfs=\$ZFS_VERSION_$subversion
-                       log_must $ZFS create -o version=${subversion} \
+                       log_must zfs create -o version=${subversion} \
                                ${current_fs}/$subverfs
                done
                datasets="$datasets ${current_fs}"
@@ -92,10 +96,10 @@ for newv in "" "current" $ZFS_VERSION; do
        fi
 
        export __ZFS_POOL_RESTRICT="$TESTPOOL"
-       log_must $ZFS upgrade $opt -a
+       log_must zfs upgrade $opt -a
        unset __ZFS_POOL_RESTRICT
 
-       for fs in $($ZFS list -rH -t filesystem -o name $rootfs) ; do
+       for fs in $(zfs list -rH -t filesystem -o name $rootfs) ; do
                log_must check_fs_version $fs $newv
        done
        cleanup
index 6cd3bb45364c82e2f1185d182d01043804ef29f5..f5eef319330b7900309c1f081c42396783c0585a 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_upgrade/zfs_upgrade.kshlib
 
@@ -47,7 +51,7 @@ log_assert "Badly-formed 'zfs upgrade' should return an error."
 
 typeset -i i=1
 while (( i < ${#args[*]} )); do
-       log_mustnot $ZFS upgrade ${args[i]}
+       log_mustnot zfs upgrade ${args[i]}
        ((i = i + 1))
 done
 
index cdc7e4140e531e997299f0cdf5f2d9ff5afa0d4a..6c6f94754d3c9926b7212057d36f0dbadc0fc819 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zfs_upgrade/zfs_upgrade.kshlib
 
@@ -48,7 +52,7 @@ log_assert "Set invalid value or non-digit version should fail as expected."
 typeset -i i=0
 while (( i < ${#args[*]} ))
 do
-       log_mustnot $ZFS upgrade -V ${args[i]} $TESTPOOL/$TESTFS
+       log_mustnot zfs upgrade -V ${args[i]} $TESTPOOL/$TESTFS
        ((i = i + 1))
 done
 
index 7b3764426532990f4648251e91279d580a54b4bb..a3158bd57819813f1c1cabe17b1d8b836dfafd17 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -57,7 +62,7 @@ log_assert "Execute zpool sub-command without proper parameters."
 
 typeset -i i=0
 while [[ $i -lt ${#args[*]} ]]; do
-       log_mustnot $ZPOOL ${args[i]}
+       log_mustnot zpool ${args[i]}
 
        ((i = i + 1))
 done
index a2dc206cd7ccd133db5eb1f287cbebaa02233acc..a45e4a88331a205da89e77b274b145eca469bad4 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,11 +48,11 @@ function cleanup
        unset ZFS_ABORT
 
        if [[ -d $corepath ]]; then
-               $RM -rf $corepath
+               rm -rf $corepath
        fi
 
        if poolexists $pool; then
-               log_must $ZPOOL destroy -f $pool
+               log_must zpool destroy -f $pool
        fi
 }
 
@@ -62,16 +62,16 @@ log_onexit cleanup
 #preparation work for testing
 corepath=$TESTDIR/core
 if [[ -d $corepath ]]; then
-       $RM -rf $corepath
+       rm -rf $corepath
 fi
-$MKDIR $corepath
+mkdir $corepath
 
 pool=pool.$$
 vdev1=$TESTDIR/file1
 vdev2=$TESTDIR/file2
 vdev3=$TESTDIR/file3
 for vdev in $vdev1 $vdev2 $vdev3; do
-       $MKFILE $MINVDEVSIZE $vdev
+       mkfile $MINVDEVSIZE $vdev
 done
 
 set -A cmds "create $pool mirror $vdev1 $vdev2" "list $pool" "iostat $pool" \
@@ -90,19 +90,19 @@ if is_linux; then
        echo "$corepath/core.zpool" >/proc/sys/kernel/core_pattern
        echo 0 >/proc/sys/kernel/core_uses_pid
 else
-       $COREADM -p ${corepath}/core.%f
+       coreadm -p ${corepath}/core.%f
 fi
 
 export ZFS_ABORT=yes
 
 for subcmd in "${cmds[@]}" "${badparams[@]}"; do
        corefile=${corepath}/core.zpool
-       $ZPOOL $subcmd >/dev/null 2>&1
+       zpool $subcmd >/dev/null 2>&1
        ls -l $corepath >>/tmp/CORE
        if [[ ! -e $corefile ]]; then
-               log_fail "$ZPOOL $subcmd cannot generate core file  with ZFS_ABORT set."
+               log_fail "zpool $subcmd cannot generate core file  with ZFS_ABORT set."
        fi
-       $RM -f $corefile
+       rm -f $corefile
 done
 
 log_pass "With ZFS_ABORT set, zpool command can abort and generate core file as expected."
index 7f45ecb9c214d02d2ab5f39e20b1cd0f1b89caca..8bfbb5fd8634fbc32af630035168d337cfa70fa7 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -46,16 +46,16 @@ verify_runnable "both"
 
 log_assert "Debugging features of zpool should succeed."
 
-log_must $ZPOOL -? > /dev/null 2>&1
+log_must zpool -? > /dev/null 2>&1
 
 if is_global_zone ; then
-       log_must $ZPOOL freeze $TESTPOOL
+       log_must zpool freeze $TESTPOOL
 else
-       log_mustnot $ZPOOL freeze $TESTPOOL
-       log_mustnot $ZPOOL freeze ${TESTPOOL%%/*}
+       log_mustnot zpool freeze $TESTPOOL
+       log_mustnot zpool freeze ${TESTPOOL%%/*}
 fi
 
-log_mustnot $ZPOOL freeze fakepool
+log_mustnot zpool freeze fakepool
 
 # Remove corefile possibly left by previous failing run of this test.
 [[ -f core ]] && log_must rm -f core
@@ -67,10 +67,10 @@ if is_linux; then
 fi
 
 ZFS_ABORT=1; export ZFS_ABORT
-$ZPOOL > /dev/null 2>&1
+zpool > /dev/null 2>&1
 unset ZFS_ABORT
 
-[[ -f core ]] || log_fail "$ZPOOL did not dump core by request."
+[[ -f core ]] || log_fail "zpool did not dump core by request."
 [[ -f core ]] && log_must rm -f core
 
 log_pass "Debugging features of zpool succeed."
index a7180b5c5419ea4b8984d15bd0c813c7eb9ce21a..be415f137a12f4c0d3fd001bd37e0f678bc918f3 100755 (executable)
@@ -43,7 +43,7 @@ verify_runnable "global"
 function cleanup
 {
        poolexists $TESTPOOL && destroy_pool $TESTPOOL
-       log_must $RM $disk1 $disk2
+       log_must rm $disk1 $disk2
 }
 
 #
@@ -57,7 +57,7 @@ function verify_device_ashift
        typeset value=$2
        typeset ashift
 
-       $ZDB -e -l $device | $GREP " ashift:" | {
+       zdb -e -l $device | grep " ashift:" | {
                while read ashift ; do
                        if [[ "ashift: $value" != "$ashift" ]]; then
                                return 1
@@ -73,14 +73,14 @@ log_onexit cleanup
 
 disk1=$TEST_BASE_DIR/$FILEDISK0
 disk2=$TEST_BASE_DIR/$FILEDISK1
-log_must $MKFILE $SIZE $disk1
-log_must $MKFILE $SIZE $disk2
+log_must mkfile $SIZE $disk1
+log_must mkfile $SIZE $disk2
 
 typeset ashifts=("9" "10" "11" "12" "13")
 for ashift in ${ashifts[@]}
 do
-       log_must $ZPOOL create $TESTPOOL $disk1
-       log_must $ZPOOL add -o ashift=$ashift $TESTPOOL $disk2
+       log_must zpool create $TESTPOOL $disk1
+       log_must zpool add -o ashift=$ashift $TESTPOOL $disk2
        verify_device_ashift $disk2 $ashift
        if [[ $? -ne 0 ]]
        then
@@ -88,19 +88,19 @@ do
                    "$ashift"
        fi
        # clean things for the next run
-       log_must $ZPOOL destroy $TESTPOOL
-       log_must $ZPOOL labelclear $disk1
-       log_must $ZPOOL labelclear $disk2
+       log_must zpool destroy $TESTPOOL
+       log_must zpool labelclear $disk1
+       log_must zpool labelclear $disk2
 done
 
 typeset badvals=("off" "on" "1" "8" "14" "1b" "ff" "-")
 for badval in ${badvals[@]}
 do
-       log_must $ZPOOL create $TESTPOOL $disk1
-       log_mustnot $ZPOOL add -o ashift="$badval" $disk2
-       log_must $ZPOOL destroy $TESTPOOL
-       log_must $ZPOOL labelclear $disk1
-       log_must $ZPOOL labelclear $disk2
+       log_must zpool create $TESTPOOL $disk1
+       log_mustnot zpool add -o ashift="$badval" $disk2
+       log_must zpool destroy $TESTPOOL
+       log_must zpool labelclear $disk1
+       log_must zpool labelclear $disk2
 done
 
 log_pass "zpool add -o ashift=<n>' works with different ashift values"
index a8b271f21eee58d7679fd1016968b8cad9d0692d..4b5f44a2a64d8a7ca75be424a974196b6a399413 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,7 +52,7 @@ if [[ -n $DISK ]]; then
 
         partition_disk $SIZE $DISK 7
 else
-       for disk in `$ECHO $DISKSARRAY`; do
+       for disk in `echo $DISKSARRAY`; do
                cleanup_devices $disk
                partition_disk $SIZE $disk 7
        done
index 71d30274edf76650bc8a5e5b05bef6da24f0090b..e4fdff4aad7d7b33a85f6792ee35fc23846f825f 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2012, 2014 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -42,16 +42,16 @@ function find_vfstab_dev
        typeset vfstabdevs=""
        typeset line
 
-       $CAT $vfstab | $GREP "^${DEV_DSKDIR}" >$tmpfile
+       cat $vfstab | grep "^${DEV_DSKDIR}" >$tmpfile
        while read -r line
        do
-               vfstabdev=`$ECHO "$line" | $AWK '{print $1}'`
+               vfstabdev=`echo "$line" | awk '{print $1}'`
                vfstabdev=${vfstabdev%%:}
                vfstabdevs="$vfstabdev $vfstabdevs"
        done <$tmpfile
 
-       $RM -f $tmpfile
-       $ECHO $vfstabdevs
+       rm -f $tmpfile
+       echo $vfstabdevs
 }
 
 #
@@ -65,16 +65,16 @@ function find_mnttab_dev
        typeset mnttabdevs=""
        typeset line
 
-       $CAT $mnttab | $GREP "^${DEV_DSKDIR}" >$tmpfile
+       cat $mnttab | grep "^${DEV_DSKDIR}" >$tmpfile
        while read -r line
        do
-               mnttabdev=`$ECHO "$line" | $AWK '{print $1}'`
+               mnttabdev=`echo "$line" | awk '{print $1}'`
                mnttabdev=${mnttabdev%%:}
                mnttabdevs="$mnttabdev $mnttabdevs"
        done <$tmpfile
 
-       $RM -f $tmpfile
-       $ECHO $mnttabdevs
+       rm -f $tmpfile
+       echo $mnttabdevs
 }
 
 #
@@ -86,9 +86,9 @@ function save_dump_dev
        typeset dumpdev
        typeset fnd="Dump device"
 
-       dumpdev=`$DUMPADM | $GREP "$fnd" | $CUT -f2 -d : | \
-               $AWK '{print $1}'`
-       $ECHO $dumpdev
+       dumpdev=`dumpadm | grep "$fnd" | cut -f2 -d : | \
+               awk '{print $1}'`
+       echo $dumpdev
 }
 
 #
index 1f179fddd1f44ade594f8b69dc4d74d53394f90f..df15da1836d9263a0c04e998648870aa26602cca 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2014 by Delphix. All rights reserved.
+# Copyright (c) 2014, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -104,7 +104,7 @@ while (( $i < ${#keywords[*]} )); do
                for vdev in "${poolarray[@]}"; do
                        create_pool "$TESTPOOL" "${disk}${SLICE_PREFIX}${SLICE6}"
                        log_must poolexists "$TESTPOOL"
-                       log_must $ZPOOL add -f "$TESTPOOL" ${keywords[i]} $vdev
+                       log_must zpool add -f "$TESTPOOL" ${keywords[i]} $vdev
                        log_must vdevs_in_pool "$TESTPOOL" "$vdev"
                        destroy_pool "$TESTPOOL"
                done
@@ -116,7 +116,7 @@ while (( $i < ${#keywords[*]} )); do
                                "${disk}${SLICE_PREFIX}${SLICE4}" \
                                "${disk}${SLICE_PREFIX}${SLICE5}"
                        log_must poolexists "$TESTPOOL"
-                       log_must $ZPOOL add "$TESTPOOL" ${keywords[i]} $vdev
+                       log_must zpool add "$TESTPOOL" ${keywords[i]} $vdev
                        log_must vdevs_in_pool "$TESTPOOL" "$vdev"
                        destroy_pool "$TESTPOOL"
                done
@@ -128,7 +128,7 @@ while (( $i < ${#keywords[*]} )); do
                                "${disk}${SLICE_PREFIX}${SLICE4}" \
                                "${disk}${SLICE_PREFIX}${SLICE5}"
                        log_must poolexists "$TESTPOOL"
-                       log_must $ZPOOL add "$TESTPOOL" ${keywords[i]} $vdev
+                       log_must zpool add "$TESTPOOL" ${keywords[i]} $vdev
                        log_must vdevs_in_pool "$TESTPOOL" "$vdev"
                        destroy_pool "$TESTPOOL"
                done
index a76bc9e3d09fe5bc413a500db659a32e22e835b4..eb492311a3922781ba214279b5c586fde0a02b38 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2014 by Delphix. All rights reserved.
+# Copyright (c) 2014, 2016 by Delphix. All rights reserved.
 #
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zpool_add/zpool_add.kshlib
@@ -63,10 +63,10 @@ create_pool "$TESTPOOL" mirror "${disk}${SLICE_PREFIX}${SLICE0}" \
        "${disk}${SLICE_PREFIX}${SLICE1}"
 log_must poolexists "$TESTPOOL"
 
-log_mustnot $ZPOOL add "$TESTPOOL" ${disk}${SLICE_PREFIX}${SLICE3}
+log_mustnot zpool add "$TESTPOOL" ${disk}${SLICE_PREFIX}${SLICE3}
 log_mustnot vdevs_in_pool "$TESTPOOL" "${disk}${SLICE_PREFIX}${SLICE3}"
 
-log_must $ZPOOL add -f "$TESTPOOL" ${disk}${SLICE_PREFIX}${SLICE3}
+log_must zpool add -f "$TESTPOOL" ${disk}${SLICE_PREFIX}${SLICE3}
 log_must vdevs_in_pool "$TESTPOOL" "${disk}${SLICE_PREFIX}${SLICE3}"
 
 log_pass "'zpool add -f <pool> <vdev> ...' executes successfully."
index a422e51dbccb8bee67a779da96441a1f656c28ee..1a10a0719ea35e8a90aede44ae9a4ee0e41fd3b7 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2014 by Delphix. All rights reserved.
+# Copyright (c) 2014, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -53,7 +53,7 @@ function cleanup
        partition_cleanup
 
        [[ -e $tmpfile ]] && \
-               log_must $RM -f $tmpfile
+               log_must rm -f $tmpfile
 }
 
 log_assert "'zpool add -n <pool> <vdev> ...' can display the configuration" \
@@ -66,12 +66,12 @@ tmpfile="/var/tmp/zpool_add_003.tmp$$"
 create_pool "$TESTPOOL" "${disk}${SLICE_PREFIX}${SLICE0}"
 log_must poolexists "$TESTPOOL"
 
-$ZPOOL add -n "$TESTPOOL" ${disk}${SLICE_PREFIX}${SLICE1} > $tmpfile
+zpool add -n "$TESTPOOL" ${disk}${SLICE_PREFIX}${SLICE1} > $tmpfile
 
 log_mustnot vdevs_in_pool "$TESTPOOL" "${disk}${SLICE_PREFIX}${SLICE1}"
 
 str="would update '$TESTPOOL' to the following configuration:"
-$CAT $tmpfile | $GREP "$str" >/dev/null 2>&1
+cat $tmpfile | grep "$str" >/dev/null 2>&1
 (( $? != 0 )) && \
         log_fail "'zpool add -n <pool> <vdev> ...' is executed as unexpected"
 
index a893c31923d968e1bee0f03f0b925e108e8bf276..189b26fdbcdf1aea752a2579e8a4111e850039b1 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2014 by Delphix. All rights reserved.
+# Copyright (c) 2014, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -51,7 +51,7 @@ function cleanup
                destroy_pool "$TESTPOOL"
 
        datasetexists $TESTPOOL1/$TESTVOL && \
-               log_must $ZFS destroy -f $TESTPOOL1/$TESTVOL
+               log_must zfs destroy -f $TESTPOOL1/$TESTVOL
        poolexists $TESTPOOL1 && \
                destroy_pool "$TESTPOOL1"
 
@@ -68,10 +68,10 @@ log_must poolexists "$TESTPOOL"
 
 create_pool "$TESTPOOL1" "${disk}${SLICE_PREFIX}${SLICE1}"
 log_must poolexists "$TESTPOOL1"
-log_must $ZFS create -V $VOLSIZE $TESTPOOL1/$TESTVOL
+log_must zfs create -V $VOLSIZE $TESTPOOL1/$TESTVOL
 block_device_wait
 
-log_must $ZPOOL add "$TESTPOOL" $ZVOL_DEVDIR/$TESTPOOL1/$TESTVOL
+log_must zpool add "$TESTPOOL" /dev/zvol/dsk/$TESTPOOL1/$TESTVOL
 
 log_must vdevs_in_pool "$TESTPOOL" "$ZVOL_DEVDIR/$TESTPOOL1/$TESTVOL"
 
index 8af9215811a11240035902c9504ba56aa629067c..e59f300c512a031c72659cf4673d4d3416217cc0 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -56,7 +56,7 @@ function cleanup
                destroy_pool "$TESTPOOL1"
 
        if [[ -n $saved_dump_dev ]]; then
-               log_must eval "$DUMPADM -u -d $saved_dump_dev > /dev/null"
+               log_must eval "dumpadm -u -d $saved_dump_dev > /dev/null"
        fi
 
        partition_cleanup
@@ -78,12 +78,12 @@ create_pool "$TESTPOOL1" "${disk}${SLICE_PREFIX}${SLICE1}"
 log_must poolexists "$TESTPOOL1"
 
 unset NOINUSE_CHECK
-log_mustnot $ZPOOL add -f "$TESTPOOL" ${disk}s${SLICE1}
-log_mustnot $ZPOOL add -f "$TESTPOOL" $mnttab_dev
-log_mustnot $ZPOOL add -f "$TESTPOOL" $vfstab_dev
+log_mustnot zpool add -f "$TESTPOOL" ${disk}s${SLICE1}
+log_mustnot zpool add -f "$TESTPOOL" $mnttab_dev
+log_mustnot zpool add -f "$TESTPOOL" $vfstab_dev
 
-log_must $ECHO "y" | $NEWFS ${DEV_DSKDIR}/$dump_dev > /dev/null 2>&1
-log_must $DUMPADM -u -d ${DEV_DSKDIR}/$dump_dev > /dev/null
-log_mustnot $ZPOOL add -f "$TESTPOOL" $dump_dev
+log_must echo "y" | newfs ${DEV_DSKDIR}/$dump_dev > /dev/null 2>&1
+log_must dumpadm -u -d ${DEV_DSKDIR}/$dump_dev > /dev/null
+log_mustnot zpool add -f "$TESTPOOL" $dump_dev
 
 log_pass "'zpool add' should fail with inapplicable scenarios."
index ad2aa685b5d21e4ae21342b5b3efc89e8c4d4939..dcc117e279dfaa2d7a2f8dd0143fb8c519cc7f4f 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2014, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2014, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,7 +52,7 @@ function cleanup
        poolexists $TESTPOOL && \
                destroy_pool $TESTPOOL
 
-       [[ -d $TESTDIR ]] && log_must $RM -rf $TESTDIR
+       [[ -d $TESTDIR ]] && log_must rm -rf $TESTDIR
        partition_cleanup
 }
 
@@ -60,19 +60,19 @@ log_assert "Adding a large number of file based vdevs to a zpool works."
 log_onexit cleanup
 
 create_pool $TESTPOOL ${DISKS%% *}
-log_must $ZFS create -o mountpoint=$TESTDIR $TESTPOOL/$TESTFS
-log_must $MKFILE $MINVDEVSIZE $TESTDIR/file.00
+log_must zfs create -o mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+log_must mkfile $MINVDEVSIZE $TESTDIR/file.00
 create_pool "$TESTPOOL1" "$TESTDIR/file.00"
 
-vdevs_list=$($ECHO $TESTDIR/file.{01..16})
-log_must $MKFILE $MINVDEVSIZE $vdevs_list
+vdevs_list=$(echo $TESTDIR/file.{01..16})
+log_must mkfile $MINVDEVSIZE $vdevs_list
 
-log_must $ZPOOL add -f "$TESTPOOL1" $vdevs_list
+log_must zpool add -f "$TESTPOOL1" $vdevs_list
 log_must vdevs_in_pool "$TESTPOOL1" "$vdevs_list"
 
 # Attempt to add a file based vdev that's too small.
-log_must $MKFILE 32m $TESTDIR/broken_file
-log_mustnot $ZPOOL add -f "$TESTPOOL1" ${TESTDIR}/broken_file
+log_must mkfile 32m $TESTDIR/broken_file
+log_mustnot zpool add -f "$TESTPOOL1" ${TESTDIR}/broken_file
 log_mustnot vdevs_in_pool "$TESTPOOL1" "${TESTDIR}/broken_file"
 
 log_pass "Adding a large number of file based vdevs to a zpool works."
index 25225fcee306f09b66b56b083e6491193fc348e1..081815bd028e1884aea66b5bb4cbf78336ba2b37 100755 (executable)
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zpool_add/zpool_add.kshlib
 
@@ -59,7 +64,7 @@ log_must poolexists "$TESTPOOL"
 
 typeset -i i=0
 while (( $i < ${#args[*]} )); do
-       log_mustnot $ZPOOL add ${args[i]}
+       log_mustnot zpool add ${args[i]}
        ((i = i + 1))
 done
 
index ffb5910b10681e876cf9e3e7ad36db1a2a0bf216..edcdd32c93f6248b3fd99310a755fb2522513d36 100755 (executable)
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zpool_add/zpool_add.kshlib
 
@@ -60,7 +65,7 @@ log_must poolexists "$TESTPOOL"
 
 typeset -i i=0
 while (( $i < ${#args[*]} )); do
-       log_mustnot $ZPOOL add ${args[i]}
+       log_mustnot zpool add ${args[i]}
        ((i = i + 1))
 done
 
index f547883a6e2c8f0abe6df3c32ee0f25db4dbff97..1fc1a046ab170068d0f8856a831df813d2d2c9af 100755 (executable)
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zpool_add/zpool_add.kshlib
 
@@ -58,9 +63,9 @@ log_onexit cleanup
 create_pool "$TESTPOOL" "${disk}${SLICE_PREFIX}${SLICE0}"
 log_must poolexists "$TESTPOOL"
 
-log_mustnot $ZPOOL add -f "$TESTPOOL" ${disk}${SLICE_PREFIX}${SLICE1} \
+log_mustnot zpool add -f "$TESTPOOL" ${disk}${SLICE_PREFIX}${SLICE1} \
        ${disk}${SLICE_PREFIX}${SLICE1}
-log_mustnot $ZPOOL add -f "$TESTPOOL" ${disk}${SLICE_PREFIX}${SLICE0}
+log_mustnot zpool add -f "$TESTPOOL" ${disk}${SLICE_PREFIX}${SLICE0}
 
 log_pass "'zpool add' get fail as expected if vdevs are the same or vdev is " \
        "contained in the given pool."
index df53b1214f46bb79b9cdab5f0264719dba0cda18..01b8e41ee439a249826a14593eb35a22ec303557 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -70,7 +75,7 @@ typeset -i i=0
 
 while [[ $i -lt ${#args[*]} ]]; do
 
-       log_mustnot $ZPOOL attach ${args[$i]}
+       log_mustnot zpool attach ${args[$i]}
 
        (( i = i + 1 ))
 done
index b2a2ed5e4dc5e22e831dbdd398ea026fba02797d..ae588e0ffb97005f9ab6fc061657829cd8e3851a 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,10 +48,10 @@ verify_runnable "global"
 function cleanup
 {
         poolexists $TESTPOOL1 && \
-                log_must $ZPOOL destroy -f $TESTPOOL1
+                log_must zpool destroy -f $TESTPOOL1
 
-        for file in `$LS $TESTDIR/file.*`; do
-               log_must $RM -f $file
+        for file in `ls $TESTDIR/file.*`; do
+               log_must rm -f $file
         done
 }
 
@@ -62,7 +62,7 @@ log_onexit cleanup
 #make raw files to create various configuration pools
 typeset -i i=0
 while (( i < 3 )); do
-       log_must $MKFILE $FILESIZE $TESTDIR/file.$i
+       log_must mkfile $FILESIZE $TESTDIR/file.$i
 
        (( i = i + 1 ))
 done
@@ -87,28 +87,28 @@ function check_err # <pool> [<vdev>]
        typeset c_cksum=0
        typeset tmpfile=/var/tmp/file.$$
        typeset healthstr="pool '$pool' is healthy"
-       typeset output="`$ZPOOL status -x $pool`"
+       typeset output="`zpool status -x $pool`"
 
        [[ "$output" ==  "$healthstr" ]] && return $errnum
 
-       $ZPOOL status -x $pool | $GREP -v "^$" | $GREP -v "pool:" \
-                       | $GREP -v "state:" | $GREP -v "config:" \
-                       | $GREP -v "errors:" > $tmpfile
+       zpool status -x $pool | grep -v "^$" | grep -v "pool:" \
+                       | grep -v "state:" | grep -v "config:" \
+                       | grep -v "errors:" > $tmpfile
        typeset line
        typeset -i fetchbegin=1
        while read line; do
                if (( $fetchbegin != 0 )); then
-                        $ECHO $line | $GREP "NAME" >/dev/null 2>&1
+                        echo $line | grep "NAME" >/dev/null 2>&1
                         (( $? == 0 )) && (( fetchbegin = 0 ))
                          continue
                 fi
 
                if [[ -n $checkvdev ]]; then
-                       $ECHO $line | $GREP $checkvdev >/dev/null 2>&1
+                       echo $line | grep $checkvdev >/dev/null 2>&1
                        (( $? != 0 )) && continue
-                       c_read=`$ECHO $line | $AWK '{print $3}'`
-                       c_write=`$ECHO $line | $AWK '{print $4}'`
-                       c_cksum=`$ECHO $line | $AWK '{print $5}'`
+                       c_read=`echo $line | awk '{print $3}'`
+                       c_write=`echo $line | awk '{print $4}'`
+                       c_cksum=`echo $line | awk '{print $5}'`
                        if [ $c_read != 0 ] || [ $c_write != 0 ] || \
                            [ $c_cksum != 0 ]
                        then
@@ -117,9 +117,9 @@ function check_err # <pool> [<vdev>]
                        break
                fi
 
-               c_read=`$ECHO $line | $AWK '{print $3}'`
-               c_write=`$ECHO $line | $AWK '{print $4}'`
-               c_cksum=`$ECHO $line | $AWK '{print $5}'`
+               c_read=`echo $line | awk '{print $3}'`
+               c_write=`echo $line | awk '{print $4}'`
+               c_cksum=`echo $line | awk '{print $5}'`
                if [ $c_read != 0 ] || [ $c_write != 0 ] || \
                    [ $c_cksum != 0 ]
                then
@@ -138,21 +138,21 @@ function do_testing #<clear type> <vdevs>
        shift
        typeset vdev="$@"
 
-       log_must $ZPOOL create -f $TESTPOOL1 $vdev
-       log_must $ZFS create $FS
+       log_must zpool create -f $TESTPOOL1 $vdev
+       log_must zfs create $FS
        #
        # Fully fill up the zfs filesystem in order to make data block errors
        # zfs filesystem
        #
        typeset -i ret=0
        typeset -i i=0
-       while $TRUE ; do
-               $FILE_WRITE -o create -f $file.$i -b $BLOCKSZ -c $NUM_WRITES
+       while true ; do
+               file_write -o create -f $file.$i -b $BLOCKSZ -c $NUM_WRITES
                ret=$?
                (( $ret != 0 )) && break
                (( i = i + 1 ))
        done
-       (( $ret != 28 )) && log_fail "$FILE_WRITE fails to fully fill up the $FS."
+       (( $ret != 28 )) && log_fail "file_write fails to fully fill up the $FS."
 
        #
        #Make errors to the testing pool by overwrite the vdev device with
@@ -179,30 +179,30 @@ function do_testing #<clear type> <vdevs>
                        (( wcount = FILESIZE/1024 - 512 ))
                        ;;
        esac
-       $DD if=/dev/zero of=$fbase.$i seek=512 bs=1024 count=$wcount conv=notrunc \
+       dd if=/dev/zero of=$fbase.$i seek=512 bs=1024 count=$wcount conv=notrunc \
                        > /dev/null 2>&1
-       log_must $SYNC
-       log_must $ZPOOL scrub $TESTPOOL1
+       log_must sync
+       log_must zpool scrub $TESTPOOL1
        # Wait for the completion of scrub operation
        while is_pool_scrubbing $TESTPOOL1; do
-               $SLEEP 1
+               sleep 1
        done
 
        check_err $TESTPOOL1 && \
                log_fail "No error generated."
        if [[ $type == "device" ]]; then
-               log_must $ZPOOL clear $TESTPOOL1 $fbase.$i
+               log_must zpool clear $TESTPOOL1 $fbase.$i
                ! check_err $TESTPOOL1 $fbase.$i && \
                    log_fail "'zpool clear' fails to clear error for $fbase.$i device."
        fi
 
        if [[ $type == "pool" ]]; then
-               log_must $ZPOOL clear $TESTPOOL1
+               log_must zpool clear $TESTPOOL1
                ! check_err $TESTPOOL1 && \
                    log_fail "'zpool clear' fails to clear error for pool $TESTPOOL1."
        fi
 
-       log_must $ZPOOL destroy $TESTPOOL1
+       log_must zpool destroy $TESTPOOL1
 }
 
 log_note "'zpool clear' clears leaf-device error."
index 35c2b643dc190721eeb55e4088530769fc75374e..91a637b3377b4704a14be55f786ec5a3ce0cffab 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,9 +48,9 @@ verify_runnable "global"
 function cleanup
 {
        poolexists $TESTPOOL1 && \
-               log_must $ZPOOL destroy -f $TESTPOOL1
+               log_must zpool destroy -f $TESTPOOL1
        [[ -e $file ]] && \
-               log_must $RM -f $file
+               log_must rm -f $file
 }
 
 log_assert "Execute 'zpool clear' using invalid parameters."
@@ -59,8 +59,8 @@ log_onexit cleanup
 # Create another pool for negative testing, which clears pool error
 # with vdev device not in the pool vdev devices.
 file=$TESTDIR/file.$$
-log_must $MKFILE $FILESIZE $file
-log_must $ZPOOL create $TESTPOOL1 $file
+log_must mkfile $FILESIZE $file
+log_must zpool create $TESTPOOL1 $file
 
 set -A args "" "-?" "--%" "-1234567" "0.0001" "0.7644" "-0.7644" \
                "blah" "blah $DISK" "$TESTPOOL c0txdx" "$TESTPOOL $file" \
@@ -68,7 +68,7 @@ set -A args "" "-?" "--%" "-1234567" "0.0001" "0.7644" "-0.7644" \
 
 typeset -i i=0
 while (( i < ${#args[*]} )); do
-       log_mustnot $ZPOOL clear ${args[i]}
+       log_mustnot zpool clear ${args[i]}
 
        ((i = i + 1))
 done
index 241ac035e5600ecf668d41f87ad6bdb743a0bd74..637fdd84288bb781eab59f016ade3ca1831f1d4f 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,10 +47,10 @@ verify_runnable "global"
 function cleanup
 {
         poolexists $TESTPOOL1 && \
-                log_must $ZPOOL destroy -f $TESTPOOL1
+                log_must zpool destroy -f $TESTPOOL1
 
-        for file in `$LS $TESTDIR/file.*`; do
-               log_must $RM -f $file
+        for file in `ls $TESTDIR/file.*`; do
+               log_must rm -f $file
         done
 }
 
@@ -61,13 +61,13 @@ log_onexit cleanup
 #make raw files to create a spare pool
 typeset -i i=0
 while (( i < 5 )); do
-       log_must $MKFILE $FILESIZE $TESTDIR/file.$i
+       log_must mkfile $FILESIZE $TESTDIR/file.$i
 
        (( i = i + 1 ))
 done
-log_must $ZPOOL create $TESTPOOL1 raidz $TESTDIR/file.1 $TESTDIR/file.2 \
+log_must zpool create $TESTPOOL1 raidz $TESTDIR/file.1 $TESTDIR/file.2 \
        $TESTDIR/file.3 spare $TESTDIR/file.4
 
-log_mustnot $ZPOOL clear $TESTPOOL1 $TESTDIR/file.4
+log_mustnot zpool clear $TESTPOOL1 $TESTDIR/file.4
 
 log_pass "'zpool clear' works on spare device failed as expected."
index 28adaea2cd7076d7ab0ca5c34957cb37cb2d7b6b..efdafe51a012477ae0a9ac143b244c6c53c9d52e 100755 (executable)
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zpool_create/zpool_create.shlib
 
-[[ -z $FORMAT ]] || \
-[[ -z $MKDIR ]] || \
-[[ -z $LSBLK ]] || \
-[[ -z $READLINK ]] || \
-[[ -z $TOUCH ]] && \
-       log_fail "Missing required commands"
-
 verify_runnable "global"
 
 if ! $(is_physical_device $DISKS) ; then
@@ -54,7 +47,7 @@ if [[ -n $DISK ]]; then
 
         partition_disk $((($MINVDEVSIZE / (1024 * 1024)) * 2))m $DISK 7
 else
-       for disk in `$ECHO $DISKSARRAY`; do
+       for disk in `echo $DISKSARRAY`; do
                cleanup_devices $disk
 
                partition_disk $((($MINVDEVSIZE / (1024 * 1024)) * 2))m $disk 7
index ff104f2c4b6360df331205e25c61f880a82b0c06..8551b453d22c525cf59b479b25a669a59240283c 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -64,22 +64,22 @@ function create_blockfile
        typeset size=$1
        typeset file=$2
        typeset disk=$3
-       typeset dir=`$DIRNAME $file`
+       typeset dir=`dirname $file`
 
        if [[ -d $dir ]]; then
                ismounted $dir $NEWFS_DEFAULT_FS
                (( $? == 0 )) && \
-                       log_must $UMOUNT -f $dir
+                       log_must umount -f $dir
        else
-               log_must $MKDIR -p $dir
+               log_must mkdir -p $dir
        fi
 
-       $ECHO "y" | $NEWFS ${DEV_RDSKDIR}/$disk >/dev/null 2>&1
+       echo "y" | newfs ${DEV_RDSKDIR}/$disk >/dev/null 2>&1
        (( $? != 0 )) &&
                log_fail "Create file system fail."
 
-        log_must $MOUNT ${DEV_DSKDIR}/$disk $dir
-        log_must $MKFILE $size $file
+        log_must mount ${DEV_DSKDIR}/$disk $dir
+        log_must mkfile $size $file
 }
 
 #
@@ -94,24 +94,24 @@ function clean_blockfile
                if [[ -d $dir ]]; then
                        if is_linux; then
                                if ismounted $dir ext2; then
-                                       typeset dev=$($DF -lht ext2 | \
-                                               $GREP "$dir" | \
-                                               $AWK '{print $1}')
-                                       log_must $UMOUNT -f $dir
+                                       typeset dev=$(df -lht ext2 | \
+                                               grep "$dir" | \
+                                               awk '{print $1}')
+                                       log_must umount -f $dir
                                        create_pool ${TESTPOOL}.tmp $dev
                                        destroy_pool ${TESTPOOL}.tmp
                                fi
                        else
                                if ismounted $dir ufs; then
-                                       typeset dev=$($DF -lhF ufs | \
-                                               $GREP "$dir" | \
-                                               $AWK '{print $1}')
-                                       log_must $UMOUNT -f $dir
+                                       typeset dev=$(df -lhF ufs | \
+                                               grep "$dir" | \
+                                               awk '{print $1}')
+                                       log_must umount -f $dir
                                        create_pool ${TESTPOOL}.tmp $dev
                                        destroy_pool ${TESTPOOL}.tmp
                                fi
                        fi
-                       log_must $RM -rf $dir
+                       log_must rm -rf $dir
                fi
        done
 }
@@ -127,16 +127,16 @@ function find_vfstab_dev
        typeset vfstabdevs=""
        typeset line
 
-       $CAT $vfstab | $GREP "^${DEV_DSKDIR}" >$tmpfile
+       cat $vfstab | grep "^${DEV_DSKDIR}" >$tmpfile
        while read -r line
        do
-               vfstabdev=`$ECHO "$line" | $AWK '{print $1}'`
+               vfstabdev=`echo "$line" | awk '{print $1}'`
                vfstabdev=${vfstabdev%%:}
                vfstabdevs="$vfstabdev $vfstabdevs"
        done <$tmpfile
 
-       $RM -f $tmpfile
-       $ECHO $vfstabdevs
+       rm -f $tmpfile
+       echo $vfstabdevs
 }
 
 #
@@ -148,7 +148,7 @@ function save_dump_dev
        typeset dumpdev
        typeset fnd="Dump device"
 
-       dumpdev=`$DUMPADM | $GREP "$fnd" | $CUT -f2 -d : | \
-               $AWK '{print $1}'`
-       $ECHO $dumpdev
+       dumpdev=`dumpadm | grep "$fnd" | cut -f2 -d : | \
+               awk '{print $1}'`
+       echo $dumpdev
 }
index 2dbd8738d8c881255e8820e2cefae759f7a58527..58921a0ecb121fcfd5881262989b71d57dddf9d8 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -58,7 +58,7 @@ function cleanup
        for file in /var/tmp/$FILEDISK0 /var/tmp/$FILEDISK1 /var/tmp/$FILEDISK2
        do
                if [[ -e $file ]]; then
-                       $RM -rf $file
+                       rm -rf $file
                fi
        done
 
@@ -76,38 +76,38 @@ else
        disk=$DISK0
 fi
 create_pool "$TESTPOOL" "${disk}${SLICE_PREFIX}${SLICE0}"
-log_must $ECHO "y" | $NEWFS \
+log_must echo "y" | newfs \
        ${DEV_RDSKDIR}/${disk}${SLICE_PREFIX}${SLICE1} >/dev/null 2>&1
 create_blockfile $FILESIZE $TESTDIR0/$FILEDISK0 ${disk}${SLICE_PREFIX}${SLICE4}
 create_blockfile $FILESIZE1 $TESTDIR1/$FILEDISK1 ${disk}${SLICE_PREFIX}${SLICE5}
-log_must $MKFILE $SIZE /var/tmp/$FILEDISK0
-log_must $MKFILE $SIZE /var/tmp/$FILEDISK1
-log_must $MKFILE $SIZE /var/tmp/$FILEDISK2
+log_must mkfile $SIZE /var/tmp/$FILEDISK0
+log_must mkfile $SIZE /var/tmp/$FILEDISK1
+log_must mkfile $SIZE /var/tmp/$FILEDISK2
 
 unset NOINUSE_CHECK
-log_must $ZPOOL export $TESTPOOL
+log_must zpool export $TESTPOOL
 log_note "'zpool create' without '-f' will fail " \
        "while device is belong to an exported pool."
-log_mustnot $ZPOOL create "$TESTPOOL1" "${disk}${SLICE_PREFIX}${SLICE0}"
+log_mustnot zpool create "$TESTPOOL1" "${disk}${SLICE_PREFIX}${SLICE0}"
 create_pool "$TESTPOOL1" "${disk}${SLICE_PREFIX}${SLICE0}"
 log_must poolexists $TESTPOOL1
 
 log_note "'zpool create' without '-f' will fail " \
        "while device is using by an ufs filesystem."
-log_mustnot $ZPOOL create "$TESTPOOL2" "${disk}${SLICE_PREFIX}${SLICE1}"
+log_mustnot zpool create "$TESTPOOL2" "${disk}${SLICE_PREFIX}${SLICE1}"
 create_pool "$TESTPOOL2" "${disk}${SLICE_PREFIX}${SLICE1}"
 log_must poolexists $TESTPOOL2
 
 log_note "'zpool create' mirror without '-f' will fail " \
        "while devices have different size."
-log_mustnot $ZPOOL create "$TESTPOOL3" "mirror" $TESTDIR0/$FILEDISK0 \
+log_mustnot zpool create "$TESTPOOL3" "mirror" $TESTDIR0/$FILEDISK0 \
        $TESTDIR1/$FILEDISK1
 create_pool "$TESTPOOL3" "mirror" $TESTDIR0/$FILEDISK0 $TESTDIR1/$FILEDISK1
 log_must poolexists $TESTPOOL3
 
 log_note "'zpool create' mirror without '-f' will fail " \
        "while devices are of different types."
-log_mustnot $ZPOOL create "$TESTPOOL4" "mirror" /var/tmp/$FILEDISK0 \
+log_mustnot zpool create "$TESTPOOL4" "mirror" /var/tmp/$FILEDISK0 \
        ${disk}${SLICE_PREFIX}${SLICE3}
 create_pool "$TESTPOOL4" "mirror" \
        /var/tmp/$FILEDISK0 ${disk}${SLICE_PREFIX}${SLICE3}
@@ -117,9 +117,9 @@ log_note "'zpool create' without '-f' will fail " \
        "while device is part of potentially active pool."
 create_pool "$TESTPOOL5"  "mirror" /var/tmp/$FILEDISK1 \
        /var/tmp/$FILEDISK2
-log_must $ZPOOL offline $TESTPOOL5 /var/tmp/$FILEDISK2
-log_must $ZPOOL export $TESTPOOL5
-log_mustnot $ZPOOL create "$TESTPOOL6" /var/tmp/$FILEDISK2
+log_must zpool offline $TESTPOOL5 /var/tmp/$FILEDISK2
+log_must zpool export $TESTPOOL5
+log_mustnot zpool create "$TESTPOOL6" /var/tmp/$FILEDISK2
 create_pool $TESTPOOL6 /var/tmp/$FILEDISK2
 log_must poolexists $TESTPOOL6
 
index e7917e8266dcb98ba837a03d593f1fbce4bf8b8f..2438b127e97c0a070fa3f19925cd6916d567687c 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -46,7 +46,7 @@ verify_runnable "global"
 
 function cleanup
 {
-       [[ -e $tmpfile ]] && log_must $RM -f $tmpfile
+       [[ -e $tmpfile ]] && log_must rm -f $tmpfile
 }
 
 tmpfile="/var/tmp/zpool_create_003.tmp$$"
@@ -73,13 +73,13 @@ fi
 create_pool $TESTPOOL ${disk}${SLICE_PREFIX}${SLICE0} > $tmpfile
 destroy_pool $TESTPOOL
 
-$ZPOOL create -n  $TESTPOOL ${disk}${SLICE_PREFIX}${SLICE0} > $tmpfile
+zpool create -n  $TESTPOOL ${disk}${SLICE_PREFIX}${SLICE0} > $tmpfile
 
 poolexists $TESTPOOL && \
         log_fail "'zpool create -n <pool> <vspec> ...' fail."
 
 str="would create '$TESTPOOL' with the following layout:"
-$CAT $tmpfile | $GREP "$str" >/dev/null 2>&1
+cat $tmpfile | grep "$str" >/dev/null 2>&1
 (( $? != 0 )) && \
         log_fail "'zpool create -n <pool> <vspec>...' is executed as unexpected."
 
index f9542d4bef867a25f2e116522a06c4c91fa4f03f..48846aa8ce5863875c40b4d34cade63cd07a0b9a 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cli_root/zpool_create/zpool_create.shlib
@@ -50,7 +50,7 @@ function cleanup
        poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1
        poolexists $TESTPOOL && destroy_pool $TESTPOOL
 
-       [[ -d $TESTDIR ]] && log_must $RM -rf $TESTDIR
+       [[ -d $TESTDIR ]] && log_must rm -rf $TESTDIR
        partition_disk $SIZE $disk 6
 }
 
@@ -59,10 +59,10 @@ log_onexit cleanup
 
 disk=${DISKS%% *}
 create_pool $TESTPOOL $disk
-log_must $ZFS create -o mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+log_must zfs create -o mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 
-vdevs_list=$($ECHO $TESTDIR/file.{01..16})
-log_must $MKFILE $MINVDEVSIZE $vdevs_list
+vdevs_list=$(echo $TESTDIR/file.{01..16})
+log_must mkfile $MINVDEVSIZE $vdevs_list
 
 create_pool "$TESTPOOL1" $vdevs_list
 log_must vdevs_in_pool "$TESTPOOL1" "$vdevs_list"
@@ -73,8 +73,8 @@ else
        log_fail "Creating pool with large numbers of file-vdevs failed."
 fi
 
-log_must $MKFILE 32m $TESTDIR/broken_file
+log_must mkfile 32m $TESTDIR/broken_file
 vdevs_list="$vdevs_list $TESTDIR/broken_file"
-log_mustnot $ZPOOL create -f $TESTPOOL1 $vdevs_list
+log_mustnot zpool create -f $TESTPOOL1 $vdevs_list
 
 log_pass "Storage pools with many file based vdevs can be created."
index c2f378989110268ccd4a8f1d6d6ccbb0f52b36e2..2afbec37dca9bf6e30c16cf92dd0b58f8e5efcb2 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,10 +47,10 @@ verify_runnable "global"
 function cleanup
 {
        poolexists $TESTPOOL && \
-               log_must $ZPOOL destroy -f $TESTPOOL
+               log_must zpool destroy -f $TESTPOOL
 
        for dir in $TESTDIR $TESTDIR1; do
-               [[ -d $dir ]] && $RM -rf $dir
+               [[ -d $dir ]] && rm -rf $dir
        done
 }
 
@@ -70,17 +70,17 @@ for pool in $TESTPOOL2 $TESTPOOL1 $TESTPOOL; do
 done
 
 #prepare raw file for file disk
-[[ -d $TESTDIR ]] && $RM -rf $TESTDIR
-log_must $MKDIR -p $TESTDIR
+[[ -d $TESTDIR ]] && rm -rf $TESTDIR
+log_must mkdir -p $TESTDIR
 typeset -i i=1
 while (( i < 4 )); do
-       log_must $MKFILE $FILESIZE $TESTDIR/file.$i
+       log_must mkfile $FILESIZE $TESTDIR/file.$i
 
        (( i = i + 1 ))
 done
 
 #Remove the directory with name as pool name if it exists
-[[ -d /$TESTPOOL ]] && $RM -rf /$TESTPOOL
+[[ -d /$TESTPOOL ]] && rm -rf /$TESTPOOL
 file=$TESTDIR/file
 
 for opt in "-R $TESTDIR1" "-m $TESTDIR1" \
@@ -90,13 +90,13 @@ do
        while (( i < ${#pooltype[*]} )); do
                #Remove the testing pool and its mount directory
                poolexists $TESTPOOL && \
-                       log_must $ZPOOL destroy -f $TESTPOOL
-               [[ -d $TESTDIR1 ]] && $RM -rf $TESTDIR1
-               log_must $ZPOOL create $opt $TESTPOOL ${pooltype[i]} \
+                       log_must zpool destroy -f $TESTPOOL
+               [[ -d $TESTDIR1 ]] && rm -rf $TESTDIR1
+               log_must zpool create $opt $TESTPOOL ${pooltype[i]} \
                        $file.1 $file.2 $file.3
                ! poolexists $TESTPOOL && \
                        log_fail "Createing pool with $opt fails."
-               mpt=`$ZFS mount | $EGREP "^$TESTPOOL[^/]" | $AWK '{print $2}'`
+               mpt=`zfs mount | egrep "^$TESTPOOL[^/]" | awk '{print $2}'`
                (( ${#mpt} == 0 )) && \
                        log_fail "$TESTPOOL created with $opt is not mounted."
                mpt_val=$(get_prop "mountpoint" $TESTPOOL)
index de6b1d4382a7b54fffd19db2141b1db1df200e43..60cefb01fc511c74e64bf61c01fd18edf8981642 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -59,7 +59,7 @@ mntpnt=$(get_prop mountpoint $TESTPOOL)
 
 typeset -i i=0
 while ((i < 10)); do
-       log_must $MKFILE $MINVDEVSIZE $mntpnt/vdev$i
+       log_must mkfile $MINVDEVSIZE $mntpnt/vdev$i
 
        eval vdev$i=$mntpnt/vdev$i
        ((i += 1))
@@ -108,19 +108,19 @@ set -A forced_args \
 
 i=0
 while ((i < ${#valid_args[@]})); do
-       log_must $ZPOOL create $TESTPOOL1 ${valid_args[$i]}
-       $SYNC; $SYNC
-       log_must $ZPOOL destroy -f $TESTPOOL1
+       log_must zpool create $TESTPOOL1 ${valid_args[$i]}
+       sync; sync
+       log_must zpool destroy -f $TESTPOOL1
 
        ((i += 1))
 done
 
 i=0
 while ((i < ${#forced_args[@]})); do
-       log_mustnot $ZPOOL create $TESTPOOL1 ${forced_args[$i]}
-       log_must $ZPOOL create -f $TESTPOOL1 ${forced_args[$i]}
-       $SYNC; $SYNC
-       log_must $ZPOOL destroy -f $TESTPOOL1
+       log_mustnot zpool create $TESTPOOL1 ${forced_args[$i]}
+       log_must zpool create -f $TESTPOOL1 ${forced_args[$i]}
+       sync; sync
+       log_must zpool destroy -f $TESTPOOL1
 
        ((i += 1))
 done
index 3211b0b2a50053302a2ac37961df340b1ff46e08..a7ae5c090a40bbb6428c9708143d8a794f49fba7 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -82,7 +82,7 @@ log_onexit default_cleanup_noexit
 
 typeset -i i=0
 while [[ $i -lt ${#args[*]} ]]; do
-       log_mustnot $ZPOOL create ${args[i]}
+       log_mustnot zpool create ${args[i]}
        ((i = i + 1))
 done
 
index a672eb773d8c2a8b8a951592471171564a20617f..2a09aa1cd3b511f7b2d3f11ce7b48d2bae15be42 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,10 +48,10 @@ function cleanup
 {
        if [[ $exported_pool == true ]]; then
                if [[ $force_pool == true ]]; then
-                       log_must $ZPOOL create \
+                       log_must zpool create \
                                -f $TESTPOOL ${disk}${SLICE_PREFIX}${SLICE0}
                else
-                       log_must $ZPOOL import $TESTPOOL
+                       log_must zpool import $TESTPOOL
                fi
        fi
 
@@ -80,25 +80,25 @@ function create_overlap_slice
         typeset format_file=/var/tmp/format_overlap.$$
         typeset disk=$1
 
-        $ECHO "partition" >$format_file
-        $ECHO "0" >> $format_file
-        $ECHO "" >> $format_file
-        $ECHO "" >> $format_file
-        $ECHO "0" >> $format_file
-        $ECHO "200m" >> $format_file
-        $ECHO "1" >> $format_file
-        $ECHO "" >> $format_file
-        $ECHO "" >> $format_file
-        $ECHO "0" >> $format_file
-        $ECHO "400m" >> $format_file
-        $ECHO "label" >> $format_file
-        $ECHO "" >> $format_file
-        $ECHO "q" >> $format_file
-        $ECHO "q" >> $format_file
-
-        $FORMAT -e -s -d $disk -f $format_file
+        echo "partition" >$format_file
+        echo "0" >> $format_file
+        echo "" >> $format_file
+        echo "" >> $format_file
+        echo "0" >> $format_file
+        echo "200m" >> $format_file
+        echo "1" >> $format_file
+        echo "" >> $format_file
+        echo "" >> $format_file
+        echo "0" >> $format_file
+        echo "400m" >> $format_file
+        echo "label" >> $format_file
+        echo "" >> $format_file
+        echo "q" >> $format_file
+        echo "q" >> $format_file
+
+        format -e -s -d $disk -f $format_file
        typeset -i ret=$?
-        $RM -fr $format_file
+        rm -fr $format_file
 
        if (( ret != 0 )); then
                 log_fail "unable to create overlap slice."
@@ -130,20 +130,20 @@ log_must labelvtoc $disk
 log_must create_overlap_slice $disk
 
 unset NOINUSE_CHECK
-log_mustnot $ZPOOL create $TESTPOOL ${disk}${SLICE_PREFIX}${SLICE0}
-log_must $ZPOOL create -f $TESTPOOL ${disk}${SLICE_PREFIX}${SLICE0}
+log_mustnot zpool create $TESTPOOL ${disk}${SLICE_PREFIX}${SLICE0}
+log_must zpool create -f $TESTPOOL ${disk}${SLICE_PREFIX}${SLICE0}
 destroy_pool $TESTPOOL
 
 # exported device to be as spare vdev need -f to create pool
 
-log_must $ZPOOL create -f $TESTPOOL $disk
+log_must zpool create -f $TESTPOOL $disk
 destroy_pool $TESTPOOL
 log_must partition_disk $SIZE $disk 6
 create_pool $TESTPOOL ${disk}${SLICE_PREFIX}${SLICE0} \
        ${disk}${SLICE_PREFIX}${SLICE1}
-log_must $ZPOOL export $TESTPOOL
+log_must zpool export $TESTPOOL
 exported_pool=true
-log_mustnot $ZPOOL create $TESTPOOL1 ${disk}${SLICE_PREFIX}${SLICE3} \
+log_mustnot zpool create $TESTPOOL1 ${disk}${SLICE_PREFIX}${SLICE3} \
        spare ${disk}${SLICE_PREFIX}${SLICE1}
 create_pool $TESTPOOL1 ${disk}${SLICE_PREFIX}${SLICE3} \
        spare ${disk}${SLICE_PREFIX}${SLICE1}
index 09159c393356900f547f34602b8a1e5ea3e0ae34..0b1b18aebbf4e28ebd68430e59034d8236d97b2d 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -79,16 +79,16 @@ for opt in "" "mirror" "raidz" "raidz1"; do
 
        # Create two pools but using the same disks.
        create_pool $TESTPOOL $opt $disk
-       log_mustnot $ZPOOL create -f $TESTPOOL1 $opt $disk
+       log_mustnot zpool create -f $TESTPOOL1 $opt $disk
        destroy_pool $TESTPOOL
 
        # Create two pools and part of the devices were overlapped
        create_pool $TESTPOOL $opt $disk
-       log_mustnot $ZPOOL create -f $TESTPOOL1 $opt ${DISKS% *}
+       log_mustnot zpool create -f $TESTPOOL1 $opt ${DISKS% *}
        destroy_pool $TESTPOOL
 
        # Create one pool but using the same disks twice.
-       log_mustnot $ZPOOL create -f $TESTPOOL $opt $disk $disk
+       log_mustnot zpool create -f $TESTPOOL $opt $disk $disk
 done
 
 log_pass "Using overlapping or in-use disks to create a new pool fails as expected."
index 694397ff14107ca08794ee9a3c6a9a9a0723a204..165939786d405ece6b0ce6a473826c8e8d688922 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -53,7 +53,7 @@ function cleanup
 
         poolexists $TESTPOOL && destroy_pool $TESTPOOL
 
-       [[ -d $TESTDIR ]] && $RM -rf $TESTDIR
+       [[ -d $TESTDIR ]] && rm -rf $TESTDIR
 
        partition_disk $SIZE $disk 6
 }
@@ -66,13 +66,13 @@ else
 fi
 
 create_pool $TESTPOOL $disk
-log_must $ZFS create $TESTPOOL/$TESTFS
-log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+log_must zfs create $TESTPOOL/$TESTFS
+log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 
 typeset -l devsize=$(($SPA_MINDEVSIZE - 1024 * 1024))
 for files in $TESTDIR/file1 $TESTDIR/file2
 do
-       log_must $MKFILE $devsize $files
+       log_must mkfile $devsize $files
 done
 
 set -A args \
@@ -82,7 +82,7 @@ set -A args \
 
 typeset -i i=0
 while [[ $i -lt ${#args[*]} ]]; do
-       log_mustnot $ZPOOL create ${args[i]}
+       log_mustnot zpool create ${args[i]}
        ((i = i + 1))
 done
 
index 56849e8a290509c8a9b3d9a0569a8e044317f393..359bfaf9c60d64ded33f0263ce4a4a6502d32fce 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -55,7 +55,7 @@ function cleanup
         done
 
        if [[ -n $saved_dump_dev ]]; then
-               log_must $DUMPADM -u -d $saved_dump_dev
+               log_must dumpadm -u -d $saved_dump_dev
        fi
 
         partition_disk $SIZE $disk 6
@@ -108,24 +108,24 @@ set -A arg "$TESTPOOL $pooldev2" \
 unset NOINUSE_CHECK
 typeset -i i=0
 while (( i < ${#arg[*]} )); do
-        log_mustnot $ZPOOL create ${arg[i]}
+        log_mustnot zpool create ${arg[i]}
         (( i = i+1 ))
 done
 
 # now destroy the pool to be polite
-log_must $ZPOOL destroy -f $TESTPOOL
+log_must zpool destroy -f $TESTPOOL
 
 # create/destroy a pool as a simple way to set the partitioning
 # back to something normal so we can use this $disk as a dump device
-log_must $ZPOOL create -f $TESTPOOL3 $disk
-log_must $ZPOOL destroy -f $TESTPOOL3
+log_must zpool create -f $TESTPOOL3 $disk
+log_must zpool destroy -f $TESTPOOL3
 
-log_must $DUMPADM -d ${DEV_DSKDIR}/$specified_dump_dev
-log_mustnot $ZPOOL create -f $TESTPOOL1 "$specified_dump_dev"
+log_must dumpadm -d ${DEV_DSKDIR}/$specified_dump_dev
+log_mustnot zpool create -f $TESTPOOL1 "$specified_dump_dev"
 
 # Also check to see that in-use checking prevents us from creating
 # a zpool from just the first slice on the disk.
-log_mustnot $ZPOOL create \
+log_mustnot zpool create \
        -f $TESTPOOL1 ${specified_dump_dev}${SLICE_PREFIX}${SLICE0}
 
 log_pass "'zpool create' is failed as expected with inapplicable scenarios."
index f3e438f2c25d12e4f5ddd723ca5b10ebcba39537..062a2d63a83f912c18dbf17425873b0a5a014c2d 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -48,15 +52,15 @@ function cleanup
        fi
 
 }
-typeset swap_disks=`$SWAP -l | $GREP "c[0-9].*d[0-9].*s[0-9]" | \
-            $AWK '{print $1}'`
+typeset swap_disks=`swap -l | grep "c[0-9].*d[0-9].*s[0-9]" | \
+            awk '{print $1}'`
 
 log_assert "'zpool create' should fail with disk slice in swap."
 log_onexit cleanup
 
 for sdisk in $swap_disks; do
        for opt in "-n" "" "-f"; do
-               log_mustnot $ZPOOL create $opt $TESTPOOL $sdisk
+               log_mustnot zpool create $opt $TESTPOOL $sdisk
        done
 done
 
index ccc5b09c108a603c7502fa6558a7155106d7f1b1..6785c02e11570ee3f324b59c51c1087b1e9109d3 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,13 +48,13 @@ verify_runnable "global"
 function cleanup
 {
        if datasetexists $vol_name; then
-               $SWAP -l | $GREP $TMP_FILE > /dev/null 2>&1
+               swap -l | grep $TMP_FILE > /dev/null 2>&1
                if [[ $? -eq 0 ]]; then
-                       log_must $SWAP -d $TMP_FILE
+                       log_must swap -d $TMP_FILE
                fi
-               $RM -f $TMP_FILE
-               log_must $UMOUNT $mntp
-               $ZFS destroy $vol_name
+               rm -f $TMP_FILE
+               log_must umount $mntp
+               zfs destroy $vol_name
        fi
 
        if poolexists $TESTPOOL; then
@@ -77,15 +77,15 @@ typeset mntp=/mnt
 typeset TMP_FILE=$mntp/tmpfile.$$
 
 create_pool $TESTPOOL $pool_dev
-log_must $ZFS create -V 100m $vol_name
-log_must $ECHO "y" | $NEWFS ${ZVOL_DEVDIR}/$vol_name > /dev/null 2>&1
-log_must $MOUNT ${ZVOL_DEVDIR}/$vol_name $mntp
+log_must zfs create -V 100m $vol_name
+log_must echo "y" | newfs ${ZVOL_DEVDIR}/$vol_name > /dev/null 2>&1
+log_must mount ${ZVOL_DEVDIR}/$vol_name $mntp
 
-log_must $MKFILE 50m $TMP_FILE
-log_must $SWAP -a $TMP_FILE
+log_must mkfile 50m $TMP_FILE
+log_must swap -a $TMP_FILE
 
 for opt in "-n" "" "-f"; do
-       log_mustnot $ZPOOL create $opt $TESTPOOL $TMP_FILE
+       log_mustnot zpool create $opt $TESTPOOL $TMP_FILE
 done
 
 log_pass "'zpool create' passed as expected with inapplicable scenario."
index 516d4e43d40f207d87b44308951fb7915d7b2471..24e58e0f86cb91429f219de2bb1792dcc965c095 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,9 +52,9 @@ function cleanup
 {
        # cleanup zfs pool and dataset
        if datasetexists $vol_name; then
-               $SWAP -l | $GREP ${ZVOL_DEVDIR}/$vol_name > /dev/null 2>&1
+               swap -l | grep ${ZVOL_DEVDIR}/$vol_name > /dev/null 2>&1
                if [[ $? -eq 0 ]]; then
-                       $SWAP -d ${ZVOL_DEVDIR}/${vol_name}
+                       swap -d ${ZVOL_DEVDIR}/${vol_name}
                fi
        fi
 
@@ -82,15 +82,15 @@ log_onexit cleanup
 # use zfs vol device in swap to create pool which should fail.
 #
 create_pool $TESTPOOL $pool_dev
-log_must $ZFS create -V 100m $vol_name
-log_must $SWAP -a ${ZVOl_DEVDIR}/$vol_name
+log_must zfs create -V 100m $vol_name
+log_must swap -a ${ZVOl_DEVDIR}/$vol_name
 for opt in "-n" "" "-f"; do
-       log_mustnot $ZPOOL create $opt $TESTPOOL1 ${ZVOL_DEVDIR}/${vol_name}
+       log_mustnot zpool create $opt $TESTPOOL1 ${ZVOL_DEVDIR}/${vol_name}
 done
 
 # cleanup
-log_must $SWAP -d ${ZVOL_DEVDIR}/${vol_name}
-log_must $ZFS destroy $vol_name
-log_must $ZPOOL destroy $TESTPOOL
+log_must swap -d ${ZVOL_DEVDIR}/${vol_name}
+log_must zfs destroy $vol_name
+log_must zpool destroy $TESTPOOL
 
 log_pass "'zpool create' passed as expected with inapplicable scenario."
index be8fb6fb10bed6b9542a41d29d55a492c145910d..4c2e554320f1d4d7d4a3a1f39ee4783ab1159ea3 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -54,18 +54,18 @@ function cleanup
 
        #recover swap devices
        FSTAB=/tmp/fstab_$$
-       $RM -f $FSTAB
+       rm -f $FSTAB
        for sdisk in $swap_disks; do
-               $ECHO "$sdisk   -       -       swap    -       no      -" >> $FSTAB
+               echo "$sdisk    -       -       swap    -       no      -" >> $FSTAB
        done
        if [ -e $FSTAB ]
        then
-               log_must $SWAPADD $FSTAB
+               log_must swapadd $FSTAB
        fi
-       $RM -f $FSTAB
+       rm -f $FSTAB
        if [ $dump_device != "none" ]
        then
-               log_must $DUMPADM -u -d $dump_device
+               log_must dumpadm -u -d $dump_device
        fi
 }
 
@@ -75,22 +75,22 @@ else
        disk=$DISK0
 fi
 typeset pool_dev=${disk}${SLICE_PREFIX}${SLICE0}
-typeset swap_disks=$($SWAP -l | $GREP -v "swapfile" | $AWK '{print $1}')
-typeset dump_device=$($DUMPADM | $GREP "Dump device" | $AWK '{print $3}')
+typeset swap_disks=$(swap -l | grep -v "swapfile" | awk '{print $1}')
+typeset dump_device=$(dumpadm | grep "Dump device" | awk '{print $3}')
 
 log_assert "'zpool create' should success with no device in swap."
 log_onexit cleanup
 
 for sdisk in $swap_disks; do
        log_note "Executing: swap -d $sdisk"
-       $SWAP -d $sdisk >/dev/null 2>&1;
+       swap -d $sdisk >/dev/null 2>&1;
        if [[ $? != 0 ]]; then
                log_untested "Unable to delete swap device $sdisk because of" \
                                "insufficient RAM"
        fi
 done
 
-log_must $ZPOOL create $TESTPOOL $pool_dev
-log_must $ZPOOL destroy $TESTPOOL
+log_must zpool create $TESTPOOL $pool_dev
+log_must zpool destroy $TESTPOOL
 
 log_pass "'zpool create' passed as expected with applicable scenario."
index 14cbf988779172013dc816f7b630b9ad9cf8e5e0..7e75e74c298b7d5820f482d458693befd12d263b 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,7 +52,7 @@ function cleanup
        fi
 
        if [[ -d $TESTDIR ]]; then
-               log_must $RM -rf $TESTDIR
+               log_must rm -rf $TESTDIR
        fi
 }
 
@@ -68,20 +68,20 @@ log_assert "'zpool create' should fail with mountpoint exists and not empty."
 log_onexit cleanup
 
 if [[ ! -d $TESTDIR ]]; then
-       log_must $MKDIR -p $TESTDIR
+       log_must mkdir -p $TESTDIR
 fi
 
 typeset -i i=0
 
 while (( i < 2 )); do
-       log_must $RM -rf $TESTDIR/*
+       log_must rm -rf $TESTDIR/*
        if (( i == 0 )); then
-               log_must $MKDIR $TESTDIR/testdir
+               log_must mkdir $TESTDIR/testdir
        else
-               log_must $TOUCH $TESTDIR/testfile
+               log_must touch $TESTDIR/testfile
        fi
 
-       log_mustnot $ZPOOL create -m $TESTDIR -f $TESTPOOL $pool_dev
+       log_mustnot zpool create -m $TESTDIR -f $TESTPOOL $pool_dev
        log_mustnot poolexists $TESTPOOL
 
        (( i = i + 1 ))
index a42edff019a26661f9d0734c9a18fb0f6fb5546a..1de51e04149bbcfd6d7dd2d9ea70044b4f8d0660 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,7 +47,7 @@
 function cleanup
 {
        poolexists $TESTPOOL && destroy_pool $TESTPOOL
-       [[ -f $CPATH ]] && log_must $RM $CPATH
+       [[ -f $CPATH ]] && log_must rm $CPATH
 }
 
 log_onexit cleanup
@@ -70,15 +70,15 @@ typeset vals=("off" "off" "$CPATH" "3" "on")
 typeset -i i=0;
 while [ $i -lt "${#props[@]}" ]
 do
-       log_must $ZPOOL create -o ${props[$i]}=${vals[$i]} $TESTPOOL $disk
+       log_must zpool create -o ${props[$i]}=${vals[$i]} $TESTPOOL $disk
        RESULT=$(get_pool_prop ${props[$i]} $TESTPOOL)
        if [[ $RESULT != ${vals[$i]} ]]
        then
-               $ZPOOL get all $TESTPOOL
+               zpool get all $TESTPOOL
                log_fail "Pool was created without setting the ${props[$i]} " \
                    "property"
        fi
-       log_must $ZPOOL destroy $TESTPOOL
+       log_must zpool destroy $TESTPOOL
        ((i = i + 1))
 done
 
@@ -86,18 +86,18 @@ done
 poolexists $TESTPOOL && destroy_pool $TESTPOOL
 
 # pick two properties, and verify we can create with those as well
-log_must $ZPOOL create -o delegation=off -o cachefile=$CPATH $TESTPOOL $disk
+log_must zpool create -o delegation=off -o cachefile=$CPATH $TESTPOOL $disk
 RESULT=$(get_pool_prop delegation $TESTPOOL)
 if [[ $RESULT != off ]]
 then
-       $ZPOOL get all $TESTPOOL
+       zpool get all $TESTPOOL
        log_fail "Pool created without the delegation prop."
 fi
 
 RESULT=$(get_pool_prop cachefile $TESTPOOL)
 if [[ $RESULT != $CPATH ]]
 then
-       $ZPOOL get all $TESTPOOL
+       zpool get all $TESTPOOL
        log_fail "Pool created without the cachefile prop."
 fi
 
index 277b91e01d9596b29e715740736290166514a38b..9cf6081ff74b89094eadf0251cce8cdfdb408614 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -61,7 +65,7 @@ typeset -i i=0;
 while [ $i -lt "${#props[@]}" ]
 do
         # try to set each property in the prop list with it's corresponding val
-        log_mustnot $ZPOOL create -o ${props[$i]}=${vals[$i]} $TESTPOOL $disk
+        log_mustnot zpool create -o ${props[$i]}=${vals[$i]} $TESTPOOL $disk
        if poolexists $TESTPOOL
        then
                log_fail "$TESTPOOL was created when setting ${props[$i]}!"
index 2ab2f50cb0bd3775dbba32c53630a2d7b5272daa..47da43e8ff9af13e9227d14b26aa837aff7329fd 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -51,7 +51,7 @@ function cleanup
         fi
        if [ -d ${TESTPOOL}.root ]
        then
-               log_must $RMDIR ${TESTPOOL}.root
+               log_must rmdir ${TESTPOOL}.root
        fi
 }
 
@@ -65,44 +65,44 @@ else
        disk=$DISK0
 fi
 
-log_must $MKDIR /${TESTPOOL}.root
-log_must $ZPOOL create -R /${TESTPOOL}.root $TESTPOOL $disk
+log_must mkdir /${TESTPOOL}.root
+log_must zpool create -R /${TESTPOOL}.root $TESTPOOL $disk
 if [ ! -d /${TESTPOOL}.root ]
 then
        log_fail "Mountpoint was not create when using zpool with -R flag!"
 fi
 
-FS=$($ZFS list $TESTPOOL)
+FS=$(zfs list $TESTPOOL)
 if [ -z "$FS" ]
 then
        log_fail "Mounted filesystem at /${TESTPOOL}.root isn't ZFS!"
 fi
 
-log_must $ZPOOL get all $TESTPOOL
-$ZPOOL get all $TESTPOOL > /tmp/values.$$
+log_must zpool get all $TESTPOOL
+zpool get all $TESTPOOL > /tmp/values.$$
 
 # check for the cachefile property, verifying that it's set to 'none'
-$GREP "$TESTPOOL[ ]*cachefile[ ]*none" /tmp/values.$$ > /dev/null 2>&1
+grep "$TESTPOOL[ ]*cachefile[ ]*none" /tmp/values.$$ > /dev/null 2>&1
 if [ $? -ne 0 ]
 then
        log_fail "zpool property \'cachefile\' was not set to \'none\'."
 fi
 
 # check that the root = /mountpoint property is set correctly
-$GREP "$TESTPOOL[ ]*altroot[ ]*/${TESTPOOL}.root" /tmp/values.$$ > /dev/null 2>&1
+grep "$TESTPOOL[ ]*altroot[ ]*/${TESTPOOL}.root" /tmp/values.$$ > /dev/null 2>&1
 if [ $? -ne 0 ]
 then
        log_fail "zpool property root was not found in pool output."
 fi
 
-$RM /tmp/values.$$
+rm /tmp/values.$$
 
 # finally, check that the pool has no reference in /etc/zfs/zpool.cache
 if [[ -f /etc/zfs/zpool.cache ]] ; then
-       REF=$($STRINGS /etc/zfs/zpool.cache | $GREP ${TESTPOOL})
+       REF=$(strings /etc/zfs/zpool.cache | grep ${TESTPOOL})
        if [ ! -z "$REF" ]
        then
-               $STRINGS /etc/zfs/zpool.cache
+               strings /etc/zfs/zpool.cache
                log_fail "/etc/zfs/zpool.cache appears to have a reference to $TESTPOOL"
        fi
 fi
index df40f401dd940b86dead9d3a49614be9a02f7256..f049d147dceb4bd1f214bc0b547365fe1e4fa1d1 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -75,12 +75,12 @@ set -A RW_FS_PROP "quota=512M" \
 
 typeset -i i=0
 while (( $i < ${#RW_FS_PROP[*]} )); do
-       log_must $ZPOOL create -O ${RW_FS_PROP[$i]} -f $TESTPOOL $DISKS
+       log_must zpool create -O ${RW_FS_PROP[$i]} -f $TESTPOOL $DISKS
        datasetexists $TESTPOOL || \
                log_fail "zpool create $TESTPOOL fail."
        propertycheck $TESTPOOL ${RW_FS_PROP[i]} || \
                log_fail "${RW_FS_PROP[i]} is failed to set."
-       log_must $ZPOOL destroy $TESTPOOL
+       log_must zpool destroy $TESTPOOL
        (( i = i + 1 ))
 done
 
index 2186d6cf7a31a0e0044304ba8254de38484221ad..48025e98714f31335fb38d447a801acc428a28e2 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,7 +48,7 @@ verify_runnable "global"
 
 function cleanup
 {
-       datasetexists $TESTPOOL && log_must $ZPOOL destroy $TESTPOOL
+       datasetexists $TESTPOOL && log_must zpool destroy $TESTPOOL
 }
 
 log_onexit cleanup
@@ -80,7 +80,7 @@ while (( $i < ${#RW_FS_PROP[*]} )); do
        (( i = i + 1 ))
 done
 
-log_must $ZPOOL create $opts -f $TESTPOOL $DISKS
+log_must zpool create $opts -f $TESTPOOL $DISKS
 datasetexists $TESTPOOL || log_fail "zpool create $TESTPOOL fail."
 
 i=0
index 3b0f6741cd290f863bffb2a9d36f66eb44c971f1..fb0d480642c41911b412b3d5943479a29d0a12f3 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2015 by Delphix. All rights reserved.
+# Copyright (c) 2015, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,7 +45,7 @@ verify_runnable "global"
 
 function cleanup
 {
-       datasetexists $TESTPOOL && log_must $ZPOOL destroy $TESTPOOL
+       datasetexists $TESTPOOL && log_must zpool destroy $TESTPOOL
 }
 
 log_onexit cleanup
@@ -77,7 +77,7 @@ log_assert "'zpool create -O' should return an error with badly formed parameter
 
 typeset -i i=0
 while (( $i < ${#args[*]} )); do
-       log_mustnot $ZPOOL create -O ${args[i]} -f $TESTPOOL $DISKS
+       log_mustnot zpool create -O ${args[i]} -f $TESTPOOL $DISKS
        ((i = i + 1))
 done
 
index 1fa22d6ca4263447fb45e0354dc79f82d9c6b0e2..9908d0754ffeb8bb8bea0b88e0fb45997342b785 100755 (executable)
@@ -43,7 +43,7 @@ function cleanup
 {
        if [[ -n "$child_pids" ]]; then
                for wait_pid in $child_pids; do
-                       $KILL $wait_pid 2>/dev/null
+                       kill $wait_pid 2>/dev/null
                done
        fi
 
@@ -56,7 +56,7 @@ function cleanup
                                destroy_pool $pool
                        fi
 
-                       $RM -f $vdev0 $vdev1
+                       rm -f $vdev0 $vdev1
                done
        fi
 }
@@ -77,14 +77,14 @@ function zpool_stress
        typeset retry=10
        typeset j=0
 
-       $TRUNCATE -s $FILESIZE $vdev0
-       $TRUNCATE -s $FILESIZE $vdev1
+       truncate -s $FILESIZE $vdev0
+       truncate -s $FILESIZE $vdev1
 
        while [[ $j -lt $iters ]]; do
                ((j = j + 1))
-               $SLEEP 1
+               sleep 1
 
-               $ZPOOL create $pool $vdev0 $vdev1
+               zpool create $pool $vdev0 $vdev1
                if [ $? -ne 0 ]; then
                        return 1;
                fi
@@ -96,25 +96,25 @@ function zpool_stress
                while [[ $k -lt $retry ]]; do
                        ((k = k + 1))
 
-                       $ZPOOL destroy $pool
+                       zpool destroy $pool
                        if [ $? -eq 0 ]; then
                                break;
                        elif [ $k -eq $retry ]; then
                                return 1;
                        fi
 
-                       $SLEEP 3
+                       sleep 3
                done
        done
 
-       $RM -f $vdev0 $vdev1
+       rm -f $vdev0 $vdev1
        return 0
 }
 
 # 1. Create 128 process each of which create/destroy a pool 5 times.
 typeset i=0
 while [[ $i -lt 128 ]]; do
-       typeset uuid=$($UUIDGEN | $CUT -c1-13)
+       typeset uuid=$(uuidgen | cut -c1-13)
 
        zpool_stress $TESTPOOL-$uuid 5 &
        typeset pid=$!
index 746c5041a252134ac73e08f624f0dc70ec82a493..67eff8edcf3b3ddf162d4ce3766387f1fd092d18 100755 (executable)
@@ -21,7 +21,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -44,13 +44,13 @@ verify_runnable "global"
 
 function cleanup
 {
-       datasetexists $TESTPOOL && log_must $ZPOOL destroy $TESTPOOL
+       datasetexists $TESTPOOL && log_must zpool destroy $TESTPOOL
 }
 
 function check_features
 {
-       for state in $($ZPOOL get all $TESTPOOL | \
-           $AWK '$2 ~ /feature@/ { print $3 }'); do
+       for state in $(zpool get all $TESTPOOL | \
+           awk '$2 ~ /feature@/ { print $3 }'); do
                if [[ "$state" != "enabled" && "$state" != "active" ]]; then
                        log_fail "some features are not enabled on new pool"
                fi
@@ -61,11 +61,11 @@ log_onexit cleanup
 
 log_assert "'zpool create' creates pools with all features enabled"
 
-log_must $ZPOOL create -f $TESTPOOL $DISKS
+log_must zpool create -f $TESTPOOL $DISKS
 check_features
-log_must $ZPOOL destroy -f $TESTPOOL
+log_must zpool destroy -f $TESTPOOL
 
-log_must $ZPOOL create -f -o feature@async_destroy=enabled $TESTPOOL $DISKS
+log_must zpool create -f -o feature@async_destroy=enabled $TESTPOOL $DISKS
 check_features
 
 log_pass "'zpool create' creates pools with all features enabled"
index f0e2086cac7e93e11ae2da864e3182696c171f12..7ad4ae8055653d2b2c6acdef4b4a0fee1522b11a 100755 (executable)
@@ -21,7 +21,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -43,13 +43,13 @@ verify_runnable "global"
 
 function cleanup
 {
-       datasetexists $TESTPOOL && log_must $ZPOOL destroy $TESTPOOL
+       datasetexists $TESTPOOL && log_must zpool destroy $TESTPOOL
 }
 
 function check_features
 {
-       for prop in $($ZPOOL get all $TESTPOOL | $AWK '$2 ~ /feature@/ { print $2 }'); do
-               state=$($ZPOOL list -Ho "$prop" $TESTPOOL)
+       for prop in $(zpool get all $TESTPOOL | awk '$2 ~ /feature@/ { print $2 }'); do
+               state=$(zpool list -Ho "$prop" $TESTPOOL)
                 if [[ "$state" != "disabled" ]]; then
                        log_fail "$prop is enabled on new pool"
                fi
@@ -60,11 +60,11 @@ log_onexit cleanup
 
 log_assert "'zpool create -d' creates pools with all features disabled"
 
-log_must $ZPOOL create -f -d $TESTPOOL $DISKS
+log_must zpool create -f -d $TESTPOOL $DISKS
 check_features
-log_must $ZPOOL destroy -f $TESTPOOL
+log_must zpool destroy -f $TESTPOOL
 
-log_must $ZPOOL create -f -o version=28 $TESTPOOL $DISKS
+log_must zpool create -f -o version=28 $TESTPOOL $DISKS
 check_features
 
 log_pass
index 9d45dfd4046d96193146c6c5e6cfba7c1a61a830..c72edffde67df2d55f8d2c452a1642be8f516dad 100755 (executable)
@@ -21,7 +21,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -44,7 +44,7 @@ verify_runnable "global"
 
 function cleanup
 {
-       datasetexists $TESTPOOL && log_must $ZPOOL destroy $TESTPOOL
+       datasetexists $TESTPOOL && log_must zpool destroy $TESTPOOL
 }
 
 log_onexit cleanup
@@ -52,15 +52,15 @@ log_onexit cleanup
 log_assert "'zpool create -d -o feature@async_destroy=enabled' only " \
     "enables async_destroy"
 
-log_must $ZPOOL create -f -d -o feature@async_destroy=enabled $TESTPOOL $DISKS
+log_must zpool create -f -d -o feature@async_destroy=enabled $TESTPOOL $DISKS
 
-state=$($ZPOOL list -Ho feature@async_destroy $TESTPOOL)
+state=$(zpool list -Ho feature@async_destroy $TESTPOOL)
 if [[ "$state" != "enabled" ]]; then
        log_fail "async_destroy has state $state"
 fi
 
-for prop in $($ZPOOL get all $TESTPOOL | $AWK '$2 ~ /feature@/ { print $2 }'); do
-       state=$($ZPOOL list -Ho "$prop" $TESTPOOL)
+for prop in $(zpool get all $TESTPOOL | awk '$2 ~ /feature@/ { print $2 }'); do
+       state=$(zpool list -Ho "$prop" $TESTPOOL)
        if [[ "$prop" != "feature@async_destroy" \
            && "$state" != "disabled" ]]; then
                log_fail "$prop is enabled on new pool"
index 2b465d5a41e25c97ba3cdd4b6ff27dee4da26737..5c6b29c4939e08b03e681a51ea31bf12ddd8fc88 100755 (executable)
@@ -21,7 +21,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,14 +48,14 @@ unsupported@some_feature=readonly \
 
 function cleanup
 {
-       datasetexists $TESTPOOL && log_must $ZPOOL destroy $TESTPOOL
+       datasetexists $TESTPOOL && log_must zpool destroy $TESTPOOL
 }
 
 log_assert "'zpool create' with invalid feature names/states fails"
 log_onexit cleanup
 
 for prop in $properties; do
-       log_mustnot $ZPOOL create -f -o "$prop" $TESTPOOL $DISKS
+       log_mustnot zpool create -f -o "$prop" $TESTPOOL $DISKS
        log_mustnot datasetexists $TESTPOOL
 done
 
index 488f11c9b7c37d3f77384abd6d17f6a855865661..a8ed95109f2aa702929668ad64e968aade2182f1 100755 (executable)
@@ -41,14 +41,14 @@ verify_runnable "global"
 
 function cleanup
 {
-       datasetexists $TESTPOOL && log_must $ZPOOL destroy $TESTPOOL
+       datasetexists $TESTPOOL && log_must zpool destroy $TESTPOOL
 }
 
 function check_features
 {
        typeset feature="${1}"
 
-       ${ZPOOL} get all ${TESTPOOL} | $GREP feature@ | while read line; do
+       zpool get all ${TESTPOOL} | grep feature@ | while read line; do
                set -- $(echo "${line}")
 
                if [[ "feature@${feature}" == "${2}" ]]; then
@@ -83,10 +83,10 @@ typeset -i i=0
 while (( $i < ${#features[*]} )); do
        log_assert "'zpool create' creates pools with ${features[i]} disabled"
 
-       log_must $ZPOOL create -f -o "feature@${features[i]}=disabled" \
+       log_must zpool create -f -o "feature@${features[i]}=disabled" \
            $TESTPOOL $DISKS
        log_must check_features "${features[i]}"
-       log_must $ZPOOL destroy -f $TESTPOOL
+       log_must zpool destroy -f $TESTPOOL
        (( i = i+1 ))
 done
 
index d87d7fc7a7906a638d9f8f4e19de65a214c7d6fc..6525db29c1c1fac97e79720ae62d49592c6f2943 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -49,7 +49,7 @@ function cleanup
 {
        poolexists $TESTPOOL2 && destroy_pool $TESTPOOL2
        datasetexists $TESTPOOL1/$TESTVOL && \
-               log_must $ZFS destroy -f $TESTPOOL1/$TESTVOL
+               log_must zfs destroy -f $TESTPOOL1/$TESTVOL
 
        typeset pool
        for pool in $TESTPOOL1 $TESTPOOL; do
@@ -73,13 +73,13 @@ partition_disk $SLICE_SIZE $DISK 2
 
 create_pool "$TESTPOOL" "${DISK}${SLICE_PREFIX}${SLICE0}"
 create_pool "$TESTPOOL1" "${DISK}${SLICE_PREFIX}${SLICE1}"
-log_must $ZFS create -s -V $VOLSIZE $TESTPOOL1/$TESTVOL
+log_must zfs create -s -V $VOLSIZE $TESTPOOL1/$TESTVOL
 create_pool "$TESTPOOL2" "${ZVOL_DEVDIR}/$TESTPOOL1/$TESTVOL"
 
 typeset -i i=0
 while (( i < ${#datasets[*]} )); do
        log_must poolexists "${datasets[i]}"
-       log_must $ZPOOL destroy "${datasets[i]}"
+       log_must zpool destroy "${datasets[i]}"
        log_mustnot poolexists "${datasets[i]}"
        ((i = i + 1))
 done
index 682e9c088281cfd6d1619b12b19d5db5d6db658a..d05493df2ff0a546cb87a8981e3fd7c1c39d6706 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -55,13 +55,13 @@ function cleanup
                ismounted $TESTDIR
                ((  $? == 0 )) && \
                        log_must $UNMOUNT $TESTDIR
-               log_must $RM -rf $TESTDIR
+               log_must rm -rf $TESTDIR
        fi
 
        typeset -i i=0
        while (( $i < ${#datasets[*]} )); do
                datasetexists ${datasets[i]} && \
-                       log_must $ZFS destroy ${datasets[i]}
+                       log_must zfs destroy ${datasets[i]}
                (( i = i + 1 ))
        done
 
@@ -78,12 +78,12 @@ log_onexit cleanup
 typeset cwd=""
 
 create_pool "$TESTPOOL" "$DISK"
-log_must $ZFS create $TESTPOOL/$TESTFS
-log_must $MKDIR -p $TESTDIR
-log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
-log_must $ZFS create $TESTPOOL/$TESTCTR
-log_must $ZFS create $TESTPOOL/$TESTCTR/$TESTFS1
-log_must $ZFS create -V $VOLSIZE $TESTPOOL/$TESTVOL
+log_must zfs create $TESTPOOL/$TESTFS
+log_must mkdir -p $TESTDIR
+log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+log_must zfs create $TESTPOOL/$TESTCTR
+log_must zfs create $TESTPOOL/$TESTCTR/$TESTFS1
+log_must zfs create -V $VOLSIZE $TESTPOOL/$TESTVOL
 
 typeset -i i=0
 while (( $i < ${#datasets[*]} )); do
@@ -98,10 +98,10 @@ log_note "'zpool destroy' without '-f' will fail " \
 
 for dir in $TESTDIR /$TESTPOOL/$TESTCTR /$TESTPOOL/$TESTCTR/$TESTFS1 ; do
        log_must cd $dir
-       log_mustnot $ZPOOL destroy $TESTPOOL
+       log_mustnot zpool destroy $TESTPOOL
 
        # Need mount here, otherwise some dataset may be unmounted.
-       log_must $ZFS mount -a
+       log_must zfs mount -a
 
        i=0
        while (( i < ${#datasets[*]} )); do
index fb104f1f349a5a794db066379bd06170d215e5d2..75b77b4bde72f5834f008bc97fbede6f2eabde29 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -45,7 +50,7 @@ log_assert "'zpool destroy' should return an error with badly-formed parameters.
 
 typeset -i i=0
 while (( $i < ${#args[*]} )); do
-       log_mustnot $ZPOOL destroy ${args[i]}
+       log_mustnot zpool destroy ${args[i]}
        ((i = i + 1))
 done
 
index 848ce8c8278f14fcd01f64d470ccb897989381e6..74f8e1e664fadfb834f66408ff9264b953e97693 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -57,7 +62,7 @@ typeset -i i=0
 
 while [[ $i -lt ${#args[*]} ]]; do
 
-       log_mustnot $ZPOOL detach ${args[$i]}
+       log_mustnot zpool detach ${args[$i]}
 
        (( i = i + 1 ))
 done
index 06ff6f9d5b8a0ab5091f802ca661dce2b56a82f0..96cdddf3404927a8221b846f374f1e89b78b48e0 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -51,12 +51,12 @@ verify_runnable "global"
 function cleanup
 {
        if poolexists $TESTPOOL1; then
-               log_must $ZPOOL destroy $TESTPOOL1
+               log_must zpool destroy $TESTPOOL1
        fi
 
        for i in 1 2 3; do
                if datasetexists $VFS/vol$i; then
-                       log_must $ZFS destroy $VFS/vol$i
+                       log_must zfs destroy $VFS/vol$i
                fi
        done
 }
@@ -66,12 +66,12 @@ log_onexit cleanup
 log_assert "zpool can be autoexpanded after set autoexpand=on on LUN expansion"
 
 for i in 1 2 3; do
-       log_must $ZFS create -V $org_size $VFS/vol$i
+       log_must zfs create -V $org_size $VFS/vol$i
 done
 
 for type in " " mirror raidz raidz2; do
 
-       log_must $ZPOOL create -o autoexpand=on $TESTPOOL1 $type \
+       log_must zpool create -o autoexpand=on $TESTPOOL1 $type \
            ${ZVOL_DEVDIR}/$VFS/vol1  ${ZVOL_DEVDIR}/$VFS/vol2 \
            ${ZVOL_DEVDIR}/$VFS/vol3
 
@@ -81,20 +81,20 @@ for type in " " mirror raidz raidz2; do
        fi
 
        typeset prev_size=$(get_pool_prop size $TESTPOOL1)
-       typeset zfs_prev_size=$($ZFS get -p avail $TESTPOOL1 | $TAIL -1 | \
-           $AWK '{print $3}')
+       typeset zfs_prev_size=$(zfs get -p avail $TESTPOOL1 | tail -1 | \
+           awk '{print $3}')
 
        for i in 1 2 3; do
-               log_must $ZFS set volsize=$exp_size $VFS/vol$i
+               log_must zfs set volsize=$exp_size $VFS/vol$i
        done
 
-       $SYNC
-       $SLEEP 10
-       $SYNC
+       sync
+       sleep 10
+       sync
 
        typeset expand_size=$(get_pool_prop size $TESTPOOL1)
-       typeset zfs_expand_size=$($ZFS get -p avail $TESTPOOL1 | $TAIL -1 | \
-           $AWK '{print $3}')
+       typeset zfs_expand_size=$(zfs get -p avail $TESTPOOL1 | tail -1 | \
+           awk '{print $3}')
 
        log_note "$TESTPOOL1 $type has previous size: $prev_size and " \
            "expanded size: $expand_size"
@@ -103,10 +103,10 @@ for type in " " mirror raidz raidz2; do
        # check for zpool history for the pool size expansion
                if [[ $type == " " ]]; then
                        typeset expansion_size=$(($exp_size-$org_size))
-                       typeset size_addition=$($ZPOOL history -il $TESTPOOL1 |\
-                           $GREP "pool '$TESTPOOL1' size:" | \
-                           $GREP "vdev online" | \
-                           $GREP "(+${expansion_size}" | wc -l)
+                       typeset size_addition=$(zpool history -il $TESTPOOL1 |\
+                           grep "pool '$TESTPOOL1' size:" | \
+                           grep "vdev online" | \
+                           grep "(+${expansion_size}" | wc -l)
 
                        if [[ $size_addition -ne $i ]]; then
                                log_fail "pool $TESTPOOL1 is not autoexpand " \
@@ -114,10 +114,10 @@ for type in " " mirror raidz raidz2; do
                        fi
                elif [[ $type == "mirror" ]]; then
                        typeset expansion_size=$(($exp_size-$org_size))
-                       $ZPOOL history -il $TESTPOOL1 | \
-                           $GREP "pool '$TESTPOOL1' size:" | \
-                           $GREP "vdev online" | \
-                           $GREP "(+${expansion_size})" >/dev/null 2>&1
+                       zpool history -il $TESTPOOL1 | \
+                           grep "pool '$TESTPOOL1' size:" | \
+                           grep "vdev online" | \
+                           grep "(+${expansion_size})" >/dev/null 2>&1
 
                        if [[ $? -ne 0 ]] ; then
                                log_fail "pool $TESTPOOL1 is not autoexpand " \
@@ -125,10 +125,10 @@ for type in " " mirror raidz raidz2; do
                        fi
                else
                        typeset expansion_size=$((3*($exp_size-$org_size)))
-                       $ZPOOL history -il $TESTPOOL1 | \
-                           $GREP "pool '$TESTPOOL1' size:" | \
-                           $GREP "vdev online" | \
-                           $GREP "(+${expansion_size})" >/dev/null 2>&1
+                       zpool history -il $TESTPOOL1 | \
+                           grep "pool '$TESTPOOL1' size:" | \
+                           grep "vdev online" | \
+                           grep "(+${expansion_size})" >/dev/null 2>&1
 
                        if [[ $? -ne 0 ]]; then
                                log_fail "pool $TESTPOOL is not autoexpand " \
@@ -140,9 +140,9 @@ for type in " " mirror raidz raidz2; do
                    "expansion"
        fi
 
-       log_must $ZPOOL destroy $TESTPOOL1
+       log_must zpool destroy $TESTPOOL1
        for i in 1 2 3; do
-               log_must $ZFS set volsize=$org_size $VFS/vol$i
+               log_must zfs set volsize=$org_size $VFS/vol$i
        done
 
 done
index 180bc85489d055ffff82b0062166539c1fb2f32e..d578ae602d35e010b62030ef1fc899ee3e0b2e6c 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 # Copyright (c) 2017 Lawrence Livermore National Security, LLC.
 #
 
@@ -52,11 +52,11 @@ verify_runnable "global"
 function cleanup
 {
         if poolexists $TESTPOOL1; then
-                log_must $ZPOOL destroy $TESTPOOL1
+                log_must zpool destroy $TESTPOOL1
         fi
 
        for i in 1 2 3; do
-               [ -e ${TEMPFILE}.$i ] && log_must $RM ${TEMPFILE}.$i
+               [ -e ${TEMPFILE}.$i ] && log_must rm ${TEMPFILE}.$i
        done
 }
 
@@ -67,10 +67,10 @@ log_assert "zpool can expand after zpool online -e zvol vdevs on LUN expansion"
 
 for type in " " mirror raidz raidz2; do
        for i in 1 2 3; do
-               log_must $TRUNCATE -s $org_size ${TEMPFILE}.$i
+               log_must truncate -s $org_size ${TEMPFILE}.$i
        done
 
-       log_must $ZPOOL create $TESTPOOL1 $type $TEMPFILE.1 \
+       log_must zpool create $TESTPOOL1 $type $TEMPFILE.1 \
            $TEMPFILE.2 $TEMPFILE.3
 
        typeset autoexp=$(get_pool_prop autoexpand $TESTPOOL1)
@@ -80,24 +80,24 @@ for type in " " mirror raidz raidz2; do
                    "$autoexp"
        fi
        typeset prev_size=$(get_pool_prop size $TESTPOOL1)
-       typeset zfs_prev_size=$($ZFS get -p avail $TESTPOOL1 | $TAIL -1 | \
-           $AWK '{print $3}')
+       typeset zfs_prev_size=$(zfs get -p avail $TESTPOOL1 | tail -1 | \
+           awk '{print $3}')
 
        for i in 1 2 3; do
-               log_must $TRUNCATE -s $exp_size ${TEMPFILE}.$i
+               log_must truncate -s $exp_size ${TEMPFILE}.$i
        done
 
        for i in 1 2 3; do
-               log_must $ZPOOL online -e $TESTPOOL1 ${TEMPFILE}.$i
+               log_must zpool online -e $TESTPOOL1 ${TEMPFILE}.$i
        done
 
-       $SYNC
-       $SLEEP 10
-       $SYNC
+       sync
+       sleep 10
+       sync
 
        typeset expand_size=$(get_pool_prop size $TESTPOOL1)
-       typeset zfs_expand_size=$($ZFS get -p avail $TESTPOOL1 | $TAIL -1 | \
-           $AWK '{print $3}')
+       typeset zfs_expand_size=$(zfs get -p avail $TESTPOOL1 | tail -1 | \
+           awk '{print $3}')
        log_note "$TESTPOOL1 $type has previous size: $prev_size and " \
            "expanded size: $expand_size"
 
@@ -106,10 +106,10 @@ for type in " " mirror raidz raidz2; do
        # check for zpool history for the pool size expansion
                if [[ $type == " " ]]; then
                        typeset expansion_size=$(($exp_size-$org_size))
-                       typeset size_addition=$($ZPOOL history -il $TESTPOOL1 \
-                           | $GREP "pool '$TESTPOOL1' size:" | \
-                           $GREP "vdev online" | \
-                           $GREP "(+${expansion_size}" | wc -l)
+                       typeset size_addition=$(zpool history -il $TESTPOOL1 \
+                           | grep "pool '$TESTPOOL1' size:" | \
+                           grep "vdev online" | \
+                           grep "(+${expansion_size}" | wc -l)
 
                        if [[ $size_addition -ne $i ]]; then
                                log_fail "pool $TESTPOOL1 is not autoexpand " \
@@ -117,10 +117,10 @@ for type in " " mirror raidz raidz2; do
                        fi
                elif [[ $type == "mirror" ]]; then
                        typeset expansion_size=$(($exp_size-$org_size))
-                       $ZPOOL history -il $TESTPOOL1 | \
-                           $GREP "pool '$TESTPOOL1' size:" | \
-                           $GREP "vdev online" | \
-                           $GREP "(+${expansion_size})" >/dev/null 2>&1
+                       zpool history -il $TESTPOOL1 | \
+                           grep "pool '$TESTPOOL1' size:" | \
+                           grep "vdev online" | \
+                           grep "(+${expansion_size})" >/dev/null 2>&1
 
                        if [[ $? -ne 0 ]]; then
                                log_fail "pool $TESTPOOL1 is not autoexpand " \
@@ -128,10 +128,10 @@ for type in " " mirror raidz raidz2; do
                        fi
                else
                        typeset expansion_size=$((3*($exp_size-$org_size)))
-                       $ZPOOL history -il $TESTPOOL1 | \
-                           $GREP "pool '$TESTPOOL1' size:" | \
-                           $GREP "vdev online" | \
-                           $GREP "(+${expansion_size})" >/dev/null 2>&1
+                       zpool history -il $TESTPOOL1 | \
+                           grep "pool '$TESTPOOL1' size:" | \
+                           grep "vdev online" | \
+                           grep "(+${expansion_size})" >/dev/null 2>&1
 
                        if [[ $? -ne 0 ]] ; then
                                log_fail "pool $TESTPOOL1 is not autoexpand " \
@@ -142,6 +142,6 @@ for type in " " mirror raidz raidz2; do
                log_fail "pool $TESTPOOL1 is not autoexpanded after LUN " \
                    "expansion"
        fi
-       log_must $ZPOOL destroy $TESTPOOL1
+       log_must zpool destroy $TESTPOOL1
 done
 log_pass "zpool can expand after zpool online -e zvol vdevs on LUN expansion"
index 36e8d49683ff5af8c734a205d2b18aab68c710ac..733faea0620308e9181285591f09b89ada63fa07 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -51,12 +51,12 @@ verify_runnable "global"
 function cleanup
 {
         if poolexists $TESTPOOL1; then
-                log_must $ZPOOL destroy $TESTPOOL1
+                log_must zpool destroy $TESTPOOL1
         fi
 
        for i in 1 2 3; do
                if datasetexists $VFS/vol$i; then
-                       log_must $ZFS destroy $VFS/vol$i
+                       log_must zfs destroy $VFS/vol$i
                fi
        done
 }
@@ -66,11 +66,11 @@ log_onexit cleanup
 log_assert "zpool can not expand if set autoexpand=off after LUN expansion"
 
 for i  in 1 2 3; do
-       log_must $ZFS create -V $org_size $VFS/vol$i
+       log_must zfs create -V $org_size $VFS/vol$i
 done
 
 for type in " " mirror raidz raidz2; do
-       log_must $ZPOOL create $TESTPOOL1 $type ${ZVOL_DEVDIR}/$VFS/vol1 \
+       log_must zpool create $TESTPOOL1 $type ${ZVOL_DEVDIR}/$VFS/vol1 \
            ${ZVOL_DEVDIR}/$VFS/vol2 ${ZVOL_DEVDIR}/$VFS/vol3
 
        typeset autoexp=$(get_pool_prop autoexpand $TESTPOOL1)
@@ -82,16 +82,16 @@ for type in " " mirror raidz raidz2; do
        typeset prev_size=$(get_pool_prop size $TESTPOOL1)
 
        for i in 1 2 3; do
-               log_must $ZFS set volsize=$exp_size $VFS/vol$i
+               log_must zfs set volsize=$exp_size $VFS/vol$i
        done
 
-       $SYNC
-       $SLEEP 10
-       $SYNC
+       sync
+       sleep 10
+       sync
 
        # check for zpool history for the pool size expansion
-       $ZPOOL history -il $TESTPOOL1 | $GREP "pool '$TESTPOOL1' size:" | \
-           $GREP "vdev online" >/dev/null 2>&1
+       zpool history -il $TESTPOOL1 | grep "pool '$TESTPOOL1' size:" | \
+           grep "vdev online" >/dev/null 2>&1
 
        if [[ $? -eq 0 ]]; then
                log_fail "pool $TESTPOOL1 is not autoexpand after LUN " \
@@ -104,10 +104,10 @@ for type in " " mirror raidz raidz2; do
                log_fail "pool $TESTPOOL1 size changed after LUN expansion"
        fi
 
-       log_must $ZPOOL destroy $TESTPOOL1
+       log_must zpool destroy $TESTPOOL1
 
        for i in 1 2 3; do
-               log_must $ZFS set volsize=$org_size $VFS/vol$i
+               log_must zfs set volsize=$org_size $VFS/vol$i
        done
 
 done
index af7c6f2757521f62ed9aa7eeb777bfa3fe683b71..b6823553d727e3313f5a6262e26ce875607c6672 100755 (executable)
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zpool_export/zpool_export.cfg
 
@@ -46,19 +51,19 @@ function cleanup
        typeset dir=$(get_device_dir $DISKS)
 
        datasetexists "$TESTPOOL/$TESTFS" || \
-               log_must $ZPOOL import -d $dir $TESTPOOL
+               log_must zpool import -d $dir $TESTPOOL
 
        ismounted "$TESTPOOL/$TESTFS"
        (( $? != 0 )) && \
-           log_must $ZFS mount $TESTPOOL/$TESTFS
+           log_must zfs mount $TESTPOOL/$TESTFS
 }
 
 log_onexit cleanup
 
 log_assert "Verify a pool can be exported."
 
-log_must $ZFS umount $TESTDIR
-log_must $ZPOOL export $TESTPOOL
+log_must zfs umount $TESTDIR
+log_must zpool export $TESTPOOL
 
 poolexists $TESTPOOL && \
         log_fail "$TESTPOOL unexpectedly found in 'zpool list' output."
index ee1895eaa4877736dca538c571a69d9c7921f0f9..81473d903aa49b641ac7429452aab78b0448864f 100755 (executable)
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -45,14 +50,14 @@ function cleanup
            log_fail "Couldn't cd back to $olddir"
 
        datasetexists "$TESTPOOL/$TESTFS" || \
-           log_must $ZPOOL import -d $dir $TESTPOOL
+           log_must zpool import -d $dir $TESTPOOL
 
        ismounted "$TESTPOOL/$TESTFS"
        (( $? != 0 )) && \
-           log_must $ZFS mount $TESTPOOL/$TESTFS
+           log_must zfs mount $TESTPOOL/$TESTFS
 
        [[ -e $TESTDIR/$TESTFILE0 ]] && \
-           log_must $RM -rf $TESTDIR/$TESTFILE0
+           log_must rm -rf $TESTDIR/$TESTFILE0
 }
 
 olddir=$PWD
@@ -68,7 +73,7 @@ ismounted "$TESTPOOL/$TESTFS"
 cd $TESTDIR || \
     log_fail "Couldn't cd to $TESTDIR"
 
-log_mustnot $ZPOOL export $TESTPOOL
+log_mustnot zpool export $TESTPOOL
 
 poolexists $TESTPOOL || \
        log_fail "$TESTPOOL not found in 'zpool list' output."
index c3d6c632ace676a63762c39bc91c9588be6e6a5b..b188f9c3304a5b4e8379f6a1a4875743c758fc10 100755 (executable)
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -42,11 +47,11 @@ function cleanup
 {
        typeset dir=$(get_device_dir $DISKS)
        datasetexists "$TESTPOOL/$TESTFS" || \
-               log_must $ZPOOL import -d $dir $TESTPOOL
+               log_must zpool import -d $dir $TESTPOOL
 
        ismounted "$TESTPOOL/$TESTFS"
        (( $? != 0 )) && \
-           log_must $ZFS mount $TESTPOOL/$TESTFS
+           log_must zfs mount $TESTPOOL/$TESTFS
 }
 
 log_onexit cleanup
@@ -57,7 +62,7 @@ log_assert "'zpool export' should return an error with badly-formed parameters."
 
 typeset -i i=0
 while (( $i < ${#args[*]} )); do
-       log_mustnot $ZPOOL export ${args[i]}
+       log_mustnot zpool export ${args[i]}
        ((i = i + 1))
 done
 
index 14b9f219825cac87442499edd29b26714f109c1e..7be92850c2633ecbf0cfc1cbae7430c320c476b5 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -53,13 +53,13 @@ verify_runnable "global"
 function cleanup
 {
        mntpnt=$(get_prop mountpoint $TESTPOOL)
-        datasetexists $TESTPOOL1 || log_must $ZPOOL import -d $mntpnt $TESTPOOL1
+        datasetexists $TESTPOOL1 || log_must zpool import -d $mntpnt $TESTPOOL1
        datasetexists $TESTPOOL1 && destroy_pool $TESTPOOL1
        datasetexists $TESTPOOL2 && destroy_pool $TESTPOOL2
        typeset -i i=0
        while ((i < 5)); do
                if [[ -e $mntpnt/vdev$i ]]; then
-                       log_must $RM -f $mntpnt/vdev$i
+                       log_must rm -f $mntpnt/vdev$i
                fi
                ((i += 1))
        done
@@ -73,27 +73,27 @@ mntpnt=$(get_prop mountpoint $TESTPOOL)
 
 typeset -i i=0
 while ((i < 5)); do
-       log_must $MKFILE $MINVDEVSIZE $mntpnt/vdev$i
+       log_must mkfile $MINVDEVSIZE $mntpnt/vdev$i
        eval vdev$i=$mntpnt/vdev$i
        ((i += 1))
 done
 
-log_must $ZPOOL create $TESTPOOL1 mirror $vdev0 $vdev1 spare $vdev4
-log_must $ZPOOL create $TESTPOOL2 mirror $vdev2 $vdev3 spare $vdev4
+log_must zpool create $TESTPOOL1 mirror $vdev0 $vdev1 spare $vdev4
+log_must zpool create $TESTPOOL2 mirror $vdev2 $vdev3 spare $vdev4
 
-log_must $ZPOOL export $TESTPOOL1
-log_must $ZPOOL import -d $mntpnt $TESTPOOL1
+log_must zpool export $TESTPOOL1
+log_must zpool import -d $mntpnt $TESTPOOL1
 
-log_must $ZPOOL replace $TESTPOOL1 $vdev0 $vdev4
-log_must $ZPOOL detach $TESTPOOL1 $vdev4
-log_must $ZPOOL export $TESTPOOL1
-log_must $ZPOOL import -d $mntpnt $TESTPOOL1
+log_must zpool replace $TESTPOOL1 $vdev0 $vdev4
+log_must zpool detach $TESTPOOL1 $vdev4
+log_must zpool export $TESTPOOL1
+log_must zpool import -d $mntpnt $TESTPOOL1
 
-log_must $ZPOOL replace $TESTPOOL1 $vdev0 $vdev4
-log_mustnot $ZPOOL export $TESTPOOL1
+log_must zpool replace $TESTPOOL1 $vdev0 $vdev4
+log_mustnot zpool export $TESTPOOL1
 
-log_must $ZPOOL export -f $TESTPOOL1
-log_must $ZPOOL import -d $mntpnt  $TESTPOOL1
+log_must zpool export -f $TESTPOOL1
+log_must zpool import -d $mntpnt  $TESTPOOL1
 
 log_pass "Verify zpool export succeed or fail with spare."
 
index dbf3042b69284f374015ebd3beda917126c2b244..d3b21d663f164f9594cecd21d1bedf218a35e148 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
 
 log_assert "Zpool get usage message is displayed when called with no arguments."
 
-$ZPOOL get > /dev/null 2>&1
+zpool get > /dev/null 2>&1
 RET=$?
 if [ $RET != 2 ]
 then
        log_fail "\"zpool get\" exit status $RET should be equal to 2."
 fi
 
-OUTPUT=$($ZPOOL get 2>&1 | $GREP -i usage)
+OUTPUT=$(zpool get 2>&1 | grep -i usage)
 RET=$?
 if [ $RET != 0 ]
 then
index 346811e0395a22aab6225723c0fff28457a096fe..26f27a1796d159d295c3a91cdb53e3aa63788f57 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -56,11 +56,11 @@ if ! is_global_zone ; then
        TESTPOOL=${TESTPOOL%%/*}
 fi
 
-log_must $ZPOOL get all $TESTPOOL
-$ZPOOL get all $TESTPOOL > /tmp/values.$$
+log_must zpool get all $TESTPOOL
+zpool get all $TESTPOOL > /tmp/values.$$
 
 log_note "Checking zpool get all output for a header."
-$GREP ^"NAME " /tmp/values.$$ > /dev/null 2>&1
+grep ^"NAME " /tmp/values.$$ > /dev/null 2>&1
 if [ $? -ne 0 ]
 then
        log_fail "The header was not printed from zpool get all"
@@ -70,7 +70,7 @@ fi
 while [ $i -lt "${#properties[@]}" ]
 do
        log_note "Checking for ${properties[$i]} property"
-       $GREP "$TESTPOOL *${properties[$i]}" /tmp/values.$$ > /dev/null 2>&1
+       grep "$TESTPOOL *${properties[$i]}" /tmp/values.$$ > /dev/null 2>&1
        if [ $? -ne 0 ]
        then
                log_fail "zpool property ${properties[$i]} was not found\
@@ -82,7 +82,7 @@ done
 # increment the counter to include the header line
 i=$(( $i + 1 ))
 
-COUNT=$($WC /tmp/values.$$ | $AWK '{print $1}')
+COUNT=$(wc /tmp/values.$$ | awk '{print $1}')
 if [ $i -ne $COUNT ]
 then
        log_fail "Found zpool features not in the zpool_get test config $i/$COUNT."
@@ -90,5 +90,5 @@ fi
 
 
 
-$RM /tmp/values.$$
+rm /tmp/values.$$
 log_pass "Zpool get all works as expected"
index a816b6b226d845abe04cfa72c9de421e56a97e7d..815786ad7adc7d436b1aac0060727e7402c9d0b1 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zpool_get/zpool_get.cfg
 
@@ -48,13 +52,13 @@ typeset -i i=0;
 while [ $i -lt "${#properties[@]}" ]
 do
        log_note "Checking for ${properties[$i]} property"
-       log_must eval "$ZPOOL get ${properties[$i]} $TESTPOOL > /tmp/value.$$"
-       $GREP "${properties[$i]}" /tmp/value.$$ > /dev/null 2>&1
+       log_must eval "zpool get ${properties[$i]} $TESTPOOL > /tmp/value.$$"
+       grep "${properties[$i]}" /tmp/value.$$ > /dev/null 2>&1
        if [ $? -ne 0 ]
        then
                log_fail "${properties[$i]} not seen in output"
        fi
-       $GREP "^NAME " /tmp/value.$$ > /dev/null 2>&1
+       grep "^NAME " /tmp/value.$$ > /dev/null 2>&1
        # only need to check this once.
        if [ $i -eq 0 ] && [ $? -ne 0 ]
        then
@@ -63,5 +67,5 @@ do
        i=$(( $i + 1 ))
 done
 
-$RM /tmp/value.$$
+rm /tmp/value.$$
 log_pass "Zpool get returns values for all known properties"
index c4729d8b19e01f986b260bc9a7df1f42d58e9784..1edd2ba79af9df92474744ffc814362f5eb32c9e 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -51,7 +55,7 @@ set -A arguments "$TESTPOOL $TESTPOOL" "$TESTPOOL rubbish" "-v $TESTPOOL" \
 
 for arg in $arguments
 do
-       log_mustnot $ZPOOL get $arg
+       log_mustnot zpool get $arg
 done
 
 log_pass "Malformed zpool get commands are rejected"
index a722fe7cad11b188db032d4a74ffa6cdb759c1d6..dd1be14a066bdf80ffae238eea1f8d5413de36c8 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -47,19 +51,19 @@ set -A neg_opt "$TESTPOOL/$TESTCTR" "$TESTPOOL/$TESTVOL" "-t $TESTPOOL" \
 
 function cleanup
 {
-       datasetexists $clone && log_must $ZFS destroy $clone
-       datasetexists $snap && log_must $ZFS destroy $snap
+       datasetexists $clone && log_must zfs destroy $clone
+       datasetexists $snap && log_must zfs destroy $snap
 }
 
 log_assert "Verify 'zpool history' can deal with non-existent pools and " \
        "garbage to the command."
 log_onexit cleanup
 
-log_must $ZFS snapshot $snap
-log_must $ZFS clone $snap $clone
+log_must zfs snapshot $snap
+log_must zfs clone $snap $clone
 
 for opt in "${neg_opt[@]}"; do
-       log_mustnot eval "$ZPOOL history $opt > /dev/null"
+       log_mustnot eval "zpool history $opt > /dev/null"
 done
 
 log_pass "'zpool history' command line negation test passed."
index bd5bf19034b464c9f32a8698f3024448ef013dab..0146aa5bc1ddcb5dff6d917453c1ead881376273 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,7 +47,7 @@ log_assert "Verify zpool history can handle options [-il] correctly."
 options="-i -l -il -li -lil -ili -lli -iill -liil"
 
 for opt in $options; do
-       log_must eval "$ZPOOL history $opt $TESTPOOL > /dev/null 2>&1"
+       log_must eval "zpool history $opt $TESTPOOL > /dev/null 2>&1"
 done
 
 log_pass "Verify zpool history can handle options [-il] passed."
index c55d70c7b19323c7042af3e465586a1d314bfa3f..f4f317cbecc141cd8e7a428a26992680d7a6ce78 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -36,16 +36,16 @@ verify_runnable "global"
 
 for pool in "$TESTPOOL" "$TESTPOOL1"; do
        datasetexists $pool/$TESTFS && \
-               log_must $ZFS destroy -Rf $pool/$TESTFS
+               log_must zfs destroy -Rf $pool/$TESTFS
        destroy_pool "$pool"
 done
 
 ismounted $DEVICE_DIR $NEWFS_DEFAULT_FS
-(( $? == 0 )) && log_must $UMOUNT -f $DEVICE_DIR
+(( $? == 0 )) && log_must umount -f $DEVICE_DIR
 
 for dir in "$TESTDIR" "$TESTDIR1" "$DEVICE_DIR" ; do
        [[ -d $dir ]] && \
-               log_must $RM -rf $dir
+               log_must rm -rf $dir
 done
 
 DISK=${DISKS%% *}
index 9d0b913a01a8f3893be7c8c203ba1004457e1887..142771de6c91ef9c5219dade9f9b677f6fc80dee 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -61,38 +61,38 @@ done
 create_pool "$TESTPOOL" "$ZFSSIDE_DISK1"
 
 if [[ -d $TESTDIR ]]; then
-       $RM -rf $TESTDIR  || log_unresolved Could not remove $TESTDIR
-       $MKDIR -p $TESTDIR || log_unresolved Could not create $TESTDIR
+       rm -rf $TESTDIR  || log_unresolved Could not remove $TESTDIR
+       mkdir -p $TESTDIR || log_unresolved Could not create $TESTDIR
 fi
 
-log_must $ZFS create $TESTPOOL/$TESTFS
-log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+log_must zfs create $TESTPOOL/$TESTFS
+log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 
-DISK2="$($ECHO $DISKS | $NAWK '{print $2}')"
+DISK2="$(echo $DISKS | nawk '{print $2}')"
 if is_mpath_device $DISK2; then
-       $ECHO "y" | $NEWFS -v $DEV_DSKDIR/$DISK2 >/dev/null 2>&1
+       echo "y" | newfs -v $DEV_DSKDIR/$DISK2 >/dev/null 2>&1
        (( $? != 0 )) &&
                log_untested "Unable to setup a $NEWFS_DEFAULT_FS file system"
 
        [[ ! -d $DEVICE_DIR ]] && \
-               log_must $MKDIR -p $DEVICE_DIR
+               log_must mkdir -p $DEVICE_DIR
 
-       log_must $MOUNT $DEV_DSKDIR/$DISK2 $DEVICE_DIR
+       log_must mount $DEV_DSKDIR/$DISK2 $DEVICE_DIR
 else
        log_must set_partition 0 "" $FS_SIZE $ZFS_DISK2
-       $ECHO "y" | $NEWFS -v $DEV_DSKDIR/$ZFSSIDE_DISK2 >/dev/null 2>&1
+       echo "y" | newfs -v $DEV_DSKDIR/$ZFSSIDE_DISK2 >/dev/null 2>&1
        (( $? != 0 )) &&
                log_untested "Unable to setup a $NEWFS_DEFAULT_FS file system"
 
        [[ ! -d $DEVICE_DIR ]] && \
-               log_must $MKDIR -p $DEVICE_DIR
+               log_must mkdir -p $DEVICE_DIR
 
-       log_must $MOUNT $DEV_DSKDIR/$ZFSSIDE_DISK2 $DEVICE_DIR
+       log_must mount $DEV_DSKDIR/$ZFSSIDE_DISK2 $DEVICE_DIR
 fi
 
 i=0
 while (( i < $MAX_NUM )); do
-       log_must $MKFILE $FILE_SIZE ${DEVICE_DIR}/${DEVICE_FILE}$i
+       log_must mkfile $FILE_SIZE ${DEVICE_DIR}/${DEVICE_FILE}$i
        (( i = i + 1 ))
 done
 
index b49281f9268c5fe40093f7cf8603f5fbec04580c..8ac8a4eabccaae421eae64c3c34f768127bc7546 100644 (file)
@@ -31,7 +31,7 @@
 . $STF_SUITE/include/libtest.shlib
 
 export DISKSARRAY=$DISKS
-export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
+export DISK_ARRAY_NUM=$(echo ${DISKS} | nawk '{print NF}')
 typeset -a disk_array=($(find_disks $DISKS))
 case "${#disk_array[*]}" in
 0)
@@ -51,7 +51,7 @@ case "${#disk_array[*]}" in
                else
                        export DEV_DSKDIR=$DEV_RDSKDIR
                fi
-               if ( is_mpath_device $ZFS_DISK1 ) && [[ -z $($ECHO $ZFS_DISK1 | awk 'substr($1,18,1)\
+               if ( is_mpath_device $ZFS_DISK1 ) && [[ -z $(echo $ZFS_DISK1 | awk 'substr($1,18,1)\
                     ~ /^[[:digit:]]+$/') ]] || ( is_real_device $ZFS_DISK1 ); then
                        ZFSSIDE_DISK1=${ZFS_DISK1}1
                        ZFSSIDE_DISK2=${ZFS_DISK2}2
@@ -80,7 +80,7 @@ case "${#disk_array[*]}" in
                else
                        export DEV_DSKDIR=$DEV_RDSKDIR
                fi
-               if ( is_mpath_device $ZFS_DISK1 ) && [[ -z $($ECHO $ZFS_DISK1 | awk 'substr($1,18,1)\
+               if ( is_mpath_device $ZFS_DISK1 ) && [[ -z $(echo $ZFS_DISK1 | awk 'substr($1,18,1)\
                    ~ /^[[:digit:]]+$/') ]] || ( is_real_device $ZFS_DISK1 ); then
                        ZFSSIDE_DISK1=${ZFS_DISK1}1
                elif ( is_mpath_device $ZFS_DISK1 || is_loop_device $ZFS_DISK1 ); then
@@ -89,7 +89,7 @@ case "${#disk_array[*]}" in
                        log_fail "$ZFS_DISK1 not supported for partitioning."
                fi
                ZFS_DISK2=${disk_array[1]}
-               if ( is_mpath_device $ZFS_DISK2 ) && [[ -z $($ECHO $ZFS_DISK2 | awk 'substr($1,18,1)\
+               if ( is_mpath_device $ZFS_DISK2 ) && [[ -z $(echo $ZFS_DISK2 | awk 'substr($1,18,1)\
                    ~ /^[[:digit:]]+$/') ]] || ( is_real_device $ZFS_DISK2 ); then
                        ZFSSIDE_DISK2=${ZFS_DISK2}1
                elif ( is_mpath_device $ZFS_DISK2 || is_loop_device $ZFS_DISK2 ); then
index ef3586540664bb8f318dc3d69b8af74b91ef8198..6369a297c17d32ee8800aeea31f8c592e408412c 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -63,16 +63,16 @@ function cleanup
 
        while (( i < ${#pools[*]} )); do
                poolexists ${pools[i]} && \
-                       log_must $ZPOOL export ${pools[i]}
+                       log_must zpool export ${pools[i]}
 
                datasetexists "${pools[i]}/$TESTFS" || \
-                       log_must $ZPOOL import ${devs[i]} ${pools[i]}
+                       log_must zpool import ${devs[i]} ${pools[i]}
 
                ismounted "${pools[i]}/$TESTFS" || \
-                       log_must $ZFS mount ${pools[i]}/$TESTFS
+                       log_must zfs mount ${pools[i]}/$TESTFS
 
                [[ -e ${mtpts[i]}/$TESTFILE0 ]] && \
-                       log_must $RM -rf ${mtpts[i]}/$TESTFILE0
+                       log_must rm -rf ${mtpts[i]}/$TESTFILE0
 
                ((i = i + 1))
        done
@@ -82,7 +82,7 @@ function cleanup
         destroy_pool $TESTPOOL1
 
        [[ -d $ALTER_ROOT ]] && \
-               log_must $RM -rf $ALTER_ROOT
+               log_must rm -rf $ALTER_ROOT
 }
 
 log_onexit cleanup
@@ -91,7 +91,7 @@ log_assert "Verify that an exported pool can be imported."
 
 setup_filesystem "$DEVICE_FILES" $TESTPOOL1 $TESTFS $TESTDIR1
 
-checksum1=$($SUM $MYTESTFILE | $AWK '{print $1}')
+checksum1=$(sum $MYTESTFILE | awk '{print $1}')
 
 typeset -i i=0
 typeset -i j=0
@@ -99,20 +99,20 @@ typeset basedir
 
 while (( i < ${#pools[*]} )); do
        guid=$(get_config ${pools[i]} pool_guid)
-       log_must $CP $MYTESTFILE ${mtpts[i]}/$TESTFILE0
+       log_must cp $MYTESTFILE ${mtpts[i]}/$TESTFILE0
 
-       log_must $ZFS umount ${mtpts[i]}
+       log_must zfs umount ${mtpts[i]}
 
        j=0
        while (( j <  ${#options[*]} )); do
-               log_must $ZPOOL export ${pools[i]}
+               log_must zpool export ${pools[i]}
 
                typeset target=${pools[i]}
                if (( RANDOM % 2 == 0 )) ; then
                        target=$guid
                        log_note "Import by guid."
                fi
-               log_must $ZPOOL import ${devs[i]} ${options[j]} $target
+               log_must zpool import ${devs[i]} ${options[j]} $target
 
                log_must poolexists ${pools[i]}
 
@@ -125,7 +125,7 @@ while (( i < ${#pools[*]} )); do
                [[ ! -e $basedir/$TESTFILE0 ]] && \
                        log_fail "$basedir/$TESTFILE0 missing after import."
 
-               checksum2=$($SUM $basedir/$TESTFILE0 | $AWK '{print $1}')
+               checksum2=$(sum $basedir/$TESTFILE0 | awk '{print $1}')
                [[ "$checksum1" != "$checksum2" ]] && \
                        log_fail "Checksums differ ($checksum1 != $checksum2)"
 
index 73f24a4a6ab7fc7159f0ff8dd4d8f8c5ef21f750..898f93cc9062f21dc993f0d47f02efb6cd7c9f32 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -62,16 +62,16 @@ function cleanup
        typeset -i i=0
        while (( i < ${#pools[*]} )); do
                poolexists ${pools[i]} && \
-                       log_must $ZPOOL export ${pools[i]}
+                       log_must zpool export ${pools[i]}
 
                datasetexists "${pools[i]}/$TESTFS" || \
-                       log_must $ZPOOL import ${devs[i]} ${pools[i]}
+                       log_must zpool import ${devs[i]} ${pools[i]}
 
                ismounted "${pools[i]}/$TESTFS" || \
-                       log_must $ZFS mount ${pools[i]}/$TESTFS
+                       log_must zfs mount ${pools[i]}/$TESTFS
 
                [[ -e ${mtpts[i]}/$TESTFILE0 ]] && \
-                       log_must $RM -rf ${mtpts[i]}/$TESTFILE0
+                       log_must rm -rf ${mtpts[i]}/$TESTFILE0
 
                ((i = i + 1))
        done
@@ -81,7 +81,7 @@ function cleanup
        destroy_pool $TESTPOOL1
 
        [[ -d $ALTER_ROOT ]] && \
-               log_must $RM -rf $ALTER_ROOT
+               log_must rm -rf $ALTER_ROOT
 }
 
 log_onexit cleanup
@@ -90,7 +90,7 @@ log_assert "Verify that an exported pool cannot be imported more than once."
 
 setup_filesystem "$DEVICE_FILES" $TESTPOOL1 $TESTFS $TESTDIR1
 
-checksum1=$($SUM $MYTESTFILE | $AWK '{print $1}')
+checksum1=$(sum $MYTESTFILE | awk '{print $1}')
 
 typeset -i i=0
 typeset -i j=0
@@ -99,13 +99,13 @@ typeset basedir
 while (( i < ${#pools[*]} )); do
        guid=$(get_config ${pools[i]} pool_guid)
 
-       log_must $CP $MYTESTFILE ${mtpts[i]}/$TESTFILE0
+       log_must cp $MYTESTFILE ${mtpts[i]}/$TESTFILE0
 
-       log_must $ZFS umount ${mtpts[i]}
+       log_must zfs umount ${mtpts[i]}
 
        j=0
        while (( j <  ${#options[*]} )); do
-               log_must $ZPOOL export ${pools[i]}
+               log_must zpool export ${pools[i]}
 
                typeset target=${pools[i]}
                if (( RANDOM % 2 == 0 )) ; then
@@ -113,7 +113,7 @@ while (( i < ${#pools[*]} )); do
                        log_note "Import by guid."
                fi
 
-               log_must $ZPOOL import ${devs[i]} ${options[j]} $target
+               log_must zpool import ${devs[i]} ${options[j]} $target
 
                log_must poolexists ${pools[i]}
 
@@ -126,11 +126,11 @@ while (( i < ${#pools[*]} )); do
                [[ ! -e $basedir/$TESTFILE0 ]] && \
                        log_fail "$basedir/$TESTFILE0 missing after import."
 
-               checksum2=$($SUM $basedir/$TESTFILE0 | $AWK '{print $1}')
+               checksum2=$(sum $basedir/$TESTFILE0 | awk '{print $1}')
                [[ "$checksum1" != "$checksum2" ]] && \
                        log_fail "Checksums differ ($checksum1 != $checksum2)"
 
-               log_mustnot $ZPOOL import ${devs[i]} $target
+               log_mustnot zpool import ${devs[i]} $target
 
                ((j = j + 1))
        done
index 26ed492095e6a8f6b2c75634dda3439d7316797a..dfda989deab90bc25c0e28eabdbdb05090aef352 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,20 +48,20 @@ function cleanup
 {
        destroy_pool $TESTPOOL1
 
-       log_must $RM $VDEV0 $VDEV1
-       log_must $MKFILE $FILE_SIZE $VDEV0 $VDEV1
+       log_must rm $VDEV0 $VDEV1
+       log_must mkfile $FILE_SIZE $VDEV0 $VDEV1
 }
 
 log_assert "Destroyed pools are not listed unless with -D option is specified."
 log_onexit cleanup
 
-log_must $ZPOOL create $TESTPOOL1 $VDEV0 $VDEV1
-log_must $ZPOOL destroy $TESTPOOL1
+log_must zpool create $TESTPOOL1 $VDEV0 $VDEV1
+log_must zpool destroy $TESTPOOL1
 
 #
 # 'pool:' is the keywords of 'zpool import -D' output.
 #
-log_mustnot eval "$ZPOOL import -d $DEVICE_DIR | $GREP pool:"
-log_must eval "$ZPOOL import -d $DEVICE_DIR -D | $GREP pool:"
+log_mustnot eval "zpool import -d $DEVICE_DIR | grep pool:"
+log_must eval "zpool import -d $DEVICE_DIR -D | grep pool:"
 
 log_pass "Destroyed pool only can be listed with -D option."
index f584200628b492b4bd8bfd60bea6752cd07216cb..657e28be2563898643e92d4ba8d72ced9c95feed 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -50,10 +50,10 @@ function cleanup
 {
        destroy_pool $TESTPOOL1
 
-       log_must $RM -rf $DEVICE_DIR/*
+       log_must rm -rf $DEVICE_DIR/*
        typeset i=0
        while (( i < $MAX_NUM )); do
-               log_must $MKFILE $FILE_SIZE ${DEVICE_DIR}/${DEVICE_FILE}$i
+               log_must mkfile $FILE_SIZE ${DEVICE_DIR}/${DEVICE_FILE}$i
                ((i += 1))
        done
 }
@@ -62,27 +62,27 @@ log_assert "Destroyed pools devices was moved to another directory," \
        "it still can be imported correctly."
 log_onexit cleanup
 
-log_must $ZPOOL create $TESTPOOL1 $VDEV0 $VDEV1 $VDEV2
+log_must zpool create $TESTPOOL1 $VDEV0 $VDEV1 $VDEV2
 typeset guid=$(get_config $TESTPOOL1 pool_guid)
 typeset target=$TESTPOOL1
 if (( RANDOM % 2 == 0 )) ; then
        target=$guid
        log_note "Import by guid."
 fi
-log_must $ZPOOL destroy $TESTPOOL1
+log_must zpool destroy $TESTPOOL1
 
 log_note "Devices was moved to different directories."
-log_must $MKDIR $DEVICE_DIR/newdir1 $DEVICE_DIR/newdir2
-log_must $MV $VDEV1 $DEVICE_DIR/newdir1
-log_must $MV $VDEV2 $DEVICE_DIR/newdir2
-log_must $ZPOOL import -d $DEVICE_DIR/newdir1 -d $DEVICE_DIR/newdir2 \
+log_must mkdir $DEVICE_DIR/newdir1 $DEVICE_DIR/newdir2
+log_must mv $VDEV1 $DEVICE_DIR/newdir1
+log_must mv $VDEV2 $DEVICE_DIR/newdir2
+log_must zpool import -d $DEVICE_DIR/newdir1 -d $DEVICE_DIR/newdir2 \
        -d $DEVICE_DIR -D -f $target
-log_must $ZPOOL destroy -f $TESTPOOL1
+log_must zpool destroy -f $TESTPOOL1
 
 log_note "Devices was moved to same directory."
-log_must $MV $VDEV0 $DEVICE_DIR/newdir2
-log_must $MV $DEVICE_DIR/newdir1/* $DEVICE_DIR/newdir2
-log_must $ZPOOL import -d $DEVICE_DIR/newdir2 -D -f $target
-log_must $ZPOOL destroy -f $TESTPOOL1
+log_must mv $VDEV0 $DEVICE_DIR/newdir2
+log_must mv $DEVICE_DIR/newdir1/* $DEVICE_DIR/newdir2
+log_must zpool import -d $DEVICE_DIR/newdir2 -D -f $target
+log_must zpool destroy -f $TESTPOOL1
 
 log_pass "Destroyed pools devices was moved, 'zpool import -D' passed."
index 12bd14d33c1f2e4048afea94cd6869e8b76b48d0..79f026ede55f4f682d8efa02908b3c99e7b71678 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,10 +48,10 @@ function cleanup
 {
        destroy_pool $TESTPOOL1
 
-       log_must $RM -rf $DEVICE_DIR/*
+       log_must rm -rf $DEVICE_DIR/*
        typeset i=0
        while (( i < $MAX_NUM )); do
-               log_must $MKFILE $FILE_SIZE ${DEVICE_DIR}/${DEVICE_FILE}$i
+               log_must mkfile $FILE_SIZE ${DEVICE_DIR}/${DEVICE_FILE}$i
                ((i += 1))
        done
 }
@@ -60,26 +60,26 @@ log_assert "Destroyed pools devices was renamed, it still can be imported " \
        "correctly."
 log_onexit cleanup
 
-log_must $ZPOOL create $TESTPOOL1 $VDEV0 $VDEV1 $VDEV2
+log_must zpool create $TESTPOOL1 $VDEV0 $VDEV1 $VDEV2
 typeset guid=$(get_config $TESTPOOL1 pool_guid)
 typeset target=$TESTPOOL1
 if (( RANDOM % 2 == 0 )) ; then
        target=$guid
        log_note "Import by guid."
 fi
-log_must $ZPOOL destroy $TESTPOOL1
+log_must zpool destroy $TESTPOOL1
 
 log_note "Part of devices was renamed in the same directory."
-log_must $MV $VDEV0 $DEVICE_DIR/vdev0-new
-log_must $ZPOOL import -d $DEVICE_DIR -D -f $target
-log_must $ZPOOL destroy -f $TESTPOOL1
+log_must mv $VDEV0 $DEVICE_DIR/vdev0-new
+log_must zpool import -d $DEVICE_DIR -D -f $target
+log_must zpool destroy -f $TESTPOOL1
 
 log_note "All of devices was rename to different directories."
-log_must $MKDIR $DEVICE_DIR/newdir1 $DEVICE_DIR/newdir2
-log_must $MV $VDEV1 $DEVICE_DIR/newdir1/vdev1-new
-log_must $MV $VDEV2 $DEVICE_DIR/newdir2/vdev2-new
-log_must $ZPOOL import -d $DEVICE_DIR/newdir1 -d $DEVICE_DIR/newdir2 \
+log_must mkdir $DEVICE_DIR/newdir1 $DEVICE_DIR/newdir2
+log_must mv $VDEV1 $DEVICE_DIR/newdir1/vdev1-new
+log_must mv $VDEV2 $DEVICE_DIR/newdir2/vdev2-new
+log_must zpool import -d $DEVICE_DIR/newdir1 -d $DEVICE_DIR/newdir2 \
        -d $DEVICE_DIR -D -f $target
-log_must $ZPOOL destroy -f $TESTPOOL1
+log_must zpool destroy -f $TESTPOOL1
 
 log_pass "Destroyed pools devices was renamed, 'zpool import -D' passed."
index b35e3ccff6cbb191495cc06c623219785ade0084..2353bb07d040e6a6d84579783e48fe270ef8c1d9 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -51,10 +51,10 @@ function cleanup
        destroy_pool $TESTPOOL2
        destroy_pool $TESTPOOL1
 
-       log_must $RM -rf $DEVICE_DIR/*
+       log_must rm -rf $DEVICE_DIR/*
        typeset i=0
        while (( i < $MAX_NUM )); do
-               log_must $MKFILE $FILE_SIZE ${DEVICE_DIR}/${DEVICE_FILE}$i
+               log_must mkfile $FILE_SIZE ${DEVICE_DIR}/${DEVICE_FILE}$i
                ((i += 1))
        done
 }
@@ -63,21 +63,21 @@ log_assert "For mirror, N-1 destroyed pools devices was removed or used " \
        "by other pool, it still can be imported correctly."
 log_onexit cleanup
 
-log_must $ZPOOL create $TESTPOOL1 mirror $VDEV0 $VDEV1 $VDEV2
+log_must zpool create $TESTPOOL1 mirror $VDEV0 $VDEV1 $VDEV2
 typeset guid=$(get_config $TESTPOOL1 pool_guid)
 typeset target=$TESTPOOL1
 if (( RANDOM % 2 == 0 )) ; then
        target=$guid
        log_note "Import by guid."
 fi
-log_must $ZPOOL destroy $TESTPOOL1
+log_must zpool destroy $TESTPOOL1
 
-log_must $ZPOOL create $TESTPOOL2 $VDEV0 $VDEV2
-log_must $ZPOOL import -d $DEVICE_DIR -D -f $target
-log_must $ZPOOL destroy $TESTPOOL1
+log_must zpool create $TESTPOOL2 $VDEV0 $VDEV2
+log_must zpool import -d $DEVICE_DIR -D -f $target
+log_must zpool destroy $TESTPOOL1
 
-log_must $ZPOOL destroy $TESTPOOL2
-log_must $RM -rf $VDEV2
-log_must $ZPOOL import -d $DEVICE_DIR -D -f $target
+log_must zpool destroy $TESTPOOL2
+log_must rm -rf $VDEV2
+log_must zpool import -d $DEVICE_DIR -D -f $target
 
 log_pass "zpool import -D mirror passed."
index ec7a8672d3a9ae21dddea662a53899bf3bb88eb3..6e93fd4711717e4f4b53aa1a72462d8ddf380a68 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -51,10 +51,10 @@ function cleanup
        destroy_pool $TESTPOOL2
        destroy_pool $TESTPOOL1
 
-       log_must $RM -rf $DEVICE_DIR/*
+       log_must rm -rf $DEVICE_DIR/*
        typeset i=0
        while (( i < $MAX_NUM )); do
-               log_must $MKFILE $FILE_SIZE ${DEVICE_DIR}/${DEVICE_FILE}$i
+               log_must mkfile $FILE_SIZE ${DEVICE_DIR}/${DEVICE_FILE}$i
                ((i += 1))
        done
 }
@@ -63,28 +63,28 @@ log_assert "For raidz, one destroyed pools devices was removed or used by " \
        "other pool, it still can be imported correctly."
 log_onexit cleanup
 
-log_must $ZPOOL create $TESTPOOL1 raidz $VDEV0 $VDEV1 $VDEV2 $VDIV3
+log_must zpool create $TESTPOOL1 raidz $VDEV0 $VDEV1 $VDEV2 $VDIV3
 typeset guid=$(get_config $TESTPOOL1 pool_guid)
 typeset target=$TESTPOOL1
 if (( RANDOM % 2 == 0 )) ; then
        target=$guid
        log_note "Import by guid."
 fi
-log_must $ZPOOL destroy $TESTPOOL1
+log_must zpool destroy $TESTPOOL1
 
-log_must $ZPOOL create $TESTPOOL2 $VDEV0
-log_must $ZPOOL import -d $DEVICE_DIR -D -f $target
-log_must $ZPOOL destroy $TESTPOOL1
+log_must zpool create $TESTPOOL2 $VDEV0
+log_must zpool import -d $DEVICE_DIR -D -f $target
+log_must zpool destroy $TESTPOOL1
 
-log_must $ZPOOL destroy $TESTPOOL2
-log_must $RM -rf $VDEV0
-log_must $ZPOOL import -d $DEVICE_DIR -D -f $target
-log_must $ZPOOL destroy $TESTPOOL1
+log_must zpool destroy $TESTPOOL2
+log_must rm -rf $VDEV0
+log_must zpool import -d $DEVICE_DIR -D -f $target
+log_must zpool destroy $TESTPOOL1
 
 log_note "For raidz, two destroyed pool's devices were used, import failed."
-log_must $MKFILE $FILE_SIZE $VDEV0
-log_must $ZPOOL create $TESTPOOL2 $VDEV0 $VDEV1
-log_mustnot $ZPOOL import -d $DEVICE_DIR -D -f $target
-log_must $ZPOOL destroy $TESTPOOL2
+log_must mkfile $FILE_SIZE $VDEV0
+log_must zpool create $TESTPOOL2 $VDEV0 $VDEV1
+log_mustnot zpool import -d $DEVICE_DIR -D -f $target
+log_must zpool destroy $TESTPOOL2
 
 log_pass "zpool import -D raidz passed."
index 45d76b369b528a99ad7e0581a32cc67e5cbd90f1..096bbe8114ac1baafd67c414a850a458febd4cab 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -51,10 +51,10 @@ function cleanup
        destroy_pool $TESTPOOL2
        destroy_pool $TESTPOOL1
 
-       log_must $RM -rf $DEVICE_DIR/*
+       log_must rm -rf $DEVICE_DIR/*
        typeset i=0
        while (( i < $MAX_NUM )); do
-               log_must $MKFILE $FILE_SIZE ${DEVICE_DIR}/${DEVICE_FILE}$i
+               log_must mkfile $FILE_SIZE ${DEVICE_DIR}/${DEVICE_FILE}$i
                ((i += 1))
        done
 }
@@ -63,29 +63,29 @@ log_assert "For raidz2, two destroyed pools devices was removed or used by " \
        "other pool, it still can be imported correctly."
 log_onexit cleanup
 
-log_must $ZPOOL create $TESTPOOL1 raidz2 $VDEV0 $VDEV1 $VDEV2 $VDIV3
+log_must zpool create $TESTPOOL1 raidz2 $VDEV0 $VDEV1 $VDEV2 $VDIV3
 typeset guid=$(get_config $TESTPOOL1 pool_guid)
 typeset target=$TESTPOOL1
 if (( RANDOM % 2 == 0 )) ; then
        target=$guid
        log_note "Import by guid."
 fi
-log_must $ZPOOL destroy $TESTPOOL1
+log_must zpool destroy $TESTPOOL1
 
-log_must $ZPOOL create $TESTPOOL2 $VDEV0 $VDEV1
-log_must $ZPOOL import -d $DEVICE_DIR -D -f $target
-log_must $ZPOOL destroy $TESTPOOL1
+log_must zpool create $TESTPOOL2 $VDEV0 $VDEV1
+log_must zpool import -d $DEVICE_DIR -D -f $target
+log_must zpool destroy $TESTPOOL1
 
-log_must $ZPOOL destroy $TESTPOOL2
-log_must $RM -rf $VDEV0 $VDEV1
-log_must $ZPOOL import -d $DEVICE_DIR -D -f $target
-log_must $ZPOOL destroy $TESTPOOL1
+log_must zpool destroy $TESTPOOL2
+log_must rm -rf $VDEV0 $VDEV1
+log_must zpool import -d $DEVICE_DIR -D -f $target
+log_must zpool destroy $TESTPOOL1
 
 log_note "For raidz2, more than two destroyed pool's devices were used, " \
        "import failed."
-log_must $MKFILE $FILE_SIZE $VDEV0 $VDEV1
-log_must $ZPOOL create $TESTPOOL2 $VDEV0 $VDEV1 $VDEV2
-log_mustnot $ZPOOL import -d $DEVICE_DIR -D -f $target
-log_must $ZPOOL destroy $TESTPOOL2
+log_must mkfile $FILE_SIZE $VDEV0 $VDEV1
+log_must zpool create $TESTPOOL2 $VDEV0 $VDEV1 $VDEV2
+log_mustnot zpool import -d $DEVICE_DIR -D -f $target
+log_must zpool destroy $TESTPOOL2
 
 log_pass "zpool import -D raidz2 passed."
index a572ba00a64209fcec0c30f6bf375786e6d06974..e7886ef3c8590fa51018d8e941c0ee700760c819 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -68,13 +68,13 @@ function cleanup
        while (( i < ${#pools[*]} )); do
 
                poolexists ${pools[i]} && \
-                       log_must $ZPOOL export ${pools[i]}
+                       log_must zpool export ${pools[i]}
 
                datasetexists "${pools[i]}/$TESTFS" || \
-                       log_must $ZPOOL import ${devs[i]} ${pools[i]}
+                       log_must zpool import ${devs[i]} ${pools[i]}
 
                ismounted "${pools[i]}/$TESTFS" || \
-                       log_must $ZFS mount ${pools[i]}/$TESTFS
+                       log_must zfs mount ${pools[i]}/$TESTFS
 
                ((i = i + 1))
        done
@@ -91,11 +91,11 @@ log_assert "Badly-formed 'zpool import' with inapplicable scenarios " \
 
 setup_filesystem "$DEVICE_FILES" $TESTPOOL1 $TESTFS $TESTDIR1
 
-log_must $ZPOOL export $TESTPOOL
+log_must zpool export $TESTPOOL
 
 typeset -i i=0
 while (( i < ${#args[*]} )); do
-       log_mustnot $ZPOOL import ${args[i]}
+       log_mustnot zpool import ${args[i]}
        ((i = i + 1))
 done
 
index 23d7f916f36ad036762b6d9a55ce77ca078b191b..b337bd00f1e53d9da964e3eb075fbad7ccdf32de 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -54,10 +54,10 @@ function cleanup
                destroy_pool $dt
        done
 
-       log_must $RM -rf $DEVICE_DIR/*
+       log_must rm -rf $DEVICE_DIR/*
        typeset i=0
        while (( i < $MAX_NUM )); do
-               log_must $MKFILE $FILE_SIZE ${DEVICE_DIR}/${DEVICE_FILE}$i
+               log_must mkfile $FILE_SIZE ${DEVICE_DIR}/${DEVICE_FILE}$i
                ((i += 1))
        done
 }
@@ -68,22 +68,22 @@ log_onexit cleanup
 
 poolA=poolA.$$; poolB=poolB.$$; poolC=poolC.$$; poolD=poolD.$$; poolE=poolE.$$
 
-log_must $ZPOOL create $poolA mirror $VDEV0 $VDEV1 $VDEV2 $VDEV3 $VDEV4
-log_must $ZPOOL destroy $poolA
+log_must zpool create $poolA mirror $VDEV0 $VDEV1 $VDEV2 $VDEV3 $VDEV4
+log_must zpool destroy $poolA
 
-log_must $ZPOOL create $poolB $VDEV1
-log_must $ZPOOL destroy $poolB
+log_must zpool create $poolB $VDEV1
+log_must zpool destroy $poolB
 
-log_must $ZPOOL create $poolC raidz2 $VDEV2 $VDEV3 $VDEV4
-log_must $ZPOOL destroy $poolC
+log_must zpool create $poolC raidz2 $VDEV2 $VDEV3 $VDEV4
+log_must zpool destroy $poolC
 
-log_must $ZPOOL create $poolD raidz $VDEV3 $VDEV4
-log_must $ZPOOL destroy $poolD
+log_must zpool create $poolD raidz $VDEV3 $VDEV4
+log_must zpool destroy $poolD
 
-log_must $ZPOOL create $poolE $VDEV4
-log_must $ZPOOL destroy $poolE
+log_must zpool create $poolE $VDEV4
+log_must zpool destroy $poolE
 
-log_must $ZPOOL import -d $DEVICE_DIR -D -f -a
+log_must zpool import -d $DEVICE_DIR -D -f -a
 
 for dt in $poolA $poolB $poolC $poolD $poolE; do
        log_must datasetexists $dt
index fbc6e6d27a26c05770845aaf65abd68d87da0ac0..b54168941722a310dc82c527a849967b34351e4f 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -55,27 +55,27 @@ function cleanup
        #
        # Recreate virtual devices to avoid destroyed pool information on files.
        #
-       log_must $RM -rf $VDEV0 $VDEV1 $VDEV2
-       log_must $MKFILE $FILE_SIZE $VDEV0 $VDEV1 $VDEV2
+       log_must rm -rf $VDEV0 $VDEV1 $VDEV2
+       log_must mkfile $FILE_SIZE $VDEV0 $VDEV1 $VDEV2
 }
 
 log_assert "For strip pool, any destroyed pool devices was demaged," \
        "zpool import -D will failed."
 log_onexit cleanup
 
-log_must $ZPOOL create $TESTPOOL1 $VDEV0 $VDEV1 $VDEV2
+log_must zpool create $TESTPOOL1 $VDEV0 $VDEV1 $VDEV2
 typeset guid=$(get_config $TESTPOOL1 pool_guid)
 typeset target=$TESTPOOL1
 if (( RANDOM % 2 == 0 )) ; then
        target=$guid
        log_note "Import by guid."
 fi
-log_must $ZPOOL destroy $TESTPOOL1
-log_must $ZPOOL create $TESTPOOL2 $VDEV2
+log_must zpool destroy $TESTPOOL1
+log_must zpool create $TESTPOOL2 $VDEV2
 
-log_mustnot $ZPOOL import -d $DEVICE_DIR -D -f $target
+log_mustnot zpool import -d $DEVICE_DIR -D -f $target
 
-log_must $ZPOOL destroy $TESTPOOL2
-log_mustnot $ZPOOL import -d $DEVICE_DIR -D -f $target
+log_must zpool destroy $TESTPOOL2
+log_mustnot zpool import -d $DEVICE_DIR -D -f $target
 
 log_pass "Any strip pool devices damaged, pool can't be import passed."
index bdc499cca7dd55b7dd1b78814d0eb9b3dd23b3a2..53d6fd3052c0410491763b9e4ad5c9795787df82 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -63,20 +63,20 @@ function cleanup
 
        while ((i < ${#pools[*]})); do
                if poolexists ${pools[i]}; then
-                       log_must $ZPOOL export ${pools[i]}
+                       log_must zpool export ${pools[i]}
                        log_note "Try to import ${devs[i]} ${pools[i]}"
-                       $ZPOOL import ${devs[i]} ${pools[i]}
+                       zpool import ${devs[i]} ${pools[i]}
                else
                        log_note "Try to import $option ${devs[i]} ${pools[i]}"
-                       $ZPOOL import $option ${devs[i]} ${pools[i]}
+                       zpool import $option ${devs[i]} ${pools[i]}
                fi
 
                if poolexists ${pools[i]}; then
                        is_shared ${pools[i]} && \
-                           log_must $ZFS set sharenfs=off ${pools[i]}
+                           log_must zfs set sharenfs=off ${pools[i]}
 
                        ismounted "${pools[i]}/$TESTFS" || \
-                           log_must $ZFS mount ${pools[i]}/$TESTFS
+                           log_must zfs mount ${pools[i]}/$TESTFS
                fi
 
                ((i = i + 1))
@@ -85,13 +85,13 @@ function cleanup
        destroy_pool $TESTPOOL1
 
        if datasetexists $TESTPOOL/$TESTFS; then
-               log_must $ZFS destroy -Rf $TESTPOOL/$TESTFS
+               log_must zfs destroy -Rf $TESTPOOL/$TESTFS
        fi
-       log_must $ZFS create $TESTPOOL/$TESTFS
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       log_must zfs create $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 
        [[ -d $ALTER_ROOT ]] && \
-               log_must $RM -rf $ALTER_ROOT
+               log_must rm -rf $ALTER_ROOT
 }
 
 log_onexit cleanup
@@ -102,15 +102,15 @@ log_assert "Verify all mount & share status of sub-filesystems within a pool \
 setup_filesystem "$DEVICE_FILES" $TESTPOOL1 $TESTFS $TESTDIR1
 # create a hierarchy of filesystem
 for pool in ${pools[@]} ; do
-       log_must $ZFS create $pool/$TESTFS/$TESTCTR
-       log_must $ZFS create $pool/$TESTFS/$TESTCTR/$TESTCTR1
-       log_must $ZFS set canmount=off $pool/$TESTFS/$TESTCTR
-       log_must $ZFS set canmount=off $pool/$TESTFS/$TESTCTR/$TESTCTR1
-       log_must $ZFS create $pool/$TESTFS/$TESTCTR/$TESTFS1
-       log_must $ZFS create $pool/$TESTFS/$TESTCTR/$TESTCTR1/$TESTFS1
-       log_must $ZFS create $pool/$TESTFS/$TESTFS1
-       log_must $ZFS snapshot $pool/$TESTFS/$TESTFS1@snap
-       log_must $ZFS clone $pool/$TESTFS/$TESTFS1@snap $pool/$TESTCLONE1
+       log_must zfs create $pool/$TESTFS/$TESTCTR
+       log_must zfs create $pool/$TESTFS/$TESTCTR/$TESTCTR1
+       log_must zfs set canmount=off $pool/$TESTFS/$TESTCTR
+       log_must zfs set canmount=off $pool/$TESTFS/$TESTCTR/$TESTCTR1
+       log_must zfs create $pool/$TESTFS/$TESTCTR/$TESTFS1
+       log_must zfs create $pool/$TESTFS/$TESTCTR/$TESTCTR1/$TESTFS1
+       log_must zfs create $pool/$TESTFS/$TESTFS1
+       log_must zfs snapshot $pool/$TESTFS/$TESTFS1@snap
+       log_must zfs clone $pool/$TESTFS/$TESTFS1@snap $pool/$TESTCLONE1
 done
 
 typeset mount_fs="$TESTFS $TESTFS/$TESTFS1 $TESTCLONE1 \
@@ -137,7 +137,7 @@ for option in "" "-Df"; do
                                typeset nfs_flag="sharenfs=off"
                                if ((nfs_share_bit == 1)); then
                                        log_note "Set sharenfs=on $pool"
-                                       log_must $ZFS set sharenfs=on $pool
+                                       log_must zfs set sharenfs=on $pool
                                        log_must is_shared $pool
                                        f_share="true"
                                        nfs_flag="sharenfs=on"
@@ -147,9 +147,9 @@ for option in "" "-Df"; do
                                while ((guid_bit <= 1)); do
                                        typeset guid_flag="pool name"
                                        if [[ -z $option ]]; then
-                                               log_must $ZPOOL export $pool
+                                               log_must zpool export $pool
                                        else
-                                               log_must $ZPOOL destroy $pool
+                                               log_must zpool destroy $pool
                                        fi
 
                                        typeset target=$pool
@@ -165,14 +165,14 @@ for option in "" "-Df"; do
                                        fi
                                        log_note "Import with $nfs_flag and " \
                                            "$guid_flag"
-                                       $ZPOOL import $option ${devs[i]} \
+                                       zpool import $option ${devs[i]} \
                                            ${options[j]} $target
                                        #import by GUID if import by pool name fails
                                        if [[ $? != 0 ]]; then
                                                log_note "Possible pool name" \
                                                    "duplicates. Try GUID import"
                                                target=$guid
-                                               log_must $ZPOOL import $option \
+                                               log_must zpool import $option \
                                                    ${devs[i]} ${options[j]} \
                                                    $target
                                        fi
@@ -192,7 +192,7 @@ for option in "" "-Df"; do
                                done
                                # reset nfsshare=off
                                if [[ -n $f_share ]]; then
-                                       log_must $ZFS set sharenfs=off $pool
+                                       log_must zfs set sharenfs=off $pool
                                        log_mustnot is_shared $pool
                                fi
                                ((nfs_share_bit = nfs_share_bit + 1))
index f81738c4fae8adb7aadf97a208d36b7038fd5bfa..c2863e416bb26f026ac82c248b2d0387b8a397af 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,7 +52,7 @@ function uncompress_pool
 {
 
        log_note "Creating pool from $POOL_FILE"
-       log_must $BZCAT \
+       log_must bzcat \
            $STF_SUITE/tests/functional/cli_root/zpool_import/$POOL_FILE.bz2 \
            > /$TESTPOOL/$POOL_FILE
        return 0
@@ -60,8 +60,8 @@ function uncompress_pool
 
 function cleanup
 {
-       poolexists $POOL_NAME && log_must $ZPOOL destroy $POOL_NAME
-       [[ -e /$TESTPOOL/$POOL_FILE ]] && $RM /$TESTPOOL/$POOL_FILE
+       poolexists $POOL_NAME && log_must zpool destroy $POOL_NAME
+       [[ -e /$TESTPOOL/$POOL_FILE ]] && rm /$TESTPOOL/$POOL_FILE
        return 0
 }
 
@@ -69,7 +69,7 @@ log_assert "'zpool import' fails for pool that was not cleanly exported"
 log_onexit cleanup
 
 uncompress_pool
-log_mustnot $ZPOOL import -d /$TESTPOOL $POOL_NAME
-log_must $ZPOOL import -d /$TESTPOOL -f $POOL_NAME
+log_mustnot zpool import -d /$TESTPOOL $POOL_NAME
+log_must zpool import -d /$TESTPOOL -f $POOL_NAME
 
 log_pass "'zpool import' fails for pool that was not cleanly exported"
index 8a5c6553fd4ee128f7c1a1403bedda9dd3d55abe..d70bced265f314f857ca1553a80e85525a36a158 100755 (executable)
@@ -46,10 +46,10 @@ function cleanup
                destroy_pool $dt
        done
 
-       log_must $RM -rf $DEVICE_DIR/*
+       log_must rm -rf $DEVICE_DIR/*
        typeset i=0
        while (( i < $MAX_NUM )); do
-               log_must $MKFILE $FILE_SIZE ${DEVICE_DIR}/${DEVICE_FILE}$i
+               log_must mkfile $FILE_SIZE ${DEVICE_DIR}/${DEVICE_FILE}$i
                ((i += 1))
        done
 }
@@ -65,7 +65,7 @@ function verify_pool_name
        typeset poolname=$2
        typeset labelname
 
-       $ZDB -e -l $device | $GREP " name:" | {
+       zdb -e -l $device | grep " name:" | {
                while read labelname ; do
                        if [[ "name: '$poolname'" != "$labelname" ]]; then
                                return 1
@@ -80,11 +80,11 @@ log_onexit cleanup
 
 poolA=poolA.$$; poolB=poolB.$$;
 
-log_must $ZPOOL create $poolA $VDEV0
-log_must $ZPOOL export $poolA
+log_must zpool create $poolA $VDEV0
+log_must zpool export $poolA
 
-log_must $ZPOOL import -t $poolA $poolB -d $DEVICE_DIR
-log_must $ZPOOL export $poolB
+log_must zpool import -t $poolA $poolB -d $DEVICE_DIR
+log_must zpool export $poolB
 
 log_must eval "verify_pool_name $VDEV0 $poolA"
 
index 6b83935ca35c1a3d8f5fab5041b73bd7a1a625ef..f07cf8a52468801dd093c957b869d191617d1e4d 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -63,12 +63,12 @@ function setup_single_disk #disk #pool #fs #mtpt
 
        setup_filesystem "$disk" "$pool" "$fs" "$mtpt"
 
-       log_must $CP $MYTESTFILE $mtpt/$TESTFILE0
+       log_must cp $MYTESTFILE $mtpt/$TESTFILE0
 
-       log_must $ZPOOL export $pool
+       log_must zpool export $pool
 
        [[ -d $mtpt ]] && \
-               $RM -rf $mtpt
+               rm -rf $mtpt
 }
 
 function cleanup_all
@@ -78,12 +78,12 @@ function cleanup_all
        #
        # Try import individually if 'import -a' failed.
        #
-       for pool in `$ZPOOL import | $GREP "pool:" | $AWK '{print $2}'`; do
-               $ZPOOL import -f $pool
+       for pool in `zpool import | grep "pool:" | awk '{print $2}'`; do
+               zpool import -f $pool
        done
 
-       for pool in `$ZPOOL import -d $DEVICE_DIR | $GREP "pool:" | $AWK '{print $2}'`; do
-               log_must $ZPOOL import -d $DEVICE_DIR -f $pool
+       for pool in `zpool import -d $DEVICE_DIR | grep "pool:" | awk '{print $2}'`; do
+               log_must zpool import -d $DEVICE_DIR -f $pool
        done
 
        while (( id < number )); do
@@ -93,15 +93,15 @@ function cleanup_all
                fi
 
                if (( id == 0 )); then
-                       log_must $ZPOOL export ${TESTPOOL}-$id
+                       log_must zpool export ${TESTPOOL}-$id
 
                        [[ -d /${TESTPOOL}-$id ]] && \
-                               log_must $RM -rf /${TESTPOOL}-$id
+                               log_must rm -rf /${TESTPOOL}-$id
 
-                       log_must $ZPOOL import -f ${TESTPOOL}-$id $TESTPOOL
+                       log_must zpool import -f ${TESTPOOL}-$id $TESTPOOL
 
                        [[ -e $TESTDIR/$TESTFILE0 ]] && \
-                               log_must $RM -rf $TESTDIR/$TESTFILE0
+                               log_must rm -rf $TESTDIR/$TESTFILE0
                else
                        cleanup_filesystem "${TESTPOOL}-$id" $TESTFS
 
@@ -112,7 +112,7 @@ function cleanup_all
         done
 
        [[ -d $ALTER_ROOT ]] && \
-               $RM -rf $ALTER_ROOT
+               rm -rf $ALTER_ROOT
 }
 
 function checksum_all #alter_root
@@ -136,7 +136,7 @@ function checksum_all #alter_root
                [[ ! -e $file ]] && \
                        log_fail "$file missing after import."
 
-               checksum2=$($SUM $file | $AWK '{print $1}')
+               checksum2=$(sum $file | awk '{print $1}')
                [[ "$checksum1" != "$checksum2" ]] && \
                        log_fail "Checksums differ ($checksum1 != $checksum2)"
 
@@ -151,14 +151,14 @@ log_assert "Verify that 'zpool import -a' succeeds as root."
 
 log_onexit cleanup_all
 
-checksum1=$($SUM $MYTESTFILE | $AWK '{print $1}')
+checksum1=$(sum $MYTESTFILE | awk '{print $1}')
 
-log_must $ZPOOL export $TESTPOOL
-log_must $ZPOOL import $TESTPOOL ${TESTPOOL}-0
-log_must $CP $MYTESTFILE $TESTDIR/$TESTFILE0
-log_must $ZPOOL export ${TESTPOOL}-0
+log_must zpool export $TESTPOOL
+log_must zpool import $TESTPOOL ${TESTPOOL}-0
+log_must cp $MYTESTFILE $TESTDIR/$TESTFILE0
+log_must zpool export ${TESTPOOL}-0
 [[ -d /${TESTPOOL}-0 ]] && \
-       log_must $RM -rf /${TESTPOOL}-0
+       log_must rm -rf /${TESTPOOL}-0
 
 #
 # setup exported pools on normal devices
@@ -194,13 +194,13 @@ done
 
 while (( i < ${#options[*]} )); do
 
-       log_must $ZPOOL import -d ${DEV_DSKDIR} -d $DEVICE_DIR ${options[i]} -a -f
+       log_must zpool import -d ${DEV_DSKDIR} -d $DEVICE_DIR ${options[i]} -a -f
 
        # destroy unintentional imported pools
-       typeset exclude=`eval $ECHO \"'(${KEEP})'\"`
-       for unwantedpool in $($ZPOOL list -H -o name \
-            | $EGREP -v "$exclude" | $GREP -v $TESTPOOL); do
-               log_must $ZPOOL export $unwantedpool
+       typeset exclude=`eval echo \"'(${KEEP})'\"`
+       for unwantedpool in $(zpool list -H -o name \
+            | egrep -v "$exclude" | grep -v $TESTPOOL); do
+               log_must zpool export $unwantedpool
        done
 
        if [[ -n ${options[i]} ]]; then
@@ -212,7 +212,7 @@ while (( i < ${#options[*]} )); do
        id=0
        while (( id < number )); do
                if poolexists ${TESTPOOL}-$id ; then
-                       log_must $ZPOOL export ${TESTPOOL}-$id
+                       log_must zpool export ${TESTPOOL}-$id
                fi
                (( id = id + 1 ))
        done
index ea71acfd2cbd680fff7b37b27fefefd62466a834..973efb7acf3c0593bfedf2d2eedd98e038934242 100755 (executable)
@@ -21,7 +21,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -46,23 +46,23 @@ function cleanup
 {
        poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1
 
-       log_must $RM $VDEV0
-       log_must $MKFILE $FILE_SIZE $VDEV0
+       log_must rm $VDEV0
+       log_must mkfile $FILE_SIZE $VDEV0
 }
 
 log_assert "Pool with inactive unsupported features can be imported."
 log_onexit cleanup
 
-log_must $ZPOOL create $TESTPOOL1 $VDEV0
-log_must $ZPOOL export $TESTPOOL1
+log_must zpool create $TESTPOOL1 $VDEV0
+log_must zpool export $TESTPOOL1
 
 for feature in $features; do
-       log_must $ZHACK -d $DEVICE_DIR feature enable $TESTPOOL1 $feature
+       log_must zhack -d $DEVICE_DIR feature enable $TESTPOOL1 $feature
 done
 
-log_must $ZPOOL import -d $DEVICE_DIR $TESTPOOL1
+log_must zpool import -d $DEVICE_DIR $TESTPOOL1
 for feature in $features; do
-       state=$($ZPOOL list -Ho unsupported@$feature $TESTPOOL1)
+       state=$(zpool list -Ho unsupported@$feature $TESTPOOL1)
         if [[ "$state" != "inactive" ]]; then
                log_fail "unsupported@$feature is '$state'"
         fi
index 26b99f07a7d6ff5ae1382744bd15d28de2b6ca70..d16ef217a444ad9902f6ed6b01c203abfced2687 100755 (executable)
@@ -21,7 +21,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,39 +48,39 @@ function cleanup
 {
        poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1
 
-       log_must $RM $VDEV0
-       log_must $MKFILE $FILE_SIZE $VDEV0
+       log_must rm $VDEV0
+       log_must mkfile $FILE_SIZE $VDEV0
 }
 
 log_assert "Pool with active unsupported features cannot be imported."
 log_onexit cleanup
 
-log_must $ZPOOL create $TESTPOOL1 $VDEV0
-log_must $ZPOOL export $TESTPOOL1
+log_must zpool create $TESTPOOL1 $VDEV0
+log_must zpool export $TESTPOOL1
 
 for feature in $enabled_features $active_features; do
-       log_must $ZHACK -d $DEVICE_DIR feature enable $TESTPOOL1 $feature
+       log_must zhack -d $DEVICE_DIR feature enable $TESTPOOL1 $feature
 done
 
 for feature in $active_features; do
-       log_must $ZHACK -d $DEVICE_DIR feature ref $TESTPOOL1 $feature
+       log_must zhack -d $DEVICE_DIR feature ref $TESTPOOL1 $feature
 done
 
-log_mustnot $ZPOOL import -d $DEVICE_DIR $TESTPOOL1
+log_mustnot zpool import -d $DEVICE_DIR $TESTPOOL1
 
 # error message should not mention "readonly"
-log_mustnot eval "$ZPOOL import -d $DEVICE_DIR $TESTPOOL1 | $GREP readonly"
+log_mustnot eval "zpool import -d $DEVICE_DIR $TESTPOOL1 | grep readonly"
 log_mustnot poolexists $TESTPOOL1
 
 for feature in $active_features; do
-       log_must eval "$ZPOOL import -d $DEVICE_DIR $TESTPOOL1 \
-           | $GREP $feature"
+       log_must eval "zpool import -d $DEVICE_DIR $TESTPOOL1 \
+           | grep $feature"
        log_mustnot poolexists $TESTPOOL1
 done
 
 for feature in $enabled_features; do
-       log_mustnot eval "$ZPOOL import -d $DEVICE_DIR $TESTPOOL1 \
-           | $GREP $feature"
+       log_mustnot eval "zpool import -d $DEVICE_DIR $TESTPOOL1 \
+           | grep $feature"
        log_mustnot poolexists $TESTPOOL1
 done
 
index 3f0ea63d62866e066125c24db09ba5efad360390..e92c95f54c529061cbc76d6f36244047cd05a139 100755 (executable)
@@ -21,7 +21,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -51,53 +51,53 @@ function cleanup
 {
        poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1
 
-       log_must $RM $VDEV0
-       log_must $MKFILE $FILE_SIZE $VDEV0
+       log_must rm $VDEV0
+       log_must mkfile $FILE_SIZE $VDEV0
 }
 
 log_assert "Pool with active read-only compatible features can be imported."
 log_onexit cleanup
 
-log_must $ZPOOL create $TESTPOOL1 $VDEV0
-log_must $ZPOOL export $TESTPOOL1
+log_must zpool create $TESTPOOL1 $VDEV0
+log_must zpool export $TESTPOOL1
 
 for feature in $enabled_features $active_features; do
-       log_must $ZHACK -d $DEVICE_DIR feature enable -r $TESTPOOL1 $feature
+       log_must zhack -d $DEVICE_DIR feature enable -r $TESTPOOL1 $feature
 done
 
 for feature in $active_features; do
-       log_must $ZHACK -d $DEVICE_DIR feature ref $TESTPOOL1 $feature
+       log_must zhack -d $DEVICE_DIR feature ref $TESTPOOL1 $feature
 done
 
-log_mustnot $ZPOOL import -d $DEVICE_DIR $TESTPOOL1
+log_mustnot zpool import -d $DEVICE_DIR $TESTPOOL1
 
 # error message should mention "readonly"
-log_must eval "$ZPOOL import -d $DEVICE_DIR $TESTPOOL1 | $GREP readonly"
+log_must eval "zpool import -d $DEVICE_DIR $TESTPOOL1 | grep readonly"
 log_mustnot poolexists $TESTPOOL1
 
 for feature in $enabled_features; do
-       log_mustnot eval "$ZPOOL import -d $DEVICE_DIR $TESTPOOL1 \
-           | $GREP $feature"
+       log_mustnot eval "zpool import -d $DEVICE_DIR $TESTPOOL1 \
+           | grep $feature"
        log_mustnot poolexists $TESTPOOL1
 done
 
 for feature in $active_features; do
-       log_must eval "$ZPOOL import -d $DEVICE_DIR $TESTPOOL1 \
-           | $GREP $feature"
+       log_must eval "zpool import -d $DEVICE_DIR $TESTPOOL1 \
+           | grep $feature"
        log_mustnot poolexists $TESTPOOL1
 done
 
-log_must $ZPOOL import -o readonly=on -d $DEVICE_DIR $TESTPOOL1
+log_must zpool import -o readonly=on -d $DEVICE_DIR $TESTPOOL1
 
 for feature in $enabled_features; do
-       state=$($ZPOOL list -Ho unsupported@$feature $TESTPOOL1)
+       state=$(zpool list -Ho unsupported@$feature $TESTPOOL1)
         if [[ "$state" != "inactive" ]]; then
                log_fail "unsupported@$feature is '$state'"
         fi
 done
 
 for feature in $active_features; do
-       state=$($ZPOOL list -Ho unsupported@$feature $TESTPOOL1)
+       state=$(zpool list -Ho unsupported@$feature $TESTPOOL1)
         if [[ "$state" != "readonly" ]]; then
                log_fail "unsupported@$feature is '$state'"
         fi
index d0447596b3d63012c435e44794d69c452ea5f550..78e9bbf689d0970b4caf50612eb449f240b1ce2c 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -76,7 +76,7 @@ function cleanup
        recreate_files
 
        [[ -d $ALTER_ROOT ]] && \
-               log_must $RM -rf $ALTER_ROOT
+               log_must rm -rf $ALTER_ROOT
 }
 
 function recreate_files
@@ -86,10 +86,10 @@ function recreate_files
                destroy_pool $TESTPOOL1
        fi
 
-       log_must $RM -rf $DEVICE_DIR/*
+       log_must rm -rf $DEVICE_DIR/*
        typeset i=0
        while (( i < $MAX_NUM )); do
-               log_must $MKFILE $FILE_SIZE ${DEVICE_DIR}/${DEVICE_FILE}$i
+               log_must mkfile $FILE_SIZE ${DEVICE_DIR}/${DEVICE_FILE}$i
                ((i += 1))
        done
 }
@@ -101,7 +101,7 @@ log_assert "Verify that import could handle damaged or missing device."
 CWD=$PWD
 cd $DEVICE_DIR || log_fail "Unable change directory to $DEVICE_DIR"
 
-checksum1=$($SUM $MYTESTFILE | $AWK '{print $1}')
+checksum1=$(sum $MYTESTFILE | awk '{print $1}')
 
 typeset -i i=0
 typeset -i j=0
@@ -117,9 +117,9 @@ while (( i < ${#vdevs[*]} )); do
        backup=""
 
        guid=$(get_config $TESTPOOL1 pool_guid)
-       log_must $CP $MYTESTFILE $TESTDIR1/$TESTFILE0
+       log_must cp $MYTESTFILE $TESTDIR1/$TESTFILE0
 
-       log_must $ZFS umount $TESTDIR1
+       log_must zfs umount $TESTDIR1
 
        j=0
        while (( j <  ${#options[*]} )); do
@@ -131,19 +131,19 @@ while (( i < ${#vdevs[*]} )); do
                # Restore all device files.
                #
                [[ -n $backup ]] && \
-                       log_must $TAR xf $DEVICE_DIR/$DEVICE_ARCHIVE
+                       log_must tar xf $DEVICE_DIR/$DEVICE_ARCHIVE
 
                for device in $DEVICE_FILES ; do
-                       log_must $RM -f $device
+                       log_must rm -f $device
 
                        poolexists $TESTPOOL1 && \
-                               log_must $ZPOOL export $TESTPOOL1
+                               log_must zpool export $TESTPOOL1
 
                        #
                        # Backup all device files while filesystem prepared.
                        #
                        if [[ -z $backup ]]; then
-                               log_must $TAR cf $DEVICE_DIR/$DEVICE_ARCHIVE \
+                               log_must tar cf $DEVICE_DIR/$DEVICE_ARCHIVE \
                                        ${DEVICE_FILE}*
                                backup="true"
                        fi
@@ -166,14 +166,14 @@ while (( i < ${#vdevs[*]} )); do
                                target=$guid
                                log_note "Import by guid."
                        fi
-                       $action $ZPOOL import \
+                       $action zpool import \
                                -d $DEVICE_DIR ${options[j]} $target
 
                        [[ $action == "log_mustnot" ]] && continue
 
                        log_must poolexists $TESTPOOL1
 
-                       health=$($ZPOOL list -H -o health $TESTPOOL1)
+                       health=$(zpool list -H -o health $TESTPOOL1)
 
                        [[ $health == "DEGRADED" ]] || \
                                log_fail "$TESTPOOL1: Incorrect health($health)"
@@ -186,7 +186,7 @@ while (( i < ${#vdevs[*]} )); do
                        [[ ! -e $basedir/$TESTFILE0 ]] && \
                                log_fail "$basedir/$TESTFILE0 missing after import."
 
-                       checksum2=$($SUM $basedir/$TESTFILE0 | $AWK '{print $1}')
+                       checksum2=$(sum $basedir/$TESTFILE0 | awk '{print $1}')
                        [[ "$checksum1" != "$checksum2" ]] && \
                                log_fail "Checksums differ ($checksum1 != $checksum2)"
 
index 36fbe447e5a1a8bb6944d7b753153547d141ddad..7534ebca87fe9ceecefba4d469ba25575a5c7b79 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -69,10 +69,10 @@ function cleanup
 {
        cd $DEVICE_DIR || log_fail "Unable change directory to $DEVICE_DIR"
        [[ -e $DEVICE_DIR/$DEVICE_ARCHIVE ]] && \
-               log_must $TAR xf $DEVICE_DIR/$DEVICE_ARCHIVE
+               log_must tar xf $DEVICE_DIR/$DEVICE_ARCHIVE
 
        poolexists $TESTPOOL1 || \
-               log_must $ZPOOL import -d $DEVICE_DIR $TESTPOOL1
+               log_must zpool import -d $DEVICE_DIR $TESTPOOL1
 
        cleanup_filesystem $TESTPOOL1 $TESTFS
 
@@ -88,19 +88,19 @@ function cleanup_all
        while (( i < $MAX_NUM )); do
                typeset dev_file=${DEVICE_DIR}/${DEVICE_FILE}$i
                if [[ ! -e ${dev_file} ]]; then
-                       log_must $MKFILE $FILE_SIZE ${dev_file}
+                       log_must mkfile $FILE_SIZE ${dev_file}
                fi
                ((i += 1))
        done
 
-       log_must $RM -f $DEVICE_DIR/$DEVICE_ARCHIVE
+       log_must rm -f $DEVICE_DIR/$DEVICE_ARCHIVE
        cd $CWD || log_fail "Unable change directory to $CWD"
 
        [[ -d $ALTER_ROOT ]] && \
-               log_must $RM -rf $ALTER_ROOT
+               log_must rm -rf $ALTER_ROOT
 
        [[ -d $BACKUP_DEVICE_DIR ]] && \
-               log_must $RM -rf $BACKUP_DEVICE_DIR
+               log_must rm -rf $BACKUP_DEVICE_DIR
 }
 
 log_onexit cleanup_all
@@ -110,7 +110,7 @@ log_assert "Verify that import could handle moving device."
 CWD=$PWD
 
 [[ ! -d $BACKUP_DEVICE_DIR ]] &&
-       log_must $MKDIR -p $BACKUP_DEVICE_DIR
+       log_must mkdir -p $BACKUP_DEVICE_DIR
 
 cd $DEVICE_DIR || log_fail "Unable change directory to $DEVICE_DIR"
 
@@ -123,7 +123,7 @@ typeset action
 while (( i < ${#vdevs[*]} )); do
 
        (( i != 0 )) && \
-               log_must $TAR xf $DEVICE_DIR/$DEVICE_ARCHIVE
+               log_must tar xf $DEVICE_DIR/$DEVICE_ARCHIVE
 
        setup_filesystem "$DEVICE_FILES" \
                $TESTPOOL1 $TESTFS $TESTDIR1 \
@@ -132,9 +132,9 @@ while (( i < ${#vdevs[*]} )); do
        guid=$(get_config $TESTPOOL1 pool_guid)
        backup=""
 
-       log_must $CP $MYTESTFILE $TESTDIR1/$TESTFILE0
+       log_must cp $MYTESTFILE $TESTDIR1/$TESTFILE0
 
-       log_must $ZFS umount $TESTDIR1
+       log_must zfs umount $TESTDIR1
 
        j=0
        while (( j <  ${#options[*]} )); do
@@ -145,24 +145,24 @@ while (( i < ${#vdevs[*]} )); do
                # Restore all device files.
                #
                [[ -n $backup ]] && \
-                       log_must $TAR xf $DEVICE_DIR/$DEVICE_ARCHIVE
+                       log_must tar xf $DEVICE_DIR/$DEVICE_ARCHIVE
 
-               log_must $RM -f $BACKUP_DEVICE_DIR/*
+               log_must rm -f $BACKUP_DEVICE_DIR/*
 
                for device in $DEVICE_FILES ; do
 
                        poolexists $TESTPOOL1 && \
-                               log_must $ZPOOL export $TESTPOOL1
+                               log_must zpool export $TESTPOOL1
 
                        #
                        # Backup all device files while filesystem prepared.
                        #
                        if [[ -z $backup ]] ; then
-                               log_must $TAR cf $DEVICE_DIR/$DEVICE_ARCHIVE ${DEVICE_FILE}*
+                               log_must tar cf $DEVICE_DIR/$DEVICE_ARCHIVE ${DEVICE_FILE}*
                                backup="true"
                        fi
 
-                       log_must $MV $device $BACKUP_DEVICE_DIR
+                       log_must mv $device $BACKUP_DEVICE_DIR
 
                        (( count = count + 1 ))
 
@@ -181,7 +181,7 @@ while (( i < ${#vdevs[*]} )); do
                                target=$guid
                                log_note "Import by guid."
                        fi
-                       $action $ZPOOL import \
+                       $action zpool import \
                                -d $DEVICE_DIR ${options[j]} $target
 
                done
index 7f2d4f4a3010669f6b9bea490a2d0ea53cafc3c9..fc9c6ff20ab4a79a5f2de5c02aea19f889968809 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -76,7 +76,7 @@ function verify
 
        log_must poolexists $pool
 
-       myhealth=$($ZPOOL list -H -o health $pool)
+       myhealth=$(zpool list -H -o health $pool)
 
        [[ $myhealth == $health ]] || \
                log_fail "$pool: Incorrect health ($myhealth), " \
@@ -92,7 +92,7 @@ function verify
        [[ ! -e $mtpt/$file ]] && \
                log_fail "$mtpt/$file missing after import."
 
-       checksum2=$($SUM $mymtpt/$file | $AWK '{print $1}')
+       checksum2=$(sum $mymtpt/$file | awk '{print $1}')
        [[ "$checksum1" != "$checksum2" ]] && \
                log_fail "Checksums differ ($checksum1 != $checksum2)"
 
@@ -112,7 +112,7 @@ function cleanup
        done
 
        [[ -e $DEVICE_DIR/$DEVICE_ARCHIVE ]] && \
-               log_must $TAR xf $DEVICE_DIR/$DEVICE_ARCHIVE
+               log_must tar xf $DEVICE_DIR/$DEVICE_ARCHIVE
 }
 
 function cleanup_all
@@ -124,13 +124,13 @@ function cleanup_all
        while (( i < $MAX_NUM )); do
                typeset file=${DEVICE_DIR}/${DEVICE_FILE}$i
                if  [[ -e $file ]]; then
-                       log_must $RM $file
+                       log_must rm $file
                fi
-               log_must $MKFILE $FILE_SIZE $file
+               log_must mkfile $FILE_SIZE $file
                ((i += 1))
        done
 
-       log_must $RM -f $DEVICE_DIR/$DEVICE_ARCHIVE
+       log_must rm -f $DEVICE_DIR/$DEVICE_ARCHIVE
        cd $CWD || log_fail "Unable change directory to $CWD"
 
 }
@@ -142,9 +142,9 @@ log_assert "Verify that import could handle device overlapped."
 CWD=$PWD
 
 cd $DEVICE_DIR || log_fail "Unable change directory to $DEVICE_DIR"
-log_must $TAR cf $DEVICE_DIR/$DEVICE_ARCHIVE ${DEVICE_FILE}*
+log_must tar cf $DEVICE_DIR/$DEVICE_ARCHIVE ${DEVICE_FILE}*
 
-checksum1=$($SUM $MYTESTFILE | $AWK '{print $1}')
+checksum1=$(sum $MYTESTFILE | awk '{print $1}')
 
 typeset -i i=0
 typeset -i j=0
@@ -164,7 +164,7 @@ while (( i < ${#vdevs[*]} )); do
        while (( j < ${#vdevs[*]} )); do
 
                (( j != 0 )) && \
-                       log_must $TAR xf $DEVICE_DIR/$DEVICE_ARCHIVE
+                       log_must tar xf $DEVICE_DIR/$DEVICE_ARCHIVE
 
                typeset -i overlap=1
                typeset -i begin
@@ -182,17 +182,17 @@ while (( i < ${#vdevs[*]} )); do
 
                        setup_filesystem "$vdev1" $TESTPOOL1 $TESTFS $TESTDIR1 \
                                "" ${vdevs[i]}
-                       log_must $CP $MYTESTFILE $TESTDIR1/$TESTFILE0
-                       log_must $ZFS umount $TESTDIR1
+                       log_must cp $MYTESTFILE $TESTDIR1/$TESTFILE0
+                       log_must zfs umount $TESTDIR1
                        poolexists $TESTPOOL1 && \
-                               log_must $ZPOOL export $TESTPOOL1
+                               log_must zpool export $TESTPOOL1
 
                        setup_filesystem "$vdev2" $TESTPOOL2 $TESTFS $TESTDIR2 \
                                "" ${vdevs[j]}
-                       log_must $CP $MYTESTFILE $TESTDIR2/$TESTFILE0
-                       log_must $ZFS umount $TESTDIR2
+                       log_must cp $MYTESTFILE $TESTDIR2/$TESTFILE0
+                       log_must zfs umount $TESTDIR2
                        poolexists $TESTPOOL2 && \
-                               log_must $ZPOOL export $TESTPOOL2
+                               log_must zpool export $TESTPOOL2
 
                        action=log_must
                        case "${vdevs[i]}" in
@@ -206,8 +206,8 @@ while (( i < ${#vdevs[*]} )); do
                                        ;;
                        esac
 
-                       $action $ZPOOL import -d $DEVICE_DIR $TESTPOOL1
-                       log_must $ZPOOL import -d $DEVICE_DIR $TESTPOOL2
+                       $action zpool import -d $DEVICE_DIR $TESTPOOL1
+                       log_must zpool import -d $DEVICE_DIR $TESTPOOL2
 
                        if [[ $action == log_must ]]; then
                                verify "$TESTPOOL1" "$TESTFS" "$TESTDIR1" \
index 441f7a7ae036e01fad153dd8567bb56e83625d04..ea4ea0caf8d031e1381aa7dcd5a79d2e1ec01ed3 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -64,23 +64,23 @@ function cleanup
        typeset -i i=0
        while (( i < ${#pools[*]} )); do
                if poolexists "${pools[i]}-new" ; then
-                       log_must $ZPOOL export "${pools[i]}-new"
+                       log_must zpool export "${pools[i]}-new"
 
                        [[ -d /${pools[i]}-new ]] && \
-                               log_must $RM -rf /${pools[i]}-new
+                               log_must rm -rf /${pools[i]}-new
 
-                       log_must $ZPOOL import ${devs[i]} \
+                       log_must zpool import ${devs[i]} \
                                "${pools[i]}-new" ${pools[i]}
                fi
 
                datasetexists "${pools[i]}" || \
-                       log_must $ZPOOL import ${devs[i]} ${pools[i]}
+                       log_must zpool import ${devs[i]} ${pools[i]}
 
                ismounted "${pools[i]}/$TESTFS" || \
-                       log_must $ZFS mount ${pools[i]}/$TESTFS
+                       log_must zfs mount ${pools[i]}/$TESTFS
 
                [[ -e ${mtpts[i]}/$TESTFILE0 ]] && \
-                       log_must $RM -rf ${mtpts[i]}/$TESTFILE0
+                       log_must rm -rf ${mtpts[i]}/$TESTFILE0
 
                ((i = i + 1))
 
@@ -91,9 +91,9 @@ function cleanup
        destroy_pool $TESTPOOL1
 
        [[ -d $ALTER_ROOT ]] && \
-               log_must $RM -rf $ALTER_ROOT
+               log_must rm -rf $ALTER_ROOT
        [[ -e $VDEV_FILE ]] && \
-               log_must $RM $VDEV_FILE
+               log_must rm $VDEV_FILE
 }
 
 log_onexit cleanup
@@ -101,7 +101,7 @@ log_onexit cleanup
 log_assert "Verify that an imported pool can be renamed."
 
 setup_filesystem "$DEVICE_FILES" $TESTPOOL1 $TESTFS $TESTDIR1
-checksum1=$($SUM $MYTESTFILE | $AWK '{print $1}')
+checksum1=$(sum $MYTESTFILE | awk '{print $1}')
 
 typeset -i i=0
 typeset -i j=0
@@ -109,16 +109,16 @@ typeset basedir
 
 while (( i < ${#pools[*]} )); do
        guid=$(get_config ${pools[i]} pool_guid)
-       log_must $CP $MYTESTFILE ${mtpts[i]}/$TESTFILE0
+       log_must cp $MYTESTFILE ${mtpts[i]}/$TESTFILE0
 
-       log_must $ZFS umount ${mtpts[i]}
+       log_must zfs umount ${mtpts[i]}
 
        j=0
        while (( j <  ${#options[*]} )); do
-               log_must $ZPOOL export ${pools[i]}
+               log_must zpool export ${pools[i]}
 
                [[ -d /${pools[i]} ]] && \
-                       log_must $RM -rf /${pools[i]}
+                       log_must rm -rf /${pools[i]}
 
                typeset target=${pools[i]}
                if (( RANDOM % 2 == 0 )) ; then
@@ -126,7 +126,7 @@ while (( i < ${#pools[*]} )); do
                        log_note "Import by guid."
                fi
 
-               log_must $ZPOOL import ${devs[i]} ${options[j]} \
+               log_must zpool import ${devs[i]} ${options[j]} \
                        $target ${pools[i]}-new
 
                log_must poolexists "${pools[i]}-new"
@@ -140,20 +140,20 @@ while (( i < ${#pools[*]} )); do
                [[ ! -e $basedir/$TESTFILE0 ]] && \
                        log_fail "$basedir/$TESTFILE0 missing after import."
 
-               checksum2=$($SUM $basedir/$TESTFILE0 | $AWK '{print $1}')
+               checksum2=$(sum $basedir/$TESTFILE0 | awk '{print $1}')
                [[ "$checksum1" != "$checksum2" ]] && \
                        log_fail "Checksums differ ($checksum1 != $checksum2)"
 
-               log_must $ZPOOL export "${pools[i]}-new"
+               log_must zpool export "${pools[i]}-new"
 
                [[ -d /${pools[i]}-new ]] && \
-                       log_must $RM -rf /${pools[i]}-new
+                       log_must rm -rf /${pools[i]}-new
 
                target=${pools[i]}-new
                if (( RANDOM % 2 == 0 )) ; then
                        target=$guid
                fi
-               log_must $ZPOOL import ${devs[i]} $target ${pools[i]}
+               log_must zpool import ${devs[i]} $target ${pools[i]}
 
                ((j = j + 1))
        done
@@ -163,11 +163,11 @@ done
 
 VDEV_FILE=$(mktemp /tmp/tmp.XXXXXX)
 
-log_must $MKFILE -n 128M $VDEV_FILE
-log_must $ZPOOL create testpool $VDEV_FILE
-log_must $ZFS create testpool/testfs
-ID=$($ZPOOL get -Ho value guid testpool)
-log_must $ZPOOL export testpool
-log_mustnot $ZPOOL import $(echo $ID) $($PRINTF "%*s\n" 250 "" | $TR ' ' 'c')
+log_must mkfile -n 128M $VDEV_FILE
+log_must zpool create testpool $VDEV_FILE
+log_must zfs create testpool/testfs
+ID=$(zpool get -Ho value guid testpool)
+log_must zpool export testpool
+log_mustnot zpool import $(echo id) $(printf "%*s\n" 250 "" | tr ' ' 'c')
 
 log_pass "Successfully imported and renamed a ZPOOL"
index ddd657477fc09a1148a68c7d3d7a1da751eec267..c0ccf0bb86b3922cb3d3b71974cf8b426c0d44c4 100755 (executable)
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -50,7 +55,7 @@ function cleanup
        # Ensure we don't leave disks in the offline state
        #
        for disk in $DISKLIST; do
-               log_must $ZPOOL online $TESTPOOL $disk
+               log_must zpool online $TESTPOOL $disk
                check_state $TESTPOOL $disk "online"
                if [[ $? != 0 ]]; then
                        log_fail "Unable to online $disk"
@@ -74,13 +79,13 @@ for disk in $DISKLIST; do
        i=0
        while [[ $i -lt ${#args[*]} ]]; do
                if (( j < num )) ; then
-                       log_must $ZPOOL offline ${args[$i]} $TESTPOOL $disk
+                       log_must zpool offline ${args[$i]} $TESTPOOL $disk
                        check_state $TESTPOOL $disk "offline"
                        if [[ $? != 0 ]]; then
                                log_fail "$disk of $TESTPOOL did not match offline state"
                        fi
                else
-                       log_mustnot $ZPOOL offline ${args[$i]} $TESTPOOL $disk
+                       log_mustnot zpool offline ${args[$i]} $TESTPOOL $disk
                        check_state $TESTPOOL $disk "online"
                        if [[ $? != 0 ]]; then
                                log_fail "$disk of $TESTPOOL did not match online state"
@@ -101,7 +106,7 @@ for disk in $DISKLIST; do
         i=0
         while [[ $i -lt $iters ]]; do
                index=`expr $RANDOM % ${#args[*]}`
-                log_must $ZPOOL offline ${args[$index]} $TESTPOOL $disk
+                log_must zpool offline ${args[$index]} $TESTPOOL $disk
                 check_state $TESTPOOL $disk "offline"
                 if [[ $? != 0 ]]; then
                         log_fail "$disk of $TESTPOOL is not offline."
@@ -110,7 +115,7 @@ for disk in $DISKLIST; do
                 (( i = i + 1 ))
         done
 
-       log_must $ZPOOL online $TESTPOOL $disk
+       log_must zpool online $TESTPOOL $disk
        check_state $TESTPOOL $disk "online"
        if [[ $? != 0 ]]; then
                log_fail "$disk of $TESTPOOL did not match online state"
index 9834d0731e194535b4ffc2f2edad52dc27a50b7e..14e0ab3fa75be2d3eef03bc4bb8674a5361afd9e 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -83,7 +88,7 @@ typeset -i i=0
 
 while [[ $i -lt ${#args[*]} ]]; do
 
-       log_mustnot $ZPOOL offline ${args[$i]}
+       log_mustnot zpool offline ${args[$i]}
 
        (( i = i + 1 ))
 done
index f1ed6a047e89a02bc70f80c6c4714a6777aa9b6f..2fe679776049d672c5bc7bef7e8bc7efe99a4668 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -48,7 +53,7 @@ function cleanup
        # Ensure we don't leave disks in temporary online state (-t)
        #
        for disk in $DISKLIST; do
-               log_must $ZPOOL online $TESTPOOL $disk
+               log_must zpool online $TESTPOOL $disk
                check_state $TESTPOOL $disk "online"
                if [[ $? != 0 ]]; then
                        log_fail "Unable to online $disk"
@@ -70,13 +75,13 @@ typeset -i i=0
 for disk in $DISKLIST; do
        i=0
        while [[ $i -lt ${#args[*]} ]]; do
-               log_must $ZPOOL offline $TESTPOOL $disk
+               log_must zpool offline $TESTPOOL $disk
                check_state $TESTPOOL $disk "offline"
                if [[ $? != 0 ]]; then
                        log_fail "$disk of $TESTPOOL did not match offline state"
                fi
 
-               log_must $ZPOOL online ${args[$i]} $TESTPOOL $disk
+               log_must zpool online ${args[$i]} $TESTPOOL $disk
                check_state $TESTPOOL $disk "online"
                if [[ $? != 0 ]]; then
                        log_fail "$disk of $TESTPOOL did not match online state"
@@ -95,7 +100,7 @@ for disk in $DISKLIST; do
         i=0
         while [[ $i -lt $iters ]]; do
                index=`expr $RANDOM % ${#args[*]}`
-                log_must $ZPOOL online ${args[$index]} $TESTPOOL $disk
+                log_must zpool online ${args[$index]} $TESTPOOL $disk
                 check_state $TESTPOOL $disk "online"
                 if [[ $? != 0 ]]; then
                         log_fail "$disk of $TESTPOOL did not match online state"
index 307d196dc553ef2a5f78044ab7865dfd86c309d0..79855e64a80940fde07aae90533a794696df812e 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -62,7 +67,7 @@ typeset -i i=0
 
 while [[ $i -lt ${#args[*]} ]]; do
 
-       log_mustnot $ZPOOL online ${args[$i]}
+       log_mustnot zpool online ${args[$i]}
 
        (( i = i + 1 ))
 done
index 345941bc9ae4b72d567a0c3c92cae914337f8929..7def918e8dd635009e81aeb31a726d5258af05d5 100644 (file)
@@ -30,7 +30,7 @@
 
 export DISK=${DISKS%% *}
 export SIZE="200m"
-export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
+export DISK_ARRAY_NUM=$(echo ${DISKS} | nawk '{print NF}')
 export DISKSARRAY=$DISKS
 
 if is_linux; then
index 495d8031b27470f210b86c876eb15592b0c21fd4..365e86cfa8f70849d4b60c34c199777df7a02b25 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -58,7 +58,7 @@ function check_remove
         typeset dev
 
         for dev in $devs; do
-                log_mustnot $ZPOOL remove $dev
+                log_mustnot zpool remove $dev
         done
 
         destroy_pool $pool
@@ -88,7 +88,7 @@ log_onexit cleanup
 
 typeset -i i=0
 while [[ $i -lt ${#create_args[*]} ]]; do
-       log_must $ZPOOL create $TESTPOOL ${create_args[i]}
+       log_must zpool create $TESTPOOL ${create_args[i]}
        check_remove $TESTPOOL "${verify_disks[i]}"
        (( i = i + 1))
 done
index c4ef6524dc772851c214f8a643f991b7957ab313..340735aa00692a80deb924318ad71dd0d462ff19 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -58,12 +58,12 @@ typeset spare_devs2="${disk}${SLICE_PREFIX}${SLICE1}"
 log_assert "zpool remove can only remove inactive hotspare device from pool"
 
 log_note "check hotspare device which is created by zpool create"
-log_must $ZPOOL create $TESTPOOL $spare_devs1 spare $spare_devs2
-log_must $ZPOOL remove $TESTPOOL $spare_devs2
+log_must zpool create $TESTPOOL $spare_devs1 spare $spare_devs2
+log_must zpool remove $TESTPOOL $spare_devs2
 
 log_note "check hotspare device which is created by zpool add"
-log_must $ZPOOL add $TESTPOOL spare $spare_devs2
-log_must $ZPOOL remove $TESTPOOL $spare_devs2
-log_must $ZPOOL destroy $TESTPOOL
+log_must zpool add $TESTPOOL spare $spare_devs2
+log_must zpool remove $TESTPOOL $spare_devs2
+log_must zpool destroy $TESTPOOL
 
 log_pass "zpool remove can only remove inactive hotspare device from pool"
index cb2d56ea8b2f69ed784b308cf640abb8051d71ab..c27c4c7d8fe480d8f9caf21e0fd867dd9f157809 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -63,11 +63,11 @@ log_assert "zpool remove can remove hotspare device which state go though" \
        " active to inactive in pool"
 
 log_note "Check spare device which state go through active to inactive"
-log_must $ZPOOL create $TESTPOOL $spare_devs1 $spare_devs2 spare \
+log_must zpool create $TESTPOOL $spare_devs1 $spare_devs2 spare \
                  $spare_devs3 $spare_devs4
-log_must $ZPOOL replace $TESTPOOL $spare_devs2 $spare_devs3
-log_mustnot $ZPOOL remove $TESTPOOL $spare_devs3
-log_must $ZPOOL detach $TESTPOOL $spare_devs3
-log_must $ZPOOL remove $TESTPOOL $spare_devs3
+log_must zpool replace $TESTPOOL $spare_devs2 $spare_devs3
+log_mustnot zpool remove $TESTPOOL $spare_devs3
+log_must zpool detach $TESTPOOL $spare_devs3
+log_must zpool remove $TESTPOOL $spare_devs3
 
 log_pass "'zpool remove device passed as expected.'"
index 853387798b8bae3dc547b8f48065a5200a4e7882..725e495ebb898f4a5108b6e517cfda3be269fd85 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -70,7 +75,7 @@ typeset -i i=0
 
 while [[ $i -lt ${#args[*]} ]]; do
 
-       log_mustnot $ZPOOL replace ${args[$i]}
+       log_mustnot zpool replace ${args[$i]}
 
        (( i = i + 1 ))
 done
index ae6a8e12c28964f9b2e1df2ee0c30ab65316214f..374bbe78bb212204e695b215372798fa9f6bf4ee 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -40,5 +40,5 @@ default_mirror_setup_noexit $DISK1 $DISK2
 mntpnt=$(get_prop mountpoint $TESTPOOL)
 
 # Create 100MB of data
-log_must $FILE_WRITE -b 1048576 -c 100 -o create -d 0 -f $mntpnt/bigfile
+log_must file_write -b 1048576 -c 100 -o create -d 0 -f $mntpnt/bigfile
 log_pass
index d0325633d2cebc79af7a2fcfc2de743463ba9450..bd2b57e2c1b59ffd61fe84a1a1f6cb98fd649411 100644 (file)
@@ -25,8 +25,8 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 export DISK1=${DISKS%% *}
-export DISK2=$($ECHO $DISKS | $AWK '{print $2}')
+export DISK2=$(echo $DISKS | awk '{print $2}')
index c3214c13dec051160ceafedbadc0a4834b5ecd3e..96bc185dd40c490f6703507ff91eed618e0e4ccf 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -50,7 +55,7 @@ log_assert "Execute 'zpool scrub' using invalid parameters."
 
 typeset -i i=0
 while [[ $i -lt ${#args[*]} ]]; do
-       log_mustnot $ZPOOL scrub ${args[i]}
+       log_mustnot zpool scrub ${args[i]}
 
        ((i = i + 1))
 done
index ce07fd5a2b7ac1e95328ab96ecbba8481bddf8e3..fe489e12f35e95f6b6cec648e52334099e390467 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zpool_scrub/zpool_scrub.cfg
 
 verify_runnable "global"
 
 log_assert "Verify scrub -s works correctly."
-log_must $ZINJECT -d $DISK1 -D10:1 $TESTPOOL
-log_must $ZPOOL scrub $TESTPOOL
-log_must $ZPOOL scrub -s $TESTPOOL
+log_must zinject -d $DISK1 -D10:1 $TESTPOOL
+log_must zpool scrub $TESTPOOL
+log_must zpool scrub -s $TESTPOOL
 log_must is_pool_scrub_stopped $TESTPOOL
 
-log_must $ZINJECT -c all
+log_must zinject -c all
 log_pass "Verify scrub -s works correctly."
index b1b6df1af6abc9f0a502cfe604038fdec121cc70..444ffeb39d834c81abe2690bbfde51b643b74d49 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zpool_scrub/zpool_scrub.cfg
 
@@ -50,30 +54,30 @@ verify_runnable "global"
 function get_scrub_percent
 {
        typeset -i percent
-       percent=$($ZPOOL status $TESTPOOL | $GREP "^ scrub" | \
-           $AWK '{print $7}' | $AWK -F. '{print $1}')
+       percent=$(zpool status $TESTPOOL | grep "^ scrub" | \
+           awk '{print $7}' | awk -F. '{print $1}')
        if is_pool_scrubbed $TESTPOOL ; then
                percent=100
        fi
-       $ECHO $percent
+       echo $percent
 }
 
 log_assert "scrub command terminates the existing scrub process and starts" \
        "a new scrub."
 
-log_must $ZINJECT -d $DISK1 -D10:1 $TESTPOOL
-log_must $ZPOOL scrub $TESTPOOL
+log_must zinject -d $DISK1 -D10:1 $TESTPOOL
+log_must zpool scrub $TESTPOOL
 typeset -i PERCENT=30 percent=0
 while ((percent < PERCENT)) ; do
        percent=$(get_scrub_percent)
 done
 
-log_must $ZPOOL scrub $TESTPOOL
+log_must zpool scrub $TESTPOOL
 percent=$(get_scrub_percent)
 if ((percent > PERCENT)); then
        log_fail "zpool scrub don't stop existing scrubbing process."
 fi
 
-log_must $ZINJECT -c all
+log_must zinject -c all
 log_pass "scrub command terminates the existing scrub process and starts" \
        "a new scrub."
index 16e27a0cad0ba4c8be7717db90ee599b7c99788c..b2cb8893a07409e2ca023746c92cd0a50dd8c294 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -55,16 +55,16 @@ fi
 
 log_assert "Resilver prevent scrub from starting until the resilver completes"
 
-log_must $ZPOOL detach $TESTPOOL $DISK2
-log_must $ZINJECT -d $DISK1 -D10:1 $TESTPOOL
-log_must $ZPOOL attach $TESTPOOL $DISK1 $DISK2
+log_must zpool detach $TESTPOOL $DISK2
+log_must zinject -d $DISK1 -D10:1 $TESTPOOL
+log_must zpool attach $TESTPOOL $DISK1 $DISK2
 log_must is_pool_resilvering $TESTPOOL
-log_mustnot $ZPOOL scrub $TESTPOOL
+log_mustnot zpool scrub $TESTPOOL
 
 # Allow the resilver to finish, or it will interfere with the next test.
 while ! is_pool_resilvered $TESTPOOL; do
-       $SLEEP 1
+       sleep 1
 done
 
-log_must $ZINJECT -c all
+log_must zinject -c all
 log_pass "Resilver prevent scrub from starting until the resilver completes"
index 1e752cff80f73b3cdb4146132da1d0da8acd8d42..5312f8e82d20cd21a8c5ece1790007ebbc5d0d0a 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -51,16 +51,16 @@ fi
 
 log_assert "When scrubbing, detach device should not break system."
 
-log_must $ZPOOL scrub $TESTPOOL
-log_must $ZPOOL detach $TESTPOOL $DISK2
-log_must $ZPOOL attach $TESTPOOL $DISK1 $DISK2
+log_must zpool scrub $TESTPOOL
+log_must zpool detach $TESTPOOL $DISK2
+log_must zpool attach $TESTPOOL $DISK1 $DISK2
 
 while ! is_pool_resilvered $TESTPOOL; do
-       $SLEEP 1
+       sleep 1
 done
 
-log_must $ZPOOL scrub $TESTPOOL
-log_must $ZPOOL detach $TESTPOOL $DISK1
-log_must $ZPOOL attach $TESTPOOL $DISK2 $DISK1
+log_must zpool scrub $TESTPOOL
+log_must zpool detach $TESTPOOL $DISK1
+log_must zpool attach $TESTPOOL $DISK2 $DISK1
 
 log_pass "When scrubbing, detach device should not break system."
index 570e1ba6262d2b4c4f7a9357bb92fc898edd02c1..f08fdfab7fd6a411f5e58de485af5c71b6cbe343 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 #
 # DESCRIPTION:
 
 log_assert "zpool set usage message is displayed when called with no arguments"
 
-$ZPOOL set > /dev/null 2>&1
+zpool set > /dev/null 2>&1
 RET=$?
 if [ $RET != 2 ]
 then
        log_fail "\"zpool set\" exit status $RET should be equal to 2."
 fi
 
-OUTPUT=$($ZPOOL set 2>&1 | $GREP -i usage)
+OUTPUT=$(zpool set 2>&1 | grep -i usage)
 if [ $? != 0 ]
 then
        log_fail "Usage message for zpool set did not contain the word 'usage'."
index a4c8a28992d98513c5c2d212ef4ce504f06d65e5..dbe33f9c8325f1d0841ea4d15494b1aaee903999 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,8 +48,8 @@ verify_runnable "global"
 # before running this test...
 function cleanup {
 
-       $ZPOOL destroy bootfs
-       $RM /tmp/zpool_set_002.$$.dat
+       zpool destroy bootfs
+       rm /tmp/zpool_set_002.$$.dat
 }
 
 log_assert "Malformed zpool set commands are rejected"
@@ -103,20 +103,20 @@ arguments[${#arguments[@]}]="bootfs=$bigname"
 # Create a pool called bootfs (so-called, so as to trip any clashes between
 # property name, and pool name)
 # Also create a filesystem in this pool
-log_must $MKFILE $MINVDEVSIZE /tmp/zpool_set_002.$$.dat
-log_must $ZPOOL create bootfs /tmp/zpool_set_002.$$.dat
-log_must $ZFS create bootfs/root
+log_must mkfile $MINVDEVSIZE /tmp/zpool_set_002.$$.dat
+log_must zpool create bootfs /tmp/zpool_set_002.$$.dat
+log_must zfs create bootfs/root
 
 typeset -i i=0;
 while [ $i -lt "${#arguments[@]}" ]
 do
-       log_mustnot eval "$ZPOOL set ${arguments[$i]} > /dev/null 2>&1"
+       log_mustnot eval "zpool set ${arguments[$i]} > /dev/null 2>&1"
 
        # now also try with a valid pool in the argument list
-       log_mustnot eval "$ZPOOL set ${arguments[$i]}bootfs > /dev/null 2>&1"
+       log_mustnot eval "zpool set ${arguments[$i]}bootfs > /dev/null 2>&1"
 
        # now also try with two valid pools in the argument list
-       log_mustnot eval "$ZPOOL set ${arguments[$i]}bootfs bootfs > /dev/null"
+       log_mustnot eval "zpool set ${arguments[$i]}bootfs bootfs > /dev/null"
        i=$(( $i + 1))
 done
 
index 09c9ef195381b548cf9d48fec3086558a8a7407f..c705ef33978bd12d2edf1642d7c645424c4ef1a8 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,8 +45,8 @@ verify_runnable "global"
 
 function cleanup
 {
-        $ZPOOL destroy $TESTPOOL
-        $RM /tmp/zpool_set_003.$$.dat
+        zpool destroy $TESTPOOL
+        rm /tmp/zpool_set_003.$$.dat
 }
 
 set -A props "available" "capacity" "guid"  "health"  "size" "used"
@@ -56,14 +56,14 @@ log_onexit cleanup
 
 log_assert "zpool set cannot set a readonly property"
 
-log_must $MKFILE $MINVDEVSIZE /tmp/zpool_set_003.$$.dat
-log_must $ZPOOL create $TESTPOOL /tmp/zpool_set_003.$$.dat
+log_must mkfile $MINVDEVSIZE /tmp/zpool_set_003.$$.dat
+log_must zpool create $TESTPOOL /tmp/zpool_set_003.$$.dat
 
 typeset -i i=0;
 while [ $i -lt "${#props[@]}" ]
 do
        # try to set each property in the prop list with it's corresponding val
-        log_mustnot eval "$ZPOOL set ${props[$i]}=${vals[$i]} $TESTPOOL \
+        log_mustnot eval "zpool set ${props[$i]}=${vals[$i]} $TESTPOOL \
  > /dev/null 2>&1"
         i=$(( $i + 1))
 done
index d582e55f4c99e97b643c6ec3d29e2ab6fd6e17ad..88c0601032a55c2117a5c948fd752e5e6a39e6d0 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -49,7 +54,7 @@ typeset -i i=1
 
 while [[ $i -lt ${#args[*]} ]]; do
 
-       log_mustnot $ZPOOL status ${args[$i]}
+       log_mustnot zpool status ${args[$i]}
 
        (( i = i + 1 ))
 done
index 5ae84a80971e6f4db5e661f9d1093145c7a911c5..e2751b112597089f201afe022c68a467bd7c8261 100755 (executable)
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -54,7 +59,7 @@ typeset -i i=0
 
 while [[ $i -lt ${#args[*]} ]]; do
 
-       log_must $ZPOOL status ${args[$i]}
+       log_must zpool status ${args[$i]}
 
        (( i = i + 1 ))
 done
index 0252cac70b0f304ad2fd1d2e6ba1e938a39722ef..51986e6c29a3af369bf69df11dd3ed7c3622280f 100644 (file)
@@ -48,15 +48,15 @@ function create_old_pool
 
        log_note "Creating $pool_name from $pool_files"
        for pool_file in $pool_files; do
-               log_must $BZCAT \
+               log_must bzcat \
                    $STF_SUITE/tests/functional/cli_root/zpool_upgrade/$pool_file.bz2 \
                    >/$TESTPOOL/$pool_file
        done
-       log_must $ZPOOL import -d /$TESTPOOL $pool_name
+       log_must zpool import -d /$TESTPOOL $pool_name
 
        # Put some random contents into the pool
        for i in {1..1024} ; do
-               $DD if=/dev/urandom of=/$pool_name/random.$i \
+               dd if=/dev/urandom of=/$pool_name/random.$i \
                    count=1 bs=1024 > /dev/null 2>&1
        done
 }
@@ -77,12 +77,12 @@ function check_upgrade
 
        log_note "Checking if we can upgrade from ZFS version $vers"
        pre_upgrade_checksum=$(check_pool $pool_name pre)
-       log_must $ZPOOL upgrade $pool_name
+       log_must zpool upgrade $pool_name
        post_upgrade_checksum=$(check_pool $pool_name post)
 
        log_note "Checking that there are no differences between checksum output"
-       log_must $DIFF $pre_upgrade_checksum $post_upgrade_checksum
-       $RM $pre_upgrade_checksum $post_upgrade_checksum
+       log_must diff $pre_upgrade_checksum $post_upgrade_checksum
+       rm $pre_upgrade_checksum $post_upgrade_checksum
 }
 
 # A function to destroy an upgraded pool, plus the files it was based on.
@@ -93,9 +93,11 @@ function destroy_upgraded_pool
        typeset -n pool_files=ZPOOL_VERSION_${vers}_FILES
        typeset -n pool_name=ZPOOL_VERSION_${vers}_NAME
 
-       destroy_pool $pool_name
+       if poolexists $pool_name; then
+               log_must zpool destroy $pool_name
+       fi
        for file in $pool_files; do
-               $RM -f /$TESTPOOL/$file
+               rm -f /$TESTPOOL/$file
        done
 }
 
@@ -109,7 +111,7 @@ function check_pool
 {
        typeset pool=$1
        typeset flag=$2
-       $FIND /$pool -type f -exec $CKSUM {} + > \
+       find /$pool -type f -exec cksum {} + > \
                /$TESTPOOL/pool-checksums.$pool.$flag
        echo /$TESTPOOL/pool-checksums.$pool.$flag
 }
@@ -125,14 +127,14 @@ function check_poolversion
        typeset actual
 
        # check version using zdb
-       actual=$($ZDB -C $pool | $SED -n 's/^.*version: \(.*\)$/\1/p')
+       actual=$(zdb -C $pool | sed -n 's/^.*version: \(.*\)$/\1/p')
        if [[ $actual != $vers ]] ; then
                log_fail "$pool: zdb reported version $actual, expected $vers"
        fi
 
        # check version using zpool upgrade
-       actual=$($ZPOOL upgrade | $GREP $pool$ | \
-           $AWK '{print $1}' | $SED -e 's/ //g')
+       actual=$(zpool upgrade | grep $pool$ | \
+           awk '{print $1}' | sed -e 's/ //g')
        if [[ $actual != $vers ]] ; then
                log_fail "$pool: zpool reported version $actual, expected $vers"
        fi
index f32d1cabe4dffc2b4ffb23e9f192fc3085fabf99..45d143758093db5b25178ad49aee68f2fb69529f 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 # Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
 #
 
@@ -47,14 +47,14 @@ verify_runnable "global"
 
 log_assert "Executing 'zpool upgrade -v' command succeeds"
 
-log_must $ZPOOL upgrade -v
+log_must zpool upgrade -v
 
 # We also check that the usage message contains a description of legacy
 # versions and a note about feature flags.
 
-log_must eval "$ZPOOL upgrade -v | $HEAD -1 | $GREP 'feature flags'"
+log_must eval "zpool upgrade -v | head -1 | grep 'feature flags'"
 
-$ZPOOL upgrade -v > /tmp/zpool-versions.$$
+zpool upgrade -v > /tmp/zpool-versions.$$
 
 #
 # Current output for 'zpool upgrade -v' has different indent space
@@ -64,8 +64,8 @@ $ZPOOL upgrade -v > /tmp/zpool-versions.$$
 #
 for version in {1..28}; do
        log_note "Checking for a description of pool version $version"
-       log_must eval "$AWK '/^ $version / { print $1 }' /tmp/zpool-versions.$$ | $GREP $version"
+       log_must eval "awk '/^ $version / { print $1 }' /tmp/zpool-versions.$$ | grep $version"
 done
-$RM /tmp/zpool-versions.$$
+rm /tmp/zpool-versions.$$
 
 log_pass "Executing 'zpool upgrade -v' command succeeds"
index ba3cdd01be58d8613b5ffd66d5c28026984ad6f7..f04b66413632704017e79453a0c6480e5cb898d0 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 # Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
 #
 
@@ -65,7 +65,7 @@ done
 
 # upgrade them all at once
 export __ZFS_POOL_RESTRICT="$TEST_POOLS"
-log_must $ZPOOL upgrade -a
+log_must zpool upgrade -a
 unset __ZFS_POOL_RESTRICT
 
 # verify their contents then destroy them
@@ -73,9 +73,9 @@ for config in $CONFIGS ; do
        typeset -n pool_name=ZPOOL_VERSION_${config}_NAME
 
        check_pool $pool_name post > /dev/null
-       log_must $DIFF /$TESTPOOL/pool-checksums.$pool_name.pre \
+       log_must diff /$TESTPOOL/pool-checksums.$pool_name.pre \
            /$TESTPOOL/pool-checksums.$pool_name.post
-       $RM /$TESTPOOL/pool-checksums.$pool_name.pre \
+       rm /$TESTPOOL/pool-checksums.$pool_name.pre \
            /$TESTPOOL/pool-checksums.$pool_name.post
        destroy_upgraded_pool $config
 done
index d32ae3eeb4ca5e217bed7476461ebc7e284e76c9..b294af06cf46c10ad1fa2e035ded0ff15da235e6 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 # Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
 #
 
@@ -47,7 +47,7 @@ log_assert "Variations of upgrade -v print usage message," \
     "return with non-zero status"
 
 for arg in "/tmp" "-?" "-va" "-v fakepool" "-a fakepool" ; do
-        log_mustnot $ZPOOL upgrade $arg
+        log_mustnot zpool upgrade $arg
 done
 
 log_pass "Variations of upgrade -v print usage message," \
index a66ac6c7c43041a8dbfeeaa1c55116a9ab5284ad..4c16f81082caddffac7e5e091e9b1f98eaf69285 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 # Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
 #
 
@@ -49,7 +49,7 @@ while true ; do
        if poolexists $NO_POOL ; then
                NO_POOL="${NO_POOL}x"
        else
-               log_mustnot $ZPOOL upgrade $NO_POOL
+               log_mustnot zpool upgrade $NO_POOL
                break
        fi
 done
index 0809f95f92f3bff91b7ae07e3fdfd5554d1f970a..173d7f68c8feb7d2b4618e4e1c66a96da1fb5366 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 # Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
 #
 
@@ -70,7 +70,7 @@ for ver_old in $VERSIONS; do
        typeset ver_new=$(random $ver_old $MAX_VER)
 
        create_old_pool $ver_old
-       log_must $ZPOOL upgrade -V $ver_new $pool_name > /dev/null
+       log_must zpool upgrade -V $ver_new $pool_name > /dev/null
        check_poolversion $pool_name $ver_new
        destroy_upgraded_pool $ver_old
 done
index dce926891272dafd8490f5ebdad414e19b051425..22ffda2114a5fc9f0c77c29364f792acf3be59cc 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 # Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
 #
 
@@ -57,8 +57,8 @@ typeset -i config=2
 typeset -n pool_name=ZPOOL_VERSION_${config}_NAME
 
 create_old_pool $config
-log_mustnot $ZPOOL upgrade -V 999 $pool_name
-log_mustnot $ZPOOL upgrade -V 999
+log_mustnot zpool upgrade -V 999 $pool_name
+log_mustnot zpool upgrade -V 999
 check_poolversion $pool_name $config
 destroy_upgraded_pool $config
 
index e65fbe6b40c155e56322f423f2d9d98c8b33dd66..67c11c8ab673f1e961ca92226af1c70cbc1dbf94 100755 (executable)
@@ -33,7 +33,7 @@ log_assert "arc_summary.py generates output and doesn't return an error code"
 
 typeset -i i=0
 while [[ $i -lt ${#args[*]} ]]; do
-        log_must eval "$ARC_SUMMARY ${args[i]} > /dev/null"
+        log_must eval "arc_summary.py ${args[i]} > /dev/null"
         ((i = i + 1))
 done
 
index edf80b10fff2d886fa7083b2c4f1f51a87dae206..c8a89f8c4b74958f665fdc9b8ab2c2fcb333c88c 100755 (executable)
@@ -34,7 +34,7 @@ log_assert "arcstat.py generates output and doesn't return an error code"
 
 typeset -i i=0
 while [[ $i -lt ${#args[*]} ]]; do
-        log_must eval "$ARCSTAT ${args[i]} > /dev/null"
+        log_must eval "arcstat.py ${args[i]} > /dev/null"
         ((i = i + 1))
 done
 log_pass "arcstat.py generates output and doesn't return an error code"
index 4bb4991103bba1b157dfd410a423a075961b0cc9..4319a639e7893561f50eb2481f634116df7219e1 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 
 if poolexists $TESTPOOL.virt
 then
-       log_must $ZPOOL destroy $TESTPOOL.virt
+       log_must zpool destroy $TESTPOOL.virt
 fi
 
 if poolexists v1-pool
 then
-       log_must $ZPOOL destroy v1-pool
+       log_must zpool destroy v1-pool
 fi
 
 if [[ -f /tmp/zfstest_datastream.dat ]]
 then
-       log_must $RM -f /tmp/zfstest_datastream.dat
+       log_must rm -f /tmp/zfstest_datastream.dat
 fi
 
 default_cleanup
index 229ba72cb0190f58f1db455c34fde805bbd4cd57..a5890f3c16189cd4f58434f40bfefad2fc7c131f 100755 (executable)
@@ -33,7 +33,7 @@ log_assert "dbufstat.py generates output and doesn't return an error code"
 
 typeset -i i=0
 while [[ $i -lt ${#args[*]} ]]; do
-        log_must eval "$DBUFSTAT ${args[i]} > /dev/null"
+        log_must eval "dbufstat.py ${args[i]} > /dev/null"
         ((i = i + 1))
 done
 
index 2deafcd01abfaa243f3000d895b29aaafaa63eb6..62070c018ad788ac671e113b942b1fb15644e82e 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,33 +52,33 @@ default_setup_noexit "$DISK" "" "volume"
 #
 
 # create a snapshot and a clone to test clone promote
-log_must $ZFS snapshot $TESTPOOL/$TESTFS@snap
-log_must $ZFS clone $TESTPOOL/$TESTFS@snap $TESTPOOL/$TESTFS/clone
+log_must zfs snapshot $TESTPOOL/$TESTFS@snap
+log_must zfs clone $TESTPOOL/$TESTFS@snap $TESTPOOL/$TESTFS/clone
 # create a file in the filesystem that isn't in the above snapshot
-$TOUCH /$TESTDIR/file.txt
+touch /$TESTDIR/file.txt
 
 
 # create a non-default property and a child we can use to test inherit
-log_must $ZFS create $TESTPOOL/$TESTFS/$TESTFS2
-log_must $ZFS set snapdir=hidden $TESTPOOL/$TESTFS
+log_must zfs create $TESTPOOL/$TESTFS/$TESTFS2
+log_must zfs set snapdir=hidden $TESTPOOL/$TESTFS
 
 
 # create an unmounted filesystem to test unmount
-log_must $ZFS create $TESTPOOL/$TESTFS/$TESTFS2.unmounted
-log_must $ZFS unmount $TESTPOOL/$TESTFS/$TESTFS2.unmounted
+log_must zfs create $TESTPOOL/$TESTFS/$TESTFS2.unmounted
+log_must zfs unmount $TESTPOOL/$TESTFS/$TESTFS2.unmounted
 
 
 # send our snapshot to a known file in /tmp
-$ZFS send $TESTPOOL/$TESTFS@snap > /tmp/zfstest_datastream.dat
+zfs send $TESTPOOL/$TESTFS@snap > /tmp/zfstest_datastream.dat
 if [ ! -s /tmp/zfstest_datastream.dat ]
 then
        log_fail "ZFS send datafile was not created!"
 fi
-log_must $CHMOD 644 /tmp/zfstest_datastream.dat
+log_must chmod 644 /tmp/zfstest_datastream.dat
 
 
 # create a filesystem that has particular properties to test set/get
-log_must $ZFS create -o version=1 $TESTPOOL/$TESTFS/prop
+log_must zfs create -o version=1 $TESTPOOL/$TESTFS/prop
 set -A props $PROP_NAMES
 set -A prop_vals $PROP_VALS
 typeset -i i=0
@@ -87,58 +87,58 @@ while [[ $i -lt ${#props[*]} ]]
 do
        prop_name=${props[$i]}
        prop_val=${prop_vals[$i]}
-       log_must $ZFS set $prop_name=$prop_val $TESTPOOL/$TESTFS/prop
+       log_must zfs set $prop_name=$prop_val $TESTPOOL/$TESTFS/prop
        i=$(( $i + 1 ))
 done
 
 # create a filesystem we don't mind renaming
-log_must $ZFS create $TESTPOOL/$TESTFS/renameme
+log_must zfs create $TESTPOOL/$TESTFS/renameme
 
 
 if is_global_zone && !is_linux
 then
        # create a filesystem we can share
-       log_must $ZFS create $TESTPOOL/$TESTFS/unshared
-       log_must $ZFS set sharenfs=off $TESTPOOL/$TESTFS/unshared
+       log_must zfs create $TESTPOOL/$TESTFS/unshared
+       log_must zfs set sharenfs=off $TESTPOOL/$TESTFS/unshared
 
        # create a filesystem that we can unshare
-       log_must $ZFS create $TESTPOOL/$TESTFS/shared
-       log_must $ZFS set sharenfs=on $TESTPOOL/$TESTFS/shared
+       log_must zfs create $TESTPOOL/$TESTFS/shared
+       log_must zfs set sharenfs=on $TESTPOOL/$TESTFS/shared
 fi
 
 
-log_must $ZFS create -o version=1 $TESTPOOL/$TESTFS/version1
-log_must $ZFS create -o version=1 $TESTPOOL/$TESTFS/allowed
-log_must $ZFS allow everyone create $TESTPOOL/$TESTFS/allowed
+log_must zfs create -o version=1 $TESTPOOL/$TESTFS/version1
+log_must zfs create -o version=1 $TESTPOOL/$TESTFS/allowed
+log_must zfs allow everyone create $TESTPOOL/$TESTFS/allowed
 
 if is_global_zone
 then
 
        # Now create several virtual disks to test zpool with
 
-       $MKFILE $MINVDEVSIZE /$TESTDIR/disk1.dat
-       $MKFILE $MINVDEVSIZE /$TESTDIR/disk2.dat
-       $MKFILE $MINVDEVSIZE /$TESTDIR/disk3.dat
-       $MKFILE $MINVDEVSIZE /$TESTDIR/disk-additional.dat
-       $MKFILE $MINVDEVSIZE /$TESTDIR/disk-export.dat
-       $MKFILE $MINVDEVSIZE /$TESTDIR/disk-offline.dat
-       $MKFILE $MINVDEVSIZE /$TESTDIR/disk-spare1.dat
-       $MKFILE $MINVDEVSIZE /$TESTDIR/disk-spare2.dat
+       mkfile $MINVDEVSIZE /$TESTDIR/disk1.dat
+       mkfile $MINVDEVSIZE /$TESTDIR/disk2.dat
+       mkfile $MINVDEVSIZE /$TESTDIR/disk3.dat
+       mkfile $MINVDEVSIZE /$TESTDIR/disk-additional.dat
+       mkfile $MINVDEVSIZE /$TESTDIR/disk-export.dat
+       mkfile $MINVDEVSIZE /$TESTDIR/disk-offline.dat
+       mkfile $MINVDEVSIZE /$TESTDIR/disk-spare1.dat
+       mkfile $MINVDEVSIZE /$TESTDIR/disk-spare2.dat
 
        # and create a pool we can perform attach remove replace,
        # etc. operations with
-       log_must $ZPOOL create $TESTPOOL.virt mirror /$TESTDIR/disk1.dat \
+       log_must zpool create $TESTPOOL.virt mirror /$TESTDIR/disk1.dat \
        /$TESTDIR/disk2.dat /$TESTDIR/disk3.dat /$TESTDIR/disk-offline.dat \
        spare /$TESTDIR/disk-spare1.dat
 
 
        # Offline one of the disks to test online
-       log_must $ZPOOL offline $TESTPOOL.virt /$TESTDIR/disk-offline.dat
+       log_must zpool offline $TESTPOOL.virt /$TESTDIR/disk-offline.dat
 
 
        # create an exported pool to test import
-       log_must $ZPOOL create $TESTPOOL.exported /$TESTDIR/disk-export.dat
-       log_must $ZPOOL export $TESTPOOL.exported
+       log_must zpool create $TESTPOOL.exported /$TESTDIR/disk-export.dat
+       log_must zpool export $TESTPOOL.exported
 
        set -A props $POOL_PROPS
        set -A prop_vals $POOL_VALS
@@ -148,14 +148,14 @@ then
        do
                prop_name=${props[$i]}
                prop_val=${prop_vals[$i]}
-               log_must $ZPOOL set $prop_name=$prop_val $TESTPOOL
+               log_must zpool set $prop_name=$prop_val $TESTPOOL
                i=$(( $i + 1 ))
        done
 
        # copy a v1 pool from cli_root
-       $CP $STF_SUITE/tests/functional/cli_root/zpool_upgrade/zfs-pool-v1.dat.bz2 \
+       cp $STF_SUITE/tests/functional/cli_root/zpool_upgrade/zfs-pool-v1.dat.bz2 \
            /$TESTDIR
-       log_must $BUNZIP2 /$TESTDIR/zfs-pool-v1.dat.bz2
-       log_must $ZPOOL import -d /$TESTDIR v1-pool
+       log_must bunzip2 /$TESTDIR/zfs-pool-v1.dat.bz2
+       log_must zpool import -d /$TESTDIR v1-pool
 fi
 log_pass
index 4e4276f74a354c35f1c5c01bdec1fec62c3e5187..583a65b4cc0f287b7160bd48ab24bdfd01c18552 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 function check_zdb
 {
        $@ > /tmp/zdb.$$
-       $GREP "Dataset mos" /tmp/zdb.$$
+       grep "Dataset mos" /tmp/zdb.$$
        if [ $? -eq 0 ]
        then
                log_fail "$@ exited 0 when run as a non root user!"
        fi
-       $RM /tmp/zdb.$$
+       rm /tmp/zdb.$$
 }
 
 
@@ -58,7 +58,7 @@ function cleanup
 {
        if [ -e /tmp/zdb_001_neg.$$.txt ]
        then
-               $RM /tmp/zdb_001_neg.$$.txt
+               rm /tmp/zdb_001_neg.$$.txt
        fi
 
 }
@@ -68,15 +68,15 @@ verify_runnable "global"
 log_assert "zdb can't run as a user on datasets, but can run without arguments"
 log_onexit cleanup
 
-log_must eval "$ZDB > /tmp/zdb_001_neg.$$.txt"
+log_must eval "zdb > /tmp/zdb_001_neg.$$.txt"
 # verify the output looks okay
-log_must $GREP pool_guid /tmp/zdb_001_neg.$$.txt
-log_must $RM /tmp/zdb_001_neg.$$.txt
+log_must grep pool_guid /tmp/zdb_001_neg.$$.txt
+log_must rm /tmp/zdb_001_neg.$$.txt
 
 # we shouldn't able to run it on any dataset
-check_zdb $ZDB $TESTPOOL
-check_zdb $ZDB $TESTPOOL/$TESTFS
-check_zdb $ZDB $TESTPOOL/$TESTFS@snap
-check_zdb $ZDB $TESTPOOL/$TESTFS.clone
+check_zdb zdb $TESTPOOL
+check_zdb zdb $TESTPOOL/$TESTFS
+check_zdb zdb $TESTPOOL/$TESTFS@snap
+check_zdb zdb $TESTPOOL/$TESTFS.clone
 
 log_pass "zdb can't run as a user on datasets, but can run without arguments"
index f055e2bfea5bceec7ba1854a5950ca270f43ff65..b5c1fdeca16b16b2fcecf17ecb5135bc3ac924db 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -46,14 +46,14 @@ function cleanup
 {
        if [ -e /tmp/zfs_001_neg.$$.txt ]
        then
-               $RM /tmp/zfs_001_neg.$$.txt
+               rm /tmp/zfs_001_neg.$$.txt
        fi
 }
 
 log_onexit cleanup
 log_assert "zfs shows a usage message when run as a user"
 
-eval "$ZFS > /tmp/zfs_001_neg.$$.txt 2>&1"
-log_must $GREP "usage: zfs command args" /tmp/zfs_001_neg.$$.txt
+eval "zfs > /tmp/zfs_001_neg.$$.txt 2>&1"
+log_must grep "usage: zfs command args" /tmp/zfs_001_neg.$$.txt
 
 log_pass "zfs shows a usage message when run as a user"
index 40f99378b3a6dab8ac876ae543cd70aea1de5ff1..56a74e4ae427823e6aa9ae28a20053266adcb8e0 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 #
 
 # check to see if we have zfs allow
-$ZFS 2>&1 | $GREP "allow" > /dev/null
+zfs 2>&1 | grep "allow" > /dev/null
 if (($? != 0)) then
        log_unsupported "ZFS allow not supported on this machine."
 fi
 
 log_assert "zfs allow returns an error when run as a user"
 
-log_must $ZFS allow $TESTPOOL/$TESTFS
-log_mustnot $ZFS allow $($LOGNAME) create $TESTPOOL/$TESTFS
+log_must zfs allow $TESTPOOL/$TESTFS
+log_mustnot zfs allow $(logname) create $TESTPOOL/$TESTFS
 
 # now verify that the above command actually did nothing by
 # checking for any allow output. ( if no allows are granted,
 # nothing should be output )
-OUTPUT=$($ZFS allow $TESTPOOL/$TESTFS | $GREP "Local+Descendent" )
+OUTPUT=$(zfs allow $TESTPOOL/$TESTFS | grep "Local+Descendent" )
 if [ -n "$OUTPUT" ]
 then
        log_fail "zfs allow permissions were granted on $TESTPOOL/$TESTFS"
index ccf5b4db32a9ae6b2aab6e9449684d5c49264579..7497553ed8a58822e3ce0a5a04efcad2e6a1b6e3 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -44,7 +44,7 @@
 #
 
 log_assert "zfs clone returns an error when run as a user"
-log_mustnot $ZFS clone $TESTPOOL/$TESTFS@snap $TESTPOOL/$TESTFS.myclone
+log_mustnot zfs clone $TESTPOOL/$TESTFS@snap $TESTPOOL/$TESTFS.myclone
 
 # check to see that the above command really did nothing
 if datasetexists $TESTPOOL/$TESTFS.myclone
index 2b5d9bfe31c479a2619728dfd4aefe259ff63e92..aa74bcf40c1f91c387c96a8059e80458499fc3e9 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -54,7 +54,7 @@ log_assert "Verify zfs create without parameters fails."
 
 typeset -i i=0
 while [[ $i -lt ${#args[*]} ]]; do
-       log_mustnot $ZFS ${args[i]}
+       log_mustnot zfs ${args[i]}
        ((i = i + 1))
 done
 
index 3beb68f6cb68d4a2073ec06cb6ff57aba134a213..fabba4f13e9c5623a0b3910d4a2e04bb15e86c55 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -60,7 +60,7 @@ log_assert "zfs destroy [-f|-r] [fs|snap]"
 
 typeset -i i=0
 while [[ $i -lt ${#args[*]} ]]; do
-       log_mustnot $ZFS ${args[i]}
+       log_mustnot zfs ${args[i]}
        ((i = i + 1))
 done
 
index c2d61a28787b75916da201e246f36c4f9ceefefc..439bc06ac9c0dfec832e90bb88402cfe7ab7a117 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -54,7 +54,7 @@ while [[ $i -lt ${#args[*]} ]]
 do
        PROP=${props[$i]}
        EXPECTED=${prop_vals[$i]}
-       ACTUAL=$( $ZFS get $PROP -o value -H snapdir $TESTPOOl/$TESTFS/prop )
+       ACTUAL=$( zfs get $PROP -o value -H snapdir $TESTPOOl/$TESTFS/prop )
        if [ "$ACTUAL" != "$EXPECTED" ]
        then
                log_fail "Property $PROP value was $ACTUAL, expected $EXPECTED"
index 61b9c878736c9779fa31e0a66cddb5897cecaa8f..284c9f76dff1468a94b48b27dd49fdf0cfd84e07 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 #
 
 log_assert "zfs inherit returns an error when run as a user"
-log_mustnot $ZFS inherit snapdir $TESTPOOL/$TESTFS/$TESTFS2
+log_mustnot zfs inherit snapdir $TESTPOOL/$TESTFS/$TESTFS2
 
 # check to see that the above command really did nothing
-PROP=$($ZFS get snapdir $TESTPOOL/$TESTFS)
+PROP=$(zfs get snapdir $TESTPOOL/$TESTFS)
 if [ "$PROP" = "visible" ]
 then
        log_fail "snapdir property inherited from the $TESTPOOL/$TESTFS!"
index d324f1c4900c6f92f172dce1d537795f3ea08e79..8e4c39bfce75cdd3d8131bdd889a6e7663d4e579 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 
 log_assert "zfs mount returns an error when run as a user"
 
-log_mustnot $ZFS mount $TESTPOOL/$TESTFS/$TESTFS2.unmounted
+log_mustnot zfs mount $TESTPOOL/$TESTFS/$TESTFS2.unmounted
 
 # now verify that the above command didn't do anything
-MOUNTED=$($MOUNT | $GREP $TESTPOOL/$TESTFS/$TESTFS2.unmounted)
+MOUNTED=$(mount | grep $TESTPOOL/$TESTFS/$TESTFS2.unmounted)
 if [ -n "$MOUNTED" ]
 then
        log_fail "Filesystem $TESTPOOL/$TESTFS/$TESTFS2.unmounted was mounted!"
index d6b17183be35b2526b12695e7b59ffa2360891c1..a96979a4776d18af403fc9a77fa77fc30f44e9f5 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,7 +45,7 @@
 
 log_assert "zfs promote returns an error when run as a user"
 
-log_mustnot $ZFS promote $TESTPOOL/$TESTFS/clone
+log_mustnot zfs promote $TESTPOOL/$TESTFS/clone
 
 # Now verify that the above command didn't do anything
 if datasetexists $TESTPOOL/$TESTFS/clone@snap
index ae07fef8497e8d1bbe05fdc1d649fe140e5ffb63..4f7ddf2e74bda350e99b721c4cbeeca14cccb085 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,7 +45,7 @@
 
 log_assert "zfs receive returns an error when run as a user"
 
-log_mustnot eval "$ZFS receive -d $TESTPOOL/$TESTFS/$TESTFS2 \
+log_mustnot eval "zfs receive -d $TESTPOOL/$TESTFS/$TESTFS2 \
  < /tmp/zfstest_datastream.dat"
 
 # verify that command actually did nothing
index 118b420512ec1e2ec532df3bd7133d6bfd82ffad..ac275b01e5f9ceca78f50cd7766c3ce600572b29 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,7 +45,7 @@
 
 log_assert "zfs rename returns an error when run as a user"
 
-log_mustnot $ZFS rename $TESTPOOL/$TESTFS/renameme $TESTPOOL/$TESTFS/renameme1
+log_mustnot zfs rename $TESTPOOL/$TESTFS/renameme $TESTPOOL/$TESTFS/renameme1
 
 # now verify the above command didn't actually do anything
 if datasetexists $TESTPOOL/$TESTFS/renameme1
index 02f3422b6a332cf6924c97748048314c6ef09cc9..51b5162decfc608d93056d9a8e82a553858b6eab 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -46,7 +46,7 @@
 
 log_assert "zfs rollback returns an error when run as a user"
 
-log_mustnot $ZFS rollback $TESTPOOL/$TESTFS@snap
+log_mustnot zfs rollback $TESTPOOL/$TESTFS@snap
 
 # now verify the above command didn't actually do anything
 
index 0e3af12913773b9dde0afeed6802233f3f80cf12..d5dfe37287da7acf7b7188eb922b5f5298c57182 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,14 +47,14 @@ function cleanup
 {
        if [ -e /tmp/zfstest_datastream.$$ ]
        then
-               log_must $RM /tmp/zfstest_datastream.$$
+               log_must rm /tmp/zfstest_datastream.$$
        fi
 }
 
 log_assert "zfs send returns an error when run as a user"
 log_onexit cleanup
 
-log_mustnot eval "$ZFS send $TESTPOOL/$TESTFS@snap > /tmp/zfstest_datastream.$$"
+log_mustnot eval "zfs send $TESTPOOL/$TESTFS@snap > /tmp/zfstest_datastream.$$"
 
 # Now check that the above command actually did nothing
 
index 9f1c57cd83ea7fef4e516bce652ea2f33279199a..54e7ee92d68140107b04db98ac8df7255d783a7b 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -56,10 +56,10 @@ do
        PROP=${props[$i]}
        EXPECTED=${prop_vals[$i]}
        NEW=${prop_new[$i]}
-       log_mustnot $ZFS set $PROP=$NEW $TESTPOOL/$TESTFS/prop
+       log_mustnot zfs set $PROP=$NEW $TESTPOOL/$TESTFS/prop
 
        # Now verify that the above command did nothing
-       ACTUAL=$($ZFS get $PROP -o value -H snapdir $TESTPOOl/$TESTFS/prop )
+       ACTUAL=$(zfs get $PROP -o value -H snapdir $TESTPOOl/$TESTFS/prop )
        if [ "$ACTUAL" != "$EXPECTED" ]
        then
                log_fail "Property $PROP was set to $ACTUAL, expected $EXPECTED"
index 4127234ee99791a083a199f808d829a0736706a2..1cc1783c8abb9c9bb067c429a9e8fe11b74230a2 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,7 +52,7 @@ then
        log_fail "$TESTPOOL/$TESTFS/unshared was incorrectly shared initially!"
 fi
 
-log_mustnot $ZFS share $TESTPOOL/$TESTFS/unshared
+log_mustnot zfs share $TESTPOOL/$TESTFS/unshared
 
 # Now verify that the above command didn't actually do anything
 if is_shared $TESTDIR/unshared
index 88183b14098b1f127c1fdb14d6c89350fd0e7e0b..232d9574b51c34b93f7241e14ebf08af4f5433d9 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,7 +45,7 @@
 
 log_assert "zfs snapshot returns an error when run as a user"
 
-log_mustnot $ZFS snapshot $TESTPOOL/$TESTFS@usersnap1
+log_mustnot zfs snapshot $TESTPOOL/$TESTFS@usersnap1
 
 # Now verify that the above command didn't actually do anything
 if datasetexists $TESTPOOL/$TESTFS@usersnap1
index 106e0f87c12840bccaa2f1a326412060212b8cb4..98383a08762e893cf2fb1f83d498ecc0dbc5cd65 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 #
 
 # check to see if we have zfs unallow
-$ZFS 2>&1 | $GREP "unallow" > /dev/null
+zfs 2>&1 | grep "unallow" > /dev/null
 if (($? != 0)) then
         log_unsupported "ZFS unallow not supported on this machine."
 fi
 
 log_assert "zfs unallow returns an error when run as a user"
 
-log_mustnot $ZFS unallow everyone $TESTPOOL/$TESTFS/allowed
+log_mustnot zfs unallow everyone $TESTPOOL/$TESTFS/allowed
 
 # now check with zfs allow to see if the permissions are still there
-OUTPUT=$($ZFS allow $TESTPOOL/$TESTFS/allowed | $GREP "Local+Descendent" )
+OUTPUT=$(zfs allow $TESTPOOL/$TESTFS/allowed | grep "Local+Descendent" )
 if [ -z "$OUTPUT" ]
 then
        log_fail "Error - create permissions were unallowed on \
index e0c703f900c17f9858e8a6637cb65a5a9dce59ae..5b0a773f15a9f18d30e279d5b835f0e8f013bc4d 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -58,7 +58,7 @@ log_assert "zfs u[n]mount [-f] [mountpoint|fs|snap]"
 
 typeset -i i=0
 while [[ $i -lt ${#args[*]} ]]; do
-       log_mustnot $ZFS ${args[i]}
+       log_mustnot zfs ${args[i]}
        ((i = i + 1))
 done
 
index 4849244d84a879c9748403a7ee50f42271bb2915..48d4d5294e73684b6364a20cd0b410fdd494d7e4 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -53,7 +53,7 @@ then
        log_fail "$TESTPOOL/$TESTFS/shared was not shared initially at all!"
 fi
 
-log_mustnot $ZFS unshare $TESTPOOL/$TESTFS/shared
+log_mustnot zfs unshare $TESTPOOL/$TESTFS/shared
 
 # now verify that the above command didn't do anything
 if not_shared $TESTDIR/shared
index 290827d14f3b7badd30bb98d290e005d9404da62..fd65feb8c0014a3a04e569956a29675a31d4f670 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -44,7 +44,7 @@
 #
 
 # check to see if we have upgrade capability
-$ZFS upgrade > /dev/null 2>&1
+zfs upgrade > /dev/null 2>&1
 HAS_UPGRADE=$?
 if [ $HAS_UPGRADE -ne 0 ]
 then
@@ -54,11 +54,11 @@ fi
 log_assert "zfs upgrade returns an error when run as a user"
 
 
-log_mustnot $ZFS upgrade $TESTPOOL/$TESTFS/version1
+log_mustnot zfs upgrade $TESTPOOL/$TESTFS/version1
 
 # now check to see the above command didn't do anything
-VERSION=$($ZFS upgrade $TESTPOOL/$TESTFS/version1 2>&1 \
-        | $GREP "already at this version")
+VERSION=$(zfs upgrade $TESTPOOL/$TESTFS/version1 2>&1 \
+        | grep "already at this version")
 if [ -n "$VERSION" ]
 then
        log_fail "A filesystem was upgraded!"
index e4512bc493e6bd18b2a732097ce2b604e622bb1b..d71668d896ffe97ab84a161d1dbfb14c5e2a83f8 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,14 +47,14 @@ function cleanup
 {
        if [ -e /tmp/zpool_001_neg.$$.txt ]
        then
-               $RM /tmp/zpool_001_neg.$$.txt
+               rm /tmp/zpool_001_neg.$$.txt
        fi
 }
 
 log_onexit cleanup
 log_assert "zpool shows a usage message when run as a user"
 
-eval "$ZPOOL > /tmp/zpool_001_neg.$$.txt 2>&1"
-log_must $GREP "usage: zpool command args" /tmp/zpool_001_neg.$$.txt
+eval "zpool > /tmp/zpool_001_neg.$$.txt 2>&1"
+log_must grep "usage: zpool command args" /tmp/zpool_001_neg.$$.txt
 
 log_pass "zpool shows a usage message when run as a user"
index 9858f28849614cd6e25f1280c92f1455aa4dc494..7bcd911543ede76149d51e143238e2f9d4032c8b 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -70,7 +70,7 @@ log_assert "zpool add [-fn] pool_name vdev"
 
 typeset -i i=0
 while [[ $i -lt ${#args[*]} ]]; do
-       log_mustnot $ZPOOL ${args[i]}
+       log_mustnot zpool ${args[i]}
        ((i = i + 1))
 done
 
index e1d883d28b6dd8b422e16a2a049d4c56c20fb636..b0fadca8c9fe060ca452abb047c160a7e510e23b 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,7 +45,7 @@
 
 function check_for_attach
 {
-       RESULT=$($ZPOOL status -v $TESTPOOL.virt | $GREP disk-additional.dat)
+       RESULT=$(zpool status -v $TESTPOOL.virt | grep disk-additional.dat)
        if [ -n "$RESULT" ]
        then
                log_fail "A disk was attached to the pool!"
@@ -56,11 +56,11 @@ verify_runnable "global"
 
 log_assert "zpool attach returns an error when run as a user"
 
-log_mustnot $ZPOOL attach $TESTPOOL.virt /$TESTDIR/disk1.dat \
+log_mustnot zpool attach $TESTPOOL.virt /$TESTDIR/disk1.dat \
        /$TESTDIR/disk-additional.dat
 check_for_attach
 
-log_mustnot $ZPOOL attach -f $TESTPOOL.virt /$TESTDIR/disk1.dat \
+log_mustnot zpool attach -f $TESTPOOL.virt /$TESTDIR/disk1.dat \
         /$TESTDIR/disk-additional.dat
 check_for_attach
 
index 0100bed1cc4206c0803bfa89fede4f58acaa7e5d..5d6ef5ff3e4d64e1db3e4f76b1c623ea72743ce1 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,6 +47,6 @@ verify_runnable "global"
 
 log_assert "zpool clear returns an error when run as a user"
 
-log_mustnot $ZPOOL clear $TESTPOOL
+log_mustnot zpool clear $TESTPOOL
 
 log_pass "zpool clear returns an error when run as a user"
index 592c51a100589bea846c919fe50d0d322f66f662..77d08ee39009624ff8ce923335499ecc9994ae15 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -70,7 +70,7 @@ log_assert "zpool create [-fn] pool_name vdev"
 
 typeset -i i=0
 while [[ $i -lt ${#args[*]} ]]; do
-       log_mustnot $ZPOOL ${args[i]}
+       log_mustnot zpool ${args[i]}
        ((i = i + 1))
 done
 
index 4deb2281a2f76fd92a637f432131400ec99dd6c6..acc93fe748269bcd3074c851589d0aaa1635cfd7 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,7 +52,7 @@ log_assert "zpool destroy [-f] [pool_name ...]"
 
 typeset -i i=0
 while [[ $i -lt ${#args[*]} ]]; do
-       log_mustnot $ZPOOL ${args[i]}
+       log_mustnot zpool ${args[i]}
        ((i = i + 1))
 done
 
index c5e8ab12b0540302d2fe57131a3d334181ba225a..dbc540cebbe7d908ef589be3c55e1f3764dbc509 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,9 +47,9 @@ verify_runnable "global"
 
 log_assert "zpool detach returns an error when run as a user"
 
-log_mustnot $ZPOOL detach $TESTPOOL.virt /$TESTDIR/disk1.dat
+log_mustnot zpool detach $TESTPOOL.virt /$TESTDIR/disk1.dat
 
-RESULT=$($ZPOOL status -v $TESTPOOL.virt | $GREP disk1.dat)
+RESULT=$(zpool status -v $TESTPOOL.virt | grep disk1.dat)
 if [ -z "$RESULT" ]
 then
        log_fail "A disk was detached from the pool!"
index 49151909fcecd2eb2586296cc332f93fa1d7af39..9bca4668d3d19f3ce247ef65faeb1e30660e170d 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -44,7 +44,7 @@
 
 function check_for_export
 {
-       RESULT=$($ZPOOL list | $GREP $TESTPOOL.virt )
+       RESULT=$(zpool list | grep $TESTPOOL.virt )
        if [ -z "$RESULT" ]
        then
                log_fail "A pool was exported!"
@@ -56,10 +56,10 @@ verify_runnable "global"
 
 log_assert "zpool export returns an error when run as a user"
 
-log_mustnot $ZPOOL export $TESTPOOL.virt
+log_mustnot zpool export $TESTPOOL.virt
 check_for_export
 
-log_mustnot $ZPOOL export -f $TESTPOOL.virt
+log_mustnot zpool export -f $TESTPOOL.virt
 check_for_export
 
 log_pass "zpool export returns an error when run as a user"
index 697ec6ea5c1e94393d77759376775aa88983293d..7415cebf236b4b118a2a6f90510587312feabfc7 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -54,7 +54,7 @@ while [[ $i -lt ${#args[*]} ]]
 do
        PROP=${props[$i]}
        EXPECTED=${prop_vals[$i]}
-       ACTUAL=$( $ZPOOL get $PROP $TESTPOOL | $GREP $PROP | $AWK '{print $1}' )
+       ACTUAL=$( zpool get $PROP $TESTPOOL | grep $PROP | awk '{print $1}' )
        if [ "$ACTUAL" != "$EXPECTED" ]
        then
                log_fail "Property $PROP value was $ACTUAL, expected $EXPECTED"
@@ -62,6 +62,6 @@ do
         i=$(( $i + 1 ))
 done
 
-log_must $ZPOOL get all $TESTPOOL
+log_must zpool get all $TESTPOOL
 
 log_pass "zpool get works when run as a user"
index 9a304b7e6fc24b262a2a495bf572831b31864733..47082e3524e3f22d0f062063f9582762340dbfc2 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -46,10 +46,10 @@ verify_runnable "global"
 
 log_assert "zpool history returns an error when run as a user"
 
-log_mustnot $ZPOOL history
-log_mustnot $ZPOOL history $TESTPOOL
-log_mustnot $ZPOOL history -i $TESTPOOL
-log_mustnot $ZPOOL history -l $TESTPOOL
-log_mustnot $ZPOOL history -il $TESTPOOL
+log_mustnot zpool history
+log_mustnot zpool history $TESTPOOL
+log_mustnot zpool history -i $TESTPOOL
+log_mustnot zpool history -l $TESTPOOL
+log_mustnot zpool history -il $TESTPOOL
 
 log_assert "zpool history returns an error when run as a user"
index b15a451ff9a0eaa1f2330d958d44b8de155bf12f..09fd775ff4cc7b8cb02f5f7088506653a029d455 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,7 +45,7 @@
 
 function check_for_import
 {
-       RESULT=$($ZPOOL list -H -o name | $GREP $TESTPOOL.exported)
+       RESULT=$(zpool list -H -o name | grep $TESTPOOL.exported)
        if [ -n "$RESULT" ]
        then
                log_fail "Pool $TESTPOOL.export was successfully imported!"
@@ -55,12 +55,12 @@ function check_for_import
 verify_runnable "global"
 
 log_assert "zpool import returns an error when run as a user"
-log_mustnot $ZPOOL import
+log_mustnot zpool import
 
-log_mustnot $ZPOOL import -a
+log_mustnot zpool import -a
 check_for_import
 
-log_mustnot $ZPOOL import -d /$TESTDIR $TESTPOOL.exported
+log_mustnot zpool import -d /$TESTDIR $TESTPOOL.exported
 check_for_import
 
 log_pass "zpool import returns an error when run as a user"
index dfcef4dd19db60c0b768ade230718bb7877a179b..f3460186725c341d24a19a407fc584507c5fd447 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -57,7 +57,7 @@ log_assert "Executing 'zpool import' by regular user fails"
 
 typeset -i i=0
 while [[ $i -lt ${#args[*]} ]]; do
-       log_mustnot $ZPOOL import ${args[i]}
+       log_mustnot zpool import ${args[i]}
        ((i = i + 1))
 done
 
index 952c921fe8f197a4d21e10a267a95e3ea89345a4..523883c6f0dd4cea290be1d98e38b88bbfe5a5b8 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,8 +45,8 @@
 
 function check_for_offline
 {
-       RESULT=$($ZPOOL status -v $TESTPOOL.virt | $GREP disk-1.dat \
-                | $GREP OFFLINE )
+       RESULT=$(zpool status -v $TESTPOOL.virt | grep disk-1.dat \
+                | grep OFFLINE )
        if [ -n "$RESULT" ]
        then
                log_fail "A disk was taken offline!"
@@ -57,10 +57,10 @@ verify_runnable "global"
 
 log_assert "zpool offline returns an error when run as a user"
 
-log_mustnot $ZPOOL offline $TESTPOOL.virt /$TESTDIR/disk-1.dat
+log_mustnot zpool offline $TESTPOOL.virt /$TESTDIR/disk-1.dat
 check_for_offline
 
-log_mustnot $ZPOOL offline -t $TESTPOOL.virt /$TESTDIR/disk-1.dat
+log_mustnot zpool offline -t $TESTPOOL.virt /$TESTDIR/disk-1.dat
 check_for_offline
 
 log_pass "zpool offline returns an error when run as a user"
index 36d3aef3a0dc6f121ad395edda27034343b0f1b8..b89cf07ac1839e5a809e7dcc9a8ed6ba5a2c9603 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,8 +45,8 @@
 
 function check_for_online
 {
-       RESULT=$($ZPOOL status -v $TESTPOOL.virt | $GREP disk-offline.dat \
-                | $GREP ONLINE )
+       RESULT=$(zpool status -v $TESTPOOL.virt | grep disk-offline.dat \
+                | grep ONLINE )
        if [ -n "$RESULT" ]
        then
                log_fail "A disk was brough online!"
@@ -57,10 +57,10 @@ verify_runnable "global"
 
 log_assert "zpool online returns an error when run as a user"
 
-log_mustnot $ZPOOL online $TESTPOOL.virt /$TESTDIR/disk-offline.dat
+log_mustnot zpool online $TESTPOOL.virt /$TESTDIR/disk-offline.dat
 check_for_online
 
-log_mustnot $ZPOOL online -t $TESTPOOL.virt /$TESTDIR/disk-offline.dat
+log_mustnot zpool online -t $TESTPOOL.virt /$TESTDIR/disk-offline.dat
 check_for_online
 
 log_pass "zpool online returns an error when run as a user"
index 38acd5f4d6413cd4d7a7d9e9f789797910651a7f..1168e6bdac9fea414d7010ee7a156a5eb147a290 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,9 +47,9 @@ verify_runnable "global"
 
 log_assert "zpool remove returns an error when run as a user"
 
-log_mustnot $ZPOOL remove $TESTPOOL.virt /$TESTDIR/disk-spare1.dat
+log_mustnot zpool remove $TESTPOOL.virt /$TESTDIR/disk-spare1.dat
 
-RESULT=$($ZPOOL status -v $TESTPOOL.virt | $GREP disk-spare1.dat)
+RESULT=$(zpool status -v $TESTPOOL.virt | grep disk-spare1.dat)
 if [ -z "$RESULT" ]
 then
        log_fail "A disk was removed from the pool!"
index b933d41954a843b6fa5227f528acc1261c4a002f..6211e6575540459ed2d2885e1948622011428966 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,8 +45,8 @@
 
 function check_for_replace
 {
-       $SLEEP 10
-       RESULT=$($ZPOOL status -v $TESTPOOL.virt | $GREP disk-additional.dat)
+       sleep 10
+       RESULT=$(zpool status -v $TESTPOOL.virt | grep disk-additional.dat)
        if [ -n "$RESULT" ]
        then
                log_fail "A disk was replaced in the pool!"
@@ -57,11 +57,11 @@ verify_runnable "global"
 
 log_assert "zpool replace returns an error when run as a user"
 
-log_mustnot $ZPOOL replace $TESTPOOL.virt /$TESTDIR/disk-1.dat \
+log_mustnot zpool replace $TESTPOOL.virt /$TESTDIR/disk-1.dat \
         /$TESTDIR/disk-additional.dat
 check_for_replace
 
-log_mustnot $ZPOOL replace -f $TESTPOOL.virt /$TESTDIR/disk-1.dat \
+log_mustnot zpool replace -f $TESTPOOL.virt /$TESTDIR/disk-1.dat \
  /$TESTDIR/disk-additional.dat
 check_for_replace
 
index ddc06f88f8bf4239373600257608ebc0fd35674e..9af7a3e2d58b4a05b5d435b2743d623f6b0764f4 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,7 +47,7 @@ verify_runnable "global"
 
 log_assert "zpool scrub returns an error when run as a user"
 
-log_mustnot $ZPOOL scrub $TESTPOOL
-log_mustnot $ZPOOL scrub -s $TESTPOOL
+log_mustnot zpool scrub $TESTPOOL
+log_mustnot zpool scrub -s $TESTPOOL
 
 log_pass "zpool scrub returns an error when run as a user"
index bcf3a908a5f57b823b86d2c7b994844b43736ca1..941e20c0010e71e8519c89f795e8ff82291393ea 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -59,7 +59,7 @@ do
        log_mustnot $POOL set $PROP=$NEW $TESTPOOL
 
        # Now verify that the above command did nothing
-       ACTUAL=$( $ZPOOL get $PROP $TESTPOOL | $GREP $PROP | $AWK '{print $1}' )
+       ACTUAL=$( zpool get $PROP $TESTPOOL | grep $PROP | awk '{print $1}' )
        if [ "$ACTUAL" != "$EXPECTED" ]
        then
                log_fail "Property $PROP was set to $ACTUAL, expected $EXPECTED"
index 4c6f11c0a859ed889fafb9bef03982fb17b56245..a3f839de493594b570afac0b0ba4171ad8039917 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 
 function check_pool_status
 {
-       RESULT=$($GREP "pool:" /tmp/pool-status.$$)
+       RESULT=$(grep "pool:" /tmp/pool-status.$$)
        if [ -z "$RESULT" ]
        then
                log_fail "No pool: string found in zpool status output!"
        fi
-       $RM /tmp/pool-status.$$
+       rm /tmp/pool-status.$$
 }
 
 verify_runnable "global"
 
 log_assert "zpool status works when run as a user"
 
-log_must eval "$ZPOOL status > /tmp/pool-status.$$"
+log_must eval "zpool status > /tmp/pool-status.$$"
 check_pool_status
 
-log_must eval "$ZPOOL status -v > /tmp/pool-status.$$"
+log_must eval "zpool status -v > /tmp/pool-status.$$"
 check_pool_status
 
-log_must eval "$ZPOOL status $TESTPOOL> /tmp/pool-status.$$"
+log_must eval "zpool status $TESTPOOL> /tmp/pool-status.$$"
 check_pool_status
 
-log_must eval "$ZPOOL status -v $TESTPOOL > /tmp/pool-status.$$"
+log_must eval "zpool status -v $TESTPOOL > /tmp/pool-status.$$"
 check_pool_status
 
 # Make sure -c option works, and that VDEV_PATH and VDEV_UPATH get set.
@@ -74,9 +74,9 @@ check_pool_status
 # grep for '^\s+/' to just get the vdevs (not pools).  All vdevs will start with
 # a '/' when we specify the path (-P) flag. We check for "{}" to see if one
 # of the VDEV variables isn't set.
-C1=$($ZPOOL status -P | $GREP -E '^\s+/' | $WC -l)
-C2=$($ZPOOL status -P -c 'echo vdev_test{$VDEV_PATH}{$VDEV_UPATH}' | \
-    $GREP -E '^\s+/' | $GREP -v '{}' | $WC -l)
+C1=$(zpool status -P | grep -E '^\s+/' | wc -l)
+C2=$(zpool status -P -c 'echo vdev_test{$VDEV_PATH}{$VDEV_UPATH}' | \
+    grep -E '^\s+/' | grep -v '{}' | wc -l)
 
 if [ "$C1" != "$C2" ] ; then
        log_fail "zpool status -c option failed.  Expected $C1 vdevs, got $C2"
@@ -85,7 +85,7 @@ else
 fi
 
 # $TESTPOOL.virt has an offline device, so -x will show it
-log_must eval "$ZPOOL status -x $TESTPOOL.virt > /tmp/pool-status.$$"
+log_must eval "zpool status -x $TESTPOOL.virt > /tmp/pool-status.$$"
 check_pool_status
 
 log_pass "zpool status works when run as a user"
index 02c33ca152c4464320cdd3194f19ae697f88c855..f058bf5c6e4500f1b07fc413afd4aa20a95ac094 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -49,14 +49,14 @@ log_assert "zpool upgrade returns an error when run as a user"
 
 log_onexit cleanup
 # zpool upgrade returns 0 when it can't do anything
-log_must $ZPOOL upgrade $TESTPOOL.virt
+log_must zpool upgrade $TESTPOOL.virt
 
 # Now try to upgrade our version 1 pool
-log_mustnot $ZPOOL upgrade v1-pool
+log_mustnot zpool upgrade v1-pool
 
 # if the pool has been upgraded, then v1-pool won't be listed in the output
 # of zpool upgrade anymore
-RESULT=$($ZPOOL upgrade | $GREP v1-pool)
+RESULT=$(zpool upgrade | grep v1-pool)
 if [ -z "$RESULT" ]
 then
        log_fail "A pool was upgraded successfully!"
index 66bcc06d869b82ad463682f0336c8040aa52867f..b4c588282ff7123e480ad1f8602d2d69d4bea41f 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -42,23 +42,23 @@ set -A cksumarray $CKSUMOPTS
 typeset -i index=0
 for dataset in $DATASETS
 do
-       log_must $ZFS create $TESTPOOL/$TESTFS/$dataset
-       $SLEEP 1
-        log_must $ZFS snapshot $TESTPOOL/$TESTFS/${dataset}@snap
+       log_must zfs create $TESTPOOL/$TESTFS/$dataset
+       sleep 1
+        log_must zfs snapshot $TESTPOOL/$TESTFS/${dataset}@snap
 
-       $SLEEP 1
+       sleep 1
        if is_global_zone ; then
-               log_must $ZFS create -V 64M $TESTPOOL/$TESTFS/${dataset}-vol
-               $SLEEP 1
-               log_must $ZFS snapshot $TESTPOOL/$TESTFS/${dataset}-vol@snap
+               log_must zfs create -V 64M $TESTPOOL/$TESTFS/${dataset}-vol
+               sleep 1
+               log_must zfs snapshot $TESTPOOL/$TESTFS/${dataset}-vol@snap
        fi
 
        # sleep to ensure that the datasets have different creation dates
-       $SLEEP 1
-       log_must $ZFS set checksum=${cksumarray[$index]} \
+       sleep 1
+       log_must zfs set checksum=${cksumarray[$index]} \
                $TESTPOOL/$TESTFS/$dataset
        if datasetexists $TESTPOOL/$TESTFS/${dataset}-vol; then
-               log_must $ZFS set checksum=${cksumarray[$index]} \
+               log_must zfs set checksum=${cksumarray[$index]} \
                        $TESTPOOL/$TESTFS/${dataset}-vol
        fi
 
index e64739dc317ad474153ce1852e08aecd38ab51e8..03c9d1f07a876f118352ce7ef3e474147c707ff7 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -54,7 +54,7 @@ function verify_sort { # command list name
                ACTUAL=$(basename $dataset)
                if [ "$dataset" != "$TESTPOOL/$TESTFS" ]
                then
-                       EXPECTED=$($ECHO $list | $AWK "{print \$$index}")
+                       EXPECTED=$(echo $list | awk "{print \$$index}")
                        if [ "$ACTUAL" != "$EXPECTED" ]
                        then
                                log_note "WARNING:" \
@@ -67,7 +67,7 @@ function verify_sort { # command list name
        done
 
        # finally check to see if we have the expected number of elements
-       if [ $index -ne $($ECHO $list | $AWK '{print split($0,arr)+1}') ]
+       if [ $index -ne $(echo $list | awk '{print split($0,arr)+1}') ]
        then
                log_fail "Warning: " \
                        "unexpected number of filesystems found in list output!"
@@ -85,7 +85,7 @@ function verify_reverse_sort { # command list name
        typeset name=$3
 
        # set our index to the be number of elements in the list
-       typeset -i index=$($ECHO $list | $AWK '{print split($0,arr)}')
+       typeset -i index=$(echo $list | awk '{print split($0,arr)}')
 
        log_note "Checking reverse sort by '$name'," \
                "expecting the reverse of '$list'"
@@ -96,7 +96,7 @@ function verify_reverse_sort { # command list name
                ACTUAL=$(basename $dataset)
                if [ "$dataset" != "$TESTPOOL/$TESTFS" ]
                then
-                       EXPECTED=$($ECHO $list | $AWK "{print \$$index}")
+                       EXPECTED=$(echo $list | awk "{print \$$index}")
                        if [ "$ACTUAL" != "$EXPECTED" ]
                        then
                                log_note "Warning:" \
index b0af4ebd9249587f3a019d30d3f36a750d850206..5d995a79ba3328a87e68c2686b5e80b6fd7bcde9 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -100,7 +100,7 @@ log_assert "Verify 'zfs list [-rH] [-o property[,prop]*] [fs|clct|vol]'."
 
 typeset -i i=0
 while [[ $i -lt ${#args[*]} ]]; do
-       log_must eval "$ZFS ${args[i]} > /dev/null"
+       log_must eval "zfs ${args[i]} > /dev/null"
        ((i = i + 1))
 done
 
@@ -109,7 +109,7 @@ done
 cd /tmp
 typeset -i i=0
 while [[ $i -lt ${#pathargs[*]} ]]; do
-       log_must eval "$ZFS ${pathargs[i]} > /dev/null"
+       log_must eval "zfs ${pathargs[i]} > /dev/null"
        ((i = i + 1))
 done
 
index 3d546ecca87d69a12918574ff971f799b9ec34c2..382b2cb7f0b1b125fa5404437897441be680bfe6 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cli_user/zfs_list/zfs_list.kshlib
@@ -97,80 +97,80 @@ LC_ALL=C; export LC_ALL
 
 # sort by creation
 verify_sort \
-       "$ZFS list -H -r -o name -s creation -t filesystem $TESTPOOL/$TESTFS" \
+       "zfs list -H -r -o name -s creation -t filesystem $TESTPOOL/$TESTFS" \
        "$fs_creation" "creation date"
 if is_global_zone ; then
        verify_sort \
-       "$ZFS list -H -r -o name -s creation -t volume $TESTPOOL/$TESTFS" \
+       "zfs list -H -r -o name -s creation -t volume $TESTPOOL/$TESTFS" \
        "$vol_creation" "creation date"
 fi
 verify_sort \
-       "$ZFS list -H -r -o name -s creation -t snapshot $TESTPOOL/$TESTFS" \
+       "zfs list -H -r -o name -s creation -t snapshot $TESTPOOL/$TESTFS" \
        "$snap_creation" "creation date"
 
 # sort by checksum
 verify_sort \
-       "$ZFS list -H -r -o name -s checksum -t filesystem $TESTPOOL/$TESTFS" \
+       "zfs list -H -r -o name -s checksum -t filesystem $TESTPOOL/$TESTFS" \
        "$fs_cksum" "checksum"
 if is_global_zone ; then
        verify_sort \
-       "$ZFS list -H -r -o name -s checksum -t volume $TESTPOOL/$TESTFS" \
+       "zfs list -H -r -o name -s checksum -t volume $TESTPOOL/$TESTFS" \
        "$vol_cksum" "checksum"
 fi
 verify_sort \
-       "$ZFS list -H -r -o name -s checksum -t snapshot $TESTPOOL/$TESTFS" \
+       "zfs list -H -r -o name -s checksum -t snapshot $TESTPOOL/$TESTFS" \
        "$snap_cksum" "checksum"
 verify_sort \
-       "$ZFS list -H -r -o name -S checksum -t snapshot $TESTPOOL/$TESTFS" \
+       "zfs list -H -r -o name -S checksum -t snapshot $TESTPOOL/$TESTFS" \
        "$snap_cksum" "checksum"
 
 # sort by name
 verify_sort \
-       "$ZFS list -H -r -o name -s name -t filesystem $TESTPOOL/$TESTFS" \
+       "zfs list -H -r -o name -s name -t filesystem $TESTPOOL/$TESTFS" \
        "$fs_name" "name"
 if is_global_zone ; then
        verify_sort \
-       "$ZFS list -H -r -o name -s name -t volume $TESTPOOL/$TESTFS" \
+       "zfs list -H -r -o name -s name -t volume $TESTPOOL/$TESTFS" \
        "$vol_name" "name"
 fi
 verify_sort \
-       "$ZFS list -H -r -o name -s name -t snapshot $TESTPOOL/$TESTFS" \
+       "zfs list -H -r -o name -s name -t snapshot $TESTPOOL/$TESTFS" \
        "$snap_name" "name"
 
 # reverse sort by creation
 verify_reverse_sort \
-       "$ZFS list -H -r -o name -S creation -t filesystem $TESTPOOL/$TESTFS" \
+       "zfs list -H -r -o name -S creation -t filesystem $TESTPOOL/$TESTFS" \
        "$fs_creation" "creation date"
 if is_global_zone ; then
        verify_reverse_sort \
-       "$ZFS list -H -r -o name -S creation -t volume $TESTPOOL/$TESTFS" \
+       "zfs list -H -r -o name -S creation -t volume $TESTPOOL/$TESTFS" \
        "$vol_creation" "creation date"
 fi
 verify_reverse_sort \
-       "$ZFS list -H -r -o name -S creation -t snapshot $TESTPOOL/$TESTFS" \
+       "zfs list -H -r -o name -S creation -t snapshot $TESTPOOL/$TESTFS" \
        "$snap_creation" "creation date"
 
 # reverse sort by checksum
 verify_reverse_sort \
-       "$ZFS list -H -r -o name -S checksum -t filesystem $TESTPOOL/$TESTFS" \
+       "zfs list -H -r -o name -S checksum -t filesystem $TESTPOOL/$TESTFS" \
        "$fs_rev_cksum" "checksum"
 if is_global_zone ; then
        verify_reverse_sort \
-       "$ZFS list -H -r -o name -S checksum -t volume $TESTPOOL/$TESTFS" \
+       "zfs list -H -r -o name -S checksum -t volume $TESTPOOL/$TESTFS" \
        "$vol_rev_cksum" "checksum"
 fi
 
 # reverse sort by name
 verify_reverse_sort \
-       "$ZFS list -H -r -o name -S name -t filesystem $TESTPOOL/$TESTFS"\
+       "zfs list -H -r -o name -S name -t filesystem $TESTPOOL/$TESTFS"\
        "$fs_name" "name"
 if is_global_zone ; then
        verify_reverse_sort \
-       "$ZFS list -H -r -o name -S name -t volume $TESTPOOL/$TESTFS"\
+       "zfs list -H -r -o name -S name -t volume $TESTPOOL/$TESTFS"\
        "$vol_name" "name"
 fi
 verify_reverse_sort \
-       "$ZFS list -H -r -o name -S name -t snapshot $TESTPOOL/$TESTFS"\
+       "zfs list -H -r -o name -S name -t snapshot $TESTPOOL/$TESTFS"\
        "$snap_name" "name"
 
 log_pass "The sort functionality in 'zfs list' works as expected."
index f685456d78c30a6a1edf07695f9ecb72981b4fba..3c27cbf32a5bd65ce1517999cbbd9c4f51d8b99b 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,7 +45,7 @@
 function cleanup
 {
        if [[ -f $tmpfile ]]; then
-               $RM -f $tmpfile
+               rm -f $tmpfile
        fi
 }
 
@@ -64,9 +64,9 @@ done
 cd /tmp
 
 for path in $TESTPOOL/$TESTFS $TESTDIR ./../$TESTDIR ; do
-       $ZFS list -rH -o name $path > $tmpfile
+       zfs list -rH -o name $path > $tmpfile
        for fs in $children ; do
-               $GREP "^${fs}$" $tmpfile > /dev/null 2>&1
+               grep "^${fs}$" $tmpfile > /dev/null 2>&1
                if (( $? != 0 )); then
                        log_fail "$fs not shown in the output list."
                fi
index 13d6233d3c6f961da048a53243910b2c96a7a4b8..5d1114dacfa131769e447b7c4c6db66734690f60 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -55,8 +55,8 @@ paths="$TESTPOOL/NONEXISTFS $TESTPOOL/$TESTFS/NONEXISTFS \
 cd /tmp
 
 for fs in $paths ; do
-       log_mustnot $ZFS list $fs
-       log_mustnot $ZFS list -r $fs
+       log_mustnot zfs list $fs
+       log_mustnot zfs list -r $fs
 done
 
 log_pass "'zfs list [-r]' fails while the given dataset/path does not exist " \
index 901730c04880efca97f4066ebddf2160004d7250..d881b831ffbc196ba3b7ae1fa2ee15485639faaf 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cli_root/zfs_get/zfs_get_list_d.kshlib
@@ -50,8 +50,8 @@ fi
 
 function cleanup
 {
-       log_must $RM -f $DEPTH_OUTPUT
-       log_must $RM -f $EXPECT_OUTPUT
+       log_must rm -f $DEPTH_OUTPUT
+       log_must rm -f $EXPECT_OUTPUT
 }
 
 log_onexit cleanup
@@ -74,14 +74,14 @@ for dp in ${depth_array[@]}; do
        while (( fs<${#fs_type[*]} )); do
                if [[ "$dp" == "0" ]] && \
                  [[ "${fs_type[$fs]}" == "volume" || "${fs_type[$fs]}" == "snapshot" ]]; then
-                       log_must eval "$ZFS list -H -d $dp -o name -t ${fs_type[$fs]} $DEPTH_FS > $DEPTH_OUTPUT"
+                       log_must eval "zfs list -H -d $dp -o name -t ${fs_type[$fs]} $DEPTH_FS > $DEPTH_OUTPUT"
                        [[ -s "$DEPTH_OUTPUT" ]] && \
                                log_fail "$DEPTH_OUTPUT should be null."
-                       log_mustnot $ZFS list -rH -o name -t ${fs_type[$fs]} $DEPTH_FS | $EGREP -e '$eg_opt'
+                       log_mustnot zfs list -rH -o name -t ${fs_type[$fs]} $DEPTH_FS | egrep -e '$eg_opt'
                else
-                       log_must eval "$ZFS list -H -d $dp -o name -t ${fs_type[$fs]} $DEPTH_FS > $DEPTH_OUTPUT"
-                       log_must eval "$ZFS list -rH -o name -t ${fs_type[$fs]} $DEPTH_FS | $EGREP -e '$eg_opt' > $EXPECT_OUTPUT"
-                       log_must $DIFF $DEPTH_OUTPUT $EXPECT_OUTPUT
+                       log_must eval "zfs list -H -d $dp -o name -t ${fs_type[$fs]} $DEPTH_FS > $DEPTH_OUTPUT"
+                       log_must eval "zfs list -rH -o name -t ${fs_type[$fs]} $DEPTH_FS | egrep -e '$eg_opt' > $EXPECT_OUTPUT"
+                       log_must diff $DEPTH_OUTPUT $EXPECT_OUTPUT
                fi
                (( fs+=1 ))
        done
index 74c0b8b71b47f64701fad4d367a475dc215f7135..4f3504ac41bae4b69b108a788dc76662287267d2 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/cli_root/zfs_get/zfs_get_list_d.kshlib
@@ -49,7 +49,7 @@ set -A  badargs "a" "AB" "aBc" "2A" "a2b" "aB2" "-1" "-32" "-999"
 typeset -i i=0
 while (( i < ${#badargs[*]} ))
 do
-       log_mustnot eval "$ZFS list -d ${badargs[i]} $DEPTH_FS >/dev/null 2>&1"
+       log_mustnot eval "zfs list -d ${badargs[i]} $DEPTH_FS >/dev/null 2>&1"
        (( i = i + 1 ))
 done
 
index a1fac987eca4e57d65900c0010b28d1b8a63dc98..d99d42984780b03eb1ac07e11b06813c232b0731 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -56,7 +56,7 @@ log_assert "zpool iostat [pool_name ...] [interval]"
 
 typeset -i i=0
 while [[ $i -lt ${#args[*]} ]]; do
-       log_must $ZPOOL ${args[i]}
+       log_must zpool ${args[i]}
        ((i = i + 1))
 done
 
index ec5599acef0c4004cd694861d7567439d47e9029..c67031780bfd2eb2e5bba59b65eaee27e9c91c27 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -49,7 +49,7 @@ typeset -i stat_count=0
 function cleanup
 {
        if [[ -f $tmpfile ]]; then
-               $RM -f $tmpfile
+               rm -f $tmpfile
        fi
 }
 
@@ -60,15 +60,15 @@ if ! is_global_zone ; then
        TESTPOOL=${TESTPOOL%%/*}
 fi
 
-$ZPOOL iostat $TESTPOOL 1 4 > $tmpfile 2>&1 &
+zpool iostat $TESTPOOL 1 4 > $tmpfile 2>&1 &
 sleep 4
-stat_count=$($GREP $TESTPOOL $tmpfile | $WC -l)
+stat_count=$(grep $TESTPOOL $tmpfile | wc -l)
 
 if [[ $stat_count -ne 4 ]]; then
        log_fail "zpool iostat [pool_name] [interval] [count] failed"
 fi
 
 # Test a floating point interval value
-log_must $ZPOOL iostat -v 0.5 1
+log_must zpool iostat -v 0.5 1
 
 log_pass "zpool iostat [pool_name ...] [interval] [count] passed"
index 097be9e7449e61eb6334aa35fa9819a9d649c481..b6bcf71bffff3cf7f8f5bc7ae7cb8e656d4fd920 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -59,8 +59,8 @@ log_assert "Executing 'zpool iostat' with bad options fails"
 
 typeset -i i=1
 while [[ $i -lt ${#args[*]} ]]; do
-       log_assert "doing $ZPOOL iostat ${args[i]}"
-       log_mustnot $ZPOOL iostat ${args[i]}
+       log_assert "doing zpool iostat ${args[i]}"
+       log_mustnot zpool iostat ${args[i]}
        ((i = i + 1))
 done
 
index 0119a7061f326169312a7b8f434d06cbb4eca409..a203219501133867d9f9b4004c035933f53be2aa 100755 (executable)
@@ -68,8 +68,8 @@ log_note "testpool: $TESTPOOL, disks $DISKS"
 
 typeset -i i=1
 while [[ $i -lt ${#args[*]} ]]; do
-       log_note "doing $ZPOOL iostat ${args[i]}"
-       log_must $ZPOOL iostat ${args[i]}
+       log_note "doing zpool iostat ${args[i]}"
+       log_must zpool iostat ${args[i]}
        ((i = i + 1))
 done
 
index 89a9a497532037f3ced646e8f920181d24228a05..6204c14619ee66691bfbefc215be8676db62ab30 100755 (executable)
@@ -54,9 +54,9 @@ fi
 # a '/' when we specify the path (-P) flag. We check for "{}" to see if one
 # of the VDEV variables isn't set.
 #
-C1=$($ZPOOL iostat -Pv $testpool | $GREP -E '^\s+/' | $WC -l)
-C2=$($ZPOOL iostat -Pv -c 'echo vdev_test{$VDEV_PATH}{$VDEV_UPATH}' $testpool \
-    | $GREP -E '^\s+/' | $GREP -v '{}' | $WC -l)
+C1=$(zpool iostat -Pv $testpool | grep -E '^\s+/' | wc -l)
+C2=$(zpool iostat -Pv -c 'echo vdev_test{$VDEV_PATH}{$VDEV_UPATH}' $testpool \
+    | grep -E '^\s+/' | grep -v '{}' | wc -l)
 if [ "$C1" != "$C2" ] ; then
        log_fail "zpool iostat -c failed, expected $C1 vdevs, got $C2"
 else
@@ -67,12 +67,12 @@ fi
 # run on the vdev.  We write the command results to a temp file to verify that
 # the command actually gets run, rather than just verifying that the results
 # are *displayed* for the specific vdev.
-TMP=$($MKTEMP)
-FIRST_VDEV=$($ZPOOL iostat -Pv $testpool | $GREP -Eo '^\s+/[^ ]+' | $HEAD -n 1)
-log_must $ZPOOL iostat -Pv -c "echo \$VDEV_PATH >> $TMP" $testpool \
+TMP=$(mktemp)
+FIRST_VDEV=$(zpool iostat -Pv $testpool | grep -Eo '^\s+/[^ ]+' | head -n 1)
+log_must zpool iostat -Pv -c "echo \$VDEV_PATH >> $TMP" $testpool \
     $FIRST_VDEV > /dev/null
-C2=$($WC -w < $TMP)
-$RM $TMP
+C2=$(wc -w < $TMP)
+rm $TMP
 if [ "$C2" != "1" ] ; then
        log_fail "zpool iostat -c <VDEV> failed, expected 1 vdev, got $C2"
 else
index 29283cc072a03d3ff8996e2f3eb1396f8411e752..4c57413f14649a0a0f1344f7c7f2d8a263951b60 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -56,7 +56,7 @@ log_assert "zpool list [-H] [-o filed[,filed]*] [<pool_name> ...]"
 
 typeset -i i=0
 while [[ $i -lt ${#args[*]} ]]; do
-       log_must $ZPOOL ${args[i]}
+       log_must zpool ${args[i]}
 
        ((i = i + 1))
 done
index 469437a384736724ff6f1d9fe44577b38026d723..4ed38d475cd75e8ed60a62090b205b05c6b5a014 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -50,7 +50,7 @@ log_assert "Executing 'zpool list' with bad options fails"
 
 typeset -i i=1
 while [[ $i -lt ${#args[*]} ]]; do
-       log_mustnot $ZPOOL list ${args[i]}
+       log_mustnot zpool list ${args[i]}
        ((i = i + 1))
 done
 
index ce2c26bd247fb8c9bdbc66366e9086a661f709e8..b35b1775a746b9dfc30915192ca68d60522a67f7 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -49,22 +49,22 @@ typeset OP=create
 log_assert "Ensure that compressed files are smaller."
 
 log_note "Ensure compression is off"
-log_must $ZFS set compression=off $TESTPOOL/$TESTFS
+log_must zfs set compression=off $TESTPOOL/$TESTFS
 
 log_note "Writing file without compression..."
-log_must $FILE_WRITE -o $OP -f $TESTDIR/$TESTFILE0 -b $BLOCKSZ \
+log_must file_write -o $OP -f $TESTDIR/$TESTFILE0 -b $BLOCKSZ \
     -c $NUM_WRITES -d $DATA
 
 log_note "Add compression property to the dataset and write another file"
-log_must $ZFS set compression=on $TESTPOOL/$TESTFS
+log_must zfs set compression=on $TESTPOOL/$TESTFS
 
-log_must $FILE_WRITE -o $OP -f $TESTDIR/$TESTFILE1 -b $BLOCKSZ \
+log_must file_write -o $OP -f $TESTDIR/$TESTFILE1 -b $BLOCKSZ \
     -c $NUM_WRITES -d $DATA
 
-$SLEEP 60
+sleep 60
 
-FILE0_BLKS=`$DU -k $TESTDIR/$TESTFILE0 | $AWK '{ print $1}'`
-FILE1_BLKS=`$DU -k $TESTDIR/$TESTFILE1 | $AWK '{ print $1}'`
+FILE0_BLKS=`du -k $TESTDIR/$TESTFILE0 | awk '{ print $1}'`
+FILE1_BLKS=`du -k $TESTDIR/$TESTFILE1 | awk '{ print $1}'`
 
 if [[ $FILE0_BLKS -le $FILE1_BLKS ]]; then
        log_fail "$TESTFILE0 is smaller than $TESTFILE1" \
index 88e155611e8575bef7392805dd575755d2e1ff11..a07d70824042259f24eeb6da2630f9f440a05189 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -51,22 +51,22 @@ typeset OP=create
 log_assert "Ensure that compressed files in a dataset are smaller."
 
 log_note "Ensure compression is off"
-log_must $ZFS set compression=off $TESTPOOL/$TESTCTR
+log_must zfs set compression=off $TESTPOOL/$TESTCTR
 
 log_note "Writing file without compression..."
-log_must $FILE_WRITE -o $OP -f $TESTDIR1/$TESTFILE0 -b $BLOCKSZ \
+log_must file_write -o $OP -f $TESTDIR1/$TESTFILE0 -b $BLOCKSZ \
     -c $NUM_WRITES -d $DATA
 
 log_note "Add compression property to the dataset and write another file"
-log_must $ZFS set compression=on $TESTPOOL/$TESTCTR
+log_must zfs set compression=on $TESTPOOL/$TESTCTR
 
-log_must $FILE_WRITE -o $OP -f $TESTDIR1/$TESTFILE1 -b $BLOCKSZ \
+log_must file_write -o $OP -f $TESTDIR1/$TESTFILE1 -b $BLOCKSZ \
     -c $NUM_WRITES -d $DATA
 
-$SLEEP 60
+sleep 60
 
-FILE0_BLKS=`$DU -k $TESTDIR1/$TESTFILE0 | $AWK '{ print $1}'`
-FILE1_BLKS=`$DU -k $TESTDIR1/$TESTFILE1 | $AWK '{ print $1}'`
+FILE0_BLKS=`du -k $TESTDIR1/$TESTFILE0 | awk '{ print $1}'`
+FILE1_BLKS=`du -k $TESTDIR1/$TESTFILE1 | awk '{ print $1}'`
 
 if [[ $FILE0_BLKS -le $FILE1_BLKS ]]; then
        log_fail "$TESTFILE0 is smaller than $TESTFILE1" \
index 8070ceef278250195a9332601d6c1449a2f500ee..713f206c6a2e0fa951028e10aa2f3ee45bc53bd7 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,7 +47,7 @@ verify_runnable "both"
 
 function cleanup
 {
-       $RM -f $TESTDIR/*
+       rm -f $TESTDIR/*
 }
 
 log_assert "Changing blocksize doesn't cause system panic with compression settings"
@@ -64,7 +64,7 @@ for propname in "compression" "compress"
 do
        for value in $(get_compress_opts zfs_compress)
        do
-               log_must $ZFS set $propname=$value $fs
+               log_must zfs set $propname=$value $fs
                if [[ $value == "gzip-6" ]]; then
                        value="gzip"
                fi
@@ -74,7 +74,7 @@ do
 
                (( blksize = 512 ))
                while (( blksize <= 131072 )); do
-                       log_must $ZFS set recordsize=$blksize $fs
+                       log_must zfs set recordsize=$blksize $fs
                        (( offset = $RANDOM ))
                        if (( offset > blksize )); then
                                (( offset = offset % blksize ))
@@ -84,9 +84,9 @@ do
                                (( offset = offset + 1 ))
                        fi
                        (( fsize = offset ))
-                       log_must $MKFILE $fsize $single_blk_file
+                       log_must mkfile $fsize $single_blk_file
                        (( fsize = blksize + offset ))
-                       log_must $MKFILE $fsize $multi_blk_file
+                       log_must mkfile $fsize $multi_blk_file
 
                        (( blksize = blksize * 2 ))
                done
index 8b9054ef367dd43012489555c9847a93f2cccb1e..29d4b3a2b058000b95ea3542d715ca9f6f742b28 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,7 +47,7 @@ verify_runnable "both"
 
 function cleanup
 {
-       $RM -f $TESTDIR/*
+       rm -f $TESTDIR/*
 }
 
 function create_free_testing #<file size> <file>
@@ -71,10 +71,10 @@ function create_free_testing #<file size> <file>
                                fi
                        fi
 
-                       log_must $RANDFREE_FILE -l fsz -s $start \
+                       log_must randfree_file -l fsz -s $start \
                                -n $len $file
                        [[ -e $file ]] && \
-                               log_must $RM -f $file
+                               log_must rm -f $file
                done
        done
 }
@@ -96,7 +96,7 @@ for propname in "compression" "compress"
 do
        for value in $(get_compress_opts zfs_compress)
        do
-               log_must $ZFS set compression=$value $fs
+               log_must zfs set compression=$value $fs
                real_val=$(get_prop $propname $fs)
                if [[ $value == "gzip-6" ]]; then
                        value="gzip"
@@ -106,7 +106,7 @@ do
 
                (( blksize = 512 ))
                while (( blksize <= 131072 )); do
-                       log_must $ZFS set recordsize=$blksize $fs
+                       log_must zfs set recordsize=$blksize $fs
 
                        # doing single block testing
                        (( fsize = $RANDOM ))
index e14979d6540e673f3749a77109d81240b188befc..c3451cd78d0c83da183c495a7ecc60bc507396c0 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -37,8 +37,8 @@ cleanup_user_group
 if ! is_linux; then
        # restore the state of svc:/network/nis/client:default
        if [[ -e $NISSTAFILE ]]; then
-               log_must $SVCADM enable svc:/network/nis/client:default
-               log_must $RM -f $NISSTAFILE
+               log_must svcadm enable svc:/network/nis/client:default
+               log_must rm -f $NISSTAFILE
        fi
 fi
 
index 796cda929fa1b1509436467745391a7d61d6ac6a..8e6bd46a27614c44719c31ad7d0f13b59150ceff 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 # Copyright 2016 Nexenta Systems, Inc.
 #
 
@@ -54,15 +54,15 @@ function cleanup_user_group
 function restore_root_datasets
 {
        if datasetexists $ROOT_TESTFS ; then
-               log_must $ZFS destroy -Rf $ROOT_TESTFS
+               log_must zfs destroy -Rf $ROOT_TESTFS
        fi
-       log_must $ZFS create $ROOT_TESTFS
+       log_must zfs create $ROOT_TESTFS
 
        if is_global_zone ; then
                if datasetexists $ROOT_TESTVOL ; then
-                       log_must $ZFS destroy -Rf $ROOT_TESTVOL
+                       log_must zfs destroy -Rf $ROOT_TESTVOL
                fi
-               log_must $ZFS create -V $VOLSIZE $ROOT_TESTVOL
+               log_must zfs create -V $VOLSIZE $ROOT_TESTVOL
                block_device_wait
        fi
 
@@ -87,7 +87,7 @@ function verify_perm
        fi
 
        typeset type=$(get_prop type $dtst)
-       permissions=$($ECHO $permissions | $TR -s "," " ")
+       permissions=$(echo $permissions | tr -s "," " ")
 
        typeset user
        for user in $@; do
@@ -132,7 +132,7 @@ function verify_noperm
        fi
 
        typeset type=$(get_prop type $dtst)
-       permissions=$($ECHO $permissions | $TR -s "," " ")
+       permissions=$(echo $permissions | tr -s "," " ")
 
        typeset user
        for user in $@; do
@@ -348,13 +348,13 @@ function setup_unallow_testenv
 {
        log_must restore_root_datasets
 
-       log_must $ZFS create $SUBFS
+       log_must zfs create $SUBFS
 
        for dtst in $DATASETS ; do
-               log_must $ZFS allow -l $STAFF1 $LOCAL_SET $dtst
-               log_must $ZFS allow -d $STAFF2 $DESC_SET  $dtst
-               log_must $ZFS allow $OTHER1 $LOCAL_DESC_SET $dtst
-               log_must $ZFS allow $OTHER2 $LOCAL_DESC_SET $dtst
+               log_must zfs allow -l $STAFF1 $LOCAL_SET $dtst
+               log_must zfs allow -d $STAFF2 $DESC_SET  $dtst
+               log_must zfs allow $OTHER1 $LOCAL_DESC_SET $dtst
+               log_must zfs allow $OTHER2 $LOCAL_DESC_SET $dtst
 
                log_must verify_perm $dtst $LOCAL_SET $STAFF1
                log_must verify_perm $dtst $LOCAL_DESC_SET $OTHER1
@@ -382,24 +382,24 @@ function verify_send
        typeset dtst=$3
 
        typeset oldval
-       typeset stamp=${perm}.${user}.$($DATE +'%F-%T-%N')
+       typeset stamp=${perm}.${user}.$(date +'%F-%T-%N')
        typeset snap=$dtst@snap.$stamp
 
        typeset -i ret=1
 
-       log_must $ZFS snapshot $snap
+       log_must zfs snapshot $snap
        typeset bak_user=/tmp/bak.$user.$stamp
        typeset bak_root=/tmp/bak.root.$stamp
 
-       user_run $user eval "$ZFS send $snap > $bak_user"
-       log_must eval "$ZFS send $snap > $bak_root"
+       user_run $user eval "zfs send $snap > $bak_user"
+       log_must eval "zfs send $snap > $bak_root"
 
        if [[ $(checksum $bak_user) == $(checksum $bak_root) ]]; then
                ret=0
        fi
 
-       $RM -rf $bak_user > /dev/null
-       $RM -rf $bak_root > /dev/null
+       rm -rf $bak_user > /dev/null
+       rm -rf $bak_root > /dev/null
 
        return $ret
 }
@@ -411,16 +411,16 @@ function verify_fs_receive
        typeset fs=$3
 
        typeset dtst
-       typeset stamp=${perm}.${user}.$($DATE +'%F-%T-%N')
+       typeset stamp=${perm}.${user}.$(date +'%F-%T-%N')
        typeset newfs=$fs/newfs.$stamp
        typeset newvol=$fs/newvol.$stamp
        typeset bak_user=/tmp/bak.$user.$stamp
        typeset bak_root=/tmp/bak.root.$stamp
 
-       log_must $ZFS create $newfs
+       log_must zfs create $newfs
        typeset datasets="$newfs"
        if is_global_zone ; then
-               log_must $ZFS create -V $VOLSIZE $newvol
+               log_must zfs create -V $VOLSIZE $newvol
                block_device_wait
                datasets="$newfs $newvol"
        fi
@@ -428,49 +428,49 @@ function verify_fs_receive
        for dtst in $datasets ; do
 
                typeset dtstsnap=$dtst@snap.$stamp
-               log_must $ZFS snapshot $dtstsnap
+               log_must zfs snapshot $dtstsnap
 
-               log_must eval "$ZFS send $dtstsnap > $bak_root"
-               log_must $ZFS destroy -rf $dtst
+               log_must eval "zfs send $dtstsnap > $bak_root"
+               log_must zfs destroy -rf $dtst
 
-               user_run $user eval "$ZFS receive $dtst < $bak_root"
+               user_run $user eval "zfs receive $dtst < $bak_root"
                if datasetexists $dtstsnap ; then
                        return 1
                fi
 
-               log_must $ZFS allow $user create $fs
-               user_run $user eval "$ZFS receive $dtst < $bak_root"
-               log_must $ZFS unallow $user create $fs
+               log_must zfs allow $user create $fs
+               user_run $user eval "zfs receive $dtst < $bak_root"
+               log_must zfs unallow $user create $fs
                if datasetexists $dtstsnap ; then
                        return 1
                fi
 
-               log_must $ZFS allow $user mount $fs
-               user_run $user eval "$ZFS receive $dtst < $bak_root"
-               log_must $ZFS unallow $user mount $fs
+               log_must zfs allow $user mount $fs
+               user_run $user eval "zfs receive $dtst < $bak_root"
+               log_must zfs unallow $user mount $fs
                if datasetexists $dtstsnap ; then
                        return 1
                fi
 
-               log_must $ZFS allow $user mount,create $fs
-               user_run $user eval "$ZFS receive $dtst < $bak_root"
-               log_must $ZFS unallow $user mount,create $fs
+               log_must zfs allow $user mount,create $fs
+               user_run $user eval "zfs receive $dtst < $bak_root"
+               log_must zfs unallow $user mount,create $fs
                if ! datasetexists $dtstsnap ; then
                        return 1
                fi
 
                # check the data integrity
-               log_must eval "$ZFS send $dtstsnap > $bak_user"
-               log_must $ZFS destroy -rf $dtst
-               log_must eval "$ZFS receive $dtst < $bak_root"
-               log_must eval "$ZFS send $dtstsnap > $bak_root"
-               log_must $ZFS destroy -rf $dtst
+               log_must eval "zfs send $dtstsnap > $bak_user"
+               log_must zfs destroy -rf $dtst
+               log_must eval "zfs receive $dtst < $bak_root"
+               log_must eval "zfs send $dtstsnap > $bak_root"
+               log_must zfs destroy -rf $dtst
                if [[ $(checksum $bak_user) != $(checksum $bak_root) ]]; then
                        return 1
                fi
 
-               $RM -rf $bak_user > /dev/null
-               $RM -rf $bak_root > /dev/null
+               rm -rf $bak_user > /dev/null
+               rm -rf $bak_root > /dev/null
 
        done
 
@@ -483,9 +483,9 @@ function verify_userprop
        typeset perm=$2
        typeset dtst=$3
 
-       typeset stamp=${perm}.${user}.$($DATE +'%F-%T-%N')
+       typeset stamp=${perm}.${user}.$(date +'%F-%T-%N')
 
-       user_run $user $ZFS set "$user:ts=$stamp" $dtst
+       user_run $user zfs set "$user:ts=$stamp" $dtst
        if [[ $stamp != $(get_prop "$user:ts" $dtst) ]]; then
                return 1
        fi
@@ -508,8 +508,8 @@ function verify_ccr
        elif [[ $oldval == "off" ]]; then
                n=0
        fi
-       log_note "$user $ZFS set $perm=${modes[$n]} $dtst"
-       user_run $user $ZFS set $perm=${modes[$n]} $dtst
+       log_note "$user zfs set $perm=${modes[$n]} $dtst"
+       user_run $user zfs set $perm=${modes[$n]} $dtst
        if [[ ${modes[$n]} != $(get_prop $perm $dtst) ]]; then
                return 1
        fi
@@ -534,8 +534,8 @@ function verify_copies
        elif [[ $oldval -eq 3 ]]; then
                n=0
        fi
-       log_note "$user $ZFS set $perm=${modes[$n]} $dtst"
-       user_run $user $ZFS set $perm=${modes[$n]} $dtst
+       log_note "$user zfs set $perm=${modes[$n]} $dtst"
+       user_run $user zfs set $perm=${modes[$n]} $dtst
        if [[ ${modes[$n]} != $(get_prop $perm $dtst) ]]; then
                return 1
        fi
@@ -551,13 +551,13 @@ function verify_reservation
 
        typeset value32m=$(( 1024 * 1024 * 32 ))
        typeset oldval=$(get_prop reservation $dtst)
-       user_run $user $ZFS set reservation=$value32m $dtst
+       user_run $user zfs set reservation=$value32m $dtst
        if [[ $value32m != $(get_prop reservation $dtst) ]]; then
-               log_must $ZFS set reservation=$oldval $dtst
+               log_must zfs set reservation=$oldval $dtst
                return 1
        fi
 
-       log_must $ZFS set reservation=$oldval $dtst
+       log_must zfs set reservation=$oldval $dtst
        return 0
 }
 
@@ -567,88 +567,88 @@ function verify_fs_create
        typeset perm=$2
        typeset fs=$3
 
-       typeset stamp=${perm}.${user}.$($DATE +'%F-%T-%N')
+       typeset stamp=${perm}.${user}.$(date +'%F-%T-%N')
        typeset newfs=$fs/nfs.$stamp
        typeset newvol=$fs/nvol.$stamp
 
-       user_run $user $ZFS create $newfs
+       user_run $user zfs create $newfs
        if datasetexists $newfs ; then
                return 1
        fi
 
-       log_must $ZFS allow $user mount $fs
-       user_run $user $ZFS create $newfs
-       log_must $ZFS unallow $user mount $fs
+       log_must zfs allow $user mount $fs
+       user_run $user zfs create $newfs
+       log_must zfs unallow $user mount $fs
        if ! datasetexists $newfs ; then
                return 1
        fi
 
-       log_must $ZFS destroy $newfs
+       log_must zfs destroy $newfs
 
        if is_global_zone ; then
                # mount permission is required for sparse volume
-               user_run $user $ZFS create -V 150m -s $newvol
+               user_run $user zfs create -V 150m -s $newvol
                block_device_wait
                if datasetexists $newvol ; then
                        return 1
                fi
 
-               log_must $ZFS allow $user mount $fs
-               user_run $user $ZFS create -V 150m -s $newvol
-               log_must $ZFS unallow $user mount $fs
+               log_must zfs allow $user mount $fs
+               user_run $user zfs create -V 150m -s $newvol
+               log_must zfs unallow $user mount $fs
                if ! datasetexists $newvol ; then
                        return 1
                fi
 
                block_device_wait
-               log_must $ZFS destroy $newvol
+               log_must zfs destroy $newvol
                block_device_wait
 
                # mount and reserveration permission are
                # required for normal volume
-               user_run $user $ZFS create -V 150m $newvol
+               user_run $user zfs create -V 150m $newvol
                block_device_wait
                if datasetexists $newvol ; then
                        return 1
                fi
 
-               log_must $ZFS allow $user mount $fs
-               user_run $user $ZFS create -V 150m $newvol
+               log_must zfsallow $user mount $fs
+               user_run $user zfscreate -V 150m $newvol
                block_device_wait
-               log_must $ZFS unallow $user mount $fs
+               log_must zfsunallow $user mount $fs
                if datasetexists $newvol ; then
                        return 1
                fi
 
-               log_must $ZFS allow $user reservation $fs
-               user_run $user $ZFS create -V 150m $newvol
+               log_must zfsallow $user reservation $fs
+               user_run $user zfscreate -V 150m $newvol
                block_device_wait
-               log_must $ZFS unallow $user reservation $fs
+               log_must zfsunallow $user reservation $fs
                if datasetexists $newvol ; then
                        return 1
                fi
 
-               log_must $ZFS allow $user refreservation $fs
-               user_run $user $ZFS create -V 150m $newvol
+               log_must zfsallow $user refreservation $fs
+               user_run $user zfscreate -V 150m $newvol
                block_device_wait
-               log_must $ZFS unallow $user refreservation $fs
+               log_must zfsunallow $user refreservation $fs
                if datasetexists $newvol ; then
                        return 1
                fi
 
-               log_must $ZFS allow $user mount $fs
-               log_must $ZFS allow $user reservation $fs
-               log_must $ZFS allow $user refreservation $fs
-               user_run $user $ZFS create -V 150m $newvol
-               log_must $ZFS unallow $user mount $fs
-               log_must $ZFS unallow $user reservation $fs
-               log_must $ZFS unallow $user refreservation $fs
+               log_must zfs allow $user mount $fs
+               log_must zfs allow $user reservation $fs
+               log_must zfs allow $user refreservation $fs
+               user_run $user zfs create -V 150m $newvol
+               log_must zfs unallow $user mount $fs
+               log_must zfs unallow $user reservation $fs
+               log_must zfs unallow $user refreservation $fs
                if ! datasetexists $newvol ; then
                        return 1
                fi
 
                block_device_wait
-               log_must $ZFS destroy $newvol
+               log_must zfsdestroy $newvol
                block_device_wait
        fi
 
@@ -662,21 +662,21 @@ function verify_fs_destroy
        typeset fs=$3
 
        if ! ismounted $fs ; then
-               user_run $user $ZFS destroy $fs
+               user_run $user zfs destroy $fs
                if datasetexists $fs ; then
                        return 1
                fi
        fi
 
        if ismounted $fs ; then
-               user_run $user $ZFS destroy $fs
+               user_run $user zfs destroy $fs
                if ! datasetexists $fs ; then
                        return 1
                fi
 
                # mount permission is required
-               log_must $ZFS allow $user mount $fs
-               user_run $user $ZFS destroy $fs
+               log_must zfs allow $user mount $fs
+               user_run $user zfs destroy $fs
                if datasetexists $fs ; then
                        return 1
                fi
@@ -695,36 +695,36 @@ function verify_fs_snapshot
        typeset perm=$2
        typeset fs=$3
 
-       typeset stamp=${perm}.${user}.$($DATE +'%F-%T-%N')
+       typeset stamp=${perm}.${user}.$(date +'%F-%T-%N')
        typeset snap=$fs@snap.$stamp
        typeset mntpt=$(get_prop mountpoint $fs)
 
        if [[ "yes" == $(get_prop mounted $fs) ]]; then
-               log_must $ZFS umount $fs
+               log_must zfs umount $fs
        fi
 
-       user_run $user $ZFS snapshot $snap
+       user_run $user zfs snapshot $snap
        if ! datasetexists $snap ; then
                return 1
        fi
-       log_must $ZFS destroy $snap
+       log_must zfs destroy $snap
 
        if [[ "no" == $(get_prop mounted $fs) ]]; then
-               log_must $ZFS mount $fs
+               log_must zfs mount $fs
        fi
 
-       user_run $user $ZFS snapshot $snap
+       user_run $user zfs snapshot $snap
        if ! datasetexists $snap ; then
                return 1
        fi
-       log_must $ZFS destroy $snap
+       log_must zfs destroy $snap
 
        typeset snapdir=${mntpt}/.zfs/snapshot/snap.$stamp
-       user_run $user $MKDIR $snapdir
+       user_run $user mkdir $snapdir
        if ! datasetexists $snap ; then
                return 1
        fi
-       log_must $ZFS destroy $snap
+       log_must zfs destroy $snap
 
        return 0
 }
@@ -736,19 +736,19 @@ function verify_fs_rollback
        typeset fs=$3
 
        typeset oldval
-       typeset stamp=${perm}.${user}.$($DATE +'%F-%T-%N')
+       typeset stamp=${perm}.${user}.$(date +'%F-%T-%N')
        typeset snap=$fs@snap.$stamp
        typeset mntpt=$(get_prop mountpoint $fs)
 
        oldval=$(datasetcksum $fs)
-       log_must $ZFS snapshot $snap
+       log_must zfs snapshot $snap
 
        if ! ismounted $fs; then
-               log_must $ZFS mount $fs
+               log_must zfs mount $fs
        fi
-       log_must $TOUCH $mntpt/testfile.$stamp
+       log_must touch $mntpt/testfile.$stamp
 
-       user_run $user $ZFS rollback -R $snap
+       user_run $user zfs rollback -R $snap
        if is_global_zone ; then
                if [[ $oldval != $(datasetcksum $fs) ]]; then
                        return 1
@@ -769,41 +769,41 @@ function verify_fs_clone
        typeset perm=$2
        typeset fs=$3
 
-       typeset stamp=${perm}.${user}.$($DATE +'%F-%T-%N')
+       typeset stamp=${perm}.${user}.$(date +'%F-%T-%N')
         typeset basefs=${fs%/*}
        typeset snap=$fs@snap.$stamp
        typeset clone=$basefs/cfs.$stamp
 
-       log_must $ZFS snapshot $snap
-       user_run $user $ZFS clone $snap $clone
+       log_must zfs snapshot $snap
+       user_run $user zfs clone $snap $clone
        if datasetexists $clone ; then
                return 1
        fi
 
-       log_must $ZFS allow $user create $basefs
-       user_run $user $ZFS clone $snap $clone
-       log_must $ZFS unallow $user create $basefs
+       log_must zfs allow $user create $basefs
+       user_run $user zfs clone $snap $clone
+       log_must zfs unallow $user create $basefs
        if datasetexists $clone ; then
                return 1
        fi
 
-       log_must $ZFS allow $user mount $basefs
-       user_run $user $ZFS clone $snap $clone
-       log_must $ZFS unallow $user mount $basefs
+       log_must zfs allow $user mount $basefs
+       user_run $user zfs clone $snap $clone
+       log_must zfs unallow $user mount $basefs
        if datasetexists $clone ; then
                return 1
        fi
 
-       log_must $ZFS allow $user mount $basefs
-       log_must $ZFS allow $user create $basefs
-       user_run $user $ZFS clone $snap $clone
-       log_must $ZFS unallow $user create $basefs
-       log_must $ZFS unallow $user mount $basefs
+       log_must zfs allow $user mount $basefs
+       log_must zfs allow $user create $basefs
+       user_run $user zfs clone $snap $clone
+       log_must zfs unallow $user create $basefs
+       log_must zfs unallow $user mount $basefs
        if ! datasetexists $clone ; then
                return 1
        fi
 
-       log_must $ZFS destroy -R $snap
+       log_must zfs destroy -R $snap
 
        return 0
 }
@@ -814,79 +814,79 @@ function verify_fs_rename
        typeset perm=$2
        typeset fs=$3
 
-       typeset stamp=${perm}.${user}.$($DATE +'%F-%T-%N')
+       typeset stamp=${perm}.${user}.$(date +'%F-%T-%N')
         typeset basefs=${fs%/*}
        typeset snap=$fs@snap.$stamp
        typeset renamefs=$basefs/nfs.$stamp
 
        if ! ismounted $fs; then
-               log_must $ZFS mount $fs
+               log_must zfs mount $fs
        fi
 
        # case 1
-       user_run $user $ZFS rename $fs $renamefs
+       user_run $user zfs rename $fs $renamefs
        if datasetexists $renamefs ; then
                return 1
        fi
 
        # case 2
-       log_must $ZFS allow $user create $basefs
-       user_run $user $ZFS rename $fs $renamefs
-       log_must $ZFS unallow $user create $basefs
+       log_must zfs allow $user create $basefs
+       user_run $user zfs rename $fs $renamefs
+       log_must zfs unallow $user create $basefs
        if datasetexists $renamefs ; then
                return 1
        fi
 
        # case 3
-       log_must $ZFS allow $user mount $basefs
-       user_run $user $ZFS rename $fs $renamefs
-       log_must $ZFS unallow $user mount $basefs
+       log_must zfs allow $user mount $basefs
+       user_run $user zfs rename $fs $renamefs
+       log_must zfs unallow $user mount $basefs
        if datasetexists $renamefs ; then
                return 1
        fi
 
        # case 4
-       log_must $ZFS allow $user mount $fs
-       user_run $user $ZFS rename $fs $renamefs
+       log_must zfs allow $user mount $fs
+       user_run $user zfs rename $fs $renamefs
        if datasetexists $renamefs ; then
-               log_must $ZFS unallow $user mount $renamefs
+               log_must zfs unallow $user mount $renamefs
                return 1
        fi
-       log_must $ZFS unallow $user mount $fs
+       log_must zfs unallow $user mount $fs
 
        # case 5
-       log_must $ZFS allow $user create $basefs
-       log_must $ZFS allow $user mount $fs
-       user_run $user $ZFS rename $fs $renamefs
-       log_must $ZFS unallow $user create $basefs
+       log_must zfs allow $user create $basefs
+       log_must zfs allow $user mount $fs
+       user_run $user zfs rename $fs $renamefs
+       log_must zfs unallow $user create $basefs
        if datasetexists $renamefs ; then
-               log_must $ZFS unallow $user mount $renamefs
+               log_must zfs unallow $user mount $renamefs
                return 1
        fi
-       log_must $ZFS unallow $user mount $fs
+       log_must zfs unallow $user mount $fs
 
        # case 6
-       log_must $ZFS allow $user mount $basefs
-       log_must $ZFS allow $user mount $fs
-       user_run $user $ZFS rename $fs $renamefs
-       log_must $ZFS unallow $user mount $basefs
+       log_must zfs allow $user mount $basefs
+       log_must zfs allow $user mount $fs
+       user_run $user zfs rename $fs $renamefs
+       log_must zfs unallow $user mount $basefs
        if datasetexists $renamefs ; then
-               log_must $ZFS unallow $user mount $renamefs
+               log_must zfs unallow $user mount $renamefs
                return 1
        fi
-       log_must $ZFS unallow $user mount $fs
+       log_must zfs unallow $user mount $fs
 
        # case 7
-       log_must $ZFS allow $user create $basefs
-       log_must $ZFS allow $user mount $basefs
-       user_run $user $ZFS rename $fs $renamefs
-       log_must $ZFS unallow $user mount $basefs
-       log_must $ZFS unallow $user create $basefs
+       log_must zfs allow $user create $basefs
+       log_must zfs allow $user mount $basefs
+       user_run $user zfs rename $fs $renamefs
+       log_must zfs unallow $user mount $basefs
+       log_must zfs unallow $user create $basefs
        if ! datasetexists $renamefs ; then
                return 1
        fi
 
-       log_must $ZFS rename $renamefs $fs
+       log_must zfs rename $renamefs $fs
 
        return 0
 }
@@ -897,36 +897,36 @@ function verify_fs_mount
        typeset perm=$2
        typeset fs=$3
 
-       typeset stamp=${perm}.${user}.$($DATE +'%F-%T-%N')
+       typeset stamp=${perm}.${user}.$(date +'%F-%T-%N')
        typeset mntpt=$(get_prop mountpoint $fs)
        typeset newmntpt=/tmp/mnt.$stamp
 
        if ismounted $fs ; then
-               user_run $user $ZFS unmount $fs
+               user_run $user zfs unmount $fs
                if ismounted $fs ; then
                        return 1
                fi
        fi
 
        if ! ismounted $fs ; then
-               log_must $ZFS set mountpoint=$newmntpt $fs
-               log_must $RM -rf $newmntpt
-               log_must $MKDIR $newmntpt
+               log_must zfs set mountpoint=$newmntpt $fs
+               log_must rm -rf $newmntpt
+               log_must mkdir $newmntpt
 
-               user_run $user $ZFS mount $fs
+               user_run $user zfs mount $fs
                if ismounted $fs ; then
                        return 1
                fi
 
                # mountpoint's owner must be the user
-               log_must $CHOWN $user $newmntpt
-               user_run $user $ZFS mount $fs
+               log_must chown $user $newmntpt
+               user_run $user zfs mount $fs
                if ! ismounted $fs ; then
                        return 1
                fi
-               log_must $ZFS umount $fs
-               log_must $RM -rf $newmntpt
-               log_must $ZFS set mountpoint=$mntpt $fs
+               log_must zfs umount $fs
+               log_must rm -rf $newmntpt
+               log_must zfs set mountpoint=$mntpt $fs
        fi
 
        return 0
@@ -939,22 +939,22 @@ function verify_fs_share
        typeset fs=$3
        typeset -i ret=0
 
-       $SVCADM enable -rs nfs/server
-       typeset stat=$($SVCS -H -o STA nfs/server:default)
+       svcadm enable -rs nfs/server
+       typeset stat=$(svcs -H -o STA nfs/server:default)
        if [[ $stat != "ON" ]]; then
                log_fail "Could not enable nfs/server"
        fi
 
-       log_must $ZFS set sharenfs=on $fs
-       $ZFS unshare $fs
+       log_must zfs set sharenfs=on $fs
+       zfs unshare $fs
 
-       user_run $user $ZFS share $fs
+       user_run $user zfs share $fs
        if ! is_shared $fs; then
                ret=1
        fi
 
-       $ZFS unshare $fs
-       log_must $ZFS set sharenfs=off $fs
+       zfs unshare $fs
+       log_must zfs set sharenfs=off $fs
 
        return $ret
 }
@@ -965,34 +965,34 @@ function verify_fs_mountpoint
        typeset perm=$2
        typeset fs=$3
 
-       typeset stamp=${perm}.${user}.$($DATE +'%F-%T-%N')
+       typeset stamp=${perm}.${user}.$(date +'%F-%T-%N')
        typeset mntpt=$(get_prop mountpoint $fs)
        typeset newmntpt=/tmp/mnt.$stamp
 
        if ! ismounted $fs ; then
-               user_run $user $ZFS set mountpoint=$newmntpt $fs
+               user_run $user zfs set mountpoint=$newmntpt $fs
                if [[ $newmntpt != \
                        $(get_prop mountpoint $fs) ]] ; then
                        return 1
                fi
-               log_must $ZFS set mountpoint=$mntpt $fs
+               log_must zfs set mountpoint=$mntpt $fs
        fi
 
        if ismounted $fs ; then
-               user_run $user $ZFS set mountpoint=$newmntpt $fs
+               user_run $user zfs set mountpoint=$newmntpt $fs
                if [[ $mntpt != $(get_prop mountpoint $fs) ]]; then
                        return 1
                fi
 
                # require mount permission when fs is mounted
-               log_must $ZFS allow $user mount $fs
-               user_run $user $ZFS set mountpoint=$newmntpt $fs
-               log_must $ZFS unallow $user mount $fs
+               log_must zfs allow $user mount $fs
+               user_run $user zfs set mountpoint=$newmntpt $fs
+               log_must zfs unallow $user mount $fs
                if [[ $newmntpt != \
                        $(get_prop mountpoint $fs) ]] ; then
                        return 1
                fi
-               log_must $ZFS set mountpoint=$mntpt $fs
+               log_must zfs set mountpoint=$mntpt $fs
        fi
 
        return 0
@@ -1004,19 +1004,19 @@ function verify_fs_promote
        typeset perm=$2
        typeset fs=$3
 
-       typeset stamp=${perm}.${user}.$($DATE +'%F-%T-%N')
+       typeset stamp=${perm}.${user}.$(date +'%F-%T-%N')
         typeset basefs=${fs%/*}
        typeset snap=$fs@snap.$stamp
        typeset clone=$basefs/cfs.$stamp
 
-       log_must $ZFS snapshot $snap
-       log_must $ZFS clone $snap $clone
-       log_must $ZFS promote $clone
+       log_must zfs snapshot $snap
+       log_must zfs clone $snap $clone
+       log_must zfs promote $clone
 
        typeset fs_orig=$(get_prop origin $fs)
        typeset clone_orig=$(get_prop origin $clone)
 
-       user_run $user $ZFS promote $fs
+       user_run $user zfs promote $fs
        # promote should fail if original fs does not have
        # promote permission
        if [[ $fs_orig != $(get_prop origin $fs) || \
@@ -1024,27 +1024,27 @@ function verify_fs_promote
                return 1
        fi
 
-       log_must $ZFS allow $user promote $clone
-       user_run $user $ZFS promote $fs
-       log_must $ZFS unallow $user promote $clone
+       log_must zfs allow $user promote $clone
+       user_run $user zfs promote $fs
+       log_must zfs unallow $user promote $clone
        if [[ $fs_orig != $(get_prop origin $fs) || \
                $clone_orig != $(get_prop origin $clone) ]]; then
                return 1
        fi
 
-       log_must $ZFS allow $user mount $fs
-       user_run $user $ZFS promote $fs
-       log_must $ZFS unallow $user mount $fs
+       log_must zfs allow $user mount $fs
+       user_run $user zfs promote $fs
+       log_must zfs unallow $user mount $fs
        if [[ $fs_orig != $(get_prop origin $fs) || \
                $clone_orig != $(get_prop origin $clone) ]]; then
                return 1
        fi
 
-       log_must $ZFS allow $user mount $fs
-       log_must $ZFS allow $user promote $clone
-       user_run $user $ZFS promote $fs
-       log_must $ZFS unallow $user promote $clone
-       log_must $ZFS unallow $user mount $fs
+       log_must zfs allow $user mount $fs
+       log_must zfs allow $user promote $clone
+       user_run $user zfs promote $fs
+       log_must zfs unallow $user promote $clone
+       log_must zfs unallow $user mount $fs
        if [[ $snap != $(get_prop origin $clone) || \
                $clone_orig != $(get_prop origin $fs) ]]; then
                return 1
@@ -1060,7 +1060,7 @@ function verify_fs_canmount
        typeset fs=$3
 
        typeset oldval
-       typeset stamp=${perm}.${user}.$($DATE +'%F-%T-%N')
+       typeset stamp=${perm}.${user}.$(date +'%F-%T-%N')
 
        if ! ismounted $fs ; then
                set -A modes "on" "off"
@@ -1070,8 +1070,8 @@ function verify_fs_canmount
                elif [[ $oldval == "off" ]]; then
                        n=0
                fi
-               log_note "$user $ZFS set $perm=${modes[$n]} $fs"
-               user_run $user $ZFS set $perm=${modes[$n]} $fs
+               log_note "$user zfs set $perm=${modes[$n]} $fs"
+               user_run $user zfs set $perm=${modes[$n]} $fs
                if [[ ${modes[$n]} != $(get_prop $perm $fs) ]]; then
                        return 1
                fi
@@ -1089,10 +1089,10 @@ function verify_fs_canmount
                elif [[ $oldval == "off" ]]; then
                        n=0
                fi
-               log_note "$user $ZFS set $perm=${modes[$n]} $fs"
-               log_must $ZFS allow $user mount $fs
-               user_run $user $ZFS set $perm=${modes[$n]} $fs
-               log_must $ZFS unallow $user mount $fs
+               log_note "$user zfs set $perm=${modes[$n]} $fs"
+               log_must zfs allow $user mount $fs
+               user_run $user zfs set $perm=${modes[$n]} $fs
+               log_must zfs unallow $user mount $fs
                if [[ ${modes[$n]} != $(get_prop $perm $fs) ]]; then
                        return 1
                fi
@@ -1108,7 +1108,7 @@ function verify_fs_recordsize
        typeset fs=$3
 
        typeset value8k=$(( 1024 * 8 ))
-       user_run $user $ZFS set recordsize=$value8k $fs
+       user_run $user zfs set recordsize=$value8k $fs
        if [[ $value8k != $(get_prop recordsize $fs) ]]; then
                return 1
        fi
@@ -1123,7 +1123,7 @@ function verify_fs_dnodesize
        typeset fs=$3
        value="2k"
 
-       user_run $user $ZFS set dnodesize=$value $fs
+       user_run $user zfsset dnodesize=$value $fs
        if [[ $value != $(get_prop dnodesize $fs) ]]; then
                return 1
        fi
@@ -1138,7 +1138,7 @@ function verify_fs_quota
        typeset fs=$3
 
        typeset value32m=$(( 1024 * 1024 * 32 ))
-       user_run $user $ZFS set quota=$value32m $fs
+       user_run $user zfs set quota=$value32m $fs
        if [[ $value32m != $(get_prop quota $fs) ]]; then
                return 1
        fi
@@ -1162,8 +1162,8 @@ function verify_fs_aclmode
        elif [[ $oldval == "passthrough" ]]; then
                n=0
        fi
-       log_note "$user $ZFS set aclmode=${modes[$n]} $fs"
-       user_run $user $ZFS set aclmode=${modes[$n]} $fs
+       log_note "$user zfs set aclmode=${modes[$n]} $fs"
+       user_run $user zfs set aclmode=${modes[$n]} $fs
        if [[ ${modes[$n]} != $(get_prop aclmode $fs) ]]; then
                return 1
        fi
@@ -1194,8 +1194,8 @@ function verify_fs_aclinherit
        elif [[ $oldval == "passthrough" ]]; then
                n=0
        fi
-       log_note "$user $ZFS set aclinherit=${modes[$n]} $fs"
-       user_run $user $ZFS set aclinherit=${modes[$n]} $fs
+       log_note "$user zfs set aclinherit=${modes[$n]} $fs"
+       user_run $user zfs set aclinherit=${modes[$n]} $fs
 
        typeset newval=$(get_prop aclinherit $fs)
        if [[ ${modes[$n]} == "secure" && $newval == "restricted" ]]; then
@@ -1221,8 +1221,8 @@ function verify_fs_snapdir
        elif [[ $oldval == "hidden" ]]; then
                n=0
        fi
-       log_note "$user $ZFS set snapdir=${modes[$n]} $fs"
-       user_run $user $ZFS set snapdir=${modes[$n]} $fs
+       log_note "$user zfs set snapdir=${modes[$n]} $fs"
+       user_run $user zfs set snapdir=${modes[$n]} $fs
        if [[ ${modes[$n]} != $(get_prop snapdir $fs) ]]; then
                return 1
        fi
@@ -1244,8 +1244,8 @@ function verify_fs_aedsx
        elif [[ $oldval == "off" ]]; then
                n=0
        fi
-       log_note "$user $ZFS set $perm=${modes[$n]} $fs"
-       user_run $user $ZFS set $perm=${modes[$n]} $fs
+       log_note "$user zfs set $perm=${modes[$n]} $fs"
+       user_run $user zfs set $perm=${modes[$n]} $fs
        if [[ ${modes[$n]} != $(get_prop $perm $fs) ]]; then
                return 1
        fi
@@ -1267,25 +1267,25 @@ function verify_fs_zoned
        elif [[ $oldval == "off" ]]; then
                n=0
        fi
-       log_note "$user $ZFS set $perm=${modes[$n]} $fs"
+       log_note "$user zfs set $perm=${modes[$n]} $fs"
        if is_global_zone ; then
                if ! ismounted $fs ; then
-                       user_run $user $ZFS set \
+                       user_run $user zfs set \
                                $perm=${modes[$n]} $fs
                        if [[ ${modes[$n]} != \
                                $(get_prop $perm $fs) ]]; then
                                return 1
                        fi
                        if [[ $n -eq 0 ]]; then
-                               log_mustnot $ZFS mount $fs
+                               log_mustnot zfs mount $fs
                        else
-                               log_must $ZFS mount $fs
+                               log_must zfs mount $fs
                        fi
                fi
 
                if ismounted $fs; then
                        # n always is 1 in this case
-                       user_run $user $ZFS set \
+                       user_run $user zfs set \
                                $perm=${modes[$n]} $fs
                        if [[ $oldval != \
                                $(get_prop $perm $fs) ]]; then
@@ -1294,10 +1294,10 @@ function verify_fs_zoned
 
                        # mount permission is needed
                        # to make zoned=on
-                       log_must $ZFS allow $user mount $fs
-                       user_run $user $ZFS set \
+                       log_must zfs allow $user mount $fs
+                       user_run $user zfs set \
                                $perm=${modes[$n]} $fs
-                       log_must $ZFS unallow $user mount $fs
+                       log_must zfs unallow $user mount $fs
                        if [[ ${modes[$n]} != \
                                $(get_prop $perm $fs) ]]; then
                                return 1
@@ -1306,7 +1306,7 @@ function verify_fs_zoned
        fi
 
        if ! is_global_zone; then
-               user_run $user $ZFS set $perm=${modes[$n]} $fs
+               user_run $user zfs set $perm=${modes[$n]} $fs
                if [[ $oldval != $(get_prop $perm $fs) ]]; then
                        return 1
                fi
@@ -1329,14 +1329,14 @@ function verify_fs_sharenfs
                nmode="off"
        fi
 
-       log_note "$user $ZFS set $perm=$nmode $fs"
-       user_run $user $ZFS set $perm=$nmode $fs
+       log_note "$user zfs set $perm=$nmode $fs"
+       user_run $user zfs set $perm=$nmode $fs
        if [[ $(get_prop $perm $fs) != $nmode ]]; then
                return 1
        fi
 
-       log_note "$user $ZFS set $perm=$omode $fs"
-       user_run $user $ZFS set $perm=$omode $fs
+       log_note "$user zfs set $perm=$omode $fs"
+       user_run $user zfs set $perm=$omode $fs
        if [[ $(get_prop $perm $fs) != $omode ]]; then
                return 1
        fi
@@ -1350,14 +1350,14 @@ function verify_vol_destroy
        typeset perm=$2
        typeset vol=$3
 
-       user_run $user $ZFS destroy $vol
+       user_run $user zfs destroy $vol
        if ! datasetexists $vol ; then
                return 1
        fi
 
        # mount permission is required
-       log_must $ZFS allow $user mount $vol
-       user_run $user $ZFS destroy $vol
+       log_must zfs allow $user mount $vol
+       user_run $user zfs destroy $vol
        if datasetexists $vol ; then
                return 1
        fi
@@ -1371,18 +1371,18 @@ function verify_vol_snapshot
        typeset perm=$2
        typeset vol=$3
 
-       typeset stamp=${perm}.${user}.$($DATE +'%F-%T-%N')
+       typeset stamp=${perm}.${user}.$(date +'%F-%T-%N')
         typeset basevol=${vol%/*}
        typeset snap=$vol@snap.$stamp
 
-       user_run $user $ZFS snapshot $snap
+       user_run $user zfs snapshot $snap
        if datasetexists $snap ; then
                return 1
        fi
 
-       log_must $ZFS allow $user mount $vol
-       user_run $user $ZFS snapshot $snap
-       log_must $ZFS unallow $user mount $vol
+       log_must zfs allow $user mount $vol
+       user_run $user zfs snapshot $snap
+       log_must zfs unallow $user mount $vol
        if ! datasetexists $snap ; then
                return 1
        fi
@@ -1396,28 +1396,28 @@ function verify_vol_rollback
        typeset perm=$2
        typeset vol=$3
 
-       typeset stamp=${perm}.${user}.$($DATE +'%F-%T-%N')
+       typeset stamp=${perm}.${user}.$(date+'%F-%T-%N')
         typeset basevol=${vol%/*}
        typeset snap=$vol@snap.$stamp
 
        typeset oldval
-       log_must $ZFS snapshot $snap
+       log_must zfs snapshot $snap
        oldval=$(datasetcksum $vol)
 
-       log_must $DD if=/dev/urandom of=$ZVOL_RDEVDIR/$vol \
+       log_must dd if=/dev/urandom of=$ZVOL_RDEVDIR/$vol \
                bs=512 count=1
 
-       user_run $user $ZFS rollback -R $snap
-       $SLEEP 10
+       user_run $user zfs rollback -R $snap
+       sleep 10
        if [[ $oldval == $(datasetcksum $vol) ]]; then
                return 1
        fi
 
        # rollback on volume has to be with mount permission
-       log_must $ZFS allow $user mount $vol
-       user_run $user $ZFS rollback -R $snap
-       $SLEEP 10
-       log_must $ZFS unallow $user mount $vol
+       log_must zfs allow $user mount $vol
+       user_run $user zfs rollback -R $snap
+       sleep 10
+       log_must zfs unallow $user mount $vol
        if [[ $oldval != $(datasetcksum $vol) ]]; then
                return 1
        fi
@@ -1431,39 +1431,39 @@ function verify_vol_clone
        typeset perm=$2
        typeset vol=$3
 
-       typeset stamp=${perm}.${user}.$($DATE +'%F-%T-%N')
+       typeset stamp=${perm}.${user}.$(date+'%F-%T-%N')
         typeset basevol=${vol%/*}
        typeset snap=$vol@snap.$stamp
        typeset clone=$basevol/cvol.$stamp
 
-       log_must $ZFS snapshot $snap
+       log_must zfs snapshot $snap
 
-       user_run $user $ZFS clone $snap $clone
+       user_run $user zfs clone $snap $clone
        if datasetexists $clone ; then
                return 1
        fi
 
-       log_must $ZFS allow $user create $basevol
-       user_run $user $ZFS clone $snap $clone
-       log_must $ZFS unallow $user create $basevol
+       log_must zfs allow $user create $basevol
+       user_run $user zfs clone $snap $clone
+       log_must zfs unallow $user create $basevol
        if datasetexists $clone ; then
                return 1
        fi
 
-       log_must $ZFS allow $user mount $basevol
-       user_run $user $ZFS clone $snap $clone
-       log_must $ZFS unallow $user mount $basevol
+       log_must zfs allow $user mount $basevol
+       user_run $user zfs clone $snap $clone
+       log_must zfs unallow $user mount $basevol
        if datasetexists $clone ; then
                return 1
        fi
 
        # require create permission on parent and
        # mount permission on itself as well
-       log_must $ZFS allow $user mount $basevol
-       log_must $ZFS allow $user create $basevol
-       user_run $user $ZFS clone $snap $clone
-       log_must $ZFS unallow $user create $basevol
-       log_must $ZFS unallow $user mount $basevol
+       log_must zfs allow $user mount $basevol
+       log_must zfs allow $user create $basevol
+       user_run $user zfs clone $snap $clone
+       log_must zfs unallow $user create $basevol
+       log_must zfs unallow $user mount $basevol
        if ! datasetexists $clone ; then
                return 1
        fi
@@ -1477,43 +1477,43 @@ function verify_vol_rename
        typeset perm=$2
        typeset vol=$3
 
-       typeset stamp=${perm}.${user}.$($DATE +'%F-%T-%N')
+       typeset stamp=${perm}.${user}.$(date+'%F-%T-%N')
         typeset basevol=${vol%/*}
        typeset snap=$vol@snap.$stamp
        typeset clone=$basevol/cvol.$stamp
        typeset renamevol=$basevol/nvol.$stamp
 
-       user_run $user $ZFS rename $vol $renamevol
+       user_run $user zfs rename $vol $renamevol
        if datasetexists $renamevol ; then
                return 1
        fi
 
-       log_must $ZFS allow $user create $basevol
-       user_run $user $ZFS rename $vol $renamevol
-       log_must $ZFS unallow $user create $basevol
+       log_must zfs allow $user create $basevol
+       user_run $user zfs rename $vol $renamevol
+       log_must zfs unallow $user create $basevol
        if datasetexists $renamevol ; then
                return 1
        fi
 
-       log_must $ZFS allow $user mount $basevol
-       user_run $user $ZFS rename $vol $renamevol
-       log_must $ZFS unallow $user mount $basevol
+       log_must zfs allow $user mount $basevol
+       user_run $user zfs rename $vol $renamevol
+       log_must zfs unallow $user mount $basevol
        if datasetexists $renamevol ; then
                return 1
        fi
 
        # require both create permission on parent and
        # mount permission on parent as well
-       log_must $ZFS allow $user mount $basevol
-       log_must $ZFS allow $user create $basevol
-       user_run $user $ZFS rename $vol $renamevol
-       log_must $ZFS unallow $user mount $basevol
-       log_must $ZFS unallow $user create $basevol
+       log_must zfs allow $user mount $basevol
+       log_must zfs allow $user create $basevol
+       user_run $user zfs rename $vol $renamevol
+       log_must zfs unallow $user mount $basevol
+       log_must zfs unallow $user create $basevol
        if ! datasetexists $renamevol ; then
                return 1
        fi
 
-       log_must $ZFS rename $renamevol $vol
+       log_must zfs rename $renamevol $vol
 
        return 0
 }
@@ -1524,14 +1524,14 @@ function verify_vol_promote
        typeset perm=$2
        typeset vol=$3
 
-       typeset stamp=${perm}.${user}.$($DATE +'%F-%T-%N')
+       typeset stamp=${perm}.${user}.$(date+'%F-%T-%N')
         typeset basevol=${vol%/*}
        typeset snap=$vol@snap.$stamp
        typeset clone=$basevol/cvol.$stamp
 
-       log_must $ZFS snapshot $snap
-       log_must $ZFS clone $snap $clone
-       log_must $ZFS promote $clone
+       log_must zfs snapshot $snap
+       log_must zfs clone $snap $clone
+       log_must zfs promote $clone
 
        typeset vol_orig=$(get_prop origin $vol)
        typeset clone_orig=$(get_prop origin $clone)
@@ -1539,7 +1539,7 @@ function verify_vol_promote
        # promote should fail if $vol and $clone
        # miss either mount or promote permission
        # case 1
-       user_run $user $ZFS promote $vol
+       user_run $user zfs promote $vol
        if [[ $vol_orig != $(get_prop origin $vol) || \
                $clone_orig != $(get_prop origin $clone) ]];
        then
@@ -1549,9 +1549,9 @@ function verify_vol_promote
        # promote should fail if $vol and $clone
        # miss either mount or promote permission
        # case 2
-       log_must $ZFS allow $user promote $clone
-       user_run $user $ZFS promote $vol
-       log_must $ZFS unallow $user promote $clone
+       log_must zfs allow $user promote $clone
+       user_run $user zfs promote $vol
+       log_must zfs unallow $user promote $clone
        if [[ $vol_orig != $(get_prop origin $vol) || \
                $clone_orig != $(get_prop origin $clone) ]];
        then
@@ -1561,9 +1561,9 @@ function verify_vol_promote
        # promote should fail if $vol and $clone
        # miss either mount or promote permission
        # case 3
-       log_must $ZFS allow $user mount $vol
-       user_run $user $ZFS promote $vol
-       log_must $ZFS unallow $user mount $vol
+       log_must zfs allow $user mount $vol
+       user_run $user zfs promote $vol
+       log_must zfs unallow $user mount $vol
        if [[ $vol_orig != $(get_prop origin $vol) || \
                $clone_orig != $(get_prop origin $clone) ]];
        then
@@ -1573,9 +1573,9 @@ function verify_vol_promote
        # promote should fail if $vol and $clone
        # miss either mount or promote permission
        # case 4
-       log_must $ZFS allow $user mount $clone
-       user_run $user $ZFS promote $vol
-       log_must $ZFS unallow $user mount $clone
+       log_must zfs allow $user mount $clone
+       user_run $user zfs promote $vol
+       log_must zfs unallow $user mount $clone
        if [[ $vol_orig != $(get_prop origin $vol) || \
                $clone_orig != $(get_prop origin $clone) ]];
        then
@@ -1585,11 +1585,11 @@ function verify_vol_promote
        # promote should fail if $vol and $clone
        # miss either mount or promote permission
        # case 5
-       log_must $ZFS allow $user promote $clone
-       log_must $ZFS allow $user mount $vol
-       user_run $user $ZFS promote $vol
-       log_must $ZFS unallow $user promote $clone
-       log_must $ZFS unallow $user mount $vol
+       log_must zfs allow $user promote $clone
+       log_must zfs allow $user mount $vol
+       user_run $user zfs promote $vol
+       log_must zfs unallow $user promote $clone
+       log_must zfs unallow $user mount $vol
        if [[ $vol_orig != $(get_prop origin $vol) || \
                $clone_orig != $(get_prop origin $clone) ]];
        then
@@ -1599,11 +1599,11 @@ function verify_vol_promote
        # promote should fail if $vol and $clone
        # miss either mount or promote permission
        # case 6
-       log_must $ZFS allow $user promote $clone
-       log_must $ZFS allow $user mount $clone
-       user_run $user $ZFS promote $vol
-       log_must $ZFS unallow $user promote $clone
-       log_must $ZFS unallow $user mount $vol
+       log_must zfs allow $user promote $clone
+       log_must zfs allow $user mount $clone
+       user_run $user zfs promote $vol
+       log_must zfs unallow $user promote $clone
+       log_must zfs unallow $user mount $vol
        if [[ $vol_orig != $(get_prop origin $vol) || \
                $clone_orig != $(get_prop origin $clone) ]];
        then
@@ -1613,11 +1613,11 @@ function verify_vol_promote
        # promote should fail if $vol and $clone
        # miss either mount or promote permission
        # case 7
-       log_must $ZFS allow $user mount $vol
-       log_must $ZFS allow $user mount $clone
-       user_run $user $ZFS promote $vol
-       log_must $ZFS unallow $user mount $vol
-       log_must $ZFS unallow $user mount $clone
+       log_must zfs allow $user mount $vol
+       log_must zfs allow $user mount $clone
+       user_run $user zfs promote $vol
+       log_must zfs unallow $user mount $vol
+       log_must zfs unallow $user mount $clone
        if [[ $vol_orig != $(get_prop origin $vol) || \
                $clone_orig != $(get_prop origin $clone) ]];
        then
@@ -1627,13 +1627,13 @@ function verify_vol_promote
        # promote only succeeds when $vol and $clone
        # have both mount and promote permission
        # case 8
-       log_must $ZFS allow $user promote $clone
-       log_must $ZFS allow $user mount $vol
-       log_must $ZFS allow $user mount $clone
-       user_run $user $ZFS promote $vol
-       log_must $ZFS unallow $user promote $clone
-       log_must $ZFS unallow $user mount $vol
-       log_must $ZFS unallow $user mount $clone
+       log_must zfs allow $user promote $clone
+       log_must zfs allow $user mount $vol
+       log_must zfs allow $user mount $clone
+       user_run $user zfs promote $vol
+       log_must zfs unallow $user promote $clone
+       log_must zfs unallow $user mount $vol
+       log_must zfs unallow $user mount $clone
        if [[ $snap != $(get_prop origin $clone) || \
                $clone_orig != $(get_prop origin $vol) ]]; then
                return 1
@@ -1656,7 +1656,7 @@ function verify_vol_volsize
 
        if [[ "0" == $reserv_size ]]; then
                # sparse volume
-               user_run $user $ZFS set volsize=$newval $vol
+               user_run $user zfs set volsize=$newval $vol
                if [[ $oldval == $(get_prop volsize $vol) ]];
                then
                        return 1
@@ -1665,17 +1665,17 @@ function verify_vol_volsize
        else
                # normal volume, reservation permission
                # is required
-               user_run $user $ZFS set volsize=$newval $vol
+               user_run $user zfs set volsize=$newval $vol
                if [[ $newval == $(get_prop volsize $vol) ]];
                then
                        return 1
                fi
 
-               log_must $ZFS allow $user reservation $vol
-               log_must $ZFS allow $user refreservation $vol
-               user_run $user $ZFS set volsize=$newval $vol
-               log_must $ZFS unallow $user reservation $vol
-               log_must $ZFS unallow $user refreservation $vol
+               log_must zfs allow $user reservation $vol
+               log_must zfs allow $user refreservation $vol
+               user_run $user zfs set volsize=$newval $vol
+               log_must zfs unallow $user reservation $vol
+               log_must zfs unallow $user refreservation $vol
                if [[ $oldval == $(get_prop volsize $vol) ]];
                then
                        return 1
@@ -1693,16 +1693,16 @@ function verify_allow
 
        typeset -i ret
 
-       user_run $user $ZFS allow $user allow $dtst
+       user_run $user zfs allow $user allow $dtst
        ret=$?
        if [[ $ret -eq 0 ]]; then
                return 1
        fi
 
-       log_must $ZFS allow $user copies $dtst
-       user_run $user $ZFS allow $user copies $dtst
+       log_must zfs allow $user copies $dtst
+       user_run $user zfs allow $user copies $dtst
        ret=$?
-       log_must $ZFS unallow $user copies $dtst
+       log_must zfs unallow $user copies $dtst
        if [[ $ret -eq 1 ]]; then
                return 1
        fi
index 6533f27cb9c3354640982ee647ae205ed17c709b..1e974be73bb25c0c8898a84ac7c9de3602ae8a57 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -36,10 +36,10 @@ if ! is_linux; then
        # check svc:/network/nis/client:default state
        # disable it if the state is ON
        # and the state will be restored during cleanup.ksh
-       log_must $RM -f $NISSTAFILE
-       if [[ "ON" == $($SVCS -H -o sta svc:/network/nis/client:default) ]]; then
-               log_must $SVCADM disable -t svc:/network/nis/client:default
-               log_must $TOUCH $NISSTAFILE
+       log_must rm -f $NISSTAFILE
+       if [[ "ON" == $(svcs -H -o sta svc:/network/nis/client:default) ]]; then
+               log_must svcadm disable -t svc:/network/nis/client:default
+               log_must touch $NISSTAFILE
        fi
 fi
 
@@ -57,6 +57,6 @@ log_must add_user $OTHER_GROUP $OTHER2
 
 DISK=${DISKS%% *}
 default_volume_setup $DISK
-log_must $CHMOD 777 $TESTDIR
+log_must chmod 777 $TESTDIR
 
 log_pass
index 14a3bc10e30fc2596352bec5a6925322637ef9c7..3db1af5098e1fc4badd44bba5879a13f81ca248f 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/delegate/delegate_common.kshlib
@@ -65,12 +65,12 @@ eval set -A dataset $DATASETS
 typeset perms="snapshot,reservation,compression,checksum,send,userprop"
 
 log_note "Create a user called 'everyone'."
-if ! $ID everyone > /dev/null 2>&1; then
+if ! id everyone > /dev/null 2>&1; then
        user_added="TRUE"
        log_must add_user $STAFF_GROUP everyone
 fi
 for dtst in $DATASETS ; do
-       log_must $ZFS allow everyone $perms $dtst
+       log_must zfs allow everyone $perms $dtst
        log_must verify_perm $dtst $perms $EVERYONE "everyone"
 done
 log_must restore_root_datasets
@@ -79,20 +79,20 @@ if [[ $user_added == "TRUE" ]]; then
 fi
 
 log_note "Created a group called 'everyone'."
-if ! $CAT /etc/group | $AWK -F: '{print $1}' | \
-       $GREP -w 'everyone' > /dev/null 2>&1
+if ! cat /etc/group | awk -F: '{print $1}' | \
+       grep -w 'everyone' > /dev/null 2>&1
 then
        group_added="TRUE"
-       log_must $GROUPADD everyone
+       log_must groupadd everyone
 fi
 
 for dtst in $DATASETS ; do
-       log_must $ZFS allow everyone $perms $dtst
+       log_must zfs allow everyone $perms $dtst
        log_must verify_perm $dtst $perms $EVERYONE
 done
 log_must restore_root_datasets
 if [[ $group_added == "TRUE" ]]; then
-       log_must $GROUPDEL everyone
+       log_must groupdel everyone
 fi
 
 log_pass "everyone is always interpreted as keyword passed."
index e11051adfe31ba78cffb28cf329f8544fd6860f2..23ed806ad75d4f5b6ab7704d78e4225679429b10 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/delegate/delegate_common.kshlib
@@ -48,7 +48,7 @@ verify_runnable "both"
 
 function cleanup
 {
-       if $ID $STAFF_GROUP > /dev/null 2>&1; then
+       if id $STAFF_GROUP > /dev/null 2>&1; then
                log_must del_user $STAFF_GROUP
        fi
 
@@ -63,7 +63,7 @@ typeset perms="snapshot,reservation,compression,checksum,send,userprop"
 
 log_must add_user $STAFF_GROUP $STAFF_GROUP
 for dtst in $DATASETS ; do
-       log_must $ZFS allow $STAFF_GROUP $perms $dtst
+       log_must zfs allow $STAFF_GROUP $perms $dtst
        log_must verify_perm $dtst $perms $STAFF_GROUP
        log_must verify_noperm $dtst $perms $STAFF1 $STAFF2
 done
@@ -72,7 +72,7 @@ log_must restore_root_datasets
 
 log_must del_user $STAFF_GROUP
 for dtst in $datasets ; do
-       log_must $ZFS allow $STAFF_GROUP $perms $dtst
+       log_must zfs allow $STAFF_GROUP $perms $dtst
        log_must verify_perm $dtst $perms $STAFF1 $STAFF2
 done
 
index 21cf4a04ad0358ace25ed259706ef538bec03a89..d8eb58ae1d65a30e410359fd6b5bdf2787848ba8 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/delegate/delegate_common.kshlib
@@ -53,10 +53,10 @@ childfs=$ROOT_TESTFS/childfs
 eval set -A dataset $DATASETS
 typeset perms="snapshot,reservation,compression,checksum,userprop"
 
-log_must $ZFS create $childfs
+log_must zfs create $childfs
 
 for dtst in $DATASETS ; do
-       log_must $ZFS allow -l $STAFF1 $perms $dtst
+       log_must zfs allow -l $STAFF1 $perms $dtst
        log_must verify_perm $dtst $perms $STAFF1
        if [[ $dtst == $ROOT_TESTFS ]] ; then
                log_must verify_noperm $childfs $perms \
@@ -66,9 +66,9 @@ done
 
 log_must restore_root_datasets
 
-log_must $ZFS create $childfs
+log_must zfs create $childfs
 for dtst in $DATASETS ; do
-       log_must $ZFS allow -l -g $STAFF_GROUP $perms $dtst
+       log_must zfs allow -l -g $STAFF_GROUP $perms $dtst
        log_must verify_perm $dtst $perms $STAFF1 $STAFF2
        if [[ $dtst == $ROOT_TESTFS ]] ; then
                log_must verify_noperm $childfs $perms \
@@ -78,9 +78,9 @@ done
 
 log_must restore_root_datasets
 
-log_must $ZFS create $childfs
+log_must zfs create $childfs
 for dtst in $DATASETS ; do
-       log_must $ZFS allow -l -e $perms $dtst
+       log_must zfs allow -l -e $perms $dtst
        log_must verify_perm $dtst $perms $STAFF1 $STAFF2 $OTHER1 $OTHER2
        if [[ $dtst == $ROOT_TESTFS ]] ; then
                log_must verify_noperm $childfs $perms \
index c1cdb3c3436198aabf15f932530584641886d927..1462f5ebe984889e8c01b968d9592f9584886a92 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/delegate/delegate_common.kshlib
@@ -58,9 +58,9 @@ eval set -A dataset $DATASETS
 typeset perms="snapshot,reservation,compression,checksum,userprop"
 
 # Verify option '-d' only affect sub-datasets
-log_must $ZFS create $childfs
+log_must zfs create $childfs
 for dtst in $DATASETS ; do
-       log_must $ZFS allow -d $STAFF1 $perms $dtst
+       log_must zfs allow -d $STAFF1 $perms $dtst
        log_must verify_noperm $dtst $perms $STAFF1
        if [[ $dtst == $ROOT_TESTFS ]]; then
                log_must verify_perm $childfs $perms $STAFF1
@@ -70,9 +70,9 @@ done
 log_must restore_root_datasets
 
 # Verify option '-d + -g' affect group in sub-datasets.
-log_must $ZFS create $childfs
+log_must zfs create $childfs
 for dtst in $DATASETS ; do
-       log_must $ZFS allow -d -g $STAFF_GROUP $perms $dtst
+       log_must zfs allow -d -g $STAFF_GROUP $perms $dtst
        log_must verify_noperm $dtst $perms $STAFF2
        if [[ $dtst == $ROOT_TESTFS ]]; then
                log_must verify_perm $childfs $perms $STAFF2
@@ -82,9 +82,9 @@ done
 log_must restore_root_datasets
 
 # Verify option '-d + -e' affect everyone in sub-datasets.
-log_must $ZFS create $childfs
+log_must zfs create $childfs
 for dtst in $DATASETS ; do
-       log_must $ZFS allow -d -e $perms $dtst
+       log_must zfs allow -d -e $perms $dtst
        log_must verify_noperm $dtst $perms $OTHER1 $OTHER2
        if [[ $dtst == $ROOT_TESTFS ]]; then
                log_must verify_perm $childfs $perms $OTHER1 $OTHER2
index 93426430e6bd021b4d3d91d45afc36d3dd8c42fe..3feb598c4cedba06ca23e9036f820e4dff847c9a 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/delegate/delegate_common.kshlib
@@ -52,16 +52,16 @@ log_onexit restore_root_datasets
 eval set -A dataset $DATASETS
 typeset perms="snapshot,reservation,compression,checksum,userprop"
 
-log_must $ZFS allow -l everyone create,mount $ROOT_TESTFS
-log_must $ZFS allow -c $perms $ROOT_TESTFS
+log_must zfs allow -l everyone create,mount $ROOT_TESTFS
+log_must zfs allow -c $perms $ROOT_TESTFS
 
 mntpnt=$(get_prop mountpoint $ROOT_TESTFS)
-log_must $CHMOD 777 $mntpnt
+log_must chmod 777 $mntpnt
 
 for user in $EVERYONE; do
        childfs=$ROOT_TESTFS/$user
 
-       user_run $user $ZFS create $childfs
+       user_run $user zfs create $childfs
 
        for other in $EVERYONE; do
                #
index e8cdf2586a5d08e8bc77fa01fc8dfa36cff9ceb7..2fc05dee907a221e3bccba7cd547fa05911cc8df 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/delegate/delegate_common.kshlib
@@ -51,21 +51,21 @@ log_assert "Changing permissions in a set will change what is allowed " \
 log_onexit restore_root_datasets
 
 fs1=$ROOT_TESTFS/fs1; fs2=$ROOT_TESTFS/fs2
-log_must $ZFS create $fs1
-log_must $ZFS create $fs2
+log_must zfs create $fs1
+log_must zfs create $fs2
 
 eval set -A dataset $DATASETS
 perms1="snapshot,checksum,reservation"
 
 for dtst in $DATASETS $fs1 $fs2; do
-       log_must $ZFS allow -s @basic $perms1 $dtst
-       log_must $ZFS allow $STAFF1 @basic $dtst
+       log_must zfs allow -s @basic $perms1 $dtst
+       log_must zfs allow $STAFF1 @basic $dtst
        log_must verify_perm $dtst $perms1 $STAFF1
 done
 
 perms2="send,compression,userprop"
 for dtst in $DATASETS $fs1 $fs2; do
-       log_must $ZFS allow -s @basic $perms2 $dtst
+       log_must zfs allow -s @basic $perms2 $dtst
        log_must verify_perm $dtst ${perms1},${perms2} $STAFF1
 done
 
index 5305deb53251af2325de7e5d34da9246a85a3fd2..ea43fcf03337f1e4e398327b41231bfcb40313ab 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/delegate/delegate_common.kshlib
@@ -62,16 +62,16 @@ typeset perms2="checksum,send,userprop"
 #
 childfs=$ROOT_TESTFS/childfs
 grandchild=$childfs/grandchild
-log_must $ZFS create $childfs
-log_must $ZFS create $grandchild
+log_must zfs create $childfs
+log_must zfs create $grandchild
 
 #
 # Setting different permissions to the same set on two level.
 # But only assign the user at one level.
 #
-log_must $ZFS allow -s @set $perms1 $ROOT_TESTFS
-log_must $ZFS allow -s @set $perms2 $childfs
-log_must $ZFS allow $STAFF1 @set $childfs
+log_must zfs allow -s @set $perms1 $ROOT_TESTFS
+log_must zfs allow -s @set $perms2 $childfs
+log_must zfs allow $STAFF1 @set $childfs
 
 #
 # Verify only perms2 is valid to user on the level which he was assigned.
@@ -86,7 +86,7 @@ done
 # Delegate @set to STAFF1 on ROOT_TESTFS, verify $perms1 will not be appended
 # to its descendent datasets since it is masked
 #
-log_must $ZFS allow $STAFF1 @set $ROOT_TESTFS
+log_must zfs allow $STAFF1 @set $ROOT_TESTFS
 log_must verify_perm $ROOT_TESTFS $perms1 $STAFF1
 for fs in $childfs $grandchild ; do
        log_must verify_noperm $fs $perms1 $STAFF1
@@ -94,7 +94,7 @@ for fs in $childfs $grandchild ; do
 done
 
 # Remove the mask, $perms1 will be allowed to its descendent datasets
-log_must $ZFS unallow -s @set $childfs
+log_must zfs unallow -s @set $childfs
 for fs in $childfs $grandchild ; do
        log_must verify_noperm $fs $perms2 $STAFF1
        log_must verify_perm $fs $perms1 $STAFF1
index fb02b9af33ee13c58c79fa8e8aae1a39157238b3..48de842b7edc81db04aa874aa15270fef244f86e 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/delegate/delegate_common.kshlib
@@ -51,27 +51,27 @@ perms1="snapshot,reservation"
 perms2="send,compression,checksum,userprop"
 childfs=$ROOT_TESTFS/childfs
 
-log_must $ZFS create $childfs
+log_must zfs create $childfs
 
 for dtst in $DATASETS ; do
        # Delegate local permission to $STAFF1
-       log_must $ZFS allow -l $STAFF1 $perms1 $dtst
-       log_must $ZFS allow -l $STAFF1 allow $dtst
+       log_must zfs allow -l $STAFF1 $perms1 $dtst
+       log_must zfs allow -l $STAFF1 allow $dtst
 
        if [[ $dtst == $ROOT_TESTFS ]]; then
-               log_must $ZFS allow -l $STAFF1 $perms2 $childfs
+               log_must zfs allow -l $STAFF1 $perms2 $childfs
                # $perms1 is local permission in $ROOT_TESTFS
-               log_mustnot user_run $STAFF1 $ZFS allow $OTHER1 $perms1 $childfs
+               log_mustnot user_run $STAFF1 zfs allow $OTHER1 $perms1 $childfs
                log_must verify_noperm $childfs $perms1 $OTHER1
        fi
 
        # Verify 'allow' give non-privilege user delegated permission.
-       log_must user_run $STAFF1 $ZFS allow -l $OTHER1 $perms1 $dtst
+       log_must user_run $STAFF1 zfs allow -l $OTHER1 $perms1 $dtst
        log_must verify_perm $dtst $perms1 $OTHER1
 
        # $perms2 was not allow to $STAFF1, so he have no permission to
        # delegate permission to other else.
-       log_mustnot user_run $STAFF1 $ZFS allow $OTHER1 $perms2 $dtst
+       log_mustnot user_run $STAFF1 zfs allow $OTHER1 $perms2 $dtst
        log_must verify_noperm $dtst $perms2 $OTHER1
 done
 
index 4da16538cc4c32da647081625f1e5ff5065e07ef..c2c911020410e78a32abe18c25175d53e5fc4df2 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/delegate/delegate_common.kshlib
@@ -49,16 +49,16 @@ log_onexit restore_root_datasets
 # Permission sets are limited to 64 characters in length.
 longset="set123456789012345678901234567890123456789012345678901234567890123"
 for dtst in $DATASETS ; do
-       log_mustnot eval "$ZFS allow -s @$longset $dtst"
+       log_mustnot eval "zfs allow -s @$longset $dtst"
        # Create non-existent permission set
-       typeset timestamp=$($DATE +'%F-%R:%S')
-       log_mustnot $ZFS allow -s @non-existent $dtst
-       log_mustnot $ZFS allow $STAFF "atime,created,mounted" $dtst
-       log_mustnot $ZFS allow $dtst $TESTPOOL
-       log_mustnot $ZFS allow -c $dtst
-       log_mustnot $ZFS allow -u $STAFF1 $dtst
-       log_mustnot $ZFS allow -u $STAFF1 -g $STAFF_GROUP "create,destroy" $dtst
-       log_mustnot $ZFS allow -u $STAFF1 -e "mountpoint" $dtst
+       typeset timestamp=$(date +'%F-%R:%S')
+       log_mustnot zfs allow -s @non-existent $dtst
+       log_mustnot zfs allow $STAFF "atime,created,mounted" $dtst
+       log_mustnot zfs allow $dtst $TESTPOOL
+       log_mustnot zfs allow -c $dtst
+       log_mustnot zfs allow -u $STAFF1 $dtst
+       log_mustnot zfs allow -u $STAFF1 -g $STAFF_GROUP "create,destroy" $dtst
+       log_mustnot zfs allow -u $STAFF1 -e "mountpoint" $dtst
 done
 
 log_pass "Invalid arguments are handled correctly."
index 16154dbed3aee9f1d5394a1feb89c93f7955b131..7b70e13224b500e9272f918c1dce46c10ba16962 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/delegate/delegate_common.kshlib
@@ -135,7 +135,7 @@ for dtst in $DATASETS; do
 
        typeset -i i=0
        while (( i < ${#perms[@]} )); do
-               log_must $ZFS allow $STAFF1 ${perms[$i]} $dtst
+               log_must zfs allow $STAFF1 ${perms[$i]} $dtst
 
                if [[ ${perms[((i+k))]} == "true" ]]; then
                        log_must verify_perm $dtst ${perms[$i]} $STAFF1
index 60031c92ca0eaf619fa934c55c6220c61b93f806..d4203a814341953d2ec026a673de7f992dfc9395 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/delegate/delegate_common.kshlib
@@ -59,7 +59,7 @@ for dtst in $DATASETS ; do
        typeset -i i=0
 
        while ((i < ${#invalid_perms[@]})); do
-               log_mustnot $ZFS allow $STAFF1 ${invalid_perms[$i]} $dtst
+               log_mustnot zfs allow $STAFF1 ${invalid_perms[$i]} $dtst
 
                ((i += 1))
        done
index 723fb92921d313419ccf5135b73999faf0232463..4da559bfc772082d443e1a2862b7a086e79eb736 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/delegate/delegate_common.kshlib
@@ -46,7 +46,7 @@ verify_runnable "global"
 
 function cleanup
 {
-       log_must $ZPOOL set delegation=on $TESTPOOL
+       log_must zpool set delegation=on $TESTPOOL
        log_must restore_root_datasets
 }
 
@@ -69,13 +69,13 @@ set -A perms        create snapshot mount send allow quota reservation \
                zoned xattr receive destroy sharenfs share
 fi
 
-log_must $ZPOOL set delegation=off $TESTPOOL
+log_must zpool set delegation=off $TESTPOOL
 
 for dtst in $DATASETS; do
        typeset -i i=0
        while (( i < ${#perms[@]} )); do
 
-               log_must $ZFS allow $STAFF1 ${perms[$i]} $dtst
+               log_must zfs allow $STAFF1 ${perms[$i]} $dtst
                log_must verify_noperm $dtst ${perms[$i]} $STAFF1
 
                log_must restore_root_datasets
index a2c34de7a262da2deee537b8cff86a25ed1094da..178d250ca52982a7a254e05ba4e4026640d183ed 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/delegate/delegate_common.kshlib
@@ -49,10 +49,10 @@ log_onexit restore_root_datasets
 log_must setup_unallow_testenv
 
 for dtst in $DATASETS ; do
-       log_must $ZFS unallow -l $STAFF1 $dtst
+       log_must zfs unallow -l $STAFF1 $dtst
        log_must verify_noperm $dtst $LOCAL_SET $STAFF1
 
-       log_must $ZFS unallow -l $OTHER1 $dtst
+       log_must zfs unallow -l $OTHER1 $dtst
        log_must verify_noperm $dtst $LOCAL_DESC_SET $OTHER1
 
        log_must verify_perm $dtst $LOCAL_DESC_SET $OTHER2
index c48df76d8aad5d29341dd3625214585ba74e4991..ea1de97614f30621c029ec17876eff333deb557b 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/delegate/delegate_common.kshlib
@@ -48,10 +48,10 @@ log_onexit restore_root_datasets
 
 log_must setup_unallow_testenv
 
-log_must $ZFS unallow -d $STAFF2 $ROOT_TESTFS
+log_must zfs unallow -d $STAFF2 $ROOT_TESTFS
 log_must verify_noperm $SUBFS $DESC_SET $STAFF2
 
-log_must $ZFS unallow -d $OTHER1 $ROOT_TESTFS
+log_must zfs unallow -d $OTHER1 $ROOT_TESTFS
 log_must verify_noperm $SUBFS $LOCAL_DESC_SET $OTHER1
 log_must verify_perm $ROOT_TESTFS $LOCAL_DESC_SET $OTHER1
 
index 57dff54620dd76df724a123db9e174435a58efd3..35eb9a961ebc517eb10b282fe83a64d95ae263b0 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/delegate/delegate_common.kshlib
@@ -53,15 +53,15 @@ log_onexit restore_root_datasets
 log_must setup_unallow_testenv
 
 for dtst in $DATASETS ; do
-       log_must $ZFS unallow $STAFF1 $dtst
-       log_must $ZFS unallow -l -d $STAFF2 $dtst
+       log_must zfs unallow $STAFF1 $dtst
+       log_must zfs unallow -l -d $STAFF2 $dtst
        log_must verify_noperm $dtst $LOCAL_SET $STAFF1
        if [[ $dtst == $ROOT_TESTFS ]]; then
                log_must verify_noperm $SUBFS $DESC_SET $STAFF2
        fi
 
-       log_must $ZFS unallow -l -d $OTHER1 $dtst
-       log_must $ZFS unallow -r $OTHER2 $dtst
+       log_must zfs unallow -l -d $OTHER1 $dtst
+       log_must zfs unallow -r $OTHER2 $dtst
        log_must verify_noperm $dtst $LOCAL_DESC_SET $OTHER1 $OTHER2
        if [[ $dtst == $ROOT_TESTFS ]]; then
                log_must verify_noperm $SUBFS $LOCAL_DESC_SET $OTHER1 $OTHER2
index 0c55551ee5ecb2287574a45d7c3be889da6336f0..d41d76bd09503f3aa1237d7a00f4092567248221 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/delegate/delegate_common.kshlib
@@ -48,11 +48,11 @@ log_assert "Verify '-s' will remove permissions from the named set."
 log_onexit restore_root_datasets
 
 for dtst in $DATASETS ; do
-       log_must $ZFS allow -s @basic $LOCAL_DESC_SET $dtst
-       log_must $ZFS allow -u $STAFF1 @basic $dtst
+       log_must zfs allow -s @basic $LOCAL_DESC_SET $dtst
+       log_must zfs allow -u $STAFF1 @basic $dtst
 
        log_must verify_perm $dtst $LOCAL_DESC_SET $STAFF1
-       log_must $ZFS unallow -s @basic $LOCAL_DESC_SET $dtst
+       log_must zfs unallow -s @basic $LOCAL_DESC_SET $dtst
        log_must verify_noperm $dtst $LOCAL_DESC_SET $STAFF1
 done
 
index a723e8f96124994bf705e83c2684a4accd664d73..a97f500ea98e2361a6c42b0f8480112305bd6cdc 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/delegate/delegate_common.kshlib
@@ -49,13 +49,13 @@ verify_runnable "both"
 log_assert "Verify option '-c' will remove the created permission set."
 log_onexit restore_root_datasets
 
-log_must $ZFS allow -c $LOCAL_SET $ROOT_TESTFS
-log_must $ZFS allow -l $STAFF1 create,mount $ROOT_TESTFS
+log_must zfs allow -c $LOCAL_SET $ROOT_TESTFS
+log_must zfs allow -l $STAFF1 create,mount $ROOT_TESTFS
 
 # Create $SUBFS and verify $SUBFS has created time permissions.
-user_run $STAFF1 $ZFS create $SUBFS
+user_run $STAFF1 zfs create $SUBFS
 if ! datasetexists $SUBFS ; then
-       log_fail "ERROR: ($STAFF1): $ZFS create $SUBFS"
+       log_fail "ERROR: ($STAFF1): zfs create $SUBFS"
 fi
 log_must verify_perm $SUBFS $LOCAL_SET $STAFF1
 
@@ -63,10 +63,10 @@ log_must verify_perm $SUBFS $LOCAL_SET $STAFF1
 # After unallow -c, create $SUBFS2 and verify $SUBFS2 has not created time
 # permissions any more.
 #
-log_must $ZFS unallow -c $LOCAL_SET $ROOT_TESTFS
-user_run $STAFF1 $ZFS create $SUBFS2
+log_must zfs unallow -c $LOCAL_SET $ROOT_TESTFS
+user_run $STAFF1 zfs create $SUBFS2
 if ! datasetexists $SUBFS2 ; then
-       log_fail "ERROR: ($STAFF1): $ZFS create $SUBFS2"
+       log_fail "ERROR: ($STAFF1): zfs create $SUBFS2"
 fi
 log_must verify_noperm $SUBFS2 $LOCAL_SET $STAFF1
 
index af9ea49f01dc1299741b272d0a3ce3d27dd045ba..2bba43de9d140c989009cbce1968657fc2edb3b6 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/delegate/delegate_common.kshlib
@@ -49,22 +49,22 @@ log_assert "Verify option '-u', '-g' and '-e' only removed the specified type "\
 log_onexit restore_root_datasets
 
 for dtst in $DATASETS ; do
-       log_must $ZFS allow -u $STAFF1 $LOCAL_DESC_SET $dtst
-       log_must $ZFS allow -g $STAFF_GROUP $LOCAL_DESC_SET $dtst
-       log_must $ZFS allow -e $LOCAL_DESC_SET $dtst
+       log_must zfs allow -u $STAFF1 $LOCAL_DESC_SET $dtst
+       log_must zfs allow -g $STAFF_GROUP $LOCAL_DESC_SET $dtst
+       log_must zfs allow -e $LOCAL_DESC_SET $dtst
 
        log_must verify_perm $dtst $LOCAL_DESC_SET \
                $STAFF1 $STAFF2 $OTHER1 $OTHER2
 
-       log_must $ZFS unallow -e $dtst
+       log_must zfs unallow -e $dtst
        log_must verify_perm $dtst $LOCAL_DESC_SET $STAFF1 $STAFF2
        log_must verify_noperm $dtst $LOCAL_DESC_SET $OTHER1 $OTHER2
 
-       log_must $ZFS unallow -g $STAFF_GROUP $dtst
+       log_must zfs unallow -g $STAFF_GROUP $dtst
        log_must verify_perm $dtst $LOCAL_DESC_SET $STAFF1
        log_must verify_noperm $dtst $LOCAL_DESC_SET $STAFF2
 
-       log_must $ZFS unallow -u $STAFF1 $dtst
+       log_must zfs unallow -u $STAFF1 $dtst
        log_must verify_noperm $dtst $LOCAL_DESC_SET $STAFF1
 done
 
index e9bd3bfd0f853795a1f8458cab3f224b5fd1d592..b1a221be0bd9a620dbb01fd6927afba0062f9277 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/delegate/delegate_common.kshlib
@@ -49,16 +49,16 @@ log_assert "zfs unallow won't remove those permissions which inherited from " \
 log_onexit restore_root_datasets
 
 perm1="atime,devices"; perm2="compression,checksum"
-log_must $ZFS create $SUBFS
-log_must $ZFS allow $STAFF1 $perm1 $ROOT_TESTFS
-log_must $ZFS allow $STAFF1 $perm2 $SUBFS
+log_must zfs create $SUBFS
+log_must zfs allow $STAFF1 $perm1 $ROOT_TESTFS
+log_must zfs allow $STAFF1 $perm2 $SUBFS
 
 log_must verify_perm $SUBFS ${perm1},${perm2} $STAFF1
 #
 # Athrough unallow the permissions which don't exists on the specific dataset
 # return 0, the inherited permissions can't be removed in fact.
 #
-log_must $ZFS unallow -u $STAFF1 $perm1 $SUBFS
+log_must zfs unallow -u $STAFF1 $perm1 $SUBFS
 log_must verify_perm $SUBFS ${perm1},${perm2} $STAFF1
 
 log_pass "Verify zfs unallow won't remove inherited permissions passed."
index b00119df6ebed000809257548abee2909c5d11aa..a8bd5ebcb6b48cf544d0ac060c5aeb63fd584f19 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/delegate/delegate_common.kshlib
@@ -68,15 +68,15 @@ log_must setup_unallow_testenv
 export POSIXLY_CORRECT=1
 
 for dtst in $DATASETS ; do
-       log_must $ZFS allow -c create $dtst
+       log_must zfs allow -c create $dtst
 
        typeset -i i=0
        while ((i < ${#badopts[@]})); do
-               neg_test $ZFS unallow ${badopts[$i]} $dtst
+               neg_test zfs unallow ${badopts[$i]} $dtst
                ((i += 1))
        done
 
-       # Causes test failure: neg_test user_run $STAFF1 $ZFS unallow $dtst
+       # Causes test failure: neg_test user_run $STAFF1 zfs unallow $dtst
 done
 
 unset POSIXLY_CORRECT
index acea6e24d267cf030cee8b6dad400f5ca3ddf7ab..ac031ed6a52f300defc0731a2dcd0fb5de2cc39d 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,15 +52,15 @@ log_assert "Setting devices=on on file system, the devices files in this file" \
        "system can be used."
 log_onexit cleanup
 
-log_must $ZFS set devices=on $TESTPOOL/$TESTFS
+log_must zfs set devices=on $TESTPOOL/$TESTFS
 
 #
 # Separately create block device file and character device file, then try to
 # open them and make sure it succeed.
 #
 create_dev_file b $TESTDIR/$TESTFILE1
-log_must $DD if=$TESTDIR/$TESTFILE1 of=$TESTDIR/$TESTFILE1.out count=1
+log_must dd if=$TESTDIR/$TESTFILE1 of=$TESTDIR/$TESTFILE1.out count=1
 create_dev_file c $TESTDIR/$TESTFILE2
-log_must $DD if=$TESTDIR/$TESTFILE2 of=$TESTDIR/$TESTFILE2.out count=1
+log_must dd if=$TESTDIR/$TESTFILE2 of=$TESTDIR/$TESTFILE2.out count=1
 
 log_pass "Setting devices=on on file system and testing it pass."
index 8a1f828775a0dc7b0341780a92661675ba48151d..ce25502b818b9c99e90f2c6086b4c07d50483ce4 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,15 +52,15 @@ log_assert "Setting devices=off on file system, the devices files in this file"\
        "system can not be used."
 log_onexit cleanup
 
-log_must $ZFS set devices=off $TESTPOOL/$TESTFS
+log_must zfs set devices=off $TESTPOOL/$TESTFS
 
 #
 # Separately create block device file and character device file, then try to
 # open them and make sure it failed.
 #
 create_dev_file b $TESTDIR/$TESTFILE1
-log_mustnot $DD if=$TESTDIR/$TESTFILE1 of=$TESTDIR/$TESTFILE1.out count=1
+log_mustnot dd if=$TESTDIR/$TESTFILE1 of=$TESTDIR/$TESTFILE1.out count=1
 create_dev_file c $TESTDIR/$TESTFILE2
-log_mustnot $DD if=$TESTDIR/$TESTFILE2 of=$TESTDIR/$TESTFILE2.out count=1
+log_mustnot dd if=$TESTDIR/$TESTFILE2 of=$TESTDIR/$TESTFILE2.out count=1
 
 log_pass "Setting devices=off on file system and testing it pass."
index 837478cfbc8cb463f4f23a0ac184c876822cfaf1..1fcd67409c11c4130cc36eaafec9d6b35b3058b1 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -44,6 +44,6 @@
 
 log_assert "Writing random data into /dev/zfs should do no harm."
 
-log_mustnot $DD if=/dev/urandom of=/dev/zfs count=1024
+log_mustnot dd if=/dev/urandom of=/dev/zfs count=1024
 
 log_pass "Writing random data into /dev/zfs should do no harm."
index 3eb8507ed73abcb4c828a5d5f757c14cf4522d28..fe575eed8b2132a97ef048ec4b58dc00e9fb2136 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/devices/devices.cfg
@@ -45,20 +45,20 @@ function create_dev_file
        case $filetype in
                b)
                        if is_linux; then
-                               devtype=$($DF -T / | $AWK '{print $2}')
+                               devtype=$(df -T / | awk '{print $2}')
                        else
-                               devtype=$($DF -n / | $AWK '{print $3}')
+                               devtype=$(df -n / | awk '{print $3}')
                        fi
                        case $devtype in
                                zfs)
-                                       rootpool=$($DF / | \
-                                               $AWK '{print $2}')
+                                       rootpool=$(df / | \
+                                               awk '{print $2}')
                                        rootpool=${rootpool#\(}
                                        rootpool=${rootpool%%/*}
 
                                        devstr=$(get_disklist $rootpool)
-                                       devstr=$($ECHO "$devstr" | \
-                                               $AWK '{print $1}')
+                                       devstr=$(echo "$devstr" | \
+                                               awk '{print $1}')
                                        [[ -z $devstr ]] && \
                                                log_fail "Can not get block device file."
                                        devstr=$DEV_DSKDIR/${devstr}
@@ -68,11 +68,11 @@ function create_dev_file
                        # Get the existing block device file in current system.
                        # And bring out the first one.
                        #
-                                       devstr=$($DF -lhF ufs | \
-                                               $GREP "^${DEV_DSKDIR}" | \
-                                               $AWK '{print $1}')
-                                       devstr=$($ECHO "$devstr" | \
-                                               $AWK '{print $1}')
+                                       devstr=$(df-lhF ufs | \
+                                               grep "^${DEV_DSKDIR}" | \
+                                               awk '{print $1}')
+                                       devstr=$(echo "$devstr" | \
+                                               awk '{print $1}')
                                        [[ -z $devstr ]] && \
                                                log_fail "Can not get block device file."
                                        ;;
@@ -90,7 +90,7 @@ function create_dev_file
                        # Get the device file information. i.e:
                        # $DEV_DSKDIR/c0t0d0s0:      block special (28/768)
                        #
-                       devstr=$($FILE $devstr)
+                       devstr=$(file $devstr)
 
                        #
                        # Bring out major and minor number.
@@ -100,13 +100,13 @@ function create_dev_file
                        minor=${devstr##*/}
                        minor=${minor%\)}
 
-                       log_must $MKNOD $filename b $major $minor
+                       log_must mknod $filename b $major $minor
                        ;;
                c)
                        #
                        # Create device file '/dev/null'
                        #
-                       log_must $MKNOD $filename c $($GETMAJOR mm) 2
+                       log_must mknod $filename c $(getmajor mm) 2
                        ;;
                *)
                        log_fail "'$filetype' is wrong."
@@ -118,9 +118,9 @@ function create_dev_file
 
 function cleanup
 {
-       log_must $ZFS set devices=on $TESTPOOL/$TESTFS
-       log_must $RM -f $TESTDIR/$TESTFILE1
-       log_must $RM -f $TESTDIR/$TESTFILE2
-       log_must $RM -f $TESTDIR/$TESTFILE1.out
-       log_must $RM -f $TESTDIR/$TESTFILE2.out
+       log_must zfs set devices=on $TESTPOOL/$TESTFS
+       log_must rm -f $TESTDIR/$TESTFILE1
+       log_must rm -f $TESTDIR/$TESTFILE2
+       log_must rm -f $TESTDIR/$TESTFILE1.out
+       log_must rm -f $TESTDIR/$TESTFILE2.out
 }
index f6e44d24073e60e8a618c99b4ded0e085beffcf1..d76a265e2472a9f263e69c045c1a609505274e04 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -38,9 +38,9 @@
 #
 # STRATEGY:
 # 1. Create pool and file system.
-# 2. Copy '/usr/bin/ls' to the ZFS file system.
+# 2. Copy '$STF_PATH/ls' to the ZFS file system.
 # 3. Setting exec=on on this file system.
-# 4. Make sure '/usr/bin/ls' can work in this ZFS file system.
+# 4. Make sure '$STF_PATH/ls' can work in this ZFS file system.
 # 5. Make sure mmap which is using the PROT_EXEC calls succeed.
 #
 
@@ -48,15 +48,15 @@ verify_runnable "both"
 
 function cleanup
 {
-       log_must $RM $TESTDIR/myls
+       log_must rm $TESTDIR/myls
 }
 
 log_assert "Setting exec=on on a filesystem, processes can be executed from " \
        "this file system."
 log_onexit cleanup
 
-log_must $CP $LS $TESTDIR/myls
-log_must $ZFS set exec=on $TESTPOOL/$TESTFS
+log_must cp $STF_PATH/ls $TESTDIR/myls
+log_must zfs set exec=on $TESTPOOL/$TESTFS
 log_must $TESTDIR/myls
 log_must $MMAP_EXEC $TESTDIR/myls
 
index 34a7f6c56ae5a1f86343d7f2139de037043a5d7e..eaf2d0b62d888ecd112ddcdaafc5626a4994c21e 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,7 +48,7 @@ verify_runnable "both"
 
 function cleanup
 {
-       log_must $RM $TESTDIR/myls
+       log_must rm $TESTDIR/myls
 }
 
 #
@@ -75,8 +75,8 @@ log_assert "Setting exec=off on a filesystem, processes can not be executed " \
        "from this file system."
 log_onexit cleanup
 
-log_must $CP $LS $TESTDIR/myls
-log_must $ZFS set exec=off $TESTPOOL/$TESTFS
+log_must cp /usr/bin/ls $TESTDIR/myls
+log_must zfs set exec=off $TESTPOOL/$TESTFS
 
 log_must exec_n_check 126 $TESTDIR/myls
 log_must exec_n_check 13 $MMAP_EXEC $TESTDIR/myls
index 3321b5a60cb88342e53313cd05bba4854d03017f..aa7ab76e7535200f87a1d4d3c2ed3bb6c299f567 100755 (executable)
@@ -65,8 +65,8 @@ log_onexit cleanup
 
 # If using the default loop devices, need a scsi_debug device for auto-online
 if is_loop_device $DISK1; then
-       SD=$($LSSCSI | $NAWK '/scsi_debug/ {print $6; exit}')
-       SDDEVICE=$($ECHO $SD | $NAWK -F / '{print $3}')
+       SD=$(lsscsi | nawk '/scsi_debug/ {print $6; exit}')
+       SDDEVICE=$(echo $SD | nawk -F / '{print $3}')
        SDDEVICE_ID=$(get_persistent_disk_name $SDDEVICE)
        autoonline_disks="$SDDEVICE"
 else
@@ -76,43 +76,43 @@ fi
 # Clear disk labels
 for i in {0..2}
 do
-       log_must $ZPOOL labelclear -f /dev/disk/by-id/"${devs_id[i]}"
+       log_must zpool labelclear -f /dev/disk/by-id/"${devs_id[i]}"
 done
 
 if is_loop_device $DISK1; then
        # create a pool with one scsi_debug device and 3 loop devices
-       log_must $ZPOOL create -f $TESTPOOL raidz1 $SDDEVICE_ID $DISK1 \
+       log_must zpool create -f $TESTPOOL raidz1 $SDDEVICE_ID $DISK1 \
            $DISK2 $DISK3
 elif ( is_real_device $DISK1 || is_mpath_device $DISK1 ); then
        # else use the persistent names for sd devices
-       log_must $ZPOOL create -f $TESTPOOL raidz1 ${devs_id[0]} \
+       log_must zpool create -f $TESTPOOL raidz1 ${devs_id[0]} \
            ${devs_id[1]} ${devs_id[2]}
 else
        log_fail "Disks are not supported for this test"
 fi
 
 # Add some data to the pool
-log_must $MKFILE $FSIZE /$TESTPOOL/data
+log_must mkfile $FSIZE /$TESTPOOL/data
 
 for offline_disk in $autoonline_disks
 do
-       log_must $ZPOOL export -F $TESTPOOL
+       log_must zpool export -F $TESTPOOL
 
-       host=$($LS /sys/block/$offline_disk/device/scsi_device \
-           | $NAWK -F : '{ print $1}')
+       host=$(ls /sys/block/$offline_disk/device/scsi_device \
+           | nawk -F : '{ print $1}')
 
        # Offline disk
        on_off_disk $offline_disk "offline"
 
        # Reimport pool with drive missing
-       log_must $ZPOOL import $TESTPOOL
+       log_must zpool import $TESTPOOL
        check_state $TESTPOOL "" "degraded"
        if (($? != 0)); then
                log_fail "$TESTPOOL is not degraded"
        fi
 
        # Clear zpool events
-       $ZPOOL events -c $TESTPOOL
+       zpool events -c $TESTPOOL
 
        # Online disk
        on_off_disk $offline_disk "online" $host
@@ -124,12 +124,13 @@ do
                        log_fail "Timeout occured"
                fi
                ((timeout++))
-               $SLEEP 1
-               $ZPOOL events $TESTPOOL \
-                   | $EGREP sysevent.fs.zfs.resilver_finish > /dev/null
+
+               sleep 1
+               zpool events $TESTPOOL \
+                   | egrep sysevent.fs.zfs.resilver_finish > /dev/null
                if (($? == 0)); then
                        log_note "Auto-online of $offline_disk is complete"
-                       $SLEEP 1
+                       sleep 1
                        break
                fi
        done
@@ -139,8 +140,8 @@ do
        if (($? != 0)); then
                log_fail "$TESTPOOL is not back online"
        fi
-       $SLEEP 2
+       sleep 2
 done
-log_must $ZPOOL destroy $TESTPOOL
+log_must zpool destroy $TESTPOOL
 
 log_pass "Auto-online test successful"
index b822b109d3b5a033b4e83c7e7e95956c37a702c9..d784f06a6112ddb732caf7df710d8a7b42c86ed0 100755 (executable)
@@ -57,21 +57,21 @@ fi
 
 function setup
 {
-       $LSMOD | $EGREP scsi_debug > /dev/null
+       lsmod | egrep scsi_debug > /dev/null
        if (($? == 1)); then
                load_scsi_debug $SDSIZE $SDHOSTS $SDTGTS $SDLUNS
        fi
        # Register vdev_id alias rule for scsi_debug device to create a
        # persistent path
-       SD=$($LSSCSI | $NAWK '/scsi_debug/ {print $6; exit}' \
-           | $NAWK -F / '{print $3}')
+       SD=$(lsscsi | nawk '/scsi_debug/ {print $6; exit}' \
+           | nawk -F / '{print $3}')
        SDDEVICE_ID=$(get_persistent_disk_name $SD)
-       log_must eval "$ECHO "alias scsidebug /dev/disk/by-id/$SDDEVICE_ID" \
+       log_must eval "echo "alias scsidebug /dev/disk/by-id/$SDDEVICE_ID" \
            >> $VDEVID_CONF"
        block_device_wait
 
-       SDDEVICE=$($UDEVADM info -q all -n $DEV_DSKDIR/$SD | $EGREP ID_VDEV \
-           | $NAWK '{print $2; exit}' | $NAWK -F = '{print $2; exit}')
+       SDDEVICE=$(udevadm info -q all -n $DEV_DSKDIR/$SD | egrep ID_VDEV \
+           | nawk '{print $2; exit}' | nawk -F = '{print $2; exit}')
        [[ -z $SDDEVICE ]] && log_fail "vdev rule was not registered properly"
 }
 
@@ -87,42 +87,42 @@ log_onexit cleanup
 # Clear disk labels
 for i in {0..2}
 do
-       log_must $ZPOOL labelclear -f /dev/disk/by-id/"${devs_id[i]}"
+       log_must zpool labelclear -f /dev/disk/by-id/"${devs_id[i]}"
 done
 
 setup
 if is_loop_device $DISK1; then
-       log_must $ZPOOL create -f $TESTPOOL raidz1 $SDDEVICE $DISK1 $DISK2 \
+       log_must zpool create -f $TESTPOOL raidz1 $SDDEVICE $DISK1 $DISK2 \
            $DISK3
 elif ( is_real_device $DISK1 || is_mpath_device $DISK1 ); then
-       log_must $ZPOOL create -f $TESTPOOL raidz1 $SDDEVICE ${devs_id[0]} \
+       log_must zpool create -f $TESTPOOL raidz1 $SDDEVICE ${devs_id[0]} \
            ${devs_id[1]} ${devs_id[2]}
 else
        log_fail "Disks are not supported for this test"
 fi
 
 # Auto-replace is opt-in so need to set property
-log_must $ZPOOL set autoreplace=on $TESTPOOL
+log_must zpool set autoreplace=on $TESTPOOL
 
 # Add some data to the pool
-log_must $MKFILE $FSIZE /$TESTPOOL/data
+log_must mkfile $FSIZE /$TESTPOOL/data
 
-log_must $ZPOOL export -F $TESTPOOL
+log_must zpool export -F $TESTPOOL
 
 # Offline disk
 on_off_disk $SD "offline"
 block_device_wait
-log_must $MODUNLOAD scsi_debug
+log_must modprobe -r scsi_debug
 
 # Reimport pool with drive missing
-log_must $ZPOOL import $TESTPOOL
+log_must zpool import $TESTPOOL
 check_state $TESTPOOL "" "degraded"
 if (($? != 0)); then
        log_fail "$TESTPOOL is not degraded"
 fi
 
 # Clear zpool events
-$ZPOOL events -c $TESTPOOL
+zpool events -c $TESTPOOL
 
 # Create another scsi_debug device
 setup
@@ -134,12 +134,12 @@ while true; do
                log_fail "Timeout occured"
        fi
        ((timeout++))
-       $SLEEP 1
-       $ZPOOL events $TESTPOOL | $EGREP sysevent.fs.zfs.resilver_finish \
+       sleep 1
+       zpool events $TESTPOOL | egrep sysevent.fs.zfs.resilver_finish \
            > /dev/null
        if (($? == 0)); then
                log_note "Auto-replace should be complete"
-               $SLEEP 1
+               sleep 1
                break
        fi
 done
@@ -149,8 +149,8 @@ check_state $TESTPOOL "" "online"
 if (($? != 0)); then
        log_fail "$TESTPOOL is not back online"
 fi
-$SLEEP 2
+sleep 2
 
-log_must $ZPOOL destroy $TESTPOOL
+log_must zpool destroy $TESTPOOL
 
 log_pass "Auto-replace test successful"
index 233213c9ffc824d97994dfc4c09f9f3e9b00d138..88bf5e28a75a00099083125f5e44a540770aae7c 100755 (executable)
@@ -31,23 +31,20 @@ verify_runnable "global"
 cleanup_devices $DISKS
 
 # Remove symlink and vdev_id.conf in-tree file
-$RM -f $VDEVID_CONF_ETC
-$RM -f $VDEVID_CONF
+rm -f $VDEVID_CONF_ETC
+rm -f $VDEVID_CONF
 zed_stop
 
-SD=$($LSSCSI | $NAWK '/scsi_debug/ {print $6; exit}')
-SDDEVICE=$($ECHO $SD | $NAWK -F / '{print $3}')
-
-if [[ -z $SDDEVICE ]]; then
-       log_pass
-fi
+SD=$(lsscsi | nawk '/scsi_debug/ {print $6; exit}')
+SDDEVICE=$(echo $SD | nawk -F / '{print $3}')
 
 # Offline disk and remove scsi_debug module
 if is_linux; then
-       on_off_disk $SDDEVICE "offline"
-       block_device_wait
-       log_must $MODUNLOAD scsi_debug
+       if [ -n "$SDDEVICE" ]; then
+               on_off_disk $SDDEVICE "offline"
+               block_device_wait
+       fi
+       modprobe -r scsi_debug
 fi
 
-
 log_pass
index 8552e8702b8f6d22f4f169c408671ee9211c3890..6a05b8cc497766facdfab6c18ba3b2a862f3b911 100644 (file)
@@ -27,7 +27,7 @@
 
 verify_runnable "global"
 
-export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
+export DISK_ARRAY_NUM=$(echo ${DISKS} | nawk '{print NF}')
 export DISKSARRAY=$DISKS
 export FSIZE=10M
 export MAXTIMEOUT=20
@@ -37,9 +37,9 @@ export SDHOSTS=1
 export SDTGTS=1
 export SDLUNS=1
 
-export DISK1=$($ECHO $DISKS | $NAWK '{print $1}')
-export DISK2=$($ECHO $DISKS | $NAWK '{print $2}')
-export DISK3=$($ECHO $DISKS | $NAWK '{print $3}')
+export DISK1=$(echo $DISKS | nawk '{print $1}')
+export DISK2=$(echo $DISKS | nawk '{print $2}')
+export DISK3=$(echo $DISKS | nawk '{print $3}')
 
 export VDEVID_CONF=$ZEDLET_DIR/vdev_id.conf
 export VDEVID_CONF_ETC=/etc/zfs/vdev_id.conf
index d25cdffe2de384c2242d635ee3161e40a6221464..2b9fb61c0ecad1da60c6ee1efd00c2b9d4950344 100755 (executable)
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/fault/fault.cfg
 
-[[ -z $UDEVADM ]] && log_fail "Missing UDEVADM command"
-[[ -z $LSMOD ]]  && log_fail "Missing LSMOD command"
-[[ -z $LSSCSI ]] && log_fail "Missing LSSCSI command"
-[[ -z $MODUNLOAD ]] && log_fail "Missing MODUNLOAD command"
-[[ -z $MODLOAD ]] && log_fail "Missing MODLOAD command"
-
 verify_runnable "global"
 
 if [[ ! -d $ZEDLET_DIR ]]; then
-       log_must $MKDIR $ZEDLET_DIR
+       log_must mkdir $ZEDLET_DIR
 fi
+
 if [[ ! -e $VDEVID_CONF ]]; then
-       log_must $TOUCH $VDEVID_CONF
+       log_must touch $VDEVID_CONF
 fi
+
 if [[ -e $VDEVID_CONF_ETC ]]; then
        log_fail "Must not have $VDEVID_CONF_ETC file present on system"
 fi
index c7e984f542aeca98116348399289f26cb5a92dda..b9f1837d622c3c8bcc07d51336f8d4c82e60d405 100755 (executable)
@@ -21,7 +21,7 @@
 #
 
 #
-# Copyright (c) 2013, 2014 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -53,18 +53,18 @@ fi
 
 function cleanup
 {
-       datasetexists $TEST_FS && log_must $ZFS destroy $TEST_FS
+       datasetexists $TEST_FS && log_must zfs destroy $TEST_FS
 }
 
 log_onexit cleanup
 log_assert "async_destroy can suspend and resume traversal"
 
-log_must $ZFS create -o recordsize=512 -o compression=off $TEST_FS
+log_must zfs create -o recordsize=512 -o compression=off $TEST_FS
 
 # Fill with 1G
-log_must $DD bs=1024k count=1024 if=/dev/zero of=/$TEST_FS/file
+log_must dd bs=1024k count=1024 if=/dev/zero of=/$TEST_FS/file
 
-log_must $ZFS destroy $TEST_FS
+log_must zfs destroy $TEST_FS
 
 #
 # We monitor the freeing property, to verify we can see blocks being
@@ -73,20 +73,20 @@ log_must $ZFS destroy $TEST_FS
 t0=$SECONDS
 count=0
 while [[ $((SECONDS - t0)) -lt 10 ]]; do
-       [[ "0" != "$($ZPOOL list -Ho freeing $TESTPOOL)" ]] && ((count++))
+       [[ "0" != "$(zpool list -Ho freeing $TESTPOOL)" ]] && ((count++))
        [[ $count -gt 1 ]] && break
-       $SLEEP 1
+       sleep 1
 done
 
 [[ $count -eq 0 ]] && log_fail "Freeing property remained empty"
 
 # Wait for everything to be freed.
-while [[ "0" != "$($ZPOOL list -Ho freeing $TESTPOOL)" ]]; do
+while [[ "0" != "$(zpool list -Ho freeing $TESTPOOL)" ]]; do
        [[ $((SECONDS - t0)) -gt 180 ]] && \
            log_fail "Timed out waiting for freeing to drop to zero"
 done
 
 # Check for leaked blocks.
-log_must $ZDB -b $TESTPOOL
+log_must zdb -b $TESTPOOL
 
 log_pass "async_destroy can suspend and resume traversal"
index a05acb97eb4d701759a373701b3ba117b665f039..c07f4e8d7421f661de36549473b66e57dc0b0802 100755 (executable)
@@ -42,13 +42,13 @@ verify_runnable "both"
 
 function cleanup
 {
-       datasetexists $TEST_FS && log_must $ZFS destroy $TEST_FS
+       datasetexists $TEST_FS && log_must zfs destroy $TEST_FS
 }
 
 log_onexit cleanup
 log_assert "dnode sizes are consistent with dnodesize dataset property"
 
-log_must $ZFS create $TEST_FS
+log_must zfs create $TEST_FS
 
 set -A dnsizes "512" "1k" "2k" "4k" "8k" "16k"
 set -A inodes
@@ -59,15 +59,15 @@ for ((i=0; i < ${#dnsizes[*]}; i++)) ; do
                size="legacy"
        fi
        file=/$TEST_FS/file.$size
-       log_must $ZFS set dnsize=$size $TEST_FS
+       log_must zfs set dnsize=$size $TEST_FS
        touch $file
        inodes[$i]=$(ls -li $file | awk '{print $1}')
 done
 
-log_must $ZFS umount $TEST_FS
+log_must zfs umount $TEST_FS
 
 for ((i=0; i < ${#dnsizes[*]}; i++)) ; do
-       dnsize=$($ZDB -dddd $TEST_FS ${inodes[$i]} |
+       dnsize=$(zdb -dddd $TEST_FS ${inodes[$i]} |
            awk '/ZFS plain file/ {print $6}' | tr K k)
        if [[ "$dnsize" != "${dnsizes[$i]}" ]]; then
                log_fail "dnode size is $dnsize (expected ${dnsizes[$i]})"
index 788e33a13b4f5da2764cb311324231a00c18342f..1dd8d888c369cd730bd942e70e9bdaa6b569a47c 100755 (executable)
@@ -43,13 +43,13 @@ verify_runnable "both"
 
 function cleanup
 {
-       datasetexists $TEST_FS && log_must $ZFS destroy $TEST_FS
+       datasetexists $TEST_FS && log_must zfs destroy $TEST_FS
 }
 
 log_onexit cleanup
 log_assert "extended attributes use extra bonus space of a large dnode"
 
-log_must $ZFS create -o xattr=sa $TEST_FS
+log_must zfs create -o xattr=sa $TEST_FS
 
 # Store dnode size minus 512 in an xattr
 set -A xattr_sizes "512" "1536" "3584" "7680" "15872"
@@ -59,7 +59,7 @@ set -A inodes
 for ((i=0; i < ${#prop_values[*]}; i++)) ; do
        prop_val=${prop_values[$i]}
        file=/$TEST_FS/file.$prop_val
-       log_must $ZFS set dnsize=$prop_val $TEST_FS
+       log_must zfs set dnsize=$prop_val $TEST_FS
        touch $file
        xattr_size=${xattr_sizes[$i]}
        xattr_name=user.foo
@@ -69,10 +69,10 @@ for ((i=0; i < ${#prop_values[*]}; i++)) ; do
        inodes[$i]=$(ls -li $file | awk '{print $1}')
 done
 
-log_must $ZFS umount $TEST_FS
+log_must zfs umount $TEST_FS
 
 for ((i=0; i < ${#inodes[*]}; i++)) ; do
-       log_mustnot eval "$ZDB -dddd $TEST_FS ${inodes[$i]} | grep SPILL_BLKPTR"
+       log_mustnot eval "zdb -dddd $TEST_FS ${inodes[$i]} | grep SPILL_BLKPTR"
 done
 
 log_pass "extended attributes use extra bonus space of a large dnode"
index 3f5779ded5957280c98efc87e40743a926f2e5e6..a938c7de7c4e89d531ed9a8b91bbe16995d952b3 100755 (executable)
@@ -27,7 +27,7 @@ verify_runnable "both"
 function cleanup
 {
         if datasetexists $LDNPOOL ; then
-                log_must $ZPOOL destroy -f $LDNPOOL
+                log_must zpool destroy -f $LDNPOOL
         fi
 }
 
@@ -37,27 +37,27 @@ log_assert "feature correctly switches between enabled and active"
 
 LDNPOOL=ldnpool
 LDNFS=$LDNPOOL/large_dnode
-log_must $MKFILE 64M  $TESTDIR/$LDNPOOL
-log_must $ZPOOL create $LDNPOOL $TESTDIR/$LDNPOOL
+log_must mkfile 64M  $TESTDIR/$LDNPOOL
+log_must zpool create $LDNPOOL $TESTDIR/$LDNPOOL
 
 
-state=$($ZPOOL list -Ho feature@large_dnode $LDNPOOL)
+state=$(zpool list -Ho feature@large_dnode $LDNPOOL)
 if [[ "$state" != "enabled" ]]; then
         log_fail "large_dnode has state $state (expected enabled)"
 fi
 
-log_must $ZFS create -o dnodesize=1k $LDNFS
+log_must zfs create -o dnodesize=1k $LDNFS
 log_must touch /$LDNFS/foo
-log_must $ZFS unmount $LDNFS
+log_must zfs unmount $LDNFS
 
-state=$($ZPOOL list -Ho feature@large_dnode $LDNPOOL)
+state=$(zpool list -Ho feature@large_dnode $LDNPOOL)
 if [[ "$state" != "active" ]]; then
         log_fail "large_dnode has state $state (expected active)"
 fi
 
-log_must $ZFS destroy $LDNFS
+log_must zfs destroy $LDNFS
 
-state=$($ZPOOL list -Ho feature@large_dnode $LDNPOOL)
+state=$(zpool list -Ho feature@large_dnode $LDNPOOL)
 if [[ "$state" != "enabled" ]]; then
         log_fail "large_dnode has state $state (expected enabled)"
 fi
index 26ed669949bcb26ea97048e23c04c914b5a762a0..1006ae6af54af4dbc48d7c5961b495b257212598 100755 (executable)
 # CDDL HEADER END
 #
 
+#
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 verify_runnable "both"
@@ -31,11 +40,11 @@ TEST_STREAM=$TESTDIR/ldnsnap
 function cleanup
 {
        if datasetexists $TEST_FS ; then
-               log_must $ZFS destroy -r $TEST_FS
+               log_must zfs destroy -r $TEST_FS
        fi
 
        if datasetexists $LGCYPOOL ; then
-               log_must $ZPOOL destroy -f $LGCYPOOL
+               log_must zpool destroy -f $LGCYPOOL
        fi
 
        rm -f $TEST_STREAM
@@ -44,16 +53,16 @@ function cleanup
 log_onexit cleanup
 log_assert "zfs send stream with large dnodes not accepted by legacy pool"
 
-log_must $ZFS create -o dnodesize=1k $TEST_FS
+log_must zfs create -o dnodesize=1k $TEST_FS
 log_must touch /$TEST_FS/foo
-log_must $ZFS umount $TEST_FS
-log_must $ZFS snap $TEST_SNAP
-log_must eval "$ZFS send $TEST_SNAP > $TEST_STREAM"
+log_must zfs umount $TEST_FS
+log_must zfs snap $TEST_SNAP
+log_must eval "zfs send $TEST_SNAP > $TEST_STREAM"
 
 LGCYPOOL=ldnpool
 LGCYFS=$LGCYPOOL/legacy
-log_must $MKFILE 64M  $TESTDIR/$LGCYPOOL
-log_must $ZPOOL create -d $LGCYPOOL $TESTDIR/$LGCYPOOL
-log_mustnot eval "$ZFS recv $LGCYFS < $TEST_STREAM"
+log_must mkfile 64M  $TESTDIR/$LGCYPOOL
+log_must zpool create -d $LGCYPOOL $TESTDIR/$LGCYPOOL
+log_mustnot eval "zfs recv $LGCYFS < $TEST_STREAM"
 
 log_pass
index 1117e849d513f932d2fc1cd6c4599d930a11be9c..13f1288e4e8cb149ef2a59dc6384ee6ccac8bc1d 100755 (executable)
@@ -36,11 +36,11 @@ TEST_FILEINCR=bar
 function cleanup
 {
        if datasetexists $TEST_SEND_FS ; then
-               log_must $ZFS destroy -r $TEST_SEND_FS
+               log_must zfs destroy -r $TEST_SEND_FS
        fi
 
        if datasetexists $TEST_RECV_FS ; then
-               log_must $ZFS destroy -r $TEST_RECV_FS
+               log_must zfs destroy -r $TEST_RECV_FS
        fi
 
        rm -f $TEST_STREAM
@@ -51,25 +51,25 @@ log_onexit cleanup
 
 log_assert "zfs send stream with large dnodes accepted by new pool"
 
-log_must $ZFS create -o dnodesize=1k $TEST_SEND_FS
-log_must $TOUCH /$TEST_SEND_FS/$TEST_FILE
-log_must $ZFS snap $TEST_SNAP
-log_must $ZFS send $TEST_SNAP > $TEST_STREAM
-log_must $RM -f /$TEST_SEND_FS/$TEST_FILE
-log_must $TOUCH /$TEST_SEND_FS/$TEST_FILEINCR
-log_must $ZFS snap $TEST_SNAPINCR
-log_must $ZFS send -i $TEST_SNAP $TEST_SNAPINCR > $TEST_STREAMINCR
+log_must zfs create -o dnodesize=1k $TEST_SEND_FS
+log_must touch /$TEST_SEND_FS/$TEST_FILE
+log_must zfs snap $TEST_SNAP
+log_must zfs send $TEST_SNAP > $TEST_STREAM
+log_must rm -f /$TEST_SEND_FS/$TEST_FILE
+log_must touch /$TEST_SEND_FS/$TEST_FILEINCR
+log_must zfs snap $TEST_SNAPINCR
+log_must zfs send -i $TEST_SNAP $TEST_SNAPINCR > $TEST_STREAMINCR
 
-log_must eval "$ZFS recv $TEST_RECV_FS < $TEST_STREAM"
+log_must eval "zfs recv $TEST_RECV_FS < $TEST_STREAM"
 inode=$(ls -li /$TEST_RECV_FS/$TEST_FILE | awk '{print $1}')
-dnsize=$($ZDB -dddd $TEST_RECV_FS $inode | awk '/ZFS plain file/ {print $6}')
+dnsize=$(zdb -dddd $TEST_RECV_FS $inode | awk '/ZFS plain file/ {print $6}')
 if [[ "$dnsize" != "1K" ]]; then
        log_fail "dnode size is $dnsize (expected 1K)"
 fi
 
-log_must eval "$ZFS recv -F $TEST_RECV_FS < $TEST_STREAMINCR"
-log_must $DIFF -r /$TEST_SEND_FS /$TEST_RECV_FS
-log_must $ZFS umount $TEST_SEND_FS
-log_must $ZFS umount $TEST_RECV_FS
+log_must eval "zfs recv -F $TEST_RECV_FS < $TEST_STREAMINCR"
+log_must diff -r /$TEST_SEND_FS /$TEST_RECV_FS
+log_must zfs umount $TEST_SEND_FS
+log_must zfs umount $TEST_RECV_FS
 
 log_pass
index 198b69bf7937fc9d6a6868567004022f0cbbe3a1..68fc5e304011a8cd539b2b3cb49153e4f2cc7cae 100755 (executable)
 # CDDL HEADER END
 #
 
+#
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -35,13 +44,13 @@ verify_runnable "both"
 
 function cleanup
 {
-       datasetexists $TEST_FS && log_must $ZFS destroy $TEST_FS
+       datasetexists $TEST_FS && log_must zfs destroy $TEST_FS
 }
 
 log_onexit cleanup
 log_assert "xattrtest runs cleanly on dataset with large dnodes"
 
-log_must $ZFS create $TEST_FS
+log_must zfs create $TEST_FS
 
 set -A xattr_sizes "512" "1536" "3584" "7680" "15872"
 set -A prop_values "1k"  "2k"   "4k"   "8k"   "16k"
@@ -50,9 +59,9 @@ for ((i=0; i < ${#prop_values[*]}; i++)) ; do
        prop_val=${prop_values[$i]}
        dir=/$TEST_FS/$prop_val
        xattr_size=${xattr_sizes[$i]}
-       log_must $ZFS set dnsize=$prop_val $TEST_FS
+       log_must zfs set dnsize=$prop_val $TEST_FS
        log_must mkdir $dir
-       log_must $XATTRTEST -R -y -s $xattr_size -f 1024 -p $dir
+       log_must xattrtest -R -y -s $xattr_size -f 1024 -p $dir
 done
 
 log_pass
index d6cc17e0b580ce7732aa050f54cb9dd29f500ca5..fb4747839f3ddf92a4447ea73c8882608780979d 100755 (executable)
 # CDDL HEADER END
 #
 
+#
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -33,7 +42,7 @@ verify_runnable "both"
 function cleanup
 {
         if datasetexists $LGCYPOOL ; then
-                log_must $ZPOOL destroy -f $LGCYPOOL
+                log_must zpool destroy -f $LGCYPOOL
         fi
 }
 
@@ -45,12 +54,12 @@ set -A prop_vals "auto" "1k" "2k" "4k" "8k" "16k"
 
 LGCYPOOL=lgcypool
 LGCYFS=$LGCYPOOL/legacy
-log_must $MKFILE 64M  $TESTDIR/$LGCYPOOL
-log_must $ZPOOL create -d $LGCYPOOL $TESTDIR/$LGCYPOOL
-log_must $ZFS create $LGCYFS
+log_must mkfile 64M  $TESTDIR/$LGCYPOOL
+log_must zpool create -d $LGCYPOOL $TESTDIR/$LGCYPOOL
+log_must zfs create $LGCYFS
 
 for val in ${prop_vals[@]} ; do
-       log_mustnot $ZFS set dnodesize=$val $LGCYFS
+       log_mustnot zfs set dnodesize=$val $LGCYFS
 done
 
 log_pass
index ac3e09b9d168f0fa09bd6de66bad0e3c0c38991e..cc03fec399cb9a7c6275b049ab1efdcf260591da 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,8 +48,8 @@ verify_runnable "global"
 
 log_assert "A zpool may be increased in capacity by adding a disk"
 
-log_must $ZFS set compression=off $TESTPOOL/$TESTFS
-$FILE_WRITE -o create -f $TESTDIR/$TESTFILE1 \
+log_must zfs set compression=off $TESTPOOL/$TESTFS
+file_write -o create -f $TESTDIR/$TESTFILE1 \
        -b $BLOCK_SIZE -c $WRITE_COUNT -d 0
 typeset -i zret=$?
 readonly ENOSPC=28
@@ -62,13 +62,13 @@ if [[ ! -s $TESTDIR/$TESTFILE1 ]]; then
 fi
 
 if [[ -n $DISK ]]; then
-       log_must $ZPOOL add $TESTPOOL $DISK"s"$SLICE1
+       log_must zpool add $TESTPOOL $DISK"s"$SLICE1
 else
-       log_must $ZPOOL add $TESTPOOL $DISK1
+       log_must zpool add $TESTPOOL $DISK1
 fi
 
-log_must $FILE_WRITE -o append -f $TESTDIR/$TESTFILE1 \
+log_must file_write -o append -f $TESTDIR/$TESTFILE1 \
        -b $BLOCK_SIZE -c $SMALL_WRITE_COUNT -d 0
 
-log_must $ZFS inherit compression $TESTPOOL/$TESTFS
+log_must zfs inherit compression $TESTPOOL/$TESTFS
 log_pass "TESTPOOL successfully grown"
index aaf3e533524aa49c0e6748b834d122427f05a411..6a5b9d9f96f940e5a5cc5c5261d400a6a190a8e2 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 # Copyright 2016 Nexenta Systems, Inc.
 #
 
@@ -51,7 +51,7 @@ fi
 function cleanup
 {
        datasetexists $TESTPOOL && log_must destroy_pool $TESTPOOL
-       [[ -d $TESTDIR ]] && log_must $RM -rf $TESTDIR
+       [[ -d $TESTDIR ]] && log_must rm -rf $TESTDIR
 }
 
 log_assert "mirror/raidz pool may be increased in capacity by adding a disk"
@@ -80,12 +80,12 @@ for pooltype in "mirror" "raidz"; do
                        ${DISK1}${SLICE_PREFIX}${SLICE0}
        fi
 
-       [[ -d $TESTDIR ]] && log_must $RM -rf $TESTDIR
-       log_must $ZFS create $TESTPOOL/$TESTFS
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       [[ -d $TESTDIR ]] && log_must rm -rf $TESTDIR
+       log_must zfs create $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 
-       log_must $ZFS set compression=off $TESTPOOL/$TESTFS
-       $FILE_WRITE -o create -f $TESTDIR/$TESTFILE1 \
+       log_must zfs set compression=off $TESTPOOL/$TESTFS
+       file_write -o create -f $TESTDIR/$TESTFILE1 \
             -b $BLOCK_SIZE -c $WRITE_COUNT -d 0
 
        [[ $? -ne $ENOSPC ]] && \
@@ -96,16 +96,16 @@ for pooltype in "mirror" "raidz"; do
 
        # $DISK will be set if we're using slices on one disk
        if [[ -n $DISK ]]; then
-               log_must $ZPOOL add $TESTPOOL $pooltype ${DISK}s3 ${DISK}s4
+               log_must zpool add $TESTPOOL $pooltype ${DISK}s3 ${DISK}s4
        else
                [[ -z $DISK2 || -z $DISK3 ]] && 
                    log_unsupported "No spare disks available"
-               log_must $ZPOOL add $TESTPOOL $pooltype \
+               log_must zpool add $TESTPOOL $pooltype \
                        ${DISK2}${SLICE_PREFIX}${SLICE0} \
                        ${DISK3}${SLICE_PREFIX}${SLICE0}
        fi
 
-       log_must $FILE_WRITE -o append -f $TESTDIR/$TESTFILE1 \
+       log_must file_write -o append -f $TESTDIR/$TESTFILE1 \
            -b $BLOCK_SIZE -c $SMALL_WRITE_COUNT -d 0
 
        log_must destroy_pool $TESTPOOL
index a09846aa90a222a7cb60806cc75a73193b9bba20..688174188261e6f36a0461455b9c5e19047f5c99 100755 (executable)
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 
-[[ -f $OLD_HISTORY ]] && $RM -f $OLD_HISTORY
-[[ -f $TMP_HISTORY ]] && $RM -f $TMP_HISTORY
-[[ -f $NEW_HISTORY ]] && $RM -f $NEW_HISTORY
+[[ -f $OLD_HISTORY ]] && rm -f $OLD_HISTORY
+[[ -f $TMP_HISTORY ]] && rm -f $TMP_HISTORY
+[[ -f $NEW_HISTORY ]] && rm -f $NEW_HISTORY
 
 default_cleanup
index 26170cb630af1eb9664f002ad0781a1a153033f7..80c0fb3639cfe4ec9afae82344497426824a6136 100755 (executable)
@@ -25,7 +25,7 @@
 # Use is subject to license terms.
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/history/history_common.kshlib
@@ -49,9 +49,9 @@ function cleanup
        destroy_pool $MPOOL
        destroy_pool $upgrade_pool
 
-       [[ -d $import_dir ]] && $RM -rf $import_dir
+       [[ -d $import_dir ]] && rm -rf $import_dir
        for file in $VDEV1 $VDEV2 $VDEV3 $VDEV4; do
-               [[ -f $file ]] && $RM -f $file
+               [[ -f $file ]] && rm -f $file
        done
 }
 
@@ -63,60 +63,60 @@ mntpnt=$(get_prop mountpoint $TESTPOOL)
 VDEV1=$mntpnt/vdev1; VDEV2=$mntpnt/vdev2;
 VDEV3=$mntpnt/vdev3; VDEV4=$mntpnt/vdev4;
 
-log_must $MKFILE $MINVDEVSIZE $VDEV1 $VDEV2 $VDEV3
-log_must $MKFILE $(($MINVDEVSIZE * 2)) $VDEV4
+log_must mkfile $MINVDEVSIZE $VDEV1 $VDEV2 $VDEV3
+log_must mkfile $(($MINVDEVSIZE * 2)) $VDEV4
 
-run_and_verify -p "$MPOOL" "$ZPOOL create $MPOOL mirror $VDEV1 $VDEV2"
-run_and_verify -p "$MPOOL" "$ZPOOL add -f $MPOOL spare $VDEV3"
-run_and_verify -p "$MPOOL" "$ZPOOL remove $MPOOL $VDEV3"
-run_and_verify -p "$MPOOL" "$ZPOOL offline $MPOOL $VDEV1"
-run_and_verify -p "$MPOOL" "$ZPOOL online $MPOOL $VDEV1"
-run_and_verify -p "$MPOOL" "$ZPOOL attach $MPOOL $VDEV1 $VDEV4"
-run_and_verify -p "$MPOOL" "$ZPOOL detach $MPOOL $VDEV4"
-run_and_verify -p "$MPOOL" "$ZPOOL replace -f $MPOOL $VDEV1 $VDEV4"
-run_and_verify -p "$MPOOL" "$ZPOOL scrub $MPOOL"
-run_and_verify -p "$MPOOL" "$ZPOOL clear $MPOOL"
+run_and_verify -p "$MPOOL" "zpool create $MPOOL mirror $VDEV1 $VDEV2"
+run_and_verify -p "$MPOOL" "zpool add -f $MPOOL spare $VDEV3"
+run_and_verify -p "$MPOOL" "zpool remove $MPOOL $VDEV3"
+run_and_verify -p "$MPOOL" "zpool offline $MPOOL $VDEV1"
+run_and_verify -p "$MPOOL" "zpool online $MPOOL $VDEV1"
+run_and_verify -p "$MPOOL" "zpool attach $MPOOL $VDEV1 $VDEV4"
+run_and_verify -p "$MPOOL" "zpool detach $MPOOL $VDEV4"
+run_and_verify -p "$MPOOL" "zpool replace -f $MPOOL $VDEV1 $VDEV4"
+run_and_verify -p "$MPOOL" "zpool scrub $MPOOL"
+run_and_verify -p "$MPOOL" "zpool clear $MPOOL"
 
 # For export and destroy, mimic the behavior of run_and_verify using two
 # commands since the history will be unavailable until the pool is imported
 # again.
-commands=("$ZPOOL export $MPOOL" "$ZPOOL import -d $mntpnt $MPOOL"
-    "$ZPOOL destroy $MPOOL" "$ZPOOL import -D -f -d $mntpnt $MPOOL")
+commands=("zpool export $MPOOL" "zpool import -d $mntpnt $MPOOL"
+    "zpool destroy $MPOOL" "zpool import -D -f -d $mntpnt $MPOOL")
 for i in 0 2; do
        cmd1="${commands[$i]}"
        cmd2="${commands[(($i + 1 ))]}"
 
-       $ZPOOL history $MPOOL > $OLD_HISTORY 2>/dev/null
+       zpool history $MPOOL > $OLD_HISTORY 2>/dev/null
        log_must $cmd1
        log_must $cmd2
-       $ZPOOL history $MPOOL > $TMP_HISTORY 2>/dev/null
-       $DIFF $OLD_HISTORY $TMP_HISTORY | $GREP "^> " | $SED 's/^> //g' > \
+       zpool history $MPOOL > $TMP_HISTORY 2>/dev/null
+       diff $OLD_HISTORY $TMP_HISTORY | grep "^> " | sed 's/^> //g' > \
            $NEW_HISTORY
         if is_linux; then
-               $GREP "$($ECHO "$cmd1" | $SED 's/^.*\/\(zpool .*\).*$/\1/')" \
+               grep "$(echo "$cmd1" | sed 's/^.*\/\(zpool .*\).*$/\1/')" \
                    $NEW_HISTORY >/dev/null 2>&1 || \
                    log_fail "Didn't find \"$cmd1\" in pool history"
-               $GREP "$($ECHO "$cmd2" | $SED 's/^.*\/\(zpool .*\).*$/\1/')" \
+               grep "$(echo "$cmd2" | sed 's/^.*\/\(zpool .*\).*$/\1/')" \
                    $NEW_HISTORY >/dev/null 2>&1 || \
                    log_fail "Didn't find \"$cmd2\" in pool history"
         else
-               $GREP "$($ECHO "$cmd1" | $SED 's/\/usr\/sbin\///g')" \
+               grep "$(echo "$cmd1" | sed 's/\/usr\/sbin\///g')" \
                    $NEW_HISTORY >/dev/null 2>&1 || \
                    log_fail "Didn't find \"$cmd1\" in pool history"
-               $GREP "$($ECHO "$cmd2" | $SED 's/\/usr\/sbin\///g')" \
+               grep "$(echo "$cmd2" | sed 's/\/usr\/sbin\///g')" \
                    $NEW_HISTORY >/dev/null 2>&1 || \
                    log_fail "Didn't find \"$cmd2\" in pool history"
         fi
 done
 
-run_and_verify -p "$MPOOL" "$ZPOOL split $MPOOL ${MPOOL}_split"
+run_and_verify -p "$MPOOL" "zpool split $MPOOL ${MPOOL}_split"
 
 import_dir=/var/tmp/import_dir.$$
-log_must $MKDIR $import_dir
-log_must $CP $STF_SUITE/tests/functional/history/zfs-pool-v4.dat.Z $import_dir
-log_must $UNCOMPRESS $import_dir/zfs-pool-v4.dat.Z
-upgrade_pool=$($ZPOOL import -d $import_dir | $GREP "pool:" | $AWK '{print $2}')
-log_must $ZPOOL import -d $import_dir $upgrade_pool
-run_and_verify -p "$upgrade_pool" "$ZPOOL upgrade $upgrade_pool"
+log_must mkdir $import_dir
+log_must cp $STF_SUITE/tests/functional/history/zfs-pool-v4.dat.Z $import_dir
+log_must uncompress $import_dir/zfs-pool-v4.dat.Z
+upgrade_pool=$(zpool import -d $import_dir | grep "pool:" | awk '{print $2}')
+log_must zpool import -d $import_dir $upgrade_pool
+run_and_verify -p "$upgrade_pool" "zpool upgrade $upgrade_pool"
 
 log_pass "zpool sub-commands which modify state are logged passed. "
index 06edc67e33f1165ead52e396c998f3e2f5f84ea9..979f06076ade4e6f100880c40a166621cb8bfd66 100755 (executable)
@@ -25,7 +25,7 @@
 # Use is subject to license terms.
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/history/history_common.kshlib
@@ -46,12 +46,12 @@ verify_runnable "global"
 function cleanup
 {
 
-       [[ -f $tmpfile ]] && $RM -f $tmpfile
-       [[ -f $tmpfile2 ]] && $RM -f $tmpfile2
+       [[ -f $tmpfile ]] && rm -f $tmpfile
+       [[ -f $tmpfile2 ]] && rm -f $tmpfile2
        for dataset in $fs $newfs $fsclone $vol $newvol $volclone; do
-               datasetexists $dataset && $ZFS destroy -Rf $dataset
+               datasetexists $dataset && zfs destroy -Rf $dataset
        done
-       $RM -rf /history.$$
+       rm -rf /history.$$
 }
 
 log_assert "Verify zfs sub-commands which modify state are logged."
@@ -116,54 +116,54 @@ props=(
 )
 fi
 
-run_and_verify "$ZFS create $fs"
+run_and_verify "zfs create $fs"
 # Set all the property for filesystem
 typeset -i i=0
 while ((i < ${#props[@]})) ; do
-       run_and_verify "$ZFS set ${props[$i]}=${props[((i+1))]} $fs"
+       run_and_verify "zfs set ${props[$i]}=${props[((i+1))]} $fs"
 
        # quota, reservation, canmount can not be inherited.
        #
        if [[ ${props[$i]} != "quota" && ${props[$i]} != "reservation" && \
            ${props[$i]} != "canmount" ]];
        then
-               run_and_verify "$ZFS inherit ${props[$i]} $fs"
+               run_and_verify "zfs inherit ${props[$i]} $fs"
        fi
 
        ((i += 2))
 done
 
-run_and_verify "$ZFS create -V 64M $vol"
-run_and_verify "$ZFS set volsize=32M $vol"
-run_and_verify "$ZFS snapshot $fssnap"
-run_and_verify "$ZFS hold tag $fssnap"
-run_and_verify "$ZFS release tag $fssnap"
-run_and_verify "$ZFS snapshot $volsnap"
-run_and_verify "$ZFS snapshot $fssnap2"
-run_and_verify "$ZFS snapshot $volsnap2"
+run_and_verify "zfs create -V 64M $vol"
+run_and_verify "zfs set volsize=32M $vol"
+run_and_verify "zfs snapshot $fssnap"
+run_and_verify "zfs hold tag $fssnap"
+run_and_verify "zfs release tag $fssnap"
+run_and_verify "zfs snapshot $volsnap"
+run_and_verify "zfs snapshot $fssnap2"
+run_and_verify "zfs snapshot $volsnap2"
 
 # Send isn't logged...
-log_must $ZFS send -i $fssnap $fssnap2 > $tmpfile
-log_must $ZFS send -i $volsnap $volsnap2 > $tmpfile2
+log_must zfs send -i $fssnap $fssnap2 > $tmpfile
+log_must zfs send -i $volsnap $volsnap2 > $tmpfile2
 # Verify that's true
-$ZPOOL history $TESTPOOL | $GREP 'zfs send' >/dev/null 2>&1 && \
+zpool history $TESTPOOL | grep 'zfs send' >/dev/null 2>&1 && \
     log_fail "'zfs send' found in history of \"$TESTPOOL\""
 
-run_and_verify "$ZFS destroy $fssnap2"
-run_and_verify "$ZFS destroy $volsnap2"
-run_and_verify "$ZFS receive $fs < $tmpfile"
-run_and_verify "$ZFS receive $vol < $tmpfile2"
-run_and_verify "$ZFS rollback -r $fssnap"
-run_and_verify "$ZFS rollback -r $volsnap"
-run_and_verify "$ZFS clone $fssnap $fsclone"
-run_and_verify "$ZFS clone $volsnap $volclone"
-run_and_verify "$ZFS rename $fs $newfs"
-run_and_verify "$ZFS rename $vol $newvol"
-run_and_verify "$ZFS promote $fsclone"
-run_and_verify "$ZFS promote $volclone"
-run_and_verify "$ZFS destroy $newfs"
-run_and_verify "$ZFS destroy $newvol"
-run_and_verify "$ZFS destroy -rf $fsclone"
-run_and_verify "$ZFS destroy -rf $volclone"
+run_and_verify "zfs destroy $fssnap2"
+run_and_verify "zfs destroy $volsnap2"
+run_and_verify "zfs receive $fs < $tmpfile"
+run_and_verify "zfs receive $vol < $tmpfile2"
+run_and_verify "zfs rollback -r $fssnap"
+run_and_verify "zfs rollback -r $volsnap"
+run_and_verify "zfs clone $fssnap $fsclone"
+run_and_verify "zfs clone $volsnap $volclone"
+run_and_verify "zfs rename $fs $newfs"
+run_and_verify "zfs rename $vol $newvol"
+run_and_verify "zfs promote $fsclone"
+run_and_verify "zfs promote $volclone"
+run_and_verify "zfs destroy $newfs"
+run_and_verify "zfs destroy $newvol"
+run_and_verify "zfs destroy -rf $fsclone"
+run_and_verify "zfs destroy -rf $volclone"
 
 log_pass "zfs sub-commands which modify state are logged passed."
index 01bba0c96631273b7a7e39a0a25f7087e5283c88..3f6df99a09774ba0a5bc7d6b95234b1f28b0b9f6 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -46,9 +46,9 @@ verify_runnable "global"
 
 function cleanup
 {
-       datasetexists $spool && log_must $ZPOOL destroy $spool
-       [[ -f $VDEV0 ]] && log_must $RM -f $VDEV0
-       [[ -f $TMPFILE ]] && log_must $RM -f $TMPFILE
+       datasetexists $spool && log_must zpool destroy $spool
+       [[ -f $VDEV0 ]] && log_must rm -f $VDEV0
+       [[ -f $TMPFILE ]] && log_must rm -f $TMPFILE
 }
 
 log_assert "zpool history limitation test."
@@ -58,39 +58,39 @@ mntpnt=$(get_prop mountpoint $TESTPOOL)
 (( $? != 0 )) && log_fail "get_prop mountpoint $TESTPOOL"
 
 VDEV0=$mntpnt/vdev0
-log_must $MKFILE $MINVDEVSIZE $VDEV0
+log_must mkfile $MINVDEVSIZE $VDEV0
 
 spool=smallpool.$$; sfs=smallfs.$$
-log_must $ZPOOL create $spool $VDEV0
-log_must $ZFS create $spool/$sfs
+log_must zpool create $spool $VDEV0
+log_must zfs create $spool/$sfs
 
-typeset -i orig_count=$($ZPOOL history $spool | $WC -l)
-typeset orig_md5=$($ZPOOL history $spool | $HEAD -2 | $MD5SUM | \
-    $AWK '{print $1}')
+typeset -i orig_count=$(zpool history $spool | wc -l)
+typeset orig_md5=$(zpool history $spool | head -2 | md5sum | \
+    awk '{print $1}')
 
 typeset -i i=0
 while ((i < 300)); do
-       $ZFS set compression=off $spool/$sfs
-       $ZFS set compression=on $spool/$sfs
-       $ZFS set compression=off $spool/$sfs
-       $ZFS set compression=on $spool/$sfs
-       $ZFS set compression=off $spool/$sfs
+       zfs set compression=off $spool/$sfs
+       zfs set compression=on $spool/$sfs
+       zfs set compression=off $spool/$sfs
+       zfs set compression=on $spool/$sfs
+       zfs set compression=off $spool/$sfs
 
        ((i += 1))
 done
 
 TMPFILE=/tmp/spool.$$
-$ZPOOL history $spool >$TMPFILE
-typeset -i entry_count=$($WC -l $TMPFILE | $AWK '{print $1}')
-typeset final_md5=$($HEAD -2 $TMPFILE | $MD5SUM | $AWK '{print $1}')
+zpool history $spool >$TMPFILE
+typeset -i entry_count=$(wc -l $TMPFILE | awk '{print $1}')
+typeset final_md5=$(head -2 $TMPFILE | md5sum | awk '{print $1}')
 
-$GREP 'zpool create' $TMPFILE >/dev/null 2>&1 ||
+grep 'zpool create' $TMPFILE >/dev/null 2>&1 ||
     log_fail "'zpool create' was not found in pool history"
 
-$GREP 'zfs create' $TMPFILE >/dev/null 2>&1 &&
+grep 'zfs create' $TMPFILE >/dev/null 2>&1 &&
     log_fail "'zfs create' was found in pool history"
 
-$GREP 'zfs set compress' $TMPFILE >/dev/null 2>&1 ||
+grep 'zfs set compress' $TMPFILE >/dev/null 2>&1 ||
     log_fail "'zfs set compress' was found in pool history"
 
 # Verify that the creation of the pool was preserved in the history.
index e29173f860e92196117d2b9a3869e4ec114db027..1b8e7dfe02ec654436462c51c8c77637ffde9c44 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -46,51 +46,51 @@ verify_runnable "global"
 
 log_assert "'zpool history' can cope with simultaneous commands."
 
-typeset -i orig_count=$($ZPOOL history $spool | $WC -l | $AWK '{print $1}')
+typeset -i orig_count=$(zpool history $spool | wc -l | awk '{print $1}')
 
 typeset -i i=0
 while ((i < 10)); do
-       $ZFS set compression=off $TESTPOOL/$TESTFS &
-       $ZFS set atime=off $TESTPOOL/$TESTFS &
-       $ZFS create $TESTPOOL/$TESTFS1 &
-       $ZFS create $TESTPOOL/$TESTFS2 &
-       $ZFS create $TESTPOOL/$TESTFS3 &
+       zfs set compression=off $TESTPOOL/$TESTFS &
+       zfs set atime=off $TESTPOOL/$TESTFS &
+       zfs create $TESTPOOL/$TESTFS1 &
+       zfs create $TESTPOOL/$TESTFS2 &
+       zfs create $TESTPOOL/$TESTFS3 &
 
        wait
 
-       $ZFS snapshot $TESTPOOL/$TESTFS1@snap &
-       $ZFS snapshot $TESTPOOL/$TESTFS2@snap &
-       $ZFS snapshot $TESTPOOL/$TESTFS3@snap &
+       zfs snapshot $TESTPOOL/$TESTFS1@snap &
+       zfs snapshot $TESTPOOL/$TESTFS2@snap &
+       zfs snapshot $TESTPOOL/$TESTFS3@snap &
 
        wait
 
-       $ZFS clone $TESTPOOL/$TESTFS1@snap $TESTPOOL/clone1 &
-       $ZFS clone $TESTPOOL/$TESTFS2@snap $TESTPOOL/clone2 &
-       $ZFS clone $TESTPOOL/$TESTFS3@snap $TESTPOOL/clone3 &
+       zfs clone $TESTPOOL/$TESTFS1@snap $TESTPOOL/clone1 &
+       zfs clone $TESTPOOL/$TESTFS2@snap $TESTPOOL/clone2 &
+       zfs clone $TESTPOOL/$TESTFS3@snap $TESTPOOL/clone3 &
 
        wait
 
-       $ZFS promote $TESTPOOL/clone1 &
-       $ZFS promote $TESTPOOL/clone2 &
-       $ZFS promote $TESTPOOL/clone3 &
+       zfs promote $TESTPOOL/clone1 &
+       zfs promote $TESTPOOL/clone2 &
+       zfs promote $TESTPOOL/clone3 &
 
        wait
 
-       $ZFS destroy $TESTPOOL/$TESTFS1 &
-       $ZFS destroy $TESTPOOL/$TESTFS2 &
-       $ZFS destroy $TESTPOOL/$TESTFS3 &
+       zfs destroy $TESTPOOL/$TESTFS1 &
+       zfs destroy $TESTPOOL/$TESTFS2 &
+       zfs destroy $TESTPOOL/$TESTFS3 &
 
        wait
 
-       $ZFS destroy -Rf $TESTPOOL/clone1 &
-       $ZFS destroy -Rf $TESTPOOL/clone2 &
-       $ZFS destroy -Rf $TESTPOOL/clone3 &
+       zfs destroy -Rf $TESTPOOL/clone1 &
+       zfs destroy -Rf $TESTPOOL/clone2 &
+       zfs destroy -Rf $TESTPOOL/clone3 &
 
        wait
        ((i += 1))
 done
 
-typeset -i entry_count=$($ZPOOL history $spool | $WC -l | $AWK '{print $1}')
+typeset -i entry_count=$(zpool history $spool | wc -l | awk '{print $1}')
 
 if ((entry_count - orig_count != 200)); then
        log_fail "The entries count error: entry_count=$entry_count " \
index 7a3ac27c26d41db97b67aabacbf93b0d5cecadc0..f6a81a4ac5f2dbc66ff5476dcce8ba2bafe945bd 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,14 +52,14 @@ verify_runnable "global"
 log_assert "Verify 'zpool get|history|list|status|iostat' will not be logged."
 
 # Save initial TESTPOOL history
-log_must eval "$ZPOOL history $TESTPOOL >$OLD_HISTORY"
+log_must eval "zpool history $TESTPOOL >$OLD_HISTORY"
 
-log_must $ZPOOL get all $TESTPOOL >/dev/null
-log_must $ZPOOL list $TESTPOOL >/dev/null
-log_must $ZPOOL status $TESTPOOL >/dev/null
-log_must $ZPOOL iostat $TESTPOOL >/dev/null
+log_must zpool get all $TESTPOOL >/dev/null
+log_must zpool list $TESTPOOL >/dev/null
+log_must zpool status $TESTPOOL >/dev/null
+log_must zpool iostat $TESTPOOL >/dev/null
 
-log_must eval "$ZPOOL history $TESTPOOL >$NEW_HISTORY"
-log_must $DIFF $OLD_HISTORY $NEW_HISTORY
+log_must eval "zpool history $TESTPOOL >$NEW_HISTORY"
+log_must diff $OLD_HISTORY $NEW_HISTORY
 
 log_pass "Verify 'zpool get|history|list|status|iostat' will not be logged."
index d1ed4149e0690058ad3256497ec6b3d29d20c9fa..a2da831c5cce7b0f9fa8cf6710ea355940e595a6 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/history/history_common.kshlib
@@ -48,9 +48,9 @@ verify_runnable "global"
 function cleanup
 {
        if datasetexists $fs ; then
-               log_must $ZFS destroy -rf $fs
+               log_must zfs destroy -rf $fs
        fi
-       log_must $ZFS create $fs
+       log_must zfs create $fs
 }
 
 log_assert "Verify 'zfs list|get|holds|mount|unmount|share|unshare|send' " \
@@ -60,29 +60,29 @@ log_onexit cleanup
 # Create initial test environment
 fs=$TESTPOOL/$TESTFS; snap1=$fs@snap1; snap2=$fs@snap2
 if ! is_linux; then
-       log_must $ZFS set sharenfs=on $fs
+       log_must zfs set sharenfs=on $fs
 fi
-log_must $ZFS snapshot $snap1
-log_must $ZFS hold tag $snap1
-log_must $ZFS snapshot $snap2
+log_must zfs snapshot $snap1
+log_must zfs hold tag $snap1
+log_must zfs snapshot $snap2
 
 # Save initial TESTPOOL history
-log_must eval "$ZPOOL history $TESTPOOL > $OLD_HISTORY"
+log_must eval "zpool history $TESTPOOL > $OLD_HISTORY"
 
-log_must $ZFS list $fs > /dev/null
-log_must $ZFS get mountpoint $fs > /dev/null
-log_must $ZFS unmount $fs
-log_must $ZFS mount $fs
+log_must zfs list $fs > /dev/null
+log_must zfs get mountpoint $fs > /dev/null
+log_must zfs unmount $fs
+log_must zfs mount $fs
 if ! is_linux; then
-       log_must $ZFS share $fs
-       log_must $ZFS unshare $fs
+       log_must zfs share $fs
+       log_must zfs unshare $fs
 fi
-log_must $ZFS send -i $snap1 $snap2 > /dev/null
-log_must $ZFS holds $snap1
+log_must zfs send -i $snap1 $snap2 > /dev/null
+log_must zfs holds $snap1
 
-log_must eval "$ZPOOL history $TESTPOOL > $NEW_HISTORY"
-log_must $DIFF $OLD_HISTORY $NEW_HISTORY
+log_must eval "zpool history $TESTPOOL > $NEW_HISTORY"
+log_must diff $OLD_HISTORY $NEW_HISTORY
 
-log_must $ZFS release tag $snap1
+log_must zfs release tag $snap1
 
 log_pass "Verify 'zfs list|get|mount|unmount|share|unshare|send' passed."
index 66d21910585aeb581931417cca0cc835a77b7531..b65e855d8c70771a4d91035d7ccd678423479ff0 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,9 +47,9 @@ verify_runnable "global"
 function cleanup
 {
        poolexists $migratedpoolname &&  \
-               log_must $ZPOOL destroy -f $migratedpoolname
+               log_must zpool destroy -f $migratedpoolname
 
-       [[ -d $import_dir ]] && $RM -rf $import_dir
+       [[ -d $import_dir ]] && rm -rf $import_dir
 }
 
 log_assert "Verify command history moves with migrated pool."
@@ -62,28 +62,28 @@ migratedpoolname=$MIGRATEDPOOLNAME
 typeset -i RET=1
 typeset -i linenum=0
 
-[[ ! -d $import_dir ]] && log_must $MKDIR $import_dir
+[[ ! -d $import_dir ]] && log_must mkdir $import_dir
 
 # We test the migrations on both uniform platform and cross platform
 for arch in "i386" "sparc"; do
-       log_must $CP $tst_dir/${arch}.orig_history.txt $import_dir
+       log_must cp $tst_dir/${arch}.orig_history.txt $import_dir
        orig_cmds_f=$import_dir/${arch}.orig_history.txt
        # remove blank line
        orig_cmds_f1=$import_dir/${arch}.orig_history_1.txt
-       $CAT $orig_cmds_f | $GREP -v "^$" > $orig_cmds_f1
+       cat $orig_cmds_f | grep -v "^$" > $orig_cmds_f1
 
-       log_must $CP $tst_dir/${arch}.migratedpool.DAT.Z $import_dir
-       log_must $UNCOMPRESS $import_dir/${arch}.migratedpool.DAT.Z
+       log_must cp $tst_dir/${arch}.migratedpool.DAT.Z $import_dir
+       log_must uncompress $import_dir/${arch}.migratedpool.DAT.Z
 
        # destroy the pool with same name, so that import operation succeeds.
        poolexists $migratedpoolname && \
-           log_must $ZPOOL destroy -f $migratedpoolname
+           log_must zpool destroy -f $migratedpoolname
 
-       log_must $ZPOOL import -d $import_dir $migratedpoolname
-       TZ=$TIMEZONE $ZPOOL history $migratedpoolname | $GREP -v "^$" \
+       log_must zpool import -d $import_dir $migratedpoolname
+       TZ=$TIMEZONE zpool history $migratedpoolname | grep -v "^$" \
            >$migrated_cmds_f
        RET=$?
-       (( $RET != 0 )) && log_fail "$ZPOOL histroy $migratedpoolname fails."
+       (( $RET != 0 )) && log_fail "zpool histroy $migratedpoolname fails."
 
        # The migrated history file should differ with original history file on
        # two commands -- 'export' and 'import', which are included in migrated
@@ -92,21 +92,21 @@ for arch in "i386" "sparc"; do
        # then compare this filtered file with the original history file. They
        # should be identical at this time.
        for subcmd in "export" "import"; do
-               $GREP "$subcmd" $migrated_cmds_f >/dev/null 2>&1
+               grep "$subcmd" $migrated_cmds_f >/dev/null 2>&1
                RET=$?
                (( $RET != 0 )) && log_fail "zpool $subcmd is not logged for" \
                    "the imported pool $migratedpoolname."
        done
 
        tmpfile=$import_dir/cmds_tmp.$$
-       linenum=`$CAT $migrated_cmds_f | $WC -l`
+       linenum=`cat $migrated_cmds_f | wc -l`
        (( linenum = linenum - 2 ))
-       $HEAD -n $linenum $migrated_cmds_f > $tmpfile
-       log_must $DIFF $tmpfile $orig_cmds_f1
+       head -n $linenum $migrated_cmds_f > $tmpfile
+       log_must diff $tmpfile $orig_cmds_f1
 
        # cleanup for next loop testing
-       log_must $ZPOOL destroy -f $migratedpoolname
-       log_must $RM -f `$LS $import_dir`
+       log_must zpool destroy -f $migratedpoolname
+       log_must rm -f `ls $import_dir`
 done
 
 log_pass "Verify command history moves with migrated pool."
index 56df2939c220ccbe3147277f0d66aeee9bdfc788..996c7658c32c6ad3b09bda8252c39ba793d5e83b 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/history/history_common.kshlib
@@ -48,9 +48,9 @@ verify_runnable "global"
 function cleanup
 {
        if datasetexists $root_testfs; then
-               log_must $ZFS destroy -rf $root_testfs
+               log_must zfs destroy -rf $root_testfs
        fi
-       log_must $ZFS create $root_testfs
+       log_must zfs create $root_testfs
 }
 
 log_assert "Pool history records all recursive operations."
@@ -59,16 +59,16 @@ log_onexit cleanup
 root_testfs=$TESTPOOL/$TESTFS
 fs1=$root_testfs/fs1; fs2=$root_testfs/fs2; fs3=$root_testfs/fs3
 for fs in $fs1 $fs2 $fs3; do
-       log_must $ZFS create $fs
+       log_must zfs create $fs
 done
 
-run_and_verify "$ZFS snapshot -r $root_testfs@snap" "-i"
-run_and_verify "$ZFS hold -r tag $root_testfs@snap" "-i"
-run_and_verify "$ZFS release -r tag $root_testfs@snap" "-i"
-log_must $ZFS snapshot $root_testfs@snap2
-log_must $ZFS snapshot $root_testfs@snap3
-run_and_verify "$ZFS rollback -r $root_testfs@snap" "-i"
-run_and_verify "$ZFS inherit -r mountpoint $root_testfs" "-i"
-run_and_verify "$ZFS destroy -r $root_testfs" "-i"
+run_and_verify "zfs snapshot -r $root_testfs@snap" "-i"
+run_and_verify "zfs hold -r tag $root_testfs@snap" "-i"
+run_and_verify "zfs release -r tag $root_testfs@snap" "-i"
+log_must zfs snapshot $root_testfs@snap2
+log_must zfs snapshot $root_testfs@snap3
+run_and_verify "zfs rollback -r $root_testfs@snap" "-i"
+run_and_verify "zfs inherit -r mountpoint $root_testfs" "-i"
+run_and_verify "zfs destroy -r $root_testfs" "-i"
 
 log_pass "Pool history records all recursive operations."
index 8a10d16f203e8a3cc06e39ded0f53f0d1fb70907..cf40df84ec839192a90043ba87eb84a6b5312272 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/history/history_common.kshlib
@@ -107,7 +107,7 @@ while ((i < ${#array[@]})); do
        subcmd=${array[$i]}
        options=${array[((i + 1))]}
 
-       run_and_verify "$ZFS $subcmd $options $testfs" "-i"
+       run_and_verify "zfs $subcmd $options $testfs" "-i"
        ((i += 2))
 done
 
index 4c146d8f3145dc4740b92ef2fe0db2a43460b4b5..6ba0389f5f46d267a5babfc9096b78f64df5e9a5 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/history/history_common.kshlib
@@ -47,7 +47,7 @@ function cleanup
 {
        del_user $HIST_USER
        del_group $HIST_GROUP
-       datasetexists $root_testfs && log_must $ZFS destroy -rf $root_testfs
+       datasetexists $root_testfs && log_must zfs destroy -rf $root_testfs
 }
 
 log_assert "Verify internal long history information are correct."
@@ -59,18 +59,18 @@ root_testfs=$TESTPOOL/$TESTFS1
 add_group $HIST_GROUP
 add_user $HIST_GROUP $HIST_USER
 
-run_and_verify "$ZFS create $root_testfs" "-l"
-run_and_verify "$ZFS allow $HIST_GROUP snapshot,mount $root_testfs" "-l"
-run_and_verify "$ZFS allow $HIST_USER destroy,mount $root_testfs" "-l"
-run_and_verify "$ZFS allow $HIST_USER reservation $root_testfs" "-l"
-run_and_verify "$ZFS allow $HIST_USER allow $root_testfs" "-l"
-run_and_verify -u "$HIST_USER" "$ZFS snapshot $root_testfs@snap" "-l"
-run_and_verify -u "$HIST_USER" "$ZFS destroy $root_testfs@snap" "-l"
-run_and_verify -u "$HIST_USER" "$ZFS set reservation=64M $root_testfs" "-l"
+run_and_verify "zfs create $root_testfs" "-l"
+run_and_verify "zfs allow $HIST_GROUP snapshot,mount $root_testfs" "-l"
+run_and_verify "zfs allow $HIST_USER destroy,mount $root_testfs" "-l"
+run_and_verify "zfs allow $HIST_USER reservation $root_testfs" "-l"
+run_and_verify "zfs allow $HIST_USER allow $root_testfs" "-l"
+run_and_verify -u "$HIST_USER" "zfs snapshot $root_testfs@snap" "-l"
+run_and_verify -u "$HIST_USER" "zfs destroy $root_testfs@snap" "-l"
+run_and_verify -u "$HIST_USER" "zfs set reservation=64M $root_testfs" "-l"
 run_and_verify -u "$HIST_USER" \
-    "$ZFS allow $HIST_USER reservation $root_testfs" "-l"
-run_and_verify "$ZFS unallow $HIST_USER create $root_testfs" "-l"
-run_and_verify "$ZFS unallow $HIST_GROUP snapshot $root_testfs" "-l"
-run_and_verify "$ZFS destroy -r $root_testfs" "-l"
+    "zfs allow $HIST_USER reservation $root_testfs" "-l"
+run_and_verify "zfs unallow $HIST_USER create $root_testfs" "-l"
+run_and_verify "zfs unallow $HIST_GROUP snapshot $root_testfs" "-l"
+run_and_verify "zfs destroy -r $root_testfs" "-l"
 
 log_pass "Verify internal long history information pass."
index 640666ca136e79568c80e9007764a58160e7e36a..7b92b8d0164ac892823126937c13210d7d6d08d6 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,14 +52,14 @@ function run_and_verify
        flags="$2"
 
        if is_linux; then
-               histcmd=$($ECHO $fullcmd | $SED 's/^.*\/\(zpool .*\).*$/\1/')
-               histcmd=$($ECHO $histcmd | $SED 's/^.*\/\(zfs .*\).*$/\1/')
+               histcmd=$(echo $fullcmd | sed 's/^.*\/\(zpool .*\).*$/\1/')
+               histcmd=$(echo $histcmd | sed 's/^.*\/\(zfs .*\).*$/\1/')
        else
-               histcmd=$($ECHO $fullcmd | $SED 's/\/usr\/sbin\///g')
+               histcmd=$(echo $fullcmd | sed 's/\/usr\/sbin\///g')
        fi
 
-       cmd=$($ECHO $histcmd | $AWK '{print $1}')
-       subcmd=$($ECHO $histcmd | $AWK '{print $2}')
+       cmd=$(echo $histcmd | awk '{print $1}')
+       subcmd=$(echo $histcmd | awk '{print $2}')
 
        # If we aren't running zpool or zfs, something is wrong
        [[ $cmd == "zpool" || $cmd == "zfs" ]] || \
@@ -70,18 +70,18 @@ function run_and_verify
            histcmd=${histcmd%% <*}
 
        # Run the command as the specified user, and find the new history.
-       $ZPOOL history $flags $pool > $OLD_HISTORY 2>/dev/null
+       zpool history $flags $pool > $OLD_HISTORY 2>/dev/null
        if [[ $user == "root" ]]; then
                log_must eval "$fullcmd"
        else
-               log_must $SU $user -c "eval $fullcmd"
+               log_must su $user -c "eval $fullcmd"
        fi
-       $ZPOOL history $flags $pool > $TMP_HISTORY 2>/dev/null
-       $DIFF $OLD_HISTORY $TMP_HISTORY | $GREP "^> " | $SED 's/^> //g' \
+       zpool history $flags $pool > $TMP_HISTORY 2>/dev/null
+       diff $OLD_HISTORY $TMP_HISTORY | grep "^> " | sed 's/^> //g' \
            > $NEW_HISTORY
 
        # Verify what's common to every case, regardless of zpool history flags.
-       $GREP "$histcmd" $NEW_HISTORY >/dev/null 2>&1 || \
+       grep "$histcmd" $NEW_HISTORY >/dev/null 2>&1 || \
            log_fail "Didn't find \"$histcmd\" in pool history"
 
        # If 'zpool history' was called without any flags, then we're done.
@@ -103,10 +103,10 @@ function verify_long
 
        [[ $flags =~ "l" ]] || return 1
 
-       typeset uid=$($ID -u $user)
-       typeset hname=$($HOSTNAME)
+       typeset uid=$(id -u $user)
+       typeset hname=$(hostname)
        if ! is_global_zone; then
-               hname=$hname:$($ZONENAME)
+               hname=$hname:$(zonename)
        fi
 
        typeset suffix=""
@@ -114,7 +114,7 @@ function verify_long
                suffix=":linux"
        fi
 
-       $GREP "$cmd \[user $uid ($user) on $hname$suffix\]" \
+       grep "$cmd \[user $uid ($user) on $hname$suffix\]" \
            $NEW_HISTORY >/dev/null 2>&1
        if [[ $? != 0 ]]; then
                log_note "Couldn't find long information for \"$cmd\""
@@ -132,15 +132,15 @@ function verify_hold
 
        [[ $flags =~ "i" ]] || return 1
 
-       typeset tag=$($ECHO $cmd | $AWK '{print $4}')
+       typeset tag=$(echo $cmd | awk '{print $4}')
        typeset fullname=${cmd##* }
        typeset dsname=${fullname%%@*}
        typeset snapname=${fullname##*@}
 
        # This works whether or not the hold was recursive
-       for ds in $($ZFS list -r -Ho name -t snapshot $dsname | \
-           $GREP "@$snapname"); do
-               $GREP "$subcmd $ds ([0-9]*) tag=$tag" $NEW_HISTORY \
+       for ds in $(zfs list -r -Ho name -t snapshot $dsname | \
+           grep "@$snapname"); do
+               grep "$subcmd $ds ([0-9]*) tag=$tag" $NEW_HISTORY \
                    >/dev/null 2>&1
                if [[ $? != 0 ]]; then
                        log_note "Didn't find hold on $ds with $tag"
@@ -171,14 +171,14 @@ function verify_rollback
        typeset rb_fs=${dsname}/%rollback
        typeset snapname=${fullname##*@}
 
-       $GREP "clone swap $rb_fs ([0-9]*) parent=$parent_fs" $NEW_HISTORY \
+       grep "clone swap $rb_fs ([0-9]*) parent=$parent_fs" $NEW_HISTORY \
            >/dev/null 2>&1
        if [[ $? != 0 ]]; then
                log_note "Didn't find rollback clone swap in pool history"
                return 1
        fi
 
-       $GREP "destroy $rb_fs" $NEW_HISTORY >/dev/null 2>&1
+       grep "destroy $rb_fs" $NEW_HISTORY >/dev/null 2>&1
        if [[ $? != 0 ]]; then
                log_note "Didn't find rollback destroy in pool history"
                return 1
@@ -199,8 +199,8 @@ function verify_inherit
        prop=${prop##* }
 
        # This works whether or not the inherit was recursive
-       for ds in $($ZFS list -r -Ho name -t filesystem $dsname); do
-               $GREP "$subcmd $ds ([0-9]*) ${prop}=" $NEW_HISTORY >/dev/null \
+       for ds in $(zfs list -r -Ho name -t filesystem $dsname); do
+               grep "$subcmd $ds ([0-9]*) ${prop}=" $NEW_HISTORY >/dev/null \
                    2>&1
                if [[ $? != 0 ]]; then
                        log_note "Didn't find inherit history for $ds"
@@ -230,7 +230,7 @@ function verify_allow
        # - Whether the operation applies locally or to descendent datasets (or
        #   both)
        #
-       $ECHO $cmd  | $AWK '{i = NF - 1; print $i}' | $GREP '@' >/dev/null \
+       echo $cmd  | awk '{i = NF - 1; print $i}' | grep '@' >/dev/null \
            2>&1 && is_set=1
        dsname=${cmd##* }
        [[ $cmd =~ "-l " ]] && lflag=1
@@ -253,7 +253,7 @@ function verify_allow
                [[ -n $is_set ]] && str="S-\$@"
                tmp=${cmd#*@}
                code="$str${tmp% *}"
-               $GREP "permission $subcmd $dsname ([0-9]*) $code" \
+               grep "permission $subcmd $dsname ([0-9]*) $code" \
                    $NEW_HISTORY >/dev/null 2>&1
                if [[ $? != 0 ]]; then
                         log_note "Couldn't find $code in $NEW_HISTORY"
@@ -264,7 +264,7 @@ function verify_allow
                [[ -n $is_set ]] && str="C-\$"
                tmp=${cmd#*-c}
                code="$str${tmp% *}"
-               $GREP "permission $subcmd $dsname ([0-9]*) $code" \
+               grep "permission $subcmd $dsname ([0-9]*) $code" \
                    $NEW_HISTORY >/dev/null 2>&1
                if [ $? != 0 ]]; then
                         log_note "Couldn't find $code in $NEW_HISTORY"
@@ -274,11 +274,11 @@ function verify_allow
                str="u"
                [[ -n $is_set ]] && str="U"
                tmp=${cmd##*-u }
-               opt=$($ECHO $tmp | $AWK '{print $2}')
-               uid=$($ID -u ${tmp%% *})
+               opt=$(echo $tmp | awk '{print $2}')
+               uid=$(id -u ${tmp%% *})
                if [[ -n $lflag ]]; then
                        code="${str}l\$$uid $opt"
-                       $GREP "permission $subcmd $dsname ([0-9]*) $code" \
+                       grep "permission $subcmd $dsname ([0-9]*) $code" \
                            $NEW_HISTORY >/dev/null 2>&1
                        if [ $? != 0 ]]; then
                                 log_note "Couldn't find $code in $NEW_HISTORY"
@@ -287,7 +287,7 @@ function verify_allow
                fi
                if [[ -n $dflag ]]; then
                        code="${str}d\$$uid $opt"
-                       $GREP "permission $subcmd $dsname ([0-9]*) $code" \
+                       grep "permission $subcmd $dsname ([0-9]*) $code" \
                            $NEW_HISTORY >/dev/null 2>&1
                        if [ $? != 0 ]]; then
                                 log_note "Couldn't find $code in $NEW_HISTORY"
@@ -298,11 +298,11 @@ function verify_allow
                str="g"
                [[ -n $is_set ]] && str="G"
                tmp=${cmd##*-g }
-               opt=$($ECHO $tmp | $AWK '{print $2}')
-               gid=$($AWK -F: "/^${tmp%% *}:/ {print \$3}" /etc/group)
+               opt=$(echo $tmp | awk '{print $2}')
+               gid=$(awk -F: "/^${tmp%% *}:/ {print \$3}" /etc/group)
                if [[ -n $lflag ]]; then
                        code="${str}l\$$gid $opt"
-                       $GREP "permission $subcmd $dsname ([0-9]*) $code" \
+                       grep "permission $subcmd $dsname ([0-9]*) $code" \
                            $NEW_HISTORY >/dev/null 2>&1
                        if [ $? != 0 ]]; then
                                 log_note "Couldn't find $code in $NEW_HISTORY"
@@ -311,7 +311,7 @@ function verify_allow
                fi
                if [[ -n $dflag ]]; then
                        code="${str}d\$$gid $opt"
-                       $GREP "permission $subcmd $dsname ([0-9]*) $code" \
+                       grep "permission $subcmd $dsname ([0-9]*) $code" \
                            $NEW_HISTORY >/dev/null 2>&1
                        if [ $? != 0 ]]; then
                                 log_note "Couldn't find $code in $NEW_HISTORY"
@@ -325,7 +325,7 @@ function verify_allow
                opt=${opt%% *}
                if [[ -n $lflag ]]; then
                        code="${str}l\$ $opt"
-                       $GREP "permission $subcmd $dsname ([0-9]*) $code" \
+                       grep "permission $subcmd $dsname ([0-9]*) $code" \
                            $NEW_HISTORY >/dev/null 2>&1
                        if [ $? != 0 ]]; then
                                 log_note "Couldn't find $code in $NEW_HISTORY"
@@ -334,7 +334,7 @@ function verify_allow
                fi
                if [[ -n $dflag ]]; then
                        code="${str}d\$ $opt"
-                       $GREP "permission $subcmd $dsname ([0-9]*) $code" \
+                       grep "permission $subcmd $dsname ([0-9]*) $code" \
                            $NEW_HISTORY >/dev/null 2>&1
                        if [ $? != 0 ]]; then
                                 log_note "Couldn't find $code in $NEW_HISTORY"
@@ -372,7 +372,7 @@ function verify_destroy
        [[ $dsname =~ "@" ]] && typeset is_snap=1
 
        if [[ -n $is_snap ]]; then
-               $GREP "ioctl destroy_snaps" $NEW_HISTORY >/dev/null 2>&1
+               grep "ioctl destroy_snaps" $NEW_HISTORY >/dev/null 2>&1
                if [[ $? != 0 ]]; then
                        log_note "Didn't find ioctl while destroying $dsname"
                        return 1
@@ -380,7 +380,7 @@ function verify_destroy
        fi
 
        # This should be present for datasets and snapshots alike
-       $GREP "destroy $dsname" $NEW_HISTORY >/dev/null 2>&1
+       grep "destroy $dsname" $NEW_HISTORY >/dev/null 2>&1
        if [[ $? != 0 ]]; then
                log_note "Didn't find \"destroy\" for $dsname"
                return 1
@@ -400,7 +400,7 @@ function verify_snapshot
        typeset dsname=${fullname%%@*}
        typeset snapname=${fullname##*@}
 
-       $GREP "\[txg:[0-9]*\] $subcmd $fullname ([0-9]*)" $NEW_HISTORY \
+       grep "\[txg:[0-9]*\] $subcmd $fullname ([0-9]*)" $NEW_HISTORY \
            >/dev/null 2>&1
        if [[ $? != 0 ]]; then
                log_note "Didn't find snapshot command for $fullname"
@@ -408,9 +408,9 @@ function verify_snapshot
        fi
 
        # This works whether or not the snapshot was recursive
-       for ds in $($ZFS list -r -Ho name -t snapshot $dsname | \
-           $GREP "@$snapname"); do
-               $GREP "^[ ]* $ds$" $NEW_HISTORY >/dev/null 2>&1
+       for ds in $(zfs list -r -Ho name -t snapshot $dsname | \
+           grep "@$snapname"); do
+               grep "^[ ]* $ds$" $NEW_HISTORY >/dev/null 2>&1
                if [[ $? != 0 ]]; then
                        log_note "Didn't find \"ioctl snapshot\" for $ds"
                        return 1
index 3c631a2d7f2e5e13c82c9544adf0ac7619d42973..daac5c18a345ce3e0991ce793e30a7a0c4f61172 100755 (executable)
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . ${STF_SUITE}/include/libtest.shlib
 
-$RM -rf $TESTDIR.*
+rm -rf $TESTDIR.*
 default_cleanup
index cee0cfdf13aa21978b0d991b4e2d4fe5044e10a3..cd6bd5c027ca014855522e97983d1e968277edb6 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 #
@@ -38,7 +38,7 @@ function get_prop_src # property dataset
         typeset prop=$1
         typeset dataset=$2
 
-       prop_val=`$ZFS get -H -o source $prop $dataset`
+       prop_val=`zfs get -H -o source $prop $dataset`
 
         if [[ $? -ne 0 ]]; then
                 log_fail "Unable to determine the source of $prop " \
@@ -104,7 +104,7 @@ function set_n_verify_prop #property value dataset
        typeset prop_val=$2
        typeset dataset=$3
 
-       $ZFS set $prop=$prop_val $dataset
+       zfs set $prop=$prop_val $dataset
        check_val=`get_prop $prop $dataset`
 
        if [[ $check_val != $prop_val ]]; then
index 96a07eb1bc3f0c6ddf336491738dd4a51541d5b1..76bd05ce57de2eb9762eecf276b44b6d54c2ef9b 100755 (executable)
@@ -25,7 +25,7 @@
 # Use is subject to license terms.
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -58,10 +58,10 @@ function create_dataset { #name type disks
        if [[ $type == "POOL" ]]; then
                create_pool "$dataset" "$disks"
        elif [[ $type == "CTR" ]]; then
-               log_must $ZFS create $dataset
-               log_must $ZFS set canmount=off $dataset
+               log_must zfs create $dataset
+               log_must zfs set canmount=off $dataset
        elif [[ $type == "FS" ]]; then
-               log_must $ZFS create $dataset
+               log_must zfs create $dataset
        else
                log_fail "Unrecognised type $type"
        fi
@@ -143,7 +143,7 @@ function update_recordsize { #dataset init_code
                def_val[idx]=$record_val
                def_recordsize=1
        elif [[ $init_code == "local" ]]; then
-               log_must $ZFS set recordsize=$record_val $dataset
+               log_must zfs set recordsize=$record_val $dataset
                local_val[idx]=$record_val
        fi
 }
@@ -332,13 +332,13 @@ function scan_state { #state-file
                                        log_note "No operation specified"
                                else
                                        export __ZFS_POOL_RESTRICT="TESTPOOL"
-                                       log_must $ZFS unmount -a
+                                       log_must zfs unmount -a
                                        unset __ZFS_POOL_RESTRICT
 
                                        for p in ${prop[i]} ${prop[((i+1))]}; do
-                                               $ZFS $op $p $target
+                                               zfs $op $p $target
                                                ret=$?
-                                               check_failure $ret "$ZFS $op $p \
+                                               check_failure $ret "zfs $op $p \
                                                    $target"
                                        done
                                fi
index 7d2b631caa7beec5327a74d093d0c33a13e6d0b4..a0891fde19caaddee95ae3cbaca3181fad464a91 100644 (file)
@@ -31,6 +31,7 @@
 . $STF_SUITE/include/libtest.shlib
 
 if is_linux; then
+       DISK_ARRAY_NUM=2
        set_device_dir
        set_slice_prefix
        export SLICE0=1
index b7d002003b33bfc9b717311178ca1d70b4b4d374..4ba57c3627a7d24ea8c5f65093d78648b17ef898 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -49,7 +49,7 @@ function cleanup
        # Remove dump device.
        #
        if [[ -n $PREVDUMPDEV ]]; then
-               log_must $DUMPADM -u -d $PREVDUMPDEV > /dev/null
+               log_must dumpadm -u -d $PREVDUMPDEV > /dev/null
        fi
 
        destroy_pool $TESTPOOL
@@ -62,17 +62,17 @@ log_onexit cleanup
 typeset dumpdev=""
 typeset diskslice=""
 
-PREVDUMPDEV=`$DUMPADM | $GREP "Dump device" | $AWK '{print $3}'`
+PREVDUMPDEV=`dumpadm | grep "Dump device" | awk '{print $3}'`
 
 log_note "Zero $FS_DISK0 and place free space in to slice 0"
 log_must cleanup_devices $FS_DISK0
 
 diskslice="${DEV_DSKDIR}/${FS_DISK0}${SLICE0}"
 log_note "Configuring $diskslice as dump device"
-log_must $DUMPADM -d $diskslice > /dev/null
+log_must dumpadm -d $diskslice > /dev/null
 
 log_note "Confirm that dump device has been setup"
-dumpdev=`$DUMPADM | $GREP "Dump device" | $AWK '{print $3}'`
+dumpdev=`dumpadm | grep "Dump device" | awk '{print $3}'`
 [[ -z "$dumpdev" ]] && log_untested "No dump device has been configured"
 
 [[ "$dumpdev" != "$diskslice" ]] && \
@@ -80,7 +80,7 @@ dumpdev=`$DUMPADM | $GREP "Dump device" | $AWK '{print $3}'`
 
 log_note "Attempt to zpool the dump device"
 unset NOINUSE_CHECK
-log_mustnot $ZPOOL create $TESTPOOL "$diskslice"
+log_mustnot zpool create $TESTPOOL "$diskslice"
 log_mustnot poolexists $TESTPOOL
 
 log_pass "Unable to zpool a device in use by dumpadm"
index d8ae35b75c32dcc34b5b5489c62485d9d22b4a77..932955b4fb10f33d997040473d349150d3ae414e 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -57,26 +57,26 @@ function cleanup
        poolexists $TESTPOOL2 && destroy_pool $TESTPOOL2
 
        log_note "Kill off ufsdump process if still running"
-       $KILL -0 $PIDUFSDUMP > /dev/null 2>&1 && \
-           log_must $KILL -9 $PIDUFSDUMP  > /dev/null 2>&1
+       kill -0 $PIDUFSDUMP > /dev/null 2>&1 && \
+           log_must kill -9 $PIDUFSDUMP  > /dev/null 2>&1
        #
        # Note: It would appear that ufsdump spawns a number of processes
        # which are not killed when the $PIDUFSDUMP is whacked.  So best bet
        # is to find the rest of the them and deal with them individually.
        #
-       for all in `$PGREP ufsdump`
+       for all in `pgrep ufsdump`
        do
-               $KILL -9 $all > /dev/null 2>&1
+               kill -9 $all > /dev/null 2>&1
        done
 
        log_note "Kill off ufsrestore process if still running"
-       $KILL -0 $PIDUFSRESTORE > /dev/null 2>&1 && \
-           log_must $KILL -9 $PIDUFSRESTORE  > /dev/null 2>&1
+       kill -0 $PIDUFSRESTORE > /dev/null 2>&1 && \
+           log_must kill -9 $PIDUFSRESTORE  > /dev/null 2>&1
 
-       ismounted $UFSMP ufs && log_must $UMOUNT $UFSMP
+       ismounted $UFSMP ufs && log_must umount $UFSMP
 
-       $RM -rf $UFSMP
-       $RM -rf $TESTDIR
+       rm -rf $UFSMP
+       rm -rf $TESTDIR
 
        #
        # Tidy up the disks we used.
@@ -103,23 +103,23 @@ for num in 0 1 2; do
 done
 
 log_note "Make a ufs filesystem on source $rawdisk1"
-$ECHO "y" | $NEWFS -v $rawdisk1 > /dev/null 2>&1
+echo "y" | newfs -v $rawdisk1 > /dev/null 2>&1
 (($? != 0)) && log_untested "Unable to create ufs filesystem on $rawdisk1"
 
-log_must $MKDIR -p $UFSMP
+log_must mkdir -p $UFSMP
 
 log_note "mount source $disk1 on $UFSMP"
-log_must $MOUNT $disk1 $UFSMP
+log_must mount $disk1 $UFSMP
 
 log_note "Now create some directories and files to be ufsdump'ed"
 while (($dirnum <= 2)); do
-       log_must $MKDIR $bigdir${dirnum}
+       log_must mkdir $bigdir${dirnum}
        while (( $filenum <= 2 )); do
-               $FILE_WRITE -o create -f $bigdir${dirnum}/file${filenum} \
+               file_write -o create -f $bigdir${dirnum}/file${filenum} \
                    -b $BLOCK_SIZE -c $BLOCK_COUNT
                if [[ $? -ne 0 ]]; then
                        if [[ $dirnum -lt 3 ]]; then
-                               log_fail "$FILE_WRITE only wrote" \
+                               log_fail "file_write only wrote" \
                                    "<(( $dirnum * 3 + $filenum ))>" \
                                    "files, this is not enough"
                        fi
@@ -130,46 +130,46 @@ while (($dirnum <= 2)); do
        ((dirnum = dirnum + 1))
 done
 
-log_must $UMOUNT $UFSMP
+log_must umount $UFSMP
 
 log_note "Start ufsdump in the background"
-log_note "$UFSDUMP 0bf 512 $rawdisk0 $disk1"
-$UFSDUMP 0bf 512 $rawdisk0 $disk1 &
+log_note "ufsdump 0bf 512 $rawdisk0 $disk1"
+ufsdump 0bf 512 $rawdisk0 $disk1 &
 PIDUFSDUMP=$!
 
 unset NOINUSE_CHECK
 log_note "Attempt to zpool the source device in use by ufsdump"
-log_mustnot $ZPOOL create $TESTPOOL1 "$disk1"
+log_mustnot zpool create $TESTPOOL1 "$disk1"
 log_mustnot poolexists $TESTPOOL1
 
 log_note "Attempt to take the source device in use by ufsdump as spare device"
-log_mustnot $ZPOOL create $TESTPOOL1 "$FS_SIDE2" spare "$disk1"
+log_mustnot zpool create $TESTPOOL1 "$FS_SIDE2" spare "$disk1"
 log_mustnot poolexists $TESTPOOL1
 
 wait $PIDUFSDUMP
 typeset -i retval=$?
-(($retval != 0)) && log_fail "$UFSDUMP failed with error code $ret_val"
+(($retval != 0)) && log_fail "ufsdump failed with error code $ret_val"
 
-log_must $MOUNT $disk1 $UFSMP
+log_must mount $disk1 $UFSMP
 
-log_must $RM -rf $UFSMP/*
-log_must $MKDIR $restored_files
+log_must rm -rf $UFSMP/*
+log_must mkdir $restored_files
 
 cwd=$PWD
 log_must cd $restored_files
 log_note "Start ufsrestore in the background from the target device"
-log_note "$UFSRESTORE rbf 512 $rawdisk0"
-$UFSRESTORE rbf 512 $rawdisk0 &
+log_note "ufsrestore rbf 512 $rawdisk0"
+ufsrestore rbf 512 $rawdisk0 &
 PIDUFSRESTORE=$!
 log_must cd $cwd
 
 log_note "Attempt to zpool the restored device in use by ufsrestore"
-log_mustnot $ZPOOL create -f $TESTPOOL2 "$disk1"
+log_mustnot zpool create -f $TESTPOOL2 "$disk1"
 log_mustnot poolexists $TESTPOOL2
 
 log_note "Attempt to take the restored device in use by ufsrestore as spare" \
     "device"
-log_mustnot $ZPOOL create -f $TESTPOOL2 "$FS_SIDE2" spare "$disk1"
+log_mustnot zpool create -f $TESTPOOL2 "$FS_SIDE2" spare "$disk1"
 log_mustnot poolexists $TESTPOOL2
 
 log_pass "Unable to zpool over a device in use by ufsdump or ufsrestore"
index fb949950b961f5ffb5f4d563cfc9bc4c4325ff96..0c61ba075b5f588b37607a761ff0d99f7232ee6d 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,12 +52,12 @@ function cleanup
        # to work correctly.  So its reproduced below.  Still need to full
        # understand why default_cleanup does not work correctly from here.
        #
-        log_must $ZFS umount $TESTPOOL/$TESTFS
+        log_must zfs umount $TESTPOOL/$TESTFS
 
-        $RM -rf $TESTDIR || \
+        rm -rf $TESTDIR || \
             log_unresolved Could not remove $TESTDIR
 
-       log_must $ZFS destroy $TESTPOOL/$TESTFS
+       log_must zfs destroy $TESTPOOL/$TESTFS
        destroy_pool $TESTPOOL
 }
 #
@@ -69,13 +69,19 @@ function mini_format
 {
         typeset disk=$1
 
-       typeset format_file=/var/tmp/format_in.$$.1
-       $ECHO "partition" > $format_file
-       $ECHO "modify" >> $format_file
+       if is_linux; then
+               parted $disk -s -- mklabel gpt
+               typeset -i retval=$?
+       else
+               typeset format_file=/var/tmp/format_in.$$.1
+               echo "partition" > $format_file
+               echo "modify" >> $format_file
 
-       $FORMAT -e -s -d $disk -f $format_file
-       typeset -i retval=$?
-       $RM -rf $format_file
+               format -e -s -d $disk -f $format_file
+               typeset -i retval=$?
+
+               rm -rf $format_file
+       fi
        return $retval
 }
 
@@ -84,7 +90,7 @@ log_assert "format will disallow modification of a mounted zfs disk partition"\
 
 log_onexit cleanup
 log_must default_setup_noexit $FS_DISK0
-log_must $ZPOOL add $TESTPOOL spare $FS_DISK1
+log_must zpool add $TESTPOOL spare $FS_DISK1
 
 log_note "Attempt to format a ZFS disk"
 log_mustnot mini_format $FS_DISK0
index 9e506f279a6161c2c82713a120e6943046b8b8ba..04fa30b27216f69b4eaff8a55522939c48ba987f 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -59,7 +59,7 @@ function verify_assertion #slices
        typeset targets=$1
 
        for t in $targets; do
-               $ECHO "y" | $NEWFS -v $t > /dev/null 2>&1
+               echo "y" | newfs -v $t > /dev/null 2>&1
                (( $? !=0 )) || \
                        log_fail "newfs over active pool " \
                        "unexpected return code of 0"
index 665b2c0d337c1608f4b06522c15568cea080a4a8..6d2e88d91d50de59a7dd51fc3fabfa6f48c28224 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,7 +47,7 @@ verify_runnable "global"
 function cleanup
 {
        if [[ -n $PREVDUMPDEV ]]; then
-               log_must $DUMPADM -u -d $PREVDUMPDEV
+               log_must dumpadm -u -d $PREVDUMPDEV
        fi
 
        poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1
@@ -63,7 +63,7 @@ function verify_assertion #slices
        typeset targets=$1
 
        for t in $targets; do
-               log_mustnot $DUMPADM -d $t
+               log_mustnot dumpadm -d $t
        done
 
         return 0
@@ -77,7 +77,7 @@ set -A vdevs "" "mirror" "raidz" "raidz1" "raidz2"
 
 typeset -i i=0
 
-PREVDUMPDEV=`$DUMPADM | $GREP "Dump device" | $AWK '{print $3}'`
+PREVDUMPDEV=`dumpadm | grep "Dump device" | awk '{print $3}'`
 
 unset NOINUSE_CHECK
 while (( i < ${#vdevs[*]} )); do
index 22673b7457f4b9668bd8e78ec1fa6b2b31daf93e..d4c6d0a0b2f0d3b01da933155fa4ae6407654f64 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,10 +48,10 @@ verify_runnable "global"
 function cleanup
 {
        if [[ -n $PREVDUMPDEV ]]; then
-               log_must $DUMPADM -u -d $PREVDUMPDEV
+               log_must dumpadm -u -d $PREVDUMPDEV
        fi
 
-       poolexists $TESTPOOL1 || $ZPOOL import $TESTPOOL1 >/dev/null 2>&1
+       poolexists $TESTPOOL1 || zpool import $TESTPOOL1 >/dev/null 2>&1
 
        poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1
 
@@ -66,9 +66,9 @@ function verify_assertion #slices
        typeset targets=$1
 
        for t in $targets; do
-               log_must $DUMPADM -u -d $t
+               log_must dumpadm -u -d $t
 
-               log_must $DUMPADM -u -d $PREVDUMPDEV
+               log_must dumpadm -u -d $PREVDUMPDEV
        done
 
        return 0
@@ -82,7 +82,7 @@ set -A vdevs "" "mirror" "raidz" "raidz1" "raidz2"
 
 typeset -i i=0
 
-PREVDUMPDEV=`$DUMPADM | $GREP "Dump device" | $AWK '{print $3}'`
+PREVDUMPDEV=`dumpadm | grep "Dump device" | awk '{print $3}'`
 
 while (( i < ${#vdevs[*]} )); do
 
@@ -99,9 +99,9 @@ while (( i < ${#vdevs[*]} )); do
        fi
 
        create_pool $TESTPOOL1 ${vdevs[i]} $vslices spare $sslices
-       log_must $ZPOOL export $TESTPOOL1
+       log_must zpool export $TESTPOOL1
        verify_assertion "$disktargets"
-       log_must $ZPOOL import $TESTPOOL1
+       log_must zpool import $TESTPOOL1
        destroy_pool $TESTPOOL1
 
        if [[ ( $FS_DISK0 == $FS_DISK2 ) && -n ${vdevs[i]} ]]; then
@@ -115,9 +115,9 @@ while (( i < ${#vdevs[*]} )); do
        fi
 
        create_pool $TESTPOOL1 ${vdevs[i]} $vdisks spare $sdisks
-       log_must $ZPOOL export $TESTPOOL1
+       log_must zpool export $TESTPOOL1
        verify_assertion "$disktargets"
-       log_must $ZPOOL import $TESTPOOL1
+       log_must zpool import $TESTPOOL1
        destroy_pool $TESTPOOL1
 
        (( i = i + 1 ))
index fecb68455ea87cf5486a890f021d7fd6c940a06f..5144054a976a07e4d8ccc22fb9647ead4f278d51 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,7 +47,7 @@ verify_runnable "global"
 
 function cleanup
 {
-       poolexists $TESTPOOL1 || $ZPOOL import $TESTPOOL1 >/dev/null 2>&1
+       poolexists $TESTPOOL1 || zpool import $TESTPOOL1 >/dev/null 2>&1
 
        poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1
 
@@ -62,7 +62,7 @@ function verify_assertion #slices
        typeset targets=$1
 
        for t in $targets; do
-               $ECHO "y" | $NEWFS -v $t > /dev/null 2>&1
+               echo "y" | newfs -v $t > /dev/null 2>&1
                (( $? !=0 )) && \
                        log_fail "newfs over exported pool " \
                                "failes unexpected."
@@ -93,7 +93,7 @@ while (( i < ${#vdevs[*]} )); do
        fi
 
        create_pool $TESTPOOL1 ${vdevs[i]} $vslices spare $sslices
-       log_must $ZPOOL export $TESTPOOL1
+       log_must zpool export $TESTPOOL1
        verify_assertion "$rawtargets"
        cleanup_devices $vslices $sslices
 
index c408b7028a399a313d24c840b5a1edf39d307c4b..f76913fb55cec844da1878956bead768a956b30e 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,7 +47,7 @@ verify_runnable "global"
 
 function cleanup
 {
-       poolexists $TESTPOOL1 || $ZPOOL import $TESTPOOL1 >/dev/null 2>&1
+       poolexists $TESTPOOL1 || zpool import $TESTPOOL1 >/dev/null 2>&1
 
        poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1
 
@@ -91,7 +91,7 @@ while (( i < ${#vdevs[*]} )); do
        fi
 
        create_pool $TESTPOOL1 ${vdevs[i]} $vslices spare $sslices
-       log_must $ZPOOL export $TESTPOOL1
+       log_must zpool export $TESTPOOL1
        verify_assertion "$vdisks $sdisks"
 
        if [[ ( $FS_DISK0 == $FS_DISK2 ) && -n ${vdevs[i]} ]]; then
@@ -105,7 +105,7 @@ while (( i < ${#vdevs[*]} )); do
        fi
 
        create_pool $TESTPOOL1 ${vdevs[i]} $vdisks spare $sdisks
-       log_must $ZPOOL export $TESTPOOL1
+       log_must zpool export $TESTPOOL1
        verify_assertion "$vdisks $sdisks"
 
        (( i = i + 1 ))
index b973d6ee9c124741a9e2048bb83d78d9f665652e..3be20356ea0ee7ab1707ac829212a6b5795de403 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,6 +48,6 @@ verify_runnable "both"
 log_assert "Write a file to the allowable ZFS fs size."
 
 log_note "Invoke 'largest_file' with $TESTDIR/bigfile"
-log_must $LARGEST_FILE $TESTDIR/bigfile
+log_must largest_file $TESTDIR/bigfile
 
 log_pass "Successfully created a file to the maximum allowable size."
index 152fe2e081210206e9ec3b4fdb65520cca2e9049..f4d4e5afbbc2f98ed0da6ddaebc39b5ad2578b0c 100755 (executable)
@@ -43,13 +43,13 @@ log_assert "Verify 'ulimit -f' maximum file size is enforced"
 # Verify 'ulimit -f unlimited' works
 log_must ulimit -f unlimited
 log_must sh -c 'dd if=/dev/zero of=$TESTDIR/ulimit_write_file bs=1M count=2'
-log_must sh -c '$TRUNCATE -s2M $TESTDIR/ulimit_trunc_file'
-log_must $RM $TESTDIR/ulimit_write_file $TESTDIR/ulimit_trunc_file
+log_must sh -c 'truncate -s2M $TESTDIR/ulimit_trunc_file'
+log_must rm $TESTDIR/ulimit_write_file $TESTDIR/ulimit_trunc_file
 
 # Verify 'ulimit -f <size>' works
 log_must ulimit -f 1024
 log_mustnot sh -c 'dd if=/dev/zero of=$TESTDIR/ulimit_write_file bs=1M count=2'
-log_mustnot sh -c '$TRUNCATE -s2M $TESTDIR/ulimit_trunc_file'
-log_must $RM $TESTDIR/ulimit_write_file $TESTDIR/ulimit_trunc_file
+log_mustnot sh -c 'truncate -s2M $TESTDIR/ulimit_trunc_file'
+log_must rm $TESTDIR/ulimit_write_file $TESTDIR/ulimit_trunc_file
 
 log_pass "Successfully enforced 'ulimit -f' maximum file size"
index 14765b8db3fceee617e6126c41825fec0bdd3c0a..4b25cf6163b45daeee28351b6286db4f6bf792e2 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -57,7 +57,7 @@ verify_runnable "global"
 #
 function parse_expected_output
 {
-       UNITS=`$ECHO $1 | $SED -e 's/^\([0-9].*\)\([a-z].\)/\2/'`
+       UNITS=`echo $1 | sed -e 's/^\([0-9].*\)\([a-z].\)/\2/'`
        case "$UNITS" in
                'mb') CHKUNIT="M" ;;
                'gb') CHKUNIT="G" ;;
@@ -68,14 +68,14 @@ function parse_expected_output
        esac
 
        log_note "Detect zpool $TESTPOOL in this test machine."
-       log_must eval "$ZPOOL list $TESTPOOL > /tmp/j.$$"
-       log_must eval "$GREP $TESTPOOL /tmp/j.$$ | \
-               $AWK '{print $2}' | $GREP $CHKUNIT"
+       log_must eval "zpool list $TESTPOOL > /tmp/j.$$"
+       log_must eval "grep $TESTPOOL /tmp/j.$$ | \
+               awk '{print $2}' | grep $CHKUNIT"
 
        log_note "Detect the file system in this test machine."
-       log_must eval "$DF -F zfs -h > /tmp/j.$$"
-       log_must eval "$GREP $TESTPOOL /tmp/j.$$ | \
-               $AWK '{print $2}' | $GREP $CHKUNIT"
+       log_must eval "df -F zfs -h > /tmp/j.$$"
+       log_must eval "grep $TESTPOOL /tmp/j.$$ | \
+               awk '{print $2}' | grep $CHKUNIT"
 
        return 0
 }
@@ -89,19 +89,19 @@ function cleanup
 
        if datasetexists $TESTPOOL/$TESTFS ; then
                if ismounted $TESTPOOL/$TESTFS ; then
-                       log_must $ZFS unmount $TESTPOOL/$TESTFS
+                       log_must zfs unmount $TESTPOOL/$TESTFS
                fi
-               log_must $ZFS destroy $TESTPOOL/$TESTFS
+               log_must zfs destroy $TESTPOOL/$TESTFS
        fi
 
        destroy_pool $TESTPOOL
 
        datasetexists $TESTPOOL2/$TESTVOL && \
-               log_must $ZFS destroy $TESTPOOL2/$TESTVOL
+               log_must zfs destroy $TESTPOOL2/$TESTVOL
 
        destroy_pool $TESTPOOL2
 
-       $RM -f /tmp/j.* > /dev/null
+       rm -f /tmp/j.* > /dev/null
 }
 
 log_assert "The largest pool can be created and a dataset in that" \
@@ -123,7 +123,7 @@ for volsize in $VOLSIZES; do
        create_pool $TESTPOOL2 "$DISKS"
 
        log_note "Create a volume device of desired sizes: $volsize"
-       str=$($ZFS create -sV $volsize $TESTPOOL2/$TESTVOL 2>&1)
+       str=$(zfs create -sV $volsize $TESTPOOL2/$TESTVOL 2>&1)
        ret=$?
        if (( ret != 0 )); then
                if [[ is_32bit && \
@@ -134,7 +134,7 @@ for volsize in $VOLSIZES; do
                        log_unsupported \
                                "Max volume size is 1TB on 32-bit systems."
                else
-                       log_fail "$ZFS create -sV $volsize $TESTPOOL2/$TESTVOL"
+                       log_fail "zfs create -sV $volsize $TESTPOOL2/$TESTVOL"
                fi
        fi
 
@@ -142,18 +142,18 @@ for volsize in $VOLSIZES; do
        create_pool $TESTPOOL "$VOL_PATH"
 
        log_note "Create a zfs file system in the largest pool"
-       log_must $ZFS create $TESTPOOL/$TESTFS
+       log_must zfs create $TESTPOOL/$TESTFS
 
        log_note "Parse the execution result"
        parse_expected_output $volsize
 
        log_note "unmount this zfs file system $TESTPOOL/$TESTFS"
-       log_must $ZFS unmount $TESTPOOL/$TESTFS
+       log_must zfs unmount $TESTPOOL/$TESTFS
 
        log_note "Destroy zfs, volume & zpool"
-       log_must $ZFS destroy $TESTPOOL/$TESTFS
+       log_must zfs destroy $TESTPOOL/$TESTFS
        destroy_pool $TESTPOOL
-       log_must $ZFS destroy $TESTPOOL2/$TESTVOL
+       log_must zfs destroy $TESTPOOL2/$TESTVOL
        destroy_pool $TESTPOOL2
 done
 
index 53e89ae3f08d1983af2b50931e1d7149243b1205..71e617ecf5e1393df43b6aa8792f8644057c1a47 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,38 +52,38 @@ export NUMFILES=10000
 # Detect and make sure this test must be executed on a multi-process system
 is_mp || log_fail "This test requires a multi-processor system."
 
-log_must $MKDIR -p ${TESTDIR}/tmp
+log_must mkdir -p ${TESTDIR}/tmp
 
 typeset -i i=0
 while [ $i -lt $NUMFILES ]; do
         (( i = i + 1 ))
-        $TOUCH ${TESTDIR}/tmp/x$i > /dev/null 2>&1
+        touch ${TESTDIR}/tmp/x$i > /dev/null 2>&1
 done
 
 sleep 3
 
-$RM -f ${TESTDIR}/tmp/x* >/dev/null 2>&1
+rm -f ${TESTDIR}/tmp/x* >/dev/null 2>&1
 
-$RM_LNKCNT_ZERO_FILE ${TESTDIR}/tmp/test$$ > /dev/null 2>&1 &
+rm_lnkcnt_zero_file ${TESTDIR}/tmp/test$$ > /dev/null 2>&1 &
 PID=$!
-log_note "$RM_LNKCNT_ZERO_FILE ${TESTDIR}/tmp/test$$ pid: $PID"
+log_note "rm_lnkcnt_zero_file ${TESTDIR}/tmp/test$$ pid: $PID"
 
 i=0
 while [ $i -lt $ITERS ]; do
-       if ! $PGREP $RM_LNKCNT_ZERO_FILE > /dev/null ; then
-               log_note "$RM_LNKCNT_ZERO_FILE completes"
+       if ! pgrep rm_lnkcnt_zero_file > /dev/null ; then
+               log_note "rm_lnkcnt_zero_file completes"
                break
        fi
-       log_must $SLEEP 10
+       log_must sleep 10
        (( i = i + 1 ))
 done
 
-if $PGREP $RM_LNKCNT_ZERO_FILE > /dev/null; then
-       log_must $KILL -TERM $PID
+if pgrep rm_lnkcnt_zero_file > /dev/null; then
+       log_must kill -TERM $PID
        log_fail "file link count is zero"
 fi
 
-log_must $KILL -TERM $PID
-log_must $RM -f ${TESTDIR}/tmp/test$$*
+log_must kill -TERM $PID
+log_must rm -f ${TESTDIR}/tmp/test$$*
 
 log_pass "Verify file link count is zero on zfs"
index 0b6efce6aba2c8973494c9482521d57db4ee7b20..1a1f3f42731e237baf5cc91f9e0d0049673bcb9c 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 verify_runnable "global"
 
 ismounted $NONZFS_TESTDIR $NEWFS_DEFAULT_FS
-(( $? == 0 )) && log_must $UMOUNT -f $NONZFS_TESTDIR
+(( $? == 0 )) && log_must umount -f $NONZFS_TESTDIR
 
 ismounted $TESTPOOL/$TESTFS
-[[ $? == 0 ]] && log_must $ZFS umount -f $TESTDIR
+[[ $? == 0 ]] && log_must zfs umount -f $TESTDIR
 destroy_pool $TESTPOOL
 
 DISK=${DISKS%% *}
index 340288025ee47e11de5aa4977016c6b41016bcd1..7d8643670976e7ed4bbb09a818ab9e22b684a39c 100644 (file)
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 
 export DISKSARRAY=$DISKS
-export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
+export DISK_ARRAY_NUM=$(echo ${DISKS} | nawk '{print NF}')
 set -A disk_array $(find_disks $DISKS)
 case "${#disk_array[*]}" in
 0)
@@ -49,7 +49,7 @@ case "${#disk_array[*]}" in
                else
                        export DEV_DSKDIR=$DEV_RDSKDIR
                fi
-               if ( is_mpath_device $ZFS_DISK ) && [[ -z $($ECHO $ZFS_DISK | awk 'substr($1,18,1)\
+               if ( is_mpath_device $ZFS_DISK ) && [[ -z $(echo $ZFS_DISK | awk 'substr($1,18,1)\
                    ~ /^[[:digit:]]+$/') ]] || ( is_real_device $ZFS_DISK ); then
                        ZFSSIDE_DISK=${SINGLE_DISK}1
                        NONZFSSIDE_DISK=${SINGLE_DISK}2
@@ -76,7 +76,7 @@ case "${#disk_array[*]}" in
                else
                        export DEV_DSKDIR=$DEV_RDSKDIR
                fi
-               if ( is_mpath_device $ZFS_DISK ) && [[ -z $($ECHO $ZFS_DISK | awk 'substr($1,18,1)\
+               if ( is_mpath_device $ZFS_DISK ) && [[ -z $(echo $ZFS_DISK | awk 'substr($1,18,1)\
                    ~ /^[[:digit:]]+$/') ]] || ( is_real_device $ZFS_DISK ); then
                        ZFSSIDE_DISK=${ZFS_DISK}1
                elif ( is_mpath_device $ZFS_DISK || is_loop_device $ZFS_DISK ); then
@@ -84,7 +84,7 @@ case "${#disk_array[*]}" in
                else
                        log_fail "$ZFS_DISK not supported for partitioning."
                fi
-               if ( is_mpath_device $NONZFS_DISK ) && [[ -z $($ECHO $NONZFS_DISK | awk 'substr($1,18,1)\
+               if ( is_mpath_device $NONZFS_DISK ) && [[ -z $(echo $NONZFS_DISK | awk 'substr($1,18,1)\
                    ~ /^[[:digit:]]+$/') ]] || ( is_real_device $NONZFS_DISK ); then
                        NONZFSSIDE_DISK=${NONZFS_DISK}1
                elif ( is_mpath_device $NONZFS_DISK || is_loop_device $NONZFS_DISK ); then
@@ -104,9 +104,9 @@ export DISK_COUNT ZFS_DISK NONZFS_DISK SINGLE_DISK ZFSSIDE_DISK NONZFSSIDE_DISK
 
 export TESTFILE=/etc/passwd
 export NONZFS_TESTDIR=$TESTDIR/nonzfstestdir
-tmp=`$SUM $TESTFILE`
-export SUMA=`$ECHO $tmp | $AWK '{print $1}'`
-export SUMB=`$ECHO $tmp | $AWK '{print $2}'`
+tmp=`sum $TESTFILE`
+export SUMA=`echo $tmp | awk '{print $1}'`
+export SUMB=`echo $tmp | awk '{print $2}'`
 export FS_SIZE=1g
-export BNAME=`$BASENAME $TESTFILE`
-export DNAME=`$DIRNAME $TESTFILE`
+export BNAME=`basename $TESTFILE`
+export DNAME=`dirname $TESTFILE`
index e0799afd1b3dadc29e18b713412024f33fe88f20..a2b4ed99b11e76ec2ccf5f320b7da0584cf2ac94 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/migration/migration.cfg
@@ -43,7 +43,7 @@
 #      srcdir: is the directory where the testfile is
 #      cmd:    is the command to be executed.
 #              E.g.
-#              $TAR cf $TESTDIR/tar$$.tar
+#              tar cf $TESTDIR/tar$$.tar
 #
 function prepare #srcdir cmd
 {
@@ -82,7 +82,7 @@ function prepare #srcdir cmd
 #      oldsumb: is the second part of the values returned by sum
 #      cmd: is the command to be executed;
 #              E.g.
-#              "$TAR xf $TESTDIR/tar$$.tar"
+#              "tar xf $TESTDIR/tar$$.tar"
 #
 function migrate #destdir oldsuma oldsumb cmd
 {
@@ -99,17 +99,17 @@ function migrate #destdir oldsuma oldsumb cmd
        $cmd
        (( $? != 0 )) && return 1
 
-       sumy=`$SUM ./$BNAME`
-       suma=`$ECHO $sumy | $AWK '{print $1}'`
-       sumb=`$ECHO $sumy | $AWK '{print $2}'`
+       sumy=`sum ./$BNAME`
+       suma=`echo $sumy | awk '{print $1}'`
+       sumb=`echo $sumy | awk '{print $2}'`
 
        if (( $oldsuma != $suma )); then
-               log_note "$SUM values are not the same"
+               log_note "sum values are not the same"
                retval=1
        fi
 
        if (( $oldsumb != $sumb )); then
-               log_note "$SUM values are not the same"
+               log_note "sum values are not the same"
                retval=1
        fi
 
@@ -130,20 +130,20 @@ function migrate_cpio
        cd $destdir
        (( $? != 0 )) && return 1
 
-       $CPIO -iv < $archive
+       cpio -iv < $archive
        (( $? != 0 )) && return 1
 
-       sumy=`$SUM ./$BNAME`
-       suma=`$ECHO $sumy | $AWK '{print $1}'`
-       sumb=`$ECHO $sumy | $AWK '{print $2}'`
+       sumy=`sum ./$BNAME`
+       suma=`echo $sumy | awk '{print $1}'`
+       sumb=`echo $sumy | awk '{print $2}'`
 
        if (( $oldsuma != $suma )); then
-               log_note "$SUM values are not the same"
+               log_note "sum values are not the same"
                retval=1
        fi
 
        if (( $oldsumb != $sumb )); then
-               log_note "$SUM values are not the same"
+               log_note "sum values are not the same"
                retval=1
        fi
 
index 5286461bd24d932320f4ed836db4309e5a82d914..4d5fbb9ff5ed729b31fa8853ee94d35809228778 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,18 +48,18 @@ verify_runnable "both"
 
 function cleanup
 {
-       $RM -rf $TESTDIR/tar$$.tar
-       $RM -rf $TESTDIR/$BNAME
+       rm -rf $TESTDIR/tar$$.tar
+       rm -rf $TESTDIR/$BNAME
 }
 
 log_assert "Migrating test file from ZFS fs to ZFS fs using tar"
 
 log_onexit cleanup
 
-prepare $DNAME "$TAR cf $TESTDIR/tar$$.tar $BNAME"
+prepare $DNAME "tar cf $TESTDIR/tar$$.tar $BNAME"
 (( $? != 0 )) && log_fail "Unable to create src archive"
 
-migrate $TESTDIR $SUMA $SUMB "$TAR xf $TESTDIR/tar$$.tar"
+migrate $TESTDIR $SUMA $SUMB "tar xf $TESTDIR/tar$$.tar"
 (( $? != 0 )) && log_fail "Uable to successfully migrate test file from" \
     "ZFS fs to ZFS fs"
 
index 54fbc049b6c9baad0e482782a2edd186291c4d71..e0655248dee5a3507a498c728011558350788959 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,18 +48,18 @@ verify_runnable "both"
 
 function cleanup
 {
-       $RM -rf $TESTDIR/tar$$.tar
-       $RM -rf $NONZFS_TESTDIR/$BNAME
+       rm -rf $TESTDIR/tar$$.tar
+       rm -rf $NONZFS_TESTDIR/$BNAME
 }
 
 log_assert "Migrating test file from ZFS fs to UFS fs using tar"
 
 log_onexit cleanup
 
-prepare $DNAME "$TAR cf $TESTDIR/tar$$.tar $BNAME"
+prepare $DNAME "tar cf $TESTDIR/tar$$.tar $BNAME"
 (( $? != 0 )) && log_fail "Unable to create src archive"
 
-migrate $NONZFS_TESTDIR $SUMA $SUMB "$TAR xf $TESTDIR/tar$$.tar"
+migrate $NONZFS_TESTDIR $SUMA $SUMB "tar xf $TESTDIR/tar$$.tar"
 (( $? != 0 )) && log_fail "Uable to successfully migrate test file from" \
     "ZFS fs to UFS fs"
 
index c8d67c12ebd376b78ae5c0cc20711675c5629360..904a2b1a0427fda5526cbe67602be2876e3180fc 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,18 +48,18 @@ verify_runnable "both"
 
 function cleanup
 {
-       $RM -rf $NONZFS_TESTDIR/tar$$.tar
-       $RM -rf $TESTDIR/$BNAME
+       rm -rf $NONZFS_TESTDIR/tar$$.tar
+       rm -rf $TESTDIR/$BNAME
 }
 
 log_assert "Migrating test file from UFS fs to ZFS fs using tar"
 
 log_onexit cleanup
 
-prepare $DNAME "$TAR cf $NONZFS_TESTDIR/tar$$.tar $BNAME"
+prepare $DNAME "tar cf $NONZFS_TESTDIR/tar$$.tar $BNAME"
 (( $? != 0 )) && log_fail "Unable to create src archive"
 
-migrate $TESTDIR $SUMA $SUMB "$TAR xvf $NONZFS_TESTDIR/tar$$.tar"
+migrate $TESTDIR $SUMA $SUMB "tar xvf $NONZFS_TESTDIR/tar$$.tar"
 (( $? != 0 )) && log_fail "Uable to successfully migrate test file from" \
     "UFS fs to ZFS fs"
 
index 81b822da610aa73f7885dee5a015dc0a09e8c53b..6d33dd5b321c689e4f19b9a7f6b7fae0b3a65e7d 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,8 +48,8 @@ verify_runnable "both"
 
 function cleanup
 {
-       $RM -rf $TESTDIR/cpio$$.cpio
-       $RM -rf $TESTDIR/$BNAME
+       rm -rf $TESTDIR/cpio$$.cpio
+       rm -rf $TESTDIR/$BNAME
 }
 
 log_assert "Migrating test file from ZFS fs to ZFS fs using cpio"
@@ -60,7 +60,7 @@ cwd=$PWD
 cd $DNAME
 (( $? != 0 )) && log_untested "Could not change directory to $DNAME"
 
-$LS $BNAME | $CPIO -oc > $TESTDIR/cpio$$.cpio
+ls $BNAME | cpio -oc > $TESTDIR/cpio$$.cpio
 (( $? != 0 )) && log_fail "Unable to create cpio archive"
 
 cd $cwd
index 95ca47a2421472ca98e60d2bf2dc8a762b2c15cd..a41b19b5fa08a4c4c20dbb31e7f2b0b8c96d3720 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,8 +48,8 @@ verify_runnable "both"
 
 function cleanup
 {
-       $RM -rf $TESTDIR/cpio$$.cpio
-       $RM -rf $NONZFS_TESTDIR/$BNAME
+       rm -rf $TESTDIR/cpio$$.cpio
+       rm -rf $NONZFS_TESTDIR/$BNAME
 }
 
 log_assert "Migrating test file from ZFS fs to uFS fs using cpio"
@@ -60,7 +60,7 @@ cwd=$PWD
 cd $DNAME
 (( $? != 0 )) && log_untested "Could not change directory to $DNAME"
 
-$LS $BNAME | $CPIO -oc > $TESTDIR/cpio$$.cpio
+ls $BNAME | cpio -oc > $TESTDIR/cpio$$.cpio
 (( $? != 0 )) && log_fail "Unable to create cpio archive"
 
 cd $cwd
index d88947987e2b661d5cfe5dc16c180d5641216692..5b444421a323baa57ad43ab6797b8bab3e27be07 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,8 +48,8 @@ verify_runnable "both"
 
 function cleanup
 {
-       $RM -rf $NONZFS_TESTDIR/cpio$$.cpio
-       $RM -rf $TESTDIR/$BNAME
+       rm -rf $NONZFS_TESTDIR/cpio$$.cpio
+       rm -rf $TESTDIR/$BNAME
 }
 
 log_assert "Migrating test file from UFS fs to ZFS fs using cpio"
@@ -60,7 +60,7 @@ cwd=$PWD
 cd $DNAME
 (( $? != 0 )) && log_untested "Could not change directory to $DNAME"
 
-$LS $BNAME | $CPIO -oc > $NONZFS_TESTDIR/cpio$$.cpio
+ls $BNAME | cpio -oc > $NONZFS_TESTDIR/cpio$$.cpio
 (( $? != 0 )) && log_fail "Unable to create cpio archive"
 
 cd $cwd
index ee0927b9125d5cf6a60084eb98253182ae7ccec7..c3197052ce08de9b4c9ba7de983b3a31327ea513 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,18 +48,18 @@ verify_runnable "both"
 
 function cleanup
 {
-       $RM -rf $TESTDIR/dd$$.dd
-       $RM -rf $TESTDIR/$BNAME
+       rm -rf $TESTDIR/dd$$.dd
+       rm -rf $TESTDIR/$BNAME
 }
 
 log_assert "Migrating test file from ZFS fs to ZFS fs using dd"
 
 log_onexit cleanup
 
-prepare $DNAME "$DD if=$BNAME obs=128k of=$TESTDIR/dd$$.dd"
+prepare $DNAME "dd if=$BNAME obs=128k of=$TESTDIR/dd$$.dd"
 (( $? != 0 )) && log_fail "Unable to create src archive"
 
-migrate $TESTDIR $SUMA $SUMB "$DD if=$TESTDIR/dd$$.dd obs=128k of=$BNAME"
+migrate $TESTDIR $SUMA $SUMB "dd if=$TESTDIR/dd$$.dd obs=128k of=$BNAME"
 (( $? != 0 )) && log_fail "Uable to successfully migrate test file from" \
     "ZFS fs to ZFS fs"
 
index 92d2a45891ae30441decda63476dbdb5f368f433..2e51eef369b3aaae479c721affb0c4db7de8084f 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,18 +48,18 @@ verify_runnable "both"
 
 function cleanup
 {
-       $RM -rf $TESTDIR/dd$$.dd
-       $RM -rf $NONZFS_TESTDIR/$BNAME
+       rm -rf $TESTDIR/dd$$.dd
+       rm -rf $NONZFS_TESTDIR/$BNAME
 }
 
 log_assert "Migrating test file from ZFS fs to UFS fs using dd"
 
 log_onexit cleanup
 
-prepare $DNAME "$DD if=$BNAME obs=128k of=$TESTDIR/dd$$.dd"
+prepare $DNAME "dd if=$BNAME obs=128k of=$TESTDIR/dd$$.dd"
 (( $? != 0 )) && log_fail "Unable to create src archive"
 
-migrate $NONZFS_TESTDIR $SUMA $SUMB "$DD if=$TESTDIR/dd$$.dd obs=128k of=$BNAME"
+migrate $NONZFS_TESTDIR $SUMA $SUMB "dd if=$TESTDIR/dd$$.dd obs=128k of=$BNAME"
 (( $? != 0 )) && log_fail "Uable to successfully migrate test file from" \
     "ZFS fs to ZFS fs"
 
index 317eefdca04f65f0c71960838f9c7407f01cb82a..7749494e58e487e7e1541940f9059a4052e8c424 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,18 +48,18 @@ verify_runnable "both"
 
 function cleanup
 {
-       $RM -rf $TESTDIR/dd$$.dd
-       $RM -rf $NONZFS_TESTDIR/$BNAME
+       rm -rf $TESTDIR/dd$$.dd
+       rm -rf $NONZFS_TESTDIR/$BNAME
 }
 
 log_assert "Migrating test file from UFS fs to ZFS fs using dd"
 
 log_onexit cleanup
 
-prepare $DNAME "$DD if=$BNAME obs=128k of=$NONZFS_TESTDIR/dd$$.dd"
+prepare $DNAME "dd if=$BNAME obs=128k of=$NONZFS_TESTDIR/dd$$.dd"
 (( $? != 0 )) && log_fail "Unable to create src archive"
 
-migrate $TESTDIR $SUMA $SUMB "$DD if=$NONZFS_TESTDIR/dd$$.dd obs=128k of=$BNAME"
+migrate $TESTDIR $SUMA $SUMB "dd if=$NONZFS_TESTDIR/dd$$.dd obs=128k of=$BNAME"
 (( $? != 0 )) && log_fail "Uable to successfully migrate test file from" \
     "ZFS fs to ZFS fs"
 
index 462bfb1580f2d9c536bc1a6ab5217b22c5e76e15..a11ab72dff17a1fec2611e53607da27cbc8e3ba3 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,18 +48,18 @@ verify_runnable "both"
 
 function cleanup
 {
-       $RM -rf $TESTDIR/cp$$.cp
-       $RM -rf $TESTDIR/$BNAME
+       rm -rf $TESTDIR/cp$$.cp
+       rm -rf $TESTDIR/$BNAME
 }
 
 log_assert "Migrating test file from ZFS fs to ZFS fs using cp"
 
 log_onexit cleanup
 
-prepare $DNAME "$CP $BNAME $TESTDIR/cp$$.cp"
+prepare $DNAME "cp $BNAME $TESTDIR/cp$$.cp"
 (( $? != 0 )) && log_fail "Unable to create src archive"
 
-migrate $TESTDIR $SUMA $SUMB "$CP $TESTDIR/cp$$.cp $BNAME"
+migrate $TESTDIR $SUMA $SUMB "cp $TESTDIR/cp$$.cp $BNAME"
 (( $? != 0 )) && log_fail "Uable to successfully migrate test file from" \
     "ZFS fs to ZFS fs"
 
index 2fcd291fcf8f22fa38b59909b97ca307f81f239b..17e1c78f987b9ce012e89f1e9b86c8203bed5f69 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,18 +48,18 @@ verify_runnable "both"
 
 function cleanup
 {
-       $RM -rf $NONZFS_TESTDIR/cp$$.cp
-       $RM -rf $TESTDIR/$BNAME
+       rm -rf $NONZFS_TESTDIR/cp$$.cp
+       rm -rf $TESTDIR/$BNAME
 }
 
 log_assert "Migrating test file from ZFS fs to UFS fs using cp"
 
 log_onexit cleanup
 
-prepare $DNAME "$CP $BNAME $TESTDIR/cp$$.cp"
+prepare $DNAME "cp $BNAME $TESTDIR/cp$$.cp"
 (( $? != 0 )) && log_fail "Unable to create src archive"
 
-migrate $NONZFS_TESTDIR $SUMA $SUMB "$CP $TESTDIR/cp$$.cp $BNAME"
+migrate $NONZFS_TESTDIR $SUMA $SUMB "cp $TESTDIR/cp$$.cp $BNAME"
 (( $? != 0 )) && log_fail "Uable to successfully migrate test file from" \
     "ZFS fs to UFS fs"
 
index 427467e58381230e2a317f4db526251ca0af0450..823dabeae4b57490aa58b6e8d4ac09a712466757 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,18 +48,18 @@ verify_runnable "both"
 
 function cleanup
 {
-       $RM -rf $TESTDIR/cp$$.cp
-       $RM -rf $NONZFS_TESTDIR/$BNAME
+       rm -rf $TESTDIR/cp$$.cp
+       rm -rf $NONZFS_TESTDIR/$BNAME
 }
 
 log_assert "Migrating test file from UFS fs to ZFS fs using cp"
 
 log_onexit cleanup
 
-prepare $DNAME "$CP $BNAME $NONZFS_TESTDIR/cp$$.cp"
+prepare $DNAME "cp $BNAME $NONZFS_TESTDIR/cp$$.cp"
 (( $? != 0 )) && log_fail "Unable to create src archive"
 
-migrate $TESTDIR $SUMA $SUMB "$CP $NONZFS_TESTDIR/cp$$.cp $BNAME"
+migrate $TESTDIR $SUMA $SUMB "cp $NONZFS_TESTDIR/cp$$.cp $BNAME"
 (( $? != 0 )) && log_fail "Uable to successfully migrate test file from" \
     "UFS fs to ZFS fs"
 
index b923256e0782c88bcadba9280af22261d4a60f1e..cae66aa5b1c75d4f5e6aca818a3281022de5b3af 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,19 +48,19 @@ esac
 
 create_pool $TESTPOOL "$ZFS_DISK"
 
-$RM -rf $TESTDIR  || log_unresolved Could not remove $TESTDIR
-$MKDIR -p $TESTDIR || log_unresolved Could not create $TESTDIR
+rm -rf $TESTDIR  || log_unresolved Could not remove $TESTDIR
+mkdir -p $TESTDIR || log_unresolved Could not create $TESTDIR
 
-log_must $ZFS create $TESTPOOL/$TESTFS
-log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+log_must zfs create $TESTPOOL/$TESTFS
+log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 
-$RM -rf $NONZFS_TESTDIR  || log_unresolved Could not remove $NONZFS_TESTDIR
-$MKDIR -p $NONZFS_TESTDIR || log_unresolved Could not create $NONZFS_TESTDIR
+rm -rf $NONZFS_TESTDIR  || log_unresolved Could not remove $NONZFS_TESTDIR
+mkdir -p $NONZFS_TESTDIR || log_unresolved Could not create $NONZFS_TESTDIR
 
-$ECHO "y" | $NEWFS -v ${DEV_DSKDIR}/$NONZFS_DISK
+echo "y" | newfs -v ${DEV_DSKDIR}/$NONZFS_DISK
 (( $? != 0 )) &&
        log_untested "Unable to setup a UFS file system"
 
-log_must $MOUNT ${DEV_DSKDIR}/$NONZFS_DISK $NONZFS_TESTDIR
+log_must mount ${DEV_DSKDIR}/$NONZFS_DISK $NONZFS_TESTDIR
 
 log_pass
index 36bcaa802fd8bb603acb963707865130a3611860..42e1f73202c4b3d26d316ee8f5f29d9196967fb6 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,9 +47,9 @@ verify_runnable "global"
 
 log_assert "read()s from mmap()'ed file contain correct data."
 
-log_must $CHMOD 777 $TESTDIR
-log_must $READMMAP $TESTDIR/test-read-file
-log_must $ZFS unmount $TESTPOOL/$TESTFS
+log_must chmod 777 $TESTDIR
+log_must readmmap $TESTDIR/test-read-file
+log_must zfs unmount $TESTPOOL/$TESTFS
 
 typeset dir=$(get_device_dir $DISKS)
 verify_filesys "$TESTPOOL" "$TESTPOOL/$TESTFS" "$dir"
index 6bede53bf780010009af09d89176d8e179b3b8f6..f65a4c1c4a4d84007978d5810e4d573240ada4ed 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -50,13 +50,13 @@ log_assert "write()s to a file and mmap() that file at the same time does not "\
 # Detect and make sure this test must be executed on a multi-process system
 is_mp || log_fail "This test requires a multi-processor system."
 
-log_must $CHMOD 777 $TESTDIR
-$MMAPWRITE $TESTDIR/test-write-file &
+log_must chmod 777 $TESTDIR
+mmapwrite $TESTDIR/test-write-file &
 PID_MMAPWRITE=$!
-log_note "$MMAPWRITE $TESTDIR/test-write-file pid: $PID_MMAPWRITE"
-log_must $SLEEP 30
+log_note "mmapwrite $TESTDIR/test-write-file pid: $PID_MMAPWRITE"
+log_must sleep 30
 
-log_must $KILL -9 $PID_MMAPWRITE
-log_must $LS -l $TESTDIR/test-write-file
+log_must kill -9 $PID_MMAPWRITE
+log_must ls -l $TESTDIR/test-write-file
 
 log_pass "write(2) a mmap(2)'ing file succeeded."
index 36ff7c07c47ef2678cb61d1428558b79d06caa96..f20c72841f4203f80bd428afabdf4ec0b2ff3ed6 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -34,5 +34,5 @@
 log_must destroy_pool $TESTPOOL
 
 for dir in $TESTDIRS; do
-       $RM -rf $dir
+       rm -rf $dir
 done
index 7255e7d98b6de1b01174e300a991e9dd53225aa0..8e2edcd24f4b22fe04818ae51503e6128a473bf3 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -38,9 +38,9 @@ for i in 1 2 3; do
        dir=$TESTDIR.$i
        fs=$TESTPOOL/$TESTFS.$i
 
-       log_must $ZFS create $fs
-       log_must $MKDIR -p $dir
-       log_must $ZFS set mountpoint=$dir $fs
+       log_must zfs create $fs
+       log_must mkdir -p $dir
+       log_must zfs set mountpoint=$dir $fs
 
        log_must mounted $fs
 done
index 55b46ff88f055f44470d56eedc19dc3a04f4e101..ec4954569961f70c0571419df42346adba445637 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,9 +45,9 @@
 
 for fs in 1 2 3; do
        log_must mounted $TESTDIR.$fs
-       log_must $ZFS umount $TESTPOOL/$TESTFS.$fs
+       log_must zfs umount $TESTPOOL/$TESTFS.$fs
        log_must unmounted $TESTDIR.$fs
-       log_must $ZFS mount $TESTPOOL/$TESTFS.$fs
+       log_must zfs mount $TESTPOOL/$TESTFS.$fs
        log_must mounted $TESTDIR.$fs
 done
 
index 6b075427e7db427ceeff844518da45a771156cb8..b5dc01e9bd05c5ccb2d92034ac073dd9adb70e89 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -32,7 +32,7 @@
 # 3. Run umountall -n and verify the file systems it reports are in the list.
 #
 
-log_must $ZFS mount -a
+log_must zfs mount -a
 for fs in 1 2 3 ; do
        log_must mounted $TESTPOOL/$TESTFS.$fs
 done
@@ -43,12 +43,12 @@ done
 zfs_list="/ /lib /sbin /tmp /usr /var /var/adm /var/run"
 
 # Append our ZFS filesystems to the list, not worrying about duplicates.
-for fs in $($MOUNT -p | $AWK '{if ($4 == "zfs") print $3}'); do
+for fs in $(mount -p | awk '{if ($4 == "zfs") print $3}'); do
        zfs_list="$zfs_list $fs"
 done
 
 fs=''
-for fs in $($UMOUNTALL -n -F zfs 2>&1 | $AWK '{print $2}'); do
+for fs in $(umountall -n -F zfs 2>&1 | awk '{print $2}'); do
        for i in $zfs_list; do
                [[ $fs = $i ]] && continue 2
        done
index ecec91fcd2249727340f2f3ac9a96ef61dee7b8d..13322cb30888cc326628c0560b3be3059d4fdb58 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 verify_runnable "global"
 
 [[ -f /var/tmp/exitsZero.ksh ]] && \
-       log_must $RM -f /var/tmp/exitsZero.ksh
+       log_must rm -f /var/tmp/exitsZero.ksh
 [[ -f /var/tmp/testbackgprocs.ksh ]] && \
-       log_must $RM -f /var/tmp/testbackgprocs.ksh
+       log_must rm -f /var/tmp/testbackgprocs.ksh
 
 ismounted $TESTPOOL/$TESTFS_TGT
-(( $? == 0 )) && log_must $ZFS umount $TESTPOOL/$TESTFS_TGT
-log_must $ZFS destroy $TESTPOOL/$TESTFS_TGT
+(( $? == 0 )) && log_must zfs umount $TESTPOOL/$TESTFS_TGT
+log_must zfs destroy $TESTPOOL/$TESTFS_TGT
 
-[[ -d $TESTDIR_TGT ]] && log_must $RM -rf $TESTDIR_TGT
+[[ -d $TESTDIR_TGT ]] && log_must rm -rf $TESTDIR_TGT
 
 default_cleanup
index e0c416638620c7a302dd5d9e9f6613f2810890e0..ac81bd3608024b1a5e74195f9f3897440c23cce0 100644 (file)
@@ -30,7 +30,7 @@
 
 export DISK=${DISKS%% *}
 export DISKSARRAY=$DISKS
-export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
+export DISK_ARRAY_NUM=$(echo ${DISKS} | nawk '{print NF}')
 set_device_dir
 
 export TESTFILE=testfile
index 834ee3b6bb2baf6c29d13b1bc740dc068355d77d..4ea5e3db388931d280446a1750fbcc2c3444e4b3 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -54,8 +54,8 @@ verify_runnable "global"
 function cleanup
 {
        PIDS=""
-       $RM -f $OLDDIR/* >/dev/null 2>&1
-       $RM -f $NEWDIR_IN_FS/* >/dev/null 2>&1
+       rm -f $OLDDIR/* >/dev/null 2>&1
+       rm -f $NEWDIR_IN_FS/* >/dev/null 2>&1
 }
 
 log_assert "Doing a 'mv' of a large amount of files within a zfs filesystem" \
index f80447f3593f371bca90c3e87772d9da0366e278..283770d4a4bf47df17d6e8603ea01185f434d803 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -55,8 +55,8 @@ verify_runnable "global"
 function cleanup
 {
        PIDS=""
-       $RM -f $OLDDIR/* >/dev/null 2>&1
-       $RM -f $NEWDIR_ACROSS_FS/* >/dev/null 2>&1
+       rm -f $OLDDIR/* >/dev/null 2>&1
+       rm -f $NEWDIR_ACROSS_FS/* >/dev/null 2>&1
 }
 
 log_assert "Doing a 'mv' of a large amount of files across two zfs filesystems" \
index 32190d8b33739fb351531f56a89ed7ade1759ab0..b18889fe181ee136e88a992cc95f0f984cf7364d 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/mv_files/mv_files.cfg
 #
 function check_bg_procs_limit_num
 {
-$ECHO "#!/bin/ksh" > /var/tmp/exitsZero.ksh
-$ECHO  "exit 0" >> /var/tmp/exitsZero.ksh
-$CHMOD 777 /var/tmp/exitsZero.ksh
+echo "#!/bin/ksh" > /var/tmp/exitsZero.ksh
+echo  "exit 0" >> /var/tmp/exitsZero.ksh
+chmod 777 /var/tmp/exitsZero.ksh
 
-$CAT <<EOF > /var/tmp/testbackgprocs.ksh
+cat <<EOF > /var/tmp/testbackgprocs.ksh
 #!/bin/ksh
 #
 # exitsZero.ksh is a one line script
@@ -57,17 +57,17 @@ do
         (( i = i + 1 ))
 done
 
-\$SLEEP 1
+\sleep 1
 
 for pid in \$PIDS
 do
-       \$WAIT \$pid
+       \wait \$pid
         (( \$? == 127 )) && exit 1
 done
 exit 0
 EOF
 
-$KSH /var/tmp/testbackgprocs.ksh
+ksh /var/tmp/testbackgprocs.ksh
 if [[ $? -eq 1 ]]; then
 #
 # Current ksh being executed has a limit
@@ -90,21 +90,21 @@ function init_setup
                reexport_pool
        fi
 
-        $RM -rf $TESTDIR  || log_unresolved Could not remove $TESTDIR
-        $MKDIR -p $TESTDIR || log_unresolved Could not create $TESTDIR
+        rm -rf $TESTDIR  || log_unresolved Could not remove $TESTDIR
+        mkdir -p $TESTDIR || log_unresolved Could not create $TESTDIR
 
-        $RM -rf $TESTDIR_TGT  || log_unresolved Could not remove $TESTDIR_TGT
-        $MKDIR -p $TESTDIR_TGT || log_unresolved Could not create $TESTDIR_TGT
+        rm -rf $TESTDIR_TGT  || log_unresolved Could not remove $TESTDIR_TGT
+        mkdir -p $TESTDIR_TGT || log_unresolved Could not create $TESTDIR_TGT
 
-        log_must $ZFS create $TESTPOOL/$TESTFS
-        log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+        log_must zfs create $TESTPOOL/$TESTFS
+        log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 
-        log_must $ZFS create $TESTPOOL/$TESTFS_TGT
-        log_must $ZFS set mountpoint=$TESTDIR_TGT $TESTPOOL/$TESTFS_TGT
+        log_must zfs create $TESTPOOL/$TESTFS_TGT
+        log_must zfs set mountpoint=$TESTDIR_TGT $TESTPOOL/$TESTFS_TGT
 
-        $MKDIR -p $OLDDIR || log_unresolved Could not create $OLDDIR
-        $MKDIR -p $NEWDIR_IN_FS || log_unresolved Could not create $NEWDIR_IN_FS
-        $MKDIR -p $NEWDIR_ACROSS_FS || log_unresolved Could not create $NEWDIR_ACROSS_FS
+        mkdir -p $OLDDIR || log_unresolved Could not create $OLDDIR
+        mkdir -p $NEWDIR_IN_FS || log_unresolved Could not create $NEWDIR_IN_FS
+        mkdir -p $NEWDIR_ACROSS_FS || log_unresolved Could not create $NEWDIR_ACROSS_FS
 
 }
 
@@ -112,8 +112,8 @@ function wait_pid
 {
        for pid in $1
        do
-               $PS -e | $GREP $pid >/dev/null 2>&1
-               (( $? == 0 )) && $WAIT $pid
+               ps -e | grep $pid >/dev/null 2>&1
+               (( $? == 0 )) && wait $pid
         done
 }
 
@@ -138,12 +138,12 @@ function generate_files
 
         while (( count <= $2 ))
         do
-                $CP /etc/passwd $1/file_$count \
+                cp /etc/passwd $1/file_$count \
                          > /dev/null 2>&1 &
 
                 PIDS="$PIDS $!"
 
-                proc_num=`$ECHO $PIDS | $WC -w`
+                proc_num=`echo $PIDS | wc -w`
                 if (( proc_num >= GANGPIDS )); then
                         wait_pid "$PIDS"
                         proc_num=0
@@ -164,8 +164,8 @@ function generate_files
 function mv_files
 {
 
-        $FIND $1 -type f -print | xargs -i \
-                $MV {} $2 > /dev/null 2>&1
+        find $1 -type f -print | xargs -i \
+                mv {} $2 > /dev/null 2>&1
 }
 
 #
@@ -177,7 +177,7 @@ function mv_files
 function count_files
 {
         typeset -i file_num
-        file_num=`$FIND $1  -type f -print | \
+        file_num=`find $1  -type f -print | \
                 wc -l`
         (( file_num != $2 )) && \
                 log_fail "The file number of target directory"\
index b27dd6e148a4e1382eec15da37093f3e213fd60c..b576b78c8aa5119654490fe904b6d588aaa23d6c 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -49,11 +49,11 @@ verify_runnable "both"
 
 log_assert "Verify a nested file system can be created/destroyed."
 
-log_must $FILE_WRITE -o create -f $TESTDIR1/file -b 8192 -c 600 -d 0
-log_must $ZFS unmount $TESTDIR1
+log_must file_write -o create -f $TESTDIR1/file -b 8192 -c 600 -d 0
+log_must zfs unmount $TESTDIR1
 
 log_note "Verify that a nested file system with a mounted file system "\
     "cannot be destroyed."
-log_mustnot $ZFS destroy $TESTPOOL/$TESTCTR
+log_mustnot zfs destroy $TESTPOOL/$TESTCTR
 
 log_pass "A nested file system was successfully populated."
index 6fedeaa58291553dd60576d59df805a1a8405ecd..5eabd3a01424dbc18e1f9861796ab3c3e50010b2 100755 (executable)
@@ -25,7 +25,7 @@
 # Use is subject to license terms.
 #
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -37,7 +37,7 @@ DISK=${DISKS%% *}
 
 ismounted "$TESTPOOL/$TESTFS"
 (( $? == 0 )) && \
-        log_must $ZFS umount $TESTDIR
+        log_must zfs umount $TESTDIR
 
 destroy_pool $TESTPOOL
 
index df1c9393aa8e58c69a8576a41e21a578bb75fa58..a7de220c00eb4cfcd71b67ebcad5ead1d3f15e26 100644 (file)
@@ -38,5 +38,5 @@ export NUM_WRITES=65536
 export DATA=0
 
 export DISKSARRAY=$DISKS
-export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
+export DISK_ARRAY_NUM=$(echo ${DISKS} | nawk '{print NF}')
 set_device_dir
index 7b20eb7c5e5915a86737c116ecb9298c75677bed..fd48dfb715fb8f75c9d2078144f846dc0cc29bcb 100755 (executable)
@@ -25,7 +25,7 @@
 # Use is subject to license terms.
 #
 #
-# Copyright (c) 2013, 2014 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -55,10 +55,10 @@ function cleanup
 log_onexit cleanup
 
 log_assert "ENOSPC is returned when file system is full."
-log_must $ZFS set compression=off $TESTPOOL/$TESTFS
+log_must zfs set compression=off $TESTPOOL/$TESTFS
 
 log_note "Writing file: $TESTFILE0 until ENOSPC."
-$FILE_WRITE -o create -f $TESTDIR/$TESTFILE0 -b $BLOCKSZ \
+file_write -o create -f $TESTDIR/$TESTFILE0 -b $BLOCKSZ \
     -c $NUM_WRITES -d $DATA
 ret=$?
 
@@ -66,7 +66,7 @@ ret=$?
     log_fail "$TESTFILE0 returned: $ret rather than ENOSPC."
 
 log_note "Write another file: $TESTFILE1 but expect ENOSPC."
-$FILE_WRITE -o create -f $TESTDIR/$TESTFILE1 -b $BLOCKSZ \
+file_write -o create -f $TESTDIR/$TESTFILE1 -b $BLOCKSZ \
     -c $NUM_WRITES -d $DATA
 ret=$?
 
index 25d88d7c5a7f7c8e82a638e4b9834175f82c277e..472d80ee0bff664feef1475a5309417f897b8915 100644 (file)
@@ -15,7 +15,7 @@
 #
 
 #
-# Copyright (c) 2014 by Delphix. All rights reserved.
+# Copyright (c) 2014, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -30,45 +30,45 @@ verify_runnable "both"
 
 log_assert "ENOSPC is returned when file system is full."
 sync
-log_must $ZFS set compression=off $TESTPOOL/$TESTFS
-log_must $ZFS snapshot $TESTPOOL/$TESTFS@snap
+log_must zfs set compression=off $TESTPOOL/$TESTFS
+log_must zfs snapshot $TESTPOOL/$TESTFS@snap
 
 log_note "Writing file: $TESTFILE0 until ENOSPC."
-$FILE_WRITE -o create -f $TESTDIR/$TESTFILE0 -b $BLOCKSZ \
+file_write -o create -f $TESTDIR/$TESTFILE0 -b $BLOCKSZ \
     -c $NUM_WRITES -d $DATA
 ret=$?
 
 (( $ret != $ENOSPC )) && \
     log_fail "$TESTFILE0 returned: $ret rather than ENOSPC."
 
-log_mustnot_expect space $ZFS create $TESTPOOL/$TESTFS/subfs
-log_mustnot_expect space $ZFS clone $TESTPOOL/$TESTFS@snap $TESTPOOL/clone
-log_mustnot_expect space $ZFS snapshot $TESTPOOL/$TESTFS@snap2
-log_mustnot_expect space $ZFS bookmark \
+log_mustnot_expect space zfs create $TESTPOOL/$TESTFS/subfs
+log_mustnot_expect space zfs clone $TESTPOOL/$TESTFS@snap $TESTPOOL/clone
+log_mustnot_expect space zfs snapshot $TESTPOOL/$TESTFS@snap2
+log_mustnot_expect space zfs bookmark \
     $TESTPOOL/$TESTFS@snap $TESTPOOL/$TESTFS#bookmark
 
-log_must $ZFS send $TESTPOOL/$TESTFS@snap >/tmp/stream.$$
-log_mustnot_expect space $ZFS receive $TESTPOOL/$TESTFS/recvd </tmp/stream.$$
+log_must zfs send $TESTPOOL/$TESTFS@snap >/tmp/stream.$$
+log_mustnot_expect space zfs receive $TESTPOOL/$TESTFS/recvd </tmp/stream.$$
 log_must rm /tmp/stream.$$
 
-log_must $ZFS rename $TESTPOOL/$TESTFS@snap $TESTPOOL/$TESTFS@snap_newname
-log_must $ZFS rename $TESTPOOL/$TESTFS@snap_newname $TESTPOOL/$TESTFS@snap
-log_must $ZFS rename $TESTPOOL/$TESTFS $TESTPOOL/${TESTFS}_newname
-log_must $ZFS rename $TESTPOOL/${TESTFS}_newname $TESTPOOL/$TESTFS
-log_must $ZFS allow staff snapshot $TESTPOOL/$TESTFS
-log_must $ZFS unallow staff snapshot $TESTPOOL/$TESTFS
-log_must $ZFS set user:prop=value $TESTPOOL/$TESTFS
-log_must $ZFS set quota=1EB $TESTPOOL/$TESTFS
-log_must $ZFS set quota=none $TESTPOOL/$TESTFS
-log_must $ZFS set reservation=1KB $TESTPOOL/$TESTFS
-log_must $ZFS set reservation=none $TESTPOOL/$TESTFS
-log_must $ZPOOL scrub $TESTPOOL
-$ZPOOL scrub -s $TESTPOOL
-log_must $ZPOOL set comment="Use the force, Luke." $TESTPOOL
-log_must $ZPOOL set comment="" $TESTPOOL
+log_must zfs rename $TESTPOOL/$TESTFS@snap $TESTPOOL/$TESTFS@snap_newname
+log_must zfs rename $TESTPOOL/$TESTFS@snap_newname $TESTPOOL/$TESTFS@snap
+log_must zfs rename $TESTPOOL/$TESTFS $TESTPOOL/${TESTFS}_newname
+log_must zfs rename $TESTPOOL/${TESTFS}_newname $TESTPOOL/$TESTFS
+log_must zfs allow staff snapshot $TESTPOOL/$TESTFS
+log_must zfs unallow staff snapshot $TESTPOOL/$TESTFS
+log_must zfs set user:prop=value $TESTPOOL/$TESTFS
+log_must zfs set quota=1EB $TESTPOOL/$TESTFS
+log_must zfs set quota=none $TESTPOOL/$TESTFS
+log_must zfs set reservation=1KB $TESTPOOL/$TESTFS
+log_must zfs set reservation=none $TESTPOOL/$TESTFS
+log_must zpool scrub $TESTPOOL
+zpool scrub -s $TESTPOOL
+log_must zpool set comment="Use the force, Luke." $TESTPOOL
+log_must zpool set comment="" $TESTPOOL
 
 # destructive tests must come last
-log_must $ZFS rollback $TESTPOOL/$TESTFS@snap
-log_must $ZFS destroy $TESTPOOL/$TESTFS@snap
+log_must zfs rollback $TESTPOOL/$TESTFS@snap
+log_must zfs destroy $TESTPOOL/$TESTFS@snap
 
 log_pass "ENOSPC returned as expected."
index 7d177c772f9a67904bac55f0c5dd5642cfbb1665..7053ad07ba4faa70499a79aa468b15df3b6ce688 100755 (executable)
@@ -43,7 +43,7 @@ DISK=${DISKS%% *}
 log_must set_partition 0 "" $SIZE $DISK
 
 if is_linux; then
-       if ( is_mpath_device $DISK ) && [[ -z $($ECHO $DISK | awk 'substr($1,18,1)\
+       if ( is_mpath_device $DISK ) && [[ -z $(echo $DISK | awk 'substr($1,18,1)\
            ~ /^[[:digit:]]+$/') ]] || ( is_real_device $DISK ); then
                default_setup $DISK"1"
        elif ( is_mpath_device $DISK || is_loop_device $DISK ); then
index a03bc54123febe8bb13cdd1e238c6218f28a8a64..1c0f0517db551303a2aba7e209fd44e0c0abc1d7 100644 (file)
@@ -10,7 +10,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/math.shlib
@@ -27,7 +27,7 @@ function verify_nopwrite
        typeset low=1
        typeset high=99
 
-       $SYNC
+       sync
        for i in origin snap clone; do
                for j in used refer usedbychildren written; do
                        typeset ${i}_$j=$(get_prop $j $(eval echo \$$i))
@@ -60,7 +60,7 @@ function verify_nopwrite
        # The comparisons below should pass regardless of nopwrite. They're
        # here for sanity.
        #
-       typeset deadlist=$($ZDB -Pddd $clone | $AWK '/Deadlist:/ {print $2}')
+       typeset deadlist=$(zdb -Pddd $clone | awk '/Deadlist:/ {print $2}')
        within_percent $deadlist $clone_written $high || return 1
        within_percent $snap_refer $snap_written $high || return 1
 
index 94a846a589abd3eeb4a1e577eb2ef74d6be3a00e..3971820966f141b369c3b89cbab4f50a2623e20f 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -34,37 +34,37 @@ log_onexit cleanup
 
 function cleanup
 {
-       datasetexists $origin && log_must $ZFS destroy -R $origin
-       log_must $ZFS create -o mountpoint=$TESTDIR $origin
+       datasetexists $origin && log_must zfs destroy -R $origin
+       log_must zfs create -o mountpoint=$TESTDIR $origin
 }
 
 log_assert "nopwrite requires copies property to remain constant"
 
 # Verify nopwrite is disabled with increased redundancy
-log_must $ZFS set compress=on $origin
-log_must $ZFS set checksum=sha256 $origin
-$DD if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS conv=notrunc \
+log_must zfs set compress=on $origin
+log_must zfs set checksum=sha256 $origin
+dd if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS conv=notrunc \
     >/dev/null 2>&1 || log_fail "dd into $TESTDIR/file failed."
-$ZFS snapshot $origin@a || log_fail "zfs snap failed"
-log_must $ZFS clone $origin@a $origin/clone
-$ZFS set copies=3 $origin/clone
-$DD if=/$TESTDIR/file of=/$TESTDIR/clone/file bs=1024k count=$MEGS \
+zfs snapshot $origin@a || log_fail "zfs snap failed"
+log_must zfs clone $origin@a $origin/clone
+zfs set copies=3 $origin/clone
+dd if=/$TESTDIR/file of=/$TESTDIR/clone/file bs=1024k count=$MEGS \
     conv=notrunc >/dev/null 2>&1 || log_fail "dd failed."
 log_mustnot verify_nopwrite $origin $origin@a $origin/clone
 
 # Verify nopwrite is disabled with decreased redundancy
-$ZFS destroy -R $origin || log_fail "Couldn't destroy $origin"
-$ZFS create -o mountpoint=$TESTDIR $origin || \
+zfs destroy -R $origin || log_fail "Couldn't destroy $origin"
+zfs create -o mountpoint=$TESTDIR $origin || \
     log_fail "Couldn't recreate $origin"
-log_must $ZFS set compress=on $origin
-log_must $ZFS set copies=3 $origin
-log_must $ZFS set checksum=sha256 $origin
-$DD if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS conv=notrunc \
+log_must zfs set compress=on $origin
+log_must zfs set copies=3 $origin
+log_must zfs set checksum=sha256 $origin
+dd if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS conv=notrunc \
     >/dev/null 2>&1 || log_fail "dd into $TESTDIR/file failed."
-$ZFS snapshot $origin@a || log_fail "zfs snap failed"
-log_must $ZFS clone $origin@a $origin/clone
-$ZFS set copies=1 $origin/clone
-$DD if=/$TESTDIR/file of=/$TESTDIR/clone/file bs=1024k count=$MEGS \
+zfs snapshot $origin@a || log_fail "zfs snap failed"
+log_must zfs clone $origin@a $origin/clone
+zfs set copies=1 $origin/clone
+dd if=/$TESTDIR/file of=/$TESTDIR/clone/file bs=1024k count=$MEGS \
     conv=notrunc >/dev/null 2>&1 || log_fail "dd failed."
 log_mustnot verify_nopwrite $origin $origin@a $origin/clone
 
index 23d4be2e3490946274a559369bd801aeddc0cd39..4d06cfe4a2cf471629f42da607e9f1091d3c57b5 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -34,42 +34,42 @@ log_onexit cleanup
 
 function cleanup
 {
-       datasetexists $origin && log_must $ZFS destroy -R $origin
-       log_must $ZFS create -o mountpoint=$TESTDIR $origin
+       datasetexists $origin && log_must zfs destroy -R $origin
+       log_must zfs create -o mountpoint=$TESTDIR $origin
 }
 
 log_assert "nopwrite updates file metadata correctly"
 
-log_must $ZFS set compress=on $origin
-log_must $ZFS set checksum=sha256 $origin
-$DD if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS conv=notrunc \
+log_must zfs set compress=on $origin
+log_must zfs set checksum=sha256 $origin
+dd if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS conv=notrunc \
     >/dev/null 2>&1 || log_fail "dd into $TESTDIR/file failed."
-$ZFS snapshot $origin@a || log_fail "zfs snap failed"
-log_must $ZFS clone $origin@a $origin/clone
+zfs snapshot $origin@a || log_fail "zfs snap failed"
+log_must zfs clone $origin@a $origin/clone
 
 if is_linux; then
        o_atime=$(stat -c %X $TESTDIR/clone/file)
        o_ctime=$(stat -c %Z $TESTDIR/clone/file)
        o_mtime=$(stat -c %Y $TESTDIR/clone/file)
 else
-       o_atime=$($LS -E% all $TESTDIR/clone/file | $AWK '/atime/ {print $4}')
-       o_ctime=$($LS -E% all $TESTDIR/clone/file | $AWK '/ctime/ {print $4}')
-       o_mtime=$($LS -E% all $TESTDIR/clone/file | $AWK '/mtime/ {print $4}')
+       o_atime=$(ls -E% all $TESTDIR/clone/file | awk '/atime/ {print $4}')
+       o_ctime=$(ls -E% all $TESTDIR/clone/file | awk '/ctime/ {print $4}')
+       o_mtime=$(ls -E% all $TESTDIR/clone/file | awk '/mtime/ {print $4}')
 fi
 
-$SLEEP 1
-$DD if=/$TESTDIR/file of=/$TESTDIR/clone/file bs=1024k count=$MEGS \
+sleep 1
+dd if=/$TESTDIR/file of=/$TESTDIR/clone/file bs=1024k count=$MEGS \
     conv=notrunc >/dev/null 2>&1 || log_fail "dd failed."
-$SLEEP 1
+sleep 1
 
 if is_linux; then
        atime=$(stat -c %X $TESTDIR/clone/file)
        ctime=$(stat -c %Z $TESTDIR/clone/file)
        mtime=$(stat -c %Y $TESTDIR/clone/file)
 else
-       atime=$($LS -E% all $TESTDIR/clone/file | $AWK '/atime/ {print $4}')
-       ctime=$($LS -E% all $TESTDIR/clone/file | $AWK '/ctime/ {print $4}')
-       mtime=$($LS -E% all $TESTDIR/clone/file | $AWK '/mtime/ {print $4}')
+       atime=$(ls -E% all $TESTDIR/clone/file | awk '/atime/ {print $4}')
+       ctime=$(ls -E% all $TESTDIR/clone/file | awk '/ctime/ {print $4}')
+       mtime=$(ls -E% all $TESTDIR/clone/file | awk '/mtime/ {print $4}')
 fi
 
 [[ $o_atime = $atime ]] || log_fail "atime changed: $o_atime $atime"
index 921d17f2a00523f0ef1fb45dcc81c5acc6433280..8b0b9b54992010effdfde0a52c35cddff6756ac7 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -36,54 +36,54 @@ log_onexit cleanup
 
 function cleanup
 {
-       datasetexists $origin && log_must $ZFS destroy -R $origin
-       log_must $ZFS create -o mountpoint=$TESTDIR $origin
+       datasetexists $origin && log_must zfs destroy -R $origin
+       log_must zfs create -o mountpoint=$TESTDIR $origin
 }
 
 log_assert "nopwrite isn't enabled without the prerequisites"
 
 # Data written into origin fs without compression or sha256
-$DD if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS conv=notrunc \
+dd if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS conv=notrunc \
     >/dev/null 2>&1 || log_fail "dd of $TESTDIR/file failed."
-$ZFS snapshot $origin@a || log_fail "zfs snap failed"
-log_must $ZFS clone -o compress=on $origin@a $origin/clone
-log_must $ZFS set checksum=sha256 $origin/clone
-$DD if=/$TESTDIR/file of=/$TESTDIR/clone/file bs=1024k count=$MEGS \
+zfs snapshot $origin@a || log_fail "zfs snap failed"
+log_must zfs clone -o compress=on $origin@a $origin/clone
+log_must zfs set checksum=sha256 $origin/clone
+dd if=/$TESTDIR/file of=/$TESTDIR/clone/file bs=1024k count=$MEGS \
     conv=notrunc >/dev/null 2>&1 || log_fail "dd failed."
 log_mustnot verify_nopwrite $origin $origin@a $origin/clone
-$ZFS destroy -R $origin@a || log_fail "zfs destroy failed"
-log_must $RM -f $TESTDIR/file
+zfs destroy -R $origin@a || log_fail "zfs destroy failed"
+log_must rm -f $TESTDIR/file
 
 # Data written to origin fs before checksum enabled
-log_must $ZFS set compress=on $origin
-$DD if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS conv=notrunc \
+log_must zfs set compress=on $origin
+dd if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS conv=notrunc \
     >/dev/null 2>&1 || log_fail "dd into $TESTDIR/file failed."
-log_must $ZFS set checksum=sha256 $origin
-$ZFS snapshot $origin@a || log_fail "zfs snap failed"
-log_must $ZFS clone $origin@a $origin/clone
-$DD if=/$TESTDIR/file of=/$TESTDIR/clone/file bs=1024k count=$MEGS \
+log_must zfs set checksum=sha256 $origin
+zfs snapshot $origin@a || log_fail "zfs snap failed"
+log_must zfs clone $origin@a $origin/clone
+dd if=/$TESTDIR/file of=/$TESTDIR/clone/file bs=1024k count=$MEGS \
     conv=notrunc >/dev/null 2>&1 || log_fail "dd failed."
 log_mustnot verify_nopwrite $origin $origin@a $origin/clone
-$ZFS destroy -R $origin@a || log_fail "zfs destroy failed"
-log_must $RM -f $TESTDIR/file
+zfs destroy -R $origin@a || log_fail "zfs destroy failed"
+log_must rm -f $TESTDIR/file
 
 # Clone with compression=off
-$DD if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS conv=notrunc \
+dd if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS conv=notrunc \
     >/dev/null 2>&1 || log_fail "dd into $TESTDIR/file failed."
-$ZFS snapshot $origin@a || log_fail "zfs snap failed"
-log_must $ZFS clone -o compress=off $origin@a $origin/clone
-$DD if=/$TESTDIR/file of=/$TESTDIR/clone/file bs=1024k count=$MEGS \
+zfs snapshot $origin@a || log_fail "zfs snap failed"
+log_must zfs clone -o compress=off $origin@a $origin/clone
+dd if=/$TESTDIR/file of=/$TESTDIR/clone/file bs=1024k count=$MEGS \
     conv=notrunc >/dev/null 2>&1 || log_fail "dd failed."
 log_mustnot verify_nopwrite $origin $origin@a $origin/clone
-$ZFS destroy -R $origin@a || log_fail "zfs destroy failed"
-log_must $RM -f $TESTDIR/file
+zfs destroy -R $origin@a || log_fail "zfs destroy failed"
+log_must rm -f $TESTDIR/file
 
 # Clone with fletcher4, rather than sha256
-$DD if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS conv=notrunc \
+dd if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS conv=notrunc \
     >/dev/null 2>&1 || log_fail "dd into $TESTDIR/file failed."
-$ZFS snapshot $origin@a || log_fail "zfs snap failed"
-log_must $ZFS clone -o checksum=fletcher4 $origin@a $origin/clone
-$DD if=/$TESTDIR/file of=/$TESTDIR/clone/file bs=1024k count=$MEGS \
+zfs snapshot $origin@a || log_fail "zfs snap failed"
+log_must zfs clone -o checksum=fletcher4 $origin@a $origin/clone
+dd if=/$TESTDIR/file of=/$TESTDIR/clone/file bs=1024k count=$MEGS \
     conv=notrunc >/dev/null 2>&1 || log_fail "dd failed."
 log_mustnot verify_nopwrite $origin $origin@a $origin/clone
 
index 7a21aa5d96fcb88fe1f2061a70d79de5c89920c2..f9e6e83b7a8d5a4bedd5a98f4f6ee77ae818be83 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -36,22 +36,22 @@ log_onexit cleanup
 
 function cleanup
 {
-       datasetexists $origin && log_must $ZFS destroy -R $TESTPOOL/clone
-       log_must $ZFS create -o mountpoint=$TESTDIR $origin
+       datasetexists $origin && log_must zfs destroy -R $TESTPOOL/clone
+       log_must zfs create -o mountpoint=$TESTDIR $origin
 }
 
 log_assert "nopwrite works on a dataset that becomes a clone via promotion."
 
-log_must $ZFS set compress=on $origin
-log_must $ZFS set checksum=sha256 $origin
-$DD if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS conv=notrunc \
+log_must zfs set compress=on $origin
+log_must zfs set checksum=sha256 $origin
+dd if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS conv=notrunc \
     >/dev/null 2>&1 || log_fail "dd into $TESTDIR/file failed."
-$ZFS snapshot $origin@a || log_fail "zfs snap failed"
-log_must $ZFS clone $origin@a $TESTPOOL/clone
-log_must $ZFS set compress=off $TESTPOOL/clone
-log_must $ZFS set checksum=off $TESTPOOL/clone
-log_must $ZFS promote $TESTPOOL/clone
-$DD if=/$TESTPOOL/clone/file of=/$TESTDIR/file bs=1024k count=$MEGS \
+zfs snapshot $origin@a || log_fail "zfs snap failed"
+log_must zfs clone $origin@a $TESTPOOL/clone
+log_must zfs set compress=off $TESTPOOL/clone
+log_must zfs set checksum=off $TESTPOOL/clone
+log_must zfs promote $TESTPOOL/clone
+dd if=/$TESTPOOL/clone/file of=/$TESTDIR/file bs=1024k count=$MEGS \
     conv=notrunc >/dev/null 2>&1 || log_fail "dd failed."
 log_must verify_nopwrite $TESTPOOL/clone $TESTPOOL/clone@a $origin
 
index a3c272c773f2be189858b1b4fdc5ad8761da75b7..a3497c75f2d7e2b20d4f0d0e836161ff849beb76 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -34,22 +34,22 @@ log_onexit cleanup
 
 function cleanup
 {
-       datasetexists $origin && log_must $ZFS destroy -R $origin
-       log_must $ZFS create -o mountpoint=$TESTDIR $origin
+       datasetexists $origin && log_must zfs destroy -R $origin
+       log_must zfs create -o mountpoint=$TESTDIR $origin
 }
 
 log_assert "nopwrite updates file metadata correctly"
 
-log_must $ZFS set compress=on $origin
-log_must $ZFS set checksum=sha256 $origin
-$DD if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS conv=notrunc \
+log_must zfs set compress=on $origin
+log_must zfs set checksum=sha256 $origin
+dd if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS conv=notrunc \
     >/dev/null 2>&1 || log_fail "dd into $TESTDIR/file failed."
-$ZFS snapshot $origin@a || log_fail "zfs snap failed"
-log_must $ZFS clone $origin@a $origin/clone
+zfs snapshot $origin@a || log_fail "zfs snap failed"
+log_must zfs clone $origin@a $origin/clone
 
 for rs in 512 1024 2048 4096 8192 16384 32768 65536 131072 ; do
-       log_must $ZFS set recsize=$rs $origin/clone
-       $DD if=/$TESTDIR/file of=/$TESTDIR/clone/file bs=1024k count=$MEGS \
+       log_must zfs set recsize=$rs $origin/clone
+       dd if=/$TESTDIR/file of=/$TESTDIR/clone/file bs=1024k count=$MEGS \
            conv=notrunc >/tmp/null 2>&1 || log_fail "dd failed."
        log_must verify_nopwrite $origin $origin@a $origin/clone
 done
index d6cc66f52b81a202e5add46dcecc327e5a516a56..c9d7b59b344b4f376763fdedb1fcfa75117c57a3 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -34,20 +34,20 @@ log_onexit cleanup
 
 function cleanup
 {
-       datasetexists $origin && log_must $ZFS destroy -R $origin
-       log_must $ZFS create -o mountpoint=$TESTDIR $origin
+       datasetexists $origin && log_must zfs destroy -R $origin
+       log_must zfs create -o mountpoint=$TESTDIR $origin
 }
 
 log_assert "nopwrite works for sync writes"
 
-log_must $ZFS set compress=on $origin
-log_must $ZFS set checksum=sha256 $origin
-$GNUDD if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS oflag=sync \
+log_must zfs set compress=on $origin
+log_must zfs set checksum=sha256 $origin
+dd if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS oflag=sync \
     conv=notrunc >/dev/null 2>&1 || log_fail "dd into $TESTDIR/file failed."
-$ZFS snapshot $origin@a || log_fail "zfs snap failed"
-log_must $ZFS clone $origin@a $origin/clone
+zfs snapshot $origin@a || log_fail "zfs snap failed"
+log_must zfs clone $origin@a $origin/clone
 
-$GNUDD if=/$TESTDIR/file of=/$TESTDIR/clone/file bs=1024k count=$MEGS \
+dd if=/$TESTDIR/file of=/$TESTDIR/clone/file bs=1024k count=$MEGS \
     oflag=sync conv=notrunc >/dev/null 2>&1 || log_fail "dd failed."
 
 log_must verify_nopwrite $origin $origin@a $origin/clone
index 12450f8498ecec105f71c53d5ecb566dda077585..d91d5536f8b6b4a83cc9e2fd242a0f2903a3dcf8 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -40,25 +40,25 @@ log_onexit cleanup
 
 function cleanup
 {
-       datasetexists $origin && log_must $ZFS destroy -R $origin
-       log_must $ZFS create -o mountpoint=$TESTDIR $origin
+       datasetexists $origin && log_must zfs destroy -R $origin
+       log_must zfs create -o mountpoint=$TESTDIR $origin
 }
 
 log_assert "nopwrite works with sha256 and any compression algorithm"
 
-log_must $ZFS set compress=on $origin
-log_must $ZFS set checksum=sha256 $origin
-$DD if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS conv=notrunc \
+log_must zfs set compress=on $origin
+log_must zfs set checksum=sha256 $origin
+dd if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS conv=notrunc \
     >/dev/null 2>&1 || log_fail "initial dd failed."
 
 # Verify nop_write for 4 random compression algorithms
 for i in $(get_rand_compress 4); do
-       $ZFS snapshot $origin@a || log_fail "zfs snap failed"
-       log_must $ZFS clone -o compress=$i $origin@a $origin/clone
-       $DD if=/$TESTDIR/file of=/$TESTDIR/clone/file bs=1024k count=$MEGS \
+       zfs snapshot $origin@a || log_fail "zfs snap failed"
+       log_must zfs clone -o compress=$i $origin@a $origin/clone
+       dd if=/$TESTDIR/file of=/$TESTDIR/clone/file bs=1024k count=$MEGS \
            conv=notrunc >/dev/null 2>&1 || log_fail "dd failed."
        log_must verify_nopwrite $origin $origin@a $origin/clone
-       $ZFS destroy -R $origin@a || log_fail "zfs destroy failed"
+       zfs destroy -R $origin@a || log_fail "zfs destroy failed"
 done
 
 log_pass "nopwrite works with sha256 and any compression algorithm"
index b337161e2608a841c98bfa77874223eebb0a8e6b..126a00ea1c401b6c34d21062dae5a752b706be5d 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -37,21 +37,21 @@ log_onexit cleanup
 
 function cleanup
 {
-       datasetexists $origin && log_must $ZFS destroy -R $origin
+       datasetexists $origin && log_must zfs destroy -R $origin
        # No need to recreate the volume as no other tests expect it.
 }
 
 log_assert "nopwrite works on volumes"
 
-log_must $ZFS set compress=on $origin
-log_must $ZFS set checksum=sha256 $origin
-$DD if=/dev/urandom of=$vol bs=8192 count=4096 conv=notrunc >/dev/null \
+log_must zfs set compress=on $origin
+log_must zfs set checksum=sha256 $origin
+dd if=/dev/urandom of=$vol bs=8192 count=4096 conv=notrunc >/dev/null \
     2>&1 || log_fail "dd into $origin failed."
-$ZFS snapshot $origin@a || log_fail "zfs snap failed"
-log_must $ZFS clone $origin@a $clone
-log_must $ZFS set compress=on $clone
-log_must $ZFS set checksum=sha256 $clone
-$DD if=$vol of=$volclone bs=8192 count=4096 conv=notrunc >/dev/null 2>&1 || \
+zfs snapshot $origin@a || log_fail "zfs snap failed"
+log_must zfs clone $origin@a $clone
+log_must zfs set compress=on $clone
+log_must zfs set checksum=sha256 $clone
+dd if=$vol of=$volclone bs=8192 count=4096 conv=notrunc >/dev/null 2>&1 || \
     log_fail "dd into $clone failed."
 log_must verify_nopwrite $origin $origin@a $clone
 
index 42be907bd0593d528c059895760cc5cfe2d48403..ae4cb69adcb028f8c1685fdf74ebcaef98f7d1ab 100644 (file)
@@ -38,5 +38,5 @@ export HOLES_COUNT=${HOLES_COUNT-"16384"}        # FILESIZE/BLKSIZE/8
 export STF_TIMEOUT=3600
 
 export DISKSARRAY=$DISKS
-export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
+export DISK_ARRAY_NUM=$(echo ${DISKS} | nawk '{print NF}')
 set_device_dir
index d98ef7f65ea9c15c8bc4c04e54f36d49b2b385b7..9682767c0ab80e82166c28de9c7747544d32d51c 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2014 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,7 +52,7 @@ function cleanup
        # Ensure we don't leave disks in the offline state
        #
        for disk in $DISKLIST; do
-               log_must $ZPOOL online $TESTPOOL $disk
+               log_must zpool online $TESTPOOL $disk
                check_state $TESTPOOL $disk "online"
                if [[ $? != 0 ]]; then
                        log_fail "Unable to online $disk"
@@ -60,33 +60,33 @@ function cleanup
 
        done
 
-       $KILL $killpid >/dev/null 2>&1
-       [[ -e $TESTDIR ]] && log_must $RM -rf $TESTDIR/*
+       kill $killpid >/dev/null 2>&1
+       [[ -e $TESTDIR ]] && log_must rm -rf $TESTDIR/*
 }
 
 log_assert "Turning a disk offline and back online during I/O completes."
 
-$FILE_TRUNC -f $((64 * 1024 * 1024)) -b 8192 -c 0 -r $TESTDIR/$TESTFILE1 &
+file_trunc -f $((64 * 1024 * 1024)) -b 8192 -c 0 -r $TESTDIR/$TESTFILE1 &
 typeset killpid="$! "
 
 for disk in $DISKLIST; do
         for i in 'do_offline' 'do_offline_while_already_offline'; do
-               log_must $ZPOOL offline $TESTPOOL $disk
+               log_must zpool offline $TESTPOOL $disk
                check_state $TESTPOOL $disk "offline"
                 if [[ $? != 0 ]]; then
                         log_fail "$disk of $TESTPOOL is not offline."
                 fi
         done
 
-        log_must $ZPOOL online $TESTPOOL $disk
+        log_must zpool online $TESTPOOL $disk
         check_state $TESTPOOL $disk "online"
         if [[ $? != 0 ]]; then
                 log_fail "$disk of $TESTPOOL did not match online state"
         fi
 done
 
-log_must $KILL $killpid
-$SYNC
+log_must kill $killpid
+sync
 
 typeset dir=$(get_device_dir $DISKS)
 verify_filesys "$TESTPOOL" "$TESTPOOL/$TESTFS" "$dir"
index 12c191a03aa4ccd3c2f6f20cdb5d331543c63eee..2f32e21e90118f25aab160afcf94373a4885786e 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2014 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -53,7 +53,7 @@ function cleanup
        # Ensure we don't leave disks in the offline state
        #
        for disk in $DISKLIST; do
-               log_must $ZPOOL online $TESTPOOL $disk
+               log_must zpool online $TESTPOOL $disk
                check_state $TESTPOOL $disk "online"
                if [[ $? != 0 ]]; then
                        log_fail "Unable to online $disk"
@@ -61,15 +61,15 @@ function cleanup
 
        done
 
-       $KILL $killpid >/dev/null 2>&1
-       [[ -e $TESTDIR ]] && log_must $RM -rf $TESTDIR/*
+       kill $killpid >/dev/null 2>&1
+       [[ -e $TESTDIR ]] && log_must rm -rf $TESTDIR/*
 }
 
 log_assert "Turning both disks offline should fail."
 
 log_onexit cleanup
 
-$FILE_TRUNC -f $((64 * 1024 * 1024)) -b 8192 -c 0 -r $TESTDIR/$TESTFILE1 &
+file_trunc -f $((64 * 1024 * 1024)) -b 8192 -c 0 -r $TESTDIR/$TESTFILE1 &
 typeset killpid="$! "
 
 disks=($DISKLIST)
@@ -79,14 +79,14 @@ disks=($DISKLIST)
 # all but one vdev offlined, whereas with raidz there can be only one.
 #
 pooltype='mirror'
-$ZPOOL list -v $TESTPOOL | $GREP raidz >/dev/null 2>&1 && pooltype='raidz'
+zpool list -v $TESTPOOL | grep raidz >/dev/null 2>&1 && pooltype='raidz'
 
 typeset -i i=0
 while [[ $i -lt ${#disks[*]} ]]; do
        typeset -i j=0
        if [[ $pooltype = 'mirror' ]]; then
                # Hold one disk online, verify the others can be offlined.
-               log_must $ZPOOL online $TESTPOOL ${disks[$i]}
+               log_must zpool online $TESTPOOL ${disks[$i]}
                check_state $TESTPOOL ${disks[$i]} "online" || \
                    log_fail "Failed to set ${disks[$i]} online"
                while [[ $j -lt ${#disks[*]} ]]; do
@@ -94,14 +94,14 @@ while [[ $i -lt ${#disks[*]} ]]; do
                                ((j++))
                                continue
                        fi
-                       log_must $ZPOOL offline $TESTPOOL ${disks[$j]}
+                       log_must zpool offline $TESTPOOL ${disks[$j]}
                        check_state $TESTPOOL ${disks[$j]} "offline" || \
                            log_fail "Failed to set ${disks[$j]} offline"
                        ((j++))
                done
        elif [[ $pooltype = 'raidz' ]]; then
                # Hold one disk offline, verify the others can't be offlined.
-               log_must $ZPOOL offline $TESTPOOL ${disks[$i]}
+               log_must zpool offline $TESTPOOL ${disks[$i]}
                check_state $TESTPOOL ${disks[$i]} "offline" || \
                    log_fail "Failed to set ${disks[$i]} offline"
                while [[ $j -lt ${#disks[*]} ]]; do
@@ -109,22 +109,22 @@ while [[ $i -lt ${#disks[*]} ]]; do
                                ((j++))
                                continue
                        fi
-                       log_mustnot $ZPOOL offline $TESTPOOL ${disks[$j]}
+                       log_mustnot zpool offline $TESTPOOL ${disks[$j]}
                        check_state $TESTPOOL ${disks[$j]} "online" || \
                            log_fail "Failed to set ${disks[$j]} online"
                        check_state $TESTPOOL ${disks[$i]} "offline" || \
                            log_fail "Failed to set ${disks[$i]} offline"
                        ((j++))
                done
-               log_must $ZPOOL online $TESTPOOL ${disks[$i]}
+               log_must zpool online $TESTPOOL ${disks[$i]}
                check_state $TESTPOOL ${disks[$i]} "online" || \
                    log_fail "Failed to set ${disks[$i]} online"
        fi
        ((i++))
 done
 
-log_must $KILL $killpid
-$SYNC
+log_must kill $killpid
+sync
 
 typeset dir=$(get_device_dir $DISKS)
 verify_filesys "$TESTPOOL" "$TESTPOOL/$TESTFS" "$dir"
index 398c19c22a9d1542116ffabbe0f4ac2007a34572..0d763ee1b882114932c303d3ad8b3621ee178870 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,8 +48,8 @@ function cleanup
                destroy_pool $TESTPOOL1
        fi
 
-       $KILL $killpid >/dev/null 2>&1
-       [[ -e $TESTDIR ]] && log_must $RM -rf $TESTDIR/*
+       kill $killpid >/dev/null 2>&1
+       [[ -e $TESTDIR ]] && log_must rm -rf $TESTDIR/*
 }
 
 log_assert "Offlining disks in a non-redundant pool should fail."
@@ -58,24 +58,24 @@ log_onexit cleanup
 
 specials_list=""
 for i in 0 1 2; do
-       $MKFILE $MINVDEVSIZE $TESTDIR/$TESTFILE1.$i
+       mkfile $MINVDEVSIZE $TESTDIR/$TESTFILE1.$i
        specials_list="$specials_list $TESTDIR/$TESTFILE1.$i"
 done
 disk=($specials_list)
 
 create_pool $TESTPOOL1 $specials_list
-log_must $ZFS create $TESTPOOL1/$TESTFS1
-log_must $ZFS set mountpoint=$TESTDIR1 $TESTPOOL1/$TESTFS1
+log_must zfs create $TESTPOOL1/$TESTFS1
+log_must zfs set mountpoint=$TESTDIR1 $TESTPOOL1/$TESTFS1
 
-$FILE_TRUNC -f $((64 * 1024 * 1024)) -b 8192 -c 0 -r $TESTDIR/$TESTFILE1 &
+file_trunc -f $((64 * 1024 * 1024)) -b 8192 -c 0 -r $TESTDIR/$TESTFILE1 &
 typeset killpid="$! "
 
 for i in 0 1 2; do
-       log_mustnot $ZPOOL offline $TESTPOOL1 ${disk[$i]}
+       log_mustnot zpool offline $TESTPOOL1 ${disk[$i]}
        check_state $TESTPOOL1 ${disk[$i]} "online"
 done
 
-log_must $KILL $killpid
-$SYNC
+log_must kill $killpid
+sync
 
 log_pass
index 1e27b29ac3bde89825e8536f62ed2de445182e6c..45ef2fd67a968c2e12ae551607e5f34ed422c8eb 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -51,11 +51,11 @@ log_assert "Ensure that pool names can use the ASCII subset of UTF-8"
 function cleanup
 {
        if [[ -n $name ]] && poolexists $name ; then
-               log_must $ZPOOL destroy $name
+               log_must zpool destroy $name
        fi
 
        if [[ -d $TESTDIR ]]; then
-               log_must $RM -rf $TESTDIR
+               log_must rm -rf $TESTDIR
        fi
 
 }
@@ -64,7 +64,7 @@ log_onexit cleanup
 
 DISK=${DISKS%% *}
 if [[ ! -e $TESTDIR ]]; then
-       log_must $MKDIR $TESTDIR
+       log_must mkdir $TESTDIR
 fi
 
 log_note "Ensure letters of the alphabet are allowable"
@@ -76,12 +76,12 @@ for name in A B C D E F G H I J K L M \
     a b c d e f g h i j k l m \
     n o p q r s t u v w x y z
 do
-       log_must $ZPOOL create -m $TESTDIR $name $DISK
+       log_must zpool create -m $TESTDIR $name $DISK
        if ! poolexists $name; then
                log_fail "Could not create a pool called '$name'"
        fi
 
-       log_must $ZPOOL destroy $name
+       log_must zpool destroy $name
 done
 
 log_note "Ensure a variety of unusual names passes"
@@ -95,7 +95,7 @@ for name in "a.............................." "a_" "a-" "a:" \
     "spar3-p00l" "hiddenmirrorpool" "hiddenraidzpool" \
     "hiddensparepool"
 do
-       log_must $ZPOOL create -m $TESTDIR $name $DISK
+       log_must zpool create -m $TESTDIR $name $DISK
        if ! poolexists $name; then
                log_fail "Could not create a pool called '$name'"
        fi
@@ -104,13 +104,13 @@ do
        # Since the naming convention applies to datasets too,
        # create datasets with the same names as above.
        #
-       log_must $ZFS create $name/$name
-       log_must $ZFS snapshot $name/$name@$name
-       log_must $ZFS clone $name/$name@$name $name/clone_$name
-       log_must $ZFS create -V 150m $name/$name/$name
+       log_must zfs create $name/$name
+       log_must zfs snapshot $name/$name@$name
+       log_must zfs clone $name/$name@$name $name/clone_$name
+       log_must zfs create -V 150m $name/$name/$name
        block_device_wait
 
-       log_must $ZPOOL destroy $name
+       log_must zpool destroy $name
 done
 
 log_pass "Valid pool names were accepted correctly."
index d54fddfe969d2a1b06097a726ea2ccd85a1053b8..4d5c83f07bec7254fb5c6406d552010ce01fe58d 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -53,27 +53,27 @@ POOLNAME=""
 function cleanup
 {
        if poolexists $POOLNAME; then
-               log_must $ZPOOL destroy $POOLNAME
+               log_must zpool destroy $POOLNAME
        fi
 
        if [[ -d $TESTDIR ]]; then
-               log_must $RM -rf $TESTDIR
+               log_must rm -rf $TESTDIR
        fi
 }
 
 log_onexit cleanup
 
-typeset exclude=`eval $ECHO \"'(${KEEP})'\"`
-for pool in $($ZPOOL list -H -o name | \
-       $EGREP -v "$exclude" | \
-       $GREP -v "$TESTPOOL" | \
-       $EGREP -v "$NO_POOLS"); do
-       log_must $ZPOOL destroy $pool
+typeset exclude=`eval echo \"'(${KEEP})'\"`
+for pool in $(zpool list -H -o name | \
+       egrep -v "$exclude" | \
+       grep -v "$TESTPOOL" | \
+       egrep -v "$NO_POOLS"); do
+       log_must zpool destroy $pool
 done
 
 DISK=${DISKS%% *}
 if [[ ! -e $TESTDIR ]]; then
-        log_must $MKDIR $TESTDIR
+        log_must mkdir $TESTDIR
 fi
 
 log_note "Ensure invalid characters fail"
@@ -83,12 +83,12 @@ for POOLNAME in "!" "\"" "#" "$" "%" "&" "'" "(" ")" \
     ":" ";" "<" "=" ">" "\?" "@" \
     "[" "]" "^" "_" "\`" "{" "|" "}" "~"
 do
-       log_mustnot $ZPOOL create -m $TESTDIR $POOLNAME $DISK
+       log_mustnot zpool create -m $TESTDIR $POOLNAME $DISK
         if poolexists $POOLNAME; then
                 log_fail "Unexpectedly created pool: '$POOLNAME'"
         fi
 
-       log_mustnot $ZPOOL destroy $POOLNAME
+       log_mustnot zpool destroy $POOLNAME
 done
 
 log_note "Check that invalid octal values fail"
@@ -99,12 +99,12 @@ for oct in "\000" "\001" "\002" "\003" "\004" "\005" "\006" "\007" \
     "\040" "\177"
 do
        POOLNAME=`eval "echo x | tr 'x' '$oct'"`
-       log_mustnot $ZPOOL create -m $TESTDIR $POOLNAME $DISK
+       log_mustnot zpool create -m $TESTDIR $POOLNAME $DISK
         if poolexists $POOLNAME; then
                 log_fail "Unexpectedly created pool: '$POOLNAME'"
         fi
 
-       log_mustnot $ZPOOL destroy $POOLNAME
+       log_mustnot zpool destroy $POOLNAME
 done
 
 log_note "Verify invalid pool names fail"
@@ -118,12 +118,12 @@ if verify_slog_support ; then
 fi
 typeset -i i=0
 while ((i < ${#POOLNAME[@]})); do
-       log_mustnot $ZPOOL create -m $TESTDIR ${POOLNAME[$i]} $DISK
+       log_mustnot zpool create -m $TESTDIR ${POOLNAME[$i]} $DISK
         if poolexists ${POOLNAME[$i]}; then
                 log_fail "Unexpectedly created pool: '${POOLNAME[$i]}'"
         fi
 
-       log_mustnot $ZPOOL destroy ${POOLNAME[$i]}
+       log_mustnot zpool destroy ${POOLNAME[$i]}
 
        ((i += 1))
 done
index 6555a0d156dc37952dfed9001c412bfc16fbe0e1..1a7c3ea4cfeae2c7d303435d81ff7218d564df9f 100755 (executable)
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 
 verify_runnable "global"
 
-log_must $ZPOOL destroy $TESTPOOL
-log_must $ZPOOL destroy $TESTPOOL2
+log_must zpool destroy $TESTPOOL
+log_must zpool destroy $TESTPOOL2
 
-log_must $RM /tmp/zpool_version_1.dat
-log_must $RM /tmp/zpool2_version_1.dat
+log_must rm /tmp/zpool_version_1.dat
+log_must rm /tmp/zpool2_version_1.dat
 
 default_cleanup
index 662221303cd3509cc96267d32a02db7696f1dd42..048cb29e3217924b9a1dcbe6b6238eab96f7226b 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -46,9 +46,9 @@ verify_runnable "global"
 log_assert "zpool set version can upgrade a pool"
 for version in 1 2 3 4 5 6 7 8
 do
-       log_must $ZPOOL set version=$version $TESTPOOL
-       ACTUAL=$($ZPOOL get version $TESTPOOL | $GREP version \
-               | $AWK '{print $3}')
+       log_must zpool set version=$version $TESTPOOL
+       ACTUAL=$(zpool get version $TESTPOOL | grep version \
+               | awk '{print $3}')
        if [ "$ACTUAL" != "$version" ]
        then
                log_fail "v. $ACTUAL set for $TESTPOOL, expected v. $version!"
index 9c51a8846a5de66376df4fe7a153bf13014a88c1..69586473eaab49ed8814fda9072c106344bab89a 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 verify_runnable "global"
 log_assert "zpool set version can only increment pool version"
 
-log_must $ZPOOL set version=6 $TESTPOOL2
+log_must zpool set version=6 $TESTPOOL2
 # verify it's actually that version - by checking the version property
 # and also by trying to set bootfs (which should fail if it is not version 6)
 
-VERSION=$($ZPOOL get version $TESTPOOL2| $GREP version | $AWK '{print $3}')
+VERSION=$(zpool get version $TESTPOOL2| grep version | awk '{print $3}')
 if [ "$VERSION" != "6" ]
 then
        log_fail "Version $VERSION set for $TESTPOOL2 expected version 6!"
 fi
-log_must $ZPOOL set bootfs=$TESTPOOL2 $TESTPOOL2
+log_must zpool set bootfs=$TESTPOOL2 $TESTPOOL2
 
 # now verify we can't downgrade the version
-log_mustnot $ZPOOL set version=5 $TESTPOOL2
-log_mustnot $ZPOOL set version=-1 $TESTPOOL2
+log_mustnot zpool set version=5 $TESTPOOL2
+log_mustnot zpool set version=-1 $TESTPOOL2
 
 # verify the version is still 6
-VERSION=$($ZPOOL get version $TESTPOOL2 | $GREP version | $AWK '{print $3}')
+VERSION=$(zpool get version $TESTPOOL2 | grep version | awk '{print $3}')
 if [ "$VERSION" != "6" ]
 then
        log_fail "Version $VERSION set for $TESTPOOL2, expected version 6!"
index aadaa906063e9af1ee059365fd048cf078c2f1c9..4c85b90f5f8872d8a61f677a6f0a35fe09103a60 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 verify_runnable "global"
 
 # create a version 1 pool
-log_must $MKFILE $MINVDEVSIZE /tmp/zpool_version_1.dat
-log_must $ZPOOL create -o version=1 $TESTPOOL /tmp/zpool_version_1.dat
+log_must mkfile $MINVDEVSIZE /tmp/zpool_version_1.dat
+log_must zpool create -o version=1 $TESTPOOL /tmp/zpool_version_1.dat
 
 
 # create another version 1 pool
-log_must $MKFILE $MINVDEVSIZE /tmp/zpool2_version_1.dat
-log_must $ZPOOL create -o version=1 $TESTPOOL2 /tmp/zpool2_version_1.dat
+log_must mkfile $MINVDEVSIZE /tmp/zpool2_version_1.dat
+log_must zpool create -o version=1 $TESTPOOL2 /tmp/zpool2_version_1.dat
 
 log_pass
index ee50ad434d7ec4ca43fc8c9aa6683ff8bb1c1816..b7a1e419fa5d005e75858bf594728c0c658b064a 100755 (executable)
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 
 verify_runnable "global"
 
-ZFS_USER=$($CAT /tmp/zfs-privs-test-user.txt)
-USES_NIS=$($CAT /tmp/zfs-privs-test-nis.txt)
+ZFS_USER=$(cat /tmp/zfs-privs-test-user.txt)
+USES_NIS=$(cat /tmp/zfs-privs-test-nis.txt)
 
 if [ "${USES_NIS}" == "true" ]
 then
-    $SVCADM enable svc:/network/nis/client:default
+    svcadm enable svc:/network/nis/client:default
 fi
 
-$USERDEL $ZFS_USER
-[[ -d /export/home/$ZFS_USER ]] && $RM -rf /export/home/$ZFS_USER
-$RM /tmp/zfs-privs-test-nis.txt
-$RM /tmp/zfs-privs-test-user.txt
+userdel $ZFS_USER
+[[ -d /export/home/$ZFS_USER ]] && rm -rf /export/home/$ZFS_USER
+rm /tmp/zfs-privs-test-nis.txt
+rm /tmp/zfs-privs-test-user.txt
 
 default_cleanup
index 5beabadb7b2006b174ac4404d5c44ffb4f44a8b8..7a2fe609500770cb3f1bca3246221d92258d3c3e 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -59,33 +59,33 @@ verify_runnable "global"
 
 log_assert "The RBAC profile \"ZFS Storage Management\" works"
 
-ZFS_USER=$($CAT /tmp/zfs-privs-test-user.txt)
+ZFS_USER=$(cat /tmp/zfs-privs-test-user.txt)
 
 # the user shouldn't be able to do anything initially
-log_mustnot $SU $ZFS_USER -c "$ZPOOL create $TESTPOOL $DISKS"
-log_mustnot $SU $ZFS_USER -c "$PFEXEC $ZPOOL create $TESTPOOL $DISKS"
+log_mustnot su $ZFS_USER -c "zpool create $TESTPOOL $DISKS"
+log_mustnot su $ZFS_USER -c "pfexec zpool create $TESTPOOL $DISKS"
 
 # the first time we assign the profile, we insist it should work
-log_must $USERMOD -P "ZFS Storage Management" $ZFS_USER
-log_must $SU $ZFS_USER -c "$PFEXEC $ZPOOL create -f $TESTPOOL $DISKS"
+log_must usermod -P "ZFS Storage Management" $ZFS_USER
+log_must su $ZFS_USER -c "pfexec zpool create -f $TESTPOOL $DISKS"
 
 # ensure the user can't create a filesystem with this profile
-log_mustnot $SU $ZFS_USER -c "$ZFS create $TESTPOOL/fs"
+log_mustnot su $ZFS_USER -c "zfs create $TESTPOOL/fs"
 
 # add ZFS File System Management profile, and try to create a fs
-log_must $USERMOD -P "ZFS File System Management" $ZFS_USER
-log_must $SU $ZFS_USER -c "$PFEXEC $ZFS create $TESTPOOL/fs"
+log_must usermod -P "ZFS File System Management" $ZFS_USER
+log_must su $ZFS_USER -c "pfexec zfs create $TESTPOOL/fs"
 
 # revoke File System Management profile
-$USERMOD -P, $ZFS_USER
-$USERMOD -P "ZFS Storage Management" $ZFS_USER
+usermod -P, $ZFS_USER
+usermod -P "ZFS Storage Management" $ZFS_USER
 
 # ensure the user can destroy pools
-log_mustnot $SU $ZFS_USER -c "$ZPOOL destroy $TESTPOOL"
-log_must $SU $ZFS_USER -c "$PFEXEC $ZPOOL destroy $TESTPOOL"
+log_mustnot su $ZFS_USER -c "zpool destroy $TESTPOOL"
+log_must su $ZFS_USER -c "pfexec zpool destroy $TESTPOOL"
 
 # revoke Storage Management profile
-$USERMOD -P, $ZFS_USER
-log_mustnot $SU $ZFS_USER -c "$PFEXEC $ZPOOL create -f $TESTPOOL $DISKS"
+usermod -P, $ZFS_USER
+log_mustnot su $ZFS_USER -c "pfexec zpool create -f $TESTPOOL $DISKS"
 
 log_pass "The RBAC profile \"ZFS Storage Management\" works"
index 7935985f3cf85c8a42866a4e21c83a7616660321..dcccb5401f39025dd140d5e1274d85567fc07127 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -62,40 +62,40 @@ verify_runnable "both"
 
 log_assert "The RBAC profile \"ZFS File System Management\" works"
 
-ZFS_USER=$($CAT /tmp/zfs-privs-test-user.txt)
+ZFS_USER=$(cat /tmp/zfs-privs-test-user.txt)
 
 # Set a $DATASET where we can create child files systems
 if is_global_zone; then
-       log_must $ZPOOL create -f $TESTPOOL $DISKS
+       log_must zpool create -f $TESTPOOL $DISKS
        DATASET=$TESTPOOL
 else
        DATASET=zonepool/zonectr0
 fi
 
 # A user shouldn't be able to create filesystems
-log_mustnot $SU $ZFS_USER -c "$ZFS create $DATASET/zfsprivfs"
+log_mustnot su $ZFS_USER -c "zfs create $DATASET/zfsprivfs"
 
 # Insist this invocation of usermod works
-log_must $USERMOD -P "ZFS File System Management" $ZFS_USER
+log_must usermod -P "ZFS File System Management" $ZFS_USER
 
 # Now try to create file systems as the user
-log_mustnot $SU $ZFS_USER -c "$ZFS create $DATASET/zfsprivfs"
-log_must $SU $ZFS_USER -c "$PFEXEC $ZFS create $DATASET/zfsprivfs"
+log_mustnot su $ZFS_USER -c "zfs create $DATASET/zfsprivfs"
+log_must su $ZFS_USER -c "pfexec zfs create $DATASET/zfsprivfs"
 
 # Ensure the user can't do anything to pools in this state:
-log_mustnot $SU $ZFS_USER -c "$ZPOOL destroy $DATASET"
-log_mustnot $SU $ZFS_USER -c "$PFEXEC $ZPOOL destroy $DATASET"
+log_mustnot su $ZFS_USER -c "zpool destroy $DATASET"
+log_mustnot su $ZFS_USER -c "pfexec zpool destroy $DATASET"
 
 # revoke File System Management profile
-$USERMOD -P, $ZFS_USER
+usermod -P, $ZFS_USER
 
 # Ensure the user can't create more filesystems
-log_mustnot $SU $ZFS_USER -c "$ZFS create $DATASET/zfsprivfs2"
-log_mustnot $SU $ZFS_USER -c "$PFEXEC $ZFS create $DATASET/zfsprivfs2"
+log_mustnot su $ZFS_USER -c "zfs create $DATASET/zfsprivfs2"
+log_mustnot su $ZFS_USER -c "pfexec zfs create $DATASET/zfsprivfs2"
 
 # assign the profile again and destroy the fs.
-$USERMOD -P "ZFS File System Management" $ZFS_USER
-log_must $SU $ZFS_USER -c "$PFEXEC $ZFS destroy $DATASET/zfsprivfs"
-$USERMOD -P, $ZFS_USER
+usermod -P "ZFS File System Management" $ZFS_USER
+log_must su $ZFS_USER -c "pfexec zfs destroy $DATASET/zfsprivfs"
+usermod -P, $ZFS_USER
 
 log_pass "The RBAC profile \"ZFS File System Management\" works"
index 0f53b8cc895e24ac6b36eb5b9d5e01073d5582c1..d8e79d1a2333c0336c2c5333e91a6e79d10ef3c6 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -36,10 +36,10 @@ USES_NIS=false
 
 # if we're running NIS, turn it off until we clean up
 # (it can cause useradd to take a long time, hitting our TIMEOUT)
-$SVCS svc:/network/nis/client:default | $GREP online > /dev/null
+svcs svc:/network/nis/client:default | grep online > /dev/null
 if [ $? -eq 0 ]
 then
-  $SVCADM disable svc:/network/nis/client:default
+  svcadm disable svc:/network/nis/client:default
   USES_NIS=true
 fi
 
@@ -58,8 +58,8 @@ do
   fi
 done
 
-log_must $MKDIR -p /export/home/$ZFS_USER
-log_must $USERADD -c "ZFS Privileges Test User" -d /export/home/$ZFS_USER $ZFS_USER
+log_must mkdir -p /export/home/$ZFS_USER
+log_must useradd -c "ZFS Privileges Test User" -d /export/home/$ZFS_USER $ZFS_USER
 
 echo $ZFS_USER > /tmp/zfs-privs-test-user.txt
 echo $USES_NIS > /tmp/zfs-privs-test-nis.txt
index bde0a37e29d9b162616e4c30737a26f65c692d7d..082a77c03372b02dac650130e66d3d520b2eeb12 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/quota/quota.cfg
@@ -48,19 +48,19 @@ function fill_quota
        typeset FILESYSTEM="$1"
        typeset MNTPT="$2"
 
-       log_must $ZFS set quota=$QUOTA_VALUE $FILESYSTEM
+       log_must zfs set quota=$QUOTA_VALUE $FILESYSTEM
 
        typeset -i write_size=0
        (( write_size = 2 * QUOTA_VALUE ))
 
        typeset -i zret=0
-       $FILE_WRITE -o create -f $MNTPT/$TESTFILE1 -b $BLOCK_SIZE \
+       file_write -o create -f $MNTPT/$TESTFILE1 -b $BLOCK_SIZE \
                 -c $write_size -d 0
        zret=$?
         [[ $zret -ne $EDQUOT ]] && \
             log_fail "Returned error code: $zret. Expected: $EDQUOT."
 
-       typeset -i file_size=`$LS -lsk $MNTPT/$TESTFILE1 | $AWK '{ print $1 }'`
+       typeset -i file_size=`ls -lsk $MNTPT/$TESTFILE1 | awk '{ print $1 }'`
        typeset -i limit=0
        (( file_size = file_size * 1024 ))
        (( limit = QUOTA_VALUE + TOLERANCE ))
@@ -86,7 +86,7 @@ function exceed_quota
        # Writing a file without API to access return code
        #
        log_note "Creating a file in a FS that has already exceeded its quota"
-       $FILE_WRITE -o create -f $MNTPT/$TESTFILE2 \
+       file_write -o create -f $MNTPT/$TESTFILE2 \
                -b $BLOCK_SIZE -c $write_size -d 0
        zret=$?
        [[ $zret -ne $EDQUOT ]] && \
index 6c5cf368b82cc45b877e050f4227607117708715..9364a9f60f1cc12573627768d04a02bd27a87060 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -56,7 +56,7 @@ log_assert "Verify that file size is limited by the file system quota"
 function cleanup
 {
        [[ -e $TESTDIR/$TESTFILE1 ]] && \
-           log_must $RM $TESTDIR/$TESTFILE1
+           log_must rm $TESTDIR/$TESTFILE1
        #
        # Need to allow time for space to be released back to
        # pool, otherwise next test will fail trying to set a
index 6de5feafb271a055254a201c650f97853ade42a5..c54968bbccc71668c18dd64ae4f976244742501e 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -57,10 +57,10 @@ log_assert "Verify that a file write cannot exceed the file system quota"
 function cleanup
 {
         [[ -e $TESTDIR/$TESTFILE1 ]] && \
-            log_must $RM $TESTDIR/$TESTFILE1
+            log_must rm $TESTDIR/$TESTFILE1
 
        [[ -e $TESTDIR/$TESTFILE2 ]] && \
-            log_must $RM $TESTDIR/$TESTFILE2
+            log_must rm $TESTDIR/$TESTFILE2
 }
 
 log_onexit cleanup
index afcc4a14c405cac5324cc5a90dd2e6538f9469bf..bec2243f9f36f2e0bd6621acd983d54dcf1fe161 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -58,7 +58,7 @@ log_assert "Verify that file size is limited by the file system quota" \
 function cleanup
 {
        [[ -e $TESTDIR1/$TESTFILE1 ]] && \
-           log_must $RM $TESTDIR1/$TESTFILE1
+           log_must rm $TESTDIR1/$TESTFILE1
 
        #
         # Need to allow time for space to be released back to
index 50106cad7af7068b4f23e08400e42e45c2ea3cc3..cc62d8fa96c7724c4af2aba5ee6ecc8e8e39e0f3 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -58,10 +58,10 @@ log_assert "Verify that a file write cannot exceed the file system quota" \
 function cleanup
 {
         [[ -e $TESTDIR1/$TESTFILE1 ]] && \
-            log_must $RM $TESTDIR1/$TESTFILE1
+            log_must rm $TESTDIR1/$TESTFILE1
 
        [[ -e $TESTDIR1/$TESTFILE2 ]] && \
-            log_must $RM $TESTDIR1/$TESTFILE2
+            log_must rm $TESTDIR1/$TESTFILE2
 }
 
 log_onexit cleanup
index 55bddb530204737d77dc2bb1b7049adec12e45f4..ed28cc1f0c9bcb0995482e231962a2fd0ecabbd3 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -49,9 +49,9 @@ verify_runnable "both"
 function cleanup
 {
        datasetexists $fs_child && \
-               log_must $ZFS destroy $fs_child
+               log_must zfs destroy $fs_child
 
-       log_must $ZFS set quota=$quota_val $fs
+       log_must zfs set quota=$quota_val $fs
 }
 
 log_onexit cleanup
@@ -66,9 +66,9 @@ space_avail=$(get_prop available $fs)
 quota_val=$(get_prop quota $fs)
 typeset -i quotasize=$space_avail
 ((quotasize = quotasize * 2 ))
-log_must $ZFS set quota=$quotasize $fs
+log_must zfs set quota=$quotasize $fs
 
-log_must $ZFS create $fs_child
+log_must zfs create $fs_child
 quota_space=$(get_prop quota $fs_child)
 [[ $quota_space == $quotasize ]] && \
        log_fail "The quota of child dataset inherits its value from parent."
index a22520c69987525b5b42d46b746aaaf8b4bc4f40..ca5ea5f82f5a835623d082075f5c748889ff9ea8 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -50,7 +50,7 @@ log_assert "Verify cannot set quota lower than the space currently in use"
 
 function cleanup
 {
-       log_must $ZFS set quota=none $TESTPOOL/$TESTFS
+       log_must zfs set quota=none $TESTPOOL/$TESTFS
 }
 
 log_onexit cleanup
@@ -64,8 +64,8 @@ quota_fp_size=${quota_integer_size}.123
 
 for size in 0 -1 $quota_integer_size -$quota_integer_size $quota_fp_size -$quota_fp_size \
        $invalid_size ; do
-       log_mustnot $ZFS set quota=$size $TESTPOOL/$TESTFS
+       log_mustnot zfs set quota=$size $TESTPOOL/$TESTFS
 done
-log_must $ZFS set quota=$space_used $TESTPOOL/$TESTFS
+log_must zfs set quota=$space_used $TESTPOOL/$TESTFS
 
 log_pass "As expected cannot set quota lower than space currently in use"
index 158ce678dd1231320c46a2d9c3b6488fa62a1f66..4c105b9411c11254f76386d35339b1945a8f3e1a 100755 (executable)
@@ -33,6 +33,6 @@
 #      This option should make raidz_test to return non 0.
 #
 
-log_mustnot $RAIDZ_TEST -T
+log_mustnot raidz_test -T
 
 log_pass "raidz_test detects errors as espected."
index b33bd1b906aeda38af1a485147ab895f668239f4..e238a881b05486eaf1b263065f5720809724b106 100755 (executable)
@@ -36,6 +36,6 @@
 #      is set to 5min, but actual runtime might be longer.
 #
 
-log_must $RAIDZ_TEST -S -t 300
+log_must raidz_test -S -t 300
 
 log_pass "raidz_test parameter sweep test succeeded."
index 64c3a04928e1bc808fd94fa3f57651b64ecb8aa7..ab36d00de945ef10d08cbc4715faf5ea0e8c0fa4 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -39,7 +39,7 @@ function cleanup
        typeset dir
        for dir in $TESTDIR $BASEDIR; do
                if [[ -d $dir ]]; then
-                       log_must $RM -rf $dir
+                       log_must rm -rf $dir
                fi
        done
 }
@@ -63,7 +63,7 @@ function random
                fi
        done
 
-       $ECHO $value
+       echo $value
 }
 
 #
@@ -79,16 +79,16 @@ function record_data
        typeset recordfile=$2
 
        [[ -z $pool ]] && log_fail "No specified pool."
-       [[ -f $recordfile ]] && log_must $RM -f $recordfile
+       [[ -f $recordfile ]] && log_must rm -f $recordfile
 
        typeset mntpnt
        mntpnt=$(get_prop mountpoint $pool)
-       log_must eval "$DU -a $mntpnt > $recordfile 2>&1"
+       log_must eval "du -a $mntpnt > $recordfile 2>&1"
        #
        # When the data was damaged, checksum is failing and return 1
        # So, will not use log_must
        #
-       $FIND $mntpnt -type f -exec $CKSUM {} + >> $recordfile 2>&1
+       find $mntpnt -type f -exec cksum {} + >> $recordfile 2>&1
 }
 
 #
@@ -112,29 +112,29 @@ function setup_test_env
        done
 
        if [[ ! -d $BASEDIR ]]; then
-               log_must $MKDIR $BASEDIR
+               log_must mkdir $BASEDIR
        fi
 
        if poolexists $pool ; then
                destroy_pool $pool
        fi
 
-       log_must $MKFILE $MINVDEVSIZE $vdevs
+       log_must mkfile $MINVDEVSIZE $vdevs
 
-       log_must $ZPOOL create -m $TESTDIR $pool $keyword $vdevs
+       log_must zpool create -m $TESTDIR $pool $keyword $vdevs
 
        log_note "Filling up the filesystem ..."
        typeset -i ret=0
        typeset -i i=0
        typeset file=$TESTDIR/file
-       while $TRUE ; do
-               $FILE_WRITE -o create -f $file.$i \
+       while true ; do
+               file_write -o create -f $file.$i \
                        -b $BLOCKSZ -c $NUM_WRITES
                ret=$?
                (( $ret != 0 )) && break
                (( i = i + 1 ))
        done
-       (($ret != 28 )) && log_note "$FILE_WRITE return value($ret) is unexpected."
+       (($ret != 28 )) && log_note "file_write return value($ret) is unexpected."
 
        record_data $TESTPOOL $PRE_RECORD_FILE
 }
@@ -149,21 +149,21 @@ function is_healthy
        typeset pool=$1
 
        typeset healthy_output="pool '$pool' is healthy"
-       typeset real_output=$($ZPOOL status -x $pool)
+       typeset real_output=$(zpool status -x $pool)
 
        if [[ "$real_output" == "$healthy_output" ]]; then
                return 0
        else
                typeset -i ret
-               $ZPOOL status -x $pool | $GREP "state:" | \
-                       $GREP "FAULTED" >/dev/null 2>&1
+               zpool status -x $pool | grep "state:" | \
+                       grep "FAULTED" >/dev/null 2>&1
                ret=$?
                (( $ret == 0 )) && return 1
                typeset l_scan
                typeset errnum
-               l_scan=$($ZPOOL status -x $pool | $GREP "scan:")
+               l_scan=$(zpool status -x $pool | grep "scan:")
                l_scan=${l_scan##*"with"}
-               errnum=$($ECHO $l_scan | $AWK '{print $1}')
+               errnum=$(echo $l_scan | awk '{print $1}')
 
                return $errnum
        fi
@@ -179,7 +179,7 @@ function is_data_valid
        typeset pool=$1
 
        record_data $pool $PST_RECORD_FILE
-       if ! $DIFF $PRE_RECORD_FILE $PST_RECORD_FILE > /dev/null 2>&1; then
+       if ! diff $PRE_RECORD_FILE $PST_RECORD_FILE > /dev/null 2>&1; then
                return 1
        fi
 
@@ -197,20 +197,20 @@ function get_vdevs #pool cnt
        typeset pool=$1
        typeset -i cnt=$2
 
-       typeset all_devs=$($ZPOOL iostat -v $pool | $AWK '{print $1}'| \
-               $EGREP -v "^pool$|^capacity$|^mirror$|^raidz1$|^raidz2$|---" | \
-               $EGREP -v "/old$|^$pool$")
+       typeset all_devs=$(zpool iostat -v $pool | awk '{print $1}'| \
+               egrep -v "^pool$|^capacity$|^mirror$|^raidz1$|^raidz2$|---" | \
+               egrep -v "/old$|^$pool$")
        typeset -i i=0
        typeset vdevs
        while ((i < cnt)); do
-               typeset dev=$($ECHO $all_devs | $AWK '{print $1}')
+               typeset dev=$(echo $all_devs | awk '{print $1}')
                eval all_devs=\${all_devs##*$dev}
 
                vdevs="$dev $vdevs"
                ((i += 1))
        done
 
-       $ECHO "$vdevs"
+       echo "$vdevs"
 }
 
 #
@@ -226,13 +226,13 @@ function replace_missing_devs
 
        typeset vdev
        for vdev in $@; do
-               log_must $GNUDD if=/dev/zero of=$vdev \
+               log_must gnudd if=/dev/zero of=$vdev \
                    bs=1024k count=$(($MINDEVSIZE / (1024 * 1024))) \
                    oflag=fdatasync
-               log_must $ZPOOL replace -f $pool $vdev $vdev
+               log_must zpool replace -f $pool $vdev $vdev
                while true; do
                        if ! is_pool_resilvered $pool ; then
-                               log_must $SLEEP 2
+                               log_must sleep 2
                        else
                                break
                        fi
@@ -260,12 +260,12 @@ function damage_devs
        typeset dev
        if [[ -n $label ]]; then
                for dev in $vdevs; do
-                       $DD if=/dev/zero of=$dev seek=512 bs=1024 \
+                       dd if=/dev/zero of=$dev seek=512 bs=1024 \
                            count=$bs_count conv=notrunc >/dev/null 2>&1
                done
        else
                for dev in $vdevs; do
-                       $DD if=/dev/zero of=$dev bs=1024 count=$bs_count \
+                       dd if=/dev/zero of=$dev bs=1024 count=$bs_count \
                            conv=notrunc >/dev/null 2>&1
                done
        fi
@@ -282,7 +282,7 @@ function clear_errors
 {
        typeset pool=$1
 
-       log_must $ZPOOL clear $pool
+       log_must zpool clear $pool
 
        if ! is_healthy $pool ; then
                log_note "$pool should be healthy."
@@ -309,7 +309,7 @@ function remove_devs
        typeset vdevs
 
        vdevs=$(get_vdevs $pool $cnt)
-       log_must $RM -f $vdevs
+       log_must rm -f $vdevs
 
        sync_pool $pool
 }
index 0d40c576a213d4530ce004836c0f6fc2d6754fd5..4332736a1ae53e7fe9ca3814a89b8e823b8fdb75 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/redundancy/redundancy.kshlib
@@ -54,7 +54,7 @@ typeset -i cnt=$(random 2 5)
 setup_test_env $TESTPOOL "" $cnt
 
 damage_devs $TESTPOOL 1 "keep_label"
-log_must $ZPOOL clear $TESTPOOL
+log_must zpool clear $TESTPOOL
 
 # Wait for the scrub intiated by the clear to wrap, or is_healthy will be wrong.
 while ! is_pool_scrubbed $TESTPOOL; do
index 9f974d89b246f85bf2562529109b5c28c74b73ab..411fab8459af662dd7c6e47fa658f3871a4bb5df 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,9 +47,9 @@ verify_runnable "both"
 
 function cleanup
 {
-       log_must $ZFS destroy -rf $TESTPOOL/$TESTFS
-       log_must $ZFS create $TESTPOOL/$TESTFS
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       log_must zfs destroy -rf $TESTPOOL/$TESTFS
+       log_must zfs create $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 }
 
 log_assert "refquota limits the amount of space a dataset can consume, " \
@@ -58,20 +58,20 @@ log_onexit cleanup
 
 fs=$TESTPOOL/$TESTFS
 sub=$fs/sub
-log_must $ZFS create $sub
+log_must zfs create $sub
 
-log_must $ZFS set refquota=10M $fs
+log_must zfs set refquota=10M $fs
 mntpnt=$(get_prop mountpoint $fs)
 
-log_mustnot $MKFILE 11M $mntpnt/file
-log_must $MKFILE 9M $mntpnt/file
-log_must $ZFS snapshot $fs@snap
-log_mustnot $MKFILE 2M $mntpnt/file2
+log_mustnot mkfile 11M $mntpnt/file
+log_must mkfile 9M $mntpnt/file
+log_must zfs snapshot $fs@snap
+log_mustnot mkfile 2M $mntpnt/file2
 
 mntpnt=$(get_prop mountpoint $sub)
-log_must $MKFILE 10M $mntpnt/file
-log_must $ZFS snapshot $sub@snap
-log_must $MKFILE 10 $mntpnt/file2
+log_must mkfile 10M $mntpnt/file
+log_must zfs snapshot $sub@snap
+log_must mkfile 10 $mntpnt/file2
 
 log_pass "refquota limits the amount of space a dataset can consume, " \
        "but does not include space used by descendents."
index 7ee5967f7f7ba65c5b3225cd95a5436db4f89022..e1d3aa82033cb4773bebfb549cbdca402939c0ec 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,9 +47,9 @@ verify_runnable "both"
 
 function cleanup
 {
-       log_must $ZFS destroy -rf $TESTPOOL/$TESTFS
-       log_must $ZFS create $TESTPOOL/$TESTFS
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       log_must zfs destroy -rf $TESTPOOL/$TESTFS
+       log_must zfs create $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 }
 
 log_assert "Quotas are enforced using the minimum of the two properties"
@@ -57,11 +57,11 @@ log_onexit cleanup
 
 TESTFILE='testfile'
 fs=$TESTPOOL/$TESTFS
-log_must $ZFS set quota=15M $fs
-log_must $ZFS set refquota=25M $fs
+log_must zfs set quota=15M $fs
+log_must zfs set refquota=25M $fs
 
 mntpnt=$(get_prop mountpoint $fs)
-log_mustnot $MKFILE 20M $mntpnt/$TESTFILE
+log_mustnot mkfile 20M $mntpnt/$TESTFILE
 typeset -i used quota
 used=$(get_prop used $fs)
 quota=$(get_prop quota $fs)
@@ -74,11 +74,11 @@ fi
 #
 # Switch the value of them and try again
 #
-log_must $RM $mntpnt/$TESTFILE
-log_must $ZFS set quota=25M $fs
-log_must $ZFS set refquota=15M $fs
+log_must rm $mntpnt/$TESTFILE
+log_must zfs set quota=25M $fs
+log_must zfs set refquota=15M $fs
 
-log_mustnot $MKFILE 20M $mntpnt/$TESTFILE
+log_mustnot mkfile 20M $mntpnt/$TESTFILE
 used=$(get_prop used $fs)
 refquota=$(get_prop refquota $fs)
 ((used = used / (1024 * 1024)))
index 8026e7d6c280b9c32546368ab720e02708424144..e4def1a0a7b4a8fb5cd2f418274d2f4697690939 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,9 +45,9 @@ verify_runnable "both"
 
 function cleanup
 {
-       log_must $ZFS destroy -rf $TESTPOOL/$TESTFS
-       log_must $ZFS create $TESTPOOL/$TESTFS
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       log_must zfs destroy -rf $TESTPOOL/$TESTFS
+       log_must zfs create $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 }
 
 log_assert "Sub-filesystem quotas are not enforced by property 'refquota'"
@@ -55,12 +55,12 @@ log_onexit cleanup
 
 TESTFILE='testfile'
 fs=$TESTPOOL/$TESTFS
-log_must $ZFS set quota=25M $fs
-log_must $ZFS set refquota=10M $fs
-log_must $ZFS create $fs/subfs
+log_must zfs set quota=25M $fs
+log_must zfs set refquota=10M $fs
+log_must zfs create $fs/subfs
 
 mntpnt=$(get_prop mountpoint $fs/subfs)
-log_must $MKFILE 20M $mntpnt/$TESTFILE
+log_must mkfile 20M $mntpnt/$TESTFILE
 
 typeset -i used quota refquota
 used=$(get_prop used $fs)
@@ -71,7 +71,7 @@ if [[ $used -lt $refquota ]]; then
        log_fail "ERROR: $used < $refquota subfs quotas are limited by refquota"
 fi
 
-log_mustnot $MKFILE 20M $mntpnt/$TESTFILE.2
+log_mustnot mkfile 20M $mntpnt/$TESTFILE.2
 used=$(get_prop used $fs)
 quota=$(get_prop quota $fs)
 ((used = used / (1024 * 1024)))
index 2d7902e4e599a32b45638a235f84886456bf0534..291cfbd25cb3276afb155f607b6867abe5cc9acc 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,9 +45,9 @@ verify_runnable "both"
 
 function cleanup
 {
-       log_must $ZFS destroy -rf $TESTPOOL/$TESTFS
-       log_must $ZFS create $TESTPOOL/$TESTFS
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       log_must zfs destroy -rf $TESTPOOL/$TESTFS
+       log_must zfs create $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 }
 
 log_assert "refquotas are not limited by snapshots."
@@ -55,15 +55,15 @@ log_onexit cleanup
 
 TESTFILE='testfile'
 fs=$TESTPOOL/$TESTFS
-log_must $ZFS set quota=25M $fs
-log_must $ZFS set refquota=15M $fs
+log_must zfs set quota=25M $fs
+log_must zfs set refquota=15M $fs
 
 mntpnt=$(get_prop mountpoint $fs)
 typeset -i i=0
 while ((i < 3)); do
-       log_must $MKFILE 7M $mntpnt/$TESTFILE.$i
-       log_must $ZFS snapshot $fs@snap.$i
-       log_must $RM $mntpnt/$TESTFILE.$i
+       log_must mkfile 7M $mntpnt/$TESTFILE.$i
+       log_must zfs snapshot $fs@snap.$i
+       log_must rm $mntpnt/$TESTFILE.$i
 
        ((i += 1))
 done
@@ -71,6 +71,6 @@ done
 #
 # Verify out of the limitation of 'quota'
 #
-log_mustnot $MKFILE 7M $mntpnt/$TESTFILE
+log_mustnot mkfile 7M $mntpnt/$TESTFILE
 
 log_pass "refquotas are not limited by snapshots."
index 33dd9c3d9d43c2bf29dfda626e1b58e03da9d09a..13977bc3b48feef1be2fb325e634827221869324 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,9 +45,9 @@ verify_runnable "both"
 
 function cleanup
 {
-       log_must $ZFS destroy -rf $TESTPOOL/$TESTFS
-       log_must $ZFS create $TESTPOOL/$TESTFS
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       log_must zfs destroy -rf $TESTPOOL/$TESTFS
+       log_must zfs create $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 }
 
 log_assert "refquotas are not limited by sub-filesystem snapshots."
@@ -55,16 +55,16 @@ log_onexit cleanup
 
 TESTFILE='testfile'
 fs=$TESTPOOL/$TESTFS
-log_must $ZFS set quota=25M $fs
-log_must $ZFS set refquota=15M $fs
-log_must $ZFS create $fs/subfs
+log_must zfs set quota=25M $fs
+log_must zfs set refquota=15M $fs
+log_must zfs create $fs/subfs
 
 mntpnt=$(get_prop mountpoint $fs/subfs)
 typeset -i i=0
 while ((i < 3)); do
-       log_must $MKFILE 7M $mntpnt/$TESTFILE.$i
-       log_must $ZFS snapshot $fs/subfs@snap.$i
-       log_must $RM $mntpnt/$TESTFILE.$i
+       log_must mkfile 7M $mntpnt/$TESTFILE.$i
+       log_must zfs snapshot $fs/subfs@snap.$i
+       log_must rm $mntpnt/$TESTFILE.$i
 
        ((i += 1))
 done
@@ -72,6 +72,6 @@ done
 #
 # Verify out of the limitation of 'quota'
 #
-log_mustnot $MKFILE 7M $mntpnt/$TESTFILE
+log_mustnot mkfile 7M $mntpnt/$TESTFILE
 
 log_pass "refquotas are not limited by sub-filesystem snapshots"
index 18b0a4f10ac4cc64a536a871329d01cd1a0240b7..39b317512df2a1667b8c3c3b840c94f62fc675a1 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,8 +45,8 @@ verify_runnable "both"
 
 function cleanup
 {
-       log_must $ZFS set refquota=none $TESTPOOL/$TESTFS
-       log_must $ZFS set refreserv=none $TESTPOOL/$TESTFS
+       log_must zfs set refquota=none $TESTPOOL/$TESTFS
+       log_must zfs set refreserv=none $TESTPOOL/$TESTFS
 }
 
 log_assert "'zfs set refquota' can handle incorrect arguments correctly."
@@ -61,8 +61,8 @@ set -A badopt \
 
 typeset -i i=0
 while ((i < ${#badopt[@]})); do
-       log_mustnot $ZFS set refquota=${badopt[$i]} $TESTPOOL/$TESTFS
-       log_mustnot $ZFS set refreserv=${badopt[$i]} $TESTPOOL/$TESTFS
+       log_mustnot zfs set refquota=${badopt[$i]} $TESTPOOL/$TESTFS
+       log_mustnot zfs set refreserv=${badopt[$i]} $TESTPOOL/$TESTFS
 
        ((i += 1))
 done
index f0f45ac70ae6f4fa29f6c19ff590d2ebee552383..527949f27c1095042f2c6573fac9d8c3c573d56c 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,9 +47,9 @@ verify_runnable "both"
 
 function cleanup
 {
-       log_must $ZFS destroy -rf $TESTPOOL/$TESTFS
-       log_must $ZFS create $TESTPOOL/$TESTFS
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       log_must zfs destroy -rf $TESTPOOL/$TESTFS
+       log_must zfs create $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 }
 
 log_assert "Reservations are enforced using the maximum of " \
@@ -57,19 +57,19 @@ log_assert "Reservations are enforced using the maximum of " \
 log_onexit cleanup
 
 fs=$TESTPOOL/$TESTFS ; subfs=$fs/subfs
-log_must $ZFS create $subfs
-log_must $ZFS set quota=25M $fs
+log_must zfs create $subfs
+log_must zfs set quota=25M $fs
 
-log_must $ZFS set reserv=10M $subfs
-log_must $ZFS set refreserv=20M $subfs
+log_must zfs set reserv=10M $subfs
+log_must zfs set refreserv=20M $subfs
 mntpnt=$(get_prop mountpoint $fs)
-log_mustnot $MKFILE 15M $mntpnt/$TESTFILE
+log_mustnot mkfile 15M $mntpnt/$TESTFILE
 
-log_must $RM -f $mntpnt/$TESTFILE
+log_must rm -f $mntpnt/$TESTFILE
 
-log_must $ZFS set reserv=20M $subfs
-log_must $ZFS set refreserv=10M $subfs
-log_mustnot $MKFILE 15M $mntpnt/$TESTFILE
+log_must zfs set reserv=20M $subfs
+log_must zfs set refreserv=10M $subfs
+log_mustnot mkfile 15M $mntpnt/$TESTFILE
 
 log_pass "Reservations are enforced using the maximum of " \
        "'reserv' and 'refreserv'"
index 7a39a8dae8d514c673c7e827de6b701f7397673b..d4c0a4faebdc36121fc65c1638635d862ea286ea 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,15 +48,15 @@ verify_runnable "both"
 function cleanup
 {
        if is_global_zone ; then
-               log_must $ZFS set refreservation=none $TESTPOOL
+               log_must zfs set refreservation=none $TESTPOOL
 
                if datasetexists $TESTPOOL@snap ; then
-                       log_must $ZFS destroy -f $TESTPOOL@snap
+                       log_must zfs destroy -f $TESTPOOL@snap
                fi
        fi
-       log_must $ZFS destroy -rf $TESTPOOL/$TESTFS
-       log_must $ZFS create $TESTPOOL/$TESTFS
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       log_must zfs destroy -rf $TESTPOOL/$TESTFS
+       log_must zfs create $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 }
 
 # This function iteratively increases refreserv to its highest possible
@@ -68,9 +68,9 @@ function max_refreserv
        typeset -i incsize=131072
        typeset -i rr=$(get_prop available $ds)
 
-       log_must $ZFS set refreserv=$rr $ds
+       log_must zfs set refreserv=$rr $ds
        while :; do
-               $ZFS set refreserv=$((rr + incsize)) $ds >/dev/null 2>&1
+               zfs set refreserv=$((rr + incsize)) $ds >/dev/null 2>&1
                if [[ $? == 0 ]]; then
                        ((rr += incsize))
                        continue
@@ -86,7 +86,7 @@ log_assert "Setting full size as refreservation, verify no snapshot " \
        "can be created."
 log_onexit cleanup
 
-log_must $ZFS create $TESTPOOL/$TESTFS/subfs
+log_must zfs create $TESTPOOL/$TESTFS/subfs
 
 typeset datasets
 if is_global_zone; then
@@ -99,15 +99,15 @@ for ds in $datasets; do
        #
        # Verify refreservation on dataset
        #
-       log_must $ZFS set quota=25M $ds
+       log_must zfs set quota=25M $ds
        max_refreserv $ds
-       log_mustnot $ZFS snapshot $ds@snap
+       log_mustnot zfs snapshot $ds@snap
        if datasetexists $ds@snap ; then
                log_fail "ERROR: $ds@snap should not exists."
        fi
 
-       log_must $ZFS set quota=none $ds
-       log_must $ZFS set refreservation=none $ds
+       log_must zfs set quota=none $ds
+       log_must zfs set refreservation=none $ds
 done
 
 log_pass "Setting full size as refreservation, verify no snapshot " \
index 17382918e987e06f18e0c7632d6802f5e1e41b5c..da36609f2c4149cd7eade34de9678fd07368ecab 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,9 +47,9 @@ verify_runnable "both"
 
 function cleanup
 {
-       log_must $ZFS destroy -rf $TESTPOOL/$TESTFS
-       log_must $ZFS create $TESTPOOL/$TESTFS
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       log_must zfs destroy -rf $TESTPOOL/$TESTFS
+       log_must zfs create $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 }
 
 log_assert "Verify a snapshot will only be allowed if there is enough " \
@@ -57,18 +57,18 @@ log_assert "Verify a snapshot will only be allowed if there is enough " \
 log_onexit cleanup
 
 fs=$TESTPOOL/$TESTFS
-log_must $ZFS set quota=25M $fs
-log_must $ZFS set refreservation=10M $fs
+log_must zfs set quota=25M $fs
+log_must zfs set refreservation=10M $fs
 
 mntpnt=$(get_prop mountpoint $fs)
-log_must $MKFILE 7M $mntpnt/$TESTFILE
-log_must $ZFS snapshot $fs@snap
+log_must mkfile 7M $mntpnt/$TESTFILE
+log_must zfs snapshot $fs@snap
 
-log_must $MKFILE 7M $mntpnt/$TESTFILE.2
-log_must $ZFS snapshot $fs@snap2
+log_must mkfile 7M $mntpnt/$TESTFILE.2
+log_must zfs snapshot $fs@snap2
 
-log_must $MKFILE 7M $mntpnt/$TESTFILE.3
-log_mustnot $ZFS snapshot $fs@snap3
+log_must mkfile 7M $mntpnt/$TESTFILE.3
+log_mustnot zfs snapshot $fs@snap3
 if datasetexists $fs@snap3 ; then
        log_fail "ERROR: $fs@snap3 should not exists."
 fi
index 8238573ef543b9babf928a0ae0c69c48a62e43d4..529d918c36954478601f89ad20f300782f09640a 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,18 +47,18 @@ verify_runnable "both"
 function cleanup
 {
        if is_global_zone ; then
-               log_must $ZFS set refreservation=none $TESTPOOL
+               log_must zfs set refreservation=none $TESTPOOL
        fi
-       log_must $ZFS destroy -rf $TESTPOOL/$TESTFS
-       log_must $ZFS create $TESTPOOL/$TESTFS
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       log_must zfs destroy -rf $TESTPOOL/$TESTFS
+       log_must zfs create $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 }
 
 log_assert "Verify refreservation is limited by available space."
 log_onexit cleanup
 
 pool=$TESTPOOL ; fs=$pool/$TESTFS ; subfs=$fs/subfs
-log_must $ZFS create $subfs
+log_must zfs create $subfs
 
 typeset datasets
 if is_global_zone; then
@@ -68,23 +68,23 @@ else
 fi
 
 for ds in $datasets; do
-       log_must $ZFS set quota=25M $ds
-       log_must $ZFS set refreservation=15M $ds
+       log_must zfs set quota=25M $ds
+       log_must zfs set refreservation=15M $ds
 
        typeset -i avail
        avail=$(get_prop avail $subfs)
-       log_must $ZFS set refreservation=$avail $subfs
+       log_must zfs set refreservation=$avail $subfs
        typeset mntpnt
        mntpnt=$(get_prop mountpoint $subfs)
-       log_must $MKFILE $avail $mntpnt/$TESTFILE
+       log_must mkfile $avail $mntpnt/$TESTFILE
 
        typeset -i exceed
        ((exceed = avail + 1))
-       log_mustnot $ZFS set refreservation=$exceed $subfs
-       log_mustnot $MKFILE $avail $mntpnt/$TESTFILE
+       log_mustnot zfs set refreservation=$exceed $subfs
+       log_mustnot mkfile $avail $mntpnt/$TESTFILE
 
-       log_must $ZFS set quota=none $ds
-       log_must $ZFS set reservation=15M $ds
+       log_must zfs set quota=none $ds
+       log_must zfs set reservation=15M $ds
 done
 
 log_pass "Verify refreservation is limited by available space."
index 5f9b8ad490d6f9e0ca4639f817097c3cec6ad5b9..a43dd84327d1e16f43c4039fd2b83d91188016b7 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -46,26 +46,26 @@ verify_runnable "global"
 
 function cleanup
 {
-       log_must $ZFS destroy -rf $TESTPOOL/$TESTFS
-       log_must $ZFS create $TESTPOOL/$TESTFS
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       log_must zfs destroy -rf $TESTPOOL/$TESTFS
+       log_must zfs create $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 }
 
 log_assert "Volume refreservation is limited by volsize"
 log_onexit cleanup
 
 fs=$TESTPOOL/$TESTFS; vol=$fs/vol
-log_must $ZFS create -V 10M $vol
+log_must zfs create -V 10M $vol
 
 # Verify the parent filesystem does not affect volume
-log_must $ZFS set quota=25M $fs
-log_must $ZFS set refreservation=10M $vol
+log_must zfs set quota=25M $fs
+log_must zfs set refreservation=10M $vol
 avail=$(get_prop mountpoint $vol)
-log_mustnot $ZFS set refreservation=$avail $vol
+log_mustnot zfs set refreservation=$avail $vol
 
 # Verify it is affected by volsize
-log_must $ZFS set volsize=15M $vol
-log_must $ZFS set refreservation=15M $vol
-log_mustnot $ZFS set refreservation=16M $vol
+log_must zfs set volsize=15M $vol
+log_must zfs set refreservation=15M $vol
+log_mustnot zfs set refreservation=16M $vol
 
 log_pass "Volume refreservation is limited by volsize"
index de23e3a65226959c7e52d12fe1808aa16a7bcfbe..12224deec6830aacb53dafcd3bd931f7bd4ebb61 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,24 +48,24 @@ verify_runnable "both"
 
 function cleanup
 {
-       log_must $RM -rf $TESTDIR/*
+       log_must rm -rf $TESTDIR/*
 }
 
 log_assert "ZFS can handle race directory rename operation."
 
 log_onexit cleanup
 
-$CD $TESTDIR
-$MKDIR -p 1/2/3/4/5 a/b/c/d/e
+cd $TESTDIR
+mkdir -p 1/2/3/4/5 a/b/c/d/e
 
 $RENAME_DIRS &
 
-$SLEEP 500
+sleep 500
 typeset -i retval=1
-$PGREP $RENAME_DIRS >/dev/null 2>&1
+pgrep $RENAME_DIRS >/dev/null 2>&1
 retval=$?
 if (( $retval == 0 )); then
-       $PKILL -9 $RENAME_DIRS >/dev/null 2>&1
+       pkill -9 $RENAME_DIRS >/dev/null 2>&1
 fi
 
 log_pass "ZFS handle race directory rename operation as expected."
index 9e8285f17b823e022a24950950264636f8e156cf..606a9575eaac414f6b7f821804d66c98a835885a 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -50,7 +50,7 @@ function cleanup
        if [[ -n "$child_pids" ]]; then
                for wait_pid in $child_pids
                do
-                       $KILL $wait_pid
+                       kill $wait_pid
                done
        fi
 
@@ -58,7 +58,7 @@ function cleanup
                destroy_pool $TESTPOOL1
        fi
 
-       [[ -e $TESTDIR ]] && log_must $RM -rf $TESTDIR/*
+       [[ -e $TESTDIR ]] && log_must rm -rf $TESTDIR/*
 }
 
 log_assert "Replacing a disk during I/O completes."
@@ -94,38 +94,38 @@ function replace_test
 
        typeset i=0
        while [[ $i -lt $iters ]]; do
-               log_note "Invoking $FILE_TRUNC with: $options_display"
-               $FILE_TRUNC $options $TESTDIR/$TESTFILE.$i &
+               log_note "Invoking file_trunc with: $options_display"
+               file_trunc $options $TESTDIR/$TESTFILE.$i &
                typeset pid=$!
 
-               $SLEEP 1
+               sleep 1
 
                child_pids="$child_pids $pid"
                ((i = i + 1))
        done
 
-       log_must $ZPOOL replace $opt $TESTPOOL1 $disk1 $disk2
+       log_must zpool replace $opt $TESTPOOL1 $disk1 $disk2
 
-       $SLEEP 10
+       sleep 10
 
        for wait_pid in $child_pids
        do
-               $KILL $wait_pid
+               kill $wait_pid
        done
        child_pids=""
 
-        log_must $ZPOOL export $TESTPOOL1
-        log_must $ZPOOL import -d $TESTDIR $TESTPOOL1
-        log_must $ZFS umount $TESTPOOL1/$TESTFS1
-        log_must $ZDB -cdui $TESTPOOL1/$TESTFS1
-        log_must $ZFS mount $TESTPOOL1/$TESTFS1
+        log_must zpool export $TESTPOOL1
+        log_must zpool import -d $TESTDIR $TESTPOOL1
+        log_must zfs umount $TESTPOOL1/$TESTFS1
+        log_must zdb -cdui $TESTPOOL1/$TESTFS1
+        log_must zfs mount $TESTPOOL1/$TESTFS1
 
 }
 
 specials_list=""
 i=0
 while [[ $i != 2 ]]; do
-        $MKFILE $MINVDEVSIZE $TESTDIR/$TESTFILE1.$i
+        mkfile $MINVDEVSIZE $TESTDIR/$TESTFILE1.$i
         specials_list="$specials_list $TESTDIR/$TESTFILE1.$i"
 
         ((i = i + 1))
@@ -134,23 +134,23 @@ done
 #
 # Create a replacement disk special file.
 #
-$MKFILE $MINVDEVSIZE $TESTDIR/$REPLACEFILE
+mkfile $MINVDEVSIZE $TESTDIR/$REPLACEFILE
 
 for type in "" "raidz" "raidz1" "mirror"; do
        for op in "" "-f"; do
                create_pool $TESTPOOL1 $type $specials_list
-               log_must $ZFS create $TESTPOOL1/$TESTFS1
-               log_must $ZFS set mountpoint=$TESTDIR1 $TESTPOOL1/$TESTFS1
+               log_must zfs create $TESTPOOL1/$TESTFS1
+               log_must zfs set mountpoint=$TESTDIR1 $TESTPOOL1/$TESTFS1
 
                replace_test "$opt" $TESTDIR/$TESTFILE1.1 $TESTDIR/$REPLACEFILE
 
-               $ZPOOL iostat -v $TESTPOOL1 | grep "$TESTDIR/$REPLACEFILE"
+               zpool iostat -v $TESTPOOL1 | grep "$TESTDIR/$REPLACEFILE"
                if [[ $? -ne 0 ]]; then
                        log_fail "$REPLACEFILE is not present."
                fi
 
                destroy_pool $TESTPOOL1
-               log_must $RM -rf /$TESTPOOL1
+               log_must rm -rf /$TESTPOOL1
        done
 done
 
index 713891d12f7cc2a27e0f6c8c8fd76305faac2bf2..391aa5cf0dfca6bc083c47e7823c89bc5c45197a 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -50,7 +50,7 @@ function cleanup
        if [[ -n "$child_pids" ]]; then
                for wait_pid in $child_pids
                do
-                       $KILL $wait_pid
+                       kill $wait_pid
                done
        fi
 
@@ -58,7 +58,7 @@ function cleanup
                destroy_pool $TESTPOOL1
        fi
 
-       [[ -e $TESTDIR ]] && log_must $RM -rf $TESTDIR/*
+       [[ -e $TESTDIR ]] && log_must rm -rf $TESTDIR/*
 }
 
 log_assert "Replacing a disk during I/O completes."
@@ -94,38 +94,38 @@ function attach_test
 
        typeset i=0
        while [[ $i -lt $iters ]]; do
-               log_note "Invoking $FILE_TRUNC with: $options_display"
-               $FILE_TRUNC $options $TESTDIR/$TESTFILE.$i &
+               log_note "Invoking file_trunc with: $options_display"
+               file_trunc $options $TESTDIR/$TESTFILE.$i &
                typeset pid=$!
 
-               $SLEEP 1
+               sleep 1
 
                child_pids="$child_pids $pid"
                ((i = i + 1))
        done
 
-       log_must $ZPOOL attach $opt $TESTPOOL1 $disk1 $disk2
+       log_must zpool attach $opt $TESTPOOL1 $disk1 $disk2
 
-       $SLEEP 10
+       sleep 10
 
        for wait_pid in $child_pids
        do
-               $KILL $wait_pid
+               kill $wait_pid
        done
        child_pids=""
 
-        log_must $ZPOOL export $TESTPOOL1
-        log_must $ZPOOL import -d $TESTDIR $TESTPOOL1
-        log_must $ZFS umount $TESTPOOL1/$TESTFS1
-        log_must $ZDB -cdui $TESTPOOL1/$TESTFS1
-        log_must $ZFS mount $TESTPOOL1/$TESTFS1
+        log_must zpool export $TESTPOOL1
+        log_must zpool import -d $TESTDIR $TESTPOOL1
+        log_must zfs umount $TESTPOOL1/$TESTFS1
+        log_must zdb -cdui $TESTPOOL1/$TESTFS1
+        log_must zfs mount $TESTPOOL1/$TESTFS1
 
 }
 
 specials_list=""
 i=0
 while [[ $i != 2 ]]; do
-       $MKFILE $MINVDEVSIZE $TESTDIR/$TESTFILE1.$i
+       mkfile $MINVDEVSIZE $TESTDIR/$TESTFILE1.$i
        specials_list="$specials_list $TESTDIR/$TESTFILE1.$i"
 
        ((i = i + 1))
@@ -134,16 +134,16 @@ done
 #
 # Create a replacement disk special file.
 #
-$MKFILE $MINVDEVSIZE $TESTDIR/$REPLACEFILE
+mkfile $MINVDEVSIZE $TESTDIR/$REPLACEFILE
 
 for op in "" "-f"; do
        create_pool $TESTPOOL1 mirror $specials_list
-       log_must $ZFS create $TESTPOOL1/$TESTFS1
-       log_must $ZFS set mountpoint=$TESTDIR1 $TESTPOOL1/$TESTFS1
+       log_must zfs create $TESTPOOL1/$TESTFS1
+       log_must zfs set mountpoint=$TESTDIR1 $TESTPOOL1/$TESTFS1
 
        attach_test "$opt" $TESTDIR/$TESTFILE1.1 $TESTDIR/$REPLACEFILE
 
-       $ZPOOL iostat -v $TESTPOOL1 | grep "$TESTDIR/$REPLACEFILE"
+       zpool iostat -v $TESTPOOL1 | grep "$TESTDIR/$REPLACEFILE"
        if [[ $? -ne 0 ]]; then
                log_fail "$REPLACEFILE is not present."
        fi
@@ -156,13 +156,13 @@ log_note "Verify 'zpool attach' fails with non-mirrors."
 for type in "" "raidz" "raidz1"; do
        for op in "" "-f"; do
                create_pool $TESTPOOL1 $type $specials_list
-               log_must $ZFS create $TESTPOOL1/$TESTFS1
-               log_must $ZFS set mountpoint=$TESTDIR1 $TESTPOOL1/$TESTFS1
+               log_must zfs create $TESTPOOL1/$TESTFS1
+               log_must zfs set mountpoint=$TESTDIR1 $TESTPOOL1/$TESTFS1
 
-               log_mustnot $ZPOOL attach "$opt" $TESTDIR/$TESTFILE1.1 \
+               log_mustnot zpool attach "$opt" $TESTDIR/$TESTFILE1.1 \
                    $TESTDIR/$REPLACEFILE
 
-               $ZPOOL iostat -v $TESTPOOL1 | grep "$TESTDIR/$REPLACEFILE"
+               zpool iostat -v $TESTPOOL1 | grep "$TESTDIR/$REPLACEFILE"
                if [[ $? -eq 0 ]]; then
                        log_fail "$REPLACEFILE should not be present."
                fi
index 1bfacafb29c318b84f66aa23f9d94a44e387d213..71b9602ee15ab9887c38c8801baea6b5a8a4f3a8 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -50,7 +50,7 @@ function cleanup
        if [[ -n "$child_pids" ]]; then
                for wait_pid in $child_pids
                do
-                       $KILL $wait_pid
+                       kill $wait_pid
                done
        fi
 
@@ -58,7 +58,7 @@ function cleanup
                destroy_pool $TESTPOOL1
        fi
 
-       [[ -e $TESTDIR ]] && log_must $RM -rf $TESTDIR/*
+       [[ -e $TESTDIR ]] && log_must rm -rf $TESTDIR/*
 }
 
 log_assert "Replacing a disk during I/O completes."
@@ -92,49 +92,49 @@ function detach_test
 
        typeset i=0
        while [[ $i -lt $iters ]]; do
-               log_note "Invoking $FILE_TRUNC with: $options_display"
-               $FILE_TRUNC $options $TESTDIR/$TESTFILE.$i &
+               log_note "Invoking file_trunc with: $options_display"
+               file_trunc $options $TESTDIR/$TESTFILE.$i &
                typeset pid=$!
 
-               $SLEEP 1
+               sleep 1
 
                child_pids="$child_pids $pid"
                ((i = i + 1))
        done
 
-       log_must $ZPOOL detach $TESTPOOL1 $disk1
+       log_must zpool detach $TESTPOOL1 $disk1
 
-       $SLEEP 10
+       sleep 10
 
        for wait_pid in $child_pids
        do
-               $KILL $wait_pid
+               kill $wait_pid
        done
        child_pids=""
 
-        log_must $ZPOOL export $TESTPOOL1
-        log_must $ZPOOL import -d $TESTDIR $TESTPOOL1
-        log_must $ZFS umount $TESTPOOL1/$TESTFS1
-        log_must $ZDB -cdui $TESTPOOL1/$TESTFS1
-        log_must $ZFS mount $TESTPOOL1/$TESTFS1
+        log_must zpool export $TESTPOOL1
+        log_must zpool import -d $TESTDIR $TESTPOOL1
+        log_must zfs umount $TESTPOOL1/$TESTFS1
+        log_must zdb -cdui $TESTPOOL1/$TESTFS1
+        log_must zfs mount $TESTPOOL1/$TESTFS1
 }
 
 specials_list=""
 i=0
 while [[ $i != 2 ]]; do
-       $MKFILE $MINVDEVSIZE $TESTDIR/$TESTFILE1.$i
+       mkfile $MINVDEVSIZE $TESTDIR/$TESTFILE1.$i
        specials_list="$specials_list $TESTDIR/$TESTFILE1.$i"
 
        ((i = i + 1))
 done
 
 create_pool $TESTPOOL1 mirror $specials_list
-log_must $ZFS create $TESTPOOL1/$TESTFS1
-log_must $ZFS set mountpoint=$TESTDIR1 $TESTPOOL1/$TESTFS1
+log_must zfs create $TESTPOOL1/$TESTFS1
+log_must zfs set mountpoint=$TESTDIR1 $TESTPOOL1/$TESTFS1
 
 detach_test $TESTDIR/$TESTFILE1.1
 
-$ZPOOL iostat -v $TESTPOOL1 | grep "$TESTDIR/$TESTFILE1.1"
+zpool iostat -v $TESTPOOL1 | grep "$TESTDIR/$TESTFILE1.1"
 if [[ $? -eq 0 ]]; then
        log_fail "$TESTFILE1.1 should no longer be present."
 fi
@@ -145,12 +145,12 @@ log_note "Verify 'zpool detach' fails with non-mirrors."
 
 for type in "" "raidz" "raidz1" ; do
        create_pool $TESTPOOL1 $type $specials_list
-       log_must $ZFS create $TESTPOOL1/$TESTFS1
-       log_must $ZFS set mountpoint=$TESTDIR1 $TESTPOOL1/$TESTFS1
+       log_must zfs create $TESTPOOL1/$TESTFS1
+       log_must zfs set mountpoint=$TESTDIR1 $TESTPOOL1/$TESTFS1
 
-       log_mustnot $ZPOOL detach $TESTDIR/$TESTFILE1.1
+       log_mustnot zpool detach $TESTDIR/$TESTFILE1.1
 
-       $ZPOOL iostat -v $TESTPOOL1 | grep "$TESTDIR/$TESTFILE1.1"
+       zpool iostat -v $TESTPOOL1 | grep "$TESTDIR/$TESTFILE1.1"
        if [[ $? -ne 0 ]]; then
                log_fail "$TESTFILE1.1 is not present."
        fi
index 157a41b6be00f6c3fe54e0e843a78cf27d36c877..49ee3b992dcc1b4515c81860dec1ab29c85bd6b1 100644 (file)
@@ -41,9 +41,9 @@ function zero_reservation
        typeset resv_val
        dataset=$1
 
-       log_must $ZFS set reservation=none $dataset
+       log_must zfs set reservation=none $dataset
 
-       resv_val=`$ZFS get -H reservation $dataset | awk '{print $3}'`
+       resv_val=`zfs get -H reservation $dataset | awk '{print $3}'`
        if [[ $? -ne 0 ]]; then
                log_fail "Unable to get reservation prop on $dataset"
        elif [[ $resv_val != "none" ]]; then
@@ -51,7 +51,7 @@ function zero_reservation
        fi
 
 
-       resv_val=`$ZFS get -pH reservation $dataset | awk '{print $3}'`
+       resv_val=`zfs get -pH reservation $dataset | awk '{print $3}'`
        if [[ $? -ne 0 ]]; then
                log_fail "Unable to get reservation prop on $dataset"
        elif [[ $resv_val -ne 0 ]]; then
@@ -100,8 +100,8 @@ function create_multiple_fs # num_fs base_fs_name base_mnt_name
        typeset MNT_NAME=$3
 
        while  (($iter < $count)); do
-               log_must $ZFS create ${FS_NAME}$iter
-               log_must $ZFS set mountpoint=${MNT_NAME}$iter ${FS_NAME}$iter
+               log_must zfs create ${FS_NAME}$iter
+               log_must zfs set mountpoint=${MNT_NAME}$iter ${FS_NAME}$iter
                ((iter = iter + 1))
        done
 }
index cef31872a67042467b7a4d5a60780103c83e220c..d142fe0cc0e71ab0a346889d137a05fb0c6fbf7b 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -54,7 +54,7 @@ verify_runnable "both"
 function cleanup
 {
        for obj in $OBJ_LIST; do
-               datasetexists $obj && log_must $ZFS destroy -f $obj
+               datasetexists $obj && log_must zfs destroy -f $obj
        done
 }
 
@@ -80,10 +80,10 @@ else
        # setting a reservation upon it (i.e. the size of the volume)
        # which we reset back to zero initially.
        #
-       log_must $ZFS create -V $vol_set_size $TESTPOOL/$TESTVOL
-       log_must $ZFS set reservation=none $TESTPOOL/$TESTVOL
-       log_must $ZFS set refreservation=none $TESTPOOL/$TESTVOL
-       log_must $ZFS create -s -V $sparse_vol_set_size $TESTPOOL/$TESTVOL2
+       log_must zfs create -V $vol_set_size $TESTPOOL/$TESTVOL
+       log_must zfs set reservation=none $TESTPOOL/$TESTVOL
+       log_must zfs set refreservation=none $TESTPOOL/$TESTVOL
+       log_must zfs create -s -V $sparse_vol_set_size $TESTPOOL/$TESTVOL2
 fi
 
 
@@ -101,7 +101,7 @@ for obj in $TESTPOOL/$TESTFS $OBJ_LIST; do
        [[ $obj == $TESTPOOL/$TESTVOL ]] && \
            ((resv_size_set = vol_set_size - RESV_DELTA))
 
-       log_must $ZFS set reservation=$resv_size_set $obj
+       log_must zfs set reservation=$resv_size_set $obj
 
        resv_size_get=`get_prop reservation $obj`
        if [[ $resv_size_set != $resv_size_get ]]; then
index fdf4ce3c17d8e9ee07fce453d3b0f95afe3b63d7..f96010802686a5571bc0d7e9435e2866a6e93b48 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -54,7 +54,7 @@ verify_runnable "both"
 function cleanup
 {
        for obj in $OBJ_LIST; do
-               datasetexists $obj && log_must $ZFS destroy -f $obj
+               datasetexists $obj && log_must zfs destroy -f $obj
        done
 
        log_must zero_reservation $TESTPOOL/$TESTFS
@@ -77,9 +77,9 @@ else
        ((sparse_vol_set_size = space_avail * 4))
        sparse_vol_set_size=$(floor_volsize $sparse_vol_set_size)
 
-       log_must $ZFS create -V $vol_set_size $TESTPOOL/$TESTVOL
-       log_must $ZFS set reservation=none $TESTPOOL/$TESTVOL
-       log_must $ZFS create -s -V $sparse_vol_set_size $TESTPOOL/$TESTVOL2
+       log_must zfs create -V $vol_set_size $TESTPOOL/$TESTVOL
+       log_must zfs set reservation=none $TESTPOOL/$TESTVOL
+       log_must zfs create -s -V $sparse_vol_set_size $TESTPOOL/$TESTVOL2
 fi
 
 for obj in $TESTPOOL/$TESTFS $OBJ_LIST ; do
@@ -96,7 +96,7 @@ for obj in $TESTPOOL/$TESTFS $OBJ_LIST ; do
            ((resv_size_set = vol_set_size + RESV_DELTA))
 
        log_must zero_reservation $obj
-       log_mustnot $ZFS set reservation=$resv_size_set $obj
+       log_mustnot zfs set reservation=$resv_size_set $obj
 
        resv_size_get=`get_prop reservation $obj`
 
index 81096e86b868d269c5689b9f713d4ba04e307f36..48adabe72ffd060e550c0dff2c3944c34f95fbcd 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -59,7 +59,7 @@ function cleanup
        log_must zero_reservation $TESTPOOL/$TESTFS
 
        for obj in $OBJ_LIST; do
-       datasetexists $obj && log_must $ZFS destroy -f $obj
+       datasetexists $obj && log_must zfs destroy -f $obj
        done
 }
 
@@ -96,7 +96,7 @@ function multiple_resv { #dataset
 
                ((resv_size_set = resv_size * i))
 
-               log_must $ZFS set reservation=$resv_size_set $dataset
+               log_must zfs set reservation=$resv_size_set $dataset
 
                resv_size_get=`get_prop reservation $dataset`
                if [[ $resv_size_set != $resv_size_get ]]; then
@@ -121,9 +121,9 @@ else
        sparse_vol_set_size=$(floor_volsize $sparse_vol_set_size)
 
 
-       log_must $ZFS create -V $vol_set_size $TESTPOOL/$TESTVOL
-       log_must $ZFS set reservation=none $TESTPOOL/$TESTVOL
-       log_must $ZFS create -s -V $sparse_vol_set_size $TESTPOOL/$TESTVOL2
+       log_must zfs create -V $vol_set_size $TESTPOOL/$TESTVOL
+       log_must zfs set reservation=none $TESTPOOL/$TESTVOL
+       log_must zfs create -s -V $sparse_vol_set_size $TESTPOOL/$TESTVOL2
 fi
 
 for obj in $TESTPOOL/$TESTFS $OBJ_LIST ; do
index 37340022829683ca2d950e0b3a10d5b69c1cc4cd..2d0054b2c18303553a5cb0384d7d329912106d3a 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -56,7 +56,7 @@ verify_runnable "both"
 function cleanup {
 
        for obj in $OBJ_LIST; do
-               datasetexists $obj && log_must $ZFS destroy -f $obj
+               datasetexists $obj && log_must zfs destroy -f $obj
        done
 }
 
@@ -64,7 +64,7 @@ log_assert "Verify space released when a dataset with reservation is destroyed"
 
 log_onexit cleanup
 
-log_must $ZFS create $TESTPOOL/$TESTFS2
+log_must zfs create $TESTPOOL/$TESTFS2
 
 space_avail=`get_prop available $TESTPOOL`
 
@@ -79,10 +79,10 @@ else
        ((sparse_vol_set_size = space_avail * 4))
        sparse_vol_set_size=$(floor_volsize $sparse_vol_set_size)
 
-       log_must $ZFS create -V $vol_set_size $TESTPOOL/$TESTVOL
-       log_must $ZFS set refreservation=none $TESTPOOL/$TESTVOL
-       log_must $ZFS set reservation=none $TESTPOOL/$TESTVOL
-       log_must $ZFS create -s -V $sparse_vol_set_size $TESTPOOL/$TESTVOL2
+       log_must zfs create -V $vol_set_size $TESTPOOL/$TESTVOL
+       log_must zfs set refreservation=none $TESTPOOL/$TESTVOL
+       log_must zfs set reservation=none $TESTPOOL/$TESTVOL
+       log_must zfs create -s -V $sparse_vol_set_size $TESTPOOL/$TESTVOL2
 fi
 
 # re-calculate space available.
@@ -104,7 +104,7 @@ for obj in $OBJ_LIST ; do
        [[ $obj == $TESTPOOL/$TESTVOL ]] && \
            ((resv_size_set = vol_set_size - RESV_DELTA))
 
-       log_must $ZFS set reservation=$resv_size_set $obj
+       log_must zfs set reservation=$resv_size_set $obj
 
        resv_size_get=`get_prop reservation $obj`
        if [[ $resv_size_set != $resv_size_get ]]; then
@@ -112,7 +112,7 @@ for obj in $OBJ_LIST ; do
                "($resv_size_set != $resv_size_get)"
        fi
 
-       log_must $ZFS destroy -f $obj
+       log_must zfs destroy -f $obj
 
        new_space_avail=`get_prop available $TESTPOOL`
        new_space_used=`get_prop used $TESTPOOL`
index 19b07fe87d6c8a87f0204bb507d503b4796c9391..4047fab0d7f943da390ba51e9ac726f0ae366132 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -59,7 +59,7 @@ log_assert "Verify space released when reservation on a dataset is set "\
 function cleanup
 {
        for obj in $OBJ_LIST; do
-               datasetexists $obj && log_must $ZFS destroy -f $obj
+               datasetexists $obj && log_must zfs destroy -f $obj
        done
 }
 
@@ -77,9 +77,9 @@ else
        sparse_vol_set_size=$(floor_volsize $sparse_vol_set_size)
 
 
-       log_must $ZFS create -V $vol_set_size $TESTPOOL/$TESTVOL
-       log_must $ZFS set reservation=none $TESTPOOL/$TESTVOL
-       log_must $ZFS create -s -V $sparse_vol_set_size $TESTPOOL/$TESTVOL2
+       log_must zfs create -V $vol_set_size $TESTPOOL/$TESTVOL
+       log_must zfs set reservation=none $TESTPOOL/$TESTVOL
+       log_must zfs create -s -V $sparse_vol_set_size $TESTPOOL/$TESTVOL2
 fi
 
 space_avail=`get_prop available $TESTPOOL`
@@ -98,7 +98,7 @@ for obj in $TESTPOOL/$TESTFS $OBJ_LIST ; do
        [[ $obj == $TESTPOOL/$TESTVOL ]] && \
            ((resv_size_set = vol_set_size - RESV_DELTA))
 
-       log_must $ZFS set reservation=$resv_size_set $obj
+       log_must zfs set reservation=$resv_size_set $obj
 
        resv_size_get=`get_prop reservation $obj`
        if [[ $resv_size_set != $resv_size_get ]]; then
@@ -106,7 +106,7 @@ for obj in $TESTPOOL/$TESTFS $OBJ_LIST ; do
                        "($resv_size_set != $resv_size_get)"
        fi
 
-       log_must $ZFS set reservation=none $obj
+       log_must zfs set reservation=none $obj
 
        new_space_avail=`get_prop available $TESTPOOL`
        new_space_used=`get_prop used $TESTPOOL`
index 87359aa5f56e5254060c69bf8db8c225e731cba0..ec1986c4547c7ebcdeba075dff01251b0be70408 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -56,8 +56,8 @@ verify_runnable "both"
 
 function cleanup
 {
-       [[ -e $TESTDIR/$TESTFILE1 ]] && log_must $RM -rf $TESTDIR/$TESTFILE1
-       log_must $ZFS set reservation=none $TESTPOOL/$TESTFS
+       [[ -e $TESTDIR/$TESTFILE1 ]] && log_must rm -rf $TESTDIR/$TESTFILE1
+       log_must zfs set reservation=none $TESTPOOL/$TESTFS
 }
 
 log_onexit cleanup
@@ -66,7 +66,7 @@ log_assert "Verify can create files both inside and outside reserved areas"
 
 space_used=`get_prop used $TESTPOOL`
 
-log_must $ZFS set reservation=$RESV_SIZE $TESTPOOL/$TESTFS
+log_must zfs set reservation=$RESV_SIZE $TESTPOOL/$TESTFS
 
 #
 # Calculate how many writes of BLOCK_SIZE it would take to fill
@@ -75,7 +75,7 @@ log_must $ZFS set reservation=$RESV_SIZE $TESTPOOL/$TESTFS
 fill_size=`expr $RESV_SIZE + 20971520`
 write_count=`expr $fill_size / $BLOCK_SIZE`
 
-log_must $FILE_WRITE -o create -f $TESTDIR/$TESTFILE1 -b $BLOCK_SIZE \
+log_must file_write -o create -f $TESTDIR/$TESTFILE1 -b $BLOCK_SIZE \
     -c $write_count -d 0
 
 log_pass "Able to create files inside and outside reserved area"
index a1185c23ec92676db9622af6b8245aa6c086d5ef..48d6b40ad05af97b29454af223b38d69e930272d 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -56,10 +56,10 @@ log_assert "Verify reservations on data sets doesn't affect other data sets " \
 function cleanup
 {
        datasetexists $TESTPOOL/$TESTFS2 && \
-           log_must $ZFS destroy -f $TESTPOOL/$TESTFS2
+           log_must zfs destroy -f $TESTPOOL/$TESTFS2
 
        datasetexists $TESTPOOL/$TESTFS1 && \
-           log_must $ZFS destroy -f $TESTPOOL/$TESTFS1
+           log_must zfs destroy -f $TESTPOOL/$TESTFS1
 }
 
 log_onexit cleanup
@@ -84,23 +84,23 @@ function create_resv_destroy { # args1 dataset1 args2 dataset2
        args2=$3
        dataset2=$4
 
-       log_must $ZFS create $args1 $dataset1
+       log_must zfs create $args1 $dataset1
 
-       log_must $ZFS set reservation=$RESV_SIZE $dataset1
+       log_must zfs set reservation=$RESV_SIZE $dataset1
 
        avail_aft_dset1=`get_prop available $TESTPOOL`
        used_aft_dset1=`get_prop used $TESTPOOL`
 
-       log_must $ZFS create $args2 $dataset2
+       log_must zfs create $args2 $dataset2
 
-       log_must $ZFS set reservation=$RESV_SIZE $dataset2
+       log_must zfs set reservation=$RESV_SIZE $dataset2
 
        #
        # After destroying the second dataset the space used and
        # available totals should revert back to the values they
        # had after creating the first dataset.
        #
-       log_must $ZFS destroy -f $dataset2
+       log_must zfs destroy -f $dataset2
 
        avail_dest_dset2=`get_prop available $TESTPOOL`
        used_dest_dset2=`get_prop used $TESTPOOL`
@@ -112,7 +112,7 @@ function create_resv_destroy { # args1 dataset1 args2 dataset2
        # After destroying the first dataset the space used and
        # space available totals should revert back to the values
        # they had when the pool was first created.
-       log_must $ZFS destroy -f $dataset1
+       log_must zfs destroy -f $dataset1
 
        avail_dest_dset1=`get_prop available $TESTPOOL`
        used_dest_dset1=`get_prop used $TESTPOOL`
index 5753d9930a8acc981c78fba979dd810276a7fc70..fbf4276e8bda2bf28400dfce799b84ec3a4b7328 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -57,9 +57,9 @@ function cleanup
        typeset -i loop=0
        while (($loop < $RESV_NUM_FS)); do
                datasetexists $TESTPOOL/${TESTFS}$loop && \
-                   log_must $ZFS destroy -f $TESTPOOL/${TESTFS}$loop
+                   log_must zfs destroy -f $TESTPOOL/${TESTFS}$loop
 
-               [[ -d ${TESTDIR}$loop ]] && log_must $RM -r ${TESTDIR}$loop
+               [[ -d ${TESTDIR}$loop ]] && log_must rm -r ${TESTDIR}$loop
 
                ((loop = loop + 1))
        done
@@ -92,7 +92,7 @@ resv_size_set=`expr $resv_space_avail / $num_resv_fs`
 #
 typeset -i num=1
 while (($num < $RESV_NUM_FS)); do
-       log_must $ZFS set reservation=$resv_size_set $TESTPOOL/$TESTFS$num
+       log_must zfs set reservation=$resv_size_set $TESTPOOL/$TESTFS$num
        ((num = num + 1))
 done
 
@@ -106,7 +106,7 @@ write_count=`expr $fill_size / $BLOCK_SIZE`
 num=0
 log_note "Writing to $TESTDIR$num/$TESTFILE1"
 
-$FILE_WRITE -o create -f $TESTDIR$num/$TESTFILE1 -b $BLOCK_SIZE \
+file_write -o create -f $TESTDIR$num/$TESTFILE1 -b $BLOCK_SIZE \
     -c $write_count -d 0
 ret=$?
 if (($ret != $ENOSPC)); then
@@ -116,9 +116,9 @@ fi
 # Remove the reservation on one of the other filesystems and verify
 # can write more data to the original non-reservation filesystem.
 num=1
-log_must $ZFS set reservation=none $TESTPOOL/${TESTFS}$num
+log_must zfs set reservation=none $TESTPOOL/${TESTFS}$num
 num=0
-log_must $FILE_WRITE -o create -f ${TESTDIR}$num/$TESTFILE2 -b $PAGESIZE \
-    -c 1000 -d 0
+log_must file_write -o create -f ${TESTDIR}$num/$TESTFILE2 \
+    -b $(getconf PAGESIZE) -c 1000 -d 0
 
 log_pass "reducing reservation allows other datasets to use space"
index 67c6524197eb2ebf0a59b9a3d03ee710e75c8f7e..d623bd913bd790d786eee04239855aab8d29b754 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -56,14 +56,14 @@ log_assert "Setting top level dataset reservation to 'none' allows more data "
 
 function cleanup
 {
-       log_must $RM -rf $TESTDIR/$TESTFILE1
-       log_must $RM -rf $TESTDIR/$TESTFILE2
-       log_must $ZFS destroy -f $TESTPOOL/$TESTFS1
+       log_must rm -rf $TESTDIR/$TESTFILE1
+       log_must rm -rf $TESTDIR/$TESTFILE2
+       log_must zfs destroy -f $TESTPOOL/$TESTFS1
 }
 
 log_onexit cleanup
 
-log_must $ZFS create $TESTPOOL/$TESTFS1
+log_must zfs create $TESTPOOL/$TESTFS1
 
 space_avail=`get_prop available $TESTPOOL`
 
@@ -75,7 +75,7 @@ space_avail=`get_prop available $TESTPOOL`
 #
 ((resv_size_set = space_avail - RESV_FREE_SPACE))
 
-log_must $ZFS set reservation=$resv_size_set $TESTPOOL/$TESTFS1
+log_must zfs set reservation=$resv_size_set $TESTPOOL/$TESTFS1
 
 space_avail_still=`get_prop available $TESTPOOL`
 
@@ -84,17 +84,17 @@ write_count=`expr $fill_size / $BLOCK_SIZE`
 
 # Now fill up the filesystem (which doesn't have a reservation set
 # and thus will use up whatever free space is left in the pool).
-$FILE_WRITE -o create -f $TESTDIR/$TESTFILE1 -b $BLOCK_SIZE \
+file_write -o create -f $TESTDIR/$TESTFILE1 -b $BLOCK_SIZE \
         -c $write_count -d 0
 ret=$?
 if (($ret != $ENOSPC)); then
        log_fail "Did not get ENOSPC as expected (got $ret)."
 fi
 
-log_must $ZFS set reservation=none $TESTPOOL/$TESTFS1
+log_must zfs set reservation=none $TESTPOOL/$TESTFS1
 
-log_must $FILE_WRITE -o create -f $TESTDIR/$TESTFILE2 -b $PAGESIZE \
-    -c 1000 -d 0
+log_must file_write -o create -f $TESTDIR/$TESTFILE2 \
+    -b $(getconf PAGESIZE) -c 1000 -d 0
 
 log_pass "Setting top level dataset reservation to 'none' allows more " \
     "data to be written to the top level filesystem"
index 23e78bddfed73047f012a648f34533ceaf933150..2ca279a4a43747ec33e9e00b9391ce14d123e6c8 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -57,15 +57,15 @@ log_assert "Destroying top level filesystem with reservation allows more " \
 function cleanup
 {
        datasetexists $TESTPOOL/$TESTFS1 && \
-           log_must $ZFS destroy $TESTPOOL/$TESTFS1
+           log_must zfs destroy $TESTPOOL/$TESTFS1
 
-       [[ -e $TESTDIR/$TESTFILE1 ]] && log_must $RM -rf $TESTDIR/$TESTFILE1
-       [[ -e $TESTDIR/$TESTFILE2 ]] && log_must $RM -rf $TESTDIR/$TESTFILE2
+       [[ -e $TESTDIR/$TESTFILE1 ]] && log_must rm -rf $TESTDIR/$TESTFILE1
+       [[ -e $TESTDIR/$TESTFILE2 ]] && log_must rm -rf $TESTDIR/$TESTFILE2
 }
 
 log_onexit cleanup
 
-log_must $ZFS create $TESTPOOL/$TESTFS1
+log_must zfs create $TESTPOOL/$TESTFS1
 
 space_avail=`get_prop available $TESTPOOL`
 
@@ -77,7 +77,7 @@ space_avail=`get_prop available $TESTPOOL`
 #
 ((resv_size_set = space_avail - RESV_FREE_SPACE))
 
-log_must $ZFS set reservation=$resv_size_set $TESTPOOL/$TESTFS1
+log_must zfs set reservation=$resv_size_set $TESTPOOL/$TESTFS1
 
 space_avail_still=`get_prop available $TESTPOOL`
 
@@ -86,16 +86,16 @@ write_count=`expr $fill_size / $BLOCK_SIZE`
 
 # Now fill up the filesystem (which doesn't have a reservation set
 # and thus will use up whatever free space is left in the pool).
-$FILE_WRITE -o create -f $TESTDIR/$TESTFILE1 -b $BLOCK_SIZE -c $write_count -d 0
+file_write -o create -f $TESTDIR/$TESTFILE1 -b $BLOCK_SIZE -c $write_count -d 0
 ret=$?
 if (($ret != $ENOSPC)); then
        log_fail "Did not get ENOSPC as expected (got $ret)."
 fi
 
-log_must $ZFS destroy -f $TESTPOOL/$TESTFS1
+log_must zfs destroy -f $TESTPOOL/$TESTFS1
 
-log_must $FILE_WRITE -o create -f $TESTDIR/$TESTFILE2 -b $PAGESIZE \
-    -c 1000 -d 0
+log_must file_write -o create -f $TESTDIR/$TESTFILE2 \
+    -b $(getconf PAGESIZE) -c 1000 -d 0
 
 log_pass "Destroying top level filesystem with reservation allows more data " \
     "to be written to another top level filesystem"
index 1260e0472a6bcab83cd9dc80e7cce40745471da8..a6abe9db6a13e0bc115d27aae8b8d7e8566d09fb 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -61,11 +61,11 @@ space_avail=`get_prop available $TESTPOOL`
 
 ((resv_size_set = (space_avail - RESV_DELTA) / 2))
 
-fs_quota=`$ZFS get quota $TESTPOOL/$TESTFS`
+fs_quota=`zfs get quota $TESTPOOL/$TESTFS`
 
-log_must $ZFS set reservation=$resv_size_set $TESTPOOL/$TESTFS
+log_must zfs set reservation=$resv_size_set $TESTPOOL/$TESTFS
 
-new_fs_quota=`$ZFS get quota $TESTPOOL/$TESTFS`
+new_fs_quota=`zfs get quota $TESTPOOL/$TESTFS`
 
 if [[ $fs_quota != $new_fs_quota ]]; then
        log_fail "Quota value on $TESTFS has changed " \
index cc412a0bb97cd8475836861390469c4c7e7b4b57..5ab0952b1910f46cca471213f8011492c4c3ecf3 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -54,27 +54,27 @@ log_assert "Verify reservations protect space"
 
 function cleanup
 {
-       log_must $ZFS destroy -f $TESTPOOL/$TESTFS2
+       log_must zfs destroy -f $TESTPOOL/$TESTFS2
        log_must zero_reservation $TESTPOOL/$TESTFS
 
-       [[ -e $TESTDIR/$TESTFILE2 ]] && log_must $RM -rf $TESTDIR/$TESTFILE2
-       [[ -d $TESTDIR2 ]] && log_must $RM -rf $TESTDIR2
+       [[ -e $TESTDIR/$TESTFILE2 ]] && log_must rm -rf $TESTDIR/$TESTFILE2
+       [[ -d $TESTDIR2 ]] && log_must rm -rf $TESTDIR2
 }
 
 log_onexit cleanup
 
-log_must $ZFS create $TESTPOOL/$TESTFS2
-log_must $ZFS set mountpoint=$TESTDIR2 $TESTPOOL/$TESTFS2
+log_must zfs create $TESTPOOL/$TESTFS2
+log_must zfs set mountpoint=$TESTDIR2 $TESTPOOL/$TESTFS2
 
 space_avail=`get_prop available $TESTPOOL`
 
 ((resv_size_set = space_avail - RESV_FREE_SPACE))
 
-log_must $ZFS set reservation=$resv_size_set $TESTPOOL/$TESTFS
+log_must zfs set reservation=$resv_size_set $TESTPOOL/$TESTFS
 
 ((write_count = (RESV_FREE_SPACE + RESV_TOLERANCE) / BLOCK_SIZE))
 
-$FILE_WRITE -o create -f $TESTDIR2/$TESTFILE1 -b $BLOCK_SIZE -c $write_count \
+file_write -o create -f $TESTDIR2/$TESTFILE1 -b $BLOCK_SIZE -c $write_count \
     -d 0
 ret=$?
 if [[ $ret != $ENOSPC ]]; then
@@ -82,7 +82,7 @@ if [[ $ret != $ENOSPC ]]; then
 fi
 
 ((write_count = (RESV_FREE_SPACE - RESV_TOLERANCE) / BLOCK_SIZE))
-log_must $FILE_WRITE -o create -f $TESTDIR/$TESTFILE2 -b $BLOCK_SIZE -c \
+log_must file_write -o create -f $TESTDIR/$TESTFILE2 -b $BLOCK_SIZE -c \
     $write_count -d 0
 
 log_pass "Reserved space preserved correctly"
index de8130707d2a5143d8f8c3d4fa2b17cbbd8f50ea..4ef15d5b6e36ada801f3625f0287848b4a2a5284 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -58,7 +58,7 @@ log_assert "Reservation properties preserved across exports and imports"
 function cleanup
 {
        for obj in $OBJ_LIST; do
-                datasetexists $obj && log_must $ZFS destroy -f $obj
+                datasetexists $obj && log_must zfs destroy -f $obj
         done
 
        log_must zero_reservation $TESTPOOL/$TESTFS
@@ -68,8 +68,8 @@ log_onexit cleanup
 OBJ_LIST="$TESTPOOL/$TESTFS1/$TESTFS2 $TESTPOOL/$TESTFS1 $TESTPOOL/$TESTVOL \
     $TESTPOOL/$TESTVOL2"
 
-log_must $ZFS create $TESTPOOL/$TESTFS1
-log_must $ZFS create $TESTPOOL/$TESTFS1/$TESTFS2
+log_must zfs create $TESTPOOL/$TESTFS1
+log_must zfs create $TESTPOOL/$TESTFS1/$TESTFS2
 
 space_avail=$(get_prop available $TESTPOOL)
 [[ $? -ne 0 ]] && \
@@ -83,16 +83,16 @@ sparse_vol_set_size=$(floor_volsize $sparse_vol_set_size)
 # When initially created, a regular volume's reservation property is set
 # equal to its size (unlike a sparse volume), so we don't need to set it
 # explicitly later on
-log_must $ZFS create -V $resv_set $TESTPOOL/$TESTVOL
-log_must $ZFS create -s -V $sparse_vol_set_size $TESTPOOL/$TESTVOL2
+log_must zfs create -V $resv_set $TESTPOOL/$TESTVOL
+log_must zfs create -s -V $sparse_vol_set_size $TESTPOOL/$TESTVOL2
 
-log_must $ZFS set reservation=$resv_set $TESTPOOL/$TESTFS
-log_must $ZFS set reservation=$resv_set $TESTPOOL/$TESTFS1
-log_must $ZFS set reservation=$resv_set $TESTPOOL/$TESTFS1/$TESTFS2
-log_must $ZFS set reservation=$resv_set $TESTPOOL/$TESTVOL2
+log_must zfs set reservation=$resv_set $TESTPOOL/$TESTFS
+log_must zfs set reservation=$resv_set $TESTPOOL/$TESTFS1
+log_must zfs set reservation=$resv_set $TESTPOOL/$TESTFS1/$TESTFS2
+log_must zfs set reservation=$resv_set $TESTPOOL/$TESTVOL2
 
-log_must $ZPOOL export $TESTPOOL
-log_must $ZPOOL import $TESTPOOL
+log_must zpool export $TESTPOOL
+log_must zpool import $TESTPOOL
 
 for obj in $TESTPOOL/$TESTFS $OBJ_LIST; do
 
index dbc6889b0c0cf646f91cffc1557cf63d9d6995c6..d307917b5b17891e24666a78ba1ef7e4c7e2f78e 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -54,7 +54,7 @@ function cleanup
        #
        # Note we don't destroy $TESTFS as it's used by other tests
        for obj in $OBJ_LIST ; do
-               datasetexists $obj && log_must $ZFS destroy -f $obj
+               datasetexists $obj && log_must zfs destroy -f $obj
        done
 
        log_must zero_reservation $TESTPOOL/$TESTFS
@@ -73,8 +73,8 @@ else
        ((sparse_vol_set_size = space_avail * 4))
        sparse_vol_set_size=$(floor_volsize $sparse_vol_set_size)
 
-       log_must $ZFS create -V $vol_set_size $TESTPOOL/$TESTVOL
-       log_must $ZFS create -s -V $sparse_vol_set_size $TESTPOOL/$TESTVOL2
+       log_must zfs create -V $vol_set_size $TESTPOOL/$TESTVOL
+       log_must zfs create -s -V $sparse_vol_set_size $TESTPOOL/$TESTVOL2
 fi
 
 for obj in $TESTPOOL/$TESTFS $OBJ_LIST ; do
@@ -93,7 +93,7 @@ for obj in $TESTPOOL/$TESTFS $OBJ_LIST ; do
        # space in the pool, whichever is smaller.
        #
        if [[ $obj == $TESTPOOL/$TESTFS ]]; then
-               log_must $ZFS set quota=$quota_set_size $obj
+               log_must zfs set quota=$quota_set_size $obj
                ((resv_set_size = quota_set_size + RESV_SIZE))
 
        elif [[ $obj == $TESTPOOL/$TESTVOL2 ]] ; then
@@ -107,7 +107,7 @@ for obj in $TESTPOOL/$TESTFS $OBJ_LIST ; do
 
        orig_quota=`get_prop quota $obj`
 
-       log_mustnot $ZFS set reservation=$resv_set_size $obj
+       log_mustnot zfs set reservation=$resv_set_size $obj
        new_quota=`get_prop quota $obj`
 
        if [[ $orig_quota != $new_quota ]]; then
@@ -116,7 +116,7 @@ for obj in $TESTPOOL/$TESTFS $OBJ_LIST ; do
        fi
 
        if [[ $obj == $TESTPOOL/$TESTFS ]]; then
-               log_must $ZFS set quota=none $obj
+               log_must zfs set quota=none $obj
        fi
 done
 
index c8779a4afd3283c562ddf5465a6d9920c33bc778..d67f8c7ec2f62dc4b29a07047a46d3e11ee76557 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -57,10 +57,10 @@ log_assert "Setting volume reservation to 'none' allows more data to be " \
 function cleanup
 {
        datasetexists $TESTPOOL/$TESTVOL && \
-       log_must $ZFS destroy $TESTPOOL/$TESTVOL
+       log_must zfs destroy $TESTPOOL/$TESTVOL
 
-       [[ -e $TESTDIR/$TESTFILE1 ]] && log_must $RM -rf $TESTDIR/$TESTFILE1
-       [[ -e $TESTDIR/$TESTFILE2 ]] && log_must $RM -rf $TESTDIR/$TESTFILE2
+       [[ -e $TESTDIR/$TESTFILE1 ]] && log_must rm -rf $TESTDIR/$TESTFILE1
+       [[ -e $TESTDIR/$TESTFILE2 ]] && log_must rm -rf $TESTDIR/$TESTFILE2
 }
 log_onexit cleanup
 
@@ -75,7 +75,7 @@ space_avail=$(largest_volsize_from_pool $TESTPOOL)
 ((resv_size_set = space_avail - RESV_FREE_SPACE))
 resv_size_set=$(floor_volsize $resv_size_set)
 
-log_must $ZFS create -V $resv_size_set $TESTPOOL/$TESTVOL
+log_must zfs create -V $resv_size_set $TESTPOOL/$TESTVOL
 
 space_avail_still=`get_prop available $TESTPOOL`
 
@@ -84,16 +84,16 @@ write_count=$((fill_size / BLOCK_SIZE))
 
 # Now fill up the filesystem (which doesn't have a reservation set
 # and thus will use up whatever free space is left in the pool).
-$FILE_WRITE -o create -f $TESTDIR/$TESTFILE1 -b $BLOCK_SIZE -c $write_count -d 0
+file_write -o create -f $TESTDIR/$TESTFILE1 -b $BLOCK_SIZE -c $write_count -d 0
 ret=$?
 if (($ret != $ENOSPC)); then
        log_fail "Did not get ENOSPC as expected (got $ret)."
 fi
 
-log_must $ZFS set refreservation=none $TESTPOOL/$TESTVOL
+log_must zfs set refreservation=none $TESTPOOL/$TESTVOL
 
-log_must $FILE_WRITE -o create -f $TESTDIR/$TESTFILE2 -b $PAGESIZE \
-    -c 1000 -d 0
+log_must file_write -o create -f $TESTDIR/$TESTFILE2 \
+    -b $(getconf PAGESIZE) -c 1000 -d 0
 
 log_pass "Setting top level volume reservation to 'none' allows more " \
     "data to be written to the top level filesystem"
index 04c01656ddfc4bb686e37359a7424da8d19fd3d2..cbb1db658b3319582d0d367b59833a01fcac21ca 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -56,10 +56,10 @@ log_assert "Destroying a regular volume with reservation allows more data to" \
 function cleanup
 {
        datasetexists $TESTPOOL/$TESTVOL && \
-           log_must $ZFS destroy $TESTPOOL/$TESTVOL
+           log_must zfs destroy $TESTPOOL/$TESTVOL
 
-       [[ -e $TESTDIR/$TESTFILE1 ]] && log_must $RM -rf $TESTDIR/$TESTFILE1
-       [[ -e $TESTDIR/$TESTFILE2 ]] && log_must $RM -rf $TESTDIR/$TESTFILE2
+       [[ -e $TESTDIR/$TESTFILE1 ]] && log_must rm -rf $TESTDIR/$TESTFILE1
+       [[ -e $TESTDIR/$TESTFILE2 ]] && log_must rm -rf $TESTDIR/$TESTFILE2
 }
 log_onexit cleanup
 
@@ -75,7 +75,7 @@ vol_set_size=$(floor_volsize $vol_set_size)
 
 # Creating a regular volume implicitly sets its reservation
 # property to the same value.
-log_must $ZFS create -V $vol_set_size $TESTPOOL/$TESTVOL
+log_must zfs create -V $vol_set_size $TESTPOOL/$TESTVOL
 
 space_avail_still=$(get_prop available $TESTPOOL)
 fill_size=$((space_avail_still + $RESV_TOLERANCE))
@@ -83,16 +83,16 @@ write_count=$((fill_size / BLOCK_SIZE))
 
 # Now fill up the filesystem (which doesn't have a reservation set
 # and thus will use up whatever free space is left in the pool).
-$FILE_WRITE -o create -f $TESTDIR/$TESTFILE1 -b $BLOCK_SIZE -c $write_count -d 0
+file_write -o create -f $TESTDIR/$TESTFILE1 -b $BLOCK_SIZE -c $write_count -d 0
 ret=$?
 if (($ret != $ENOSPC)); then
        log_fail "Did not get ENOSPC as expected (got $ret)."
 fi
 
-log_must $ZFS destroy -f $TESTPOOL/$TESTVOL
+log_must zfs destroy -f $TESTPOOL/$TESTVOL
 
-log_must $FILE_WRITE -o create -f $TESTDIR/$TESTFILE2 -b $PAGESIZE \
-    -c 1000 -d 0
+log_must file_write -o create -f $TESTDIR/$TESTFILE2 \
+    -b $(getconf PAGESIZE) -c 1000 -d 0
 
 log_pass "Destroying volume with reservation allows more data to be written " \
     "to top level filesystem"
index d9b5739ee31e1329e848f7c8f989d0b07fe35b47..dc31c5a8fcda1559987a366e96ee11954e1fb8ba 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -55,7 +55,7 @@ function cleanup
        typeset vol
 
        for vol in $regvol $sparsevol; do
-               datasetexists $vol &&  log_must $ZFS destroy $vol
+               datasetexists $vol &&  log_must zfs destroy $vol
        done
 }
 log_onexit cleanup
@@ -67,8 +67,8 @@ log_onexit cleanup
 # Create a regular and sparse volume for testing.
 regvol=$TESTPOOL/$TESTVOL
 sparsevol=$TESTPOOL/$TESTVOL2
-log_must $ZFS create -V 64M $regvol
-log_must $ZFS create -s -V 64M $sparsevol
+log_must zfs create -V 64M $regvol
+log_must zfs create -s -V 64M $sparsevol
 
 typeset vsize=$(get_prop available $TESTPOOL)
 typeset iterate=10
@@ -83,8 +83,8 @@ while ((iterate > 1)); do
        ((randomblknum = 1 + RANDOM % blknum))
        # Make sure volsize is a multiple of volume block size
        ((vsize = randomblknum * volblocksize))
-       log_must $ZFS set volsize=$vsize $regvol
-       log_must $ZFS set volsize=$vsize $sparsevol
+       log_must zfs set volsize=$vsize $regvol
+       log_must zfs set volsize=$vsize $sparsevol
        vsize=$(volsize_to_reservation $regvol $vsize)
        regreserv=$(get_prop refreservation $regvol)
        sparsereserv=$(get_prop reservation $sparsevol)
index 3c02b9ebc163b47bf67b5352740ec7f7549f8d71..0969a6877316403e8528fad673a0607ac11a3699 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,8 +47,8 @@ verify_runnable "both"
 
 function cleanup
 {
-       datasetexists $fs_child && log_must $ZFS destroy $fs_child
-       log_must $ZFS set reservation=$reserv_val $fs
+       datasetexists $fs_child && log_must zfs destroy $fs_child
+       log_must zfs set reservation=$reserv_val $fs
 }
 
 log_onexit cleanup
@@ -62,9 +62,9 @@ space_avail=$(get_prop available $fs)
 reserv_val=$(get_prop reservation $fs)
 typeset reservsize=$space_avail
 ((reservsize = reservsize / 2))
-log_must $ZFS set reservation=$reservsize $fs
+log_must zfs set reservation=$reservsize $fs
 
-log_must $ZFS create $fs_child
+log_must zfs create $fs_child
 rsv_space=$(get_prop reservation $fs_child)
 [[ $rsv_space == $reservsize ]] && \
     log_fail "The reservation of child dataset inherits its value from parent."
index 1c66669c35d00282697ff9fe559337cf8a02ba03..e67158d0ba2227c9e30fcae412cf4fd53b12d207 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -53,16 +53,16 @@ typeset tmpfile="/tmp/mounted-datasets.$$"
 # damage done by the attempted pool destroy. The destroy itself should fail, but
 # some filesystems can become unmounted in the process, and aren't automatically
 # remounted.
-$MOUNT -p | $AWK '{if ($4 == "zfs") print $1" "$3}' > $tmpfile
+mount -p | awk '{if ($4 == "zfs") print $1" "$3}' > $tmpfile
 
-log_mustnot $ZPOOL destroy $rootpool
+log_mustnot zpool destroy $rootpool
 
 # Remount any filesystems that the destroy attempt unmounted.
 while read ds mntpt; do
-       mounted $ds || log_must $MOUNT -Fzfs $ds $mntpt
+       mounted $ds || log_must mount -Fzfs $ds $mntpt
 done < $tmpfile
-$RM -f $tmpfile
+rm -f $tmpfile
 
-log_mustnot $ZFS destroy $rootpool
+log_mustnot zfs destroy $rootpool
 
 log_pass "rootpool can not be destroyed"
index cea15129144cbcec3ae94d58b1cb83da9240c259..3bb5d12edddfde17f03a82223cc172e760ff1a0b 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,10 +52,10 @@ log_assert "system related filesystems can not be renamed or destroyed"
 typeset rootpool=$(get_rootpool)
 typeset rootfs=$(get_rootfs)
 
-log_mustnot $ZFS rename $rootfs $rootpool/newfs
-log_mustnot $ZFS rename -f $rootfs $rootpool/newfs
+log_mustnot zfs rename $rootfs $rootpool/newfs
+log_mustnot zfs rename -f $rootfs $rootpool/newfs
 
-log_mustnot $ZFS destroy $rootfs
-log_mustnot $ZFS destroy -f $rootfs
+log_mustnot zfs destroy $rootfs
+log_mustnot zfs destroy -f $rootfs
 
 log_pass "system related filesystems can not be renamed or destroyed"
index 4f715d59ae93566936f4b266f72a04aaf76747b8..d610c5add7cdf7578e27015d6c71b5ee1f203a1b 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,7 +45,7 @@
 verify_runnable "global"
 
 function cleanup {
-       log_must $ZFS set compression=$orig_compress $rootfs
+       log_must zfs set compression=$orig_compress $rootfs
 }
 
 log_onexit cleanup
@@ -63,7 +63,7 @@ set -A gtype "gzip" "gzip-1" "gzip-2" "gzip-3" "gzip-4" "gzip-5" \
 
 typeset -i i=0
 while (( i < ${#gtype[@]} )); do
-       log_mustnot $ZFS set compression=${gtype[i]} $rootfs
+       log_mustnot zfs set compression=${gtype[i]} $rootfs
        (( i += 1 ))
 done
 
index 6787660b0b0bfd3fd9d2025a2b0a16a6e6e91571..17a3e09a73af5930ed277e445c9443cf84ea41bf 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2014 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/rsend/rsend.kshlib
@@ -40,6 +40,6 @@ else
        cleanup_pool $POOL
        cleanup_pool $POOL2
 fi
-log_must $RM -rf $BACKDIR $TESTDIR
+log_must rm -rf $BACKDIR $TESTDIR
 
 log_pass
index 29aede5589153aa9a9bb7e1f7b60272fb0901fa9..064a6e7caf6a61007296d28ca6b4db3336836f6c 100644 (file)
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 export BACKDIR=${TEST_BASE_DIR%%/}/backdir-rsend
 
 export DISK1=${DISKS%% *}
-export DISK2=$($ECHO $DISKS | $AWK '{print $2}')
+export DISK2=$(echo $DISKS | awk '{print $2}')
 
 export POOL=$TESTPOOL
 export POOL2=$TESTPOOL1
index 7adb064f4c52bfbfa23b6ff1680f5037f2f3defd..784d0f75a418ad37f4330e20bfc9a60d45ba3a30 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -66,24 +66,24 @@ function setup_test_model
 {
        typeset pool=$1
 
-       log_must $ZFS create -p $pool/$FS/fs1/fs2
+       log_must zfs create -p $pool/$FS/fs1/fs2
 
-       log_must $ZFS snapshot $pool@psnap
-       log_must $ZFS clone $pool@psnap $pool/pclone
+       log_must zfs snapshot $pool@psnap
+       log_must zfs clone $pool@psnap $pool/pclone
 
        if is_global_zone ; then
-               log_must $ZFS create -V 16M $pool/vol
-               log_must $ZFS create -V 16M $pool/$FS/vol
+               log_must zfs create -V 16M $pool/vol
+               log_must zfs create -V 16M $pool/$FS/vol
                block_device_wait
 
-               log_must $ZFS snapshot $pool/$FS/vol@vsnap
-               log_must $ZFS clone $pool/$FS/vol@vsnap $pool/$FS/vclone
+               log_must zfs snapshot $pool/$FS/vol@vsnap
+               log_must zfs clone $pool/$FS/vol@vsnap $pool/$FS/vclone
                block_device_wait
        fi
 
        log_must snapshot_tree $pool/$FS/fs1/fs2@fsnap
-       log_must $ZFS clone $pool/$FS/fs1/fs2@fsnap $pool/$FS/fs1/fclone
-       log_must $ZFS snapshot -r $pool@init
+       log_must zfs clone $pool/$FS/fs1/fs2@fsnap $pool/$FS/fs1/fclone
+       log_must zfs snapshot -r $pool@init
 
        log_must snapshot_tree $pool@snapA
        log_must snapshot_tree $pool@snapC
@@ -96,13 +96,13 @@ function setup_test_model
        log_must snapshot_tree $pool/$FS/fs1/fclone@snapA
 
        if is_global_zone ; then
-               log_must $ZFS snapshot $pool/vol@snapA
-               log_must $ZFS snapshot $pool/$FS/vol@snapB
-               log_must $ZFS snapshot $pool/$FS/vol@snapC
-               log_must $ZFS snapshot $pool/$FS/vclone@snapC
+               log_must zfs snapshot $pool/vol@snapA
+               log_must zfs snapshot $pool/$FS/vol@snapB
+               log_must zfs snapshot $pool/$FS/vol@snapC
+               log_must zfs snapshot $pool/$FS/vclone@snapC
        fi
 
-       log_must $ZFS snapshot -r $pool@final
+       log_must zfs snapshot -r $pool@final
 
        return 0
 }
@@ -115,16 +115,16 @@ function setup_test_model
 function cleanup_pool
 {
        typeset pool=$1
-       log_must $RM -rf $BACKDIR/*
+       log_must rm -rf $BACKDIR/*
 
        if is_global_zone ; then
-               log_must $ZFS destroy -Rf $pool
+               log_must zfs destroy -Rf $pool
        else
-               typeset list=$($ZFS list -H -r -t filesystem,snapshot,volume -o name $pool)
+               typeset list=$(zfs list -H -r -t filesystem,snapshot,volume -o name $pool)
                for ds in $list ; do
                        if [[ $ds != $pool ]] ; then
                                if datasetexists $ds ; then
-                                       log_must $ZFS destroy -Rf $ds
+                                       log_must zfs destroy -Rf $ds
                                fi
                        fi
                done
@@ -134,13 +134,13 @@ function cleanup_pool
        if ! ismounted $pool ; then
                # Make sure mountpoint directory is empty
                if [[ -d $mntpnt ]]; then
-                       log_must $RM -rf $mntpnt/*
+                       log_must rm -rf $mntpnt/*
                fi
 
-               log_must $ZFS mount $pool
+               log_must zfs mount $pool
        fi
        if [[ -d $mntpnt ]]; then
-               log_must $RM -rf $mntpnt/*
+               log_must rm -rf $mntpnt/*
        fi
 
        return 0
@@ -157,16 +157,16 @@ function cmp_ds_subs
        typeset src_fs=$1
        typeset dst_fs=$2
 
-       $ZFS list -r -H -t filesystem,snapshot,volume -o name $src_fs > $BACKDIR/src1
-       $ZFS list -r -H -t filesystem,snapshot,volume -o name $dst_fs > $BACKDIR/dst1
+       zfs list -r -H -t filesystem,snapshot,volume -o name $src_fs > $BACKDIR/src1
+       zfs list -r -H -t filesystem,snapshot,volume -o name $dst_fs > $BACKDIR/dst1
 
-       eval $SED -e 's:^$src_fs:PREFIX:g' < $BACKDIR/src1 > $BACKDIR/src
-       eval $SED -e 's:^$dst_fs:PREFIX:g' < $BACKDIR/dst1 > $BACKDIR/dst
+       eval sed -e 's:^$src_fs:PREFIX:g' < $BACKDIR/src1 > $BACKDIR/src
+       eval sed -e 's:^$dst_fs:PREFIX:g' < $BACKDIR/dst1 > $BACKDIR/dst
 
-       $DIFF $BACKDIR/src $BACKDIR/dst
+       diff $BACKDIR/src $BACKDIR/dst
        typeset -i ret=$?
 
-       $RM -f $BACKDIR/src $BACKDIR/dst $BACKDIR/src1 $BACKDIR/dst1
+       rm -f $BACKDIR/src $BACKDIR/dst $BACKDIR/src1 $BACKDIR/dst1
 
        return $ret
 }
@@ -186,7 +186,7 @@ function cmp_ds_cont
        srcdir=$(get_prop mountpoint $src_fs)
        dstdir=$(get_prop mountpoint $dst_fs)
 
-       $DIFF -r $srcdir $dstdir > /dev/null 2>&1
+       diff -r $srcdir $dstdir > /dev/null 2>&1
        return $?
 }
 
@@ -207,19 +207,19 @@ function cmp_ds_prop
            "setuid" "snapdir" "version" "volsize" "xattr" "zoned" \
            "mountpoint";
        do
-               $ZFS get -H -o property,value,source $item $dtst1 >> \
+               zfs get -H -o property,value,source $item $dtst1 >> \
                    $BACKDIR/dtst1
-               $ZFS get -H -o property,value,source $item $dtst2 >> \
+               zfs get -H -o property,value,source $item $dtst2 >> \
                    $BACKDIR/dtst2
        done
 
-       eval $SED -e 's:$dtst1:PREFIX:g' < $BACKDIR/dtst1 > $BACKDIR/dtst1
-       eval $SED -e 's:$dtst2:PREFIX:g' < $BACKDIR/dtst2 > $BACKDIR/dtst2
+       eval sed -e 's:$dtst1:PREFIX:g' < $BACKDIR/dtst1 > $BACKDIR/dtst1
+       eval sed -e 's:$dtst2:PREFIX:g' < $BACKDIR/dtst2 > $BACKDIR/dtst2
 
-       $DIFF $BACKDIR/dtst1 $BACKDIR/dtst2
+       diff $BACKDIR/dtst1 $BACKDIR/dtst2
        typeset -i ret=$?
 
-       $RM -f $BACKDIR/dtst1 $BACKDIR/dtst2
+       rm -f $BACKDIR/dtst1 $BACKDIR/dtst2
 
        return $ret
 
@@ -235,16 +235,16 @@ function random_tree
        typeset dir=$1
 
        if [[ -d $dir ]]; then
-               $RM -rf $dir
+               rm -rf $dir
        fi
-       $MKDIR -p $dir
+       mkdir -p $dir
        typeset -i ret=$?
 
        typeset -i nl nd nf
        ((nl = RANDOM % 6 + 1))
        ((nd = RANDOM % 3 ))
        ((nf = RANDOM % 5 ))
-       $MKTREE -b $dir -l $nl -d $nd -f $nf
+       mktree -b $dir -l $nl -d $nd -f $nf
        ((ret |= $?))
 
        return $ret
@@ -273,7 +273,7 @@ function snapshot_tree
        fi
 
        if ((ret == 0)) ; then
-               $ZFS snapshot $snap
+               zfs snapshot $snap
                ((ret |= $?))
        fi
 
@@ -290,7 +290,7 @@ function destroy_tree
        typeset -i ret=0
        typeset snap
        for snap in "$@" ; do
-               $ZFS destroy $snap
+               zfs destroy $snap
                ret=$?
 
                typeset ds=${snap%%@*}
@@ -300,7 +300,7 @@ function destroy_tree
                        ((ret |= $?))
 
                        if ((ret != 0)); then
-                               $RM -r $mntpnt/$snap
+                               rm -r $mntpnt/$snap
                                ((ret |= $?))
                        fi
                fi
@@ -324,10 +324,10 @@ function getds_with_suffix
        typeset ds=$1
        typeset suffix=$2
 
-       typeset list=$($ZFS list -r -H -t filesystem,snapshot,volume -o name $ds \
-           | $GREP "$suffix$")
+       typeset list=$(zfs list -r -H -t filesystem,snapshot,volume -o name $ds \
+           | grep "$suffix$")
 
-       $ECHO $list
+       echo $list
 }
 
 #
@@ -337,18 +337,18 @@ function fs_inherit_prop
 {
        typeset fs_prop
        if is_global_zone ; then
-               fs_prop=$($ZFS inherit 2>&1 | \
-                   $AWK '$2=="YES" && $3=="YES" {print $1}')
+               fs_prop=$(zfs inherit 2>&1 | \
+                   awk '$2=="YES" && $3=="YES" {print $1}')
                if ! is_te_enabled ; then
-                       fs_prop=$(echo $fs_prop | $GREP -v "mlslabel")
+                       fs_prop=$(echo $fs_prop | grep -v "mlslabel")
                fi
        else
-               fs_prop=$($ZFS inherit 2>&1 | \
-                   $AWK '$2=="YES" && $3=="YES" {print $1}'|
-                   $EGREP -v "devices|mlslabel|sharenfs|sharesmb|zoned")
+               fs_prop=$(zfs inherit 2>&1 | \
+                   awk '$2=="YES" && $3=="YES" {print $1}'|
+                   egrep -v "devices|mlslabel|sharenfs|sharesmb|zoned")
        fi
 
-       $ECHO $fs_prop
+       echo $fs_prop
 }
 
 #
@@ -356,7 +356,7 @@ function fs_inherit_prop
 #
 function vol_inherit_prop
 {
-       $ECHO "checksum readonly"
+       echo "checksum readonly"
 }
 
 #
@@ -370,11 +370,11 @@ function get_dst_ds
        #
        # If the srcfs is not pool
        #
-       if ! $ZPOOL list $srcfs > /dev/null 2>&1 ; then
+       if ! zpool list $srcfs > /dev/null 2>&1 ; then
                eval dstfs="$dstfs/${srcfs#*/}"
        fi
 
-       $ECHO $dstfs
+       echo $dstfs
 }
 
 #
@@ -393,13 +393,13 @@ function mk_files
        fs=$4
 
        for ((i=0; i<$nfiles; i=i+1)); do
-               $DD if=/dev/urandom \
+               dd if=/dev/urandom \
                    of=/$fs/file-$maxsize-$((i+$file_id_offset)) \
                    bs=$((($RANDOM * $RANDOM % ($maxsize - 1)) + 1)) \
                    count=1 >/dev/null 2>&1 || log_fail \
                    "Failed to create /$fs/file-$maxsize-$((i+$file_id_offset))"
        done
-       $ECHO Created $nfiles files of random sizes up to $maxsize bytes
+       echo Created $nfiles files of random sizes up to $maxsize bytes
 }
 
 #
@@ -418,9 +418,9 @@ function rm_files
        fs=$4
 
        for ((i=0; i<$nfiles; i=i+1)); do
-               $RM -f /$fs/file-$maxsize-$((i+$file_id_offset))
+               rm -f /$fs/file-$maxsize-$((i+$file_id_offset))
        done
-       $ECHO Removed $nfiles files of random sizes up to $maxsize bytes
+       echo Removed $nfiles files of random sizes up to $maxsize bytes
 }
 
 #
@@ -432,17 +432,17 @@ function mess_file
 {
        file=$1
 
-       filesize=$($STAT -c '%s' $file)
+       filesize=$(stat -c '%s' $file)
        offset=$(($RANDOM * $RANDOM % $filesize))
        if (($RANDOM % 7 <= 1)); then
                #
                # We corrupt 2 bytes to minimize the chance that we
                # write the same value that's already there.
                #
-               log_must eval "$DD if=/dev/urandom of=$file conv=notrunc " \
+               log_must eval "dd if=/dev/urandom of=$file conv=notrunc " \
                    "bs=1 count=2 seek=$offset >/dev/null 2>&1"
        else
-               log_must $TRUNCATE -s $offset $file
+               log_must truncate -s $offset $file
        fi
 }
 
@@ -459,12 +459,12 @@ function file_check
 
        if [[ -d /$recvfs/.zfs/snapshot/a && -d \
            /$sendfs/.zfs/snapshot/a ]]; then
-               $DIFF -r /$recvfs/.zfs/snapshot/a /$sendfs/.zfs/snapshot/a
+               diff -r /$recvfs/.zfs/snapshot/a /$sendfs/.zfs/snapshot/a
                [[ $? -eq 0 ]] || log_fail "Differences found in snap a"
        fi
        if [[ -d /$recvfs/.zfs/snapshot/b && -d \
            /$sendfs/.zfs/snapshot/b ]]; then
-               $DIFF -r /$recvfs/.zfs/snapshot/b /$sendfs/.zfs/snapshot/b
+               diff -r /$recvfs/.zfs/snapshot/b /$sendfs/.zfs/snapshot/b
                [[ $? -eq 0 ]] || log_fail "Differences found in snap b"
        fi
 }
@@ -487,15 +487,15 @@ function resume_test
 
        for ((i=0; i<2; i=i+1)); do
                mess_file /$streamfs/$stream_num
-               log_mustnot $ZFS recv -sv $recvfs </$streamfs/$stream_num
+               log_mustnot zfs recv -sv $recvfs </$streamfs/$stream_num
                stream_num=$((stream_num+1))
 
-               token=$($ZFS get -Hp -o value receive_resume_token $recvfs)
-               log_must eval "$ZFS send -v -t $token >/$streamfs/$stream_num"
+               token=$(zfs get -Hp -o value receive_resume_token $recvfs)
+               log_must eval "zfs send -v -t $token >/$streamfs/$stream_num"
                [[ -f /$streamfs/$stream_num ]] || \
                    log_fail "NO FILE /$streamfs/$stream_num"
        done
-       log_must $ZFS recv -sv $recvfs </$streamfs/$stream_num
+       log_must zfs recv -sv $recvfs </$streamfs/$stream_num
 }
 
 #
@@ -514,19 +514,19 @@ function test_fs_setup
        streamfs=$sendpool/stream
 
        if datasetexists $recvfs; then
-               log_must $ZFS destroy -r $recvfs
+               log_must zfs destroy -r $recvfs
        fi
        if datasetexists $sendfs; then
-               log_must $ZFS destroy -r $sendfs
+               log_must zfs destroy -r $sendfs
        fi
-       if $($ZFS create -o compress=lz4 $sendfs); then
+       if $(zfs create -o compress=lz4 $sendfs); then
                mk_files 1000 256 0 $sendfs &
                mk_files 1000 131072 0 $sendfs &
                mk_files 100 1048576 0 $sendfs &
                mk_files 10 10485760 0 $sendfs &
                mk_files 1 104857600 0 $sendfs &
                wait
-               log_must $ZFS snapshot $sendfs@a
+               log_must zfs snapshot $sendfs@a
 
                rm_files 200 256 0 $sendfs &
                rm_files 200 131072 0 $sendfs &
@@ -540,14 +540,14 @@ function test_fs_setup
                mk_files 4 10485760 0 $sendfs &
                wait
 
-               log_must $ZFS snapshot $sendfs@b
-               log_must eval "$ZFS send -v $sendfs@a >/$sendpool/initial.zsend"
-               log_must eval "$ZFS send -v -i @a $sendfs@b " \
+               log_must zfs snapshot $sendfs@b
+               log_must eval "zfs send -v $sendfs@a >/$sendpool/initial.zsend"
+               log_must eval "zfs send -v -i @a $sendfs@b " \
                    ">/$sendpool/incremental.zsend"
        fi
 
        if datasetexists $streamfs; then
-               log_must $ZFS destroy -r $streamfs
+               log_must zfs destroy -r $streamfs
        fi
-       log_must $ZFS create -o compress=lz4 $sendpool/stream
+       log_must zfs create -o compress=lz4 $sendpool/stream
 }
index 6087dd3ef014c836a57205469eb9481792582d39..3864d8a7d1bd2d16a9a34d65c44a584f43e928ca 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/rsend/rsend.kshlib
@@ -50,8 +50,8 @@ log_onexit cleanup_pool $POOL2
 #
 # Verify the entire pool and sub-ds can be backup and restored.
 #
-log_must eval "$ZFS send -R $POOL@final > $BACKDIR/pool-final-R"
-log_must eval "$ZFS receive -d -F $POOL2 < $BACKDIR/pool-final-R"
+log_must eval "zfs send -R $POOL@final > $BACKDIR/pool-final-R"
+log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/pool-final-R"
 
 dstds=$(get_dst_ds $POOL $POOL2)
 log_must cmp_ds_subs $POOL $dstds
@@ -63,8 +63,8 @@ log_must cleanup_pool $POOL2
 #
 # Verify all the filesystem and sub-fs can be backup and restored.
 #
-log_must eval "$ZFS send -R $POOL/$FS@final > $BACKDIR/fs-final-R"
-log_must eval "$ZFS receive -d $POOL2 < $BACKDIR/fs-final-R"
+log_must eval "zfs send -R $POOL/$FS@final > $BACKDIR/fs-final-R"
+log_must eval "zfs receive -d $POOL2 < $BACKDIR/fs-final-R"
 
 dstds=$(get_dst_ds $POOL/$FS $POOL2)
 log_must cmp_ds_subs $POOL/$FS $dstds
index 9a495d35298eeec828ad3ebf7c42528bb8924344..f2c1e03937e2ff10b2724d9252bd17e9f736ffdc 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/rsend/rsend.kshlib
@@ -50,17 +50,17 @@ log_onexit cleanup_pool $POOL2
 #
 # Duplicate POOL2
 #
-log_must eval "$ZFS send -R $POOL@final > $BACKDIR/pool-R"
-log_must eval "$ZFS receive -d -F $POOL2 < $BACKDIR/pool-R"
+log_must eval "zfs send -R $POOL@final > $BACKDIR/pool-R"
+log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/pool-R"
 
 if is_global_zone ; then
        #
        # Verify send -I will backup all the incrementals in pool
        #
-       log_must eval "$ZFS send -I $POOL2@init $POOL2@final > " \
+       log_must eval "zfs send -I $POOL2@init $POOL2@final > " \
                "$BACKDIR/pool-init-final-I"
        log_must destroy_tree $POOL2@final $POOL2@snapC $POOL2@snapA
-       log_must eval "$ZFS receive -d -F $POOL2 < $BACKDIR/pool-init-final-I"
+       log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/pool-init-final-I"
        log_must cmp_ds_subs $POOL $POOL2
        log_must cmp_ds_cont $POOL $POOL2
 fi
@@ -70,9 +70,9 @@ dstds=$(get_dst_ds $POOL $POOL2)
 #
 # Verify send -I will backup all the incrementals in filesystem
 #
-log_must eval "$ZFS send -I @init $dstds/$FS@final > $BACKDIR/fs-init-final-I"
+log_must eval "zfs send -I @init $dstds/$FS@final > $BACKDIR/fs-init-final-I"
 log_must destroy_tree $dstds/$FS@final $dstds/$FS@snapC $dstds/$FS@snapB
-log_must eval "$ZFS receive -d -F $dstds < $BACKDIR/fs-init-final-I"
+log_must eval "zfs receive -d -F $dstds < $BACKDIR/fs-init-final-I"
 log_must cmp_ds_subs $POOL $dstds
 log_must cmp_ds_cont $POOL $dstds
 
@@ -81,11 +81,11 @@ if is_global_zone ; then
        # Verify send -I will backup all the incrementals in volume
        #
        dataset=$POOL2/$FS/vol
-       log_must eval "$ZFS send -I @vsnap $dataset@final > " \
+       log_must eval "zfs send -I @vsnap $dataset@final > " \
                "$BACKDIR/vol-vsnap-final-I"
        log_must destroy_tree $dataset@final $dataset@snapC  \
                $dataset@snapB $dataset@init
-       log_must eval "$ZFS receive -d -F $POOL2 < $BACKDIR/vol-vsnap-final-I"
+       log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/vol-vsnap-final-I"
        log_must cmp_ds_subs $POOL $POOL2
        log_must cmp_ds_cont $POOL $POOL2
 fi
index 85d789de5b44f7ea005347b50424f47052baa0cc..11d48ef0dc8db5f10ecbb6f638b6ccd36be18060 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/rsend/rsend.kshlib
@@ -50,17 +50,17 @@ log_onexit cleanup_pool $POOL2
 #
 # Duplicate POOL2
 #
-log_must eval "$ZFS send -R $POOL@final > $BACKDIR/pool-R"
-log_must eval "$ZFS receive -d -F $POOL2 < $BACKDIR/pool-R"
+log_must eval "zfs send -R $POOL@final > $BACKDIR/pool-R"
+log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/pool-R"
 
 if is_global_zone ; then
        #
        # Verify send -I backup all incrementals from pool
        #
-       log_must eval "$ZFS send -I $POOL2@psnap $POOL2/pclone@final > " \
+       log_must eval "zfs send -I $POOL2@psnap $POOL2/pclone@final > " \
                "$BACKDIR/pool-clone-I"
-       log_must $ZFS destroy -rf $POOL2/pclone
-       log_must eval "$ZFS receive -d -F $POOL2 < $BACKDIR/pool-clone-I"
+       log_must zfs destroy -rf $POOL2/pclone
+       log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/pool-clone-I"
        log_must cmp_ds_subs $POOL $POOL2
        log_must cmp_ds_cont $POOL $POOL2
 fi
@@ -71,10 +71,10 @@ dstds=$(get_dst_ds $POOL $POOL2)
 # Verify send -I backup all incrementals from filesystem
 #
 ds=$dstds/$FS/fs1
-log_must eval "$ZFS send -I $ds/fs2@fsnap $ds/fclone@final > " \
+log_must eval "zfs send -I $ds/fs2@fsnap $ds/fclone@final > " \
        "$BACKDIR/fs-clone-I"
-log_must $ZFS destroy -rf $ds/fclone
-log_must eval "$ZFS receive -F $ds/fclone < $BACKDIR/fs-clone-I"
+log_must zfs destroy -rf $ds/fclone
+log_must eval "zfs receive -F $ds/fclone < $BACKDIR/fs-clone-I"
 
 log_must cmp_ds_subs $POOL $dstds
 log_must cmp_ds_cont $POOL $dstds
@@ -84,10 +84,10 @@ if is_global_zone ; then
        # Verify send -I backup all incrementals from volume
        #
        ds=$POOL2/$FS
-       log_must eval "$ZFS send -I $ds/vol@vsnap $ds/vclone@final > " \
+       log_must eval "zfs send -I $ds/vol@vsnap $ds/vclone@final > " \
                "$BACKDIR/vol-clone-I"
-       log_must $ZFS destroy -rf $ds/vclone
-       log_must eval "$ZFS receive -d -F $POOL2 < $BACKDIR/vol-clone-I"
+       log_must zfs destroy -rf $ds/vclone
+       log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/vol-clone-I"
        log_must cmp_ds_subs $POOL $POOL2
        log_must cmp_ds_cont $POOL $POOL2
 fi
index 18cdac379ffce894741cdd22f989168cf39134b1..c0b36b2329e7c7a54c416a496e66ce5ff3e59b37 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/rsend/rsend.kshlib
@@ -51,8 +51,8 @@ log_onexit cleanup_pool $POOL2
 #
 # Duplicate POOL2 for testing
 #
-log_must eval "$ZFS send -R $POOL@final > $BACKDIR/pool-final-R"
-log_must eval "$ZFS receive -d -F $POOL2 < $BACKDIR/pool-final-R"
+log_must eval "zfs send -R $POOL@final > $BACKDIR/pool-final-R"
+log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/pool-final-R"
 
 if is_global_zone ; then
        #
@@ -63,10 +63,10 @@ if is_global_zone ; then
        interlist="$interlist $(getds_with_suffix $POOL2 @snapB)"
        interlist="$interlist $(getds_with_suffix $POOL2 @snapA)"
 
-       log_must eval "$ZFS send -R -i @init $POOL2@final > " \
+       log_must eval "zfs send -R -i @init $POOL2@final > " \
                "$BACKDIR/pool-init-final-iR"
        log_must destroy_tree $interlist
-       log_must eval "$ZFS receive -d -F $POOL2 < $BACKDIR/pool-init-final-iR"
+       log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/pool-init-final-iR"
 
        # Get current datasets with suffix @final
        dstlist=$(getds_with_suffix $POOL2 @final)
@@ -80,7 +80,7 @@ dstds=$(get_dst_ds $POOL $POOL2)
 #
 # Testing send -R -i backup from filesystem
 #
-log_must eval "$ZFS send -R -i @init $dstds/$FS@final > " \
+log_must eval "zfs send -R -i @init $dstds/$FS@final > " \
        "$BACKDIR/fs-init-final-iR"
 
 srclist=$(getds_with_suffix $dstds/$FS @final)
@@ -89,9 +89,9 @@ interlist="$interlist $(getds_with_suffix $dstds/$FS @snapB)"
 interlist="$interlist $(getds_with_suffix $dstds/$FS @snapA)"
 log_must destroy_tree $interlist
 if is_global_zone ; then
-       log_must eval "$ZFS receive -d -F $POOL2 < $BACKDIR/fs-init-final-iR"
+       log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/fs-init-final-iR"
 else
-       $ZFS receive -F -d $dstds/$FS < $BACKDIR/fs-init-final-iR
+       zfs receive -F -d $dstds/$FS < $BACKDIR/fs-init-final-iR
 fi
 
 dstlist=$(getds_with_suffix $dstds/$FS @final)
@@ -105,10 +105,10 @@ if is_global_zone ; then
        # Testing send -R -i backup from volume
        #
        srclist=$(getds_with_suffix $POOL2/$FS/vol @final)
-       log_must eval "$ZFS send -R -i @init $POOL2/$FS/vol@final > " \
+       log_must eval "zfs send -R -i @init $POOL2/$FS/vol@final > " \
                "$BACKDIR/vol-init-final-iR"
        log_must destroy_tree $srclist
-       log_must eval "$ZFS receive -d $POOL2 < $BACKDIR/vol-init-final-iR"
+       log_must eval "zfs receive -d $POOL2 < $BACKDIR/vol-init-final-iR"
 
        dstlist=$(getds_with_suffix $POOL2/$FS/vol @final)
        if [[ $srclist != $dstlist ]]; then
index 154072d70a3f9e7d2a3e26596a3469813e2d6e07..4d156690e38a42a29e929670a473d977638c7428 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/rsend/rsend.kshlib
@@ -51,21 +51,21 @@ log_onexit cleanup_pool $POOL2
 #
 # Duplicate POOL2 for testing
 #
-log_must eval "$ZFS send -R $POOL@final > $BACKDIR/pool-final-R"
-log_must eval "$ZFS receive -d -F $POOL2 < $BACKDIR/pool-final-R"
+log_must eval "zfs send -R $POOL@final > $BACKDIR/pool-final-R"
+log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/pool-final-R"
 
 if is_global_zone ; then
        #
        # Testing send -R -I from pool
        #
-       log_must eval "$ZFS send -R -I @init $POOL2@final > " \
+       log_must eval "zfs send -R -I @init $POOL2@final > " \
                "$BACKDIR/pool-init-final-IR"
        list=$(getds_with_suffix $POOL2 @snapA)
        list="$list $(getds_with_suffix $POOL2 @snapB)"
        list="$list $(getds_with_suffix $POOL2 @snapC)"
        list="$list $(getds_with_suffix $POOL2 @final)"
        log_must destroy_tree $list
-       log_must eval "$ZFS receive -d -F $POOL2 < $BACKDIR/pool-init-final-IR"
+       log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/pool-init-final-IR"
        log_must cmp_ds_cont $POOL $POOL2
 fi
 
@@ -73,7 +73,7 @@ dstds=$(get_dst_ds $POOL $POOL2)
 #
 # Testing send -R -I from filesystem
 #
-log_must eval "$ZFS send -R -I @init $dstds/$FS@final > " \
+log_must eval "zfs send -R -I @init $dstds/$FS@final > " \
        "$BACKDIR/fs-init-final-IR"
 list=$(getds_with_suffix $dstds/$FS @snapA)
 list="$list $(getds_with_suffix $dstds/$FS @snapB)"
@@ -81,9 +81,9 @@ list="$list $(getds_with_suffix $dstds/$FS @snapC)"
 list="$list $(getds_with_suffix $dstds/$FS @final)"
 log_must destroy_tree $list
 if is_global_zone ; then
-       log_must eval "$ZFS receive -d -F $dstds < $BACKDIR/fs-init-final-IR"
+       log_must eval "zfs receive -d -F $dstds < $BACKDIR/fs-init-final-IR"
 else
-       $ZFS receive -d -F $dstds < $BACKDIR/fs-init-final-IR
+       zfs receive -d -F $dstds < $BACKDIR/fs-init-final-IR
 fi
 log_must cmp_ds_subs $POOL $dstds
 log_must cmp_ds_cont $POOL $dstds
@@ -93,10 +93,10 @@ if is_global_zone ; then
        # Testing send -I -R for volume
        #
        vol=$POOL2/$FS/vol
-       log_must eval "$ZFS send -R -I @init $vol@final > " \
+       log_must eval "zfs send -R -I @init $vol@final > " \
                "$BACKDIR/vol-init-final-IR"
        log_must destroy_tree $vol@snapB $vol@snapC $vol@final
-       log_must eval "$ZFS receive -d -F $POOL2 < $BACKDIR/vol-init-final-IR"
+       log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/vol-init-final-IR"
        log_must cmp_ds_subs $POOL $POOL2
        log_must cmp_ds_cont $POOL $POOL2
 fi
index 78f3d26bcb6644d36bb4cfa79f2d6b1c22fd0334..8c598f4ec29cfe120a3ea791a3e63506da349307 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/rsend/rsend.kshlib
@@ -64,7 +64,7 @@ log_onexit cleanup
 
 typeset -i i=0
 while ((i < ${#snaps[@]})); do
-       log_must $ZFS rename -r ${snaps[$i]} ${snaps[((i+1))]}
+       log_must zfs rename -r ${snaps[$i]} ${snaps[((i+1))]}
 
        ((i += 2))
 done
@@ -72,8 +72,8 @@ done
 #
 # Duplicate POOL2 for testing
 #
-log_must eval "$ZFS send -R $POOL@init > $BACKDIR/pool-final-R"
-log_must eval "$ZFS receive -d -F $POOL2 < $BACKDIR/pool-final-R"
+log_must eval "zfs send -R $POOL@init > $BACKDIR/pool-final-R"
+log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/pool-final-R"
 
 dstds=$(get_dst_ds $POOL $POOL2)
 log_must cmp_ds_subs $POOL $dstds
index e08bd80bf8314dda014cd4e68d516cf68dbd6730..29e9f1859579a38342e5ff89c8c69288a90028f8 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/rsend/rsend.kshlib
@@ -64,7 +64,7 @@ log_onexit cleanup
 
 typeset -i i=0
 while ((i < ${#dtst[@]})); do
-       log_must $ZFS rename ${dtst[$i]} ${dtst[((i+1))]}
+       log_must zfs rename ${dtst[$i]} ${dtst[((i+1))]}
 
        ((i += 2))
 done
@@ -72,15 +72,15 @@ done
 #
 # Verify zfs send -R should succeed
 #
-log_must eval "$ZFS send -R $POOL@final > $BACKDIR/pool-final-R"
-log_must eval "$ZFS receive -d -F $POOL2 < $BACKDIR/pool-final-R"
+log_must eval "zfs send -R $POOL@final > $BACKDIR/pool-final-R"
+log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/pool-final-R"
 dstds=$(get_dst_ds $POOL $POOL2)
 log_must cmp_ds_subs $POOL $dstds
 
 #
 # Verify zfs send -R -I should succeed
 #
-log_must eval "$ZFS send -R -I @init $dstds@final > " \
+log_must eval "zfs send -R -I @init $dstds@final > " \
         "$BACKDIR/pool-init-final-IR"
 list=$(getds_with_suffix $dstds @snapA)
 list="$list $(getds_with_suffix $dstds @snapB)"
@@ -88,9 +88,9 @@ list="$list $(getds_with_suffix $dstds @snapC)"
 list="$list $(getds_with_suffix $dstds @final)"
 log_must destroy_tree $list
 if is_global_zone ; then
-       log_must eval "$ZFS receive -d -F $dstds < $BACKDIR/pool-init-final-IR"
+       log_must eval "zfs receive -d -F $dstds < $BACKDIR/pool-init-final-IR"
 else
-       $ZFS receive -d -F $dstds < $BACKDIR/pool-init-final-IR
+       zfs receive -d -F $dstds < $BACKDIR/pool-init-final-IR
 fi
 log_must cmp_ds_subs $POOL $dstds
 
index 7248142fa2d9ee7d1de884a6d018908c855172a7..561a55a229d6d1b6076891f8772d3fc839cfc670 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/rsend/rsend.kshlib
@@ -60,7 +60,7 @@ function cleanup
                origin=$(get_prop origin ${dtst[$i]})
 
                if [[ $origin != "-" ]]; then
-                       log_must $ZFS promote ${dtst[$i]}
+                       log_must zfs promote ${dtst[$i]}
                fi
 
                ((i += 2))
@@ -68,7 +68,7 @@ function cleanup
 
        origin=$(get_prop origin $POOL2)
        if [[ $origin != "-" ]]; then
-               log_must $ZFS promote $POOL2
+               log_must zfs promote $POOL2
        fi
        log_must cleanup_pool $POOL2
 }
@@ -78,7 +78,7 @@ log_onexit cleanup
 
 typeset -i i=0
 while ((i < ${#dtst[@]})); do
-       log_must $ZFS promote ${dtst[((i+1))]}
+       log_must zfs promote ${dtst[((i+1))]}
 
        ((i += 2))
 done
@@ -86,8 +86,8 @@ done
 #
 # Verify zfs send -R should succeed
 #
-log_must eval "$ZFS send -R $POOL@final > $BACKDIR/pool-final-R"
-log_must eval "$ZFS receive -d -F $POOL2 < $BACKDIR/pool-final-R"
+log_must eval "zfs send -R $POOL@final > $BACKDIR/pool-final-R"
+log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/pool-final-R"
 
 dstds=$(get_dst_ds $POOL $POOL2)
 #
@@ -119,10 +119,10 @@ while ((i < ${#pair[@]})); do
 done
 
 # Verify the original filesystem can be promoted
-log_must $ZFS promote $dstds
+log_must zfs promote $dstds
 if is_global_zone ; then
-       log_must $ZFS promote $dstds/$FS/vol
+       log_must zfs promote $dstds/$FS/vol
 fi
-log_must $ZFS promote $dstds/$FS/fs1/fs2
+log_must zfs promote $dstds/$FS/fs1/fs2
 
 log_pass "Changes made by 'zfs promote' can be properly received."
index c85d22d729a597bdbe41e5b2ed23750156909ffb..1578283fc707de2fc9952646a44b5f3238c1ccc0 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/rsend/rsend.kshlib
@@ -48,30 +48,30 @@ verify_runnable "global"
 function cleanup
 {
        if datasetexists bpool ; then
-               log_must $ZPOOL destroy -f bpool
+               log_must zpool destroy -f bpool
        fi
        if datasetexists spool ; then
-               log_must $ZPOOL destroy -f spool
+               log_must zpool destroy -f spool
        fi
 }
 
 log_assert "Verify zfs receive can handle out of space correctly."
 log_onexit cleanup
 
-log_must $MKFILE $MINVDEVSIZE $TESTDIR/bfile
-log_must $MKFILE $SPA_MINDEVSIZE  $TESTDIR/sfile
+log_must mkfile $MINVDEVSIZE $TESTDIR/bfile
+log_must mkfile $SPA_MINDEVSIZE  $TESTDIR/sfile
 log_must zpool create bpool $TESTDIR/bfile
 log_must zpool create spool $TESTDIR/sfile
 
 #
 # Test out of space on sub-filesystem
 #
-log_must $ZFS create bpool/fs
-log_must $MKFILE 30M /bpool/fs/file
+log_must zfs create bpool/fs
+log_must mkfile 30M /bpool/fs/file
 
-log_must $ZFS snapshot bpool/fs@snap
-log_must eval "$ZFS send -R bpool/fs@snap > $BACKDIR/fs-R"
-log_mustnot eval "$ZFS receive -d -F spool < $BACKDIR/fs-R"
+log_must zfs snapshot bpool/fs@snap
+log_must eval "zfs send -R bpool/fs@snap > $BACKDIR/fs-R"
+log_mustnot eval "zfs receive -d -F spool < $BACKDIR/fs-R"
 
 log_must datasetnonexists spool/fs
 log_must ismounted spool
@@ -79,12 +79,12 @@ log_must ismounted spool
 #
 # Test out of space on top filesystem
 #
-log_must $MV /bpool/fs/file /bpool
-log_must $ZFS destroy -rf bpool/fs
+log_must mv /bpool/fs/file /bpool
+log_must zfs destroy -rf bpool/fs
 
-log_must $ZFS snapshot bpool@snap
-log_must eval "$ZFS send -R bpool@snap > $BACKDIR/bpool-R"
-log_mustnot eval "$ZFS receive -d -F spool < $BACKDIR/bpool-R"
+log_must zfs snapshot bpool@snap
+log_must eval "zfs send -R bpool@snap > $BACKDIR/bpool-R"
+log_mustnot eval "zfs receive -d -F spool < $BACKDIR/bpool-R"
 
 log_must datasetnonexists spool/fs
 log_must ismounted spool
index 503a8c224efa489bffa7aae5b651fce4bacef285..e76f5c5c86204e396a05858429bc0d7413bce7ae 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/rsend/rsend.kshlib
@@ -47,31 +47,31 @@ verify_runnable "both"
 log_assert "ZFS can handle stream with multiple identical (same GUID) snapshots"
 log_onexit cleanup_pool $POOL2
 
-log_must $ZFS create $POOL2/$FS
-log_must $ZFS snapshot $POOL2/$FS@snap
+log_must zfs create $POOL2/$FS
+log_must zfs snapshot $POOL2/$FS@snap
 
 #
 # First round restore the stream
 #
-log_must eval "$ZFS send -R $POOL2/$FS@snap > $BACKDIR/fs-R"
-log_must eval "$ZFS receive -d -F $POOL2/$FS < $BACKDIR/fs-R"
+log_must eval "zfs send -R $POOL2/$FS@snap > $BACKDIR/fs-R"
+log_must eval "zfs receive -d -F $POOL2/$FS < $BACKDIR/fs-R"
 
 #
 # In order to avoid 'zfs send -R' failed, create snapshot for
 # all the sub-systems
 #
-list=$($ZFS list -r -H -o name -t filesystem $POOL2/$FS)
+list=$(zfs list -r -H -o name -t filesystem $POOL2/$FS)
 for item in $list ; do
        if datasetnonexists $item@snap ; then
-               log_must $ZFS snapshot $item@snap
+               log_must zfs snapshot $item@snap
        fi
 done
 
 #
 # Second round restore the stream
 #
-log_must eval "$ZFS send -R $POOL2/$FS@snap > $BACKDIR/fs-R"
+log_must eval "zfs send -R $POOL2/$FS@snap > $BACKDIR/fs-R"
 dstds=$(get_dst_ds $POOL2/$FS $POOL2/$FS)
-log_must eval "$ZFS receive -d -F $dstds < $BACKDIR/fs-R"
+log_must eval "zfs receive -d -F $dstds < $BACKDIR/fs-R"
 
 log_pass "ZFS can handle stream with multiple identical (same GUID) snapshots"
index fa8aa3bd5930769b834a489f2c4b90b98baf322e..3b6cc29372c0a76bb59286592d8dc9b286dc51e9 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/rsend/rsend.kshlib
@@ -46,7 +46,7 @@ verify_runnable "both"
 function cleanup
 {
        export __ZFS_POOL_RESTRICT="$POOL $POOL2"
-       log_must $ZFS unmount -a
+       log_must zfs unmount -a
        unset __ZFS_POOL_RESTRICT
        log_must cleanup_pool $POOL
        log_must cleanup_pool $POOL2
@@ -62,7 +62,7 @@ log_onexit cleanup
 #
 for prop in $(fs_inherit_prop); do
        value=$(get_prop $prop $POOL/$FS)
-       log_must $ZFS set $prop=$value $POOL/$FS
+       log_must zfs set $prop=$value $POOL/$FS
 done
 
 #
@@ -70,17 +70,17 @@ done
 #
 for ds in "$POOL/$FS/fs1" "$POOL/$FS/fs1/fs2" "$POOL/$FS/fs1/fclone" ; do
        for prop in $(fs_inherit_prop) ; do
-               $ZFS inherit $prop $ds
+               zfs inherit $prop $ds
                if (($? !=0 )); then
-                       log_fail "$ZFS inherit $prop $ds"
+                       log_fail "zfs inherit $prop $ds"
                fi
        done
 done
 if is_global_zone ; then
        for prop in $(vol_inherit_prop) ; do
-               $ZFS inherit $prop $POOL/$FS/vol
+               zfs inherit $prop $POOL/$FS/vol
                if (($? !=0 )); then
-                       log_fail "$ZFS inherit $prop $POOL/$FS/vol"
+                       log_fail "zfs inherit $prop $POOL/$FS/vol"
                fi
        done
 fi
@@ -89,9 +89,9 @@ fi
 # Verify datasets can be backup and restore correctly
 # Unmount $POOL/$FS to avoid two fs mount in the same mountpoint
 #
-log_must eval "$ZFS send -R $POOL@final > $BACKDIR/pool-R"
-log_must $ZFS unmount -f $POOL/$FS
-log_must eval "$ZFS receive -d -F $POOL2 < $BACKDIR/pool-R"
+log_must eval "zfs send -R $POOL@final > $BACKDIR/pool-R"
+log_must zfs unmount -f $POOL/$FS
+log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/pool-R"
 
 dstds=$(get_dst_ds $POOL $POOL2)
 #
index a7698da691458a51be2dbe57eeb460fce0d9941b..3c19f618b27b465d6fb59fefea419cdfb29feedb 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/rsend/rsend.kshlib
@@ -51,7 +51,7 @@ function rand_set_prop
        shift 2
        typeset value=$(random_get $@)
 
-       log_must eval "$ZFS set $prop='$value' $dtst"
+       log_must eval "zfs set $prop='$value' $dtst"
 }
 
 function edited_prop
@@ -62,15 +62,15 @@ function edited_prop
 
        case $behaviour in
                "get")
-                       typeset props=$($ZFS inherit 2>&1 | \
-                               $AWK '$2=="YES" {print $1}' | \
-                               $EGREP -v "^vol|\.\.\.$")
+                       typeset props=$(zfs inherit 2>&1 | \
+                               awk '$2=="YES" {print $1}' | \
+                               egrep -v "^vol|\.\.\.$")
                        for item in $props ; do
                                if [[ $item == "mlslabel" ]] && \
                                        ! is_te_enabled ; then
                                        continue
                                fi
-                               $ZFS get -H -o property,value $item $ds >> \
+                               zfs get -H -o property,value $item $ds >> \
                                        $backfile
                                if (($? != 0)); then
                                        log_fail "zfs get -H -o property,value"\
@@ -85,9 +85,9 @@ function edited_prop
 
                        typeset prop value
                        while read prop value ; do
-                               eval $ZFS set $prop='$value' $ds
+                               eval zfs set $prop='$value' $ds
                                if (($? != 0)); then
-                                       log_fail "$ZFS set $prop=$value $ds"
+                                       log_fail "zfs set $prop=$value $ds"
                                fi
                        done < $backfile
                        ;;
@@ -106,14 +106,14 @@ function cleanup
 
        typeset prop
        for prop in $(fs_inherit_prop) ; do
-               log_must $ZFS inherit $prop $POOL
-               log_must $ZFS inherit $prop $POOL2
+               log_must zfs inherit $prop $POOL
+               log_must zfs inherit $prop $POOL2
        done
 
        log_must setup_test_model $POOL
 
        if [[ -d $TESTDIR ]]; then
-               log_must $RM -rf $TESTDIR/*
+               log_must rm -rf $TESTDIR/*
        fi
 }
 
@@ -164,8 +164,8 @@ rand_set_prop $POOL sync "standard" "always" "disabled"
 #
 # Duplicate POOL2 for testing
 #
-log_must eval "$ZFS send -R $POOL@final > $BACKDIR/pool-final-R"
-log_must eval "$ZFS receive -d -F $POOL2 < $BACKDIR/pool-final-R"
+log_must eval "zfs send -R $POOL@final > $BACKDIR/pool-final-R"
+log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/pool-final-R"
 
 #
 # Define all the POOL/POOL2 datasets pair
@@ -187,7 +187,7 @@ while ((i < ${#pair[@]})); do
 done
 
 
-$ZPOOL upgrade -v | $GREP "Snapshot properties" > /dev/null 2>&1
+zpool upgrade -v | grep "Snapshot properties" > /dev/null 2>&1
 if (( $? == 0 )) ; then
        i=0
        while ((i < ${#pair[@]})); do
index fefcfa7c39574766077f0f5dbe192cb01cb88fd5..80644ee2093037f29806d4562b8a1b8328dacd49 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/rsend/rsend.kshlib
@@ -63,20 +63,20 @@ cleanup
 #
 # Duplicate POOL2 for testing
 #
-log_must eval "$ZFS send -R $POOL@final > $BACKDIR/pool-final-R"
-log_must eval "$ZFS receive -dF $POOL2 < $BACKDIR/pool-final-R"
+log_must eval "zfs send -R $POOL@final > $BACKDIR/pool-final-R"
+log_must eval "zfs receive -dF $POOL2 < $BACKDIR/pool-final-R"
 
-log_must $ZFS destroy -Rf $POOL/$FS
-log_must $ZFS destroy -Rf $POOL/pclone
+log_must zfs destroy -Rf $POOL/$FS
+log_must zfs destroy -Rf $POOL/pclone
 
 if is_global_zone ; then
-       log_must $ZFS destroy -Rf $POOL/vol
+       log_must zfs destroy -Rf $POOL/vol
 fi
-log_must $ZFS snapshot -r $POOL@destroy
+log_must zfs snapshot -r $POOL@destroy
 
-log_must eval "$ZFS send -R -I @final $POOL@destroy > " \
+log_must eval "zfs send -R -I @final $POOL@destroy > " \
        "$BACKDIR/pool-final-destroy-IR"
-log_must eval "$ZFS receive -dF $POOL2 < $BACKDIR/pool-final-destroy-IR"
+log_must eval "zfs receive -dF $POOL2 < $BACKDIR/pool-final-destroy-IR"
 
 dstds=$(get_dst_ds $POOL $POOL2)
 log_must cmp_ds_subs $POOL $dstds
index 68576816c59abf28ccce9f5ea1e5662b8d3708e5..7a2dc5dddb5d04849c024241872a6f3dbd3705c7 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2014 by Delphix. All rights reserved.
+# Copyright (c) 2014, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -33,10 +33,10 @@ verify_runnable "both"
 log_assert "zfs send will work on filesystems and volumes in a read-only pool."
 log_onexit cleanup_pool $POOL2
 
-log_must eval "$ZPOOL export $POOL"
-log_must eval "$ZPOOL import -o readonly=on $POOL"
-log_must eval "$ZFS send -R $POOL@final > $BACKDIR/pool-final-R"
-log_must eval "$ZFS receive -d -F $POOL2 < $BACKDIR/pool-final-R"
+log_must eval "zpool export $POOL"
+log_must eval "zpool import -o readonly=on $POOL"
+log_must eval "zfs send -R $POOL@final > $BACKDIR/pool-final-R"
+log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/pool-final-R"
 
 dstds=$(get_dst_ds $POOL $POOL2)
 log_must cmp_ds_subs $POOL $dstds
@@ -44,11 +44,11 @@ log_must cmp_ds_cont $POOL $dstds
 
 log_must cleanup_pool $POOL2
 
-log_must eval "$ZFS send -R $POOL/$FS@final > $BACKDIR/fs-final-R"
-log_must eval "$ZFS receive -d $POOL2 < $BACKDIR/fs-final-R"
+log_must eval "zfs send -R $POOL/$FS@final > $BACKDIR/fs-final-R"
+log_must eval "zfs receive -d $POOL2 < $BACKDIR/fs-final-R"
 block_device_wait
-log_must eval "$ZPOOL export $POOL"
-log_must eval "$ZPOOL import $POOL"
+log_must eval "zpool export $POOL"
+log_must eval "zpool import $POOL"
 
 dstds=$(get_dst_ds $POOL/$FS $POOL2)
 log_must cmp_ds_subs $POOL/$FS $dstds
index 9672f7fac5f0119d234a543cbed8217839b6eda1..e9f6df3d3be8d24bcd39cc6758d71d13a1aa127a 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2014 by Delphix. All rights reserved.
+# Copyright (c) 2014, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -43,8 +43,8 @@ recvfs=$POOL2/recvfs
 streamfs=$POOL/stream
 
 test_fs_setup $POOL $POOL2
-resume_test "$ZFS send -v $sendfs@a" $streamfs $recvfs
-resume_test "$ZFS send -v -i @a $sendfs@b" $streamfs $recvfs
+resume_test "zfs send -v $sendfs@a" $streamfs $recvfs
+resume_test "zfs send -v -i @a $sendfs@b" $streamfs $recvfs
 file_check $sendfs $recvfs
 
 log_pass "Verify resumability of a full and incremental ZFS send/receive " \
index 03736c3efde43dd3e504919b46a007a65e3004ff..46050720cf5c99e6a33cb5d2b86c384134bd69ae 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2014 by Delphix. All rights reserved.
+# Copyright (c) 2014, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -42,7 +42,7 @@ recvfs=$POOL2/recvfs
 streamfs=$POOL/stream
 
 test_fs_setup $POOL $POOL2
-resume_test "$ZFS send -D -v $sendfs@a" $streamfs $recvfs
+resume_test "zfs send -D -v $sendfs@a" $streamfs $recvfs
 file_check $sendfs $recvfs
 
 log_pass "Verify resumability of full ZFS send/receive with the -D " \
index e22ba1dd90d2b9d12128fbbb83b22f27471008e8..8f3a47a5fe7db1fbeb97c6bb3e858f40080722c9 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2014 by Delphix. All rights reserved.
+# Copyright (c) 2014, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -44,8 +44,8 @@ recvfs=$POOL2/recvfs
 streamfs=$POOL/stream
 
 test_fs_setup $POOL $POOL2
-resume_test "$ZFS send -v -e $sendfs@a" $streamfs $recvfs
-resume_test "$ZFS send -v -e -i @a $sendfs@b" $streamfs $recvfs
+resume_test "zfs send -v -e $sendfs@a" $streamfs $recvfs
+resume_test "zfs send -v -e -i @a $sendfs@b" $streamfs $recvfs
 file_check $sendfs $recvfs
 
 log_pass "Verify resumability of a full and incremental ZFS send/receive " \
index 810f60d5f08ee3781bce565291ef6249c95474cb..7670b8eb4abe5f77af0fb49d3429b943680deee6 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2014 by Delphix. All rights reserved.
+# Copyright (c) 2014, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,13 +52,13 @@ recvfs=$POOL2/recvfs
 streamfs=$POOL/stream
 
 test_fs_setup $POOL $POOL2
-log_must $ZFS bookmark $sendfs@a $sendfs#bm_a
-log_must $ZFS destroy $sendfs@a
-log_must $ZFS receive -v $recvfs </$POOL/initial.zsend
-resume_test "$ZFS send -i \#bm_a $sendfs@b" $streamfs $recvfs
-log_must $ZFS destroy -r -f $sendfs
-log_must $ZFS receive -v $sendfs </$POOL/initial.zsend
-log_must $ZFS receive -v $sendfs </$POOL/incremental.zsend
+log_must zfs bookmark $sendfs@a $sendfs#bm_a
+log_must zfs destroy $sendfs@a
+log_must zfs receive -v $recvfs </$POOL/initial.zsend
+resume_test "zfs send -i \#bm_a $sendfs@b" $streamfs $recvfs
+log_must zfs destroy -r -f $sendfs
+log_must zfs receive -v $sendfs </$POOL/initial.zsend
+log_must zfs receive -v $sendfs </$POOL/incremental.zsend
 file_check $sendfs $recvfs
 
 log_pass "Verify resumability of an incremental ZFS send/receive with ZFS " \
index 43f6a48019333811a030b8bfbf81c991331c32d9..0b0a1e0d070385f3d77ad261dd27691fc056af53 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2014 by Delphix. All rights reserved.
+# Copyright (c) 2014, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -49,8 +49,8 @@ recvfs=$POOL2/recvfs
 streamfs=$POOL/stream
 
 test_fs_setup $POOL $POOL2
-log_must $ZFS unmount $sendfs
-resume_test "$ZFS send $sendfs" $streamfs $recvfs
+log_must zfs unmount $sendfs
+resume_test "zfs send $sendfs" $streamfs $recvfs
 file_check $sendfs $recvfs
 
 log_pass "Verify resumability of a full ZFS send/receive with the source " \
index 8423adf8a035175fa2076c37a4df2ac5eb41cb5d..f0417e85ae351264f742cdc9a5d4987b5b5fbec4 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2014 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/rsend/rsend.kshlib
@@ -35,10 +35,10 @@ verify_runnable "both"
 verify_disk_count "$DISKS" 2
 
 if is_global_zone ; then
-       log_must $ZPOOL create $POOL $DISK1
-       log_must $ZPOOL create $POOL2 $DISK2
+       log_must zpool create $POOL $DISK1
+       log_must zpool create $POOL2 $DISK2
 fi
-log_must $MKDIR $BACKDIR $TESTDIR
+log_must mkdir $BACKDIR $TESTDIR
 
 log_must setup_test_model $POOL
 
index d0d77b79c2a6276e4e7a87145cc6a265ec1b910f..562de7de10dd74e18b6113f32fa61572c6436e67 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -35,8 +35,8 @@
 
 verify_runnable "global"
 
-$DF -F zfs -h | $GREP "$TESTFS " >/dev/null
-[[ $? == 0 ]] && log_must $ZFS umount -f $TESTDIR
+df -F zfs -h | grep "$TESTFS " >/dev/null
+[[ $? == 0 ]] && log_must zfs umount -f $TESTDIR
 destroy_pool $TESTPOOL
 
 DISK=${DISKS%% *}
index ee05daec4ba9ff2f440445fae27152a0b77dd057..15de7629634ecd154dda1b13e96ebde27fd8b3f5 100644 (file)
@@ -29,7 +29,7 @@
 #
 
 export DISKSARRAY=$DISKS
-export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
+export DISK_ARRAY_NUM=$(echo ${DISKS} | nawk '{print NF}')
 
 typeset -i NUMBER_OF_DISKS=0
 for i in $DISKS; do
@@ -49,7 +49,7 @@ if [[ -z $MIRROR_SECONDARY ]]; then
                else
                        export DEV_DSKDIR=$DEV_RDSKDIR
                fi
-               if ( is_mpath_device $SINGLE_DISK ) && [[ -z $($ECHO $SINGLE_DISK | awk 'substr($1,18,1)\
+               if ( is_mpath_device $SINGLE_DISK ) && [[ -z $(echo $SINGLE_DISK | awk 'substr($1,18,1)\
                    ~ /^[[:digit:]]+$/') ]] || ( is_real_device $SINGLE_DISK ); then
                        SIDE_PRIMARY=${SINGLE_DISK}1
                        SIDE_SECONDARY=${SINGLE_DISK}2
@@ -73,7 +73,7 @@ else
                else
                        export DEV_DSKDIR=$DEV_RDSKDIR
                fi
-               if ( is_mpath_device $MIRROR_PRIMARY ) && [[ -z $($ECHO $MIRROR_PRIMARY | awk 'substr($1,18,1)\
+               if ( is_mpath_device $MIRROR_PRIMARY ) && [[ -z $(echo $MIRROR_PRIMARY | awk 'substr($1,18,1)\
                    ~ /^[[:digit:]]+$/') ]] || ( is_real_device $MIRROR_PRIMARY ); then
                        SIDE_PRIMARY=${MIRROR_PRIMARY}1
                elif ( is_mpath_device $MIRROR_PRIMARY || is_loop_device $MIRROR_PRIMARY ); then
@@ -81,7 +81,7 @@ else
                else
                        log_fail "$MIRROR_PRIMARY not supported for partitioning."
                fi
-               if ( is_mpath_device $MIRROR_SECONDARY ) && [[ -z $($ECHO $MIRROR_SECONDARY | awk 'substr($1,18,1)\
+               if ( is_mpath_device $MIRROR_SECONDARY ) && [[ -z $(echo $MIRROR_SECONDARY | awk 'substr($1,18,1)\
                    ~ /^[[:digit:]]+$/') ]] || ( is_real_device $MIRROR_SECONDARY ); then
                        SIDE_SECONDARY=${MIRROR_SECONDARY}1
                elif ( is_mpath_device $MIRROR_SECONDARY || is_loop_device $MIRROR_SECONDARY ); then
index 08450dc85f3923154c7e77711504abf366ce1d5c..75c9c5840dd19af495540c07f6aa9ccb4c500ec8 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 . $STF_SUITE/tests/functional/scrub_mirror/default.cfg
 
@@ -42,20 +42,20 @@ function overwrite_verify_mirror
 
        while (( atfile < FILE_COUNT )); do
                files[$atfile]=$TESTDIR/file.$atfile
-               log_must $FILE_WRITE -o create -f $TESTDIR/file.$atfile \
+               log_must file_write -o create -f $TESTDIR/file.$atfile \
                        -b $FILE_SIZE -c 1
-               cksums[$atfile]=$($CKSUM ${files[$atfile]})
+               cksums[$atfile]=$(cksum ${files[$atfile]})
                (( atfile = atfile + 1 ))
        done
 
        # dd the affected side of the mirror
-       log_must $DD if=$OVERWRITING_DEVICE of=${DEV_DSKDIR}/$AFFECTED_DEVICE \
+       log_must dd if=$OVERWRITING_DEVICE of=${DEV_DSKDIR}/$AFFECTED_DEVICE \
                seek=8 bs=$DD_BLOCK count=$(( DD_COUNT - 128 )) conv=notrunc
 
-       log_must $ZPOOL scrub $POOL
+       log_must zpool scrub $POOL
 
        while is_pool_scrubbing $POOL; do
-               $SLEEP 2
+               sleep 2
        done
 
        atfile=0
@@ -63,11 +63,11 @@ function overwrite_verify_mirror
        typeset -i failedcount=0
        while (( atfile < FILE_COUNT )); do
                files[$atfile]=$TESTDIR/file.$atfile
-               newcksum=$($CKSUM ${files[$atfile]})
+               newcksum=$(cksum ${files[$atfile]})
                if [[ $newcksum != ${cksums[$atfile]} ]]; then
                        (( failedcount = failedcount + 1 ))
                fi
-               $RM -f ${files[$atfile]}
+               rm -f ${files[$atfile]}
                (( atfile = atfile + 1 ))
        done
 
index 039135ccde4dcc7c8d73e5d262956bcbeb4a2406..ac301f386f76e45a2869612cdded2bf8f7060f2b 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -39,16 +39,16 @@ if ! verify_slog_support ; then
 fi
 
 if datasetexists $TESTPOOL ; then
-       log_must $ZPOOL destroy -f $TESTPOOL
+       log_must zpool destroy -f $TESTPOOL
 fi
 if datasetexists $TESTPOOL2 ; then
-       log_must $ZPOOL destroy -f $TESTPOOL2
+       log_must zpool destroy -f $TESTPOOL2
 fi
 if [[ -d $VDIR ]]; then
-       log_must $RM -rf $VDIR
+       log_must rm -rf $VDIR
 fi
 if [[ -d $VDIR2 ]]; then
-       log_must $RM -rf $VDIR2
+       log_must rm -rf $VDIR2
 fi
 
 log_pass
index bf205e48e1a3242f2e5e1635a4cbfc88007b94ba..022ad1fd6e5647b37ca3cd72049e741a6b4d5d80 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -39,12 +39,12 @@ if ! verify_slog_support ; then
 fi
 
 if [[ -d $VDEV ]]; then
-       log_must $RM -rf $VDIR
+       log_must rm -rf $VDIR
 fi
 if [[ -d $VDEV2 ]]; then
-       log_must $RM -rf $VDIR2
+       log_must rm -rf $VDIR2
 fi
-log_must $MKDIR -p $VDIR $VDIR2
-log_must $MKFILE $MINVDEVSIZE $VDEV $SDEV $LDEV $VDEV2 $SDEV2 $LDEV2
+log_must mkdir -p $VDIR $VDIR2
+log_must mkfile $MINVDEVSIZE $VDEV $SDEV $LDEV $VDEV2 $SDEV2 $LDEV2
 
 log_pass
index e7d65c14807573377180779e83ea52631d273031..ca1b5ed2171044e655cfd6e55a9c9a14cf9aa99a 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 function cleanup
 {
        if datasetexists $TESTPOOL ; then
-               log_must $ZPOOL destroy -f $TESTPOOL
+               log_must zpool destroy -f $TESTPOOL
        fi
        if datasetexists $TESTPOOL2 ; then
-               log_must $ZPOOL destroy -f $TESTPOOL2
+               log_must zpool destroy -f $TESTPOOL2
        fi
        rm -rf $TESTDIR
 }
@@ -52,17 +52,17 @@ function display_status
        typeset pool=$1
 
        typeset -i ret=0
-       $ZPOOL status -xv $pool > /dev/null 2>&1
+       zpool status -xv $pool > /dev/null 2>&1
        ret=$?
 
-       $ZPOOL iostat > /dev/null 2>&1
+       zpool iostat > /dev/null 2>&1
        ((ret |= $?))
 
        typeset mntpnt=$(get_prop mountpoint $pool)
-       $DD if=/dev/random of=$mntpnt/testfile.$$ &
+       dd if=/dev/random of=$mntpnt/testfile.$$ &
        typeset pid=$!
 
-       $ZPOOL iostat -v 1 3 > /dev/null
+       zpool iostat -v 1 3 > /dev/null
        ((ret |= $?))
 
        kill -9 $pid
@@ -95,7 +95,7 @@ function verify_slog_device
        #
        # mirror:/disks/d ONLINE mirror:/disks/e ONLINE stripe:/disks/f ONLINE
        #
-       set -A dev_stat_tab $($ZPOOL status -v $pool | $NAWK 'BEGIN {start=0} \
+       set -A dev_stat_tab $(zpool status -v $pool | nawk 'BEGIN {start=0} \
                                /\tlogs/ {start=1}
                                /\tmirror/ || /\tspares/ || /^$/ {start=0}
                                (start==1) && /\t  (\/|[a-zA-Z])/ \
index c6adaa4c309f0e81c1e1f2523ca6bc462d403667..3d3daf5f9ccc9c5a5a1888102972e890d5c5aa8c 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/slog/slog.kshlib
@@ -52,7 +52,7 @@ do
        do
                for logtype in "" "mirror"
                do
-                       log_must $ZPOOL create $TESTPOOL $type $VDEV \
+                       log_must zpool create $TESTPOOL $type $VDEV \
                                $spare $SDEV log $logtype $LDEV
                        log_must display_status $TESTPOOL
 
@@ -60,7 +60,7 @@ do
                        log_must verify_slog_device \
                                $TESTPOOL $ldev 'ONLINE' $logtype
 
-                       log_must $ZPOOL destroy -f $TESTPOOL
+                       log_must zpool destroy -f $TESTPOOL
                done
        done
 done
index 9062772c1dd08aab95b09cf39cd556e6d950e691..b056f19cdb80c5c0175c0922ca500bab4ac116f4 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/slog/slog.kshlib
@@ -53,13 +53,13 @@ do
        do
                for logtype in "" "mirror"
                do
-                       log_must $ZPOOL create $TESTPOOL $type $VDEV $spare $SDEV
-                       log_must $ZPOOL add $TESTPOOL log $logtype $LDEV
+                       log_must zpool create $TESTPOOL $type $VDEV $spare $SDEV
+                       log_must zpool add $TESTPOOL log $logtype $LDEV
                        log_must display_status $TESTPOOL
                        typeset ldev=$(random_get $LDEV)
                        log_must verify_slog_device \
                                $TESTPOOL $ldev 'ONLINE' $logtype
-                       log_must $ZPOOL destroy -f $TESTPOOL
+                       log_must zpool destroy -f $TESTPOOL
                done
        done
 done
index 5a28066da149364f8e9586d638dfecae73011807..c647b8f54b7592b217800d65fb6cacdaada9f096 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/slog/slog.kshlib
@@ -55,9 +55,9 @@ do
                do
                        for newtype in "" "mirror"
                        do
-                               log_must $ZPOOL create $TESTPOOL $type $VDEV \
+                               log_must zpool create $TESTPOOL $type $VDEV \
                                        $spare $SDEV log $logtype $LDEV
-                               log_must $ZPOOL add $TESTPOOL \
+                               log_must zpool add $TESTPOOL \
                                        log $newtype $LDEV2
 
                                log_must display_status $TESTPOOL
@@ -65,7 +65,7 @@ do
                                log_must verify_slog_device \
                                        $TESTPOOL $ldev 'ONLINE' $newtype
 
-                               log_must $ZPOOL destroy -f $TESTPOOL
+                               log_must zpool destroy -f $TESTPOOL
                        done
                done
        done
index 83806d03bb185b6eb009e419e2634126a3cd5e0c..4b0b3439a2e3b76ff41d1575fb5699decad0a2a9 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/slog/slog.kshlib
@@ -53,19 +53,19 @@ do
        do
                for logtype in "" "mirror"
                do
-                       log_must $ZPOOL create $TESTPOOL $type $VDEV \
+                       log_must zpool create $TESTPOOL $type $VDEV \
                                $spare $SDEV log $logtype $LDEV
 
                        ldev=$(random_get $LDEV)
                        typeset ldev2=$(random_get $LDEV2)
-                       log_must $ZPOOL attach $TESTPOOL $ldev $ldev2
+                       log_must zpool attach $TESTPOOL $ldev $ldev2
                        log_must display_status $TESTPOOL
                        log_must verify_slog_device \
                                $TESTPOOL $ldev 'ONLINE' 'mirror'
                        log_must verify_slog_device \
                                $TESTPOOL $ldev2 'ONLINE' 'mirror'
 
-                       log_must $ZPOOL destroy -f $TESTPOOL
+                       log_must zpool destroy -f $TESTPOOL
                done
        done
 done
index f40fc5aace076b8c5fec835948216a05d0041807..cbbb9486913a0d3dbf3989b24067f337917216a6 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/slog/slog.kshlib
@@ -51,14 +51,14 @@ for type in "" "mirror" "raidz" "raidz2"
 do
        for spare in "" "spare"
        do
-               log_must $ZPOOL create $TESTPOOL $type $VDEV $spare $SDEV \
+               log_must zpool create $TESTPOOL $type $VDEV $spare $SDEV \
                        log mirror $LDEV mirror $LDEV2
                ldev=$(random_get $LDEV $LDEV2)
-               log_must $ZPOOL detach $TESTPOOL $ldev
+               log_must zpool detach $TESTPOOL $ldev
                log_must display_status $TESTPOOL
                log_mustnot verify_slog_device $TESTPOOL $ldev 'ONLINE' 'mirror'
 
-               log_must $ZPOOL destroy -f $TESTPOOL
+               log_must zpool destroy -f $TESTPOOL
        done
 done
 
index b93f64ab7ea0524f75f00538e206018511a31a91..53e8c67ca005323abae50c1d4711eb7e6e49c1f4 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/slog/slog.kshlib
@@ -53,18 +53,18 @@ do
        do
                for logtype in "" "mirror"
                do
-                       log_must $ZPOOL create $TESTPOOL $type $VDEV \
+                       log_must zpool create $TESTPOOL $type $VDEV \
                                $spare $SDEV log $logtype $LDEV
                        sdev=$(random_get $LDEV)
                        tdev=$(random_get $LDEV2)
-                       log_must $ZPOOL replace $TESTPOOL $sdev $tdev
+                       log_must zpool replace $TESTPOOL $sdev $tdev
                        log_must display_status $TESTPOOL
                        # sleep 15 to make sure replacement completely.
-                       log_must $SLEEP 15
+                       log_must sleep 15
                        log_must verify_slog_device \
                                $TESTPOOL $tdev 'ONLINE' $logtype
 
-                       log_must $ZPOOL destroy -f $TESTPOOL
+                       log_must zpool destroy -f $TESTPOOL
                done
        done
 done
index c6433014027ecaf8e943729944b0428dc707e066..4926fb7b31920d3093fd8b7a310bb79df78f060a 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/slog/slog.kshlib
@@ -59,7 +59,7 @@ do
                        # Create pool which devices resider in different
                        # directory
                        #
-                       log_must $ZPOOL create $TESTPOOL $type $VDEV \
+                       log_must zpool create $TESTPOOL $type $VDEV \
                                $spare $SDEV log $logtype $LDEV $LDEV2
                        ldev=$(random_get $LDEV $LDEV2)
                        log_must verify_slog_device \
@@ -68,8 +68,8 @@ do
                        #
                        # Nomal export/import operating
                        #
-                       log_must $ZPOOL export $TESTPOOL
-                       log_must $ZPOOL import -d $VDIR -d $VDIR2 $TESTPOOL
+                       log_must zpool export $TESTPOOL
+                       log_must zpool import -d $VDIR -d $VDIR2 $TESTPOOL
                        log_must display_status $TESTPOOL
                        ldev=$(random_get $LDEV $LDEV2)
                        log_must verify_slog_device \
@@ -78,14 +78,14 @@ do
                        #
                        # Destroy the pool and import again
                        #
-                       log_must $ZPOOL destroy $TESTPOOL
-                       log_must $ZPOOL import -Df -d $VDIR -d $VDIR2 $TESTPOOL
+                       log_must zpool destroy $TESTPOOL
+                       log_must zpool import -Df -d $VDIR -d $VDIR2 $TESTPOOL
                        log_must display_status $TESTPOOL
                        ldev=$(random_get $LDEV $LDEV2)
                        log_must verify_slog_device \
                                $TESTPOOL $ldev 'ONLINE' $logtype
 
-                       log_must $ZPOOL destroy -f $TESTPOOL
+                       log_must zpool destroy -f $TESTPOOL
                done
        done
 done
index b9243567a5366bb86bc94385d35045b2efd8a766..587e0e321222b37e93f475c27ae723df5e19daf2 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/slog/slog.kshlib
@@ -51,7 +51,7 @@ do
        do
                for logtype in "raidz" "raidz1" "raidz2"
                do
-                       log_mustnot $ZPOOL create $TESTPOOL $type $VDEV \
+                       log_mustnot zpool create $TESTPOOL $type $VDEV \
                                $spare $SDEV log $logtype $LDEV $LDEV2
                        ldev=$(random_get $LDEV $LDEV2)
                        log_mustnot verify_slog_device \
index 9b195bd64c7df7a7065efbc71a3fa5bb7f4896b9..e7091f17b759b73ff1b52e9e78b9e0ad374a596d 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/slog/slog.kshlib
@@ -53,15 +53,15 @@ do
                for logtype in "raidz" "raidz1" "raidz2"
                do
                        log=$(random_get_with_non "log")
-                       log_must $ZPOOL create $TESTPOOL $type $VDEV \
+                       log_must zpool create $TESTPOOL $type $VDEV \
                                $spare $SDEV $log $LDEV
 
-                       log_mustnot $ZPOOL add $TESTPOOL log $logtype $LDEV2
+                       log_mustnot zpool add $TESTPOOL log $logtype $LDEV2
                        ldev=$(random_get $LDEV2)
                        log_mustnot verify_slog_device \
                                $TESTPOOL $ldev 'ONLINE' $logtype
 
-                       log_must $ZPOOL destroy $TESTPOOL
+                       log_must zpool destroy $TESTPOOL
                done
        done
 done
index a5e79f073172dba666f385541e009d93dae39909..8fe248ffbcbad4db59429a7371debca7f285b133 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/slog/slog.kshlib
@@ -47,17 +47,17 @@ verify_runnable "global"
 log_assert "Slog device can not be replaced with spare device."
 log_onexit cleanup
 
-log_must $ZPOOL create $TESTPOOL $VDEV spare $SDEV log $LDEV
+log_must zpool create $TESTPOOL $VDEV spare $SDEV log $LDEV
 sdev=$(random_get $SDEV)
 ldev=$(random_get $LDEV)
-log_mustnot $ZPOOL replace $TESTPOOL $ldev $sdev
+log_mustnot zpool replace $TESTPOOL $ldev $sdev
 log_mustnot verify_slog_device $TESTPOOL $sdev 'ONLINE'
 log_must verify_slog_device $TESTPOOL $ldev 'ONLINE'
 
-log_must $ZPOOL create $TESTPOOL2 $VDEV2 spare $SDEV2
+log_must zpool create $TESTPOOL2 $VDEV2 spare $SDEV2
 sdev2=$(random_get $SDEV2)
-log_mustnot $ZPOOL replace $TESTPOOL $ldev $sdev2
-log_mustnot $ZPOOL replace -f $TESTPOOL $ldev $sdev2
+log_mustnot zpool replace $TESTPOOL $ldev $sdev2
+log_mustnot zpool replace -f $TESTPOOL $ldev $sdev2
 log_mustnot verify_slog_device $TESTPOOL $sdev2 'ONLINE'
 log_must verify_slog_device $TESTPOOL $ldev 'ONLINE'
 
index d2fd33433717daa045de6b12e42f9d1d99af3449..2dad200b31c1f578d1a735b548e38bb992c1b5c0 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/slog/slog.kshlib
@@ -51,19 +51,19 @@ for type in "" "mirror" "raidz" "raidz2"
 do
        for spare in "" "spare"
        do
-               log_must $ZPOOL create $TESTPOOL $type $VDEV $spare $SDEV \
+               log_must zpool create $TESTPOOL $type $VDEV $spare $SDEV \
                        log mirror $LDEV mirror $LDEV2
 
                ldev=$(random_get $LDEV $LDEV2)
-               log_must $ZPOOL offline $TESTPOOL $ldev
+               log_must zpool offline $TESTPOOL $ldev
                log_must display_status $TESTPOOL
                log_must verify_slog_device $TESTPOOL $ldev 'OFFLINE' 'mirror'
 
-               log_must $ZPOOL online $TESTPOOL $ldev
+               log_must zpool online $TESTPOOL $ldev
                log_must display_status $TESTPOOL
                log_must verify_slog_device $TESTPOOL $ldev 'ONLINE' 'mirror'
 
-               log_must $ZPOOL destroy -f $TESTPOOL
+               log_must zpool destroy -f $TESTPOOL
        done
 done
 
index cfe8329211c563908055a999fa7370c679c0ca41..45566d427f1dd5149c625eed7e2331c80cfc2dc6 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/slog/slog.kshlib
@@ -50,23 +50,23 @@ for type in "" "mirror" "raidz" "raidz2"
 do
        for spare in "" "spare"
        do
-               log_must $ZPOOL create $TESTPOOL $type $VDEV $spare $SDEV \
+               log_must zpool create $TESTPOOL $type $VDEV $spare $SDEV \
                        log mirror $LDEV
 
                mntpnt=$(get_prop mountpoint $TESTPOOL)
                #
                # Create file in pool to trigger writing in slog devices
                #
-               log_must $DD if=/dev/urandom of=$mntpnt/testfile.$$ count=100
+               log_must dd if=/dev/urandom of=$mntpnt/testfile.$$ count=100
 
                ldev=$(random_get $LDEV)
-               log_must $MKFILE $MINVDEVSIZE $ldev
-               log_must $ZPOOL scrub $TESTPOOL
+               log_must mkfile $MINVDEVSIZE $ldev
+               log_must zpool scrub $TESTPOOL
 
                log_must display_status $TESTPOOL
                log_must verify_slog_device $TESTPOOL $ldev 'UNAVAIL' 'mirror'
 
-               log_must $ZPOOL destroy -f $TESTPOOL
+               log_must zpool destroy -f $TESTPOOL
        done
 done
 
index c2d14894440f7f0f2c359c7b84137925626b928e..0ccea49921548a1f7154c2c8b46c13eb1a00a106 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/slog/slog.kshlib
@@ -48,10 +48,10 @@ function cleanup_testenv
 {
        cleanup
        if datasetexists $TESTPOOL2 ; then
-               log_must $ZPOOL destroy -f $TESTPOOL2
+               log_must zpool destroy -f $TESTPOOL2
        fi
        if [[ -n $lofidev ]]; then
-               $LOFIADM -d $lofidev
+               lofiadm -d $lofidev
        fi
 }
 
@@ -61,21 +61,21 @@ verify_disk_count "$DISKS" 2
 log_onexit cleanup_testenv
 
 dsk1=${DISKS%% *}
-log_must $ZPOOL create $TESTPOOL ${DISKS#$dsk1}
+log_must zpool create $TESTPOOL ${DISKS#$dsk1}
 
 # Add nomal disk
-log_must $ZPOOL add $TESTPOOL log $dsk1
+log_must zpool add $TESTPOOL log $dsk1
 log_must verify_slog_device $TESTPOOL $dsk1 'ONLINE'
 # Add nomal file
-log_must $ZPOOL add $TESTPOOL log $LDEV
+log_must zpool add $TESTPOOL log $LDEV
 ldev=$(random_get $LDEV)
 log_must verify_slog_device $TESTPOOL $ldev 'ONLINE'
 
 # Add lofi device
 lofidev=${LDEV2%% *}
-log_must $LOFIADM -a $lofidev
-lofidev=$($LOFIADM $lofidev)
-log_must $ZPOOL add $TESTPOOL log $lofidev
+log_must lofiadm -a $lofidev
+lofidev=$(lofiadm $lofidev)
+log_must zpool add $TESTPOOL log $lofidev
 log_must verify_slog_device $TESTPOOL $lofidev 'ONLINE'
 
 log_pass "Verify slog device can be disk, file, lofi device or any device " \
@@ -83,10 +83,10 @@ log_pass "Verify slog device can be disk, file, lofi device or any device " \
 
 # Add file which reside in the itself
 mntpnt=$(get_prop mountpoint $TESTPOOL)
-log_must $MKFILE $MINVDEVSIZE $mntpnt/vdev
-log_must $ZPOOL add $TESTPOOL $mntpnt/vdev
+log_must mkfile $MINVDEVSIZE $mntpnt/vdev
+log_must zpool add $TESTPOOL $mntpnt/vdev
 
 # Add ZFS volume
 vol=$TESTPOOL/vol
-log_must $ZPOOL create -V $MINVDEVSIZE $vol
-log_must $ZPOOL add $TESTPOOL ${ZVOL_DEVDIR}/$vol
\ No newline at end of file
+log_must zpool create -V $MINVDEVSIZE $vol
+log_must zpool add $TESTPOOL ${ZVOL_DEVDIR}/$vol
\ No newline at end of file
index 5f69b199f9b7c7c26b026f1fbcd85fb081fe7244..2d5407849ade51c2c06d6ba08bcf5f31c88a7afa 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/slog/slog.kshlib
@@ -49,36 +49,36 @@ for type in "mirror" "raidz" "raidz2"
 do
        for spare in "" "spare"
        do
-               log_must $ZPOOL create $TESTPOOL $type $VDEV $spare $SDEV \
+               log_must zpool create $TESTPOOL $type $VDEV $spare $SDEV \
                        log $LDEV
 
                # Corrupt a pool device to make the pool DEGRADED
-               $DD if=/dev/urandom of=/$TESTPOOL/filler bs=1024k count=50
+               dd if=/dev/urandom of=/$TESTPOOL/filler bs=1024k count=50
                # The oseek value below is to skip past the vdev label.
                if is_linux; then
-                       log_must $DD if=/dev/urandom of=$VDIR/a bs=1024k \
+                       log_must dd if=/dev/urandom of=$VDIR/a bs=1024k \
                           seek=4 conv=notrunc count=50
                else
-                       log_must $DD if=/dev/urandom of=$VDIR/a bs=1024k \
+                       log_must dd if=/dev/urandom of=$VDIR/a bs=1024k \
                           oseek=4 conv=notrunc count=50
                fi
-               log_must $ZPOOL scrub $TESTPOOL
+               log_must zpool scrub $TESTPOOL
                log_must display_status $TESTPOOL
-               log_must $ZPOOL status $TESTPOOL 2>&1 >/dev/null
+               log_must zpool status $TESTPOOL 2>&1 >/dev/null
 
-               $ZPOOL status -v $TESTPOOL | \
-                       $GREP "state: DEGRADED" 2>&1 >/dev/null
+               zpool status -v $TESTPOOL | \
+                       grep "state: DEGRADED" 2>&1 >/dev/null
                if (( $? != 0 )); then
                        log_fail "pool $TESTPOOL status should be DEGRADED"
                fi
 
-               $ZPOOL status -v $TESTPOOL | $GREP logs | \
-                       $GREP "DEGRADED" 2>&1 >/dev/null
+               zpool status -v $TESTPOOL | grep logs | \
+                       grep "DEGRADED" 2>&1 >/dev/null
                if (( $? == 0 )); then
                        log_fail "log device should display correct status"
                fi
 
-               log_must $ZPOOL destroy -f $TESTPOOL
+               log_must zpool destroy -f $TESTPOOL
        done
 done
 
index 71833e7c1d582291318d1702eb285b67f75b5fb8..6727b5f056194a549d4ed3626cd8e69a129c4ed1 100755 (executable)
@@ -64,23 +64,23 @@ log_onexit cleanup
 #
 # 1. Create an empty file system (TESTFS)
 #
-log_must $ZPOOL create $TESTPOOL $VDEV log mirror $LDEV
-log_must $ZFS set compression=on $TESTPOOL
-log_must $ZFS create $TESTPOOL/$TESTFS
-log_must $MKDIR -p $TESTDIR
+log_must zpool create $TESTPOOL $VDEV log mirror $LDEV
+log_must zfs set compression=on $TESTPOOL
+log_must zfs create $TESTPOOL/$TESTFS
+log_must mkdir -p $TESTDIR
 
 #
 # This dd command works around an issue where ZIL records aren't created
 # after freezing the pool unless a ZIL header already exists. Create a file
 # synchronously to force ZFS to write one out.
 #
-log_must $GNUDD if=/dev/zero of=/$TESTPOOL/$TESTFS/sync \
+log_must dd if=/dev/zero of=/$TESTPOOL/$TESTFS/sync \
     conv=fdatasync,fsync bs=1 count=1
 
 #
 # 2. Freeze TESTFS
 #
-log_must $ZPOOL freeze $TESTPOOL
+log_must zpool freeze $TESTPOOL
 
 #
 # 3. Run various user commands that create files, directories and ACLs
@@ -107,12 +107,12 @@ log_must mkdir /$TESTPOOL/$TESTFS/dir_to_delete
 log_must rmdir /$TESTPOOL/$TESTFS/dir_to_delete
 
 # Create a simple validation payload
-log_must $DD if=/dev/urandom of=/$TESTPOOL/$TESTFS/payload bs=1k count=8
+log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/payload bs=1k count=8
 CHECKSUM_BEFORE=$(sha256sum -b /$TESTPOOL/$TESTFS/payload)
 
 # TX_WRITE (small file with ordering)
-log_must $MKFILE 1k /$TESTPOOL/$TESTFS/small_file
-log_must $MKFILE 512b /$TESTPOOL/$TESTFS/small_file
+log_must mkfile 1k /$TESTPOOL/$TESTFS/small_file
+log_must mkfile 512b /$TESTPOOL/$TESTFS/small_file
 
 # TX_CREATE, TX_MKDIR, TX_REMOVE, TX_RMDIR
 log_must cp -R /usr/share/dict /$TESTPOOL/$TESTFS
@@ -125,26 +125,26 @@ log_must chgrp root /$TESTPOOL/$TESTFS/setattr
 log_must touch -cm -t 201311271200 /$TESTPOOL/$TESTFS/setattr
 
 # TX_TRUNCATE (to zero)
-log_must $MKFILE 4k /$TESTPOOL/$TESTFS/truncated_file
-log_must $TRUNCATE -s 0 /$TESTPOOL/$TESTFS/truncated_file
+log_must mkfile 4k /$TESTPOOL/$TESTFS/truncated_file
+log_must truncate -s 0 /$TESTPOOL/$TESTFS/truncated_file
 
 # TX_WRITE (large file)
-log_must $DD if=/dev/urandom of=/$TESTPOOL/$TESTFS/large \
+log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/large \
     bs=128k count=64 oflag=sync
 
 # Write zeroes, which compresss to holes, in the middle of a file
-log_must $DD if=/dev/urandom of=/$TESTPOOL/$TESTFS/holes.1 bs=128k count=8
-log_must $DD if=/dev/zero of=/$TESTPOOL/$TESTFS/holes.1 bs=128k count=2
+log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/holes.1 bs=128k count=8
+log_must dd if=/dev/zero of=/$TESTPOOL/$TESTFS/holes.1 bs=128k count=2
 
-log_must $DD if=/dev/urandom of=/$TESTPOOL/$TESTFS/holes.2 bs=128k count=8
-log_must $DD if=/dev/zero of=/$TESTPOOL/$TESTFS/holes.2 bs=128k count=2 seek=2
+log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/holes.2 bs=128k count=8
+log_must dd if=/dev/zero of=/$TESTPOOL/$TESTFS/holes.2 bs=128k count=2 seek=2
 
-log_must $DD if=/dev/urandom of=/$TESTPOOL/$TESTFS/holes.3 bs=128k count=8
-log_must $DD if=/dev/zero of=/$TESTPOOL/$TESTFS/holes.3 bs=128k count=2 \
+log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/holes.3 bs=128k count=8
+log_must dd if=/dev/zero of=/$TESTPOOL/$TESTFS/holes.3 bs=128k count=2 \
    seek=2 conv=notrunc
 
 # TX_MKXATTR
-log_must $MKDIR /$TESTPOOL/$TESTFS/xattr.dir
+log_must mkdir /$TESTPOOL/$TESTFS/xattr.dir
 log_must attr -qs fileattr -V HelloWorld /$TESTPOOL/$TESTFS/xattr.dir
 log_must attr -qs tmpattr -V HelloWorld /$TESTPOOL/$TESTFS/xattr.dir
 log_must attr -qr tmpattr /$TESTPOOL/$TESTFS/xattr.dir
@@ -165,12 +165,12 @@ log_must cp -a /$TESTPOOL/$TESTFS/* $TESTDIR
 # At this stage TESTFS is empty again and unfrozen, and the
 # intent log contains a complete set of deltas to replay it.
 #
-log_must $ZFS unmount /$TESTPOOL/$TESTFS
+log_must zfs unmount /$TESTPOOL/$TESTFS
 
 log_note "Verify transactions to replay:"
-log_must $ZDB -iv $TESTPOOL/$TESTFS
+log_must zdb -iv $TESTPOOL/$TESTFS
 
-log_must $ZPOOL export $TESTPOOL
+log_must zpool export $TESTPOOL
 
 #
 # 6. Remount TESTFS <which replays the intent log>
@@ -178,13 +178,13 @@ log_must $ZPOOL export $TESTPOOL
 # Import the pool to unfreeze it and claim log blocks.  It has to be
 # `zpool import -f` because we can't write a frozen pool's labels!
 #
-log_must $ZPOOL import -f -d $VDIR $TESTPOOL
+log_must zpool import -f -d $VDIR $TESTPOOL
 
 #
 # 7. Compare TESTFS against the TESTDIR copy
 #
 log_note "Verify current block usage:"
-log_must $ZDB -bcv $TESTPOOL
+log_must zdb -bcv $TESTPOOL
 
 log_note "Verify copy of xattrs:"
 log_must attr -l /$TESTPOOL/$TESTFS/xattr.dir
index 9833087d6b9b659f461eed6992340fb290042f50..4ba853162cb563620a4e0affef437d10258832ab 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -62,8 +62,8 @@ set -A args "$SNAPFS" "$SNAPDIR" "$TESTPOOL/$TESTCLONE" "$TESTDIR.0" \
 function setup_all
 {
        create_pool $TESTPOOL1 ${ZVOL_DEVDIR}/$TESTPOOL/$TESTVOL
-       log_must $ZFS create $TESTPOOL1/$TESTFS
-       log_must $ZFS set mountpoint=$TESTDIR2 $TESTPOOL1/$TESTFS
+       log_must zfs create $TESTPOOL1/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR2 $TESTPOOL1/$TESTFS
 
        return 0
 }
@@ -75,24 +75,24 @@ function cleanup_all
        i=0
        while (( i < ${#args[*]} )); do
                snapexists ${args[i]} && \
-                       log_must $ZFS destroy -Rf ${args[i]}
+                       log_must zfs destroy -Rf ${args[i]}
 
                [[ -d ${args[i+3]} ]] && \
-                       log_must $RM -rf ${args[i+3]}
+                       log_must rm -rf ${args[i+3]}
 
                [[ -d ${args[i+1]} ]] && \
-                       log_must $RM -rf ${args[i+1]}
+                       log_must rm -rf ${args[i+1]}
 
                (( i = i + 4 ))
        done
 
        datasetexists $TESTPOOL1/$TESTFS  && \
-               log_must $ZFS destroy -f $TESTPOOL1/$TESTFS
+               log_must zfs destroy -f $TESTPOOL1/$TESTFS
 
        destroy_pool $TESTPOOL1
 
        [[ -d $TESTDIR2 ]] && \
-               log_must $RM -rf $TESTDIR2
+               log_must rm -rf $TESTDIR2
 
        return 0
 }
@@ -104,7 +104,7 @@ log_onexit cleanup_all
 setup_all
 
 [[ -n $TESTDIR ]] && \
-    log_must $RM -rf $TESTDIR/* > /dev/null 2>&1
+    log_must rm -rf $TESTDIR/* > /dev/null 2>&1
 
 typeset -i COUNT=10
 typeset -i i=0
@@ -113,7 +113,7 @@ for mtpt in $TESTDIR $TESTDIR2 ; do
        log_note "Populate the $mtpt directory (prior to snapshot)"
        typeset -i j=1
        while [[ $j -le $COUNT ]]; do
-               log_must $FILE_WRITE -o create -f $mtpt/before_file$j \
+               log_must file_write -o create -f $mtpt/before_file$j \
                        -b $BLOCKSZ -c $NUM_WRITES -d $j
 
                (( j = j + 1 ))
@@ -124,33 +124,33 @@ while (( i < ${#args[*]} )); do
        #
        # Take a snapshot of the test file system.
        #
-       log_must $ZFS snapshot ${args[i]}
+       log_must zfs snapshot ${args[i]}
 
        #
        # Clone a new file system from the snapshot
        #
-       log_must $ZFS clone ${args[i]} ${args[i+2]}
+       log_must zfs clone ${args[i]} ${args[i+2]}
        if [[ -n ${args[i+3]} ]] ; then
-               log_must $ZFS set mountpoint=${args[i+3]} ${args[i+2]}
+               log_must zfs set mountpoint=${args[i+3]} ${args[i+2]}
 
-               FILE_COUNT=`$LS -Al ${args[i+3]} | $GREP -v "total" \
-                   | $GREP -v "\.zfs" | wc -l`
+               FILE_COUNT=`ls -Al ${args[i+3]} | grep -v "total" \
+                   | grep -v "\.zfs" | wc -l`
                if [[ $FILE_COUNT -ne $COUNT ]]; then
-                       $LS -Al ${args[i+3]}
+                       ls -Al ${args[i+3]}
                        log_fail "AFTER: ${args[i+3]} contains $FILE_COUNT files(s)."
                fi
 
                log_note "Verify the ${args[i+3]} directory is writable"
                j=1
                while [[ $j -le $COUNT ]]; do
-                       log_must $FILE_WRITE -o create -f ${args[i+3]}/after_file$j \
+                       log_must file_write -o create -f ${args[i+3]}/after_file$j \
                        -b $BLOCKSZ -c $NUM_WRITES -d $j
                        (( j = j + 1 ))
                done
 
-               FILE_COUNT=`$LS -Al ${args[i+3]}/after* | $GREP -v "total" | wc -l`
+               FILE_COUNT=`ls -Al ${args[i+3]}/after* | grep -v "total" | wc -l`
                if [[ $FILE_COUNT -ne $COUNT ]]; then
-                       $LS -Al ${args[i+3]}
+                       ls -Al ${args[i+3]}
                        log_fail "${args[i+3]} contains $FILE_COUNT after* files(s)."
                fi
        fi
index e5df02d45678a684b67375a7ff5f9da7774b85e7..8894c3a6528781c5928b6c05bab8e2ebadea909b 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -53,10 +53,10 @@ function cleanup
 {
        snapexists $SNAPFS
        [[ $? -eq 0 ]] && \
-               log_must $ZFS destroy $SNAPFS
+               log_must zfs destroy $SNAPFS
 
        [[ -e $TESTDIR ]] && \
-               log_must $RM -rf $TESTDIR/* > /dev/null 2>&1
+               log_must rm -rf $TESTDIR/* > /dev/null 2>&1
 }
 
 log_assert "Verify that a rollback to a previous snapshot succeeds."
@@ -64,31 +64,31 @@ log_assert "Verify that a rollback to a previous snapshot succeeds."
 log_onexit cleanup
 
 [[ -n $TESTDIR ]] && \
-    log_must $RM -rf $TESTDIR/* > /dev/null 2>&1
+    log_must rm -rf $TESTDIR/* > /dev/null 2>&1
 
 typeset -i COUNT=10
 
 log_note "Populate the $TESTDIR directory (prior to snapshot)"
 typeset -i i=1
 while [[ $i -le $COUNT ]]; do
-       log_must $FILE_WRITE -o create -f $TESTDIR/before_file$i \
+       log_must file_write -o create -f $TESTDIR/before_file$i \
           -b $BLOCKSZ -c $NUM_WRITES -d $i
 
        (( i = i + 1 ))
 done
 
-log_must $ZFS snapshot $SNAPFS
+log_must zfs snapshot $SNAPFS
 
-FILE_COUNT=`$LS -Al $SNAPDIR | $GREP -v "total" | wc -l`
+FILE_COUNT=`ls -Al $SNAPDIR | grep -v "total" | wc -l`
 if [[ $FILE_COUNT -ne $COUNT ]]; then
-        $LS -Al $SNAPDIR
+        ls -Al $SNAPDIR
         log_fail "AFTER: $SNAPFS contains $FILE_COUNT files(s)."
 fi
 
 log_note "Populate the $TESTDIR directory (post snapshot)"
 typeset -i i=1
 while [[ $i -le $COUNT ]]; do
-        log_must $FILE_WRITE -o create -f $TESTDIR/after_file$i \
+        log_must file_write -o create -f $TESTDIR/after_file$i \
            -b $BLOCKSZ -c $NUM_WRITES -d $i
 
         (( i = i + 1 ))
@@ -97,18 +97,18 @@ done
 #
 # Now rollback to latest snapshot
 #
-log_must $ZFS rollback $SNAPFS
+log_must zfs rollback $SNAPFS
 
-FILE_COUNT=`$LS -Al $TESTDIR/after* 2> /dev/null | $GREP -v "total" | wc -l`
+FILE_COUNT=`ls -Al $TESTDIR/after* 2> /dev/null | grep -v "total" | wc -l`
 if [[ $FILE_COUNT -ne 0 ]]; then
-        $LS -Al $TESTDIR
+        ls -Al $TESTDIR
         log_fail "$TESTDIR contains $FILE_COUNT after* files(s)."
 fi
 
-FILE_COUNT=`$LS -Al $TESTDIR/before* 2> /dev/null \
-    | $GREP -v "total" | wc -l`
+FILE_COUNT=`ls -Al $TESTDIR/before* 2> /dev/null \
+    | grep -v "total" | wc -l`
 if [[ $FILE_COUNT -ne $COUNT ]]; then
-       $LS -Al $TESTDIR
+       ls -Al $TESTDIR
        log_fail "$TESTDIR contains $FILE_COUNT before* files(s)."
 fi
 
index 76b8c8452069f5e59c7944b4486f9790a068b629..c424a69f0a7e697a9b046cf4340f8c41247050fb 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -53,14 +53,14 @@ function cleanup
 {
        snapexists $SNAPFS.1
        [[ $? -eq 0 ]] && \
-               log_must $ZFS destroy $SNAPFS.1
+               log_must zfs destroy $SNAPFS.1
 
        snapexists $SNAPFS
        [[ $? -eq 0 ]] && \
-               log_must $ZFS destroy $SNAPFS
+               log_must zfs destroy $SNAPFS
 
        [[ -e $TESTDIR ]] && \
-               log_must $RM -rf $TESTDIR/* > /dev/null 2>&1
+               log_must rm -rf $TESTDIR/* > /dev/null 2>&1
 }
 
 log_assert "Verify rollback is with respect to latest snapshot."
@@ -68,65 +68,65 @@ log_assert "Verify rollback is with respect to latest snapshot."
 log_onexit cleanup
 
 [[ -n $TESTDIR ]] && \
-    log_must $RM -rf $TESTDIR/* > /dev/null 2>&1
+    log_must rm -rf $TESTDIR/* > /dev/null 2>&1
 
 typeset -i COUNT=10
 
 log_note "Populate the $TESTDIR directory (prior to first snapshot)"
 typeset -i i=1
 while [[ $i -le $COUNT ]]; do
-       log_must $FILE_WRITE -o create -f $TESTDIR/original_file$i \
+       log_must file_write -o create -f $TESTDIR/original_file$i \
           -b $BLOCKSZ -c $NUM_WRITES -d $i
 
        (( i = i + 1 ))
 done
 
-log_must $ZFS snapshot $SNAPFS
+log_must zfs snapshot $SNAPFS
 
-FILE_COUNT=`$LS -Al $SNAPDIR | $GREP -v "total" | wc -l`
+FILE_COUNT=`ls -Al $SNAPDIR | grep -v "total" | wc -l`
 if [[ $FILE_COUNT -ne $COUNT ]]; then
-        $LS -Al $SNAPDIR
+        ls -Al $SNAPDIR
         log_fail "AFTER: $SNAPFS contains $FILE_COUNT files(s)."
 fi
 
 log_note "Populate the $TESTDIR directory (prior to second snapshot)"
 typeset -i i=1
 while [[ $i -le $COUNT ]]; do
-        log_must $FILE_WRITE -o create -f $TESTDIR/afterfirst_file$i \
+        log_must file_write -o create -f $TESTDIR/afterfirst_file$i \
            -b $BLOCKSZ -c $NUM_WRITES -d $i
 
         (( i = i + 1 ))
 done
 
-log_must $ZFS snapshot $SNAPFS.1
+log_must zfs snapshot $SNAPFS.1
 
 log_note "Populate the $TESTDIR directory (Post second snapshot)"
 typeset -i i=1
 while [[ $i -le $COUNT ]]; do
-        log_must $FILE_WRITE -o create -f $TESTDIR/aftersecond_file$i \
+        log_must file_write -o create -f $TESTDIR/aftersecond_file$i \
            -b $BLOCKSZ -c $NUM_WRITES -d $i
 
         (( i = i + 1 ))
 done
 
 [[ -n $TESTDIR ]] && \
-    log_must $RM -rf $TESTDIR/original_file* > /dev/null 2>&1
+    log_must rm -rf $TESTDIR/original_file* > /dev/null 2>&1
 
 #
 # Now rollback to latest snapshot
 #
-log_must $ZFS rollback $SNAPFS.1
+log_must zfs rollback $SNAPFS.1
 
-FILE_COUNT=`$LS -Al $TESTDIR/aftersecond* 2> /dev/null \
-    | $GREP -v "total" | wc -l`
+FILE_COUNT=`ls -Al $TESTDIR/aftersecond* 2> /dev/null \
+    | grep -v "total" | wc -l`
 if [[ $FILE_COUNT -ne 0 ]]; then
-        $LS -Al $TESTDIR
+        ls -Al $TESTDIR
         log_fail "$TESTDIR contains $FILE_COUNT aftersecond* files(s)."
 fi
 
-FILE_COUNT=`$LS -Al $TESTDIR/original* $TESTDIR/afterfirst*| $GREP -v "total" | wc -l`
+FILE_COUNT=`ls -Al $TESTDIR/original* $TESTDIR/afterfirst*| grep -v "total" | wc -l`
 if [[ $FILE_COUNT -ne 20 ]]; then
-        $LS -Al $TESTDIR
+        ls -Al $TESTDIR
         log_fail "$TESTDIR contains $FILE_COUNT original* files(s)."
 fi
 
index 4c9ef685187afc89e844e186c5fc181b332e138f..9b1e400db56e075a3c7e84fd8d556b077ca99593 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -54,53 +54,53 @@ function cleanup
        typeset fs=""
 
        export __ZFS_POOL_RESTRICT="$TESTPOOL"
-       log_must $ZFS mount -a
+       log_must zfs mount -a
        unset __ZFS_POOL_RESTRICT
 
        for snap in "$SNAPPOOL.1" "$SNAPPOOL"
        do
                snapexists $snap
                [[ $? -eq 0 ]] && \
-                       log_must $ZFS destroy $snap
+                       log_must zfs destroy $snap
        done
 
        for fs in "$TESTPOOL/$TESTFILE/$TESTFILE.1" "$TESTPOOL/$TESTFILE"
        do
                datasetexists $fs
                [[ $? -eq 0 ]] && \
-                       log_must $ZFS destroy -r $fs
+                       log_must zfs destroy -r $fs
        done
 
        [[ -e /$TESTPOOL ]] && \
-               log_must $RM -rf $TESTPOOL/*
+               log_must rm -rf $TESTPOOL/*
 }
 
 log_assert "Verify rollback succeeds when there are nested file systems."
 
 log_onexit cleanup
 
-log_must $ZFS snapshot $SNAPPOOL
-log_must $ZFS rollback $SNAPPOOL
-log_mustnot $ZFS snapshot $SNAPPOOL
+log_must zfs snapshot $SNAPPOOL
+log_must zfs rollback $SNAPPOOL
+log_mustnot zfs snapshot $SNAPPOOL
 
-log_must $TOUCH /$TESTPOOL/$TESTFILE
+log_must touch /$TESTPOOL/$TESTFILE
 
-log_must $ZFS rollback $SNAPPOOL
-log_must $ZFS create $TESTPOOL/$TESTFILE
+log_must zfs rollback $SNAPPOOL
+log_must zfs create $TESTPOOL/$TESTFILE
 
-log_must $ZFS rollback $SNAPPOOL
+log_must zfs rollback $SNAPPOOL
 
 log_note "Verify rollback of multiple nested file systems succeeds."
-log_must $ZFS snapshot $TESTPOOL/$TESTFILE@$TESTSNAP
-log_must $ZFS snapshot $SNAPPOOL.1
+log_must zfs snapshot $TESTPOOL/$TESTFILE@$TESTSNAP
+log_must zfs snapshot $SNAPPOOL.1
 
 export __ZFS_POOL_RESTRICT="$TESTPOOL"
-log_must $ZFS unmount -a
-log_must $ZFS mount -a
+log_must zfs unmount -a
+log_must zfs mount -a
 unset __ZFS_POOL_RESTRICT
 
-log_must $TOUCH /$TESTPOOL/$TESTFILE/$TESTFILE.1
+log_must touch /$TESTPOOL/$TESTFILE/$TESTFILE.1
 
-log_must $ZFS rollback $SNAPPOOL.1
+log_must zfs rollback $SNAPPOOL.1
 
 log_pass "Rollbacks succeed when nested file systems are present."
index 832ca1e8a821d0659376e9fddc5a824b1587df87..8b8c118d9dfb4c46d695ed44df0e80ae75b51e11 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,15 +52,15 @@ function cleanup
 {
        snapexists $SNAPFS
        if [[ $? -eq 0 ]]; then
-               log_must $ZFS destroy $SNAPFS
+               log_must zfs destroy $SNAPFS
        fi
 
        if [[ -e $SNAPDIR ]]; then
-               log_must $RM -rf $SNAPDIR > /dev/null 2>&1
+               log_must rm -rf $SNAPDIR > /dev/null 2>&1
        fi
 
        if [[ -e $TESTDIR ]]; then
-               log_must $RM -rf $TESTDIR/* > /dev/null 2>&1
+               log_must rm -rf $TESTDIR/* > /dev/null 2>&1
        fi
 }
 
@@ -69,21 +69,21 @@ log_assert "Verify a file system snapshot is identical to original."
 log_onexit cleanup
 
 log_note "Create a file in the zfs filesystem..."
-log_must $FILE_WRITE -o create -f $TESTDIR/$TESTFILE -b $BLOCKSZ \
+log_must file_write -o create -f $TESTDIR/$TESTFILE -b $BLOCKSZ \
     -c $NUM_WRITES -d $DATA
 
 log_note "Sum the file, save for later comparison..."
-FILE_SUM=`$SUM -r $TESTDIR/$TESTFILE | $AWK  '{ print $1 }'`
+FILE_SUM=`sum -r $TESTDIR/$TESTFILE | awk  '{ print $1 }'`
 log_note "FILE_SUM = $FILE_SUM"
 
 log_note "Create a snapshot and mount it..."
-log_must $ZFS snapshot $SNAPFS
+log_must zfs snapshot $SNAPFS
 
 log_note "Append to the original file..."
-log_must $FILE_WRITE -o append -f $TESTDIR/$TESTFILE -b $BLOCKSZ \
+log_must file_write -o append -f $TESTDIR/$TESTFILE -b $BLOCKSZ \
     -c $NUM_WRITES -d $DATA
 
-SNAP_FILE_SUM=`$SUM -r $SNAPDIR/$TESTFILE | $AWK '{ print $1 }'`
+SNAP_FILE_SUM=`sum -r $SNAPDIR/$TESTFILE | awk '{ print $1 }'`
 if [[ $SNAP_FILE_SUM -ne $FILE_SUM ]]; then
        log_fail "Sums do not match, aborting!! ($SNAP_FILE_SUM != $FILE_SUM)"
 fi
index 040f3acf696be5bec2a25f0fdfcc166423a7af62..611c4154a0dbafa2e4ba2ffa4a47e3d63a95bd18 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -57,19 +57,19 @@ function cleanup
 
         snapexists $SNAPFS
         if [[ $? -eq 0 ]]; then
-                log_must $ZFS destroy $SNAPFS
+                log_must zfs destroy $SNAPFS
         fi
 
         if [[ -e $SNAPDIR ]]; then
-                log_must $RM -rf $SNAPDIR > /dev/null 2>&1
+                log_must rm -rf $SNAPDIR > /dev/null 2>&1
         fi
 
         if [[ -e $TESTDIR ]]; then
-                log_must $RM -rf $TESTDIR/* > /dev/null 2>&1
+                log_must rm -rf $TESTDIR/* > /dev/null 2>&1
         fi
 
        if [[ -e /tmp/zfs_snapshot2.$$ ]]; then
-               log_must $RM -rf /tmp/zfs_snapshot2.$$ > /dev/null 2>&1
+               log_must rm -rf /tmp/zfs_snapshot2.$$ > /dev/null 2>&1
        fi
 
 }
@@ -83,13 +83,13 @@ typeset -i COUNT=21
 typeset OP=create
 
 [[ -n $TESTDIR ]] && \
-    $RM -rf $TESTDIR/* > /dev/null 2>&1
+    rm -rf $TESTDIR/* > /dev/null 2>&1
 
 log_note "Create files in the zfs filesystem..."
 
 typeset i=1
 while [ $i -lt $COUNT ]; do
-       log_must $FILE_WRITE -o $OP -f $TESTDIR/file$i \
+       log_must file_write -o $OP -f $TESTDIR/file$i \
            -b $BLOCKSZ -c $NUM_WRITES -d $DATA
 
        (( i = i + 1 ))
@@ -98,35 +98,35 @@ done
 log_note "Create a tarball from $TESTDIR contents..."
 CWD=$PWD
 cd $TESTDIR || log_fail "Could not cd $TESTDIR"
-log_must $TAR cf $TESTDIR/tarball.original.tar file*
+log_must tar cf $TESTDIR/tarball.original.tar file*
 cd $CWD || log_fail "Could not cd $CWD"
 
 log_note "Create a snapshot and mount it..."
-log_must $ZFS snapshot $SNAPFS
+log_must zfs snapshot $SNAPFS
 
 log_note "Remove all of the original files..."
-log_must $RM -f $TESTDIR/file* > /dev/null 2>&1
+log_must rm -f $TESTDIR/file* > /dev/null 2>&1
 
 log_note "Create tarball of snapshot..."
 CWD=$PWD
 cd $SNAPDIR || log_fail "Could not cd $SNAPDIR"
-log_must $TAR cf $TESTDIR/tarball.snapshot.tar file*
+log_must tar cf $TESTDIR/tarball.snapshot.tar file*
 cd $CWD || log_fail "Could not cd $CWD"
 
-log_must $MKDIR $TESTDIR/original
-log_must $MKDIR $TESTDIR/snapshot
+log_must mkdir $TESTDIR/original
+log_must mkdir $TESTDIR/snapshot
 
 CWD=$PWD
 cd $TESTDIR/original || log_fail "Could not cd $TESTDIR/original"
-log_must $TAR xf $TESTDIR/tarball.original.tar
+log_must tar xf $TESTDIR/tarball.original.tar
 
 cd $TESTDIR/snapshot || log_fail "Could not cd $TESTDIR/snapshot"
-log_must $TAR xf $TESTDIR/tarball.snapshot.tar
+log_must tar xf $TESTDIR/tarball.snapshot.tar
 
 cd $CWD || log_fail "Could not cd $CWD"
 
-$DIRCMP $TESTDIR/original $TESTDIR/snapshot > /tmp/zfs_snapshot2.$$
-$GREP different /tmp/zfs_snapshot2.$$ >/dev/null 2>&1
+dircmp $TESTDIR/original $TESTDIR/snapshot > /tmp/zfs_snapshot2.$$
+grep different /tmp/zfs_snapshot2.$$ >/dev/null 2>&1
 if [[ $? -ne 1 ]]; then
        log_fail "Directory structures differ."
 fi
index f30629f26b096beab06b00caaf3810477297d135..054b58cd559045ae4e50acd20bb5f24350b2c2b7 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -51,18 +51,18 @@ function cleanup
        while [ $i -lt $COUNT ]; do
                snapexists $SNAPFS.$i
                if [[ $? -eq 0 ]]; then
-                       log_must $ZFS destroy $SNAPFS.$i
+                       log_must zfs destroy $SNAPFS.$i
                fi
 
                if [[ -e $SNAPDIR.$i ]]; then
-                       log_must $RM -rf $SNAPDIR.$i > /dev/null 2>&1
+                       log_must rm -rf $SNAPDIR.$i > /dev/null 2>&1
                fi
 
                (( i = i + 1 ))
        done
 
        if [[ -e $TESTDIR ]]; then
-               log_must $RM -rf $TESTDIR/* > /dev/null 2>&1
+               log_must rm -rf $TESTDIR/* > /dev/null 2>&1
        fi
 }
 
@@ -71,30 +71,30 @@ log_assert "Verify many snapshots of a file system can be taken."
 log_onexit cleanup
 
 [[ -n $TESTDIR ]] && \
-    log_must $RM -rf $TESTDIR/* > /dev/null 2>&1
+    log_must rm -rf $TESTDIR/* > /dev/null 2>&1
 
 typeset -i COUNT=10
 
 log_note "Create some files in the $TESTDIR directory..."
 typeset -i i=1
 while [[ $i -lt $COUNT ]]; do
-       log_must $FILE_WRITE -o create -f $TESTDIR/file$i \
+       log_must file_write -o create -f $TESTDIR/file$i \
           -b $BLOCKSZ -c $NUM_WRITES -d $i
-       log_must $ZFS snapshot $SNAPFS.$i
+       log_must zfs snapshot $SNAPFS.$i
 
        (( i = i + 1 ))
 done
 
 log_note "Remove all of the original files"
 [[ -n $TESTDIR ]] && \
-    log_must $RM -rf $TESTDIR/file* > /dev/null 2>&1
+    log_must rm -rf $TESTDIR/file* > /dev/null 2>&1
 
 i=1
 while [[ $i -lt $COUNT ]]; do
-       FILECOUNT=`$LS $SNAPDIR.$i/file* | wc -l`
+       FILECOUNT=`ls $SNAPDIR.$i/file* | wc -l`
        typeset j=1
        while [ $j -lt $FILECOUNT ]; do
-               log_must $FILE_CHECK $SNAPDIR.$i/file$j $j
+               log_must file_check $SNAPDIR.$i/file$j $j
                (( j = j + 1 ))
        done
        (( i = i + 1 ))
index e1040070ce1fe634493be392b8dac4963e3aaba2..9d3b3de1adc0e3fd8fec581badeaef37407eb114 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -50,10 +50,10 @@ function cleanup
 {
        snapexists $SNAPFS
        [[ $? -eq 0 ]] && \
-               log_must $ZFS destroy $SNAPFS
+               log_must zfs destroy $SNAPFS
 
        [[ -e $TESTDIR ]] && \
-               log_must $RM -rf $TESTDIR/* > /dev/null 2>&1
+               log_must rm -rf $TESTDIR/* > /dev/null 2>&1
 }
 
 log_assert "Verify that a snapshot of an empty file system remains empty."
@@ -61,12 +61,12 @@ log_assert "Verify that a snapshot of an empty file system remains empty."
 log_onexit cleanup
 
 [[ -n $TESTDIR ]] && \
-    log_must $RM -rf $TESTDIR/* > /dev/null 2>&1
+    log_must rm -rf $TESTDIR/* > /dev/null 2>&1
 
-log_must $ZFS snapshot $SNAPFS
-FILE_COUNT=`$LS -Al $SNAPDIR | $GREP -v "total 0" | wc -l`
+log_must zfs snapshot $SNAPFS
+FILE_COUNT=`ls -Al $SNAPDIR | grep -v "total 0" | wc -l`
 if [[ $FILE_COUNT -ne 0 ]]; then
-       $LS $SNAPDIR
+       ls $SNAPDIR
        log_fail "BEFORE: $SNAPDIR contains $FILE_COUNT files(s)."
 fi
 
@@ -75,15 +75,15 @@ typeset -i COUNT=10
 log_note "Populate the $TESTDIR directory"
 typeset -i i=1
 while [[ $i -lt $COUNT ]]; do
-       log_must $FILE_WRITE -o create -f $TESTDIR/file$i \
+       log_must file_write -o create -f $TESTDIR/file$i \
           -b $BLOCKSZ -c $NUM_WRITES -d $i
 
        (( i = i + 1 ))
 done
 
-FILE_COUNT=`$LS -Al $SNAPDIR | $GREP -v "total 0" | wc -l`
+FILE_COUNT=`ls -Al $SNAPDIR | grep -v "total 0" | wc -l`
 if [[ $FILE_COUNT -ne 0 ]]; then
-        $LS $SNAPDIR
+        ls $SNAPDIR
         log_fail "AFTER: $SNAPDIR contains $FILE_COUNT files(s)."
 fi
 
index 8c73639d444322b73bc4a9448efdac98f60282ce..c1917dff129988b93184b76c4a78efd08bf2ffb9 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -51,15 +51,15 @@ function cleanup
 {
        snapexists $SNAPCTR
        if [[ $? -eq 0 ]]; then
-               log_must $ZFS destroy $SNAPCTR
+               log_must zfs destroy $SNAPCTR
        fi
 
        if [[ -e $SNAPDIR1 ]]; then
-               log_must $RM -rf $SNAPDIR1 > /dev/null 2>&1
+               log_must rm -rf $SNAPDIR1 > /dev/null 2>&1
        fi
 
        if [[ -e $TESTDIR ]]; then
-               log_must $RM -rf $TESTDIR/* > /dev/null 2>&1
+               log_must rm -rf $TESTDIR/* > /dev/null 2>&1
        fi
 }
 
@@ -68,21 +68,21 @@ log_assert "Verify that a snapshot of a dataset is identical to " \
 log_onexit cleanup
 
 log_note "Create a file in the zfs filesystem..."
-log_must $FILE_WRITE -o create -f $TESTDIR1/$TESTFILE -b $BLOCKSZ \
+log_must file_write -o create -f $TESTDIR1/$TESTFILE -b $BLOCKSZ \
     -c $NUM_WRITES -d $DATA
 
 log_note "Sum the file, save for later comparison..."
-FILE_SUM=`$SUM -r $TESTDIR1/$TESTFILE | $AWK  '{ print $1 }'`
+FILE_SUM=`sum -r $TESTDIR1/$TESTFILE | awk  '{ print $1 }'`
 log_note "FILE_SUM = $FILE_SUM"
 
 log_note "Create a snapshot and mount it..."
-log_must $ZFS snapshot $SNAPCTR
+log_must zfs snapshot $SNAPCTR
 
 log_note "Append to the original file..."
-log_must $FILE_WRITE -o append -f $TESTDIR1/$TESTFILE -b $BLOCKSZ \
+log_must file_write -o append -f $TESTDIR1/$TESTFILE -b $BLOCKSZ \
     -c $NUM_WRITES -d $DATA
 
-SNAP_FILE_SUM=`$SUM -r $SNAPDIR1/$TESTFILE | $AWK '{ print $1 }'`
+SNAP_FILE_SUM=`sum -r $SNAPDIR1/$TESTFILE | awk '{ print $1 }'`
 if [[ $SNAP_FILE_SUM -ne $FILE_SUM ]]; then
        log_fail "Sums do not match, aborting!! ($SNAP_FILE_SUM != $FILE_SUM)"
 fi
index cc2c6edcc3c4eaadbe9bb1a8ec939f5177d18b04..6269e4a8b5cd5c7dd0c6717202f2585994f0f4a6 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -56,19 +56,19 @@ function cleanup
 
         snapexists $SNAPCTR
         if [[ $? -eq 0 ]]; then
-                log_must $ZFS destroy $SNAPCTR
+                log_must zfs destroy $SNAPCTR
         fi
 
         if [[ -e $SNAPDIR1 ]]; then
-                log_must $RM -rf $SNAPDIR1 > /dev/null 2>&1
+                log_must rm -rf $SNAPDIR1 > /dev/null 2>&1
         fi
 
         if [[ -e $TESTDIR1 ]]; then
-                log_must $RM -rf $TESTDIR1/* > /dev/null 2>&1
+                log_must rm -rf $TESTDIR1/* > /dev/null 2>&1
         fi
 
        if [[ -e /tmp/zfs_snapshot2.$$ ]]; then
-               log_must $RM -rf /tmp/zfs_snapshot2.$$ > /dev/null 2>&1
+               log_must rm -rf /tmp/zfs_snapshot2.$$ > /dev/null 2>&1
        fi
 
 }
@@ -81,13 +81,13 @@ log_onexit cleanup
 typeset -i COUNT=21
 typeset OP=create
 
-[[ -n $TESTDIR1 ]] && $RM -rf $TESTDIR1/* > /dev/null 2>&1
+[[ -n $TESTDIR1 ]] && rm -rf $TESTDIR1/* > /dev/null 2>&1
 
 log_note "Create files in the zfs dataset ..."
 
 typeset i=1
 while [ $i -lt $COUNT ]; do
-       log_must $FILE_WRITE -o $OP -f $TESTDIR1/file$i \
+       log_must file_write -o $OP -f $TESTDIR1/file$i \
            -b $BLOCKSZ -c $NUM_WRITES -d $DATA
 
        (( i = i + 1 ))
@@ -96,35 +96,35 @@ done
 log_note "Create a tarball from $TESTDIR1 contents..."
 CWD=$PWD
 cd $TESTDIR1 || log_fail "Could not cd $TESTDIR1"
-log_must $TAR cf $TESTDIR1/tarball.original.tar file*
+log_must tar cf $TESTDIR1/tarball.original.tar file*
 cd $CWD || log_fail "Could not cd $CWD"
 
 log_note "Create a snapshot and mount it..."
-log_must $ZFS snapshot $SNAPCTR
+log_must zfs snapshot $SNAPCTR
 
 log_note "Remove all of the original files..."
-log_must $RM -f $TESTDIR1/file* > /dev/null 2>&1
+log_must rm -f $TESTDIR1/file* > /dev/null 2>&1
 
 log_note "Create tarball of snapshot..."
 CWD=$PWD
 cd $SNAPDIR1 || log_fail "Could not cd $SNAPDIR1"
-log_must $TAR cf $TESTDIR1/tarball.snapshot.tar file*
+log_must tar cf $TESTDIR1/tarball.snapshot.tar file*
 cd $CWD || log_fail "Could not cd $CWD"
 
-log_must $MKDIR $TESTDIR1/original
-log_must $MKDIR $TESTDIR1/snapshot
+log_must mkdir $TESTDIR1/original
+log_must mkdir $TESTDIR1/snapshot
 
 CWD=$PWD
 cd $TESTDIR1/original || log_fail "Could not cd $TESTDIR1/original"
-log_must $TAR xf $TESTDIR1/tarball.original.tar
+log_must tar xf $TESTDIR1/tarball.original.tar
 
 cd $TESTDIR1/snapshot || log_fail "Could not cd $TESTDIR1/snapshot"
-log_must $TAR xf $TESTDIR1/tarball.snapshot.tar
+log_must tar xf $TESTDIR1/tarball.snapshot.tar
 
 cd $CWD || log_fail "Could not cd $CWD"
 
-$DIRCMP $TESTDIR1/original $TESTDIR1/snapshot > /tmp/zfs_snapshot2.$$
-$GREP different /tmp/zfs_snapshot2.$$ >/dev/null 2>&1
+dircmp $TESTDIR1/original $TESTDIR1/snapshot > /tmp/zfs_snapshot2.$$
+grep different /tmp/zfs_snapshot2.$$ >/dev/null 2>&1
 if [[ $? -ne 1 ]]; then
        log_fail "Directory structures differ."
 fi
index 5ee9f5d3a7f8ecaf9dab3830ea62cde95df8d291..7ed1fdb6e7ad93e0018c89c5abd94077fd6b2882 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -51,22 +51,22 @@ function cleanup
        while [ $i -lt $COUNT ]; do
                snapexists $SNAPCTR.$i
                if [[ $? -eq 0 ]]; then
-                       log_must $ZFS destroy $SNAPCTR.$i
+                       log_must zfs destroy $SNAPCTR.$i
                fi
 
                if [[ -e $SNAPDIR.$i ]]; then
-                       log_must $RM -rf $SNAPDIR1.$i > /dev/null 2>&1
+                       log_must rm -rf $SNAPDIR1.$i > /dev/null 2>&1
                fi
 
                (( i = i + 1 ))
        done
 
        if [[ -e $SNAPDIR1 ]]; then
-               log_must $RM -rf $SNAPDIR1 > /dev/null 2>&1
+               log_must rm -rf $SNAPDIR1 > /dev/null 2>&1
        fi
 
        if [[ -e $TESTDIR ]]; then
-               log_must $RM -rf $TESTDIR/* > /dev/null 2>&1
+               log_must rm -rf $TESTDIR/* > /dev/null 2>&1
        fi
 }
 
@@ -75,30 +75,30 @@ log_assert "Verify that many snapshots can be made on a zfs dataset."
 log_onexit cleanup
 
 [[ -n $TESTDIR ]] && \
-    log_must $RM -rf $TESTDIR/* > /dev/null 2>&1
+    log_must rm -rf $TESTDIR/* > /dev/null 2>&1
 
 typeset -i COUNT=10
 
 log_note "Create some files in the $TESTDIR directory..."
 typeset -i i=1
 while [[ $i -lt $COUNT ]]; do
-       log_must $FILE_WRITE -o create -f $TESTDIR1/file$i \
+       log_must file_write -o create -f $TESTDIR1/file$i \
           -b $BLOCKSZ -c $NUM_WRITES -d $i
-       log_must $ZFS snapshot $SNAPCTR.$i
+       log_must zfs snapshot $SNAPCTR.$i
 
        (( i = i + 1 ))
 done
 
 log_note "Remove all of the original files"
 [[ -n $TESTDIR ]] && \
-    log_must $RM -rf $TESTDIR1/file* > /dev/null 2>&1
+    log_must rm -rf $TESTDIR1/file* > /dev/null 2>&1
 
 i=1
 while [[ $i -lt $COUNT ]]; do
-       FILECOUNT=`$LS $SNAPDIR1.$i/file* | wc -l`
+       FILECOUNT=`ls $SNAPDIR1.$i/file* | wc -l`
        typeset j=1
        while [ $j -lt $FILECOUNT ]; do
-               log_must $FILE_CHECK $SNAPDIR1.$i/file$j $j
+               log_must file_check $SNAPDIR1.$i/file$j $j
                (( j = j + 1 ))
        done
        (( i = i + 1 ))
index b4437a2a86f1142933eec1402b2280875c8bf651..0f7b0621a4829c703899b382a2005c824112049c 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -50,13 +50,13 @@ function cleanup
        while [[ $i -lt $COUNT ]]; do
                snapexists $SNAPFS.$i
                [[ $? -eq 0 ]] && \
-                       log_must $ZFS destroy $SNAPFS.$i
+                       log_must zfs destroy $SNAPFS.$i
 
                (( i = i + 1 ))
        done
 
        [[ -e $TESTDIR ]] && \
-               log_must $RM -rf $TESTDIR/* > /dev/null 2>&1
+               log_must rm -rf $TESTDIR/* > /dev/null 2>&1
 }
 
 log_assert "Verify that destroying snapshots returns space to the pool."
@@ -64,7 +64,7 @@ log_assert "Verify that destroying snapshots returns space to the pool."
 log_onexit cleanup
 
 [[ -n $TESTDIR ]] && \
-    log_must $RM -rf $TESTDIR/* > /dev/null 2>&1
+    log_must rm -rf $TESTDIR/* > /dev/null 2>&1
 
 typeset -i COUNT=10
 
@@ -73,17 +73,17 @@ orig_size=`get_prop available $TESTPOOL`
 log_note "Populate the $TESTDIR directory"
 typeset -i i=1
 while [[ $i -lt $COUNT ]]; do
-       log_must $FILE_WRITE -o create -f $TESTDIR/file$i \
+       log_must file_write -o create -f $TESTDIR/file$i \
           -b $BLOCKSZ -c $NUM_WRITES -d $i
 
-       log_must $ZFS snapshot $SNAPFS.$i
+       log_must zfs snapshot $SNAPFS.$i
        (( i = i + 1 ))
 done
 
 typeset -i i=1
 while [[ $i -lt $COUNT ]]; do
        log_must rm -rf $TESTDIR/file$i > /dev/null 2>&1
-       log_must $ZFS destroy $SNAPFS.$i
+       log_must zfs destroy $SNAPFS.$i
 
        (( i = i + 1 ))
 done
index dfc75d821d84fa476f8232c212191aced32ce5de..9266691247cfa0e96bb120deabb8045336ebc715 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -53,7 +53,7 @@ function cleanup
 
        for ds in $ctr/$TESTVOL1 $ctr/$TESTCLONE; do
                datasetexists $ds && \
-                       log_must $ZFS destroy -f $ds
+                       log_must zfs destroy -f $ds
        done
 
        for snap in $ctr/$TESTFS1@$TESTSNAP1 \
@@ -61,7 +61,7 @@ function cleanup
                $snapctrclone $snapctrfs
        do
                snapexists $snap && \
-                       log_must $ZFS destroy -rf $snap
+                       log_must zfs destroy -rf $snap
        done
 
 }
@@ -82,15 +82,15 @@ snapctrclone=$ctrclone@$TESTSNAP
 snapctrfs=$SNAPCTR
 
 #preparation for testing
-log_must $ZFS snapshot $ctrfs@$TESTSNAP1
-log_must $ZFS clone $ctrfs@$TESTSNAP1 $ctrclone
+log_must zfs snapshot $ctrfs@$TESTSNAP1
+log_must zfs clone $ctrfs@$TESTSNAP1 $ctrclone
 if is_global_zone; then
-       log_must $ZFS create -V $VOLSIZE $ctrvol
+       log_must zfs create -V $VOLSIZE $ctrvol
 else
-       log_must $ZFS create $ctrvol
+       log_must zfs create $ctrvol
 fi
 
-log_must $ZFS snapshot -r $snappool
+log_must zfs snapshot -r $snappool
 
 #verify the snapshot -r results
 for snap in $snappool $snapfs $snapvol $snapctr $snapctrvol \
@@ -102,7 +102,7 @@ done
 
 log_note "Verify that destroy -r can destroy the snapshot tree."
 
-log_must $ZFS destroy -r $snappool
+log_must zfs destroy -r $snappool
 for snap in $snappool $snapfs $snapvol $snapctr $snapctrvol \
                $snapctrclone $snapctrfs
 do
index cb9ff880e0534c6d7d4a6644c0c67513747468e6..e0849493db3c17b74187bd3d9fc5c7bacff84bb5 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -50,14 +50,14 @@ function cleanup
        typeset snap
 
        datasetexists $ctrvol && \
-               log_must $ZFS destroy -f $ctrvol
+               log_must zfs destroy -f $ctrvol
 
        for snap in $ctrfs@$TESTSNAP1 \
                $snappool $snapvol $snapctr $snapctrvol \
                $snapctrclone $snapctrfs
        do
                snapexists $snap && \
-                       log_must $ZFS destroy -rf $snap
+                       log_must zfs destroy -rf $snap
        done
 
 }
@@ -77,17 +77,17 @@ snapctrclone=$ctr/$TESTCLONE@$TESTSNAP
 snapctrfs=$SNAPCTR
 
 #preparation for testing
-log_must $ZFS snapshot $ctrfs@$TESTSNAP1
+log_must zfs snapshot $ctrfs@$TESTSNAP1
 if is_global_zone; then
-       log_must $ZFS create -V $VOLSIZE $ctrvol
+       log_must zfs create -V $VOLSIZE $ctrvol
 else
-       log_must $ZFS create $ctrvol
+       log_must zfs create $ctrvol
 fi
 
-log_must $ZFS snapshot -r $snappool
+log_must zfs snapshot -r $snappool
 
 #select the $TESTCTR as destroy point, $TESTCTR is a child of $TESTPOOL
-log_must $ZFS destroy -r $snapctr
+log_must zfs destroy -r $snapctr
 for snap in $snapctr $snapctrvol $snapctrclone $snapctrfs; do
        snapexists $snap && \
                log_fail "The snapshot $snap is not destroyed correctly."
index 9774035a5e49323213f1503c0ed7e0a333e2ee19..44e5943bcd2f1f1c94f0b7f7f133095d7b14c6b3 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,41 +52,41 @@ verify_runnable "both"
 function cleanup
 {
        snapexists $SNAPPOOL && \
-               log_must $ZFS destroy -r $SNAPPOOL
+               log_must zfs destroy -r $SNAPPOOL
 
        [[ -e $TESTDIR ]] && \
-               log_must $RM -rf $TESTDIR/* > /dev/null 2>&1
+               log_must rm -rf $TESTDIR/* > /dev/null 2>&1
 }
 
 log_assert "Verify that rollback to a snapshot created by snapshot -r succeeds."
 log_onexit cleanup
 
 [[ -n $TESTDIR ]] && \
-    log_must $RM -rf $TESTDIR/* > /dev/null 2>&1
+    log_must rm -rf $TESTDIR/* > /dev/null 2>&1
 
 typeset -i COUNT=10
 
 log_note "Populate the $TESTDIR directory (prior to snapshot)"
 typeset -i i=0
 while (( i < COUNT )); do
-       log_must $FILE_WRITE -o create -f $TESTDIR/before_file$i \
+       log_must file_write -o create -f $TESTDIR/before_file$i \
           -b $BLOCKSZ -c $NUM_WRITES -d $i
 
        (( i = i + 1 ))
 done
 
-log_must $ZFS snapshot -r $SNAPPOOL
+log_must zfs snapshot -r $SNAPPOOL
 
-FILE_COUNT=`$LS -Al $SNAPDIR | $GREP -v "total" | wc -l`
+FILE_COUNT=`ls -Al $SNAPDIR | grep -v "total" | wc -l`
 if (( FILE_COUNT != COUNT )); then
-        $LS -Al $SNAPDIR
+        ls -Al $SNAPDIR
         log_fail "AFTER: $SNAPFS contains $FILE_COUNT files(s)."
 fi
 
 log_note "Populate the $TESTDIR directory (post snapshot)"
 typeset -i i=0
 while (( i < COUNT )); do
-        log_must $FILE_WRITE -o create -f $TESTDIR/after_file$i \
+        log_must file_write -o create -f $TESTDIR/after_file$i \
            -b $BLOCKSZ -c $NUM_WRITES -d $i
 
         (( i = i + 1 ))
@@ -95,18 +95,18 @@ done
 #
 # Now rollback to latest snapshot
 #
-log_must $ZFS rollback $SNAPFS
+log_must zfs rollback $SNAPFS
 
-FILE_COUNT=`$LS -Al $TESTDIR/after* 2> /dev/null | $GREP -v "total" | wc -l`
+FILE_COUNT=`ls -Al $TESTDIR/after* 2> /dev/null | grep -v "total" | wc -l`
 if (( FILE_COUNT != 0 )); then
-        $LS -Al $TESTDIR
+        ls -Al $TESTDIR
         log_fail "$TESTDIR contains $FILE_COUNT after* files(s)."
 fi
 
-FILE_COUNT=`$LS -Al $TESTDIR/before* 2> /dev/null \
-    | $GREP -v "total" | wc -l`
+FILE_COUNT=`ls -Al $TESTDIR/before* 2> /dev/null \
+    | grep -v "total" | wc -l`
 if (( FILE_COUNT != $COUNT )); then
-       $LS -Al $TESTDIR
+       ls -Al $TESTDIR
        log_fail "$TESTDIR contains $FILE_COUNT before* files(s)."
 fi
 
index 6f75861fd9529e6d74fd88bc94dc69a634a443f2..c5717e4526869c9d8035cfc28c45ce42561a1aa8 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -54,16 +54,16 @@ verify_runnable "both"
 function cleanup
 {
        if datasetexists $clone1; then
-               log_must $ZFS promote $ctrfs
-               log_must $ZFS destroy $clone1
+               log_must zfs promote $ctrfs
+               log_must zfs destroy $clone1
        fi
 
        snapexists $snapctr && \
-               log_must $ZFS destroy -r $snapctr
+               log_must zfs destroy -r $snapctr
 
        if snapexists $clone@$TESTSNAP1; then
-               log_must $ZFS promote $ctrfs
-               log_must $ZFS destroy -rR $ctrfs@$TESTSNAP1
+               log_must zfs promote $ctrfs
+               log_must zfs destroy -rR $ctrfs@$TESTSNAP1
        fi
 }
 
@@ -82,17 +82,17 @@ snapctrclone1=$clone1@$TESTSNAP
 snapctrfs=$SNAPCTR
 
 #preparation for testing
-log_must $ZFS snapshot $ctrfs@$TESTSNAP1
-log_must $ZFS clone $ctrfs@$TESTSNAP1 $clone
-log_must $ZFS promote $clone
+log_must zfs snapshot $ctrfs@$TESTSNAP1
+log_must zfs clone $ctrfs@$TESTSNAP1 $clone
+log_must zfs promote $clone
 
-log_must $ZFS snapshot -r $snapctr
+log_must zfs snapshot -r $snapctr
 
 ! snapexists $snapctrclone && \
        log_fail "'snapshot -r' fails to create $snapctrclone for $ctr/$TESTCLONE."
 
-log_must $ZFS clone $snapctrfs $clone1
-log_must $ZFS promote $clone1
+log_must zfs clone $snapctrfs $clone1
+log_must zfs promote $clone1
 
 #verify the origin value is correct.
 orig_value=$(get_prop origin $ctrfs)
index 65315ee2ce58e0b444d5d03f70225bcd1195390a..31aedb224515529d1720fd0dd03849ee4d1add9f 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -49,13 +49,13 @@ verify_runnable "both"
 function cleanup
 {
        datasetexists $ctrfs && \
-               $ZFS destroy -r $ctrfs
+               zfs destroy -r $ctrfs
 
        snapexists $snappool && \
-               log_must $ZFS destroy -r $snappool
+               log_must zfs destroy -r $snappool
 
        [[ -e $TESTDIR ]] && \
-               log_must $RM -rf $TESTDIR/* > /dev/null 2>&1
+               log_must rm -rf $TESTDIR/* > /dev/null 2>&1
 }
 
 log_assert "Verify snapshots from 'snapshot -r' can be used for zfs send/recv"
@@ -71,28 +71,28 @@ fsdir=/$ctrfs
 snapdir=$fsdir/.zfs/snapshot/$TESTSNAP
 
 [[ -n $TESTDIR ]] && \
-    log_must $RM -rf $TESTDIR/* > /dev/null 2>&1
+    log_must rm -rf $TESTDIR/* > /dev/null 2>&1
 
 typeset -i COUNT=10
 
 log_note "Populate the $TESTDIR directory (prior to snapshot)"
 typeset -i i=0
 while (( i < COUNT )); do
-       log_must $FILE_WRITE -o create -f $TESTDIR/file$i \
+       log_must file_write -o create -f $TESTDIR/file$i \
           -b $BLOCKSZ -c $NUM_WRITES -d $i
 
        (( i = i + 1 ))
 done
 
-log_must $ZFS snapshot -r $snappool
+log_must zfs snapshot -r $snappool
 
-$ZFS send $snapfs | $ZFS receive $ctrfs >/dev/null 2>&1
+zfs send $snapfs | zfs receive $ctrfs >/dev/null 2>&1
 if ! datasetexists $ctrfs || ! snapexists $snapctrfs; then
        log_fail "zfs send/receive fails with snapshot $snapfs."
 fi
 
 for dir in $fsdir $snapdir; do
-       FILE_COUNT=`$LS -Al $dir | $GREP -v "total" | wc -l`
+       FILE_COUNT=`ls -Al $dir | grep -v "total" | wc -l`
        (( FILE_COUNT != COUNT )) && log_fail "Got $FILE_COUNT expected $COUNT"
 done
 
index 39a8ff3a1be2ee85f216316b87e3e919b77b2a5d..3579fbebb4b86e711cb1f33852af6b3068afa13c 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -49,30 +49,30 @@ verify_runnable "both"
 function cleanup
 {
        [[ -e $TESTDIR1 ]] && \
-               log_must $RM -rf $TESTDIR1/* > /dev/null 2>&1
+               log_must rm -rf $TESTDIR1/* > /dev/null 2>&1
 
        snapexists $SNAPCTR && \
-               log_must $ZFS destroy $SNAPCTR
+               log_must zfs destroy $SNAPCTR
 
        datasetexists $TESTPOOL/$TESTCTR/$TESTFS1 && \
-               log_must $ZFS set quota=none $TESTPOOL/$TESTCTR/$TESTFS1
+               log_must zfs set quota=none $TESTPOOL/$TESTCTR/$TESTFS1
 
 }
 
 log_assert "Verify creating/destroying snapshots do things clean"
 log_onexit cleanup
 
-log_must $ZFS set quota=$FSQUOTA $TESTPOOL/$TESTCTR/$TESTFS1
-log_must $MKFILE $FILESIZE $TESTDIR1/$TESTFILE
+log_must zfs set quota=$FSQUOTA $TESTPOOL/$TESTCTR/$TESTFS1
+log_must mkfile $FILESIZE $TESTDIR1/$TESTFILE
 
-log_must $ZFS snapshot $SNAPCTR
-log_must $ZFS destroy $SNAPCTR
+log_must zfs snapshot $SNAPCTR
+log_must zfs destroy $SNAPCTR
 
 log_note "Make the quota of filesystem is reached"
-log_mustnot $MKFILE $FILESIZE1 $TESTDIR1/$TESTFILE1
+log_mustnot mkfile $FILESIZE1 $TESTDIR1/$TESTFILE1
 
 log_note "Verify removing the first file should succeed after the snapshot is \
        removed"
-log_must $RM $TESTDIR1/$TESTFILE
+log_must rm $TESTDIR1/$TESTFILE
 
 log_pass "Verify creating/destroying snapshots do things clean"
index cf819ddb9b537700d87dc760fd311a0921f35ee5..1091bcb13ea7f0d45f3bbefe23862544a3c8d3a0 100755 (executable)
@@ -27,7 +27,7 @@
 
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -54,13 +54,13 @@ function cleanup
        typeset -i i=0
        while ((i < snap_cnt)); do
                typeset snap=$fs@snap.$i
-               datasetexists $snap && log_must $ZFS destroy -f $snap
+               datasetexists $snap && log_must zfs destroy -f $snap
 
                ((i += 1))
        done
 }
 
-$ZFS 2>&1 | $GREP "allow" > /dev/null
+zfs 2>&1 | grep "allow" > /dev/null
 (($? != 0)) && log_unsupported
 
 log_assert "Verify snapshot can be created via mkdir in .zfs/snapshot."
@@ -73,10 +73,10 @@ snapdir=$mntpnt/.zfs
 set -A ro_dirs "$snapdir" "$snapdir/snap" "$snapdir/snapshot"
 for dir in ${ro_dirs[@]}; do
        if [[ -d $dir ]]; then
-               log_mustnot $RM -rf $dir
-               log_mustnot $TOUCH $dir/testfile
+               log_mustnot rm -rf $dir
+               log_mustnot touch $dir/testfile
        else
-               log_mustnot $MKDIR $dir
+               log_mustnot mkdir $dir
        fi
 done
 
@@ -85,8 +85,8 @@ typeset -i snap_cnt=5
 typeset -i cnt=0
 while ((cnt < snap_cnt)); do
        testfile=$mntpnt/testfile.$cnt
-       log_must $MKFILE 1M $testfile
-       log_must $MKDIR $snapdir/snapshot/snap.$cnt
+       log_must mkfile 1M $testfile
+       log_must mkdir $snapdir/snapshot/snap.$cnt
        if ! datasetexists $fs@snap.$cnt ; then
                log_fail "ERROR: $fs@snap.$cnt should exists."
        fi
@@ -96,7 +96,7 @@ done
 
 # Verify rollback to previous snapshot succeed.
 ((cnt = RANDOM % snap_cnt))
-log_must $ZFS rollback -r $fs@snap.$cnt
+log_must zfs rollback -r $fs@snap.$cnt
 
 typeset -i i=0
 while ((i < snap_cnt)); do
@@ -115,7 +115,7 @@ while ((i < snap_cnt)); do
 done
 
 # Verify remove directory in snapdir can destroy snapshot.
-log_must $RMDIR $snapdir/snapshot/snap.$cnt
+log_must rmdir $snapdir/snapshot/snap.$cnt
 log_mustnot datasetexists $fs@snap.$cnt
 
 log_pass "Verify snapshot can be created via mkdir in .zfs/snapshot passed."
index 9d957c70e9979ab3a7977ab97254ad57254de3a2..66bf64833150bd505183f4eb418c1fd36a076fe2 100755 (executable)
@@ -27,7 +27,7 @@
 
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,19 +48,19 @@ verify_runnable "both"
 function cleanup
 {
        datasetexists $SNAPFS && \
-               log_must $ZFS destroy -Rf $SNAPFS
+               log_must zfs destroy -Rf $SNAPFS
        datasetexists $TESTPOOL/$TESTFS@snap_a && \
-               log_must $ZFS destroy -Rf $TESTPOOL/$TESTFS@snap_a
+               log_must zfs destroy -Rf $TESTPOOL/$TESTFS@snap_a
        datasetexists $TESTPOOL/$TESTCLONE@snap_a && \
-               log_must $ZFS destroy -Rf $TESTPOOL/$TESTCLONE@snap_a
+               log_must zfs destroy -Rf $TESTPOOL/$TESTCLONE@snap_a
 
        datasetexists $TESTPOOL/$TESTCLONE && \
-               log_must $ZFS destroy $TESTPOOL/$TESTCLONE
+               log_must zfs destroy $TESTPOOL/$TESTCLONE
        datasetexists $TESTPOOL/$TESTFS && \
-               log_must $ZFS destroy $TESTPOOL/$TESTFS
+               log_must zfs destroy $TESTPOOL/$TESTFS
 
-       log_must $ZFS create $TESTPOOL/$TESTFS
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       log_must zfs create $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 }
 
 log_assert "Verify renamed snapshots via mv can be destroyed."
@@ -68,34 +68,34 @@ log_onexit cleanup
 
 # scenario 1
 
-log_must $ZFS snapshot $SNAPFS
-log_must $MV $TESTDIR/$SNAPROOT/$TESTSNAP $TESTDIR/$SNAPROOT/snap_a
+log_must zfs snapshot $SNAPFS
+log_must mv $TESTDIR/$SNAPROOT/$TESTSNAP $TESTDIR/$SNAPROOT/snap_a
 
 datasetexists $TESTPOOL/$TESTFS@snap_a || \
        log_fail "rename snapshot via mv in .zfs/snapshot fails."
-log_must $ZFS destroy $TESTPOOL/$TESTFS@snap_a
+log_must zfs destroy $TESTPOOL/$TESTFS@snap_a
 
 # scenario 2
 
-log_must $ZFS snapshot $SNAPFS
-log_must $ZFS clone $SNAPFS $TESTPOOL/$TESTCLONE
-log_must $MV $TESTDIR/$SNAPROOT/$TESTSNAP $TESTDIR/$SNAPROOT/snap_a
+log_must zfs snapshot $SNAPFS
+log_must zfs clone $SNAPFS $TESTPOOL/$TESTCLONE
+log_must mv $TESTDIR/$SNAPROOT/$TESTSNAP $TESTDIR/$SNAPROOT/snap_a
 
 datasetexists $TESTPOOL/$TESTFS@snap_a || \
         log_fail "rename snapshot via mv in .zfs/snapshot fails."
-log_must $ZFS promote $TESTPOOL/$TESTCLONE
+log_must zfs promote $TESTPOOL/$TESTCLONE
 # promote back to $TESTPOOL/$TESTFS for scenario 3
-log_must $ZFS promote $TESTPOOL/$TESTFS
-log_must $ZFS destroy $TESTPOOL/$TESTCLONE
-log_must $ZFS destroy $TESTPOOL/$TESTFS@snap_a
+log_must zfs promote $TESTPOOL/$TESTFS
+log_must zfs destroy $TESTPOOL/$TESTCLONE
+log_must zfs destroy $TESTPOOL/$TESTFS@snap_a
 
 # scenario 3
 
-log_must $ZFS snapshot $SNAPFS
-log_must $ZFS clone $SNAPFS $TESTPOOL/$TESTCLONE
-log_must $ZFS rename $SNAPFS $TESTPOOL/$TESTFS@snap_a
-log_must $ZFS promote $TESTPOOL/$TESTCLONE
-log_must $ZFS destroy $TESTPOOL/$TESTFS
-log_must $ZFS destroy $TESTPOOL/$TESTCLONE@snap_a
+log_must zfs snapshot $SNAPFS
+log_must zfs clone $SNAPFS $TESTPOOL/$TESTCLONE
+log_must zfs rename $SNAPFS $TESTPOOL/$TESTFS@snap_a
+log_must zfs promote $TESTPOOL/$TESTCLONE
+log_must zfs destroy $TESTPOOL/$TESTFS
+log_must zfs destroy $TESTPOOL/$TESTCLONE@snap_a
 
 log_pass "Verify renamed snapshots via mv can be destroyed."
index 89d89ff28396a994862d9a6ef16157b4d1a45b17..a21f8750d69706ec79f19f4b21253781dc30c7a2 100755 (executable)
@@ -27,7 +27,7 @@
 
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -57,11 +57,11 @@ function cleanup
        cd $SAVED_DIR
 
        if datasetexists $TESTPOOL/$TESTFS ; then
-               log_must $ZFS destroy -Rf $TESTPOOL/$TESTFS
+               log_must zfs destroy -Rf $TESTPOOL/$TESTFS
        fi
 
-       log_must $ZFS create $TESTPOOL/$TESTFS
-       log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+       log_must zfs create $TESTPOOL/$TESTFS
+       log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
 }
 
 function verify_structure {
@@ -145,33 +145,33 @@ SAVED_DIR=$PWD
 # ./dir1/dir2/file6
 
 cd $TESTDIR
-$MKFILE 10m file1
-$MKFILE 20m file2
-$MKDIR dir1
+mkfile 10m file1
+mkfile 20m file2
+mkdir dir1
 cd dir1
-$MKFILE 10m file3
-$MKFILE 20m file4
-$MKDIR dir2
+mkfile 10m file3
+mkfile 20m file4
+mkdir dir2
 cd dir2
-$MKFILE 10m file5
-$MKFILE 20m file6
+mkfile 10m file5
+mkfile 20m file6
 
 # Now walk the directory structure verifying it
 cd $TESTDIR
 verify_structure
 
 # Take snapshots
-log_must $ZFS snapshot $TESTPOOL/$TESTFS@snap_a
-log_must $ZFS snapshot $TESTPOOL/$TESTFS@snap_b
+log_must zfs snapshot $TESTPOOL/$TESTFS@snap_a
+log_must zfs snapshot $TESTPOOL/$TESTFS@snap_b
 
 # Change the filesystem structure by renaming files in the original structure
 # The snapshot file structure should not change
 cd $TESTDIR
-log_must $MV file2 file99
+log_must mv file2 file99
 cd dir1
-log_must $MV file4 file99
+log_must mv file4 file99
 cd dir2
-log_must $MV file6 file99
+log_must mv file6 file99
 
 # verify the top level snapshot directories
 verify_dir $TESTDIR/.zfs
index 5e3a765321a8bf0cfa3fc26f46a6edd096092c5e..d7d05bfeef1fd04c82b6dd2280fa8a2105db4ec3 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -55,7 +55,7 @@ function _check_used # dataset
 function check_used # dataset
 {
        typeset dataset=$1
-       for child in $($ZFS list -rH -t filesystem,volume -o name $dataset)
+       for child in $(zfs list -rH -t filesystem,volume -o name $dataset)
        do
                _check_used $child
        done
@@ -66,7 +66,7 @@ function check_usedbychildren # dataset
        typeset dataset=$1
        typeset -i usedbychildren_sum=0
        typeset -i parent_usedbychildren=0
-       for child in $($ZFS list -rH -t filesystem,volume -o name $dataset)
+       for child in $(zfs list -rH -t filesystem,volume -o name $dataset)
        do
                if [[ "$(get_prop type $child)" == "snapshot" ]]; then
                        continue
@@ -120,7 +120,7 @@ function _check_usedbydataset # dataset
 function check_usedbydataset # dataset
 {
        typeset dataset=$1
-       for child in $($ZFS list -rH -t filesystem,volume -o name $dataset)
+       for child in $(zfs list -rH -t filesystem,volume -o name $dataset)
        do
                _check_usedbydataset $child
        done
@@ -146,7 +146,7 @@ function _check_usedbyrefreservation # dataset
 function check_usedbyrefreservation # dataset
 {
        typeset dataset=$1
-       for child in $($ZFS list -rH -t filesystem,volume -o name $dataset)
+       for child in $(zfs list -rH -t filesystem,volume -o name $dataset)
        do
                _check_usedbyrefreservation $child
        done
@@ -157,7 +157,7 @@ function check_usedbysnapshots # dataset
        typeset dataset=$1
        typeset -i usedbysnapshots_sum=0
        typeset -i parent_usedbysnapshots=0
-       for child in $($ZFS list -rH -t filesystem,volume,snapshot -o name $dataset)
+       for child in $(zfs list -rH -t filesystem,volume,snapshot -o name $dataset)
        do
                # parent
                if [[ "$child" == "$dataset" ]]; then
index 3182dedb1793d08052037ee489ff29071eef846f..302ba40c38a32dd532c7d8f55f4b81ab5ef60cf2 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -51,13 +51,13 @@ verify_runnable "both"
 
 function cleanup
 {
-       log_must $ZFS destroy -rR $USEDTEST
+       log_must zfs destroy -rR $USEDTEST
 }
 
 log_assert "Verify used is correct."
 log_onexit cleanup
 
-log_must $ZFS create $USEDTEST
+log_must zfs create $USEDTEST
 check_used $USEDTEST
 
 typeset -i i=0
@@ -67,21 +67,21 @@ while ((i < 5)); do
        ((r_size=(i+1)*16))
 
        #usedbyrefreservation
-       log_must $ZFS set refreservation="$r_size"M $USEDTEST
+       log_must zfs set refreservation="$r_size"M $USEDTEST
 
        #usedbydataset
-       log_must $MKFILE 16M $mntpnt/file$i
+       log_must mkfile 16M $mntpnt/file$i
 
        #usedbychildren
-       log_must $ZFS create $USEDTEST/fs$i
-       log_must $MKFILE 16M $mntpnt/fs$i/file$i
+       log_must zfs create $USEDTEST/fs$i
+       log_must mkfile 16M $mntpnt/fs$i/file$i
 
        if is_global_zone; then
-               log_must $ZFS create -V 16M $USEDTEST/vol$i
+               log_must zfs create -V 16M $USEDTEST/vol$i
        fi
 
        #usedbysnapshots
-       log_must $ZFS snapshot -r $USEDTEST@snap$i
+       log_must zfs snapshot -r $USEDTEST@snap$i
 
        check_used $USEDTEST
 
index db6ac3dcb011f51142fa5fd8ed946cc2f21064e8..96d2df6c65226e6f70b2c74f3e36b0340d45e50f 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -49,13 +49,13 @@ verify_runnable "both"
 
 function cleanup
 {
-       log_must $ZFS destroy -rR $USEDTEST
+       log_must zfs destroy -rR $USEDTEST
 }
 
 log_assert "Verify usedbychildren is correct."
 log_onexit cleanup
 
-log_must $ZFS create $USEDTEST
+log_must zfs create $USEDTEST
 check_usedbychildren $USEDTEST
 
 typeset -i i=0
@@ -64,15 +64,15 @@ mntpnt=$(get_prop mountpoint $USEDTEST)
 while ((i < 5)); do
        ((r_size=(i+1)*16))
 
-       log_must $ZFS create $USEDTEST/fs$i
-       log_must $ZFS set reservation="$r_size"M $USEDTEST/fs$i
-       log_must $MKFILE 48M $mntpnt/fs$i/file$i
+       log_must zfs create $USEDTEST/fs$i
+       log_must zfs set reservation="$r_size"M $USEDTEST/fs$i
+       log_must mkfile 48M $mntpnt/fs$i/file$i
 
        if is_global_zone; then
-               log_must $ZFS create -V 32M $USEDTEST/vol$i
+               log_must zfs create -V 32M $USEDTEST/vol$i
        fi
 
-       log_must $ZFS snapshot -r $USEDTEST@snap$i
+       log_must zfs snapshot -r $USEDTEST@snap$i
 
        check_usedbychildren $USEDTEST
 
index 9dee1f3c406969b1562fc891c154218cf47a0dc5..d4726ff40cbdd76db1cdcd77efc17b99fb74af9f 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,13 +48,13 @@ verify_runnable "both"
 
 function cleanup
 {
-       log_must $ZFS destroy -rR $USEDTEST
+       log_must zfs destroy -rR $USEDTEST
 }
 
 log_assert "Verify usedbydataset is correct."
 log_onexit cleanup
 
-log_must $ZFS create $USEDTEST
+log_must zfs create $USEDTEST
 check_usedbydataset $USEDTEST
 
 typeset -i i=0
@@ -63,16 +63,16 @@ mntpnt=$(get_prop mountpoint $USEDTEST)
 while ((i < 5)); do
        ((r_size=(i+1)*16))
 
-       log_must $MKFILE 16M $mntpnt/file$i
-       log_must $MKFILE "$r_size"M $mntpnt/file_var$i
-       log_must $ZFS snapshot -r $USEDTEST@snap$i
+       log_must mkfile 16M $mntpnt/file$i
+       log_must mkfile "$r_size"M $mntpnt/file_var$i
+       log_must zfs snapshot -r $USEDTEST@snap$i
 
-       log_must $ZFS clone $USEDTEST@snap$i $USEDTEST/cln$i
-       log_must $ZFS set is:cloned=yes $USEDTEST/cln$i
+       log_must zfs clone $USEDTEST@snap$i $USEDTEST/cln$i
+       log_must zfs set is:cloned=yes $USEDTEST/cln$i
 
        mntpnt_cln=$(get_prop mountpoint $USEDTEST/cln$i)
-       log_must $MKFILE 16M $mntpnt_cln/file_cln$i
-       log_must $MKFILE "$r_size"M $mntpnt_cln/file_cln_var$i
+       log_must mkfile 16M $mntpnt_cln/file_cln$i
+       log_must mkfile "$r_size"M $mntpnt_cln/file_cln_var$i
 
        check_usedbydataset $USEDTEST
 
index 2cc4cade042d9224444a9ddfeecc122d0a1cdd98..64ca3e2b3508b329f4bf3a34716df172250e4fa8 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -53,13 +53,13 @@ verify_runnable "both"
 
 function cleanup
 {
-       log_must $ZFS destroy -rR $USEDTEST
+       log_must zfs destroy -rR $USEDTEST
 }
 
 log_assert "Verify usedbyrefreservation is correct."
 log_onexit cleanup
 
-log_must $ZFS create $USEDTEST
+log_must zfs create $USEDTEST
 check_usedbyrefreservation $USEDTEST
 
 typeset -i i=0
@@ -67,25 +67,25 @@ typeset -i r_size=0
 mntpnt=$(get_prop mountpoint $USEDTEST)
 while ((i < 5)); do
        ((r_size=(i+1)*16))
-       log_must $ZFS set refreservation="$r_size"M $USEDTEST
+       log_must zfs set refreservation="$r_size"M $USEDTEST
 
-       log_must $MKFILE 16M $mntpnt/file$i
+       log_must mkfile 16M $mntpnt/file$i
 
-       log_must $ZFS create $USEDTEST/fs$i
-       log_must $ZFS set refreservation="$r_size"M $USEDTEST/fs$i
-       log_must $MKFILE 16M $mntpnt/fs$i/file$i
+       log_must zfs create $USEDTEST/fs$i
+       log_must zfs set refreservation="$r_size"M $USEDTEST/fs$i
+       log_must mkfile 16M $mntpnt/fs$i/file$i
 
        if is_global_zone; then
-               log_must $ZFS create -V 16M $USEDTEST/vol$i
+               log_must zfs create -V 16M $USEDTEST/vol$i
        fi
 
-       log_must $ZFS snapshot -r $USEDTEST@snap$i
+       log_must zfs snapshot -r $USEDTEST@snap$i
 
-       log_must $ZFS clone $USEDTEST@snap$i $USEDTEST/cln$i
+       log_must zfs clone $USEDTEST@snap$i $USEDTEST/cln$i
 
        mntpnt_cln=$(get_prop mountpoint $USEDTEST/cln$i)
-       log_must $ZFS set refreservation="$r_size"M $USEDTEST/cln$i
-       log_must $MKFILE 16M $mntpnt_cln/file_cln$i
+       log_must zfs set refreservation="$r_size"M $USEDTEST/cln$i
+       log_must mkfile 16M $mntpnt_cln/file_cln$i
 
        check_usedbyrefreservation $USEDTEST
 
index f4099c84ef9d11c9b2d98ab69cd2072d8e9f6c53..ac5224caf6dcd8d4c0dc6216363179dbd00b4854 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,13 +47,13 @@ verify_runnable "both"
 
 function cleanup
 {
-       log_must $ZFS destroy -rR $USEDTEST
+       log_must zfs destroy -rR $USEDTEST
 }
 
 log_assert "Verify usedbysnapshots is correct."
 log_onexit cleanup
 
-log_must $ZFS create $USEDTEST
+log_must zfs create $USEDTEST
 check_usedbysnapshots $USEDTEST
 
 typeset -i i=0
@@ -62,9 +62,9 @@ mntpnt=$(get_prop mountpoint $USEDTEST)
 while ((i < 5)); do
        ((r_size=(i+1)*16))
 
-       log_must $MKFILE "$r_size"M $mntpnt/file$i
+       log_must mkfile "$r_size"M $mntpnt/file$i
 
-       log_must $ZFS snapshot $USEDTEST@snap$i
+       log_must zfs snapshot $USEDTEST@snap$i
        check_usedbysnapshots $USEDTEST
 
         ((i = i + 1))
index a01677d9117723e26397f5be0eb42d27eb14b159..0fc669148aa18a5bd82436402e624799115c470b 100644 (file)
@@ -39,5 +39,5 @@ export HOLES_COUNT=${HOLES_COUNT-"16384"}        # FILESIZE/BLKSIZE/8
 export STF_TIMEOUT=3600
 
 export DISKSARRAY=$DISKS
-export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
+export DISK_ARRAY_NUM=$(echo ${DISKS} | nawk '{print NF}')
 set_device_dir
index 0672b81ca988fb6db10f64df70a156b9e8f2bf21..f44de5ad8a6e44ee7fb327a969d4d34d21a96641 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,7 +52,7 @@ fi
 
 function cleanup
 {
-       [[ -e $TESTDIR ]] && log_must $RM -rf $TESTDIR/*
+       [[ -e $TESTDIR ]] && log_must rm -rf $TESTDIR/*
 }
 
 log_assert "Ensure random blocks are read back correctly"
@@ -76,8 +76,8 @@ options="$options -r "
 
 [[ -n "$options" ]] && options_display=$options
 
-log_note "Invoking $FILE_TRUNC with: $options_display"
-log_must $FILE_TRUNC $options $TESTDIR/$TESTFILE
+log_note "Invoking file_trunc with: $options_display"
+log_must file_trunc $options $TESTDIR/$TESTFILE
 
 typeset dir=$(get_device_dir $DISKS)
 verify_filesys "$TESTPOOL" "$TESTPOOL/$TESTFS" "$dir"
index e370af4c8b9976257cc9c64f699918eeefe06bef..b3e99d8611a5448fb043e79118978f6f4b6901c4 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -72,7 +72,7 @@ log_must $THREADSAPPEND ${TESTDIR}/${TESTFILE}
 #
 # Check the size of the resulting file
 #
-SIZE=`$LS -l ${TESTDIR}/${TESTFILE} | $AWK '{print $5}'`
+SIZE=`ls -l ${TESTDIR}/${TESTFILE} | awk '{print $5}'`
 if [[ $SIZE -ne $FILE_SIZE ]]; then
        log_fail "'The length of ${TESTDIR}/${TESTFILE}' doesn't equal 1310720."
 fi
index e9449daff0bbda70ffe4e3ef81bb5001b2b58d90..13cdafab133ba67ce45954fda78e3bc965c8bf2d 100644 (file)
@@ -34,6 +34,6 @@ export TRUNC_FILEOFFSET=${TRUNC_FILEOFFSET-""}
 export TRUNC_COUNT=${TRUNC_COUNT-"16384"}         # FILESIZE/BLKSIZE/8
 
 export DISKSARRAY=$DISKS
-export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
+export DISK_ARRAY_NUM=$(echo ${DISKS} | nawk '{print NF}')
 
 set_device_dir
index c6c8d2b6830ff73cc64c4dfc2fd18ddc31c66652..24a0e4e94bf6b77d0f874f2b28cdb0a9ffd5838c 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/truncate/truncate.cfg
 . $STF_SUITE/include/libtest.shlib
 
@@ -49,7 +53,7 @@ fi
 
 function cleanup
 {
-       [[ -e $TESTDIR ]] && log_must $RM -rf $TESTDIR/*
+       [[ -e $TESTDIR ]] && log_must rm -rf $TESTDIR/*
 }
 
 log_assert "Ensure file with random blocks is truncated properly"
@@ -71,8 +75,8 @@ log_onexit cleanup
 
 [[ -n "$options" ]] && options_display=$options
 
-log_note "Invoking $FILE_TRUNC with: $options_display"
-log_must $FILE_TRUNC $options $TESTDIR/$TESTFILE
+log_note "Invoking file_trunc with: $options_display"
+log_must file_trunc $options $TESTDIR/$TESTFILE
 
 typeset dir=$(get_device_dir $DISKS)
 verify_filesys "$TESTPOOL" "$TESTPOOL/$TESTFS" "$dir"
index fe9584a655b245d466a23145842904152360e983..9708b818e68f32c129715c890b550956e9677850 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/tests/functional/truncate/truncate.cfg
 . $STF_SUITE/include/libtest.shlib
 
@@ -42,21 +46,21 @@ verify_runnable "both"
 
 function cleanup
 {
-       [[ -e $TESTDIR ]] && log_must $RM -rf $TESTDIR/*
-       [[ -f $srcfile ]] && $RM -f $srcfile
+       [[ -e $TESTDIR ]] && log_must rm -rf $TESTDIR/*
+       [[ -f $srcfile ]] && rm -f $srcfile
 }
 
 log_assert "Ensure zeroed file gets written correctly during a sync operation"
 
 srcfile="/tmp/cosmo.$$"
-log_must $DD if=/dev/urandom of=$srcfile bs=1024k count=1
+log_must dd if=/dev/urandom of=$srcfile bs=1024k count=1
 
 log_onexit cleanup
-log_must $CP $srcfile $TESTDIR/$TESTFILE
-log_must $CP /dev/null $TESTDIR/$TESTFILE
-log_must $SYNC
+log_must cp $srcfile $TESTDIR/$TESTFILE
+log_must cp /dev/null $TESTDIR/$TESTFILE
+log_must sync
 if [[ -s $TESTDIR/$TESTFILE ]]; then
-       log_note "$($LS -l $TESTDIR/$TESTFILE)"
+       log_note "$(ls -l $TESTDIR/$TESTFILE)"
        log_fail "testfile not truncated"
 fi
 
index 6b0eb9d9a5a2a3c1865466c4ba7a1dbd9f3eed89..19f4de24a9bef4e27948121b2a7228a16cee5e7e 100755 (executable)
@@ -37,8 +37,8 @@
 
 verify_runnable "global"
 
-log_must $ZPOOL destroy $TESTPOOL
+log_must zpool destroy $TESTPOOL
 
-log_must $RM /tmp/zpool_upgrade_test.dat
+log_must rm /tmp/zpool_upgrade_test.dat
 
 default_cleanup
index 57b483581a5ea601a652c71ef3fda2d57618db28..c3b89b3047dfdf4df03fb863f85077d06174bd2d 100755 (executable)
@@ -38,7 +38,7 @@
 verify_runnable "global"
 
 # create a pool without any features
-log_must $MKFILE 128m /tmp/zpool_upgrade_test.dat
-log_must $ZPOOL create -d -m $TESTDIR $TESTPOOL /tmp/zpool_upgrade_test.dat
+log_must mkfile 128m /tmp/zpool_upgrade_test.dat
+log_must zpool create -d -m $TESTDIR $TESTPOOL /tmp/zpool_upgrade_test.dat
 
 log_pass
index 49087f5a19cbc50cb9f1f0c435413db53c471919..49b6d18220a89b22863d43496a81b8d21b6a9dce 100755 (executable)
@@ -42,8 +42,8 @@
 
 function cleanup
 {
-       datasetexists $TESTPOOL/fs1 && log_must $ZFS destroy $TESTPOOL/fs1
-       datasetexists $TESTPOOL/fs2 && log_must $ZFS destroy $TESTPOOL/fs2
+       datasetexists $TESTPOOL/fs1 && log_must zfs destroy $TESTPOOL/fs1
+       datasetexists $TESTPOOL/fs2 && log_must zfs destroy $TESTPOOL/fs2
 }
 
 verify_runnable "global"
@@ -51,48 +51,48 @@ verify_runnable "global"
 log_assert "pool upgrade for userobj accounting should work"
 log_onexit cleanup
 
-log_must $MKFILES $TESTDIR/tf $((RANDOM % 1000 + 1))
-log_must $ZFS create $TESTPOOL/fs1
-log_must $MKFILES $TESTDIR/fs1/tf $((RANDOM % 1000 + 1))
-log_must $ZFS create $TESTPOOL/fs2
-log_must $MKFILES $TESTDIR/fs2/tf $((RANDOM % 1000 + 1))
-log_must $ZFS umount $TESTPOOL/fs2
+log_must mkfiles $TESTDIR/tf $((RANDOM % 1000 + 1))
+log_must zfs create $TESTPOOL/fs1
+log_must mkfiles $TESTDIR/fs1/tf $((RANDOM % 1000 + 1))
+log_must zfs create $TESTPOOL/fs2
+log_must mkfiles $TESTDIR/fs2/tf $((RANDOM % 1000 + 1))
+log_must zfs umount $TESTPOOL/fs2
 
 # Make sure userobj accounting is disabled
-$ZFS userspace -o objused -H $TESTPOOL | $HEAD -n 1 | $GREP -q "-" ||
+zfs userspace -o objused -H $TESTPOOL | head -n 1 | grep -q "-" ||
        log_fail "userobj accounting should be disabled initially"
 
 # Upgrade zpool to support all features
-log_must $ZPOOL upgrade $TESTPOOL
+log_must zpool upgrade $TESTPOOL
 
 # Make sure userobj accounting is disabled again
-$ZFS userspace -o objused -H $TESTPOOL | $HEAD -n 1 | $GREP -q "-" ||
+zfs userspace -o objused -H $TESTPOOL | head -n 1 | grep -q "-" ||
        log_fail "userobj accounting should be disabled after pool upgrade"
 
 # Create a file in fs1 should trigger dataset upgrade
-log_must $MKFILE 1m $TESTDIR/fs1/tf
+log_must mkfile 1m $TESTDIR/fs1/tf
 sync_pool
 
 # Make sure userobj accounting is working for fs1
-$ZFS userspace -o objused -H $TESTPOOL/fs1 | $HEAD -n 1 | $GREP -q "-" &&
+zfs userspace -o objused -H $TESTPOOL/fs1 | head -n 1 | grep -q "-" &&
        log_fail "userobj accounting should be enabled for $TESTPOOL/fs1"
 
 # Mount a dataset should trigger upgrade
-log_must $ZFS mount $TESTPOOL/fs2
+log_must zfs mount $TESTPOOL/fs2
 sync_pool
 
 # Make sure userobj accounting is working for fs2
-$ZFS userspace -o objused -H $TESTPOOL/fs2 | $HEAD -n 1 | $GREP -q "-" &&
+zfs userspace -o objused -H $TESTPOOL/fs2 | head -n 1 | grep -q "-" &&
        log_fail "userobj accounting should be enabled for $TESTPOOL/fs2"
 
 # All in all, after having been through this, the dataset for testpool
 # still shouldn't be upgraded
-$ZFS userspace -o objused -H $TESTPOOL | $HEAD -n 1 | $GREP -q "-" ||
+zfs userspace -o objused -H $TESTPOOL | head -n 1 | grep -q "-" ||
        log_fail "userobj accounting should be disabled for $TESTPOOL"
 
 # Manual upgrade root dataset
-log_must $ZFS set version=current $TESTPOOL
-$ZFS userspace -o objused -H $TESTPOOL | $HEAD -n 1 | $GREP -q "-" &&
+log_must zfs set version=current $TESTPOOL
+zfs userspace -o objused -H $TESTPOOL | head -n 1 | grep -q "-" &&
        log_fail "userobj accounting should be enabled for $TESTPOOL"
 
 log_pass "all tests passed - what a lucky day!"
index 5931acb92bb8027cb994fdaa9c5f7be01df7de72..5c8229b1874ff64e36400921ca27734f3ea2d6d2 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -36,6 +36,6 @@ log_must cleanup_quota
 log_must clean_user_group
 
 typeset mntp=$(get_prop mountpoint $QFS)
-log_must $CHMOD 0755 $mntp
+chmod 0755 $mntp
 
 default_cleanup
index 800285e074b0ebe9a8732205f4be2d7bc193f0a6..fb7a19057acf416379fbac3dd5f64605dd929568 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -46,7 +46,7 @@
 function cleanup
 {
        if datasetexists $snap_fs; then
-               log_must $ZFS destroy $snap_fs
+               log_must zfs destroy $snap_fs
        fi
 
        log_must cleanup_quota
@@ -63,17 +63,17 @@ set -A params -- "-n" "-H" "-p" "-o type,name,used,quota" \
 
 typeset snap_fs=$QFS@snap
 
-log_must $ZFS set groupquota@$QGROUP=500m $QFS
+log_must zfs set groupquota@$QGROUP=500m $QFS
 mkmount_writable $QFS
-log_must user_run $QUSER1 $MKFILE 50m $QFILE
+log_must user_run $QUSER1 mkfile 50m $QFILE
 
-$SYNC
+sync
 
-log_must $ZFS snapshot $snap_fs
+log_must zfs snapshot $snap_fs
 
 for param in "${params[@]}"; do
-       log_must eval "$ZFS groupspace $param $QFS >/dev/null 2>&1"
-       log_must eval "$ZFS groupspace $param $snap_fs >/dev/null 2>&1"
+       log_must eval "zfs groupspace $param $QFS >/dev/null 2>&1"
+       log_must eval "zfs groupspace $param $snap_fs >/dev/null 2>&1"
 done
 
 log_pass "Check the zfs groupspace with all possible parameters"
index 92d8dd942b38b5de31793d0de30b392b2ad3e1e4..20d0f7319df13c064a10822589bd0914f4508081 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -46,7 +46,7 @@
 function cleanup
 {
        if datasetexists $snapfs; then
-               log_must $ZFS destroy $snapfs
+               log_must zfs destroy $snapfs
        fi
        log_must cleanup_quota
 }
@@ -55,25 +55,25 @@ log_onexit cleanup
 
 log_assert "Check the zfs groupspace used and quota"
 
-log_must $ZFS set groupquota@$QGROUP=500m $QFS
+log_must zfs set groupquota@$QGROUP=500m $QFS
 mkmount_writable $QFS
-log_must user_run $QUSER1 $MKFILE 100m $QFILE
+log_must user_run $QUSER1 mkfile 100m $QFILE
 
-$SYNC
+sync
 
 typeset snapfs=$QFS@snap
 
-log_must $ZFS snapshot $snapfs
+log_must zfs snapshot $snapfs
 
-log_must eval "$ZFS groupspace $QFS >/dev/null 2>&1"
-log_must eval "$ZFS groupspace $snapfs >/dev/null 2>&1"
+log_must eval "zfs groupspace $QFS >/dev/null 2>&1"
+log_must eval "zfs groupspace $snapfs >/dev/null 2>&1"
 
 for fs in "$QFS" "$snapfs"; do
        log_note "check the quota size in zfs groupspace $fs"
-       log_must eval "$ZFS groupspace $fs | $GREP $QGROUP | $GREP 500M"
+       log_must eval "zfs groupspace $fs | grep $QGROUP | grep 500M"
 
        log_note "check the user used size in zfs groupspace $fs"
-       log_must eval "$ZFS groupspace $fs | $GREP $QGROUP | $GREP 100M"
+       log_must eval "zfs groupspace $fs | grep $QGROUP | grep 100M"
 done
 
 log_pass "Check the zfs groupspace used and quota pass as expect"
index 7ea8cd56326e4e9e556bcfcb2572d8e155d92e40..5f5965b648c53a60424b5d22928916554b893d31 100755 (executable)
 function cleanup
 {
        if datasetexists $snapfs; then
-               log_must $ZFS destroy $snapfs
+               log_must zfs destroy $snapfs
        fi
 
-       log_must $RM -f ${QFILE}_*
+       log_must rm -f ${QFILE}_*
        log_must cleanup_quota
 }
 
@@ -57,8 +57,8 @@ function group_object_count
 {
        typeset fs=$1
        typeset user=$2
-       typeset cnt=$($ZFS groupspace -oname,objused $fs | $GREP $user |
-                       $AWK '{print $2}')
+       typeset cnt=$(zfs groupspace -oname,objused $fs | grep $user |
+                       awk '{print $2}')
        echo $cnt
 }
 
@@ -67,21 +67,21 @@ log_onexit cleanup
 log_assert "Check the zfs groupspace object used"
 
 mkmount_writable $QFS
-log_must $ZFS set xattr=sa $QFS
+log_must zfs set xattr=sa $QFS
 
 ((user1_cnt = RANDOM % 100 + 1))
 ((user2_cnt = RANDOM % 100 + 1))
-log_must user_run $QUSER1 $MKFILES ${QFILE}_1 $user1_cnt
-log_must user_run $QUSER2 $MKFILES ${QFILE}_2 $user2_cnt
+log_must user_run $QUSER1 mkfiles ${QFILE}_1 $user1_cnt
+log_must user_run $QUSER2 mkfiles ${QFILE}_2 $user2_cnt
 ((grp_cnt = user1_cnt + user2_cnt))
 sync_pool
 
 typeset snapfs=$QFS@snap
 
-log_must $ZFS snapshot $snapfs
+log_must zfs snapshot $snapfs
 
-log_must eval "$ZFS groupspace $QFS >/dev/null 2>&1"
-log_must eval "$ZFS groupspace $snapfs >/dev/null 2>&1"
+log_must eval "zfs groupspace $QFS >/dev/null 2>&1"
+log_must eval "zfs groupspace $snapfs >/dev/null 2>&1"
 
 for fs in "$QFS" "$snapfs"; do
        log_note "check the object count in zfs groupspace $fs"
@@ -90,7 +90,7 @@ for fs in "$QFS" "$snapfs"; do
 done
 
 log_note "file removal"
-log_must $RM ${QFILE}_*
+log_must rm ${QFILE}_*
 sync_pool
 
 [[ $(group_object_count $QFS $QGROUP) -eq 0 ]] ||
index 1c27075a10c37f356bdb9dd92bef88243021d64e..d4b3cdcaba9220604e5cda5839a494541ce99e93 100755 (executable)
@@ -40,5 +40,17 @@ log_must add_group $QGROUP
 log_must add_user $QGROUP $QUSER1
 log_must add_user $QGROUP $QUSER2
 
+#
+# Verify the test user can execute the zfs utilities.  This may not
+# be possible due to default permissions on the user home directory.
+# This can be resolved granting group read access.
+#
+# chmod 0750 $HOME
+#
+user_run $QUSER1 zfs list
+if [ $? -ne 0 ]; then
+       log_unsupported "Test user $QUSER1 cannot execute zfs utilities"
+fi
+
 DISK=${DISKS%% *}
 default_setup $DISK
index 7a4f8f3ba575c77fb1bee9bbb4ac2be8696e8b09..dd8f6d3552bb27f04cd5dcb15ec2398a5ebc1b7f 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/userquota/userquota_common.kshlib
@@ -56,18 +56,18 @@ log_assert "If write operation overwrite {user|group}quota size, it will fail"
 
 mkmount_writable $QFS
 log_note "Check the userquota@$QUSER1"
-log_must $ZFS set userquota@$QUSER1=$UQUOTA_SIZE $QFS
-log_must user_run $QUSER1 $MKFILE $UQUOTA_SIZE $QFILE
+log_must zfs set userquota@$QUSER1=$UQUOTA_SIZE $QFS
+log_must user_run $QUSER1 mkfile $UQUOTA_SIZE $QFILE
 sync_pool
-log_mustnot user_run $QUSER1 $MKFILE 1 $OFILE
+log_mustnot user_run $QUSER1 mkfile 1 $OFILE
 cleanup_quota
 
 log_note "Check the groupquota@$QGROUP"
-log_must $ZFS set groupquota@$QGROUP=$GQUOTA_SIZE $QFS
+log_must zfs set groupquota@$QGROUP=$GQUOTA_SIZE $QFS
 mkmount_writable $QFS
-log_must user_run $QUSER1 $MKFILE $GQUOTA_SIZE $QFILE
+log_must user_run $QUSER1 mkfile $GQUOTA_SIZE $QFILE
 sync_pool
-log_mustnot user_run $QUSER1 $MKFILE 1 $OFILE
+log_mustnot user_run $QUSER1 mkfile 1 $OFILE
 
 cleanup_quota
 
index aa52c1d12bab5ad309704782fdc076e04e6b8833..64066ea8e3d2e16d283495f2269dadddeae91912 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -46,11 +46,11 @@ verify_runnable "global"
 function cleanup
 {
        if poolexists $TESTPOOL1; then
-               log_must $ZPOOL destroy $TESTPOOL1
+               log_must zpool destroy $TESTPOOL1
        fi
 
        if [[ -f $pool_vdev ]]; then
-               $RM -f $pool_vdev
+               rm -f $pool_vdev
        fi
 }
 
@@ -61,25 +61,25 @@ log_assert \
 
 typeset pool_vdev=/var/tmp/pool_dev.$$
 
-log_must $MKFILE 500m $pool_vdev
+log_must mkfile 500m $pool_vdev
 
 if poolexists $TESTPOOL1; then
-       $ZPOOL destroy $TESTPOOL1
+       zpool destroy $TESTPOOL1
 fi
 
-log_must $ZPOOL create -O userquota@$QUSER1=$UQUOTA_SIZE \
+log_must zpool create -O userquota@$QUSER1=$UQUOTA_SIZE \
        -O groupquota@$QGROUP=$GQUOTA_SIZE $TESTPOOL1 $pool_vdev
 
-log_must eval "$ZFS list -r -o userquota@$QUSER1,groupquota@$QGROUP \
+log_must eval "zfs list -r -o userquota@$QUSER1,groupquota@$QGROUP \
        $TESTPOOL1 > /dev/null 2>&1"
 
 log_must check_quota "userquota@$QUSER1" $TESTPOOL1 "$UQUOTA_SIZE"
 log_must check_quota "groupquota@$QGROUP" $TESTPOOL1 "$GQUOTA_SIZE"
 
-log_must $ZFS create -o userquota@$QUSER1=$UQUOTA_SIZE \
+log_must zfs create -o userquota@$QUSER1=$UQUOTA_SIZE \
        -o groupquota@$QGROUP=$GQUOTA_SIZE $TESTPOOL1/fs
 
-log_must eval "$ZFS list -r -o userquota@$QUSER1,groupquota@$QGROUP \
+log_must eval "zfs list -r -o userquota@$QUSER1,groupquota@$QGROUP \
        $TESTPOOL1 > /dev/null 2>&1"
 
 log_must check_quota "userquota@$QUSER1" $TESTPOOL1/fs "$UQUOTA_SIZE"
index 40903db384e0df0727e2c7d4ec4e517de6f72524..c4ac15c0dfe4618f53746071a44955c5d8343229 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,10 +52,10 @@ log_onexit cleanup
 log_assert "Check the basic function of set/get userquota and groupquota on fs"
 
 log_note "Check the set|get userquota@$QUSER1 and groupquota@QGROUP"
-log_must $ZFS set userquota@$QUSER1=$UQUOTA_SIZE $QFS
+log_must zfs set userquota@$QUSER1=$UQUOTA_SIZE $QFS
 log_must check_quota "userquota@$QUSER1" $QFS "$UQUOTA_SIZE"
 
-log_must $ZFS set groupquota@$QGROUP=$GQUOTA_SIZE $QFS
+log_must zfs set groupquota@$QGROUP=$GQUOTA_SIZE $QFS
 log_must check_quota "groupquota@$QGROUP" $QFS "$GQUOTA_SIZE"
 
 log_pass "Check the basic function of set/get userquota on fs passed as expect"
index 74906326171dafebff6b6032949ebbaa1122fc4a..36433fa299631c514a536d46027cd0f3d1d59c65 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -62,7 +62,7 @@ if [[ $group_used != 0 ]]; then
 fi
 
 mkmount_writable $QFS
-log_must user_run $QUSER1 $MKFILE 100m $QFILE
+log_must user_run $QUSER1 mkfile 100m $QFILE
 sync_pool
 
 user_used=$(get_value "userused@$QUSER1" $QFS)
index 1b405fb0decd9c187ae5ad854239ccacf4784bf0..825ebe09b28bc33418c999288e6a86715c94b2c3 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,7 +45,7 @@
 function cleanup
 {
        if datasetexists $snap_fs; then
-               log_must $ZFS destroy $snap_fs
+               log_must zfs destroy $snap_fs
        fi
 
        log_must cleanup_quota
@@ -56,39 +56,39 @@ log_onexit cleanup
 log_assert "Check the invalid parameter of zfs set user|group quota"
 typeset snap_fs=$QFS@snap
 
-log_must $ZFS snapshot $snap_fs
+log_must zfs snapshot $snap_fs
 
 set -A no_users "mms1234" "ss@#" "root-122"
 for user in "${no_users[@]}"; do
-       log_mustnot $ID $user
-       log_mustnot $ZFS set userquota@$user=100m $QFS
+       log_mustnot id $user
+       log_mustnot zfs set userquota@$user=100m $QFS
 done
 
 log_note "can set all numberic id even that id is not existed"
-log_must $ZFS set userquota@12345678=100m $QFS
-log_mustnot $ZFS set userquota@12345678=100m $snap_fs
+log_must zfs set userquota@12345678=100m $QFS
+log_mustnot zfs set userquota@12345678=100m $snap_fs
 
 set -A sizes "100mfsd" "m0.12m" "GGM" "-1234-m" "123m-m"
 
 for size in "${sizes[@]}"; do
        log_note "can not set user quota with invalid size parameter"
-       log_mustnot $ZFS set userquota@root=$size $QFS
+       log_mustnot zfs set userquota@root=$size $QFS
 done
 
 log_note "can not set user quota to snapshot $snap_fs"
-log_mustnot $ZFS set userquota@root=100m $snap_fs
+log_mustnot zfs set userquota@root=100m $snap_fs
 
 
 set -A no_groups "aidsf@dfsd@" "123223-dsfds#sdfsd" "mss_#ss" "@@@@"
 for group in "${no_groups[@]}"; do
-       log_mustnot eval "$GREP $group /etc/group"
-       log_mustnot $ZFS set groupquota@$group=100m $QFS
+       log_mustnot eval "grep $group /etc/group"
+       log_mustnot zfs set groupquota@$group=100m $QFS
 done
 
 log_note "can not set group quota with invalid size parameter"
-log_mustnot $ZFS set groupquota@root=100msfsd $QFS
+log_mustnot zfs set groupquota@root=100msfsd $QFS
 
 log_note "can not set group quota to snapshot $snap_fs"
-log_mustnot $ZFS set groupquota@root=100m $snap_fs
+log_mustnot zfs set groupquota@root=100m $snap_fs
 
 log_pass "Check the invalid parameter of zfs set user|group quota pas as expect"
index 92b4f830b458c1931bc6329c011c6dbbc8f701f2..c53cb5f1e72b47ed3729eb954a2b210f8dae103a 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,7 +45,7 @@
 function cleanup
 {
        if datasetexists $snap_fs; then
-               log_must $ZFS destroy $snap_fs
+               log_must zfs destroy $snap_fs
        fi
 
        log_must cleanup_quota
@@ -56,20 +56,20 @@ log_onexit cleanup
 log_assert "Check the invalid parameter of zfs get user|group quota"
 typeset snap_fs=$QFS@snap
 
-log_must $ZFS snapshot $snap_fs
+log_must zfs snapshot $snap_fs
 
 set -A no_users "mms1234" "ss@#" "root-122" "1234"
 for user in "${no_users[@]}"; do
-       log_mustnot eval "$ID $user >/dev/null 2>&1"
-       log_must eval "$ZFS get userquota@$user $QFS >/dev/null 2>&1"
-       log_must eval "$ZFS get userquota@$user $snap_fs >/dev/null 2>&1"
+       log_mustnot eval "id $user >/dev/null 2>&1"
+       log_must eval "zfs get userquota@$user $QFS >/dev/null 2>&1"
+       log_must eval "zfs get userquota@$user $snap_fs >/dev/null 2>&1"
 done
 
 set -A no_groups "aidsf@dfsd@" "123223-dsfds#sdfsd" "mss_#ss" "1234"
 for group in "${no_groups[@]}"; do
-       log_mustnot eval "$GROUPDEL $group > /dev/null 2>&1"
-       log_must eval "$ZFS get groupquota@$group $QFS >/dev/null 2>&1"
-       log_must eval "$ZFS get groupquota@$group $snap_fs >/dev/null 2>&1"
+       log_mustnot eval "groupdel $group > /dev/null 2>&1"
+       log_must eval "zfs get groupquota@$group $QFS >/dev/null 2>&1"
+       log_must eval "zfs get groupquota@$group $snap_fs >/dev/null 2>&1"
 done
 
 log_pass "Check the invalid parameter of zfs get user|group quota pass as expect"
index ec9158d1f462e25d9824f4cf5e93545432cef99b..1dea4006618c15b8f584f11359a0c6ec938e35dc 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 function cleanup
 {
        log_must cleanup_quota
-       log_must $ZFS set quota=none $QFS
+       log_must zfs set quota=none $QFS
 }
 
 log_onexit cleanup
 
 log_assert "Check set user|group quota to larger than the quota size of a fs"
 
-log_must $ZFS set quota=200m $QFS
-log_must $ZFS set userquota@$QUSER1=500m $QFS
-log_must $ZFS set groupquota@$QGROUP=600m $QFS
+log_must zfs set quota=200m $QFS
+log_must zfs set userquota@$QUSER1=500m $QFS
+log_must zfs set groupquota@$QGROUP=600m $QFS
 
-log_must $ZFS get userquota@$QUSER1 $QFS
-log_must $ZFS get groupquota@$QGROUP $QFS
+log_must zfs get userquota@$QUSER1 $QFS
+log_must zfs get groupquota@$QGROUP $QFS
 
 log_note "write some data to the $QFS"
 mkmount_writable $QFS
-log_must user_run $QUSER1 $MKFILE 100m $QFILE
-$SYNC
+log_must user_run $QUSER1 mkfile 100m $QFILE
+sync
 
 log_note "set user|group quota at a smaller size than it current usage"
-log_must $ZFS set userquota@$QUSER1=90m $QFS
-log_must $ZFS set groupquota@$QGROUP=90m $QFS
+log_must zfs set userquota@$QUSER1=90m $QFS
+log_must zfs set groupquota@$QGROUP=90m $QFS
 
-log_must $ZFS get userquota@$QUSER1 $QFS
-log_must $ZFS get groupquota@$QGROUP $QFS
+log_must zfs get userquota@$QUSER1 $QFS
+log_must zfs get groupquota@$QGROUP $QFS
 
 log_pass "set user|group quota to larger than quota size of a fs pass as expect"
index 23ea1171aeccc5405ae33c2883e3653ba7ce4386..c9404cd2868f2603d1464a72d97d9b966f6ce22b 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -51,10 +51,10 @@ log_onexit cleanup
 
 log_assert "Check zfs get all will not print out user|group quota"
 
-log_must $ZFS set userquota@$QUSER1=50m $QFS
-log_must $ZFS set groupquota@$QGROUP=100m $QFS
+log_must zfs set userquota@$QUSER1=50m $QFS
+log_must zfs set groupquota@$QGROUP=100m $QFS
 
-log_mustnot $ZFS get all $QFS | $GREP userquota
-log_mustnot $ZFS get all $QFS | $GREP groupquota
+log_mustnot zfs get all $QFS | grep userquota
+log_mustnot zfs get all $QFS | grep groupquota
 
 log_pass "zfs get all will not print out user|group quota"
index 18c0de86374a67c51244d43b0c46137d50df147d..1c0fdde3fa46e0cc8c6d6a066fa7199f06e1124a 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -50,7 +50,7 @@
 function cleanup
 {
        if datasetexists $snap_fs; then
-               log_must $ZFS destroy $snap_fs
+               log_must zfs destroy $snap_fs
        fi
 
        log_must cleanup_quota
@@ -62,25 +62,25 @@ log_assert "Check the snapshot's user|group quota"
 typeset snap_fs=$QFS@snap
 
 
-log_must $ZFS set userquota@$QUSER1=$UQUOTA_SIZE $QFS
+log_must zfs set userquota@$QUSER1=$UQUOTA_SIZE $QFS
 log_must check_quota "userquota@$QUSER1" $QFS "$UQUOTA_SIZE"
 
-log_must $ZFS set groupquota@$QGROUP=$GQUOTA_SIZE $QFS
+log_must zfs set groupquota@$QGROUP=$GQUOTA_SIZE $QFS
 log_must check_quota "groupquota@$QGROUP" $QFS "$GQUOTA_SIZE"
 
-log_must $ZFS snapshot $snap_fs
+log_must zfs snapshot $snap_fs
 
 log_note "check the snapshot $snap_fs user|group quota"
 log_must check_quota "userquota@$QUSER1" $snap_fs "$UQUOTA_SIZE"
 log_must check_quota "groupquota@$QGROUP" $snap_fs "$GQUOTA_SIZE"
 
 log_note  "set userquota and groupquota to $snap_fs which will fail"
-log_mustnot $ZFS set userquota@$QUSER1=$SNAP_QUOTA $snap_fs
-log_mustnot $ZFS set groupquota@$QGROUP=$SNAP_QUOTA $snap_fs
+log_mustnot zfs set userquota@$QUSER1=$SNAP_QUOTA $snap_fs
+log_mustnot zfs set groupquota@$QGROUP=$SNAP_QUOTA $snap_fs
 
 log_note "change the parent's userquota and groupquota"
-log_must $ZFS set userquota@$QUSER1=$TEST_QUOTA $QFS
-log_must $ZFS set groupquota@$QGROUP=$TEST_QUOTA $QFS
+log_must zfs set userquota@$QUSER1=$TEST_QUOTA $QFS
+log_must zfs set groupquota@$QGROUP=$TEST_QUOTA $QFS
 
 log_must check_quota "userquota@$QUSER1" $QFS $TEST_QUOTA
 log_must check_quota "groupquota@$QGROUP" $QFS $TEST_QUOTA
index 7f7f9672ddf3817c022b4a7e357846ad407b3dd4..08af6560dc87ad33fa380814954767e8160b6145 100755 (executable)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,24 +52,24 @@ log_onexit cleanup
 log_assert "overwrite any of the {user|group}quota size, it will fail"
 
 log_note "overwrite to $QFS to make it exceed userquota"
-log_must $ZFS set userquota@$QUSER1=$UQUOTA_SIZE $QFS
-log_must $ZFS set groupquota@$QGROUP=$GQUOTA_SIZE $QFS
+log_must zfs set userquota@$QUSER1=$UQUOTA_SIZE $QFS
+log_must zfs set groupquota@$QGROUP=$GQUOTA_SIZE $QFS
 
 mkmount_writable $QFS
-log_must user_run $QUSER1 $MKFILE $UQUOTA_SIZE $QFILE
+log_must user_run $QUSER1 mkfile $UQUOTA_SIZE $QFILE
 sync_pool
 
-log_must eval "$ZFS get -p userused@$QUSER1 $QFS >/dev/null 2>&1"
-log_must eval "$ZFS get -p groupused@$GROUPUSED $QFS >/dev/null 2>&1"
+log_must eval "zfs get -p userused@$QUSER1 $QFS >/dev/null 2>&1"
+log_must eval "zfs get -p groupused@$GROUPUSED $QFS >/dev/null 2>&1"
 
-log_mustnot user_run $QUSER1 $MKFILE 1 $OFILE
+log_mustnot user_run $QUSER1 mkfile 1 $OFILE
 
-log_must $RM -f $QFILE
+log_must rm -f $QFILE
 
 log_note "overwrite to $QFS to make it exceed userquota"
-log_mustnot user_run $QUSER1 $MKFILE $GQUOTA_SIZE $QFILE
+log_mustnot user_run $QUSER1 mkfile $GQUOTA_SIZE $QFILE
 
-log_must eval "$ZFS get -p userused@$QUSER1 $QFS >/dev/null 2>&1"
-log_must eval "$ZFS get -p groupused@$GROUPUSED $QFS >/dev/null 2>&1"
+log_must eval "zfs get -p userused@$QUSER1 $QFS >/dev/null 2>&1"
+log_must eval "zfs get -p groupused@$GROUPUSED $QFS >/dev/null 2>&1"
 
 log_pass "overwrite any of the {user|group}quota size, it fail as expect"
index 7e04377fa9b7920f6f7da0f329a5981598d4a870..93020ae8ded6e3c811060fc2dae46c042503ecc9 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -50,7 +50,7 @@ function cleanup
 {
        for ds in $TESTPOOL/fs $TESTPOOL/fs-rename $TESTPOOL/fs-clone; do
                if datasetexists $ds; then
-                       log_must $ZFS destroy -rRf $ds
+                       log_must zfs destroy -rRf $ds
                fi
        done
 }
@@ -62,11 +62,11 @@ log_assert \
 
 cleanup
 
-log_must $ZFS create -o userquota@$QUSER1=$UQUOTA_SIZE \
+log_must zfs create -o userquota@$QUSER1=$UQUOTA_SIZE \
        -o groupquota@$QGROUP=$GQUOTA_SIZE $TESTPOOL/fs
 
-log_must $ZFS snapshot $TESTPOOL/fs@snap
-log_must eval "$ZFS list -r -o userquota@$QUSER1,groupquota@$QGROUP \
+log_must zfs snapshot $TESTPOOL/fs@snap
+log_must eval "zfs list -r -o userquota@$QUSER1,groupquota@$QGROUP \
        $TESTPOOL >/dev/null 2>&1"
 
 log_must check_quota "userquota@$QUSER1" $TESTPOOL/fs@snap "$UQUOTA_SIZE"
@@ -74,50 +74,50 @@ log_must check_quota "groupquota@$QGROUP" $TESTPOOL/fs@snap "$GQUOTA_SIZE"
 
 
 log_note "clone fs gets its parent's userquota/groupquota initially"
-log_must $ZFS clone  -o userquota@$QUSER1=$UQUOTA_SIZE \
+log_must zfs clone  -o userquota@$QUSER1=$UQUOTA_SIZE \
                -o groupquota@$QGROUP=$GQUOTA_SIZE \
                $TESTPOOL/fs@snap $TESTPOOL/fs-clone
 
-log_must eval "$ZFS list -r -o userquota@$QUSER1,groupquota@$QGROUP \
+log_must eval "zfs list -r -o userquota@$QUSER1,groupquota@$QGROUP \
        $TESTPOOL >/dev/null 2>&1"
 
 log_must check_quota "userquota@$QUSER1" $TESTPOOL/fs-clone "$UQUOTA_SIZE"
 log_must check_quota "groupquota@$QGROUP" $TESTPOOL/fs-clone "$GQUOTA_SIZE"
 
-log_must eval "$ZFS list -o userquota@$QUSER1,groupquota@$QGROUP \
+log_must eval "zfs list -o userquota@$QUSER1,groupquota@$QGROUP \
        $TESTPOOL/fs-clone >/dev/null 2>&1"
 
 log_note "zfs promote can not change the previously set user|group quota"
-log_must $ZFS promote $TESTPOOL/fs-clone
+log_must zfs promote $TESTPOOL/fs-clone
 
-log_must eval "$ZFS list -r -o userquota@$QUSER1,groupquota@$QGROUP \
+log_must eval "zfs list -r -o userquota@$QUSER1,groupquota@$QGROUP \
        $TESTPOOL >/dev/null 2>&1"
 
 log_must check_quota "userquota@$QUSER1" $TESTPOOL/fs-clone "$UQUOTA_SIZE"
 log_must check_quota "groupquota@$QGROUP" $TESTPOOL/fs-clone "$GQUOTA_SIZE"
 
 log_note "zfs send receive can not change the previously set user|group quota"
-log_must $ZFS send $TESTPOOL/fs-clone@snap | $ZFS receive $TESTPOOL/fs-rev
+log_must zfs send $TESTPOOL/fs-clone@snap | zfs receive $TESTPOOL/fs-rev
 
-log_must eval "$ZFS list -r -o userquota@$QUSER1,groupquota@$QGROUP \
+log_must eval "zfs list -r -o userquota@$QUSER1,groupquota@$QGROUP \
        $TESTPOOL >/dev/null 2>&1"
 
 log_must check_quota "userquota@$QUSER1" $TESTPOOL/fs-rev "$UQUOTA_SIZE"
 log_must check_quota "groupquota@$QGROUP" $TESTPOOL/fs-rev "$GQUOTA_SIZE"
 
 log_note "zfs rename can not change the previously set user|group quota"
-log_must $ZFS rename $TESTPOOL/fs-rev $TESTPOOL/fs-rename
+log_must zfs rename $TESTPOOL/fs-rev $TESTPOOL/fs-rename
 
-log_must eval "$ZFS list -r -o userquota@$QUSER1,groupquota@$QGROUP \
+log_must eval "zfs list -r -o userquota@$QUSER1,groupquota@$QGROUP \
        $TESTPOOL  >/dev/null 2>&1"
 
 log_must check_quota "userquota@$QUSER1" $TESTPOOL/fs-rename "$UQUOTA_SIZE"
 log_must check_quota "groupquota@$QGROUP" $TESTPOOL/fs-rename "$GQUOTA_SIZE"
 
 log_note "zfs upgrade can not change the previously set user|group quota"
-log_must $ZFS upgrade $TESTPOOL/fs-rename
+log_must zfs upgrade $TESTPOOL/fs-rename
 
-log_must eval "$ZFS list -r -o userquota@$QUSER1,groupquota@$QGROUP \
+log_must eval "zfs list -r -o userquota@$QUSER1,groupquota@$QGROUP \
        $TESTPOOL >/dev/null 2>&1"
 
 log_must check_quota "userquota@$QUSER1" $TESTPOOL/fs-rename "$UQUOTA_SIZE"
index c1d790bfa4094e1e62bd436a83a8d6ff8a24ea89..088499eb042685e6184168484d2ddc777d08cd93 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -47,7 +47,7 @@ function cleanup
        cleanup_quota
 
        if datasetexists $snap_fs; then
-               log_must $ZFS destroy $snap_fs
+               log_must zfs destroy $snap_fs
        fi
 }
 
@@ -57,10 +57,10 @@ typeset snap_fs=$QFS@snap
 log_assert "Check  set userquota and groupquota on snapshot"
 
 log_note "Check can not set user|group quuota on snapshot"
-log_must $ZFS snapshot $snap_fs
+log_must zfs snapshot $snap_fs
 
-log_mustnot $ZFS set userquota@$QUSER1=$UQUOTA_SIZE $snap_fs
+log_mustnot zfs set userquota@$QUSER1=$UQUOTA_SIZE $snap_fs
 
-log_mustnot $ZFS set groupquota@$QGROUP=$GQUOTA_SIZE $snap_fs
+log_mustnot zfs set groupquota@$QGROUP=$GQUOTA_SIZE $snap_fs
 
 log_pass "Check  set userquota and groupquota on snapshot"
index a84a45524f694d7b13bfaccf4210f02926ac49a7..84f2386af5b836eac7da24bbc52e5b7c9349f02c 100755 (executable)
@@ -48,7 +48,7 @@
 
 function cleanup
 {
-       log_must $RM -f ${QFILE}_*
+       log_must rm -f ${QFILE}_*
        cleanup_quota
 }
 
@@ -57,21 +57,21 @@ log_onexit cleanup
 log_assert "If creating object exceeds {user|group}objquota count, it will fail"
 
 mkmount_writable $QFS
-log_must $ZFS set xattr=sa $QFS
+log_must zfs set xattr=sa $QFS
 
 log_note "Check the userobjquota@$QUSER1"
-log_must $ZFS set userobjquota@$QUSER1=100 $QFS
-log_must user_run $QUSER1 $MKFILES ${QFILE}_1 100
+log_must zfs set userobjquota@$QUSER1=100 $QFS
+log_must user_run $QUSER1 mkfiles ${QFILE}_1 100
 sync_pool
-log_mustnot user_run $QUSER1 $MKFILE 1 $OFILE
+log_mustnot user_run $QUSER1 mkfile 1 $OFILE
 cleanup_quota
 
 log_note "Check the groupobjquota@$QGROUP"
-log_must $ZFS set groupobjquota@$QGROUP=200 $QFS
+log_must zfs set groupobjquota@$QGROUP=200 $QFS
 mkmount_writable $QFS
-log_must user_run $QUSER1 $MKFILES ${QFILE}_2 100
+log_must user_run $QUSER1 mkfiles ${QFILE}_2 100
 sync_pool
-log_mustnot user_run $QUSER2 $MKFILE 1 $OFILE
+log_mustnot user_run $QUSER2 mkfile 1 $OFILE
 
 cleanup
 log_pass "Creating objects exceeds {user|group}objquota count, it as expect"
index 2b50e293eeb2a682893e5a425686bc205f400411..299fd5a7de54ec35d8e01c06e63d9e0fa7e59b6c 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 function cleanup_quota
 {
        if datasetexists $QFS; then
-               log_must $ZFS set userquota@$QUSER1=none $QFS
-               log_must $ZFS set userobjquota@$QUSER1=none $QFS
-               log_must $ZFS set userquota@$QUSER2=none $QFS
-               log_must $ZFS set userobjquota@$QUSER2=none $QFS
-               log_must $ZFS set groupquota@$QGROUP=none $QFS
-               log_must $ZFS set groupobjquota@$QGROUP=none $QFS
+               log_must zfs set userquota@$QUSER1=none $QFS
+               log_must zfs set userobjquota@$QUSER1=none $QFS
+               log_must zfs set userquota@$QUSER2=none $QFS
+               log_must zfs set userobjquota@$QUSER2=none $QFS
+               log_must zfs set groupquota@$QGROUP=none $QFS
+               log_must zfs set groupobjquota@$QGROUP=none $QFS
                recovery_writable $QFS
        fi
 
-       [[ -f $QFILE ]] && log_must $RM -f $QFILE
-       [[ -f $OFILE ]] && log_must $RM -f $OFILE
-       $SYNC
+       [[ -f $QFILE ]] && log_must rm -f $QFILE
+       [[ -f $OFILE ]] && log_must rm -f $OFILE
+       sync
 
        return 0
 }
@@ -74,7 +74,7 @@ function mkmount_writable
 {
        typeset fs=$1
        typeset mntp=$(get_prop mountpoint $fs)
-       log_must $CHMOD 0777 $mntp
+       log_must chmod 0777 $mntp
 }
 
 #
@@ -84,7 +84,7 @@ function recovery_writable
 {
        typeset fs=$1
        typeset mntp=$(get_prop mountpoint $fs)
-       log_must $CHMOD 0755 $mntp
+       log_must chmod 0755 $mntp
 }
 
 #
@@ -111,13 +111,13 @@ function get_value # property dataset
         typeset prop=$1
         typeset dataset=$2
 
-        prop_val=$($ZFS get -H -o value $prop $dataset 2>/dev/null)
+        prop_val=$(zfs get -H -o value $prop $dataset 2>/dev/null)
         if [[ $? -ne 0 ]]; then
                 log_note "Unable to get $prop property for dataset " \
                 "$dataset"
                 return 1
         fi
 
-        $ECHO $prop_val
+        echo $prop_val
         return 0
 }
index c336ad23c7451baa39b83325dd080f10a2ececfa..ef05338af41d4fbf3052148c95e3d6c8fc2029f3 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -46,7 +46,7 @@
 function cleanup
 {
        if datasetexists $snap_fs; then
-               log_must $ZFS destroy $snap_fs
+               log_must zfs destroy $snap_fs
        fi
 
        log_must cleanup_quota
@@ -63,16 +63,16 @@ set -A params -- "-n" "-H" "-p" "-o type,name,used,quota" \
 
 typeset snap_fs=$QFS@snap
 
-log_must $ZFS set userquota@$QUSER1=100m $QFS
+log_must zfs set userquota@$QUSER1=100m $QFS
 mkmount_writable $QFS
-log_must user_run $QUSER1 $MKFILE 50m $QFILE
-$SYNC
+log_must user_run $QUSER1 mkfile 50m $QFILE
+sync
 
-log_must $ZFS snapshot $snap_fs
+log_must zfs snapshot $snap_fs
 
 for param in "${params[@]}"; do
-       log_must eval "$ZFS userspace $param $QFS >/dev/null 2>&1"
-       log_must eval "$ZFS userspace $param $snap_fs >/dev/null 2>&1"
+       log_must eval "zfs userspace $param $QFS >/dev/null 2>&1"
+       log_must eval "zfs userspace $param $snap_fs >/dev/null 2>&1"
 done
 
 log_pass "zfs userspace with all possible parameters pass as expect"
index cb84cf927b223b49cabd6ddeb26f5b2e80397e1d..8161cc152037c85b3bc5d43ad6a7da8c38d80006 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -46,7 +46,7 @@
 function cleanup
 {
        if datasetexists $snapfs; then
-               log_must $ZFS destroy $snapfs
+               log_must zfs destroy $snapfs
        fi
 
        log_must cleanup_quota
@@ -56,26 +56,26 @@ log_onexit cleanup
 
 log_assert "Check the zfs userspace used and quota"
 
-log_must $ZFS set userquota@$QUSER1=100m $QFS
+log_must zfs set userquota@$QUSER1=100m $QFS
 
 mkmount_writable $QFS
 
-log_must user_run $QUSER1 $MKFILE 50m $QFILE
-$SYNC
+log_must user_run $QUSER1 mkfile 50m $QFILE
+sync
 
 typeset snapfs=$QFS@snap
 
-log_must $ZFS snapshot $snapfs
+log_must zfs snapshot $snapfs
 
-log_must eval "$ZFS userspace $QFS >/dev/null 2>&1"
-log_must eval "$ZFS userspace $snapfs >/dev/null 2>&1"
+log_must eval "zfs userspace $QFS >/dev/null 2>&1"
+log_must eval "zfs userspace $snapfs >/dev/null 2>&1"
 
 for fs in "$QFS" "$snapfs"; do
        log_note "check the quota size in zfs userspace $fs"
-       log_must eval "$ZFS userspace $fs | $GREP $QUSER1 | $GREP 100M"
+       log_must eval "zfs userspace $fs | grep $QUSER1 | grep 100M"
 
        log_note "check the user used size in zfs userspace $fs"
-       log_must eval "$ZFS userspace $fs | $GREP $QUSER1 | $GREP 50\\.\*M"
+       log_must eval "zfs userspace $fs | grep $QUSER1 | grep 50\\.\*M"
 done
 
 log_pass "Check the zfs userspace used and quota"
index 421de6581c75ada6a70db5bacf6e790d1e42891c..671e144b092a530c2039cecb32fde9b381a66ca2 100755 (executable)
 function cleanup
 {
        if datasetexists $snapfs; then
-               log_must $ZFS destroy $snapfs
+               log_must zfs destroy $snapfs
        fi
 
-       log_must $RM -f ${QFILE}_*
+       log_must rm -f ${QFILE}_*
        log_must cleanup_quota
 }
 
@@ -58,8 +58,8 @@ function user_object_count
 {
        typeset fs=$1
        typeset user=$2
-       typeset cnt=$($ZFS userspace -oname,objused $fs |
-           $AWK /$user/'{print $2}')
+       typeset cnt=$(zfs userspace -oname,objused $fs |
+           awk /$user/'{print $2}')
        echo $cnt
 }
 
@@ -68,21 +68,21 @@ log_onexit cleanup
 log_assert "Check the zfs userspace object used"
 
 mkmount_writable $QFS
-log_must $ZFS set xattr=sa $QFS
+log_must zfs set xattr=sa $QFS
 
 ((user1_cnt = RANDOM % 100 + 1))
 ((user2_cnt = RANDOM % 100 + 1))
 
-log_must user_run $QUSER1 $MKFILES ${QFILE}_1 $user1_cnt
-log_must user_run $QUSER2 $MKFILES ${QFILE}_2 $user2_cnt
+log_must user_run $QUSER1 mkfiles ${QFILE}_1 $user1_cnt
+log_must user_run $QUSER2 mkfiles ${QFILE}_2 $user2_cnt
 sync_pool
 
 typeset snapfs=$QFS@snap
 
-log_must $ZFS snapshot $snapfs
+log_must zfs snapshot $snapfs
 
-log_must eval "$ZFS userspace $QFS >/dev/null 2>&1"
-log_must eval "$ZFS userspace $snapfs >/dev/null 2>&1"
+log_must eval "zfs userspace $QFS >/dev/null 2>&1"
+log_must eval "zfs userspace $snapfs >/dev/null 2>&1"
 
 for fs in "$QFS" "$snapfs"; do
        log_note "check the user used objects in zfs userspace $fs"
@@ -93,7 +93,7 @@ for fs in "$QFS" "$snapfs"; do
 done
 
 log_note "change the owner of files"
-log_must $CHOWN $QUSER2 ${QFILE}_1*
+log_must chown $QUSER2 ${QFILE}_1*
 sync_pool
 
 [[ $(user_object_count $QFS $QUSER1) -eq 0 ]] ||
@@ -106,7 +106,7 @@ sync_pool
        log_fail "expected $((user1_cnt+user2_cnt)) files for $QUSER2"
 
 log_note "file removal"
-log_must $RM ${QFILE}_*
+log_must rm ${QFILE}_*
 sync_pool
 
 [[ $(user_object_count $QFS $QUSER2) -eq 0 ]] ||
index dcd5adebe839cd3ec42b9d90794b172a623d5f24..aae2ab40ce58d98e0b57e6142038243924ec7545 100644 (file)
@@ -14,7 +14,7 @@
 #
 
 #
-# Copyright (c) 2015 by Delphix. All rights reserved.
+# Copyright (c) 2015, 2016 by Delphix. All rights reserved.
 #
 
 function get_conf_section # regex conf
@@ -69,7 +69,7 @@ function assert_zap_common # pool vd lvl zapobj
 
         if [[ -z "$zapobj" ]]; then
                 log_fail "$vd on $pool has no $lvl ZAP in config"
-        elif [[ -z "$($ZDB -d $pool $zapobj | grep 'zap')" ]]; then
+        elif [[ -z "$(zdb -d $pool $zapobj | grep 'zap')" ]]; then
                 log_fail "$vd on $pool has no $lvl ZAP in MOS"
         fi
 }
@@ -101,13 +101,13 @@ function assert_leaf_zap # pool vd conf
 function cleanup
 {
         if datasetexists $TESTPOOL ; then
-                log_must $ZPOOL destroy -f $TESTPOOL
+                log_must zpool destroy -f $TESTPOOL
         fi
         if [[ -e $conf ]]; then
-                log_must $RM -f "$conf"
+                log_must rm -f "$conf"
         fi
         if [[ -e $POOL2 ]]; then
-                log_must $ZPOOL destroy -f $POOL2
+                log_must zpool destroy -f $POOL2
         fi
 }
 
index 95a586432fb12d93ee428faf08f68e655cc10385..fe7dff6570a1ac5f8a9dad8d9bf8dc137c564c2e 100755 (executable)
@@ -31,9 +31,9 @@ log_assert "Per-vdev ZAPs are created on pool creation with one disk."
 
 DISK=${DISKS%% *}
 
-log_must $ZPOOL create -f $TESTPOOL $DISK
+log_must zpool create -f $TESTPOOL $DISK
 conf="$TESTDIR/vz001"
-log_must $ZDB -PC $TESTPOOL > $conf
+log_must zdb -PC $TESTPOOL > $conf
 
 assert_top_zap $TESTPOOL $DISK "$conf"
 assert_leaf_zap $TESTPOOL $DISK "$conf"
index c09facd8e234ee581fc1e2706d5ba57c5ed16f75..01d04ab156dbf4fff35a71a3d35d25b028c2de72 100755 (executable)
 
 log_assert "Per-vdev ZAPs are created on pool creation with many disks."
 
-log_must $ZPOOL create -f $TESTPOOL $DISKS
+log_must zpool create -f $TESTPOOL $DISKS
 
 conf="$TESTDIR/vz002"
-log_must $ZDB -PC $TESTPOOL > $conf
+log_must zdb -PC $TESTPOOL > $conf
 
 assert_has_sentinel "$conf"
 for DISK in $DISKS; do
index fa92975ce032635c8bd226b81ab6769f31149816..b6d9ffbda15cfe13d2cf1004e28d5752be50c703 100755 (executable)
 log_assert "Per-vdev ZAPs are created on pool creation with multi-level vdev "\
         "trees."
 
-log_must $ZPOOL create -f $TESTPOOL mirror $DISKS
+log_must zpool create -f $TESTPOOL mirror $DISKS
 
 conf="$TESTDIR/vz003"
-log_must $ZDB -PC $TESTPOOL > $conf
+log_must zdb -PC $TESTPOOL > $conf
 
 assert_has_sentinel "$conf"
 assert_top_zap $TESTPOOL "type: 'mirror'" "$conf"
index 16fbbc83b608ca2aed0210d79df66a6286ed1f67..a84de65777049efe9f82ab2cb81d34be6d942af3 100755 (executable)
 log_assert "Per-vdev ZAPs are transferred properly on attach/detach"
 
 DISK=${DISKS%% *}
-log_must $ZPOOL create -f $TESTPOOL $DISK
+log_must zpool create -f $TESTPOOL $DISK
 
 # Make the pool.
 conf="$TESTDIR/vz004"
-log_must $ZDB -PC $TESTPOOL > $conf
+log_must zdb -PC $TESTPOOL > $conf
 assert_has_sentinel "$conf"
 orig_top=$(get_top_vd_zap $DISK $conf)
 orig_leaf=$(get_leaf_vd_zap $DISK $conf)
@@ -49,8 +49,8 @@ assert_zap_common $TESTPOOL $DISK "top" $orig_top
 #
 
 disk2=$(echo $DISKS | awk '{print $2}')
-log_must $ZPOOL attach $TESTPOOL $DISK $disk2
-log_must $ZDB -PC $TESTPOOL > $conf
+log_must zpool attach $TESTPOOL $DISK $disk2
+log_must zdb -PC $TESTPOOL > $conf
 
 # Ensure top-level ZAP was transferred successfully.
 new_top=$(get_top_vd_zap "type: 'mirror'" $conf)
@@ -78,8 +78,8 @@ dsk2_leaf=$(get_leaf_vd_zap $disk2 $conf)
 # Detach original disk.
 #
 
-log_must $ZPOOL detach $TESTPOOL $DISK
-log_must $ZDB -PC $TESTPOOL > $conf
+log_must zpool detach $TESTPOOL $DISK
+log_must zdb -PC $TESTPOOL > $conf
 
 final_top=$(get_top_vd_zap $disk2 $conf)
 final_leaf=$(get_leaf_vd_zap $disk2 $conf)
index b824c9c8f2de63497d384914cf570d890c1991bd..8cf8e6d4055be6921c1e0e4ad918d55f4a058d16 100755 (executable)
 log_assert "Per-vdev ZAPs persist across export/import."
 
 DISK=${DISKS%% *}
-log_must $ZPOOL create -f $TESTPOOL $DISK
+log_must zpool create -f $TESTPOOL $DISK
 
 # Make the pool.
 conf="$TESTDIR/vz005"
-log_must $ZDB -PC $TESTPOOL > $conf
+log_must zdb -PC $TESTPOOL > $conf
 assert_has_sentinel "$conf"
 orig_top=$(get_top_vd_zap $DISK $conf)
 orig_leaf=$(get_leaf_vd_zap $DISK $conf)
@@ -43,13 +43,13 @@ assert_zap_common $TESTPOOL $DISK "top" $orig_top
 assert_zap_common $TESTPOOL $DISK "leaf" $orig_leaf
 
 # Export the pool.
-log_must $ZPOOL export $TESTPOOL
+log_must zpool export $TESTPOOL
 
 # Import the pool.
-log_must $ZPOOL import $TESTPOOL
+log_must zpool import $TESTPOOL
 
 # Verify that ZAPs persisted.
-log_must $ZDB -PC $TESTPOOL > $conf
+log_must zdb -PC $TESTPOOL > $conf
 
 new_top=$(get_top_vd_zap $DISK $conf)
 new_leaf=$(get_leaf_vd_zap $DISK $conf)
index 3ea386742d4ecd46618178a5b6644cf715e0fef2..0476bcda91ff4288dff2146262ce0638aa10765a 100755 (executable)
 
 DISK_ARR=($DISKS)
 DISK=${DISK_ARR[0]}
-log_must $ZPOOL create -f $TESTPOOL $DISK
+log_must zpool create -f $TESTPOOL $DISK
 
 log_assert "Per-vdev ZAPs are created for added vdevs."
 
-log_must $ZPOOL add -f $TESTPOOL ${DISK_ARR[1]}
+log_must zpool add -f $TESTPOOL ${DISK_ARR[1]}
 conf="$TESTDIR/vz006"
-log_must $ZDB -PC $TESTPOOL > $conf
+log_must zdb -PC $TESTPOOL > $conf
 
 assert_has_sentinel "$conf"
 orig_top=$(get_top_vd_zap ${DISK_ARR[1]} $conf)
index daf65b2d3d887333a85767296275f67e967f1192..1f71b11ee5627b56d2fb32ad0a5b62c7f5bed271 100755 (executable)
 
 DISK_ARR=($DISKS)
 POOL2=${TESTPOOL}2
-log_must $ZPOOL create -f $TESTPOOL mirror ${DISK_ARR[0]} ${DISK_ARR[1]}
+log_must zpool create -f $TESTPOOL mirror ${DISK_ARR[0]} ${DISK_ARR[1]}
 
 log_assert "Per-vdev ZAPs persist correctly on the original pool after split."
 conf="$TESTDIR/vz007"
-log_must $ZDB -PC $TESTPOOL > $conf
+log_must zdb -PC $TESTPOOL > $conf
 
 assert_has_sentinel "$conf"
 orig_top=$(get_top_vd_zap "type: 'mirror'" $conf)
@@ -46,10 +46,10 @@ assert_zap_common $TESTPOOL "type: 'mirror'" "top" $orig_top
 assert_zap_common $TESTPOOL ${DISK_ARR[0]} "leaf" $orig_leaf0
 assert_zap_common $TESTPOOL ${DISK_ARR[1]} "leaf" $orig_leaf1
 
-log_must $ZPOOL split $TESTPOOL $POOL2 ${DISK_ARR[1]}
+log_must zpool split $TESTPOOL $POOL2 ${DISK_ARR[1]}
 
 # Make sure old pool's ZAPs are consistent.
-log_must $ZDB -PC $TESTPOOL > $conf
+log_must zdb -PC $TESTPOOL > $conf
 new_leaf0=$(get_leaf_vd_zap ${DISK_ARR[0]} $conf)
 new_top_s0=$(get_top_vd_zap ${DISK_ARR[0]} $conf)
 
@@ -61,8 +61,8 @@ new_top_s0=$(get_top_vd_zap ${DISK_ARR[0]} $conf)
 log_assert "Per-vdev ZAPs persist on the new pool after import."
 
 # Import the split pool.
-log_must $ZPOOL import $POOL2
-log_must $ZDB -PC $TESTPOOL > $conf
+log_must zpool import $POOL2
+log_must zdb -PC $TESTPOOL > $conf
 
 new_leaf1=$(get_leaf_vd_zap ${DISK_ARR[1]} $conf)
 new_top_s1=$(get_top_vd_zap ${DISK_ARR[1]} $conf)
index fe7b5ab0837645d3b2d9e1739ba4c5c883e19e5c..6cb14ad64876acbd0792a9fb2ff5833bebc1964f 100644 (file)
@@ -34,7 +34,7 @@
 verify_runnable "global"
 
 export SIZE="1gb"
-export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
+export DISK_ARRAY_NUM=$(echo ${DISKS} | nawk '{print NF}')
 export DISKSARRAY=$DISKS
 
 if is_linux; then
index 3261af167ab7adebe1c865a07476df740930cd30..1835eb366196378904b993dbcc3fed2f17954bd2 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,11 +48,11 @@ verify_runnable "both"
 
 function cleanup
 {
-       for file in `$FIND $TESTDIR -type f`; do
-               $CAT /dev/null > $file
+       for file in `find $TESTDIR -type f`; do
+               cat /dev/null > $file
        done
-       log_must $SYNC
-       log_must $RM -rf $TESTDIR/*
+       log_must sync
+       log_must rm -rf $TESTDIR/*
 }
 
 typeset -i retval=0
index 39c410b9dc7657bb27eabe7a38a6f769d90a3765..9f0b3f3cdc87c875095e8794ab0cad7cfccb2db2 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,11 +48,11 @@ verify_runnable "both"
 
 function cleanup
 {
-       for file in `$FIND $TESTDIR -type f`; do
-               $CAT /dev/null > $file
+       for file in `find $TESTDIR -type f`; do
+               cat /dev/null > $file
        done
-       log_must $SYNC
-       log_must $RM -rf $TESTDIR/*
+       log_must sync
+       log_must rm -rf $TESTDIR/*
 }
 
 typeset -i retval=0
index b52c07d3d8d2d8b19a3c189f0989adf834118e62..10cd733d21fd3d21fefc40b5b96735272cfb2590 100755 (executable)
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 
-ZFS_USER=$($CAT /tmp/zfs-xattr-test-user.txt)
-$RM /tmp/zfs-xattr-test-user.txt
+ZFS_USER=$(cat /tmp/zfs-xattr-test-user.txt)
+rm /tmp/zfs-xattr-test-user.txt
 
-USES_NIS=$($CAT /tmp/zfs-xattr-test-nis.txt)
-$RM /tmp/zfs-xattr-test-nis.txt
+USES_NIS=$(cat /tmp/zfs-xattr-test-nis.txt)
+rm /tmp/zfs-xattr-test-nis.txt
 
 del_user $ZFS_USER
 
 if [ "${USES_NIS}" == "true" ]
 then
-    $SVCADM enable svc:/network/nis/client:default
+    svcadm enable svc:/network/nis/client:default
 fi
 
 default_cleanup
index d359eb049ce3aab345924060e07df2e2db9f7a6e..ac82c5919118d5450128ec8a6f59b998444966bc 100755 (executable)
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 
 # if we're running NIS, turn it off until we clean up
 # (it can cause useradd to take a long time, hitting our TIMEOUT)
-USES_NIS=FALSE
-$SVCS svc:/network/nis/client:default | $GREP online > /dev/null
+USES_NIS=false
+svcs svc:/network/nis/client:default | grep online > /dev/null
 if [ $? -eq 0 ]
 then
-       $SVCADM disable -t svc:/network/nis/client:default
+       svcadm disable -t svc:/network/nis/client:default
        USES_NIS=true
 fi
 
@@ -45,7 +45,7 @@ ZFS_GROUP=staff
 while [ -z "${FOUND}" ]
 do
        COUNT=0
-       USER_EXISTS=$( $GREP $ZFS_USER /etc/passwd )
+       USER_EXISTS=$( grep $ZFS_USER /etc/passwd )
        if [ ! -z "${USER_EXISTS}" ]
        then
                ZFS_USER="${ZFS_USER}${COUNT}"
@@ -57,8 +57,8 @@ done
 
 log_must add_user $ZFS_GROUP $ZFS_USER
 
-$ECHO $ZFS_USER > /tmp/zfs-xattr-test-user.txt
-$ECHO $USES_NIS > /tmp/zfs-xattr-test-nis.txt
+echo $ZFS_USER > /tmp/zfs-xattr-test-user.txt
+echo $USES_NIS > /tmp/zfs-xattr-test-nis.txt
 
 DISK=${DISKS%% *}
 default_setup $DISK
index 1bc7e5c7550808125094efcf3ca8d60783611d1c..adb5132f28ffffee7b96711c3f75789eb441c699 100755 (executable)
@@ -24,7 +24,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,14 +48,14 @@ function cleanup {
 
        if [ -f $TESTDIR/myfile.$$ ]
        then
-               log_must $RM $TESTDIR/myfile.$$
+               log_must rm $TESTDIR/myfile.$$
        fi
 }
 
 log_assert "Create/read/write/append of xattrs works"
 log_onexit cleanup
 
-log_must $TOUCH $TESTDIR/myfile.$$
+log_must touch $TESTDIR/myfile.$$
 create_xattr $TESTDIR/myfile.$$ passwd /etc/passwd
 verify_write_xattr $TESTDIR/myfile.$$ passwd
 delete_xattr $TESTDIR/myfile.$$ passwd
index cd57b3594bb6c5d193768397be5f574c9d0d8490..99212a011066db51b44eba78a51e5f2115b71d84 100755 (executable)
@@ -24,7 +24,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -42,7 +42,7 @@
 
 function cleanup {
 
-       log_must $RM $TESTDIR/myfile.$$
+       log_must rm $TESTDIR/myfile.$$
 
 }
 
@@ -50,7 +50,7 @@ log_assert "A read of a non-existent xattr fails"
 log_onexit cleanup
 
 # create a file
-log_must $TOUCH $TESTDIR/myfile.$$
-log_mustnot eval "$CAT $TESTDIR/myfile.$$ not-here.txt > /dev/null 2>&1"
+log_must touch $TESTDIR/myfile.$$
+log_mustnot eval "cat $TESTDIR/myfile.$$ not-here.txt > /dev/null 2>&1"
 
 log_pass "A read of a non-existent xattr fails"
index 90d78604b410b81f52d80a39d5e50950f664d9a9..28fae8e6574f853f0a224799a13b4254794b6c81 100755 (executable)
@@ -24,7 +24,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 
 function cleanup {
 
-       log_must $RM $TESTDIR/myfile.$$
+       log_must rm $TESTDIR/myfile.$$
 
 }
 
 log_assert "read/write xattr on a file with no permissions fails"
 log_onexit cleanup
 
-log_must $TOUCH $TESTDIR/myfile.$$
+log_must touch $TESTDIR/myfile.$$
 create_xattr $TESTDIR/myfile.$$ passwd /etc/passwd
 
-log_must $CHMOD 000 $TESTDIR/myfile.$$
-log_mustnot $SU $ZFS_USER -c "$RUNAT $TESTDIR/myfile.$$ $CAT passwd"
-log_mustnot $SU $ZFS_USER -c "$RUNAT $TESTDIR/myfile.$$ $CP /etc/passwd ."
+log_must chmod 000 $TESTDIR/myfile.$$
+log_mustnot su $ZFS_USER -c "runat $TESTDIR/myfile.$$ cat passwd"
+log_mustnot su $ZFS_USER -c "runat $TESTDIR/myfile.$$ cp /etc/passwd ."
 
 log_pass "read/write xattr on a file with no permissions fails"
index f0f301fe8690b34f7d33dacc5e1933e9889ffd76..921526315141c489cc76826d34f9c2c54e5f4f59 100755 (executable)
@@ -24,7 +24,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,8 +52,8 @@ function cleanup {
 
        if [ $( ismounted /tmp/$NEWFS_DEFAULT_FS.$$ $NEWFS_DEFAULT_FS ) ]
        then
-               log_must $UMOUNT /tmp/$NEWFS_DEFAULT_FS.$$
-               log_must $RM -rf /tmp/$NEWFS_DEFAULT_FS.$$
+               log_must umount /tmp/$NEWFS_DEFAULT_FS.$$
+               log_must rm -rf /tmp/$NEWFS_DEFAULT_FS.$$
        fi
 }
 
@@ -61,27 +61,27 @@ log_assert "Files from $NEWFS_DEFAULT_FS,tmpfs with xattrs copied to zfs retain
 log_onexit cleanup
 
 # Create a UFS|EXT2 file system that we can work in
-log_must $ZFS create -V128m $TESTPOOL/$TESTFS/zvol
+log_must zfs create -V128m $TESTPOOL/$TESTFS/zvol
 block_device_wait
-log_must eval "$ECHO y | $NEWFS $ZVOL_DEVDIR/$TESTPOOL/$TESTFS/zvol > /dev/null 2>&1"
+log_must eval "echo y | $NEWFS $ZVOL_DEVDIR/$TESTPOOL/$TESTFS/zvol > /dev/null 2>&1"
 
-log_must $MKDIR /tmp/$NEWFS_DEFAULT_FS.$$
-log_must $MOUNT $ZVOL_DEVDIR/$TESTPOOL/$TESTFS/zvol /tmp/$NEWFS_DEFAULT_FS.$$
+log_must mkdir /tmp/$NEWFS_DEFAULT_FS.$$
+log_must mount $ZVOL_DEVDIR/$TESTPOOL/$TESTFS/zvol /tmp/$NEWFS_DEFAULT_FS.$$
 
 # Create files in ufs|ext2 and tmpfs, and set some xattrs on them.
-log_must $TOUCH /tmp/$NEWFS_DEFAULT_FS.$$/$NEWFS_DEFAULT_FS-file.$$
-log_must $TOUCH /tmp/tmpfs-file.$$
+log_must touch /tmp/$NEWFS_DEFAULT_FS.$$/$NEWFS_DEFAULT_FS-file.$$
+log_must touch /tmp/tmpfs-file.$$
 
-log_must $RUNAT /tmp/$NEWFS_DEFAULT_FS.$$/$NEWFS_DEFAULT_FS-file.$$ $CP /etc/passwd .
-log_must $RUNAT /tmp/tmpfs-file.$$ $CP /etc/group .
+log_must runat /tmp/$NEWFS_DEFAULT_FS.$$/$NEWFS_DEFAULT_FS-file.$$ cp /etc/passwd .
+log_must runat /tmp/tmpfs-file.$$ cp /etc/group .
 
 # copy those files to ZFS
-log_must $CP -@ /tmp/$NEWFS_DEFAULT_FS.$$/$NEWFS_DEFAULT_FS-file.$$ $TESTDIR
-log_must $CP -@ /tmp/tmpfs-file.$$ $TESTDIR
+log_must cp -@ /tmp/$NEWFS_DEFAULT_FS.$$/$NEWFS_DEFAULT_FS-file.$$ $TESTDIR
+log_must cp -@ /tmp/tmpfs-file.$$ $TESTDIR
 
 # ensure the xattr information has been copied correctly
-log_must $RUNAT $TESTDIR/$NEWFS_DEFAULT_FS-file.$$ $DIFF passwd /etc/passwd
-log_must $RUNAT $TESTDIR/tmpfs-file.$$ $DIFF group /etc/group
+log_must runat $TESTDIR/$NEWFS_DEFAULT_FS-file.$$ diff passwd /etc/passwd
+log_must runat $TESTDIR/tmpfs-file.$$ diff group /etc/group
 
-log_must $UMOUNT /tmp/$NEWFS_DEFAULT_FS.$$
+log_must umount /tmp/$NEWFS_DEFAULT_FS.$$
 log_pass "Files from $NEWFS_DEFAULT_FS,tmpfs with xattrs copied to zfs retain xattr info."
index f7be58e81920648cd6ec2201d3e3e7c09b79986e..e5fbe6f18b506cb8cac674b5d646917821bb5455 100755 (executable)
@@ -24,7 +24,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 
 function cleanup {
 
-       log_must $ZFS destroy $TESTPOOL/$TESTFS/clone
-       log_must $ZFS destroy $TESTPOOL/$TESTFS@snapshot1
-       log_must $RM $TESTDIR/myfile.$$
+       log_must zfs destroy $TESTPOOL/$TESTFS/clone
+       log_must zfs destroy $TESTPOOL/$TESTFS@snapshot1
+       log_must rm $TESTDIR/myfile.$$
 }
 
 log_assert "read/write/create/delete xattr on a clone filesystem"
 log_onexit cleanup
 
 # create a file, and an xattr on it
-log_must $TOUCH $TESTDIR/myfile.$$
+log_must touch $TESTDIR/myfile.$$
 create_xattr $TESTDIR/myfile.$$ passwd /etc/passwd
 
 # snapshot & clone the filesystem
-log_must $ZFS snapshot $TESTPOOL/$TESTFS@snapshot1
-log_must $ZFS clone $TESTPOOL/$TESTFS@snapshot1 $TESTPOOL/$TESTFS/clone
-log_must $ZFS set mountpoint=$TESTDIR/clone $TESTPOOL/$TESTFS/clone
+log_must zfs snapshot $TESTPOOL/$TESTFS@snapshot1
+log_must zfs clone $TESTPOOL/$TESTFS@snapshot1 $TESTPOOL/$TESTFS/clone
+log_must zfs set mountpoint=$TESTDIR/clone $TESTPOOL/$TESTFS/clone
 
 # check for the xattrs on the clone
 verify_xattr $TESTDIR/clone/myfile.$$ passwd /etc/passwd
index 24915fda250c3cf938c72422339f9cb2dbb59d0c..56f29c88d8eb987b3344987d5f860e8a0806b7d5 100755 (executable)
@@ -24,7 +24,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -42,8 +42,8 @@
 
 function cleanup {
 
-       log_must $ZFS destroy $TESTPOOL/$TESTFS@snap
-       log_must $RM $TESTDIR/myfile.$$
+       log_must zfs destroy $TESTPOOL/$TESTFS@snap
+       log_must rm $TESTDIR/myfile.$$
 
 }
 
@@ -51,11 +51,11 @@ log_assert "read xattr on a snapshot"
 log_onexit cleanup
 
 # create a file, and an xattr on it
-log_must $TOUCH $TESTDIR/myfile.$$
+log_must touch $TESTDIR/myfile.$$
 create_xattr $TESTDIR/myfile.$$ passwd /etc/passwd
 
 # snapshot the filesystem
-log_must $ZFS snapshot $TESTPOOL/$TESTFS@snap
+log_must zfs snapshot $TESTPOOL/$TESTFS@snap
 
 # check for the xattr on the snapshot
 verify_xattr $TESTDIR/.zfs/snapshot/snap/myfile.$$ passwd /etc/passwd
index bef602012eb9d23aced05e14c2c9bb34227f901a..6b3feeafc05bc63cc08cfbec8b9da2a03f8a15c0 100755 (executable)
@@ -24,7 +24,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 #
 
 function cleanup {
-       log_must $ZFS destroy $TESTPOOL/$TESTFS@snap
-       log_must $RM $TESTDIR/myfile2.$$
-       log_must $RM $TESTDIR/myfile.$$
-       log_must $RM /tmp/output.$$
-       [[ -e /tmp/expected_output.$$ ]]  && log_must $RM  \
+       log_must zfs destroy $TESTPOOL/$TESTFS@snap
+       log_must rm $TESTDIR/myfile2.$$
+       log_must rm $TESTDIR/myfile.$$
+       log_must rm /tmp/output.$$
+       [[ -e /tmp/expected_output.$$ ]]  && log_must rm  \
        /tmp/expected_output.$$
 
 }
@@ -59,23 +59,23 @@ log_assert "create/write xattr on a snapshot fails"
 log_onexit cleanup
 
 # create a file, and an xattr on it
-log_must $TOUCH $TESTDIR/myfile.$$
+log_must touch $TESTDIR/myfile.$$
 create_xattr $TESTDIR/myfile.$$ passwd /etc/passwd
 
 # create another file that doesn't have an xattr
-log_must $TOUCH $TESTDIR/myfile2.$$
+log_must touch $TESTDIR/myfile2.$$
 
 # snapshot the filesystem
-log_must $ZFS snapshot $TESTPOOL/$TESTFS@snap
+log_must zfs snapshot $TESTPOOL/$TESTFS@snap
 
 # we shouldn't be able to alter the first file's xattr
-log_mustnot eval " $RUNAT $TESTDIR/.zfs/snapshot/snap/myfile.$$ \
-    $CP /etc/passwd .  >/tmp/output.$$  2>&1"
-log_must $GREP  -i  Read-only  /tmp/output.$$
+log_mustnot eval " runat $TESTDIR/.zfs/snapshot/snap/myfile.$$ \
+    cp /etc/passwd .  >/tmp/output.$$  2>&1"
+log_must grep  -i  Read-only  /tmp/output.$$
 
-log_must eval "$RUNAT $TESTDIR/.zfs/snapshot/snap/myfile2.$$  \
-    $LS >/tmp/output.$$  2>&1"
+log_must eval "runat $TESTDIR/.zfs/snapshot/snap/myfile2.$$  \
+    ls >/tmp/output.$$  2>&1"
 create_expected_output  /tmp/expected_output.$$ SUNWattr_ro SUNWattr_rw
-log_must $DIFF /tmp/output.$$ /tmp/expected_output.$$
+log_must diff /tmp/output.$$ /tmp/expected_output.$$
 
 log_pass "create/write xattr on a snapshot fails"
index 40cc4a08eb9ccd00d671fb68cbad7abdc346d3a9..20319967c2e99ac18dc760f64832dec52a0914d6 100755 (executable)
@@ -24,7 +24,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,7 +45,7 @@ function cleanup {
 
        for file in /tmp/output.$$ /tmp/expected-output.$$ \
                $TESTDIR/myfile.$$ ; do
-               log_must $RM -f $file
+               log_must rm -f $file
        done
 }
 
@@ -53,28 +53,28 @@ log_assert "special . and .. dirs work as expected for xattrs"
 log_onexit cleanup
 
 # create a file, and an xattr on it
-log_must $TOUCH $TESTDIR/myfile.$$
+log_must touch $TESTDIR/myfile.$$
 create_xattr $TESTDIR/myfile.$$ passwd /etc/passwd
 
 # listing the directory .
-log_must eval "$RUNAT $TESTDIR/myfile.$$ $LS  . > /tmp/output.$$"
+log_must eval "runat $TESTDIR/myfile.$$ ls  . > /tmp/output.$$"
 create_expected_output  /tmp/expected-output.$$  \
     SUNWattr_ro  SUNWattr_rw  passwd
-log_must $DIFF /tmp/output.$$ /tmp/expected-output.$$
+log_must diff /tmp/output.$$ /tmp/expected-output.$$
 # list the directory . long form
-log_must eval "$RUNAT $TESTDIR/myfile.$$ $LS -a . > /tmp/output.$$"
+log_must eval "runat $TESTDIR/myfile.$$ ls -a . > /tmp/output.$$"
 create_expected_output  /tmp/expected-output.$$ . ..  \
     SUNWattr_ro  SUNWattr_rw  passwd
-log_must $DIFF /tmp/output.$$ /tmp/expected-output.$$
+log_must diff /tmp/output.$$ /tmp/expected-output.$$
 
 # list the directory .. expecting one file
-OUTPUT=$($RUNAT $TESTDIR/myfile.$$ $LS ..)
+OUTPUT=$(runat $TESTDIR/myfile.$$ ls ..)
 if [ "$OUTPUT" != ".." ]
 then
        log_fail "Listing the .. directory doesn't show \"..\" as expected."
 fi
 
 # verify we can't list ../
-log_mustnot eval "$RUNAT $TESTDIR/myfile.$$ $LS ../ > /dev/null 2>&1"
+log_mustnot eval "runat $TESTDIR/myfile.$$ ls ../ > /dev/null 2>&1"
 
 log_pass "special . and .. dirs work as expected for xattrs"
index 40b361710e5a8c3370e1a43c4862573b93af4309..6a953cf8417869541fe4c85ffc9198513a959c09 100755 (executable)
@@ -24,7 +24,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -42,7 +42,7 @@
 
 function cleanup {
 
-       log_must $RM $TESTDIR/myfile.$$
+       log_must rm $TESTDIR/myfile.$$
 
 }
 
@@ -50,13 +50,13 @@ log_assert "links between xattr and normal file namespace fail"
 log_onexit cleanup
 
 # create a file, and an xattr on it
-log_must $TOUCH $TESTDIR/myfile.$$
+log_must touch $TESTDIR/myfile.$$
 create_xattr $TESTDIR/myfile.$$ passwd /etc/passwd
 
 # Try to create a soft link from the xattr namespace to the default namespace
-log_mustnot $RUNAT $TESTDIR/myfile.$$ $LN -s /etc/passwd foo
+log_mustnot runat $TESTDIR/myfile.$$ $LN -s /etc/passwd foo
 
 # Try to create a hard link from the xattr namespace to the default namespace
-log_mustnot $RUNAT $TESTDIR/myfile.$$ $LN /etc/passwd foo
+log_mustnot runat $TESTDIR/myfile.$$ $LN /etc/passwd foo
 
 log_pass "links between xattr and normal file namespace fail"
index e3e23a428fb56f5fab788a0624dfd150ef12b542..43502bfff28b48d601231fc4f3f8b834d4083daf 100755 (executable)
@@ -24,7 +24,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 
 function cleanup {
 
-       log_must $RM $TESTDIR/myfile.$$
+       log_must rm $TESTDIR/myfile.$$
 }
 
 log_assert "mkdir, mknod fail"
 log_onexit cleanup
 
 # create a file, and an xattr on it
-log_must $TOUCH $TESTDIR/myfile.$$
+log_must touch $TESTDIR/myfile.$$
 create_xattr $TESTDIR/myfile.$$ passwd /etc/passwd
 
 # Try to create directory in the xattr namespace
-log_mustnot $RUNAT $TESTDIR/myfile.$$ $MKDIR foo
+log_mustnot runat $TESTDIR/myfile.$$ mkdir foo
 
 # Try to create a range of different filetypes in the xattr namespace
-log_mustnot $RUNAT $TESTDIR/myfile.$$ $MKNOD block b 888 888
+log_mustnot runat $TESTDIR/myfile.$$ mknod block b 888 888
 
-log_mustnot $RUNAT $TESTDIR/myfile.$$ $MKNOD char c
+log_mustnot runat $TESTDIR/myfile.$$ mknod char c
 
-log_mustnot $RUNAT $TESTDIR/myfile.$$ $MKNOD fifo p
+log_mustnot runat $TESTDIR/myfile.$$ mknod fifo p
 
 log_pass "mkdir, mknod fail"
index e3a8d26922e14c4afc281b66941f30486db120e9..12f067489f20f49f8b862d43facb6e64cf84c9ac 100755 (executable)
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,7 +48,7 @@
 
 function cleanup {
 
-       log_must $RM $TESTDIR/myfile.$$
+       log_must rm $TESTDIR/myfile.$$
 }
 
 log_assert "Basic applications work with xattrs: cpio cp find mv pax tar"
@@ -56,7 +56,7 @@ log_onexit cleanup
 
 # Create a file, and set an xattr on it. This file is used in several of the
 # test scenarios below.
-log_must $TOUCH $TESTDIR/myfile.$$
+log_must touch $TESTDIR/myfile.$$
 create_xattr $TESTDIR/myfile.$$ passwd /etc/passwd
 
 
@@ -67,127 +67,127 @@ create_xattr $TESTDIR/myfile.$$ passwd /etc/passwd
 
 
 log_note "Checking cpio"
-log_must $TOUCH $TESTDIR/cpio.$$
+log_must touch $TESTDIR/cpio.$$
 create_xattr $TESTDIR/cpio.$$ passwd /etc/passwd
-$ECHO $TESTDIR/cpio.$$ | $CPIO -o@ > /tmp/xattr.$$.cpio
-$ECHO $TESTDIR/cpio.$$ | $CPIO -o > /tmp/noxattr.$$.cpio
+echo $TESTDIR/cpio.$$ | cpio -o@ > /tmp/xattr.$$.cpio
+echo $TESTDIR/cpio.$$ | cpio -o > /tmp/noxattr.$$.cpio
 
 # we should have no xattr here
-log_must $CPIO -iu < /tmp/xattr.$$.cpio
-log_mustnot eval "$RUNAT $TESTDIR/cpio.$$ $CAT passwd > /dev/null 2>&1"
+log_must cpio -iu < /tmp/xattr.$$.cpio
+log_mustnot eval "runat $TESTDIR/cpio.$$ cat passwd > /dev/null 2>&1"
 
 # we should have an xattr here
-log_must $CPIO -iu@ < /tmp/xattr.$$.cpio
-log_must eval "$RUNAT $TESTDIR/cpio.$$ $CAT passwd > /dev/null 2>&1"
+log_must cpio -iu@ < /tmp/xattr.$$.cpio
+log_must eval "runat $TESTDIR/cpio.$$ cat passwd > /dev/null 2>&1"
 
 # we should have no xattr here
-log_must $CPIO -iu < /tmp/noxattr.$$.cpio
-log_mustnot eval "$RUNAT $TESTDIR/cpio.$$ $CAT passwd > /dev/null 2>&1"
+log_must cpio -iu < /tmp/noxattr.$$.cpio
+log_mustnot eval "runat $TESTDIR/cpio.$$ cat passwd > /dev/null 2>&1"
 
 # we should have no xattr here
-log_must $CPIO -iu@ < /tmp/noxattr.$$.cpio
-log_mustnot eval "$RUNAT $TESTDIR/cpio.$$ $CAT passwd > /dev/null 2>&1"
-log_must $RM $TESTDIR/cpio.$$ /tmp/xattr.$$.cpio /tmp/noxattr.$$.cpio
+log_must cpio -iu@ < /tmp/noxattr.$$.cpio
+log_mustnot eval "runat $TESTDIR/cpio.$$ cat passwd > /dev/null 2>&1"
+log_must rm $TESTDIR/cpio.$$ /tmp/xattr.$$.cpio /tmp/noxattr.$$.cpio
 
 
 
 log_note "Checking cp"
 # check that with the right flag, the xattr is preserved
-log_must $CP -@ $TESTDIR/myfile.$$ $TESTDIR/myfile2.$$
+log_must cp -@ $TESTDIR/myfile.$$ $TESTDIR/myfile2.$$
 compare_xattrs $TESTDIR/myfile.$$ $TESTDIR/myfile2.$$ passwd
-log_must $RM $TESTDIR/myfile2.$$
+log_must rm $TESTDIR/myfile2.$$
 
 # without the right flag, there should be no xattr
-log_must $CP $TESTDIR/myfile.$$ $TESTDIR/myfile2.$$
-log_mustnot eval "$RUNAT $TESTDIR/myfile2.$$ $LS passwd > /dev/null 2>&1"
-log_must $RM $TESTDIR/myfile2.$$
+log_must cp $TESTDIR/myfile.$$ $TESTDIR/myfile2.$$
+log_mustnot eval "runat $TESTDIR/myfile2.$$ ls passwd > /dev/null 2>&1"
+log_must rm $TESTDIR/myfile2.$$
 
 
 
 log_note "Checking find"
 # create a file without xattrs, and check that find -xattr only finds
 # our test file that has an xattr.
-log_must $MKDIR $TESTDIR/noxattrs
-log_must $TOUCH $TESTDIR/noxattrs/no-xattr
+log_must mkdir $TESTDIR/noxattrs
+log_must touch $TESTDIR/noxattrs/no-xattr
 
-$FIND $TESTDIR -xattr | $GREP myfile.$$
+find $TESTDIR -xattr | grep myfile.$$
 [[ $? -ne 0 ]] && \
        log_fail "find -xattr didn't find our file that had an xattr."
-$FIND $TESTDIR -xattr | $GREP no-xattr
+find $TESTDIR -xattr | grep no-xattr
 [[ $? -eq 0 ]] && \
        log_fail "find -xattr found a file that didn't have an xattr."
-log_must $RM -rf $TESTDIR/noxattrs
+log_must rm -rf $TESTDIR/noxattrs
 
 
 
 log_note "Checking mv"
 # mv doesn't have any flags to preserve/ommit xattrs - they're
 # always moved.
-log_must $TOUCH $TESTDIR/mvfile.$$
+log_must touch $TESTDIR/mvfile.$$
 create_xattr $TESTDIR/mvfile.$$ passwd /etc/passwd
-log_must $MV $TESTDIR/mvfile.$$ $TESTDIR/mvfile2.$$
+log_must mv $TESTDIR/mvfile.$$ $TESTDIR/mvfile2.$$
 verify_xattr $TESTDIR/mvfile2.$$ passwd /etc/passwd
-log_must $RM $TESTDIR/mvfile2.$$
+log_must rm $TESTDIR/mvfile2.$$
 
 
 log_note "Checking pax"
-log_must $TOUCH $TESTDIR/pax.$$
+log_must touch $TESTDIR/pax.$$
 create_xattr $TESTDIR/pax.$$ passwd /etc/passwd
-log_must $PAX -w -f $TESTDIR/noxattr.pax $TESTDIR/pax.$$
-log_must $PAX -w@ -f $TESTDIR/xattr.pax $TESTDIR/pax.$$
-log_must $RM $TESTDIR/pax.$$
+log_must pax -w -f $TESTDIR/noxattr.pax $TESTDIR/pax.$$
+log_must pax -w@ -f $TESTDIR/xattr.pax $TESTDIR/pax.$$
+log_must rm $TESTDIR/pax.$$
 
 # we should have no xattr here
-log_must $PAX -r -f $TESTDIR/noxattr.pax
-log_mustnot eval "$RUNAT $TESTDIR/pax.$$ $CAT passwd > /dev/null 2>&1"
-log_must $RM $TESTDIR/pax.$$
+log_must pax -r -f $TESTDIR/noxattr.pax
+log_mustnot eval "runat $TESTDIR/pax.$$ cat passwd > /dev/null 2>&1"
+log_must rm $TESTDIR/pax.$$
 
 # we should have no xattr here
-log_must $PAX -r@ -f $TESTDIR/noxattr.pax
-log_mustnot eval "$RUNAT $TESTDIR/pax.$$ $CAT passwd > /dev/null 2>&1"
-log_must $RM $TESTDIR/pax.$$
+log_must pax -r@ -f $TESTDIR/noxattr.pax
+log_mustnot eval "runat $TESTDIR/pax.$$ cat passwd > /dev/null 2>&1"
+log_must rm $TESTDIR/pax.$$
 
 
 # we should have an xattr here
-log_must $PAX -r@ -f $TESTDIR/xattr.pax
+log_must pax -r@ -f $TESTDIR/xattr.pax
 verify_xattr $TESTDIR/pax.$$ passwd /etc/passwd
-log_must $RM $TESTDIR/pax.$$
+log_must rm $TESTDIR/pax.$$
 
 # we should have no xattr here
-log_must $PAX -r -f $TESTDIR/xattr.pax $TESTDIR
-log_mustnot eval "$RUNAT $TESTDIR/pax.$$ $CAT passwd > /dev/null 2>&1"
-log_must $RM $TESTDIR/pax.$$ $TESTDIR/noxattr.pax $TESTDIR/xattr.pax
+log_must pax -r -f $TESTDIR/xattr.pax $TESTDIR
+log_mustnot eval "runat $TESTDIR/pax.$$ cat passwd > /dev/null 2>&1"
+log_must rm $TESTDIR/pax.$$ $TESTDIR/noxattr.pax $TESTDIR/xattr.pax
 
 
 log_note "Checking tar"
-log_must $TOUCH $TESTDIR/tar.$$
+log_must touch $TESTDIR/tar.$$
 create_xattr $TESTDIR/tar.$$ passwd /etc/passwd
 
 log_must cd $TESTDIR
 
-log_must $TAR cf noxattr.tar tar.$$
-log_must $TAR c@f xattr.tar tar.$$
-log_must $RM $TESTDIR/tar.$$
+log_must tar cf noxattr.tar tar.$$
+log_must tar c@f xattr.tar tar.$$
+log_must rm $TESTDIR/tar.$$
 
 # we should have no xattr here
-log_must $TAR xf xattr.tar
-log_mustnot eval "$RUNAT $TESTDIR/tar.$$ $CAT passwd > /dev/null 2>&1"
-log_must $RM $TESTDIR/tar.$$
+log_must tar xf xattr.tar
+log_mustnot eval "runat $TESTDIR/tar.$$ cat passwd > /dev/null 2>&1"
+log_must rm $TESTDIR/tar.$$
 
 # we should have an xattr here
-log_must $TAR x@f xattr.tar
+log_must tar x@f xattr.tar
 verify_xattr tar.$$ passwd /etc/passwd
-log_must $RM $TESTDIR/tar.$$
+log_must rm $TESTDIR/tar.$$
 
 # we should have no xattr here
-log_must $TAR xf $TESTDIR/noxattr.tar
-log_mustnot eval "$RUNAT $TESTDIR/tar.$$ $CAT passwd > /dev/null 2>&1"
-log_must $RM $TESTDIR/tar.$$
+log_must tar xf $TESTDIR/noxattr.tar
+log_mustnot eval "runat $TESTDIR/tar.$$ cat passwd > /dev/null 2>&1"
+log_must rm $TESTDIR/tar.$$
 
 # we should have no xattr here
-log_must $TAR x@f $TESTDIR/noxattr.tar
-log_mustnot eval "$RUNAT $TESTDIR/tar.$$ $CAT passwd > /dev/null 2>&1"
-log_must $RM $TESTDIR/tar.$$ $TESTDIR/noxattr.tar $TESTDIR/xattr.tar
+log_must tar x@f $TESTDIR/noxattr.tar
+log_mustnot eval "runat $TESTDIR/tar.$$ cat passwd > /dev/null 2>&1"
+log_must rm $TESTDIR/tar.$$ $TESTDIR/noxattr.tar $TESTDIR/xattr.tar
 
 
 log_assert "Basic applications work with xattrs: cpio cp find mv pax tar"
index 477e155a36c1a5368ca28124514d4a1fb969a731..26d6bd7dd75b178b617d33e63957acfc49b97993 100755 (executable)
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 #
 
 function cleanup {
-       log_must $RM $TESTDIR/myfile.$$
+       log_must rm $TESTDIR/myfile.$$
 }
 
 function get_pool_size {
        poolname=$1
-       psize=$($ZPOOL list -H -o allocated $poolname)
+       psize=$(zpool list -H -o allocated $poolname)
        if [[ $psize == *[mM] ]]
        then
-               returnvalue=$($ECHO $psize | $SED -e 's/m//g' -e 's/M//g')
+               returnvalue=$(echo $psize | sed -e 's/m//g' -e 's/M//g')
                returnvalue=$((returnvalue * 1024))
        else
-               returnvalue=$($ECHO $psize | $SED -e 's/k//g' -e 's/K//g')
+               returnvalue=$(echo $psize | sed -e 's/k//g' -e 's/K//g')
        fi
        echo $returnvalue
 }
@@ -65,7 +65,7 @@ function get_pool_size {
 log_assert "xattr file sizes count towards normal disk usage"
 log_onexit cleanup
 
-log_must $TOUCH $TESTDIR/myfile.$$
+log_must touch $TESTDIR/myfile.$$
 
 POOL_SIZE=0
 NEW_POOL_SIZE=0
@@ -77,12 +77,12 @@ then
        POOL_SIZE=$(get_pool_size $TESTPOOL)
 fi
 
-FS_SIZE=$($ZFS get -p -H -o value used $TESTPOOL/$TESTFS)
+FS_SIZE=$(zfs get -p -H -o value used $TESTPOOL/$TESTFS)
 
-log_must $RUNAT $TESTDIR/myfile.$$ $MKFILE 200m xattr
+log_must runat $TESTDIR/myfile.$$ mkfile 200m xattr
 
 #Make sure the newly created file is counted into zpool usage
-log_must $SYNC
+log_must sync
 
 # now check to see if our pool disk usage has increased
 if is_global_zone
@@ -95,7 +95,7 @@ then
 fi
 
 # also make sure our filesystem usage has increased
-NEW_FS_SIZE=$($ZFS get -p -H -o value used $TESTPOOL/$TESTFS)
+NEW_FS_SIZE=$(zfs get -p -H -o value used $TESTPOOL/$TESTFS)
 (($NEW_FS_SIZE <= $FS_SIZE)) && \
     log_fail "The new filesystem size $NEW_FS_SIZE was less \
     than or equal to the old filesystem size $FS_SIZE."
index 4e9e12ecc99a4bd0f6c8fb08f853259b7ff41264..50b8ffbfaca12c5c314a7e90ef5bfa1b349da80d 100755 (executable)
@@ -24,7 +24,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 
 function cleanup {
 
-       log_must $RM $TESTDIR/myfile.$$
+       log_must rm $TESTDIR/myfile.$$
 }
 
 
 log_assert "The noxattr mount option functions as expected"
 log_onexit cleanup
 
-$ZFS set 2>&1 | $GREP xattr > /dev/null
+zfs set 2>&1 | grep xattr > /dev/null
 if [ $? -ne 0 ]
 then
        log_unsupported "noxattr mount option not supported on this release."
 fi
 
-log_must $TOUCH $TESTDIR/myfile.$$
+log_must touch $TESTDIR/myfile.$$
 create_xattr $TESTDIR/myfile.$$ passwd /etc/passwd
 
-log_must $UMOUNT $TESTDIR
-log_must $ZFS mount -o noxattr $TESTPOOL/$TESTFS
+log_must umount $TESTDIR
+log_must zfs mount -o noxattr $TESTPOOL/$TESTFS
 
 # check that we can't perform xattr operations
-log_mustnot eval "$RUNAT $TESTDIR/myfile.$$ $CAT passwd > /dev/null 2>&1"
-log_mustnot eval "$RUNAT $TESTDIR/myfile.$$ $RM passwd > /dev/null 2>&1"
-log_mustnot eval "$RUNAT $TESTDIR/myfile.$$ $CP /etc/passwd . > /dev/null 2>&1"
+log_mustnot eval "runat $TESTDIR/myfile.$$ cat passwd > /dev/null 2>&1"
+log_mustnot eval "runat $TESTDIR/myfile.$$ rm passwd > /dev/null 2>&1"
+log_mustnot eval "runat $TESTDIR/myfile.$$ cp /etc/passwd . > /dev/null 2>&1"
 
-log_must $TOUCH $TESTDIR/new.$$
-log_mustnot eval "$RUNAT $TESTDIR/new.$$ $CP /etc/passwd . > /dev/null 2>&1"
-log_mustnot eval "$RUNAT $TESTDIR/new.$$ $RM passwd > /dev/null 2>&1"
+log_must touch $TESTDIR/new.$$
+log_mustnot eval "runat $TESTDIR/new.$$ cp /etc/passwd . > /dev/null 2>&1"
+log_mustnot eval "runat $TESTDIR/new.$$ rm passwd > /dev/null 2>&1"
 
 # now mount the filesystem again as normal
-log_must $UMOUNT $TESTDIR
-log_must $ZFS mount $TESTPOOL/$TESTFS
+log_must umount $TESTDIR
+log_must zfs mount $TESTPOOL/$TESTFS
 
 # we should still have an xattr on the first file
 verify_xattr $TESTDIR/myfile.$$ passwd /etc/passwd
 
 # there should be no xattr on the file we created while the fs was mounted
 # -o noxattr
-log_mustnot eval "$RUNAT $TESTDIR/new.$$ $CAT passwd > /dev/null 2>&1"
+log_mustnot eval "runat $TESTDIR/new.$$ cat passwd > /dev/null 2>&1"
 create_xattr $TESTDIR/new.$$ passwd /etc/passwd
 
 log_pass "The noxattr mount option functions as expected"
index d6509a55a8f1861e45171428a7e4a185b10bdb2b..56710093406c174a2595a30c637300b7973a32a1 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -39,9 +39,9 @@ function create_xattr { # filename xattr_name xattr_contents
        typeset XATTR_CONTENTS=$3
 
        # read any empty xattr on that file
-       log_must $RUNAT $FILE $LS
+       log_must runat $FILE ls
        # create the xattr
-       log_must $RUNAT $FILE $CP $XATTR_CONTENTS $XATTR_NAME
+       log_must runat $FILE cp $XATTR_CONTENTS $XATTR_NAME
 
        verify_xattr $FILE $XATTR_NAME $XATTR_CONTENTS
 }
@@ -53,11 +53,11 @@ function compare_xattrs { # filename1 filename2 xattr_name
        typeset FILE2=$2
        typeset XATTR_NAME=$3
 
-       $RUNAT $FILE1 $CAT $XATTR_NAME > /tmp/file1.$$
-       $RUNAT $FILE2 $CAT $XATTR_NAME > /tmp/file2.$$
+       runat $FILE1 cat $XATTR_NAME > /tmp/file1.$$
+       runat $FILE2 cat $XATTR_NAME > /tmp/file2.$$
 
-       log_must $DIFF /tmp/file1.$$ /tmp/file2.$$
-       log_must $RM /tmp/file1.$$ /tmp/file2.$$
+       log_must diff /tmp/file1.$$ /tmp/file2.$$
+       log_must rm /tmp/file1.$$ /tmp/file2.$$
 }
 
 function verify_xattr { # filename xattr_name xattr_contents
@@ -66,9 +66,9 @@ function verify_xattr { # filename xattr_name xattr_contents
        typeset XATTR_CONTENTS=$3
 
        # read the xattr, writing it to a temp file
-       log_must eval "$RUNAT $FILE $CAT $XATTR_NAME > /tmp/$XATTR_NAME.$$ 2>&1"
-       log_must $DIFF $XATTR_CONTENTS /tmp/$XATTR_NAME.$$
-       $RM /tmp/$XATTR_NAME.$$
+       log_must eval "runat $FILE cat $XATTR_NAME > /tmp/$XATTR_NAME.$$ 2>&1"
+       log_must diff $XATTR_CONTENTS /tmp/$XATTR_NAME.$$
+       rm /tmp/$XATTR_NAME.$$
 }
 
 function delete_xattr { # filename xattr_name
@@ -76,8 +76,8 @@ function delete_xattr { # filename xattr_name
         typeset XATTR_NAME=$2
 
         # delete the xattr
-        log_must $RUNAT $FILE $RM $XATTR_NAME
-        log_mustnot eval "$RUNAT $FILE $LS $XATTR_NAME > /dev/null 2>&1"
+        log_must runat $FILE rm $XATTR_NAME
+        log_mustnot eval "runat $FILE ls $XATTR_NAME > /dev/null 2>&1"
 }
 
 # not sure about this : really this should be testing write/append
@@ -85,11 +85,11 @@ function verify_write_xattr { # filename xattr_name
         typeset FILE=$1
         typeset XATTR_NAME=$2
 
-        log_must eval "$RUNAT $FILE $DD if=/etc/passwd of=$XATTR_NAME"
-        log_must eval "$RUNAT $FILE $CAT $XATTR_NAME > /tmp/$XATTR_NAME.$$ 2>&1"
-        log_must $DD if=/etc/passwd of=/tmp/passwd_dd.$$
-        log_must $DIFF /tmp/passwd_dd.$$ /tmp/$XATTR_NAME.$$
-        log_must $RM /tmp/passwd_dd.$$ /tmp/$XATTR_NAME.$$
+        log_must eval "runat $FILE dd if=/etc/passwd of=$XATTR_NAME"
+        log_must eval "runat $FILE cat $XATTR_NAME > /tmp/$XATTR_NAME.$$ 2>&1"
+        log_must dd if=/etc/passwd of=/tmp/passwd_dd.$$
+        log_must diff /tmp/passwd_dd.$$ /tmp/$XATTR_NAME.$$
+        log_must rm /tmp/passwd_dd.$$ /tmp/$XATTR_NAME.$$
 }
 
 # this function is to create the expected output
@@ -97,11 +97,11 @@ function create_expected_output  { # expected_output_file  contents_of_the_outpu
    typeset FILE=$1
    shift
    if [[ -f $FILE ]]; then
-      log_must $RM $FILE
+      log_must rm $FILE
    fi
 
    for line in $@
    do
-      log_must eval "$ECHO $line >> $FILE"
+      log_must eval "echo $line >> $FILE"
    done
  }
index 32422982c970ec23fa718f905fa4b43aa420d6b7..c9250d4e53e942f6c4d12ba92f1eced6570d6a7d 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -35,9 +35,9 @@
 verify_runnable "global"
 
 ismounted $TESTDIR $NEWFS_DEFAULT_FS
-(( $? == 0 )) && log_must $UMOUNT -f $TESTDIR
+(( $? == 0 )) && log_must umount -f $TESTDIR
 
-[[ -e $TESTDIR ]] && $RM -rf $TESTDIR
+[[ -e $TESTDIR ]] && rm -rf $TESTDIR
 
 default_zvol_cleanup
 
index 629fdfafb129e6e140ce49eb81793f4b1793a8c1..7ac3815febdd09dd3cf0d7de2e6cca3902792d21 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -42,10 +42,10 @@ fi
 
 default_zvol_setup $DISK $VOLSIZE $BLOCKSIZE
 
-$ECHO "y" | $NEWFS -v ${ZVOL_RDEVDIR}/$TESTPOOL/$TESTVOL >/dev/null 2>&1
+echo "y" | newfs -v ${ZVOL_RDEVDIR}/$TESTPOOL/$TESTVOL >/dev/null 2>&1
 (( $? != 0 )) && log_fail "Unable to newfs(1M) $TESTPOOL/$TESTVOL"
 
-log_must $MKDIR $TESTDIR
-log_must $MOUNT ${ZVOL_DEVDIR}/$TESTPOOL/$TESTVOL $TESTDIR
+log_must mkdir $TESTDIR
+log_must mount ${ZVOL_DEVDIR}/$TESTPOOL/$TESTVOL $TESTDIR
 
 log_pass
index 8284ffb864cc638a4d01d1ffc96ba5094a353c68..a2df9c4e0d9700cfeac4dd8e935f01fc07d7e3d9 100644 (file)
@@ -34,7 +34,7 @@
 verify_runnable "global"
 
 #export SIZE="1gb"
-export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
+export DISK_ARRAY_NUM=$(echo ${DISKS} | nawk '{print NF}')
 export DISKSARRAY=$DISKS
 
 
index 418ba72c175b18002cab887e762c86d3afd37590..f19fa9df3bf485c5506be2d2b263f76fcafe7c77 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -49,7 +49,7 @@ verify_runnable "global"
 
 function cleanup
 {
-       $RM -rf $TESTDIR/*
+       rm -rf $TESTDIR/*
 }
 
 log_assert "A zvol volume will return ENOSPC when the underlying pool " \
@@ -64,7 +64,7 @@ BLOCKSZ=$(( 1024 * 1024 ))
 NUM_WRITES=40
 
 while (( 1 )); do
-        $FILE_WRITE -o create -f $TESTDIR/testfile$$.$fn \
+        file_write -o create -f $TESTDIR/testfile$$.$fn \
             -b $BLOCKSZ -c $NUM_WRITES
         retval=$?
         if (( $retval != 0 )); then
index ebfbe5c5a8ce19c0d86cee40506d80ad5a09aed2..233867efe997f8e381ed20729e3ca14ab5df833a 100644 (file)
@@ -33,7 +33,7 @@
 
 verify_runnable "global"
 
-export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
+export DISK_ARRAY_NUM=$(echo ${DISKS} | nawk '{print NF}')
 export DISKSARRAY=$DISKS
 
 
index 4a4c6fbb7bd63dae9d5192df9dfc6c107076239b..847443ac0e95dad2fcc0d480112f82961a6877ce 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -56,7 +56,7 @@ log_assert "Executing well-formed 'zfs list' commands should return success"
 
 typeset -i i=0
 while (( $i < ${#args[*]} )); do
-       log_must eval "$ZFS ${args[i]} > /dev/null"
+       log_must eval "zfs ${args[i]} > /dev/null"
        ((i = i + 1))
 done
 
index 65315ed71bb2aa23d4d78cf95e1717049709b216..e5b69239f5667ef99c644b61b88e419656650a49 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -45,7 +45,7 @@ verify_runnable "global"
 function cleanup
 {
        datasetexists $TESTPOOL/$LONGVOLNAME && \
-               $ZFS destroy $TESTPOOL/$LONGVOLNAME
+               zfs destroy $TESTPOOL/$LONGVOLNAME
 }
 
 log_onexit cleanup
@@ -54,7 +54,7 @@ log_assert "Creating a volume a 50 letter name should work."
 
 LONGVOLNAME="volumename50charslong_0123456789012345678901234567"
 
-log_must $ZFS create -V $VOLSIZE $TESTPOOL/$LONGVOLNAME
+log_must zfs create -V $VOLSIZE $TESTPOOL/$LONGVOLNAME
 
 datasetexists $TESTPOOL/$LONGVOLNAME || \
        log_fail "Couldn't find long volume name"
index f092e480e29c5a7124f4fc481fe81633268f9c27..779a0baaa091547e56f06535b70ef6a3cf531305 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -52,7 +52,7 @@ log_assert "Try each ZFS volume sub-command without parameters to make sure" \
 
 typeset -i i=0
 while (( $i < ${#args[*]} )); do
-       log_mustnot $ZFS ${args[i]}
+       log_mustnot zfs ${args[i]}
        (( i = i + 1 ))
 done
 
index b5d5998fcc9bde2b67904aec7ba0cf6b890beeaf..bd4f6d8ed889447d95528b9ce62669ea832cc420 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -53,7 +53,7 @@ function default_zvol_setup # disk_device volume_size block_size
                create_args="-b $blocksize"
        fi
 
-       log_must $ZFS create $create_args -V $size $TESTPOOL/$TESTVOL
+       log_must zfs create $create_args -V $size $TESTPOOL/$TESTVOL
        block_device_wait
 }
 
@@ -64,7 +64,7 @@ function default_zvol_setup # disk_device volume_size block_size
 function default_zvol_cleanup
 {
         if datasetexists $TESTPOOL/$TESTVOL ; then
-               log_must $ZFS destroy $TESTPOOL/$TESTVOL
+               log_must zfs destroy $TESTPOOL/$TESTVOL
        fi
 
         destroy_pool $TESTPOOL
@@ -72,7 +72,7 @@ function default_zvol_cleanup
 
 function get_dumpdevice
 {
-       typeset ret=$($DUMPADM | $GREP "Dump device:" | $AWK '{print $3}')
+       typeset ret=$(dumpadm | grep "Dump device:" | awk '{print $3}')
        echo $ret
 }
 
@@ -85,16 +85,16 @@ function set_dumpsize
                return 1
        fi
 
-       log_must $ZFS set volsize=64m $volume
+       log_must zfs set volsize=64m $volume
 
        if ! is_linux; then
-               output=$($DUMPADM -d ${ZVOL_DEVDIR}/$volume 2>&1 | \
-                               $TAIL -1 | $AWK '{print $3}')
+               output=$(dumpadm -d /dev/zvol/dsk/$volume 2>&1 | \
+                               tail -1 | awk '{print $3}')
 
                if [[ -n $output ]]; then
                        (( output = output / 1024 / 1024 ))
                        (( output = output + output / 5 ))
-                       log_must $ZFS set volsize=${output}m $volume
+                       log_must zfs set volsize=${output}m $volume
                fi
        fi
 
@@ -112,13 +112,13 @@ function safe_dumpadm
        if [[ $device == "${ZVOL_DEVDIR}/"* ]] ; then
                typeset volume=${device#${ZVOL_DEVDIR}/}
                set_dumpsize $volume
-               log_must $DUMPADM -d $device
+               log_must dumpadm -d $device
        else
-               log_must $SWAPADD
+               log_must swapadd
                if ! is_swap_inuse $device ; then
-                       log_must $SWAP -a $device
+                       log_must swap -a $device
                fi
-               log_must $DUMPADM -d swap
+               log_must dumpadm -d swap
        fi
 }
 
@@ -131,7 +131,7 @@ function is_zvol_dumpified
                return 1
        fi
 
-       $ZDB -dddd $volume 2 | $GREP "dumpsize" > /dev/null 2>&1
+       zdb -dddd $volume 2 | grep "dumpsize" > /dev/null 2>&1
        return $?
 }
 
@@ -144,6 +144,6 @@ function is_swap_inuse
                return 1
        fi
 
-       $SWAP -l | $GREP -w $device > /dev/null 2>&1
+       swap -l | grep -w $device > /dev/null 2>&1
        return $?
 }
index 7b53a4e739eee71a482476d62069ec9fd57a9c8a..d970dd51f1220b19d00b588da5bdef3d68d7b4db 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 # Copyright 2016 Nexenta Systems, Inc.
 #
 
@@ -45,7 +45,7 @@
 
 verify_runnable "global"
 
-volsize=$($ZFS get -H -o value volsize $TESTPOOL/$TESTVOL)
+volsize=$(zfs get -H -o value volsize $TESTPOOL/$TESTVOL)
 
 function cleanup
 {
@@ -54,7 +54,7 @@ function cleanup
        if [[ $dumpdev != $savedumpdev ]] ; then
                safe_dumpadm $savedumpdev
        fi
-       $ZFS set volsize=$volsize $TESTPOOL/$TESTVOL
+       zfs set volsize=$volsize $TESTPOOL/$TESTVOL
 }
 
 log_assert "Verify that a ZFS volume can act as dump device."
index d3fdefb6b9fa4ed3d300316b1a4a99a7374831ea..c2e2755d668f30428584fa441a1c5c15e94a70f9 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 # Copyright 2016 Nexenta Systems, Inc.
 #
 
 
 verify_runnable "global"
 
-volsize=$($ZFS get -H -o value volsize $TESTPOOL/$TESTVOL)
+volsize=$(zfs get -H -o value volsize $TESTPOOL/$TESTVOL)
 
 function cleanup
 {
        snapexists $TESTPOOL/$TESTVOL@snap && \
-               $ZFS destroy $TESTPOOL/$TESTVOL@snap
+               zfs destroy $TESTPOOL/$TESTVOL@snap
 
        ismounted $TESTDIR ufs
-       (( $? == 0 )) && log_must $UMOUNT $TESTDIR
+       (( $? == 0 )) && log_must umount $TESTDIR
 
-       [[ -e $TESTDIR ]] && $RM -rf $TESTDIR
-       $ZFS set volsize=$volsize $TESTPOOL/$TESTVOL
+       [[ -e $TESTDIR ]] && rm -rf $TESTDIR
+       zfs set volsize=$volsize $TESTPOOL/$TESTVOL
 }
 
 log_assert "Verify that ZFS volume snapshot could be fscked"
@@ -65,19 +65,19 @@ TESTVOL='testvol'
 BLOCKSZ=$(( 1024 * 1024 ))
 NUM_WRITES=40
 
-log_must $ZFS set volsize=128m $TESTPOOL/$TESTVOL
+log_must zfs set volsize=128m $TESTPOOL/$TESTVOL
 
-$ECHO "y" | $NEWFS -v ${ZVOL_RDEVDIR}/$TESTPOOL/$TESTVOL >/dev/null 2>&1
+echo "y" | newfs -v ${ZVOL_RDEVDIR}/$TESTPOOL/$TESTVOL >/dev/null 2>&1
 (( $? != 0 )) && log_fail "Unable to newfs(1M) $TESTPOOL/$TESTVOL"
 
-log_must $MKDIR $TESTDIR
-log_must $MOUNT ${ZVOL_DEVDIR}/$TESTPOOL/$TESTVOL $TESTDIR
+log_must mkdir $TESTDIR
+log_must mount ${ZVOL_DEVDIR}/$TESTPOOL/$TESTVOL $TESTDIR
 
 typeset -i fn=0
 typeset -i retval=0
 
 while (( 1 )); do
-        $FILE_WRITE -o create -f $TESTDIR/testfile$$.$fn \
+        file_write -o create -f $TESTDIR/testfile$$.$fn \
             -b $BLOCKSZ -c $NUM_WRITES
         retval=$?
         if (( $retval != 0 )); then
@@ -87,8 +87,8 @@ while (( 1 )); do
         (( fn = fn + 1 ))
 done
 
-log_must $LOCKFS -f $TESTDIR
-log_must $ZFS snapshot $TESTPOOL/$TESTVOL@snap
+log_must lockfs -f $TESTDIR
+log_must zfs snapshot $TESTPOOL/$TESTVOL@snap
 
 $FSCK -n ${ZVOL_RDEVDIR}/$TESTPOOL/$TESTVOL@snap >/dev/null 2>&1
 retval=$?
index 321ddabb67e2241365319392f5e5fd8826445d65..d22582ac3b04587d8e552a5476d937c393a9057b 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 # Copyright 2016 Nexenta Systems, Inc.
 #
 
@@ -46,7 +46,7 @@
 
 verify_runnable "global"
 
-volsize=$($ZFS get -H -o value volsize $TESTPOOL/$TESTVOL)
+volsize=$(zfs get -H -o value volsize $TESTPOOL/$TESTVOL)
 
 function cleanup
 {
@@ -58,7 +58,7 @@ function cleanup
        if poolexists $TESTPOOL1 ; then
                destroy_pool $TESTPOOL1
        fi
-       $ZFS set volsize=$volsize $TESTPOOL/$TESTVOL
+       zfs set volsize=$volsize $TESTPOOL/$TESTVOL
 }
 
 log_assert "Verify zpool creation and newfs on dump zvol is denied."
@@ -70,11 +70,11 @@ savedumpdev=$(get_dumpdevice)
 safe_dumpadm $voldev
 
 unset NOINUSE_CHECK
-$ECHO "y" | $NEWFS -v $voldev > /dev/null 2>&1
+echo "y" | newfs -v $voldev > /dev/null 2>&1
 if (( $? == 0 )) ; then
        log_fail "newfs on dump zvol succeeded unexpectedly"
 fi
 
-log_mustnot $ZPOOL create $TESTPOOL1 $voldev
+log_mustnot zpool create $TESTPOOL1 $voldev
 
 log_pass "Verify zpool creation and newfs on dump zvol is denied."
index b78dd269ab46911f12eb81f75cb23d2cc849716d..5e031c3c2bc1db720b39246c9240786147dbcaee 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 # Copyright 2016 Nexenta Systems, Inc.
 #
 
@@ -45,7 +45,7 @@
 
 verify_runnable "global"
 
-volsize=$($ZFS get -H -o value volsize $TESTPOOL/$TESTVOL)
+volsize=$(zfs get -H -o value volsize $TESTPOOL/$TESTVOL)
 
 function cleanup
 {
@@ -54,35 +54,35 @@ function cleanup
                safe_dumpadm $savedumpdev
        fi
 
-       $SWAP -l | $GREP -w $voldev > /dev/null 2>&1
+       swap -l | grep -w $voldev > /dev/null 2>&1
         if (( $? == 0 ));  then
-               log_must $SWAP -d $voldev
+               log_must swap -d $voldev
        fi
 
        typeset snap
        for snap in snap0 snap1 ; do
                if datasetexists $TESTPOOL/$TESTVOL@$snap ; then
-                       log_must $ZFS destroy $TESTPOOL/$TESTVOL@$snap
+                       log_must zfs destroy $TESTPOOL/$TESTVOL@$snap
                fi
        done
-       $ZFS set volsize=$volsize $TESTPOOL/$TESTVOL
+       zfs set volsize=$volsize $TESTPOOL/$TESTVOL
 }
 
 function verify_snapshot
 {
        typeset volume=$1
 
-       log_must $ZFS snapshot $volume@snap0
-       log_must $ZFS snapshot $volume@snap1
+       log_must zfs snapshot $volume@snap0
+       log_must zfs snapshot $volume@snap1
        log_must datasetexists $volume@snap0 $volume@snap1
 
-       log_must $ZFS destroy $volume@snap1
-       log_must $ZFS snapshot $volume@snap1
+       log_must zfs destroy $volume@snap1
+       log_must zfs snapshot $volume@snap1
 
-       log_mustnot $ZFS rollback -r $volume@snap0
+       log_mustnot zfs rollback -r $volume@snap0
        log_must datasetexists $volume@snap0
 
-       log_must $ZFS destroy -r $volume@snap0
+       log_must zfs destroy -r $volume@snap0
 }
 
 log_assert "Verify the ability to take snapshots of zvols used as dump or swap."
@@ -102,12 +102,12 @@ log_mustnot is_zvol_dumpified $TESTPOOL/$TESTVOL
 
 # create snapshot over swap zvol
 
-log_must $SWAP -a $voldev
+log_must swap -a $voldev
 log_mustnot is_zvol_dumpified $TESTPOOL/$TESTVOL
 
 verify_snapshot $TESTPOOL/$TESTVOL
 
-log_must $SWAP -d $voldev
+log_must swap -d $voldev
 log_mustnot is_zvol_dumpified $TESTPOOL/$TESTVOL
 
 log_pass "Creating snapshots from dump/swap zvols succeeds."
index df6e8f7298da1bbdc3b2ee0343a9da939cdad33e..68d8dfb1ffbebeb0db4a27be0793eeeb6ad2d396 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 # Copyright 2016 Nexenta Systems, Inc.
 #
 
 
 verify_runnable "global"
 
-volsize=$($ZFS get -H -o value volsize $TESTPOOL/$TESTVOL)
+volsize=$(zfs get -H -o value volsize $TESTPOOL/$TESTVOL)
 
 function cleanup
 {
-       $SWAP -l | $GREP $voldev > /dev/null 2>&1
+       swap -l | grep $voldev > /dev/null 2>&1
        if (( $? == 0 )) ; then
-               log_must $SWAP -d $voldev
+               log_must swap -d $voldev
        fi
 
        typeset dumpdev=$(get_dumpdevice)
        if [[ $dumpdev != $savedumpdev ]] ; then
                safe_dumpadm $savedumpdev
        fi
-       $ZFS set volsize=$volsize $TESTPOOL/$TESTVOL
+       zfs set volsize=$volsize $TESTPOOL/$TESTVOL
 }
 
 log_assert "Verify a device cannot be dump and swap at the same time."
@@ -68,12 +68,12 @@ voldev=${ZVOL_DEVDIR}/$TESTPOOL/$TESTVOL
 savedumpdev=$(get_dumpdevice)
 
 # If device in swap list, it cannot be dump device
-log_must $SWAP -a $voldev
-log_mustnot $DUMPADM -d $voldev
-log_must $SWAP -d $voldev
+log_must swap -a $voldev
+log_mustnot dumpadm -d $voldev
+log_must swap -d $voldev
 
 # If device has dedicated as dump device, it cannot add into swap list
 safe_dumpadm $voldev
-log_mustnot $SWAP -a $voldev
+log_mustnot swap -a $voldev
 
 log_pass "A device cannot be dump and swap at the same time."
index 53e822a10a9132227047f772d63db7afb98f2160..9df136f04915dcbba41dc1f79eecbf9fe2cdd316 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 # Copyright 2016 Nexenta Systems, Inc.
 #
 
@@ -45,7 +45,7 @@
 
 verify_runnable "global"
 
-volsize=$($ZFS get -H -o value volsize $TESTPOOL/$TESTVOL)
+volsize=$(zfs get -H -o value volsize $TESTPOOL/$TESTVOL)
 
 function cleanup
 {
@@ -53,7 +53,7 @@ function cleanup
        if [[ $dumpdev != $savedumpdev ]] ; then
                safe_dumpadm $savedumpdev
        fi
-       $ZFS set volsize=$volsize $TESTPOOL/$TESTVOL
+       zfs set volsize=$volsize $TESTPOOL/$TESTVOL
 }
 
 log_assert "zfs volume as dumpdevice should have 128k volblocksize"
@@ -62,12 +62,12 @@ log_onexit cleanup
 voldev=${ZVOL_DEVDIR}/$TESTPOOL/$TESTVOL
 savedumpdev=$(get_dumpdevice)
 
-typeset oblksize=$($ZFS get -H -o value volblocksize $TESTPOOL/$TESTVOL)
+typeset oblksize=$(zfs get -H -o value volblocksize $TESTPOOL/$TESTVOL)
 log_note "original $TESTPOOL/$TESTVOL volblocksize=$oblksize"
 
 safe_dumpadm $voldev
 
-typeset blksize=$($ZFS get -H -o value volblocksize $TESTPOOL/$TESTVOL)
+typeset blksize=$(zfs get -H -o value volblocksize $TESTPOOL/$TESTVOL)
 
 if [[ $blksize != "128K" ]]; then
        log_fail "ZFS volume $TESTPOOL/$TESTVOL volblocksize=$blksize"
index 610bc85dc7f1f7f5e38a7e5db37a6b0a47d91350..27d81eea57efb6f02e66696c628180b42e37e5ff 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
 
 verify_runnable "global"
 
-log_must $SWAPADD
+log_must swapadd
 for swapdev in $SAVESWAPDEVS
 do
        if ! is_swap_inuse $swapdev ; then
-               log_must $SWAP -a $swapdev >/dev/null 2>&1
+               log_must swap -a $swapdev >/dev/null 2>&1
        fi
 done
 
 voldev=${ZVOL_DEVDIR}/$TESTPOOL/$TESTVOL
 if is_swap_inuse $voldev ; then
-       log_must $SWAP -d $voldev
+       log_must swap -d $voldev
 fi
 
 default_zvol_cleanup
index 9886bbe65ef94aaf7d7671f14511677ad41b32c4..8047cac236e9fe57f205543fefae9bac5ab69c17 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -37,7 +37,7 @@ verify_runnable "global"
 
 for i in $SAVESWAPDEVS ; do
        log_note "Executing: swap -d $i"
-       $SWAP -d $i >/dev/null 2>&1
+       swap -d $i >/dev/null 2>&1
        if [[ $? != 0 ]]; then
                log_untested "Unable to delete swap device $i because of" \
                                "insufficient RAM"
index abc31a9e8207ab1868ff4d69b61a537046234071..12d12723ac585ab4a677bf6c9e13fa716a28b519 100644 (file)
@@ -25,7 +25,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/tests/functional/zvol/zvol.cfg
@@ -33,7 +33,7 @@
 #
 # Remember swap devices
 #
-SAVESWAPDEVS=$($SWAP -l | $NAWK '(NR != 1) {print $1}')
+SAVESWAPDEVS=$(swap -l | nawk '(NR != 1) {print $1}')
 
 export BLOCKSZ=$(( 1024 * 1024 ))
 export NUM_WRITES=40
index 68d8ebb9d4d3470f9c9a77b7cc3220e049e36736..fc717114c94d4445c9c671605f495ebf11182fd5 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,10 +48,10 @@ verify_runnable "global"
 
 function cleanup
 {
-       $RM -rf /tmp/$TESTFILE
+       rm -rf /tmp/$TESTFILE
 
        if is_swap_inuse $voldev ; then
-               log_must $SWAP -d $voldev
+               log_must swap -d $voldev
        fi
 }
 
@@ -61,16 +61,16 @@ log_onexit cleanup
 
 voldev=${ZVOL_DEVDIR}/$TESTPOOL/$TESTVOL
 log_note "Add zvol volume as swap space"
-log_must $SWAP -a $voldev
+log_must swap -a $voldev
 
 log_note "Create a file under /tmp"
-log_must $FILE_WRITE -o create -f /tmp/$TESTFILE \
+log_must file_write -o create -f /tmp/$TESTFILE \
     -b $BLOCKSZ -c $NUM_WRITES -d $DATA
 
 [[ ! -f /tmp/$TESTFILE ]] &&
     log_fail "Unable to create file under /tmp"
 
-filesize=`$LS -l /tmp/$TESTFILE | $AWK '{print $5}'`
+filesize=`ls -l /tmp/$TESTFILE | awk '{print $5}'`
 tf_size=$(( BLOCKSZ * NUM_WRITES ))
 (( $tf_size != $filesize )) &&
     log_fail "testfile is ($filesize bytes), expected ($tf_size bytes)"
index 1657be10fc0b3e84ef009f11473c69c7416fab26..aae92439c1a32b1152422caf4fe99930bc24f9d3 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,7 +48,7 @@ log_assert "Using a zvol as swap space, fill /tmp to 80%."
 
 vol=$TESTPOOL/$TESTVOL
 swapdev=${ZVOL_DEVDIR}/$vol
-log_must $SWAP -a $swapdev
+log_must swap -a $swapdev
 
 # Get 80% of the number of 512 blocks in the zvol
 typeset -i count blks volsize=$(get_prop volsize $vol)
@@ -57,8 +57,8 @@ typeset -i count blks volsize=$(get_prop volsize $vol)
 ((count = blks / 2048))
 
 log_note "Fill 80% of swap"
-log_must $DD if=/dev/urandom of=/tmp/$TESTFILE bs=1048576 count=$count
-log_must $RM -f /tmp/$TESTFILE
-log_must $SWAP -d $swapdev
+log_must dd if=/dev/urandom of=/tmp/$TESTFILE bs=1048576 count=$count
+log_must rm -f /tmp/$TESTFILE
+log_must swap -d $swapdev
 
 log_pass "Using a zvol as swap space, fill /tmp to 80%."
index 0817caa2a4f46604b782805df4136c5e79415ef0..10d9fe9c088b0b47cda61d69fdbc17f13e86fd4f 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -48,16 +48,16 @@ verify_runnable "global"
 
 function cleanup
 {
-       [[ -f /tmp/$TESTFILE ]] && log_must $RM -f /tmp/$TESTFILE
-       [[ -f $NEW_VFSTAB_FILE ]] && log_must $RM -f $NEW_VFSTAB_FILE
+       [[ -f /tmp/$TESTFILE ]] && log_must rm -f /tmp/$TESTFILE
+       [[ -f $NEW_VFSTAB_FILE ]] && log_must rm -f $NEW_VFSTAB_FILE
        [[ -f $PREV_VFSTAB_FILE ]] && \
-           log_must $MV $PREV_VFSTAB_FILE $VFSTAB_FILE
-       [[ -f $PREV_VFSTAB_FILE ]] && $RM -f $PREV_VFSTAB_FILE
+           log_must mv $PREV_VFSTAB_FILE $VFSTAB_FILE
+       [[ -f $PREV_VFSTAB_FILE ]] && rm -f $PREV_VFSTAB_FILE
 
-       log_must $SWAPADD $VFSTAB_FILE
+       log_must swapadd $VFSTAB_FILE
 
         if is_swap_inuse $voldev ; then
-               log_must $SWAP -d $voldev
+               log_must swap -d $voldev
        fi
 
 }
@@ -72,23 +72,23 @@ VFSTAB_FILE=/etc/vfstab
 NEW_VFSTAB_FILE=/var/tmp/zvol_vfstab.$$
 PREV_VFSTAB_FILE=/var/tmp/zvol_vfstab.PREV.$$
 
-[[ -f $NEW_VFSTAB_FILE ]] && $CP /dev/null $NEW_VFSTAB_FILE
+[[ -f $NEW_VFSTAB_FILE ]] && cp /dev/null $NEW_VFSTAB_FILE
 
-$AWK '{if ($4 != "swap") print $1}' /etc/vfstab > $NEW_VFSTAB_FILE
-$ECHO "$voldev\t-\t-\tswap\t-\tno\t-"  >> $NEW_VFSTAB_FILE
+awk '{if ($4 != "swap") print $1}' /etc/vfstab > $NEW_VFSTAB_FILE
+echo "$voldev\t-\t-\tswap\t-\tno\t-"  >> $NEW_VFSTAB_FILE
 
 # Copy off the original vfstab, and run swapadd on the newly constructed one.
-log_must $CP $VFSTAB_FILE $PREV_VFSTAB_FILE
-log_must $CP $NEW_VFSTAB_FILE $VFSTAB_FILE
-log_must $SWAPADD $VFSTAB_FILE
+log_must cp $VFSTAB_FILE $PREV_VFSTAB_FILE
+log_must cp $NEW_VFSTAB_FILE $VFSTAB_FILE
+log_must swapadd $VFSTAB_FILE
 
-log_must $FILE_WRITE -o create -f /tmp/$TESTFILE \
+log_must file_write -o create -f /tmp/$TESTFILE \
     -b $BLOCKSZ -c $NUM_WRITES -d $DATA
 
 [[ ! -f /tmp/$TESTFILE ]] &&
     log_fail "Unable to create file under /tmp"
 
-filesize=`$LS -l /tmp/$TESTFILE | $AWK '{print $5}'`
+filesize=`ls -l /tmp/$TESTFILE | awk '{print $5}'`
 tf_size=$((BLOCKSZ * NUM_WRITES))
 (($tf_size != $filesize)) && \
     log_fail "testfile is ($filesize bytes), expected ($tf_size bytes)"
index 5d0eedf814ad394124cb6d39f6445481742cfefd..c96ea0136020b797f9d01170c0ec3b9bf9fabf48 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -46,8 +46,8 @@ verify_runnable "global"
 
 function cleanup
 {
-       is_swap_inuse $swapname && log_must $SWAP -d $swapname
-       datasetexists $vol && log_must $ZFS destroy $vol
+       is_swap_inuse $swapname && log_must swap -d $swapname
+       datasetexists $vol && log_must zfs destroy $vol
 }
 
 log_assert "For an added swap zvol, (2G <= volsize <= 16G)"
@@ -61,14 +61,14 @@ for vbs in 8192 16384 32768 65536 131072; do
                swapname="${ZVOL_DEVDIR}/$vol"
 
                # Create a sparse volume to test larger sizes
-               log_must $ZFS create -s -b $vbs -V $volsize $vol
-               log_must $SWAP -a $swapname
+               log_must zfs create -s -b $vbs -V $volsize $vol
+               log_must swap -a $swapname
 
                new_volsize=$(get_prop volsize $vol)
                [[ $volsize -eq $new_volsize ]] || log_fail "$volsize $new_volsize"
 
-               log_must $SWAP -d $swapname
-               log_must $ZFS destroy $vol
+               log_must swap -d $swapname
+               log_must zfs destroy $vol
        done
 done
 
index 7710b38a6a8ca4afdc191c0af2a8f1f3d405c1a4..61c6ff8be0a0c44d70452cf3a78bffd591effa82 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -54,16 +54,16 @@ typeset -i pageblocks volblocks max_swaplow
 # Both swaplow and swaplen are the desired length of
 # the swap area in 512-byte blocks.
 #
-((pageblocks = $($PAGESIZE) / 512))
+((pageblocks = $(getconf PAGESIZE) / 512))
 ((volblocks = $(get_prop volsize $vol) / 512))
 ((max_swaplow = (volblocks - (pageblocks * 2))))
 
 for i in {0..10}; do
-       swaplow=$($SHUF -n 1 -i ${pageblocks}-${max_swaplow})
+       swaplow=$(shuf -n 1 -i ${pageblocks}-${max_swaplow})
        ((maxlen = max_swaplow - swaplow))
-       swaplen=$($SHUF -n 1 -i ${pageblocks}-${maxlen})
-       log_must $SWAP -a $swapname $swaplow $swaplen
-       log_must $SWAP -d $swapname $swaplow
+       swaplen=$(shuf -n 1 -i ${pageblocks}-${maxlen})
+       log_must swap -a $swapname $swaplow $swaplen
+       log_must swap -d $swapname $swaplow
 done
 
 log_pass $assertion
index c49d49643028df74def8b7e1cad3aff67d7eee58..5788a86434872dc45df108c751d92fcc337594dd 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -50,7 +50,7 @@ function cleanup
        typeset -i i=0
 
        while ((count > 0)); do
-               log_must $SWAP -d $swapname ${swap_opt[$i]}
+               log_must swap -d $swapname ${swap_opt[$i]}
 
                ((i += 2))
                ((count -= 1))
@@ -67,7 +67,7 @@ typeset -x NOINUSE_CHECK=1
 
 typeset vol=$TESTPOOL/$TESTVOL
 typeset -i pageblocks volblocks
-((pageblocks = $($PAGESIZE) / 512))
+((pageblocks = $(getconf PAGESIZE) / 512))
 ((volblocks = $(get_prop volsize $vol) / 512))
 
 log_note "Verify volume can be add as several segments."
@@ -87,11 +87,11 @@ swapname=${ZVOL_DEVDIR}/$vol
 typeset -i i=0 count=0
 
 if is_swap_inuse $swapname ; then
-       log_must $SWAP -d $swapname
+       log_must swap -d $swapname
 fi
 
 while ((i < ${#swap_opt[@]})); do
-       log_must $SWAP -a $swapname ${swap_opt[$i]} ${swap_opt[((i+1))]}
+       log_must swap -a $swapname ${swap_opt[$i]} ${swap_opt[((i+1))]}
 
        ((i += 2))
        ((count += 1))
@@ -100,7 +100,7 @@ done
 log_note "Verify overlapping swap volume are not allowed"
 i=0
 while ((i < ${#swap_opt[@]})); do
-       log_mustnot $SWAP -a $swapname ${swap_opt[$i]}
+       log_mustnot swap -a $swapname ${swap_opt[$i]}
 
        ((i += 2))
 done
index 8be67842ce4a68ba5b9b1d66002ada78d24f906d..76b6651c3acba38a6c0148d57ae4ea819ee21b99 100644 (file)
@@ -10,7 +10,7 @@
 #
 
 #
-# Copyright (c) 2015 by Delphix. All rights reserved.
+# Copyright (c) 2015, 2016 by Delphix. All rights reserved.
 # Copyright (c) 2016, Intel Corporation.
 #
 
@@ -34,7 +34,7 @@ function get_sync_str
 
        [[ $sync -eq 0 ]] && sync_str='async'
        [[ $sync -eq 1 ]] && sync_str='sync'
-       $ECHO $sync_str
+       echo $sync_str
 }
 
 #
@@ -67,14 +67,14 @@ function do_fio_run
 
                                if $do_recreate; then
                                        recreate_perfpool
-                                       log_must $ZFS create $PERF_FS_OPTS \
+                                       log_must zfs create $PERF_FS_OPTS \
                                            $TESTFS
                                fi
 
                                if $clear_cache; then
                                        # Clear the ARC
-                                       $ZPOOL export $PERFPOOL
-                                       $ZPOOL import $PERFPOOL
+                                       zpool export $PERFPOOL
+                                       zpool import $PERFPOOL
                                fi
 
                                export RUNTIME=$PERF_RUNTIME
@@ -82,7 +82,7 @@ function do_fio_run
                                export NUMJOBS=$threads
                                export SYNC_TYPE=$sync
                                export BLOCKSIZE=$iosize
-                               $SYNC
+                               sync
 
                                # Start the data collection
                                do_collect_scripts $threads $sync $iosize
@@ -91,12 +91,12 @@ function do_fio_run
                                typeset suffix="$sync_str.$iosize-ios.$threads-threads"
 
                                # Define output file
-                               typeset logbase="$(get_perf_output_dir)/$($BASENAME \
+                               typeset logbase="$(get_perf_output_dir)/$(basename \
                                    $SUDO_COMMAND)"
                                typeset outfile="$logbase.fio.$suffix"
 
                                # Start the load
-                               log_must $FIO --output $outfile $FIO_SCRIPTS/$script
+                               log_must fio --output $outfile $FIO_SCRIPTS/$script
                        done
                done
        done
@@ -124,17 +124,17 @@ function do_collect_scripts
        typeset oIFS=$IFS
        IFS=','
        for item in $PERF_COLLECT_SCRIPTS; do
-               collect_scripts+=($($ECHO $item | $SED 's/^ *//g'))
+               collect_scripts+=($(echo $item | sed 's/^ *//g'))
        done
        IFS=$oIFS
 
        typeset idx=0
        while [[ $idx -lt "${#collect_scripts[@]}" ]]; do
-               typeset logbase="$(get_perf_output_dir)/$($BASENAME \
+               typeset logbase="$(get_perf_output_dir)/$(basename \
                    $SUDO_COMMAND)"
                typeset outfile="$logbase.${collect_scripts[$idx + 1]}.$suffix"
 
-               $TIMEOUT $PERF_RUNTIME ${collect_scripts[$idx]} >$outfile 2>&1 &
+               timeout $PERF_RUNTIME ${collect_scripts[$idx]} >$outfile 2>&1 &
                ((idx += 2))
        done
 
@@ -147,9 +147,9 @@ function do_collect_scripts
 function get_perf_output_dir
 {
        typeset dir="$(pwd)/perf_data"
-       [[ -d $dir ]] || $MKDIR -p $dir
+       [[ -d $dir ]] || mkdir -p $dir
 
-       $ECHO $dir
+       echo $dir
 }
 
 #
@@ -167,14 +167,14 @@ function recreate_perfpool
        if [[ -n $PERFPOOL_CREATE_CMD ]]; then
                log_must $PERFPOOL_CREATE_CMD
        else
-               log_must eval "$ZPOOL create -f $PERFPOOL $DISKS"
+               log_must eval "zpool create -f $PERFPOOL $DISKS"
        fi
 }
 
 function get_max_arc_size
 {
        if is_linux; then
-               typeset -l max_arc_size=`$AWK '$1 == "c_max" { print $3 }' \
+               typeset -l max_arc_size=`awk '$1 == "c_max" { print $3 }' \
                    /proc/spl/kstat/zfs/arcstats`
        else
                typeset -l max_arc_size=$(dtrace -qn 'BEGIN {
@@ -185,7 +185,7 @@ function get_max_arc_size
 
        [[ $? -eq 0 ]] || log_fail "get_max_arc_size failed"
 
-       $ECHO $max_arc_size
+       echo $max_arc_size
 }
 
 # Create a file with some information about how this system is configured.
@@ -193,26 +193,26 @@ function get_system_config
 {
        typeset config=$PERF_DATA_DIR/$1
 
-       $ECHO "{" >>$config
+       echo "{" >>$config
        if is_linux; then
-               $ECHO "  \"ncpus\": \"$($NPROC --all)\"," >>$config
-               $ECHO "  \"physmem\": \"$($FREE -b | \
-                   $AWK '$1 == "Mem:" { print $2 }')\"," >>$config
-               $ECHO "  \"c_max\": \"$(get_max_arc_size)\"," >>$config
-               $ECHO "  \"hostname\": \"$($UNAME -n)\"," >>$config
-               $ECHO "  \"kernel version\": \"$($UNAME -sr)\"," >>$config
+               echo "  \"ncpus\": \"$(nproc --all)\"," >>$config
+               echo "  \"physmem\": \"$(free -b | \
+                   awk '$1 == "Mem:" { print $2 }')\"," >>$config
+               echo "  \"c_max\": \"$(get_max_arc_size)\"," >>$config
+               echo "  \"hostname\": \"$(uname -n)\"," >>$config
+               echo "  \"kernel version\": \"$(uname -sr)\"," >>$config
        else
-               $DTRACE -qn 'BEGIN{
+               dtrace -qn 'BEGIN{
                    printf("  \"ncpus\": %d,\n", `ncpus);
                    printf("  \"physmem\": %u,\n", `physmem * `_pagesize);
                    printf("  \"c_max\": %u,\n", `arc_stats.arcstat_c_max.value.ui64);
                    printf("  \"kmem_flags\": \"0x%x\",", `kmem_flags);
                    exit(0)}' >>$config
-               $ECHO "  \"hostname\": \"$($UNAME -n)\"," >>$config
-               $ECHO "  \"kernel version\": \"$($UNAME -v)\"," >>$config
+               echo "  \"hostname\": \"$(uname -n)\"," >>$config
+               echo "  \"kernel version\": \"$(uname -v)\"," >>$config
        fi
        if is_linux; then
-               $LSBLK -dino NAME,SIZE | $AWK 'BEGIN {
+               lsblk -dino NAME,SIZE | awk 'BEGIN {
                    printf("  \"disks\": {\n"); first = 1}
                    {disk = $1} {size = $2;
                    if (first != 1) {printf(",\n")} else {first = 0}
@@ -246,7 +246,7 @@ function get_system_config
                done
                printf "\n  }\n" >>$config
        else
-               $IOSTAT -En | $AWK 'BEGIN {
+               iostat -En | awk 'BEGIN {
                    printf("  \"disks\": {\n"); first = 1}
                    /^c/ {disk = $1}
                    /^Size: [^0]/ {size = $2;
@@ -254,13 +254,13 @@ function get_system_config
                    printf("    \"%s\": \"%s\"", disk, size)}
                    END {printf("\n  },\n")}' >>$config
 
-               $SED -n 's/^set \(.*\)[ ]=[ ]\(.*\)/\1=\2/p' /etc/system | \
-                   $AWK -F= 'BEGIN {printf("  \"system\": {\n"); first = 1}
+               sed -n 's/^set \(.*\)[ ]=[ ]\(.*\)/\1=\2/p' /etc/system | \
+                   awk -F= 'BEGIN {printf("  \"system\": {\n"); first = 1}
                    {if (first != 1) {printf(",\n")} else {first = 0};
                    printf("    \"%s\": %s", $1, $2)}
                    END {printf("\n  }\n")}' >>$config
        fi
-       $ECHO "}" >>$config
+       echo "}" >>$config
 }
 
 function num_jobs_by_cpu
@@ -268,13 +268,13 @@ function num_jobs_by_cpu
        if is_linux; then
                typeset ncpu=$($NPROC --all)
        else
-               typeset ncpu=$($PSRINFO | $WC -l)
+               typeset ncpu=$(psrinfo | $WC -l)
        fi
        typeset num_jobs=$ncpu
 
-       [[ $ncpu -gt 8 ]] && num_jobs=$($ECHO "$ncpu * 3 / 4" | $BC)
+       [[ $ncpu -gt 8 ]] && num_jobs=$(echo "$ncpu * 3 / 4" | bc)
 
-       $ECHO $num_jobs
+       echo $num_jobs
 }
 
 #
@@ -287,28 +287,28 @@ function pool_to_lun_list
        typeset lun_list=':'
 
        if is_linux; then
-               ctds=$($ZPOOL list -HLv $pool | \
-                   $AWK '/sd[a-z]*|loop[0-9]*|dm-[0-9]*/ {print $1}')
+               ctds=$(zpool list -HLv $pool | \
+                   awk '/sd[a-z]*|loop[0-9]*|dm-[0-9]*/ {print $1}')
 
                for ctd in $ctds; do
                        lun_list="$lun_list$ctd:"
                done
        else
-               ctds=$($ZPOOL list -v $pool |
-                   $AWK '/c[0-9]*t[0-9a-fA-F]*d[0-9]*/ {print $1}')
+               ctds=$(zpool list -v $pool |
+                   awk '/c[0-9]*t[0-9a-fA-F]*d[0-9]*/ {print $1}')
 
                for ctd in $ctds; do
                # Get the device name as it appears in /etc/path_to_inst
-               devname=$($READLINK -f /dev/dsk/${ctd}s0 | $SED -n \
+               devname=$(readlink -f /dev/dsk/${ctd}s0 | sed -n \
                    's/\/devices\([^:]*\):.*/\1/p')
                # Add a string composed of the driver name and instance
                # number to the list for comparison with dev_statname.
-               lun=$($SED 's/"//g' /etc/path_to_inst | $GREP \
-                   $devname | $AWK '{print $3$2}')
+               lun=$(sed 's/"//g' /etc/path_to_inst | grep \
+                   $devname | awk '{print $3$2}')
                un_list="$lun_list$lun:"
                done
        fi
-       $ECHO $lun_list
+       echo $lun_list
 }
 
 # Create a perf_data directory to hold performance statistics and
index 2203d649c181beb33a182ee264437a08cd9707f1..8ec8cd67afef3be0a107dab1ee364007e27da69c 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2015 by Delphix. All rights reserved.
+# Copyright (c) 2015, 2016 by Delphix. All rights reserved.
 #
 
 #
 function cleanup
 {
        # kill fio and iostat
-       $PKILL ${FIO##*/}
-       $PKILL ${IOSTAT##*/}
-       log_must_busy $ZFS destroy $TESTFS
-       log_must_busy $ZPOOL destroy $PERFPOOL
+       pkill ${fio##*/}
+       pkill ${iostat##*/}
+       log_must_busy zfs destroy $TESTFS
+       log_must_busy zpool destroy $PERFPOOL
 }
 
 trap "log_fail \"Measure IO stats during random read load\"" SIGTERM
@@ -45,7 +45,7 @@ log_onexit cleanup
 
 export TESTFS=$PERFPOOL/testfs
 recreate_perfpool
-log_must $ZFS create $PERF_FS_OPTS $TESTFS
+log_must zfs create $PERF_FS_OPTS $TESTFS
 
 # Aim to fill the pool to 50% capacity while accounting for a 3x compressratio.
 export TOTAL_SIZE=$(($(get_prop avail $TESTFS) * 3 / 2))
@@ -70,20 +70,20 @@ fi
 # of the available files.
 export NUMJOBS=$(get_max $PERF_NTHREADS)
 export FILE_SIZE=$((TOTAL_SIZE / NUMJOBS))
-log_must $FIO $FIO_SCRIPTS/mkfiles.fio
+log_must fio $FIO_SCRIPTS/mkfiles.fio
 
 # Set up the scripts and output files that will log performance data.
 lun_list=$(pool_to_lun_list $PERFPOOL)
 log_note "Collecting backend IO stats with lun list $lun_list"
 if is_linux; then
-        export collect_scripts=("$ZPOOL iostat -lpvyL $PERFPOOL 1" "zpool.iostat"
-            "$VMSTAT 1" "vmstat" "$MPSTAT -P ALL 1" "mpstat" "$IOSTAT -dxyz 1"
+        export collect_scripts=("zpool iostat -lpvyL $PERFPOOL 1" "zpool.iostat"
+            "vmstat 1" "vmstat" "mpstat -P ALL 1" "mpstat" "iostat -dxyz 1"
             "iostat")
 else
        export collect_scripts=("$PERF_SCRIPTS/io.d $PERFPOOL $lun_list 1" "io"
-           "$VMSTAT 1" "vmstat" "$MPSTAT 1" "mpstat" "$IOSTAT -xcnz 1" "iostat")
+           "vmstat 1" "vmstat" "mpstat 1" "mpstat" "iostat -xcnz 1" "iostat")
 fi
 
 log_note "Random reads with $PERF_RUNTYPE settings"
-do_fio_run random_reads.fio $FALSE $TRUE
+do_fio_run random_reads.fio false true
 log_pass "Measure IO stats during random read load"
index 50bf2b08e0ded69795b7531700ca70853f0df9be..cf12c9b09017ad7fb3fe78b60ee5520bab74c75d 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2015 by Delphix. All rights reserved.
+# Copyright (c) 2015, 2016 by Delphix. All rights reserved.
 #
 
 #
 function cleanup
 {
        # kill fio and iostat
-       $PKILL ${FIO##*/}
-       $PKILL ${IOSTAT##*/}
-       log_must_busy $ZFS destroy $TESTFS
-       log_must_busy $ZPOOL destroy $PERFPOOL
+       pkill ${fio##*/}
+       pkill ${iostat##*/}
+       log_must_busy zfs destroy $TESTFS
+       log_must_busy zpool destroy $PERFPOOL
 }
 
 trap "log_fail \"Measure IO stats during random read load\"" SIGTERM
@@ -45,7 +45,7 @@ log_onexit cleanup
 
 export TESTFS=$PERFPOOL/testfs
 recreate_perfpool
-log_must $ZFS create $PERF_FS_OPTS $TESTFS
+log_must zfs create $PERF_FS_OPTS $TESTFS
 
 # Aim to fill the pool to 50% capacity while accounting for a 3x compressratio.
 export TOTAL_SIZE=$(($(get_prop avail $TESTFS) * 3 / 2))
@@ -70,20 +70,20 @@ fi
 # a subset of the available files.
 export NUMJOBS=$(get_max $PERF_NTHREADS)
 export FILE_SIZE=$((TOTAL_SIZE / NUMJOBS))
-log_must $FIO $FIO_SCRIPTS/mkfiles.fio
+log_must fio $FIO_SCRIPTS/mkfiles.fio
 
 # Set up the scripts and output files that will log performance data.
 lun_list=$(pool_to_lun_list $PERFPOOL)
 log_note "Collecting backend IO stats with lun list $lun_list"
 if is_linux; then
-       export collect_scripts=("$ZPOOL iostat -lpvyL $PERFPOOL 1" "zpool.iostat"
-           "$VMSTAT 1" "vmstat" "$MPSTAT -P ALL 1" "mpstat" "$IOSTAT -dxyz 1"
+       export collect_scripts=("zpool iostat -lpvyL $PERFPOOL 1" "zpool.iostat"
+           "vmstat 1" "vmstat" "mpstat -P ALL 1" "mpstat" "iostat -dxyz 1"
            "iostat")
 else
        export collect_scripts=("$PERF_SCRIPTS/io.d $PERFPOOL $lun_list 1" "io"
-           "$VMSTAT 1" "vmstat" "$MPSTAT 1" "mpstat" "$IOSTAT -xcnz 1" "iostat")
+           "vmstat 1" "vmstat" "mpstat 1" "mpstat" "iostat -xcnz 1" "iostat")
 fi
 
 log_note "Random reads and writes with $PERF_RUNTYPE settings"
-do_fio_run random_readwrite.fio $FALSE $TRUE
+do_fio_run random_readwrite.fio false true
 log_pass "Measure IO stats during random read and write load"
index 186232e198cb3330596d102a12281f7c3b123e53..8db5fbd32bd290f061677feaee209ccd50f1a997 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2015 by Delphix. All rights reserved.
+# Copyright (c) 2015, 2016 by Delphix. All rights reserved.
 #
 
 #
 function cleanup
 {
        # kill fio and iostat
-       $PKILL ${FIO##*/}
-       $PKILL ${IOSTAT##*/}
-       log_must_busy $ZFS destroy $TESTFS
-       log_must_busy $ZPOOL destroy $PERFPOOL
+       pkill ${fio##*/}
+       pkill ${iostat##*/}
+       log_must_busy zfs destroy $TESTFS
+       log_must_busy zpool destroy $PERFPOOL
 }
 
 trap "log_fail \"Measure IO stats during random read load\"" SIGTERM
@@ -44,7 +44,7 @@ log_onexit cleanup
 
 export TESTFS=$PERFPOOL/testfs
 recreate_perfpool
-log_must $ZFS create $PERF_FS_OPTS $TESTFS
+log_must zfs create $PERF_FS_OPTS $TESTFS
 
 # Aim to fill the pool to 50% capacity while accounting for a 3x compressratio.
 export TOTAL_SIZE=$(($(get_prop avail $TESTFS) * 3 / 2))
@@ -68,14 +68,14 @@ fi
 lun_list=$(pool_to_lun_list $PERFPOOL)
 log_note "Collecting backend IO stats with lun list $lun_list"
 if is_linux; then
-       export collect_scripts=("$ZPOOL iostat -lpvyL $PERFPOOL 1" "zpool.iostat"
-           "$VMSTAT 1" "vmstat" "$MPSTAT -P ALL 1" "mpstat" "$IOSTAT -dxyz 1"
+       export collect_scripts=("zpool iostat -lpvyL $PERFPOOL 1" "zpool.iostat"
+           "vmstat 1" "vmstat" "mpstat -P ALL 1" "mpstat" "iostat -dxyz 1"
            "iostat")
 else
        export collect_scripts=("$PERF_SCRIPTS/io.d $PERFPOOL $lun_list 1" "io"
-           "$VMSTAT 1" "vmstat" "$MPSTAT 1" "mpstat" "$IOSTAT -xcnz 1" "iostat")
+           "vmstat 1" "vmstat" "mpstat 1" "mpstat" "iostat -xcnz 1" "iostat")
 fi
 
 log_note "Random writes with $PERF_RUNTYPE settings"
-do_fio_run random_writes.fio $TRUE $FALSE
+do_fio_run random_writes.fio true false
 log_pass "Measure IO stats during random write load"
index 52c9631d1899a20252fb14edf4a2058906dea7cd..af53e5d1e16c6bf0933ff31d2c6542c4fbd19a93 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2015 by Delphix. All rights reserved.
+# Copyright (c) 2015, 2016 by Delphix. All rights reserved.
 #
 
 #
 function cleanup
 {
        # kill fio and iostat
-       $PKILL ${FIO##*/}
-       $PKILL ${IOSTAT##*/}
-       log_must_busy $ZFS destroy $TESTFS
-       log_must_busy $ZPOOL destroy $PERFPOOL
+       pkill ${fio##*/}
+       pkill ${iostat##*/}
+       log_must_busy zfs destroy $TESTFS
+       log_must_busy zpool destroy $PERFPOOL
 }
 
 trap "log_fail \"Measure IO stats during random read load\"" SIGTERM
@@ -45,7 +45,7 @@ log_onexit cleanup
 
 export TESTFS=$PERFPOOL/testfs
 recreate_perfpool
-log_must $ZFS create $PERF_FS_OPTS $TESTFS
+log_must zfs create $PERF_FS_OPTS $TESTFS
 
 # Aim to fill the pool to 50% capacity while accounting for a 3x compressratio.
 export TOTAL_SIZE=$(($(get_prop avail $TESTFS) * 3 / 2))
@@ -70,21 +70,21 @@ fi
 # of the available files.
 export NUMJOBS=$(get_max $PERF_NTHREADS)
 export FILE_SIZE=$((TOTAL_SIZE / NUMJOBS))
-log_must $FIO $FIO_SCRIPTS/mkfiles.fio
+log_must fio $FIO_SCRIPTS/mkfiles.fio
 
 # Set up the scripts and output files that will log performance data.
 lun_list=$(pool_to_lun_list $PERFPOOL)
 log_note "Collecting backend IO stats with lun list $lun_list"
 if is_linux; then
-       export collect_scripts=("$ZPOOL iostat -lpvyL $PERFPOOL 1" "zpool.iostat"
-           "$PERF_SCRIPTS/prefetch_io.sh $PERFPOOL 1" "prefetch" "$VMSTAT 1"
-           "vmstat" "$MPSTAT  -P ALL 1" "mpstat" "$IOSTAT -dxyz 1" "iostat")
+       export collect_scripts=("zpool iostat -lpvyL $PERFPOOL 1" "zpool.iostat"
+           "$PERF_SCRIPTS/prefetch_io.sh $PERFPOOL 1" "prefetch" "vmstat 1"
+           "vmstat" "mpstat  -P ALL 1" "mpstat" "iostat -dxyz 1" "iostat")
 else
        export collect_scripts=("$PERF_SCRIPTS/io.d $PERFPOOL $lun_list 1" "io"
-           "$PERF_SCRIPTS/prefetch_io.d $PERFPOOL 1" "prefetch" "$VMSTAT 1"
-           "vmstat" "$MPSTAT 1" "mpstat" "$IOSTAT -xcnz 1" "iostat")
+           "$PERF_SCRIPTS/prefetch_io.d $PERFPOOL 1" "prefetch" "vmstat 1" "vmstat"
+           "mpstat 1" "mpstat" "iostat -xcnz 1" "iostat")
 fi
 
 log_note "Sequential reads with $PERF_RUNTYPE settings"
-do_fio_run sequential_reads.fio $FALSE $TRUE
+do_fio_run sequential_reads.fio false true
 log_pass "Measure IO stats during sequential read load"
index 9dfbe0663d34cd35674c459260021941be428afe..5445f814e82c9ecffd19e67328ca01099a093057 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2015 by Delphix. All rights reserved.
+# Copyright (c) 2015, 2016 by Delphix. All rights reserved.
 #
 
 #
 function cleanup
 {
        # kill fio and iostat
-       $PKILL ${FIO##*/}
-       $PKILL ${IOSTAT##*/}
-       log_must_busy $ZFS destroy $TESTFS
-       log_must_busy $ZPOOL destroy $PERFPOOL
+       pkill ${fio##*/}
+       pkill ${iostat##*/}
+       log_must_busy zfs destroy $TESTFS
+       log_must_busy zpool destroy $PERFPOOL
 }
 
 trap "log_fail \"Measure IO stats during random read load\"" SIGTERM
@@ -44,7 +44,7 @@ log_onexit cleanup
 
 export TESTFS=$PERFPOOL/testfs
 recreate_perfpool
-log_must $ZFS create $PERF_FS_OPTS $TESTFS
+log_must zfs create $PERF_FS_OPTS $TESTFS
 
 # Make sure the working set can be cached in the arc. Aim for 1/2 of arc.
 export TOTAL_SIZE=$(($(get_max_arc_size) / 2))
@@ -69,21 +69,21 @@ fi
 # of the available files.
 export NUMJOBS=$(get_max $PERF_NTHREADS)
 export FILE_SIZE=$((TOTAL_SIZE / NUMJOBS))
-log_must $FIO $FIO_SCRIPTS/mkfiles.fio
+log_must fio $FIO_SCRIPTS/mkfiles.fio
 
 # Set up the scripts and output files that will log performance data.
 lun_list=$(pool_to_lun_list $PERFPOOL)
 log_note "Collecting backend IO stats with lun list $lun_list"
 if is_linux; then
-       export collect_scripts=("$ZPOOL iostat -lpvyL $PERFPOOL 1" "zpool.iostat"
-           "$PERF_SCRIPTS/prefetch_io.sh $PERFPOOL 1" "prefetch" "$VMSTAT 1"
-           "vmstat" "$MPSTAT -P ALL 1" "mpstat" "$IOSTAT -dxyz 1" "iostat")
+       export collect_scripts=("zpool iostat -lpvyL $PERFPOOL 1" "zpool.iostat"
+           "$PERF_SCRIPTS/prefetch_io.sh $PERFPOOL 1" "prefetch" "vmstat 1"
+           "vmstat" "mpstat -P ALL 1" "mpstat" "iostat -dxyz 1" "iostat")
 else
        export collect_scripts=("$PERF_SCRIPTS/io.d $PERFPOOL $lun_list 1" "io"
-           "$PERF_SCRIPTS/prefetch_io.d $PERFPOOL 1" "prefetch" "$VMSTAT 1"
-           "vmstat" "$MPSTAT 1" "mpstat" "$IOSTAT -xcnz 1" "iostat")
+           "$PERF_SCRIPTS/prefetch_io.d $PERFPOOL 1" "prefetch" "vmstat 1" "vmstat"
+           "mpstat 1" "mpstat" "iostat -xcnz 1" "iostat")
 fi
 
 log_note "Sequential cached reads with $PERF_RUNTYPE settings"
-do_fio_run sequential_reads.fio $FALSE $FALSE
+do_fio_run sequential_reads.fio false false
 log_pass "Measure IO stats during sequential cached read load"
index 6b147f0f24ad73b174a011a26860fd4cfd2b2f69..5d7175b1ad078f9428d6488f16e048df9c3894ca 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2015 by Delphix. All rights reserved.
+# Copyright (c) 2015, 2016 by Delphix. All rights reserved.
 #
 
 #
 function cleanup
 {
        # kill fio and iostat
-       $PKILL ${FIO##*/}
-       $PKILL ${IOSTAT##*/}
-       log_must_busy $ZFS destroy $TESTFS
-       log_must_busy $ZPOOL destroy $PERFPOOL
+       pkill ${fio##*/}
+       pkill ${iostat##*/}
+       log_must_busy zfs destroy $TESTFS
+       log_must_busy zpool destroy $PERFPOOL
 }
 
 trap "log_fail \"Measure IO stats during random read load\"" SIGTERM
@@ -50,7 +50,7 @@ log_onexit cleanup
 
 export TESTFS=$PERFPOOL/testfs
 recreate_perfpool
-log_must $ZFS create $PERF_FS_OPTS $TESTFS
+log_must zfs create $PERF_FS_OPTS $TESTFS
 
 # Make sure the working set can be cached in the arc. Aim for 1/2 of arc.
 export TOTAL_SIZE=$(($(get_max_arc_size) / 2))
@@ -75,7 +75,7 @@ fi
 # of the available files.
 export NUMJOBS=$(get_max $PERF_NTHREADS)
 export FILE_SIZE=$((TOTAL_SIZE / NUMJOBS))
-log_must $FIO $FIO_SCRIPTS/mkfiles.fio
+log_must fio $FIO_SCRIPTS/mkfiles.fio
 
 log_note "Creating snapshot, $TESTSNAP, of $TESTFS"
 create_snapshot $TESTFS $TESTSNAP
@@ -91,15 +91,15 @@ export TESTFS=$PERFPOOL/$TESTCLONE
 lun_list=$(pool_to_lun_list $PERFPOOL)
 log_note "Collecting backend IO stats with lun list $lun_list"
 if is_linux; then
-       export collect_scripts=("$ZPOOL iostat -lpvyL $PERFPOOL 1" "zpool.iostat"
-           "$PERF_SCRIPTS/prefetch_io.sh $PERFPOOL 1" "prefetch" "$VMSTAT 1"
-           "vmstat" "$MPSTAT -P ALL 1" "mpstat" "$IOSTAT -dxyz 1" "iostat")
+       export collect_scripts=("zpool iostat -lpvyL $PERFPOOL 1" "zpool.iostat"
+           "$PERF_SCRIPTS/prefetch_io.sh $PERFPOOL 1" "prefetch" "vmstat 1"
+           "vmstat" "mpstat -P ALL 1" "mpstat" "iostat -dxyz 1" "iostat")
 else
        export collect_scripts=("$PERF_SCRIPTS/io.d $PERFPOOL $lun_list 1" "io"
-           "$PERF_SCRIPTS/prefetch_io.d $PERFPOOL 1" "prefetch" "$VMSTAT 1"
-           "vmstat" "$MPSTAT 1" "mpstat" "$IOSTAT -xcnz 1" "iostat")
+           "$PERF_SCRIPTS/prefetch_io.d $PERFPOOL 1" "prefetch" "vmstat 1" "vmstat"
+           "mpstat 1" "mpstat" "iostat -xcnz 1" "iostat")
 fi
 
 log_note "Sequential cached reads from $TESTFS with $PERF_RUNTYPE settings"
-do_fio_run sequential_reads.fio $FALSE $FALSE
+do_fio_run sequential_reads.fio false false
 log_pass "Measure IO stats during sequential cached read load"
index 905723e5a180c67d14a7e668fe23ab0d8868743c..3319bd47c317607f3a6936656ced86f5f5f1638a 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2015 by Delphix. All rights reserved.
+# Copyright (c) 2015, 2016 by Delphix. All rights reserved.
 #
 
 #
@@ -34,17 +34,17 @@ log_onexit cleanup
 function cleanup
 {
        # kill fio and iostat
-       $PKILL ${FIO##*/}
-       $PKILL ${IOSTAT##*/}
-       log_must_busy $ZFS destroy $TESTFS
-       log_must_busy $ZPOOL destroy $PERFPOOL
+       pkill ${fio##*/}
+       pkill ${iostat##*/}
+       log_must_busy zfs destroy $TESTFS
+       log_must_busy zpool destroy $PERFPOOL
 }
 
 trap "log_fail \"Measure IO stats during random read load\"" SIGTERM
 
 export TESTFS=$PERFPOOL/testfs
 recreate_perfpool
-log_must $ZFS create $PERF_FS_OPTS $TESTFS
+log_must zfs create $PERF_FS_OPTS $TESTFS
 
 # Aim to fill the pool to 50% capacity while accounting for a 3x compressratio.
 export TOTAL_SIZE=$(($(get_prop avail $TESTFS) * 3 / 2))
@@ -68,14 +68,14 @@ fi
 lun_list=$(pool_to_lun_list $PERFPOOL)
 log_note "Collecting backend IO stats with lun list $lun_list"
 if is_linux; then
-       export collect_scripts=("$ZPOOL iostat -lpvyL $PERFPOOL 1" "zpool.iostat"
-           "$VMSTAT 1" "vmstat" "$MPSTAT -P ALL 1" "mpstat" "$IOSTAT -dxyz 1"
+       export collect_scripts=("zpool iostat -lpvyL $PERFPOOL 1" "zpool.iostat"
+           "vmstat 1" "vmstat" "mpstat -P ALL 1" "mpstat" "iostat -dxyz 1"
            "iostat")
 else
        export collect_scripts=("$PERF_SCRIPTS/io.d $PERFPOOL $lun_list 1" "io"
-           "$VMSTAT 1" "vmstat" "$MPSTAT 1" "mpstat" "$IOSTAT -xcnz 1" "iostat")
+           "vmstat 1" "vmstat" "mpstat 1" "mpstat" "iostat -xcnz 1" "iostat")
 fi
 
 log_note "Sequential writes with $PERF_RUNTYPE settings"
-do_fio_run sequential_writes.fio $TRUE $FALSE
+do_fio_run sequential_writes.fio true false
 log_pass "Measure IO stats during sequential write load"
index 5e6fe37cb3264a5a1dac0de871fc512b31053f5a..1544f637d8d9390db893b613c0fc53a308f061bf 100755 (executable)
 
 . $STF_SUITE/include/libtest.shlib
 
-[[ -z $FIO ]] && log_fail "Missing fio"
-[[ -z $FREE ]] && log_fail "Missing free"
-[[ -z $IOSTAT ]] && log_fail "Missing iostat"
-[[ -z $LSBLK ]] && log_fail "Missing lsblk"
-[[ -z $MPSTAT ]] && log_fail "Missing mpstat"
-[[ -z $VMSTAT ]] && log_fail "Missing vmstat"
-
 verify_runnable "global"
 verify_disk_count "$DISKS" 3
 
index 3dd9e6c36d5efbaf66e48a8b873be19112ca6f06..85e7d940a98b82b6d573ca114b9926ed32b180a0 100755 (executable)
 
 zfs_kstats="/proc/spl/kstat/zfs"
 
-AWK=${AWK:-awk}
-DATE=${DATE:-date}
-
 function get_prefetch_ios
 {
-        typeset -l data_misses=`$AWK '$1 == "prefetch_data_misses" \
+        typeset -l data_misses=`awk '$1 == "prefetch_data_misses" \
             { print $3 }' $zfs_kstats/arcstats`
-        typeset -l metadata_misses=`$AWK '$1 == "prefetch_metadata_misses" \
+        typeset -l metadata_misses=`awk '$1 == "prefetch_metadata_misses" \
             { print $3 }' $zfs_kstats/arcstats`
         typeset -l total_misses=$(( $data_misses + $metadata_misses ))
 
@@ -38,7 +35,7 @@ function get_prefetch_ios
 
 function get_prefetched_demand_reads
 {
-       typeset -l demand_reads=`$AWK '$1 == "demand_hit_predictive_prefetch" \
+       typeset -l demand_reads=`awk '$1 == "demand_hit_predictive_prefetch" \
            { print $3 }' $zfs_kstats/arcstats`
 
        echo $demand_reads
@@ -46,7 +43,7 @@ function get_prefetched_demand_reads
 
 function get_sync_wait_for_async
 {
-       typeset -l sync_wait=`$AWK '$1 == "sync_wait_for_async" \
+       typeset -l sync_wait=`awk '$1 == "sync_wait_for_async" \
            { print $3 }' $zfs_kstats/arcstats`
 
        echo $sync_wait
@@ -67,7 +64,7 @@ sync_wait_for_async=$(get_sync_wait_for_async)
 while true
 do
        new_prefetch_ios=$(get_prefetch_ios)
-       printf "%u\n%-24s\t%u\n" $($DATE +%s) "prefetch_ios" \
+       printf "%u\n%-24s\t%u\n" $(date +%s) "prefetch_ios" \
            $(( $new_prefetch_ios - $prefetch_ios ))
        prefetch_ios=$new_prefetch_ios