aboutsummaryrefslogtreecommitdiff
path: root/tests/client/basic-t.in
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2008-01-19 00:37:31 +0000
committerRuss Allbery <rra@stanford.edu>2008-01-19 00:37:31 +0000
commitaa57ab48cc9df24ab756b5651959b36a2d81cad3 (patch)
treeff27773218cb6d2677032d18f6872dd45493b82a /tests/client/basic-t.in
parent275cc7eac5d693bffec19884bf37322df59a871c (diff)
When downloading a keytab to a file that already exists, merge the new
keytab keys into that file rather than moving aside the old keytab and creating a new keytab with only the new keys. Also fix get handling in the client for all types other than keytabs. This isn't visible yet since the server doesn't yet support other types of objects.
Diffstat (limited to 'tests/client/basic-t.in')
-rw-r--r--tests/client/basic-t.in60
1 files changed, 40 insertions, 20 deletions
diff --git a/tests/client/basic-t.in b/tests/client/basic-t.in
index b4f539c..d983786 100644
--- a/tests/client/basic-t.in
+++ b/tests/client/basic-t.in
@@ -12,7 +12,7 @@
. "@abs_top_srcdir@/tests/libtest.sh"
# Print the number of tests.
-total=23
+total=27
count=1
echo "$total"
@@ -78,29 +78,29 @@ if [ -z "$krb5conf" ] ; then
fi
# Make sure everything's clean.
-rm -f keytab keytab.bak srvtab srvtab.bak sync-kaserver
+rm -f output output.bak keytab keytab.bak srvtab srvtab.bak sync-kaserver
# Now, we can finally run our tests. First, basic operations.
runsuccess "" "$wallet" -k "$principal" -p 14373 -s localhost -c fake-wallet \
- get keytab -f keytab service/fake-test
-if cmp keytab data/fake-data >/dev/null 2>&1 ; then
+ get file -f output fake-test
+if cmp output data/fake-data >/dev/null 2>&1 ; then
printcount "ok"
else
printcount "not ok"
fi
-if [ -f keytab.bak ] || [ -f keytab.new ] ; then
+if [ -f output.bak ] || [ -f output.new ] ; then
printcount "not ok"
else
printcount "ok"
fi
runsuccess "" "$wallet" -k "$principal" -p 14373 -s localhost -c fake-wallet \
- get keytab -f keytab service/fake-test
-if cmp keytab data/fake-data >/dev/null 2>&1 ; then
+ get file -f output fake-test
+if cmp output data/fake-data >/dev/null 2>&1 ; then
printcount "ok"
else
printcount "not ok"
fi
-if [ -f keytab.new ] || [ ! -f keytab.bak ] ; then
+if [ -f output.new ] || [ ! -f output.bak ] ; then
printcount "not ok"
else
printcount "ok"
@@ -118,27 +118,36 @@ cat >> krb5.conf <<EOF
wallet_principal = $principal
}
EOF
-runsuccess "" "$wallet" get keytab -f keytab service/fake-test
-if cmp keytab data/fake-data >/dev/null 2>&1 ; then
+runsuccess "" "$wallet" -f output get file fake-test
+if cmp output data/fake-data >/dev/null 2>&1 ; then
printcount "ok"
else
printcount "not ok"
fi
+rm -f output output.bak
-# Test srvtab support.
-runsuccess "" "$wallet" get keytab -f keytab -S srvtab service/fake-srvtab
+# Test keytab support.
+runsuccess "" "$wallet" get -f keytab keytab service/fake-srvtab
if cmp keytab data/fake-keytab >/dev/null 2>&1 ; then
printcount "ok"
rm keytab
else
printcount "not ok"
fi
-if cmp keytab.bak data/fake-data >/dev/null 2>&1 ; then
+if [ ! -f sync-kaserver ] ; then
printcount "ok"
- rm keytab.bak
else
printcount "not ok"
fi
+
+# Test srvtab support.
+runsuccess "" "$wallet" get keytab -f keytab -S srvtab service/fake-srvtab
+if cmp keytab data/fake-keytab >/dev/null 2>&1 ; then
+ printcount "ok"
+else
+ printcount "not ok"
+fi
+rm keytab
if [ -f sync-kaserver ] ; then
printcount "ok"
else
@@ -147,7 +156,6 @@ fi
runsuccess "" "$wallet" get keytab -f keytab -S srvtab service/fake-srvtab
if cmp keytab data/fake-keytab >/dev/null 2>&1 ; then
printcount "ok"
- rm keytab
else
printcount "not ok"
fi
@@ -159,26 +167,38 @@ else
fi
if cmp srvtab data/fake-srvtab >/dev/null 2>&1 ; then
printcount "ok"
- rm srvtab
else
printcount "not ok"
fi
if cmp srvtab.bak data/fake-srvtab >/dev/null 2>&1 ; then
printcount "ok"
- rm srvtab.bak
else
printcount "not ok"
fi
+rm -f srvtab srvtab.bak
+
+# Test keytab merging.
+runsuccess "" "$wallet" -f keytab get keytab service/fake-keytab
+(klist -keK keytab 2>&1) | sed '/Keytab name:/d' > klist-seen
+(klist -keK data/fake-keytab-merge 2>&1) | sed '/Keytab name:/d' > klist-good
+if cmp klist-seen klist-good >/dev/null 2>&1 ; then
+ printcount "ok"
+ rm -f keytab klist-seen klist-good
+else
+ printcount "not ok"
+fi
+
+# Test various other client functions and errors.
runsuccess "This is a fake keytab." "$wallet" get keytab service/fake-output
-runsuccess "Some stuff about service/fake-test" \
- "$wallet" show keytab service/fake-test
+runsuccess "Some stuff about file fake-test" \
+ "$wallet" show file fake-test
runfailure 1 "wallet: Unknown object type srvtab" \
"$wallet" get srvtab service/fake-test
runfailure 1 "wallet: Unknown keytab service/unknown" \
"$wallet" show keytab service/unknown
runfailure 1 "wallet: Unknown keytab service/unknown" \
"$wallet" get keytab service/unknown
-runsuccess "Expiration date of service/fake-test" \
+runsuccess "Expiration date of keytab service/fake-test" \
"$wallet" expires keytab service/fake-test
# Clean up.