webhookd/tests/test_simple.sh
Nicolas Carlier 1dab1e968d feat(notification): complete refactoring of the notification system
- URL based configuration
- Only prefixed output lines are notified
- HTTP notifier: send a JSON with notification in the text attribute
- SMTP notifier: send an email with notification text in body
2018-12-30 21:00:22 +00:00

17 lines
476 B
Bash
Executable File

#!/bin/bash
echo "Running simple test script..."
echo "Testing parameters..."
[ -z "$name" ] && echo "Name variable undefined" && exit 1
[ -z "$user_agent" ] && echo "User-Agent variable undefined" && exit 1
[ "$user_agent" != "test" ] && echo "Invalid User-Agent variable: $user_agent" && exit 1
echo "Testing payload..."
[ -z "$1" ] && echo "Payload undefined" && exit 1
[ "$1" != "{\"foo\": \"bar\"}" ] && echo "Invalid payload: $1" && exit 1
echo "notify: OK"
exit 0