From 86bce23e53e6cc89ed5104b21a5fe33fab5a7a9f Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Thu, 24 Apr 2008 23:05:14 +0000 Subject: 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. --- tests/client/basic-t.in | 30 +++++++++++++++++++++++++++++- tests/data/cmd-fake | 7 +++++++ 2 files changed, 36 insertions(+), 1 deletion(-) (limited to 'tests') 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 -- cgit v1.2.3