From 5dd6a53615ec56386772c0e182203c7d44caf1cc Mon Sep 17 00:00:00 2001 From: Andrew Bettison Date: Fri, 15 Mar 2013 15:58:17 +1030 Subject: [PATCH] Fix 'rhizomeops' tests Rename duplicate AddNoAuthor test to AddNoAuthorEncrypted Fix broken AddNoAuthor test Add new AddInvalidAuthor test --- tests/rhizomeops | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/rhizomeops b/tests/rhizomeops index 0716988d..6fb38ac0 100755 --- a/tests/rhizomeops +++ b/tests/rhizomeops @@ -80,19 +80,31 @@ setup_AddNoAuthor() { echo "A test file" >file1 } test_AddNoAuthor() { - executeOk_servald rhizome add file file1 file1.manifest + executeOk_servald rhizome add file '' file1 file1.manifest assert_stdout_add_file file1 assertGrep --matches=0 file1.manifest '^BK=' } -doc_AddNoAuthor="Add encrypted payload with no author" -setup_AddNoAuthor() { +doc_AddInvalidAuthor="Add with invalid author fails" +setup_AddInvalidAuthor() { + setup_servald + setup_rhizome + echo "A test file" >file1 +} +test_AddInvalidAuthor() { + execute $servald rhizome add file 'not_a_valid_SID' file1 + assertExitStatus '==' 255 + assertStderrGrep '^ERROR:.*[Ii]nvalid .*[Ss][Ii][Dd]' +} + +doc_AddNoAuthorEncrypted="Add encrypted payload with no author" +setup_AddNoAuthorEncrypted() { setup_servald setup_rhizome echo "A test file" >file1 echo "crypt=1" >file1.manifest } -test_AddNoAuthor() { +test_AddNoAuthorEncrypted() { executeOk_servald rhizome add file '' file1 file1.manifest tfw_cat --stdout --stderr assert_stdout_add_file file1