From: Andreas Schneider Date: Tue, 12 Nov 2024 07:53:50 +0000 (+0100) Subject: s3:tests: Fix argument checks in test shell scripts X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;ds=sidebyside;p=thirdparty%2Fsamba.git s3:tests: Fix argument checks in test shell scripts Fix the argument count check to match the number of required positional parameters. Sample failure: [595(5736)/3145 at 15m52s, 1 errors] samba3.blackbox.update_keytab(ad_member_idmap_nss:local) source3/script/tests/test_update_keytab.sh: line 16: shift: 2: shift count out of range Pair-Programmed-With: Anoop C S Signed-off-by: Andreas Schneider Signed-off-by: Anoop C S Autobuild-User(master): Anoop C S Autobuild-Date(master): Sat Jun 13 10:30:59 UTC 2026 on atb-devel-224 --- diff --git a/source3/script/tests/test_bug15435_widelink_dfs.sh b/source3/script/tests/test_bug15435_widelink_dfs.sh index f0705ca7c5c..42bf2357bf1 100755 --- a/source3/script/tests/test_bug15435_widelink_dfs.sh +++ b/source3/script/tests/test_bug15435_widelink_dfs.sh @@ -2,7 +2,7 @@ # regression test for dfs access with wide links enabled on dfs share -if [ $# -lt 5 ]; then +if [ $# -lt 6 ]; then cat < EOF diff --git a/source3/script/tests/test_dfree_command.sh b/source3/script/tests/test_dfree_command.sh index 3ebb50c1ba1..1234aa9ca65 100755 --- a/source3/script/tests/test_dfree_command.sh +++ b/source3/script/tests/test_dfree_command.sh @@ -4,7 +4,7 @@ # command disk free printout. # -if [ $# -lt 6 ]; then +if [ $# -lt 7 ]; then cat < EOF diff --git a/source3/script/tests/test_smbclient_krb5.sh b/source3/script/tests/test_smbclient_krb5.sh index 98fa7890b3c..b19cb71ecf3 100755 --- a/source3/script/tests/test_smbclient_krb5.sh +++ b/source3/script/tests/test_smbclient_krb5.sh @@ -1,6 +1,6 @@ #!/bin/sh -if [ $# -lt 1 ]; then +if [ $# -lt 3 ]; then cat < EOF diff --git a/source3/script/tests/test_smbclient_large_file.sh b/source3/script/tests/test_smbclient_large_file.sh index 3a384e2c1ba..a5db0e3831b 100755 --- a/source3/script/tests/test_smbclient_large_file.sh +++ b/source3/script/tests/test_smbclient_large_file.sh @@ -1,6 +1,6 @@ #!/bin/sh -if [ $# -lt 1 ]; then +if [ $# -lt 4 ]; then cat < EOF diff --git a/source3/script/tests/test_smbclient_log_basename.sh b/source3/script/tests/test_smbclient_log_basename.sh index f29009fe2bc..4f3b00d32ce 100755 --- a/source3/script/tests/test_smbclient_log_basename.sh +++ b/source3/script/tests/test_smbclient_log_basename.sh @@ -2,7 +2,7 @@ # this test checks whether smbclient can log into -l log-basename -if [ $# -lt 2 ]; then +if [ $# -lt 3 ]; then cat < EOF diff --git a/source3/script/tests/test_smbclient_machine_auth.sh b/source3/script/tests/test_smbclient_machine_auth.sh index c89f84892e7..372c58fe3c5 100755 --- a/source3/script/tests/test_smbclient_machine_auth.sh +++ b/source3/script/tests/test_smbclient_machine_auth.sh @@ -2,7 +2,7 @@ # this runs the file serving tests that are expected to pass with samba3 against shares with various options -if [ $# -lt 2 ]; then +if [ $# -lt 3 ]; then cat < EOF diff --git a/source3/script/tests/test_smbclient_ntlm.sh b/source3/script/tests/test_smbclient_ntlm.sh index 1e53b1eab3d..5bda503f122 100755 --- a/source3/script/tests/test_smbclient_ntlm.sh +++ b/source3/script/tests/test_smbclient_ntlm.sh @@ -2,7 +2,7 @@ # this runs a smbclient based authentication tests -if [ $# -lt 6 ]; then +if [ $# -lt 7 ]; then cat < EOF diff --git a/source3/script/tests/test_smbd_no_krb5.sh b/source3/script/tests/test_smbd_no_krb5.sh index faa46c90833..31695ce36fd 100755 --- a/source3/script/tests/test_smbd_no_krb5.sh +++ b/source3/script/tests/test_smbd_no_krb5.sh @@ -1,6 +1,6 @@ #!/bin/sh -if [ $# -lt 1 ]; then +if [ $# -lt 5 ]; then cat <