Changeset View
Changeset View
Standalone View
Standalone View
tests/sys/cddl/zfs/tests/userquota/userquota_test.sh
Show All 24 Lines | |||||
# Use is subject to license terms. | # Use is subject to license terms. | ||||
# | # | ||||
atf_test_case groupspace_001_pos cleanup | atf_test_case groupspace_001_pos cleanup | ||||
groupspace_001_pos_head() | groupspace_001_pos_head() | ||||
{ | { | ||||
atf_set "descr" "Check the zfs groupspace with all possible parameters" | atf_set "descr" "Check the zfs groupspace with all possible parameters" | ||||
atf_set "require.progs" zfs runwattr | atf_set "require.progs" "ksh93 zfs runwattr" | ||||
} | } | ||||
groupspace_001_pos_body() | groupspace_001_pos_body() | ||||
{ | { | ||||
. $(atf_get_srcdir)/../../include/default.cfg | . $(atf_get_srcdir)/../../include/default.cfg | ||||
. $(atf_get_srcdir)/userquota_common.kshlib | . $(atf_get_srcdir)/userquota_common.kshlib | ||||
. $(atf_get_srcdir)/userquota.cfg | . $(atf_get_srcdir)/userquota.cfg | ||||
verify_disk_count "$DISKS" 1 | verify_disk_count "$DISKS" 1 | ||||
Show All 9 Lines | groupspace_001_pos_cleanup() | ||||
ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ||||
} | } | ||||
atf_test_case groupspace_002_pos cleanup | atf_test_case groupspace_002_pos cleanup | ||||
groupspace_002_pos_head() | groupspace_002_pos_head() | ||||
{ | { | ||||
atf_set "descr" "Check the zfs groupspace used and quota" | atf_set "descr" "Check the zfs groupspace used and quota" | ||||
atf_set "require.progs" zfs runwattr | atf_set "require.progs" "ksh93 zfs runwattr" | ||||
} | } | ||||
groupspace_002_pos_body() | groupspace_002_pos_body() | ||||
{ | { | ||||
. $(atf_get_srcdir)/../../include/default.cfg | . $(atf_get_srcdir)/../../include/default.cfg | ||||
. $(atf_get_srcdir)/userquota_common.kshlib | . $(atf_get_srcdir)/userquota_common.kshlib | ||||
. $(atf_get_srcdir)/userquota.cfg | . $(atf_get_srcdir)/userquota.cfg | ||||
verify_disk_count "$DISKS" 1 | verify_disk_count "$DISKS" 1 | ||||
Show All 9 Lines | groupspace_002_pos_cleanup() | ||||
ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ||||
} | } | ||||
atf_test_case userquota_001_pos cleanup | atf_test_case userquota_001_pos cleanup | ||||
userquota_001_pos_head() | userquota_001_pos_head() | ||||
{ | { | ||||
atf_set "descr" "If write operation overwrite {user|group}quota size, it will fail" | atf_set "descr" "If write operation overwrite {user|group}quota size, it will fail" | ||||
atf_set "require.progs" zfs runwattr | atf_set "require.progs" "ksh93 zfs runwattr" | ||||
} | } | ||||
userquota_001_pos_body() | userquota_001_pos_body() | ||||
{ | { | ||||
. $(atf_get_srcdir)/../../include/default.cfg | . $(atf_get_srcdir)/../../include/default.cfg | ||||
. $(atf_get_srcdir)/userquota_common.kshlib | . $(atf_get_srcdir)/userquota_common.kshlib | ||||
. $(atf_get_srcdir)/userquota.cfg | . $(atf_get_srcdir)/userquota.cfg | ||||
verify_disk_count "$DISKS" 1 | verify_disk_count "$DISKS" 1 | ||||
Show All 9 Lines | userquota_001_pos_cleanup() | ||||
ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ||||
} | } | ||||
atf_test_case userquota_002_pos cleanup | atf_test_case userquota_002_pos cleanup | ||||
userquota_002_pos_head() | userquota_002_pos_head() | ||||
{ | { | ||||
atf_set "descr" "the userquota and groupquota can be set during zpool,zfs creation" | atf_set "descr" "the userquota and groupquota can be set during zpool,zfs creation" | ||||
atf_set "require.progs" zpool zfs | atf_set "require.progs" "ksh93 zpool zfs" | ||||
} | } | ||||
userquota_002_pos_body() | userquota_002_pos_body() | ||||
{ | { | ||||
. $(atf_get_srcdir)/../../include/default.cfg | . $(atf_get_srcdir)/../../include/default.cfg | ||||
. $(atf_get_srcdir)/userquota_common.kshlib | . $(atf_get_srcdir)/userquota_common.kshlib | ||||
. $(atf_get_srcdir)/userquota.cfg | . $(atf_get_srcdir)/userquota.cfg | ||||
verify_disk_count "$DISKS" 1 | verify_disk_count "$DISKS" 1 | ||||
Show All 9 Lines | userquota_002_pos_cleanup() | ||||
ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ||||
} | } | ||||
atf_test_case userquota_003_pos cleanup | atf_test_case userquota_003_pos cleanup | ||||
userquota_003_pos_head() | userquota_003_pos_head() | ||||
{ | { | ||||
atf_set "descr" "Check the basic function of set/get userquota and groupquota on fs" | atf_set "descr" "Check the basic function of set/get userquota and groupquota on fs" | ||||
atf_set "require.progs" zfs | atf_set "require.progs" "ksh93 zfs" | ||||
} | } | ||||
userquota_003_pos_body() | userquota_003_pos_body() | ||||
{ | { | ||||
. $(atf_get_srcdir)/../../include/default.cfg | . $(atf_get_srcdir)/../../include/default.cfg | ||||
. $(atf_get_srcdir)/userquota_common.kshlib | . $(atf_get_srcdir)/userquota_common.kshlib | ||||
. $(atf_get_srcdir)/userquota.cfg | . $(atf_get_srcdir)/userquota.cfg | ||||
verify_disk_count "$DISKS" 1 | verify_disk_count "$DISKS" 1 | ||||
Show All 9 Lines | userquota_003_pos_cleanup() | ||||
ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ||||
} | } | ||||
atf_test_case userquota_004_pos cleanup | atf_test_case userquota_004_pos cleanup | ||||
userquota_004_pos_head() | userquota_004_pos_head() | ||||
{ | { | ||||
atf_set "descr" "Check the basic function of {user|group} used" | atf_set "descr" "Check the basic function of {user|group} used" | ||||
atf_set "require.progs" runwattr | atf_set "require.progs" "ksh93 runwattr" | ||||
} | } | ||||
userquota_004_pos_body() | userquota_004_pos_body() | ||||
{ | { | ||||
. $(atf_get_srcdir)/../../include/default.cfg | . $(atf_get_srcdir)/../../include/default.cfg | ||||
. $(atf_get_srcdir)/userquota_common.kshlib | . $(atf_get_srcdir)/userquota_common.kshlib | ||||
. $(atf_get_srcdir)/userquota.cfg | . $(atf_get_srcdir)/userquota.cfg | ||||
verify_disk_count "$DISKS" 1 | verify_disk_count "$DISKS" 1 | ||||
Show All 9 Lines | userquota_004_pos_cleanup() | ||||
ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ||||
} | } | ||||
atf_test_case userquota_005_neg cleanup | atf_test_case userquota_005_neg cleanup | ||||
userquota_005_neg_head() | userquota_005_neg_head() | ||||
{ | { | ||||
atf_set "descr" "Check the invalid parameter of zfs set user|group quota" | atf_set "descr" "Check the invalid parameter of zfs set user|group quota" | ||||
atf_set "require.progs" zfs | atf_set "require.progs" "ksh93 zfs" | ||||
} | } | ||||
userquota_005_neg_body() | userquota_005_neg_body() | ||||
{ | { | ||||
. $(atf_get_srcdir)/../../include/default.cfg | . $(atf_get_srcdir)/../../include/default.cfg | ||||
. $(atf_get_srcdir)/userquota_common.kshlib | . $(atf_get_srcdir)/userquota_common.kshlib | ||||
. $(atf_get_srcdir)/userquota.cfg | . $(atf_get_srcdir)/userquota.cfg | ||||
verify_disk_count "$DISKS" 1 | verify_disk_count "$DISKS" 1 | ||||
Show All 9 Lines | userquota_005_neg_cleanup() | ||||
ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ||||
} | } | ||||
atf_test_case userquota_006_pos cleanup | atf_test_case userquota_006_pos cleanup | ||||
userquota_006_pos_head() | userquota_006_pos_head() | ||||
{ | { | ||||
atf_set "descr" "Check the invalid parameter of zfs get user|group quota" | atf_set "descr" "Check the invalid parameter of zfs get user|group quota" | ||||
atf_set "require.progs" zfs | atf_set "require.progs" "ksh93 zfs" | ||||
} | } | ||||
userquota_006_pos_body() | userquota_006_pos_body() | ||||
{ | { | ||||
. $(atf_get_srcdir)/../../include/default.cfg | . $(atf_get_srcdir)/../../include/default.cfg | ||||
. $(atf_get_srcdir)/userquota_common.kshlib | . $(atf_get_srcdir)/userquota_common.kshlib | ||||
. $(atf_get_srcdir)/userquota.cfg | . $(atf_get_srcdir)/userquota.cfg | ||||
verify_disk_count "$DISKS" 1 | verify_disk_count "$DISKS" 1 | ||||
Show All 9 Lines | userquota_006_pos_cleanup() | ||||
ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ||||
} | } | ||||
atf_test_case userquota_007_pos cleanup | atf_test_case userquota_007_pos cleanup | ||||
userquota_007_pos_head() | userquota_007_pos_head() | ||||
{ | { | ||||
atf_set "descr" "Check set user|group quota to larger than the quota size of a fs" | atf_set "descr" "Check set user|group quota to larger than the quota size of a fs" | ||||
atf_set "require.progs" zfs runwattr | atf_set "require.progs" "ksh93 zfs runwattr" | ||||
} | } | ||||
userquota_007_pos_body() | userquota_007_pos_body() | ||||
{ | { | ||||
. $(atf_get_srcdir)/../../include/default.cfg | . $(atf_get_srcdir)/../../include/default.cfg | ||||
. $(atf_get_srcdir)/userquota_common.kshlib | . $(atf_get_srcdir)/userquota_common.kshlib | ||||
. $(atf_get_srcdir)/userquota.cfg | . $(atf_get_srcdir)/userquota.cfg | ||||
verify_disk_count "$DISKS" 1 | verify_disk_count "$DISKS" 1 | ||||
Show All 9 Lines | userquota_007_pos_cleanup() | ||||
ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ||||
} | } | ||||
atf_test_case userquota_008_pos cleanup | atf_test_case userquota_008_pos cleanup | ||||
userquota_008_pos_head() | userquota_008_pos_head() | ||||
{ | { | ||||
atf_set "descr" "Check zfs get all will not print out user|group quota" | atf_set "descr" "Check zfs get all will not print out user|group quota" | ||||
atf_set "require.progs" zfs | atf_set "require.progs" "ksh93 zfs" | ||||
} | } | ||||
userquota_008_pos_body() | userquota_008_pos_body() | ||||
{ | { | ||||
. $(atf_get_srcdir)/../../include/default.cfg | . $(atf_get_srcdir)/../../include/default.cfg | ||||
. $(atf_get_srcdir)/userquota_common.kshlib | . $(atf_get_srcdir)/userquota_common.kshlib | ||||
. $(atf_get_srcdir)/userquota.cfg | . $(atf_get_srcdir)/userquota.cfg | ||||
verify_disk_count "$DISKS" 1 | verify_disk_count "$DISKS" 1 | ||||
Show All 9 Lines | userquota_008_pos_cleanup() | ||||
ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ||||
} | } | ||||
atf_test_case userquota_009_pos cleanup | atf_test_case userquota_009_pos cleanup | ||||
userquota_009_pos_head() | userquota_009_pos_head() | ||||
{ | { | ||||
atf_set "descr" "Check the snapshot's user|group quota" | atf_set "descr" "Check the snapshot's user|group quota" | ||||
atf_set "require.progs" zfs | atf_set "require.progs" "ksh93 zfs" | ||||
} | } | ||||
userquota_009_pos_body() | userquota_009_pos_body() | ||||
{ | { | ||||
. $(atf_get_srcdir)/../../include/default.cfg | . $(atf_get_srcdir)/../../include/default.cfg | ||||
. $(atf_get_srcdir)/userquota_common.kshlib | . $(atf_get_srcdir)/userquota_common.kshlib | ||||
. $(atf_get_srcdir)/userquota.cfg | . $(atf_get_srcdir)/userquota.cfg | ||||
verify_disk_count "$DISKS" 1 | verify_disk_count "$DISKS" 1 | ||||
Show All 9 Lines | userquota_009_pos_cleanup() | ||||
ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ||||
} | } | ||||
atf_test_case userquota_010_pos cleanup | atf_test_case userquota_010_pos cleanup | ||||
userquota_010_pos_head() | userquota_010_pos_head() | ||||
{ | { | ||||
atf_set "descr" "overwrite any of the {user|group}quota size, it will fail" | atf_set "descr" "overwrite any of the {user|group}quota size, it will fail" | ||||
atf_set "require.progs" zfs runwattr | atf_set "require.progs" "ksh93 zfs runwattr" | ||||
} | } | ||||
userquota_010_pos_body() | userquota_010_pos_body() | ||||
{ | { | ||||
. $(atf_get_srcdir)/../../include/default.cfg | . $(atf_get_srcdir)/../../include/default.cfg | ||||
. $(atf_get_srcdir)/userquota_common.kshlib | . $(atf_get_srcdir)/userquota_common.kshlib | ||||
. $(atf_get_srcdir)/userquota.cfg | . $(atf_get_srcdir)/userquota.cfg | ||||
verify_disk_count "$DISKS" 1 | verify_disk_count "$DISKS" 1 | ||||
Show All 9 Lines | userquota_010_pos_cleanup() | ||||
ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ||||
} | } | ||||
atf_test_case userquota_011_pos cleanup | atf_test_case userquota_011_pos cleanup | ||||
userquota_011_pos_head() | userquota_011_pos_head() | ||||
{ | { | ||||
atf_set "descr" "the userquota and groupquota can't change during zfs actions" | atf_set "descr" "the userquota and groupquota can't change during zfs actions" | ||||
atf_set "require.progs" zfs | atf_set "require.progs" "ksh93 zfs" | ||||
} | } | ||||
userquota_011_pos_body() | userquota_011_pos_body() | ||||
{ | { | ||||
. $(atf_get_srcdir)/../../include/default.cfg | . $(atf_get_srcdir)/../../include/default.cfg | ||||
. $(atf_get_srcdir)/userquota_common.kshlib | . $(atf_get_srcdir)/userquota_common.kshlib | ||||
. $(atf_get_srcdir)/userquota.cfg | . $(atf_get_srcdir)/userquota.cfg | ||||
verify_disk_count "$DISKS" 1 | verify_disk_count "$DISKS" 1 | ||||
Show All 9 Lines | userquota_011_pos_cleanup() | ||||
ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ||||
} | } | ||||
atf_test_case userquota_012_neg cleanup | atf_test_case userquota_012_neg cleanup | ||||
userquota_012_neg_head() | userquota_012_neg_head() | ||||
{ | { | ||||
atf_set "descr" "Check set userquota and groupquota on snapshot" | atf_set "descr" "Check set userquota and groupquota on snapshot" | ||||
atf_set "require.progs" zfs | atf_set "require.progs" "ksh93 zfs" | ||||
} | } | ||||
userquota_012_neg_body() | userquota_012_neg_body() | ||||
{ | { | ||||
. $(atf_get_srcdir)/../../include/default.cfg | . $(atf_get_srcdir)/../../include/default.cfg | ||||
. $(atf_get_srcdir)/userquota_common.kshlib | . $(atf_get_srcdir)/userquota_common.kshlib | ||||
. $(atf_get_srcdir)/userquota.cfg | . $(atf_get_srcdir)/userquota.cfg | ||||
verify_disk_count "$DISKS" 1 | verify_disk_count "$DISKS" 1 | ||||
Show All 9 Lines | userquota_012_neg_cleanup() | ||||
ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ||||
} | } | ||||
atf_test_case userspace_001_pos cleanup | atf_test_case userspace_001_pos cleanup | ||||
userspace_001_pos_head() | userspace_001_pos_head() | ||||
{ | { | ||||
atf_set "descr" "Check the zfs userspace with all possible parameters" | atf_set "descr" "Check the zfs userspace with all possible parameters" | ||||
atf_set "require.progs" zfs runwattr | atf_set "require.progs" "ksh93 zfs runwattr" | ||||
} | } | ||||
userspace_001_pos_body() | userspace_001_pos_body() | ||||
{ | { | ||||
. $(atf_get_srcdir)/../../include/default.cfg | . $(atf_get_srcdir)/../../include/default.cfg | ||||
. $(atf_get_srcdir)/userquota_common.kshlib | . $(atf_get_srcdir)/userquota_common.kshlib | ||||
. $(atf_get_srcdir)/userquota.cfg | . $(atf_get_srcdir)/userquota.cfg | ||||
verify_disk_count "$DISKS" 1 | verify_disk_count "$DISKS" 1 | ||||
Show All 9 Lines | userspace_001_pos_cleanup() | ||||
ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" | ||||
} | } | ||||
atf_test_case userspace_002_pos cleanup | atf_test_case userspace_002_pos cleanup | ||||
userspace_002_pos_head() | userspace_002_pos_head() | ||||
{ | { | ||||
atf_set "descr" "Check the zfs userspace used and quota" | atf_set "descr" "Check the zfs userspace used and quota" | ||||
atf_set "require.progs" zfs runwattr | atf_set "require.progs" "ksh93 zfs runwattr" | ||||
} | } | ||||
userspace_002_pos_body() | userspace_002_pos_body() | ||||
{ | { | ||||
. $(atf_get_srcdir)/../../include/default.cfg | . $(atf_get_srcdir)/../../include/default.cfg | ||||
. $(atf_get_srcdir)/userquota_common.kshlib | . $(atf_get_srcdir)/userquota_common.kshlib | ||||
. $(atf_get_srcdir)/userquota.cfg | . $(atf_get_srcdir)/userquota.cfg | ||||
verify_disk_count "$DISKS" 1 | verify_disk_count "$DISKS" 1 | ||||
Show All 33 Lines |