diff options
author | Andreas Schneider <asn@samba.org> | 2017-07-11 10:59:59 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2017-07-25 13:17:13 +0200 |
commit | 483090200737d34d656b16f9aa2523a3cba7bb17 (patch) | |
tree | 2bde51a73daa157a31e89497fe413cc8b7877e91 /source3 | |
parent | dc15954196e237d10c0fe3e9dd30316e1704ce25 (diff) | |
download | samba-483090200737d34d656b16f9aa2523a3cba7bb17.tar.gz |
s3:tests: Add tests for smbspool_krb5_wrapper
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jul 25 13:17:13 CEST 2017 on sn-devel-144
Diffstat (limited to 'source3')
-rwxr-xr-x | source3/script/tests/test_smbspool.sh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/source3/script/tests/test_smbspool.sh b/source3/script/tests/test_smbspool.sh index bd1884b7be7..8f9426f87ba 100755 --- a/source3/script/tests/test_smbspool.sh +++ b/source3/script/tests/test_smbspool.sh @@ -22,6 +22,7 @@ incdir=`dirname $0`/../../../testprogs/blackbox samba_bindir="$BINDIR" samba_vlp="$samba_bindir/vlp" samba_smbspool="$samba_bindir/smbspool" +samba_smbspool_krb5="$samba_bindir/smbspool_krb5_wrapper" test_smbspool_noargs() { @@ -43,6 +44,30 @@ test_smbspool_noargs() fi } +test_smbspool_authinforequired_none() +{ + cmd='$samba_smbspool_krb5 smb://$SERVER_IP/print1 200 $USERNAME "Testprint" 1 "options" $SRCDIR/testdata/printing/example.ps 2>&1' + + AUTH_INFO_REQUIRED="none" + export AUTH_INFO_REQUIRED + eval echo "$cmd" + out=$(eval $cmd) + ret=$? + unset AUTH_INFO_REQUIRED + + if [ $ret != 0 ]; then + echo "$out" + echo "failed to execute $smbspool_krb5" + fi + + echo "$out" | grep 'ATTR: auth-info-required=negotiate' + ret=$? + if [ $ret != 0 ] ; then + echo "$out" + return 1 + fi +} + # # The test enviornment uses 'vlp' (virtual lp) as the printing backend. # @@ -98,6 +123,14 @@ testit "smbspool no args" \ test_smbspool_noargs $samba_smbspool || \ failed=$(expr $failed + 1) +testit "smbspool_krb5_wrapper no args" \ + test_smbspool_noargs $samba_smbspool_krb5 || \ + failed=$(expr $failed + 1) + +testit "smbspool_krb5_wrapper AuthInfoRequired=none" \ + test_smbspool_authinforequired_none || \ + failed=$(expr $failed + 1) + testit "smbspool print example.ps" \ $samba_smbspool smb://$USERNAME:$PASSWORD@$SERVER_IP/print1 200 $USERNAME "Testprint" 1 "options" $SRCDIR/testdata/printing/example.ps || \ failed=$(expr $failed + 1) @@ -106,4 +139,15 @@ testit "vlp verify example.ps" \ test_vlp_verify \ || failed=$(expr $failed + 1) +AUTH_INFO_REQUIRED="username,password" +export AUTH_INFO_REQUIRED +testit "smbspool_krb5(username,password) print example.ps" \ + $samba_smbspool_krb5 smb://$USERNAME:$PASSWORD@$SERVER_IP/print1 200 $USERNAME "Testprint" 1 "options" $SRCDIR/testdata/printing/example.ps || \ + failed=$(expr $failed + 1) + +testit "vlp verify example.ps" \ + test_vlp_verify || \ + failed=$(expr $failed + 1) +unset AUTH_INFO_REQUIRED + exit $failed |