summaryrefslogtreecommitdiff
path: root/tests/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test.sh')
-rwxr-xr-xtests/test.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test.sh b/tests/test.sh
new file mode 100755
index 0000000..50739f5
--- /dev/null
+++ b/tests/test.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+set -e
+HOST=${HOST:-localhost}
+
+# Check features
+curl -s -H "Content-Type: application/json" http://$HOST:8080/features \
+ | grep -qs '["realm"]'
+
+# Create a host
+curl -H "Content-Type: application/json" -dhostname=foo -duserclass=bar -X POST "http://$HOST:8080/realm/example.com"
+echo
+curl -H "Content-Type: application/json" -X DELETE "http://$HOST:8080/realm/example.com/foo"
+# Removing nonexistent host is o.k.
+curl -H "Content-Type: application/json" -X DELETE "http://$HOST:8080/realm/example.com/foo"