From f5e5ad0125226c73755df783ab719cc16a3036e4 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 12 Nov 2024 08:53:50 +0100 Subject: [PATCH] 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 --- source3/script/tests/test_bug15435_widelink_dfs.sh | 2 +- source3/script/tests/test_dfree_command.sh | 2 +- source3/script/tests/test_dfree_quota.sh | 2 +- source3/script/tests/test_net_tdb.sh | 2 +- source3/script/tests/test_printing_var_exp.sh | 2 +- source3/script/tests/test_smb1_lanman_plaintext.sh | 2 +- source3/script/tests/test_smbclient_basic.sh | 2 +- source3/script/tests/test_smbclient_krb5.sh | 2 +- source3/script/tests/test_smbclient_large_file.sh | 2 +- source3/script/tests/test_smbclient_log_basename.sh | 2 +- source3/script/tests/test_smbclient_machine_auth.sh | 2 +- source3/script/tests/test_smbclient_ntlm.sh | 2 +- source3/script/tests/test_smbd_no_krb5.sh | 2 +- source3/script/tests/test_smbget.sh | 2 +- source3/script/tests/test_smbspool.sh | 2 +- source3/script/tests/test_update_keytab.sh | 2 +- source3/script/tests/test_update_keytab_clustered.sh | 4 ++-- 17 files changed, 18 insertions(+), 18 deletions(-) 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 <