httpd.test 433 B

123456789101112131415
  1. #!/bin/bash
  2. [ -f testing.sh ] && . testing.sh
  3. #testing "name" "command" "result" "infile" "stdin"
  4. testcmd "static file" \
  5. "\"\$FILES\" | sed 's/\\r//g;1,/^\$/d'>file; cmp file \$FILES/tar/tar.tar && echo yes" \
  6. 'yes\n' '' 'GET /tar/tar.tar HTTP/1.1\r\n\r\n'
  7. rm -f file
  8. testcmd "mime type" \
  9. '"$FILES" | tr A-Z a-z | sed -n "s/\r//g;s/^content-type: //p"' "application/x-tar\n" "" \
  10. 'GET /tar/tar.tar HTTP/1.1\r\n\r\n'