mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-04-07 11:08:36 +00:00
Avoid 1 second delay in tests when using curl to post forms
This commit is contained in:
parent
92af9769ec
commit
dced3bbb91
@ -50,6 +50,7 @@ meshms_send_message() {
|
||||
local text="${3?}"
|
||||
if $MESHMS_USE_RESTFUL; then
|
||||
executeOk curl \
|
||||
-H "Expect:" \
|
||||
--silent --fail --show-error \
|
||||
--output meshms_send_message.json \
|
||||
--basic --user "$MESHMS_RESTFUL_USER:$MESHMS_RESTFUL_PASSWORD" \
|
||||
|
@ -579,6 +579,7 @@ rhizome_add_bundles() {
|
||||
fi
|
||||
if $RHIZOME_USE_RESTFUL; then
|
||||
executeOk curl \
|
||||
-H "Expect:" \
|
||||
--silent --fail --show-error \
|
||||
--output "file$n.manifest" \
|
||||
--dump-header http.header$n \
|
||||
|
@ -398,6 +398,7 @@ setup_MeshmsSend() {
|
||||
}
|
||||
test_MeshmsSend() {
|
||||
executeOk curl \
|
||||
-H "Expect:" \
|
||||
--silent --fail --show-error \
|
||||
--output sendmessage.json \
|
||||
--basic --user harry:potter \
|
||||
@ -406,6 +407,7 @@ test_MeshmsSend() {
|
||||
executeOk_servald meshms list messages $SIDA1 $SIDA2
|
||||
assertStdoutGrep --matches=1 ':>:Hello World'
|
||||
executeOk curl \
|
||||
-H "Expect:" \
|
||||
--silent --fail --show-error \
|
||||
--output sendmessage.json \
|
||||
--basic --user ron:weasley \
|
||||
@ -423,6 +425,7 @@ setup_MeshmsSendMissingMessage() {
|
||||
}
|
||||
test_MeshmsSendMissingMessage() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http.body \
|
||||
--dump-header http.header \
|
||||
@ -445,6 +448,7 @@ setup_MeshmsSendDuplicateMessage() {
|
||||
}
|
||||
test_MeshmsSendDuplicateMessage() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http.body \
|
||||
--dump-header http.header \
|
||||
@ -468,6 +472,7 @@ setup_MeshmsSendMessageMissingContentType() {
|
||||
}
|
||||
test_MeshmsSendMessageMissingContentType() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http.body \
|
||||
--dump-header http.header \
|
||||
@ -490,6 +495,7 @@ setup_MeshmsSendMessageUnsupportedContentType() {
|
||||
}
|
||||
test_MeshmsSendMessageUnsupportedContentType() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http.body \
|
||||
--dump-header http.header \
|
||||
@ -512,6 +518,7 @@ setup_MeshmsSendMessageMissingCharset() {
|
||||
}
|
||||
test_MeshmsSendMessageMissingCharset() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http.body \
|
||||
--dump-header http.header \
|
||||
@ -534,6 +541,7 @@ setup_MeshmsSendMessageUnsupportedCharset() {
|
||||
}
|
||||
test_MeshmsSendMessageUnsupportedCharset() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http.body \
|
||||
--dump-header http.header \
|
||||
@ -556,6 +564,7 @@ setup_MeshmsSendNoIdentity() {
|
||||
}
|
||||
test_MeshmsSendNoIdentity() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http.body \
|
||||
--dump-header http.header \
|
||||
@ -587,6 +596,7 @@ setup_MeshmsReadAllConversations() {
|
||||
}
|
||||
test_MeshmsReadAllConversations() {
|
||||
executeOk curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http_body \
|
||||
--basic --user harry:potter \
|
||||
@ -615,6 +625,7 @@ setup_MeshmsPostSpuriousContent() {
|
||||
}
|
||||
test_MeshmsPostSpuriousContent() {
|
||||
executeOk curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http_body \
|
||||
--basic --user harry:potter \
|
||||
@ -646,6 +657,7 @@ setup_MeshmsReadAllMessages() {
|
||||
}
|
||||
test_MeshmsReadAllMessages() {
|
||||
executeOk curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http_body \
|
||||
--basic --user harry:potter \
|
||||
@ -674,6 +686,7 @@ setup_MeshmsReadMessage() {
|
||||
}
|
||||
test_MeshmsReadMessage() {
|
||||
executeOk curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http_body \
|
||||
--basic --user harry:potter \
|
||||
@ -685,6 +698,7 @@ test_MeshmsReadMessage() {
|
||||
executeOk_servald meshms list conversations $SIDA2
|
||||
assertStdoutGrep --stderr --matches=1 ":$SIDA1:unread:45:22\$"
|
||||
executeOk curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output read.json \
|
||||
--basic --user harry:potter \
|
||||
|
@ -596,6 +596,7 @@ EOF
|
||||
}
|
||||
test_HttpImport() {
|
||||
executeOk curl \
|
||||
-H "Expect:" \
|
||||
--silent --fail --show-error \
|
||||
--output http.output \
|
||||
--dump-header http.headers \
|
||||
@ -623,7 +624,11 @@ setup_HttpAddLocal() {
|
||||
}
|
||||
test_HttpAddLocal() {
|
||||
echo 'File file1' >file1
|
||||
executeOk curl --silent --form 'data=@file1' "http://${addr_localhost}:$PORTA/rhizome/secretaddfile" --output file1.manifest
|
||||
executeOk curl \
|
||||
-H "Expect:" \
|
||||
--silent \
|
||||
--form 'data=@file1' "http://${addr_localhost}:$PORTA/rhizome/secretaddfile" \
|
||||
--output file1.manifest
|
||||
assert_manifest_complete file1.manifest
|
||||
executeOk_servald rhizome list
|
||||
assert_rhizome_list --fromhere=1 file1
|
||||
|
@ -567,6 +567,7 @@ test_RhizomeInsert() {
|
||||
authorargs=()
|
||||
[ -n "${author[$n]}" ] && authorargs=(--form "bundle-author=${author[$n]}")
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output file$n.manifest \
|
||||
--dump-header http.header$n \
|
||||
@ -632,6 +633,7 @@ test_RhizomeInsert() {
|
||||
for n in 1 2 3 4; do
|
||||
$SED -e '/^version=/d;/^date=/d;/^filehash=/d;/^filesize=/d' xfile$n.manifest >nmanifest$n
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output nfile$n.manifest \
|
||||
--dump-header http.headers$n \
|
||||
@ -665,6 +667,7 @@ test_RhizomeInsertBoundaries() {
|
||||
create_file file$n $((7200 + ($n * 50)))
|
||||
>manifest$n
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output file$n.manifest \
|
||||
--dump-header http.header$n \
|
||||
@ -691,6 +694,7 @@ setup_RhizomeInsertAnon() {
|
||||
}
|
||||
test_RhizomeInsertAnon() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output ifile2.manifest \
|
||||
--dump-header http.header \
|
||||
@ -720,6 +724,7 @@ setup_RhizomeInsertAnonPassphrase() {
|
||||
test_RhizomeInsertAnonPassphrase() {
|
||||
# Create the bundle with file1
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output ifile1.manifest \
|
||||
--dump-header http.header \
|
||||
@ -744,6 +749,7 @@ test_RhizomeInsertAnonPassphrase() {
|
||||
assert_rhizome_list --fromhere=0 --manifest=ifile1.manifest file1
|
||||
# Update the bundle to file2
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output ifile2.manifest \
|
||||
--dump-header http.header \
|
||||
@ -778,6 +784,7 @@ setup_RhizomeInsertPassphrase() {
|
||||
test_RhizomeInsertPassphrase() {
|
||||
# Create the bundle with file1
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output ifile1.manifest \
|
||||
--dump-header http.header \
|
||||
@ -803,6 +810,7 @@ test_RhizomeInsertPassphrase() {
|
||||
assert_rhizome_list --fromhere=1 --manifest=ifile1.manifest file1
|
||||
# Update the bundle to file2
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output ifile2.manifest \
|
||||
--dump-header http.header \
|
||||
@ -838,6 +846,7 @@ setup_RhizomeInsertEmpty() {
|
||||
}
|
||||
test_RhizomeInsertEmpty() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output empty.manifest \
|
||||
--dump-header http.header \
|
||||
@ -867,6 +876,7 @@ setup_RhizomeInsertLarge() {
|
||||
}
|
||||
test_RhizomeInsertLarge() {
|
||||
execute --timeout=120 curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output file1.manifest \
|
||||
--dump-header http.header \
|
||||
@ -896,6 +906,7 @@ setup_RhizomeInsertMissingManifest() {
|
||||
}
|
||||
test_RhizomeInsertMissingManifest() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http.body \
|
||||
--dump-header http.header \
|
||||
@ -919,6 +930,7 @@ setup_RhizomeInsertManifestOverflow() {
|
||||
}
|
||||
test_RhizomeInsertManifestOverflow() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http.body \
|
||||
--dump-header http.header \
|
||||
@ -942,6 +954,7 @@ setup_RhizomeInsertIncorrectManifestType() {
|
||||
}
|
||||
test_RhizomeInsertIncorrectManifestType() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http.body \
|
||||
--dump-header http.header \
|
||||
@ -965,6 +978,7 @@ setup_RhizomeInsertIncorrectManifestFormat() {
|
||||
}
|
||||
test_RhizomeInsertIncorrectManifestFormat() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http.body \
|
||||
--dump-header http.header \
|
||||
@ -990,6 +1004,7 @@ setup_RhizomeInsertDuplicateManifest() {
|
||||
}
|
||||
test_RhizomeInsertDuplicateManifest() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http.body \
|
||||
--dump-header http.header \
|
||||
@ -1015,6 +1030,7 @@ setup_RhizomeInsertJournalForbidden() {
|
||||
}
|
||||
test_RhizomeInsertJournalForbidden() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http.body \
|
||||
--dump-header http.header \
|
||||
@ -1040,6 +1056,7 @@ setup_RhizomeInsertMissingPayload() {
|
||||
}
|
||||
test_RhizomeInsertMissingPayload() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http.body \
|
||||
--dump-header http.header \
|
||||
@ -1064,6 +1081,7 @@ setup_RhizomeInsertDuplicatePayload() {
|
||||
}
|
||||
test_RhizomeInsertDuplicatePayload() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http.body \
|
||||
--dump-header http.header \
|
||||
@ -1089,6 +1107,7 @@ setup_RhizomeInsertPartOrder() {
|
||||
}
|
||||
test_RhizomeInsertPartOrder() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http.body \
|
||||
--dump-header http.header \
|
||||
@ -1113,6 +1132,7 @@ setup_RhizomeInsertPartUnsupported() {
|
||||
}
|
||||
test_RhizomeInsertPartUnsupported() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http.body \
|
||||
--dump-header http.header \
|
||||
@ -1141,6 +1161,7 @@ setup_RhizomeInsertIncorrectFilesize() {
|
||||
}
|
||||
test_RhizomeInsertIncorrectFilesize() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http.body \
|
||||
--dump-header http.header \
|
||||
@ -1156,6 +1177,7 @@ test_RhizomeInsertIncorrectFilesize() {
|
||||
assertJq http.body 'contains({"rhizome_payload_status_code": 3})'
|
||||
assertJqGrep --ignore-case http.body '.rhizome_payload_status_message' 'payload size.*contradicts manifest'
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http.body \
|
||||
--dump-header http.header \
|
||||
@ -1182,6 +1204,7 @@ setup_RhizomeInsertIncorrectFilehash() {
|
||||
}
|
||||
test_RhizomeInsertIncorrectFilehash() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http.body \
|
||||
--dump-header http.header \
|
||||
@ -1215,6 +1238,7 @@ setup_RhizomeJournalAppend() {
|
||||
}
|
||||
test_RhizomeJournalAppend() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output file1.manifest \
|
||||
--dump-header http.header \
|
||||
@ -1271,6 +1295,7 @@ test_RhizomeJournalAppend() {
|
||||
executeOk_servald rhizome extract file "$BID" file1x
|
||||
assert --message="extracted payload is correct" diff file1 file1x
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output file2.manifest \
|
||||
--dump-header http.headers \
|
||||
@ -1310,6 +1335,7 @@ setup_RhizomeJournalAppendSharedPayload() {
|
||||
}
|
||||
test_RhizomeJournalAppendSharedPayload() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output file1.manifest \
|
||||
--dump-header http.header \
|
||||
@ -1330,6 +1356,7 @@ test_RhizomeJournalAppendSharedPayload() {
|
||||
assert [ $(ls "$SERVALINSTANCE_PATH/blob" | wc -l) -eq 2 ]
|
||||
extract_http_header BID http.header Serval-Rhizome-Bundle-Id "$rexp_manifestid"
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output file2.manifest \
|
||||
--dump-header http.header \
|
||||
@ -1362,6 +1389,7 @@ setup_RhizomeAppendNonJournalForbidden() {
|
||||
}
|
||||
test_RhizomeAppendNonJournalForbidden() {
|
||||
execute curl \
|
||||
-H "Expect:" \
|
||||
--silent --show-error --write-out '%{http_code}' \
|
||||
--output http.body \
|
||||
--dump-header http.header \
|
||||
|
Loading…
x
Reference in New Issue
Block a user