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