X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=tests%2Fcram%2Ftest_cgi-exec.t;fp=tests%2Fcram%2Ftest_cgi-exec.t;h=d5cffb45e8718330f9adaa7d4fd53659c8492eba;hb=ab4c3471b26179b6e1decfb6ca27c4a87df9a0a4;hp=0000000000000000000000000000000000000000;hpb=7b4e3241e1bd3ea123b12a7b4d1754af9e1b5442;p=project%2Fcgi-io.git diff --git a/tests/cram/test_cgi-exec.t b/tests/cram/test_cgi-exec.t new file mode 100644 index 0000000..d5cffb4 --- /dev/null +++ b/tests/cram/test_cgi-exec.t @@ -0,0 +1,30 @@ +check that cgi-exec is producing expected results: + + $ [ -n "$BUILD_BIN_DIR" ] && export PATH="$BUILD_BIN_DIR:$PATH" + $ ln -sf $BUILD_BIN_DIR/cgi-io $BUILD_BIN_DIR/cgi-exec + + $ for file in $(LC_ALL=C find "$TESTDIR/test-cases" -type f | sort); do + > export CONTENT_TYPE="application/x-www-form-urlencoded"; \ + > export CONTENT_LENGTH="$(wc -c < $file)"; \ + > printf "\n[-] testing: $(basename $file)\n"; \ + > valgrind --quiet --leak-check=full cgi-exec < $file; \ + > done + + [-] testing: cgi-exec-01.txt + Status: 400 Invalid command parameter\r (esc) + Content-Type: text/plain\r (esc) + \r (esc) + Invalid command parameter + + [-] testing: cgi-exec-02.txt + Status: 200 OK\r (esc) + Content-Type: application/octet-stream\r (esc) + \r (esc) + foo + + [-] testing: cgi-exec-03.txt + Status: 200 OK\r (esc) + Content-Type: 0\r (esc) + Content-Disposition: attachment; filename="output.txt"\r (esc) + \r (esc) + 1922