about summary refs log tree commit homepage
path: root/test/test_extras_exec_cgi.sh
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2013-11-02 10:54:17 +0000
committerEric Wong <normalperson@yhbt.net>2013-11-02 22:03:54 +0000
commit3192ec1b4054bcc228dfb88e57d5e1c828682a7b (patch)
treee7f7ac214f4a6e4ccdc1f1c109f49b555921a881 /test/test_extras_exec_cgi.sh
parentf78020396ac822c31f7f0b1a593bd3f58362a27a (diff)
downloadyahns-3192ec1b4054bcc228dfb88e57d5e1c828682a7b.tar.gz
These applications are what I'll be using to run on yahns on
my personal server.

Including them here will be helpful for me to find bugs.  I've
already found some, the following commits were directly the result
of playing with these extras:

* stream_file: only close FDs we opened ourselves
* worker-less server should not waitpid indiscriminately
* http: do not drop Content-Range from response headers
Diffstat (limited to 'test/test_extras_exec_cgi.sh')
-rwxr-xr-xtest/test_extras_exec_cgi.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/test_extras_exec_cgi.sh b/test/test_extras_exec_cgi.sh
new file mode 100755
index 0000000..e580773
--- /dev/null
+++ b/test/test_extras_exec_cgi.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+# Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
+# License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
+
+# test CGI program, this remains portable POSIX shell (not bash)
+set -e
+
+stdhead () {
+        echo Content-Type: text/plain
+        echo Status: 200 OK
+        echo
+}
+
+case $PATH_INFO in
+/)
+        stdhead
+        echo HIHI
+        ;;
+/env)
+        stdhead
+        env
+        ;;
+/known-length)
+        echo Content-Type: text/plain
+        echo Status: 200 OK
+        echo Content-Length: 5
+        echo
+        echo HIHI
+        ;;
+*)
+        echo Content-Type: text/plain
+        echo Status: 404 Not Found
+        echo
+        ;;
+esac