aboutsummaryrefslogtreecommitdiff
path: root/tests/httpd.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/httpd.test')
-rwxr-xr-xtests/httpd.test15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/httpd.test b/tests/httpd.test
new file mode 100755
index 00000000..ac07c39e
--- /dev/null
+++ b/tests/httpd.test
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+[ -f testing.sh ] && . testing.sh
+
+#testing "name" "command" "result" "infile" "stdin"
+
+testcmd "static file" \
+ "\"\$FILES\" | sed 's/\\r//g;1,/^\$/d'>file; cmp file \$FILES/tar/tar.tar && echo yes" \
+ 'yes\n' '' 'GET /tar/tar.tar HTTP/1.1\r\n\r\n'
+rm -f file
+
+testcmd "mime type" \
+ '"$FILES" | tr A-Z a-z | sed -n "s/\r//g;s/^content-type: //p"' "application/x-tar\n" "" \
+ 'GET /tar/tar.tar HTTP/1.1\r\n\r\n'
+