Skip to content

Commit f89a7d6

Browse files
committed
Add test for LOG_WITHOUT_NEWLINE
Issue mendhak#11
1 parent 321adf6 commit f89a7d6

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

tests.sh

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ curl -s -k -X POST -d "banana" https://localhost:8443/ping > /dev/null
142142
if [ $(docker logs http-echo-tests | wc -l) == 1 ] && \
143143
! [ $(docker logs http-echo-tests | grep banana) ]
144144
then
145-
passed "LOG_IGNORE_PATH ignored"
145+
passed "LOG_IGNORE_PATH ignored the /ping path"
146146
else
147-
failed "LOG_IGNORE_PATH was not ignored"
147+
failed "LOG_IGNORE_PATH failed"
148148
docker logs http-echo-tests
149149
exit 1
150150
fi
@@ -153,6 +153,26 @@ fi
153153
message " Stop containers "
154154
docker stop http-echo-tests
155155

156+
message " Start container with LOG_WITHOUT_NEWLINE "
157+
docker run -d --rm -e LOG_WITHOUT_NEWLINE=1 --name http-echo-tests -p 8080:80 -p 8443:443 -t mendhak/http-https-echo
158+
sleep 5
159+
curl -s -k -X POST -d "tiramisu" https://localhost:8443/ > /dev/null
160+
161+
if [ $(docker logs http-echo-tests | wc -l) == 3 ] && \
162+
[ $(docker logs http-echo-tests | grep tiramisu) ]
163+
then
164+
passed "LOG_WITHOUT_NEWLINE logged output in single line"
165+
else
166+
failed "LOG_WITHOUT_NEWLINE failed"
167+
docker logs http-echo-tests
168+
exit 1
169+
fi
170+
171+
172+
message " Stop containers "
173+
docker stop http-echo-tests
174+
175+
156176

157177
popd
158178
rm -rf testarea

0 commit comments

Comments
 (0)