mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 11:19:32 +03:00
tests: validate getsubopt(3) expulsion
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12996
This commit is contained in:
parent
77cdc63d09
commit
1c41d8941c
@ -315,7 +315,7 @@ tests = ['zfs_upgrade_001_pos', 'zfs_upgrade_002_pos', 'zfs_upgrade_003_pos',
|
||||
tags = ['functional', 'cli_root', 'zfs_upgrade']
|
||||
|
||||
[tests/functional/cli_root/zfs_wait]
|
||||
tests = ['zfs_wait_deleteq']
|
||||
tests = ['zfs_wait_deleteq', 'zfs_wait_getsubopt']
|
||||
tags = ['functional', 'cli_root', 'zfs_wait']
|
||||
|
||||
[tests/functional/cli_root/zhack]
|
||||
@ -551,7 +551,8 @@ tags = ['functional', 'cli_user', 'misc']
|
||||
|
||||
[tests/functional/cli_user/zfs_list]
|
||||
tests = ['zfs_list_001_pos', 'zfs_list_002_pos', 'zfs_list_003_pos',
|
||||
'zfs_list_004_neg', 'zfs_list_007_pos', 'zfs_list_008_neg']
|
||||
'zfs_list_004_neg', 'zfs_list_005_neg', 'zfs_list_007_pos',
|
||||
'zfs_list_008_neg']
|
||||
user =
|
||||
tags = ['functional', 'cli_user', 'zfs_list']
|
||||
|
||||
|
@ -236,7 +236,7 @@ tests = ['zfs_upgrade_001_pos', 'zfs_upgrade_002_pos', 'zfs_upgrade_006_neg',
|
||||
tags = ['functional', 'cli_root', 'zfs_upgrade']
|
||||
|
||||
[tests/functional/cli_root/zfs_wait]
|
||||
tests = ['zfs_wait_deleteq']
|
||||
tests = ['zfs_wait_deleteq', 'zfs_wait_getsubopt']
|
||||
tags = ['functional', 'cli_root', 'zfs_wait']
|
||||
|
||||
[tests/functional/cli_root/zpool]
|
||||
|
@ -47,7 +47,8 @@ log_assert "Verify 'zfs get all' fails with invalid combination scenarios."
|
||||
|
||||
set -f # Force ksh ignore '?' and '*'
|
||||
set -A bad_combine "ALL" "\-R all" "-P all" "-h all" "-rph all" "-RpH all" "-PrH all" \
|
||||
"-o all" "-s all" "-? all" "-* all" "-?* all" "all -r" "all -p" \
|
||||
"-o all" "-s all" "-s none=getsubopt" "-t filesystem=getsubopt" \
|
||||
"-? all" "-* all" "-?* all" "all -r" "all -p" \
|
||||
"all -H" "all -rp" "all -rH" "all -ph" "all -rpH" "all -r $TESTPOOL" \
|
||||
"all -H $TESTPOOL" "all -p $TESTPOOL" "all -r -p -H $TESTPOOL" \
|
||||
"all -rph $TESTPOOL" "all,available,reservation $TESTPOOL" \
|
||||
|
@ -51,7 +51,7 @@ set -A badargs "o name,property,value,resource" "o name" \
|
||||
"-o" "-o ,,,,," "-o -o -o -o" "-o NAME,PROPERTY,VALUE,SOURCE" \
|
||||
"-o name,properTy,value,source" "-o name, property, value,source" \
|
||||
"-o name:property:value:source" "-o name,property:value,source" \
|
||||
"-o name;property;value;source"
|
||||
"-o name;property;value;source" "-o name=getsubopt"
|
||||
|
||||
typeset -i i=0
|
||||
while (( i < ${#badargs[*]} ))
|
||||
|
@ -2,7 +2,8 @@ pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/cli_root/zfs_wait
|
||||
dist_pkgdata_SCRIPTS = \
|
||||
setup.ksh \
|
||||
cleanup.ksh \
|
||||
zfs_wait_deleteq.ksh
|
||||
zfs_wait_deleteq.ksh \
|
||||
zfs_wait_getsubopt.ksh
|
||||
|
||||
dist_pkgdata_DATA = \
|
||||
zfs_wait.kshlib
|
||||
|
14
tests/zfs-tests/tests/functional/cli_root/zfs_wait/zfs_wait_getsubopt.ksh
Executable file
14
tests/zfs-tests/tests/functional/cli_root/zfs_wait/zfs_wait_getsubopt.ksh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/ksh -p
|
||||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
. $STF_SUITE/include/libtest.shlib
|
||||
|
||||
#
|
||||
# DESCRIPTION:
|
||||
# zfs wait -t used to accept getsubopt(3)-style deleteq=whatever;
|
||||
# it doesn't anymore
|
||||
#
|
||||
|
||||
log_mustnot zfs wait -t deleteq=getsubopt $TESTPOOL
|
||||
|
||||
log_pass "'zfs wait -t' doesn't accept =getsubopt suffixes."
|
@ -51,7 +51,8 @@ set -A arguments "$TESTPOOL $TESTPOOL" "$TESTPOOL rubbish" "-v $TESTPOOL" \
|
||||
"nosuchproperty $TESTPOOL" "--$TESTPOOL" "all all" \
|
||||
"type $TESTPOOL" "usage: $TESTPOOL" "bootfs $TESTPOOL@" \
|
||||
"bootfs,bootfs $TESTPOOL" "name $TESTPOOL" "t%d%s" \
|
||||
"bootfs,delegation $TESTPOOL" "delegation $TESTPOOL@"
|
||||
"bootfs,delegation $TESTPOOL" "delegation $TESTPOOL@" \
|
||||
"-o name=getsubopt allocated $TESTPOOL"
|
||||
|
||||
for arg in $arguments
|
||||
do
|
||||
|
@ -43,5 +43,7 @@ zpool wait -t scrub fakepool 2>&1 | grep -i 'no such pool' || \
|
||||
log_fail "Error message did not contain phrase 'no such pool'."
|
||||
zpool wait -t foo $TESTPOOL 2>&1 | grep -i 'invalid activity' || \
|
||||
log_fail "Error message did not contain phrase 'invalid activity'."
|
||||
zpool wait -t scrub=getsubopt $TESTPOOL 2>&1 | grep -i 'invalid activity' || \
|
||||
log_fail "getsubopt(3) error message did not contain phrase 'invalid activity'."
|
||||
|
||||
log_pass "'zpool wait' behaves sensibly when invoked incorrectly."
|
||||
|
@ -6,6 +6,7 @@ dist_pkgdata_SCRIPTS = \
|
||||
zfs_list_002_pos.ksh \
|
||||
zfs_list_003_pos.ksh \
|
||||
zfs_list_004_neg.ksh \
|
||||
zfs_list_005_neg.ksh \
|
||||
zfs_list_007_pos.ksh \
|
||||
zfs_list_008_neg.ksh
|
||||
|
||||
|
14
tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_005_neg.ksh
Executable file
14
tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_005_neg.ksh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/ksh -p
|
||||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
. $STF_SUITE/include/libtest.shlib
|
||||
|
||||
#
|
||||
# DESCRIPTION:
|
||||
# zfs list -t used to accept getsubopt(3)-style filesystem=whatever;
|
||||
# it doesn't anymore
|
||||
#
|
||||
|
||||
log_mustnot zfs list -t filesystem=getsubopt
|
||||
|
||||
log_pass "'zfs list -t' doesn't accept =getsubopt suffixes."
|
Loading…
Reference in New Issue
Block a user