Skip to content

Commit 2ab73fe

Browse files
author
Max-Gerd Retzlaff
committed
POST-asynchronous.sh: add test to check that the async notification succeeded
before this change only the async request itself was checked not the success of the async notification
1 parent baeccb7 commit 2ab73fe

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

extensions/graph-store-protocol/POST-asynchronous.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ echo "post async triples" > $ECHO_OUTPUT
2727

2828
token_base64=$(echo -n ":${STORE_TOKEN}" | base64 -w 0)
2929

30+
requestID=`date +%Y%m%dT%H%M%S`
31+
3032
function async_graph_store_update () {
31-
requestID=`date +%Y%m%dT%H%M%S`
3233
index=$1
3334
curl_graph_store_update -X POST -w "%{http_code}\n" -o /dev/null \
3435
-H "Accept-Asynchronous: notify" \
@@ -70,6 +71,19 @@ select distinct ?o from <urn:dydra:all> where {?s <http://example.com/default-pr
7071
EOF
7172

7273

74+
echo "test async notifications" > $ECHO_OUTPUT
75+
curl_sparql_request -X POST \
76+
-H "Accept: application/sparql-results+json" \
77+
-H "Client-Request-Id: ${requestID}" \
78+
-H "Content-Type: application/sparql-query" \
79+
--repository "${STORE_REPOSITORY_WRITABLE}" --data-binary @- <<EOF \
80+
| tee $ECHO_OUTPUT \
81+
| fgrep -c "${requestID}" \
82+
| fgrep -q 10
83+
select ?o from <urn:dydra:all> where {?s <http://www.w3.org/ns/activitystreams#inReplyTo> ?o}
84+
EOF
85+
86+
7387
echo "test async erroneous disposition" > $ECHO_OUTPUT
7488
curl_graph_store_update -X POST -w "%{http_code}\n" -o /dev/null \
7589
-H "Accept-Asynchronous: notify-not" \

0 commit comments

Comments
 (0)