From f18d7ba9af373678c6f5d0012840a60cf913030d Mon Sep 17 00:00:00 2001 From: Andrew Bettison Date: Thu, 4 Oct 2012 14:22:06 +0930 Subject: [PATCH] Re-instate .selfsigned check in assert_rhizome_list() Also add checks for the "version", "date" and ".inserttime" columns, that they match the corresponding manifest or are at least well formed. Issue #9. --- testdefs_rhizome.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/testdefs_rhizome.sh b/testdefs_rhizome.sh index d1252a30..8256fcca 100644 --- a/testdefs_rhizome.sh +++ b/testdefs_rhizome.sh @@ -46,18 +46,18 @@ assert_manifest_complete() { } assert_rhizome_list() { - # PGS 20121002 - Removed sensitivity to self-signed flag, because it will be - # different between originator and a receiver of a bundle. assertStdoutLineCount --stderr '==' $(($# + 2)) assertStdoutIs --stderr --line=1 -e '11\n' assertStdoutIs --stderr --line=2 -e 'service:id:version:date:.inserttime:.selfsigned:filesize:filehash:sender:recipient:name\n' local filename + local re__inserttime="$rexp_date" for filename; do + re__selfsigned=1 case "$filename" in *!) filename="${filename%!}"; re__selfsigned=0;; esac unpack_manifest_for_grep "$filename" - assertStdoutGrep --stderr --matches=1 "^$re_service:$re_manifestid:.*:.*:$re_filesize:$re_filehash:$re_sender:$re_recipient:$re_name\$" + assertStdoutGrep --stderr --matches=1 "^$re_service:$re_manifestid:$re_version:$re_date:$re__inserttime:$re__selfsigned:$re_filesize:$re_filehash:$re_sender:$re_recipient:$re_name\$" done } @@ -108,6 +108,7 @@ unpack_manifest_for_grep() { re_service="$rexp_service" re_manifestid="$rexp_manifestid" re_version="$rexp_version" + re_date="$rexp_date" re_secret="$rexp_bundlesecret" re_name=$(escape_grep_basic "${filename##*/}") local filesize=$($SED -n -e '/^filesize=/s///p' "$filename.manifest" 2>/dev/null) @@ -125,6 +126,7 @@ unpack_manifest_for_grep() { if [ "$filehash" = "$re_filehash" ]; then re_manifestid=$($SED -n -e '/^id=/s///p' "$filename.manifest") re_version=$($SED -n -e '/^version=/s///p' "$filename.manifest") + re_date=$($SED -n -e '/^date=/s///p' "$filename.manifest") re_service=$($SED -n -e '/^service=/s///p' "$filename.manifest") re_service=$(escape_grep_basic "$re_service") re_sender=$($SED -n -e '/^sender=/s///p' "$filename.manifest")