mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-31 16:35:27 +00:00
updated to handle new 10-field format of output from servald rhizome lists.
Passes all 23 tests.
This commit is contained in:
parent
4da9824ab0
commit
782e9dca03
@ -40,13 +40,12 @@ setup_servald_rhizome() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
assert_rhizome_list() {
|
assert_rhizome_list() {
|
||||||
assertStdoutLineCount '==' $(($# + 2))
|
assertStdoutLineCount '==' $(($# + 1))
|
||||||
assertStdoutIs --line=1 -e '8\n'
|
assertStdoutIs --line=1 -e '10:service:id:version:date:_inserttime:filesize:filehash:name:sender:recipient\n'
|
||||||
assertStdoutIs --line=2 -e 'service:id:version:date:_inserttime:filesize:filehash:name\n'
|
|
||||||
local filename
|
local filename
|
||||||
for filename; do
|
for filename; do
|
||||||
unpack_manifest_for_grep "$filename"
|
unpack_manifest_for_grep "$filename"
|
||||||
assertStdoutGrep --matches=1 "^$re_service:$re_manifestid:.*:$re_filehash:$re_name\$"
|
assertStdoutGrep --matches=1 "^$re_service:$re_manifestid:.*:$re_filehash:$re_name:$re_sender:$re_recipient\$"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,6 +74,8 @@ unpack_manifest_for_grep() {
|
|||||||
re_manifestid=$(sed -n -e '/^id=/s///p' "$filename.manifest")
|
re_manifestid=$(sed -n -e '/^id=/s///p' "$filename.manifest")
|
||||||
# TODO should escape grep metacharacters, although service names should be tame
|
# TODO should escape grep metacharacters, although service names should be tame
|
||||||
re_service=$(sed -n -e '/^service=/s///p' "$filename.manifest")
|
re_service=$(sed -n -e '/^service=/s///p' "$filename.manifest")
|
||||||
|
re_sender=$(sed -n -e '/^sender=/s///p' "$filename.manifest")
|
||||||
|
re_recipient=$(sed -n -e '/^recipient=/s///p' "$filename.manifest")
|
||||||
case "$re_service" in
|
case "$re_service" in
|
||||||
file)
|
file)
|
||||||
# TODO should escape grep metacharacters
|
# TODO should escape grep metacharacters
|
||||||
|
Loading…
x
Reference in New Issue
Block a user