aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2008-04-24 23:05:14 +0000
committerRuss Allbery <rra@stanford.edu>2008-04-24 23:05:14 +0000
commit86bce23e53e6cc89ed5104b21a5fe33fab5a7a9f (patch)
treec8c352137a41c5e8da8e46dd880252a30132c89e /tests
parenta93ca104c89859e1022c818579f81f528be204b5 (diff)
The wallet command-line client now reads the data for store from a
file (using -f) or from standard input (if -f wasn't given) when the data isn't specified on the command line. The data still must not contain nul characters.
Diffstat (limited to 'tests')
-rw-r--r--tests/client/basic-t.in30
-rwxr-xr-xtests/data/cmd-fake7
2 files changed, 36 insertions, 1 deletions
diff --git a/tests/client/basic-t.in b/tests/client/basic-t.in
index 3a9b2c3..f18c28e 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=31
+total=35
count=1
echo "$total"
@@ -210,6 +210,34 @@ else
fi
rm -f keytab srvtab
+# Test store from standard input.
+echo "This is a test of store" | runsuccess "" "$wallet" store file fake-test
+count=`expr $count + 1`
+echo "file fake-test" > store-correct
+echo "This is a test of store" >> store-correct
+if cmp store-output store-correct >/dev/null 2>&1 ; then
+ printcount "ok"
+else
+ printcount "not ok"
+ echo == store-output ==
+ cat store-output
+ echo == store-correct ==
+ cat store-correct
+fi
+rm -f store-output store-correct
+
+# Test store with -f.
+echo "This is more store input" > store-input
+echo "file fake-test" > store-correct
+cat store-input >> store-correct
+runsuccess "" "$wallet" -f store-input store file fake-test
+if cmp store-output store-correct >/dev/null 2>&1 ; then
+ printcount "ok"
+else
+ printcount "not ok"
+fi
+rm -f store-input store-output store-correct
+
# 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 d12f839..3ffd9cc 100755
--- a/tests/data/cmd-fake
+++ b/tests/data/cmd-fake
@@ -130,6 +130,13 @@ get)
;;
esac
;;
+store)
+ if [ -n "$3" ] ; then
+ echo "Too many arguments" >&2
+ exit 1
+ fi
+ printf "$type $1\n$2" > store-output
+ ;;
show)
if [ -n "$2" ] ; then
echo "Too many arguments" >&2