mirror of
https://github.com/samba-team/samba.git
synced 2025-01-25 06:04:04 +03:00
testprogs: Reformat test_client_kerberos.sh
shfmt -w -p -i 0 -fn testprogs/blackbox/test_client_kerberos.sh Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
This commit is contained in:
parent
2c8681cca7
commit
fcdcad8781
@ -3,10 +3,10 @@
|
|||||||
# Copyright (c) 2019 Andreas Schneider <asn@samba.org>
|
# Copyright (c) 2019 Andreas Schneider <asn@samba.org>
|
||||||
|
|
||||||
if [ $# -lt 6 ]; then
|
if [ $# -lt 6 ]; then
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
Usage: test_client_kerberos.sh DOMAIN REALM USERNAME PASSWORD SERVER PREFIX CONFIGURATION
|
Usage: test_client_kerberos.sh DOMAIN REALM USERNAME PASSWORD SERVER PREFIX CONFIGURATION
|
||||||
EOF
|
EOF
|
||||||
exit 1;
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DOMAIN=$1
|
DOMAIN=$1
|
||||||
@ -30,66 +30,69 @@ samba_smbtorture="$samba_bindir/smbtorture"
|
|||||||
|
|
||||||
samba_kinit=kinit
|
samba_kinit=kinit
|
||||||
if test -x ${samba_bindir}/samba4kinit; then
|
if test -x ${samba_bindir}/samba4kinit; then
|
||||||
samba_kinit=${samba_bindir}/samba4kinit
|
samba_kinit=${samba_bindir}/samba4kinit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
samba_kdestroy=kdestroy
|
samba_kdestroy=kdestroy
|
||||||
if test -x ${samba_bindir}/samba4kdestroy; then
|
if test -x ${samba_bindir}/samba4kdestroy; then
|
||||||
samba_kinit=${samba_bindir}/samba4kdestroy
|
samba_kinit=${samba_bindir}/samba4kdestroy
|
||||||
fi
|
fi
|
||||||
|
|
||||||
test_rpc_getusername() {
|
test_rpc_getusername()
|
||||||
eval echo "$cmd"
|
{
|
||||||
out=$(eval $cmd)
|
eval echo "$cmd"
|
||||||
ret=$?
|
out=$(eval $cmd)
|
||||||
if [ $ret -ne 0 ] ; then
|
ret=$?
|
||||||
echo "Failed to connect! Error: $ret"
|
if [ $ret -ne 0 ]; then
|
||||||
echo "$out"
|
echo "Failed to connect! Error: $ret"
|
||||||
return 1
|
echo "$out"
|
||||||
fi
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "$out" | grep -q "Account Name: $USERNAME, Authority Name: $DOMAIN"
|
echo "$out" | grep -q "Account Name: $USERNAME, Authority Name: $DOMAIN"
|
||||||
ret=$?
|
ret=$?
|
||||||
if [ $ret -ne 0 ] ; then
|
if [ $ret -ne 0 ]; then
|
||||||
echo "Incorrect account/authority name! Error: $ret"
|
echo "Incorrect account/authority name! Error: $ret"
|
||||||
echo "$out"
|
echo "$out"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
test_smbclient() {
|
test_smbclient()
|
||||||
eval echo "$cmd"
|
{
|
||||||
out=$(eval $cmd)
|
eval echo "$cmd"
|
||||||
ret=$?
|
out=$(eval $cmd)
|
||||||
if [ $ret -ne 0 ] ; then
|
ret=$?
|
||||||
echo "Failed to connect! Error: $ret"
|
if [ $ret -ne 0 ]; then
|
||||||
echo "$out"
|
echo "Failed to connect! Error: $ret"
|
||||||
fi
|
echo "$out"
|
||||||
|
fi
|
||||||
|
|
||||||
return $ret
|
return $ret
|
||||||
}
|
}
|
||||||
|
|
||||||
test_smbclient_kerberos() {
|
test_smbclient_kerberos()
|
||||||
eval echo "$cmd -d5"
|
{
|
||||||
out=$(eval $cmd)
|
eval echo "$cmd -d5"
|
||||||
ret=$?
|
out=$(eval $cmd)
|
||||||
if [ $ret -ne 0 ] ; then
|
ret=$?
|
||||||
echo "Failed to connect! Error: $ret"
|
if [ $ret -ne 0 ]; then
|
||||||
echo "$out"
|
echo "Failed to connect! Error: $ret"
|
||||||
return 1
|
echo "$out"
|
||||||
fi
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "$out" | grep "Doing init for" >/dev/null 2>&1
|
echo "$out" | grep "Doing init for" >/dev/null 2>&1
|
||||||
ret=$?
|
ret=$?
|
||||||
if [ $ret -eq 0 ] ; then
|
if [ $ret -eq 0 ]; then
|
||||||
echo "Kinit failed for smbclient"
|
echo "Kinit failed for smbclient"
|
||||||
echo "$out"
|
echo "$out"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
KRB5CCNAME_PATH="$PREFIX/ccache_client_kerberos"
|
KRB5CCNAME_PATH="$PREFIX/ccache_client_kerberos"
|
||||||
@ -99,190 +102,190 @@ export KRB5CCNAME
|
|||||||
### RPCCLIENT (legacy)
|
### RPCCLIENT (legacy)
|
||||||
cmd='$samba_rpcclient ncacn_np:${SERVER} -U${USERNAME}%${PASSWORD} --configfile=${CONFIGURATION} -c getusername 2>&1'
|
cmd='$samba_rpcclient ncacn_np:${SERVER} -U${USERNAME}%${PASSWORD} --configfile=${CONFIGURATION} -c getusername 2>&1'
|
||||||
testit "test rpcclient legacy ntlm" \
|
testit "test rpcclient legacy ntlm" \
|
||||||
test_rpc_getusername || \
|
test_rpc_getusername ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
cmd='echo ${PASSWORD} | USER=${USERNAME} $samba_rpcclient ncacn_np:${SERVER} --configfile=${CONFIGURATION} -c getusername 2>&1'
|
cmd='echo ${PASSWORD} | USER=${USERNAME} $samba_rpcclient ncacn_np:${SERVER} --configfile=${CONFIGURATION} -c getusername 2>&1'
|
||||||
testit "test rpcclient legacy ntlm interactive" \
|
testit "test rpcclient legacy ntlm interactive" \
|
||||||
test_rpc_getusername || \
|
test_rpc_getusername ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
cmd='echo ${PASSWORD} | $samba_rpcclient ncacn_np:${SERVER} -U${USERNAME} --configfile=${CONFIGURATION} -c getusername 2>&1'
|
cmd='echo ${PASSWORD} | $samba_rpcclient ncacn_np:${SERVER} -U${USERNAME} --configfile=${CONFIGURATION} -c getusername 2>&1'
|
||||||
testit "test rpcclient legacy ntlm interactive with -U" \
|
testit "test rpcclient legacy ntlm interactive with -U" \
|
||||||
test_rpc_getusername || \
|
test_rpc_getusername ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
cmd='$samba_rpcclient ncacn_np:${SERVER} -U${USERNAME}%${PASSWORD} -k --configfile=${CONFIGURATION} -c getusername 2>&1'
|
cmd='$samba_rpcclient ncacn_np:${SERVER} -U${USERNAME}%${PASSWORD} -k --configfile=${CONFIGURATION} -c getusername 2>&1'
|
||||||
testit "test rpcclient legacy kerberos" \
|
testit "test rpcclient legacy kerberos" \
|
||||||
test_rpc_getusername || \
|
test_rpc_getusername ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
cmd='echo ${PASSWORD} | $samba_rpcclient ncacn_np:${SERVER} -U${USERNAME} -k --configfile=${CONFIGURATION} -c getusername 2>&1'
|
cmd='echo ${PASSWORD} | $samba_rpcclient ncacn_np:${SERVER} -U${USERNAME} -k --configfile=${CONFIGURATION} -c getusername 2>&1'
|
||||||
testit_expect_failure "test rpcclient legacy kerberos interactive (negative test)" \
|
testit_expect_failure "test rpcclient legacy kerberos interactive (negative test)" \
|
||||||
test_rpc_getusername || \
|
test_rpc_getusername ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
kerberos_kinit $samba_kinit ${USERNAME}@${REALM} ${PASSWORD}
|
kerberos_kinit $samba_kinit ${USERNAME}@${REALM} ${PASSWORD}
|
||||||
cmd='$samba_rpcclient ncacn_np:${SERVER} -k --configfile=${CONFIGURATION} -c getusername 2>&1'
|
cmd='$samba_rpcclient ncacn_np:${SERVER} -k --configfile=${CONFIGURATION} -c getusername 2>&1'
|
||||||
testit "test rpcclient legacy kerberos ccache" \
|
testit "test rpcclient legacy kerberos ccache" \
|
||||||
test_rpc_getusername || \
|
test_rpc_getusername ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
$samba_kdestroy
|
$samba_kdestroy
|
||||||
|
|
||||||
### RPCCLIENT
|
### RPCCLIENT
|
||||||
cmd='$samba_rpcclient ncacn_np:${SERVER} -U${USERNAME}%${PASSWORD} --use-kerberos=disabled --configfile=${CONFIGURATION} -c getusername 2>&1'
|
cmd='$samba_rpcclient ncacn_np:${SERVER} -U${USERNAME}%${PASSWORD} --use-kerberos=disabled --configfile=${CONFIGURATION} -c getusername 2>&1'
|
||||||
testit "test rpcclient ntlm" \
|
testit "test rpcclient ntlm" \
|
||||||
test_rpc_getusername || \
|
test_rpc_getusername ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
cmd='echo ${PASSWORD} | USER=${USERNAME} $samba_rpcclient ncacn_np:${SERVER} --use-kerberos=disabled --configfile=${CONFIGURATION} -c getusername 2>&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" \
|
testit "test rpcclient ntlm interactive" \
|
||||||
test_rpc_getusername || \
|
test_rpc_getusername ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
cmd='echo ${PASSWORD} | $samba_rpcclient ncacn_np:${SERVER} -U${USERNAME} --use-kerberos=disabled --configfile=${CONFIGURATION} -c getusername 2>&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" \
|
testit "test rpcclient ntlm interactive with -U" \
|
||||||
test_rpc_getusername || \
|
test_rpc_getusername ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
cmd='$samba_rpcclient ncacn_np:${SERVER} -U${USERNAME}%${PASSWORD} --use-kerberos=required --configfile=${CONFIGURATION} -c getusername 2>&1'
|
cmd='$samba_rpcclient ncacn_np:${SERVER} -U${USERNAME}%${PASSWORD} --use-kerberos=required --configfile=${CONFIGURATION} -c getusername 2>&1'
|
||||||
testit "test rpcclient kerberos" \
|
testit "test rpcclient kerberos" \
|
||||||
test_rpc_getusername || \
|
test_rpc_getusername ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
cmd='echo ${PASSWORD} | $samba_rpcclient ncacn_np:${SERVER} -U${USERNAME} --use-krb5-ccache=$KRB5CCNAME --configfile=${CONFIGURATION} -c getusername 2>&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)" \
|
testit_expect_failure "test rpcclient kerberos interactive (negative test)" \
|
||||||
test_rpc_getusername || \
|
test_rpc_getusername ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
kerberos_kinit $samba_kinit ${USERNAME}@${REALM} ${PASSWORD}
|
kerberos_kinit $samba_kinit ${USERNAME}@${REALM} ${PASSWORD}
|
||||||
cmd='$samba_rpcclient ncacn_np:${SERVER} --use-krb5-ccache=$KRB5CCNAME --configfile=${CONFIGURATION} -c getusername 2>&1'
|
cmd='$samba_rpcclient ncacn_np:${SERVER} --use-krb5-ccache=$KRB5CCNAME --configfile=${CONFIGURATION} -c getusername 2>&1'
|
||||||
testit "test rpcclient kerberos ccache" \
|
testit "test rpcclient kerberos ccache" \
|
||||||
test_rpc_getusername || \
|
test_rpc_getusername ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
$samba_kdestroy
|
$samba_kdestroy
|
||||||
|
|
||||||
### SMBTORTURE (legacy)
|
### SMBTORTURE (legacy)
|
||||||
|
|
||||||
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'
|
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'
|
||||||
testit "test smbtorture legacy default" \
|
testit "test smbtorture legacy default" \
|
||||||
test_rpc_getusername || \
|
test_rpc_getusername ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
cmd='$samba_smbtorture -U${USERNAME}%${PASSWORD} -k no --configfile=${CONFIGURATION} --maximum-runtime=30 --basedir=$PREFIX --option=torture:progress=no --target=samba4 ncacn_np:${SERVER} rpc.lsa-getuser 2>&1'
|
cmd='$samba_smbtorture -U${USERNAME}%${PASSWORD} -k no --configfile=${CONFIGURATION} --maximum-runtime=30 --basedir=$PREFIX --option=torture:progress=no --target=samba4 ncacn_np:${SERVER} rpc.lsa-getuser 2>&1'
|
||||||
testit "test smbtorture legacy ntlm (kerberos=no)" \
|
testit "test smbtorture legacy ntlm (kerberos=no)" \
|
||||||
test_rpc_getusername || \
|
test_rpc_getusername ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
cmd='$samba_smbtorture -U${USERNAME}%${PASSWORD} -k yes --configfile=${CONFIGURATION} --maximum-runtime=30 --basedir=$PREFIX --option=torture:progress=no --target=samba4 ncacn_np:${SERVER} rpc.lsa-getuser 2>&1'
|
cmd='$samba_smbtorture -U${USERNAME}%${PASSWORD} -k yes --configfile=${CONFIGURATION} --maximum-runtime=30 --basedir=$PREFIX --option=torture:progress=no --target=samba4 ncacn_np:${SERVER} rpc.lsa-getuser 2>&1'
|
||||||
testit "test smbtorture legacy kerberos=yes" \
|
testit "test smbtorture legacy kerberos=yes" \
|
||||||
test_rpc_getusername || \
|
test_rpc_getusername ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
kerberos_kinit $samba_kinit ${USERNAME}@${REALM} ${PASSWORD}
|
kerberos_kinit $samba_kinit ${USERNAME}@${REALM} ${PASSWORD}
|
||||||
cmd='$samba_smbtorture -k yes --configfile=${CONFIGURATION} --maximum-runtime=30 --basedir=$PREFIX --option=torture:progress=no --target=samba4 ncacn_np:${SERVER} rpc.lsa-getuser 2>&1'
|
cmd='$samba_smbtorture -k yes --configfile=${CONFIGURATION} --maximum-runtime=30 --basedir=$PREFIX --option=torture:progress=no --target=samba4 ncacn_np:${SERVER} rpc.lsa-getuser 2>&1'
|
||||||
testit "test smbtorture legacy kerberos=yes ccache" \
|
testit "test smbtorture legacy kerberos=yes ccache" \
|
||||||
test_rpc_getusername || \
|
test_rpc_getusername ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
$samba_kdestroy
|
$samba_kdestroy
|
||||||
|
|
||||||
kerberos_kinit $samba_kinit ${USERNAME}@${REALM} ${PASSWORD}
|
kerberos_kinit $samba_kinit ${USERNAME}@${REALM} ${PASSWORD}
|
||||||
cmd='$samba_smbtorture -k no --configfile=${CONFIGURATION} --maximum-runtime=30 --basedir=$PREFIX --option=torture:progress=no --target=samba4 ncacn_np:${SERVER} rpc.lsa-getuser 2>&1'
|
cmd='$samba_smbtorture -k no --configfile=${CONFIGURATION} --maximum-runtime=30 --basedir=$PREFIX --option=torture:progress=no --target=samba4 ncacn_np:${SERVER} rpc.lsa-getuser 2>&1'
|
||||||
testit_expect_failure "test smbtorture legacy kerberos=no ccache (negative test)" \
|
testit_expect_failure "test smbtorture legacy kerberos=no ccache (negative test)" \
|
||||||
test_rpc_getusername || \
|
test_rpc_getusername ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
$samba_kdestroy
|
$samba_kdestroy
|
||||||
|
|
||||||
### SMBTORTURE
|
### 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'
|
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'
|
||||||
testit "test smbtorture default" \
|
testit "test smbtorture default" \
|
||||||
test_rpc_getusername || \
|
test_rpc_getusername ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
cmd='$samba_smbtorture -U${USERNAME}%${PASSWORD} --use-kerberos=disabled --configfile=${CONFIGURATION} --maximum-runtime=30 --basedir=$PREFIX --option=torture:progress=no --target=samba4 ncacn_np:${SERVER} rpc.lsa-getuser 2>&1'
|
cmd='$samba_smbtorture -U${USERNAME}%${PASSWORD} --use-kerberos=disabled --configfile=${CONFIGURATION} --maximum-runtime=30 --basedir=$PREFIX --option=torture:progress=no --target=samba4 ncacn_np:${SERVER} rpc.lsa-getuser 2>&1'
|
||||||
testit "test smbtorture ntlm (kerberos=no)" \
|
testit "test smbtorture ntlm (kerberos=no)" \
|
||||||
test_rpc_getusername || \
|
test_rpc_getusername ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
cmd='$samba_smbtorture -U${USERNAME}%${PASSWORD} --use-kerberos=required --configfile=${CONFIGURATION} --maximum-runtime=30 --basedir=$PREFIX --option=torture:progress=no --target=samba4 ncacn_np:${SERVER} rpc.lsa-getuser 2>&1'
|
cmd='$samba_smbtorture -U${USERNAME}%${PASSWORD} --use-kerberos=required --configfile=${CONFIGURATION} --maximum-runtime=30 --basedir=$PREFIX --option=torture:progress=no --target=samba4 ncacn_np:${SERVER} rpc.lsa-getuser 2>&1'
|
||||||
testit "test smbtorture kerberos=yes" \
|
testit "test smbtorture kerberos=yes" \
|
||||||
test_rpc_getusername || \
|
test_rpc_getusername ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
kerberos_kinit $samba_kinit ${USERNAME}@${REALM} ${PASSWORD}
|
kerberos_kinit $samba_kinit ${USERNAME}@${REALM} ${PASSWORD}
|
||||||
cmd='$samba_smbtorture --use-krb5-ccache=$KRB5CCNAME --configfile=${CONFIGURATION} --maximum-runtime=30 --basedir=$PREFIX --option=torture:progress=no --target=samba4 ncacn_np:${SERVER} rpc.lsa-getuser 2>&1'
|
cmd='$samba_smbtorture --use-krb5-ccache=$KRB5CCNAME --configfile=${CONFIGURATION} --maximum-runtime=30 --basedir=$PREFIX --option=torture:progress=no --target=samba4 ncacn_np:${SERVER} rpc.lsa-getuser 2>&1'
|
||||||
testit "test smbtorture kerberos=yes ccache" \
|
testit "test smbtorture kerberos=yes ccache" \
|
||||||
test_rpc_getusername || \
|
test_rpc_getusername ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
$samba_kdestroy
|
$samba_kdestroy
|
||||||
|
|
||||||
kerberos_kinit $samba_kinit ${USERNAME}@${REALM} ${PASSWORD}
|
kerberos_kinit $samba_kinit ${USERNAME}@${REALM} ${PASSWORD}
|
||||||
cmd='$samba_smbtorture --use-kerbers=required --configfile=${CONFIGURATION} --maximum-runtime=30 --basedir=$PREFIX --option=torture:progress=no --target=samba4 ncacn_np:${SERVER} rpc.lsa-getuser 2>&1'
|
cmd='$samba_smbtorture --use-kerbers=required --configfile=${CONFIGURATION} --maximum-runtime=30 --basedir=$PREFIX --option=torture:progress=no --target=samba4 ncacn_np:${SERVER} rpc.lsa-getuser 2>&1'
|
||||||
testit_expect_failure "test smbtorture kerberos=no ccache (negative test)" \
|
testit_expect_failure "test smbtorture kerberos=no ccache (negative test)" \
|
||||||
test_rpc_getusername || \
|
test_rpc_getusername ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
$samba_kdestroy
|
$samba_kdestroy
|
||||||
|
|
||||||
### SMBCLIENT (legacy)
|
### SMBCLIENT (legacy)
|
||||||
cmd='$samba_smbclient //${SERVER}/tmp -W ${DOMAIN} -U${USERNAME}%${PASSWORD} --configfile=${CONFIGURATION} -c "ls; quit"'
|
cmd='$samba_smbclient //${SERVER}/tmp -W ${DOMAIN} -U${USERNAME}%${PASSWORD} --configfile=${CONFIGURATION} -c "ls; quit"'
|
||||||
testit "test smbclient legacy ntlm" \
|
testit "test smbclient legacy ntlm" \
|
||||||
test_smbclient || \
|
test_smbclient ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
cmd='echo ${PASSWORD} | USER=$USERNAME $samba_smbclient //${SERVER}/tmp -W ${DOMAIN} --configfile=${CONFIGURATION} -c "ls; quit"'
|
cmd='echo ${PASSWORD} | USER=$USERNAME $samba_smbclient //${SERVER}/tmp -W ${DOMAIN} --configfile=${CONFIGURATION} -c "ls; quit"'
|
||||||
testit "test smbclient legacy ntlm interactive" \
|
testit "test smbclient legacy ntlm interactive" \
|
||||||
test_smbclient || \
|
test_smbclient ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
cmd='echo ${PASSWORD} | $samba_smbclient //${SERVER}/tmp -W ${DOMAIN} -U${USERNAME} --configfile=${CONFIGURATION} -c "ls; quit"'
|
cmd='echo ${PASSWORD} | $samba_smbclient //${SERVER}/tmp -W ${DOMAIN} -U${USERNAME} --configfile=${CONFIGURATION} -c "ls; quit"'
|
||||||
testit "test smbclient legacy ntlm interactive with -U" \
|
testit "test smbclient legacy ntlm interactive with -U" \
|
||||||
test_smbclient || \
|
test_smbclient ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
cmd='$samba_smbclient //${SERVER}/tmp -W ${DOMAIN} -U${USERNAME}%${PASSWORD} -k --configfile=${CONFIGURATION} -c "ls; quit"'
|
cmd='$samba_smbclient //${SERVER}/tmp -W ${DOMAIN} -U${USERNAME}%${PASSWORD} -k --configfile=${CONFIGURATION} -c "ls; quit"'
|
||||||
testit "test smbclient legacy kerberos" \
|
testit "test smbclient legacy kerberos" \
|
||||||
test_smbclient || \
|
test_smbclient ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
kerberos_kinit $samba_kinit ${USERNAME}@${REALM} ${PASSWORD}
|
kerberos_kinit $samba_kinit ${USERNAME}@${REALM} ${PASSWORD}
|
||||||
cmd='$samba_smbclient //${SERVER}/tmp -W ${DOMAIN} -k --configfile=${CONFIGURATION} -c "ls; quit"'
|
cmd='$samba_smbclient //${SERVER}/tmp -W ${DOMAIN} -k --configfile=${CONFIGURATION} -c "ls; quit"'
|
||||||
testit "test smbclient legacy kerberos ccache" \
|
testit "test smbclient legacy kerberos ccache" \
|
||||||
test_smbclient || \
|
test_smbclient ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
$samba_kdestroy
|
$samba_kdestroy
|
||||||
|
|
||||||
### SMBCLIENT tests for --use-kerberos=desired|required|disabled
|
### SMBCLIENT tests for --use-kerberos=desired|required|disabled
|
||||||
cmd='$samba_smbclient //${SERVER}/tmp -W ${DOMAIN} -U${USERNAME}%${PASSWORD} --use-kerberos=disabled --configfile=${CONFIGURATION} -c "ls; quit"'
|
cmd='$samba_smbclient //${SERVER}/tmp -W ${DOMAIN} -U${USERNAME}%${PASSWORD} --use-kerberos=disabled --configfile=${CONFIGURATION} -c "ls; quit"'
|
||||||
testit "test smbclient ntlm" \
|
testit "test smbclient ntlm" \
|
||||||
test_smbclient || \
|
test_smbclient ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
cmd='echo ${PASSWORD} | USER=$USERNAME $samba_smbclient //${SERVER}/tmp -W ${DOMAIN} --use-kerberos=disabled --configfile=${CONFIGURATION} -c "ls; quit"'
|
cmd='echo ${PASSWORD} | USER=$USERNAME $samba_smbclient //${SERVER}/tmp -W ${DOMAIN} --use-kerberos=disabled --configfile=${CONFIGURATION} -c "ls; quit"'
|
||||||
testit "test smbclient ntlm interactive" \
|
testit "test smbclient ntlm interactive" \
|
||||||
test_smbclient || \
|
test_smbclient ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
cmd='echo ${PASSWORD} | $samba_smbclient //${SERVER}/tmp -W ${DOMAIN} -U${USERNAME} --use-kerberos=disabled --configfile=${CONFIGURATION} -c "ls; quit"'
|
cmd='echo ${PASSWORD} | $samba_smbclient //${SERVER}/tmp -W ${DOMAIN} -U${USERNAME} --use-kerberos=disabled --configfile=${CONFIGURATION} -c "ls; quit"'
|
||||||
testit "test smbclient ntlm interactive with -U" \
|
testit "test smbclient ntlm interactive with -U" \
|
||||||
test_smbclient || \
|
test_smbclient ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
cmd='$samba_smbclient //${SERVER}/tmp -W ${DOMAIN} -U${USERNAME}%${PASSWORD} --use-kerberos=desired --configfile=${CONFIGURATION} -c "ls; quit"'
|
cmd='$samba_smbclient //${SERVER}/tmp -W ${DOMAIN} -U${USERNAME}%${PASSWORD} --use-kerberos=desired --configfile=${CONFIGURATION} -c "ls; quit"'
|
||||||
testit "test smbclient kerberos=desired" \
|
testit "test smbclient kerberos=desired" \
|
||||||
test_smbclient_kerberos || \
|
test_smbclient_kerberos ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
cmd='$samba_smbclient //${SERVER}/tmp -W ${DOMAIN} -U${USERNAME}%${PASSWORD} --use-kerberos=required --configfile=${CONFIGURATION} -c "ls; quit"'
|
cmd='$samba_smbclient //${SERVER}/tmp -W ${DOMAIN} -U${USERNAME}%${PASSWORD} --use-kerberos=required --configfile=${CONFIGURATION} -c "ls; quit"'
|
||||||
testit "test smbclient kerberos=required" \
|
testit "test smbclient kerberos=required" \
|
||||||
test_smbclient_kerberos || \
|
test_smbclient_kerberos ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
|
|
||||||
kerberos_kinit $samba_kinit ${USERNAME}@${REALM} ${PASSWORD}
|
kerberos_kinit $samba_kinit ${USERNAME}@${REALM} ${PASSWORD}
|
||||||
cmd='$samba_smbclient //${SERVER}/tmp --use-krb5-ccache=$KRB5CCNAME --configfile=${CONFIGURATION} -c "ls; quit"'
|
cmd='$samba_smbclient //${SERVER}/tmp --use-krb5-ccache=$KRB5CCNAME --configfile=${CONFIGURATION} -c "ls; quit"'
|
||||||
testit "test smbclient kerberos=required ccache" \
|
testit "test smbclient kerberos=required ccache" \
|
||||||
test_smbclient || \
|
test_smbclient ||
|
||||||
failed=$(expr $failed + 1)
|
failed=$(expr $failed + 1)
|
||||||
$samba_kdestroy
|
$samba_kdestroy
|
||||||
|
|
||||||
rm -rf $KRB5CCNAME_PATH
|
rm -rf $KRB5CCNAME_PATH
|
||||||
|
Loading…
x
Reference in New Issue
Block a user