#!/bin/sh

set -eu

REQUIRED_CMDLINE="-c examples/cgi.conf"
. regression.inc

HOST="localhost"
METHODS="GET POST"

NAME="check cgi printenv.sh"
CODE=200
WPATH="/print_env.sh"
do_request

AWK_FILE="cgi.awk"
NAME="check cgi query"
CODE=200
WPATH="/print_env.sh?foo=bar&baz=foo+bar"
do_request

NAME="wrong method"
METHODS="HEAD"
CODE=405
WPATH="/print_env.sh"
do_request

echo "All tests passed"
