diff options
author | Russ Allbery <rra@stanford.edu> | 2008-02-07 00:46:54 +0000 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2008-02-07 00:46:54 +0000 |
commit | e733132938bc4fc74584b9a7c0f5441eb640e617 (patch) | |
tree | 7c2cd522c55d6a2f1e37f75081368529f9d5b8a3 /tests | |
parent | f9e41d036aebc03adc2a03a956f219fc827e2cdd (diff) |
When creating a srvtab based on a just-downloaded keytab, extract the
srvtab key before merging the keytab into an existing file.
Otherwise, if the new keys had a lower kvno than the old keys
(possible after deleting and recreating the object), the wrong key
would be extracted for the srvtab.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/client/basic-t.in | 28 | ||||
-rwxr-xr-x | tests/data/cmd-fake | 13 | ||||
-rw-r--r-- | tests/data/fake-keytab-old | bin | 0 -> 334 bytes |
3 files changed, 31 insertions, 10 deletions
diff --git a/tests/client/basic-t.in b/tests/client/basic-t.in index d983786..807d9e9 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=27 +total=30 count=1 echo "$total" @@ -82,7 +82,7 @@ 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 file -f output fake-test + -f output get file fake-test if cmp output data/fake-data >/dev/null 2>&1 ; then printcount "ok" else @@ -94,7 +94,7 @@ else printcount "ok" fi runsuccess "" "$wallet" -k "$principal" -p 14373 -s localhost -c fake-wallet \ - get file -f output fake-test + -f output get file fake-test if cmp output data/fake-data >/dev/null 2>&1 ; then printcount "ok" else @@ -127,7 +127,7 @@ fi rm -f output output.bak # Test keytab support. -runsuccess "" "$wallet" get -f keytab keytab service/fake-srvtab +runsuccess "" "$wallet" -f keytab get keytab service/fake-srvtab if cmp keytab data/fake-keytab >/dev/null 2>&1 ; then printcount "ok" rm keytab @@ -141,7 +141,7 @@ else fi # Test srvtab support. -runsuccess "" "$wallet" get keytab -f keytab -S srvtab service/fake-srvtab +runsuccess "" "$wallet" -f keytab -S srvtab get keytab service/fake-srvtab if cmp keytab data/fake-keytab >/dev/null 2>&1 ; then printcount "ok" else @@ -153,7 +153,7 @@ if [ -f sync-kaserver ] ; then else printcount "not ok" fi -runsuccess "" "$wallet" get keytab -f keytab -S srvtab service/fake-srvtab +runsuccess "" "$wallet" -f keytab -S srvtab get keytab service/fake-srvtab if cmp keytab data/fake-keytab >/dev/null 2>&1 ; then printcount "ok" else @@ -188,6 +188,22 @@ else printcount "not ok" fi +# Test srvtab download into a merged keytab with an older version. +cp data/fake-keytab-old keytab +runsuccess "" "$wallet" -f keytab -S srvtab get keytab service/fake-srvtab +if [ -f sync-kaserver ] ; then + printcount "ok" + rm sync-kaserver +else + printcount "not ok" +fi +if cmp srvtab data/fake-srvtab >/dev/null 2>&1 ; then + printcount "ok" +else + printcount "not ok" +fi +rm -f keytab srvtab + # Test various other client functions and errors. runsuccess "This is a fake keytab." "$wallet" get keytab service/fake-output runsuccess "Some stuff about file fake-test" \ diff --git a/tests/data/cmd-fake b/tests/data/cmd-fake index 4b97f43..a8d979a 100755 --- a/tests/data/cmd-fake +++ b/tests/data/cmd-fake @@ -50,11 +50,16 @@ setattr) fi case "$1" in service/fake-srvtab) - if [ "$3" != "kaserver" ] ; then - echo "Invalid attribute value $3" >&2 - exit 1 + if [ "$3" = "kaserver" ] ; then + touch sync-kaserver + else + if [ "$3" = "" ] ; then + rm sync-kaserver + else + echo "Invalid attribute value $3" >&2 + exit 1 + fi fi - touch sync-kaserver ;; *) echo "Looking at sync attribute of wrong keytab" >&2 diff --git a/tests/data/fake-keytab-old b/tests/data/fake-keytab-old Binary files differnew file mode 100644 index 0000000..6a13fd6 --- /dev/null +++ b/tests/data/fake-keytab-old |