]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
testprogs: Add additional rpcclient tests for new cmdline options
authorAndreas Schneider <asn@samba.org>
Wed, 2 Dec 2020 16:15:05 +0000 (17:15 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 20 May 2021 02:58:36 +0000 (02:58 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
testprogs/blackbox/test_client_kerberos.sh

index 6d417e9d79bc74cfd0d169c04193200d26f8c7c2..efe40c6a61a6a3bfa4bff5772097765cce9d5e6b 100755 (executable)
@@ -96,9 +96,7 @@ KRB5CCNAME_PATH="$PREFIX/ccache_client_kerberos"
 KRB5CCNAME="FILE:$KRB5CCNAME_PATH"
 export KRB5CCNAME
 
-### CHECK -k flag
-
-### RPCCLIENT
+### RPCCLIENT (legacy)
 cmd='$samba_rpcclient ncacn_np:${SERVER} -U${USERNAME}%${PASSWORD} --configfile=${CONFIGURATION} -c getusername 2>&1'
 testit "test rpcclient legacy ntlm" \
     test_rpc_getusername || \
@@ -131,6 +129,39 @@ testit "test rpcclient legacy kerberos ccache" \
     failed=$(expr $failed + 1)
 $samba_kdestroy
 
+### RPCCLIENT
+cmd='$samba_rpcclient ncacn_np:${SERVER} -U${USERNAME}%${PASSWORD} --use-kerberos=disabled --configfile=${CONFIGURATION} -c getusername 2>&1'
+testit "test rpcclient ntlm" \
+    test_rpc_getusername || \
+    failed=$(expr $failed + 1)
+
+cmd='echo ${PASSWORD} | USER=${USERNAME} $samba_rpcclient ncacn_np:${SERVER} --use-kerberos=disabled --configfile=${CONFIGURATION} -c getusername 2>&1'
+testit "test rpcclient ntlm interactive" \
+    test_rpc_getusername || \
+    failed=$(expr $failed + 1)
+
+cmd='echo ${PASSWORD} | $samba_rpcclient ncacn_np:${SERVER} -U${USERNAME} --use-kerberos=disabled --configfile=${CONFIGURATION} -c getusername 2>&1'
+testit "test rpcclient ntlm interactive with -U" \
+    test_rpc_getusername || \
+    failed=$(expr $failed + 1)
+
+cmd='$samba_rpcclient ncacn_np:${SERVER} -U${USERNAME}%${PASSWORD} --use-kerberos=required --configfile=${CONFIGURATION} -c getusername 2>&1'
+testit "test rpcclient kerberos" \
+    test_rpc_getusername || \
+    failed=$(expr $failed + 1)
+
+cmd='echo ${PASSWORD} | $samba_rpcclient ncacn_np:${SERVER} -U${USERNAME} --use-krb5-ccache=$KRB5CCNAME --configfile=${CONFIGURATION} -c getusername 2>&1'
+testit_expect_failure "test rpcclient kerberos interactive (negative test)" \
+    test_rpc_getusername || \
+    failed=$(expr $failed + 1)
+
+kerberos_kinit $samba_kinit ${USERNAME}@${REALM} ${PASSWORD}
+cmd='$samba_rpcclient ncacn_np:${SERVER} --use-krb5-ccache=$KRB5CCNAME --configfile=${CONFIGURATION} -c getusername 2>&1'
+testit "test rpcclient kerberos ccache" \
+    test_rpc_getusername || \
+    failed=$(expr $failed + 1)
+$samba_kdestroy
+
 ### SMBTORTURE
 
 cmd='$samba_smbtorture -U${USERNAME}%${PASSWORD} --configfile=${CONFIGURATION} --maximum-runtime=30 --basedir=$PREFIX --option=torture:progress=no --target=samba4 ncacn_np:${SERVER} rpc.lsa-getuser 2>&1'