diff options
author | Matthieu Patou <mat@matws.net> | 2010-07-12 00:07:20 +0400 |
---|---|---|
committer | Matthieu Patou <mat@matws.net> | 2010-07-17 17:56:16 +0400 |
commit | e461e29cd9a81d4a74fcd489c2c7b693b49f41d4 (patch) | |
tree | 850edf1fef72de36a326650ec716ece2afde6fd4 | |
parent | 5a8c77f97b30ab2c81f7170a12dddb4ab9972414 (diff) | |
download | samba-e461e29cd9a81d4a74fcd489c2c7b693b49f41d4.tar.gz samba-e461e29cd9a81d4a74fcd489c2c7b693b49f41d4.tar.bz2 samba-e461e29cd9a81d4a74fcd489c2c7b693b49f41d4.zip |
s4 unittests: add blackblox test for ktpass
-rwxr-xr-x | source4/selftest/tests.sh | 1 | ||||
-rwxr-xr-x | testprogs/blackbox/test_ktpass.sh | 37 |
2 files changed, 38 insertions, 0 deletions
diff --git a/source4/selftest/tests.sh b/source4/selftest/tests.sh index 52d1d3963e..1dd507eaed 100755 --- a/source4/selftest/tests.sh +++ b/source4/selftest/tests.sh @@ -368,6 +368,7 @@ plantestsuite "blackbox.pkinit" dc:local $bbdir/test_pkinit.sh "\$SERVER" "\$USE plantestsuite "blackbox.kinit" dc:local $bbdir/test_kinit.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$REALM" "\$DOMAIN" "$PREFIX" aes256-cts-hmac-sha1-96 $CONFIGURATION plantestsuite "blackbox.kinit" fl2000dc:local $bbdir/test_kinit.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$REALM" "\$DOMAIN" "$PREFIX" arcfour-hmac-md5 $CONFIGURATION plantestsuite "blackbox.kinit" fl2008r2dc:local $bbdir/test_kinit.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$REALM" "\$DOMAIN" "$PREFIX" aes256-cts-hmac-sha1-96 $CONFIGURATION +plantestsuite "blackbox.ktpass" dc $bbdir/test_ktpass.sh $PREFIX plantestsuite "blackbox.passwords" dc:local $bbdir/test_passwords.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$REALM" "\$DOMAIN" "$PREFIX" plantestsuite "blackbox.export.keytab" dc:local $bbdir/test_export_keytab.sh "\$SERVER" "\$USERNAME" "\$REALM" "\$DOMAIN" "$PREFIX" plantestsuite "blackbox.cifsdd" dc $samba4srcdir/client/tests/test_cifsdd.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" diff --git a/testprogs/blackbox/test_ktpass.sh b/testprogs/blackbox/test_ktpass.sh new file mode 100755 index 0000000000..b106d50240 --- /dev/null +++ b/testprogs/blackbox/test_ktpass.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +if [ $# -lt 1 ]; then +cat <<EOF +Usage: blackbox_newuser.sh PREFIX +EOF +exit 1; +fi + +PREFIX="$1" +shift 1 + +. `dirname $0`/subunit.sh + + +net="$BUILDDIR/bin/net" +samba4bindir="$BUILDDIR/bin" +samba4kinit="$samba4bindir/samba4kinit$EXEEXT" +CONFIG="--configfile=$PREFIX/dc/etc/smb.conf" + +#two test for creating new user +#newuser account is created with cn=Given Name Initials. Surname +#newuser1 account is created using cn=username +testit "newuser" $net newuser $CONFIG --given-name="User" --surname="Tester" --initials="T" --profile-path="\\\\myserver\\my\\profile" --script-path="\\\\myserver\\my\\script" --home-directory="\\\\myserver\\my\\homedir" --job-title="Tester" --department="Testing" --company="Samba.org" --description="Description" --mail-address="tester@samba.org" --internet-address="http://samba.org" --telephone-number="001122334455" --physical-delivery-office="101" --home-drive="H:" testuser testp@ssw0Rd|| failed=`expr $failed + 1` + +KRB5CCNAME="$PREFIX/tmpccache" +export KRB5CCNAME +echo "testp@ssw0Rd" >$PREFIX/tmppassfile +testit "kinit with passwd" $samba4kinit -e arcfour-hmac-md5 --password-file=$PREFIX/tmppassfile testuser@SAMBA.EXAMPLE.COM || failed=`expr $failed + 1` +testit "ktpass" $BUILDDIR/scripting/bin/ktpass.sh --host LOCALDC --out $PREFIX/testuser.kt --princ testuser --pass "testp@ssw0Rd" --path-to-ldbsearch=$BUILDDIR/bin|| failed=`expr $failed + 1` + +rm -f $KRB5CCNAME + +testit "kinit with keytab" $samba4kinit -e arcfour-hmac-md5 --use-keytab -t $PREFIX/testuser.kt testuser@SAMBA.EXAMPLE.COM || failed=`expr $failed + 1` + +rm -f $PREFIX/tmpccache $PREFIX/testuser.kt +exit $failed |