Skip to content

Commit

Permalink
added tests for #652, stepped on #652 while testing the test, added t…
Browse files Browse the repository at this point in the history
…est for that as well
  • Loading branch information
ldemailly committed Nov 12, 2022
1 parent 08dd2ac commit 1aa464b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Webtest.sh
Expand Up @@ -28,6 +28,22 @@ DOCKERNAME=fortio_server
DOCKERSECNAME=fortio_secure_server
DOCKERSECVOLNAME=fortio_certs
FORTIO_BIN_PATH=fortio # /usr/bin/fortio is the full path but isn't needed

# Unresolvable should error out - #653
docker run fortio/fortio:webtest curl http://doesnt.exist.google.com/
if [[ $? == 0 ]]; then
echo "Error in curl should show up in status"
exit 1
fi

# Expect error with extra args: (timeout (brew install coreutils) returns 124
# for timeout) - #652
timeout --preserve-status 3 docker run fortio/fortio:webtest server -loglevel debug extra-arg
if [[ $? == 124 || $? == 0 ]]; then
echo "Unrecognized extra args/typo in flags should error out"
exit 1
fi

DOCKERID=$(docker run -d --ulimit nofile=$FILE_LIMIT --net host --name $DOCKERNAME fortio/fortio:webtest server -ui-path $FORTIO_UI_PREFIX -loglevel $LOGLEVEL -maxpayloadsizekb $MAXPAYLOAD -timeout=$TIMEOUT)
function cleanup {
set +e # errors are ok during cleanup
Expand Down

0 comments on commit 1aa464b

Please sign in to comment.