]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:tests: Fix argument checks in test shell scripts master
authorAndreas Schneider <asn@samba.org>
Tue, 12 Nov 2024 07:53:50 +0000 (08:53 +0100)
committerAnoop C S <anoopcs@samba.org>
Sat, 13 Jun 2026 10:30:59 +0000 (10:30 +0000)
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 <anoopcs@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Sat Jun 13 10:30:59 UTC 2026 on atb-devel-224

17 files changed:
source3/script/tests/test_bug15435_widelink_dfs.sh
source3/script/tests/test_dfree_command.sh
source3/script/tests/test_dfree_quota.sh
source3/script/tests/test_net_tdb.sh
source3/script/tests/test_printing_var_exp.sh
source3/script/tests/test_smb1_lanman_plaintext.sh
source3/script/tests/test_smbclient_basic.sh
source3/script/tests/test_smbclient_krb5.sh
source3/script/tests/test_smbclient_large_file.sh
source3/script/tests/test_smbclient_log_basename.sh
source3/script/tests/test_smbclient_machine_auth.sh
source3/script/tests/test_smbclient_ntlm.sh
source3/script/tests/test_smbd_no_krb5.sh
source3/script/tests/test_smbget.sh
source3/script/tests/test_smbspool.sh
source3/script/tests/test_update_keytab.sh
source3/script/tests/test_update_keytab_clustered.sh

index f0705ca7c5c3547f76cedd710c7b871cb5cf39af..42bf2357bf1f1e6955cce8434cc26ba0cec642c0 100755 (executable)
@@ -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
 Usage: test_bug15435_widelink_dfs.sh SERVER SERVER_IP USERNAME PASSWORD SMBCLIENT CONFIGURATION <smbclient arguments>
 EOF
index 3ebb50c1ba11a536474f39f6d9e958bc50e58b84..1234aa9ca65509f5562bdfb0c1ee960ce74edc96 100755 (executable)
@@ -4,7 +4,7 @@
 # command disk free printout.
 #
 
-if [ $# -lt 6 ]; then
+if [ $# -lt 7 ]; then
        cat <<EOF
 Usage: test_dfree_command.sh SERVER DOMAIN USERNAME PASSWORD PREFIX SMBCLIENT
 EOF
index e9bb987e1bb6802fc16a690d63a3c9019ec02bda..8fbf36eaacc22de08a386e156ff9872c132523f8 100755 (executable)
@@ -3,7 +3,7 @@
 # Blackbox test for disk-free, quota, and their interaction
 #
 
-if [ $# -lt 6 ]; then
+if [ $# -lt 9 ]; then
        cat <<EOF
 Usage: test_dfree_quota.sh SERVER DOMAIN USERNAME PASSWORD LOCAL_PATH SMBCLIENT SMBCQUOTAS SMBCACLS
 EOF
index 46fc4a6943a2803a9e115aca6535455c7e84cc15..7dee451d19d512b1034e97a1fb1965ee3c7931f1 100755 (executable)
@@ -9,7 +9,7 @@
 #
 # Copyright (C) 2017 Christof Schmitt
 
-if [ $# -lt 7 ]; then
+if [ $# -lt 8 ]; then
        cat <<EOF
 Usage: $0 SMBCLIENT SERVER SHARE USER PASS CONFIGURATION LOCALPATH LOCKDIR
 EOF
index 5729344be2e5e6567a77967360eee52a9fae8625..87f80e711aa40e42680c29bbe046c81808470a01 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-if [ $# -lt 4 ]; then
+if [ $# -lt 5 ]; then
        cat <<EOF
 Usage: test_printing_var_exp.sh SERVER SERVER_IP DOMAIN USERNAME PASSWORD
 EOF
index 669a22e5f4c6757394867a7cef42854a739a1004..6931857bef77cf4c8eb2648c2a64ae61130534b7 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-if [ $# -lt 3 ]; then
+if [ $# -lt 4 ]; then
        cat <<EOF
 Usage: test_smb1_lanman_plaintext.sh SERVER USERNAME PASSWORD
 EOF
index 6e2a17caf46aca6192b8b62a4e70cdecb05730f0..1dcb5cad29e6ccf06b67ad1cbf63441d131fbfd7 100755 (executable)
@@ -2,7 +2,7 @@
 
 # this runs the file serving tests that are expected to pass with samba3 against shares with various options
 
-if [ $# -lt 5 ]; then
+if [ $# -lt 6 ]; then
        cat <<EOF
 Usage: test_smbclient_basic.sh SERVER SERVER_IP DOMAIN USERNAME PASSWORD SMBCLIENT <smbclient arguments>
 EOF
index 98fa7890b3c532076b4e7282752ea4459ce54df5..b19cb71ecf333c6c86023e88458da795747c3dd1 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-if [ $# -lt 1 ]; then
+if [ $# -lt 3 ]; then
        cat <<EOF
 Usage: test_smbclient_krb5.sh ccache smbclient3 server <smbclient args>
 EOF
index 3a384e2c1ba156b69a8cd2411f025d9c44f65aff..a5db0e3831be0426d6d9f91ed2893d27f2190660 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-if [ $# -lt 1 ]; then
+if [ $# -lt 4 ]; then
        cat <<EOF
 Usage: test_smbclient_large_file.sh ccache smbclient3 server prefix <smbclient args>
 EOF
index f29009fe2bc84d70fcf4134595c8afe7b52fa71f..4f3b00d32cef7e881062ebb88177f653f8e07a17 100755 (executable)
@@ -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
 Usage: test_smbclient_log_basename.sh SERVER SMBCLIENT PREFIX <smbclient arguments>
 EOF
index c89f84892e751e22d98ca5918b84a7249d676e0d..372c58fe3c5f3bed19f153e3b68b597aa224f8de 100755 (executable)
@@ -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
 Usage: test_smbclient_machine_auth.sh SERVER SMBCLIENT CONFIGURATION <smbclient arguments>
 EOF
index 1e53b1eab3db44ee5d66492bcbb5213ee6deda4e..5bda503f1225c7b8fb21b9b2cead463bfa66d871 100755 (executable)
@@ -2,7 +2,7 @@
 
 # this runs a smbclient based authentication tests
 
-if [ $# -lt 6 ]; then
+if [ $# -lt 7 ]; then
        cat <<EOF
 Usage: test_smbclient_ntlm.sh SERVER USERNAME PASSWORD MAPTOGUEST SMBCLIENT PROTOCOL CONFIGURATION <smbclient arguments>
 EOF
index faa46c9083301df52fb7f3634b03820159efc425..31695ce36fdf6492d7a1670c70926a1dbf23204b 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-if [ $# -lt 1 ]; then
+if [ $# -lt 5 ]; then
        cat <<EOF
 Usage: test_smbd_no_krb5.sh SERVER USERNAME PASSWORD PREFIX
 EOF
index b8e6200fbe1f01e7b39ef7a5a4e67d619ad7af4c..4ef3871c630275f0e98578b7adca67890beb9db8 100755 (executable)
@@ -3,7 +3,7 @@
 # Blackbox test for smbget.
 #
 
-if [ $# -lt 8 ]; then
+if [ $# -lt 10 ]; then
        cat <<EOF
 Usage: test_smbget SERVER SERVER_IP DOMAIN REALM USERNAME PASSWORD WORKDIR SMBGET
 EOF
index 7f777174d64d16e3ac89dd36de361f1b4506eb62..fb4dc772fc34015d7a49ec27d78dbf6be5fe48ff 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-if [ $# -lt 4 ]; then
+if [ $# -lt 5 ]; then
        cat <<EOF
 Usage: test_smbspool.sh SERVER SERVER_IP USERNAME PASSWORD TARGET_ENV
 EOF
index f218fbe93c05a4730fc17397a3c654528a122b3c..0771718792c0cf815f4baf37308260379bd81332 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-if [ $# -lt 1 ]; then
+if [ $# -lt 2 ]; then
 cat <<EOF
 Usage: test_update_keytab.sh DOMAIN CONFIGURATION
 EOF
index 045c67063ae68b40325b8bf3f291743d87c80200..df4eb067b03000c55e0669684cfa7fea0467a21f 100755 (executable)
@@ -1,8 +1,8 @@
 #!/bin/sh
 
-if [ $# -lt 1 ]; then
+if [ $# -lt 2 ]; then
 cat <<EOF
-Usage: test_update_keytab.sh DOMAIN CONFIGURATION
+Usage: test_update_keytab_clustered.sh DOMAIN CONFIGURATION
 EOF
 exit 1
 fi