Add Integration Test for event sending to tornado daemin
#!/usr/bin/env bash
-HTTP_RESPONSE_CODE=$(curl -sS -k -o /dev/null -w "%{http_code}" -H "content-type: application/json" -X POST -d '{"event":{"type":"something", "created_ms":111, "payload": {}}, "process_type":"SkipActions"}' http://localhost:4748/api/send_event)
+TEXT="NotMatched"
-if [ $HTTP_RESPONSE_CODE -ne 200 ]; then
- echo "[-] FAILED: Tornado daemon event sending check failed, response code was: $HTTP_RESPONSE_CODE"
- exit 1
-else
+if curl -H "content-type: application/json" -X POST -d '{"event":{"type":"something", "created_ms":111, "payload": {}}, "process_type":"SkipActions"}' http://localhost:4748/api/send_event | grep -q "$TEXT"; then
echo "Tornado daemon event sending check succeeded"
+else
+ echo "[-] FAILED: Tornado daemon event sending check failed"
+ exit 1
fi
\ No newline at end of file
