diff options
Diffstat (limited to 'regress')
-rwxr-xr-x | regress/regress | 1 | ||||
-rw-r--r-- | regress/tests.sh | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/regress/regress b/regress/regress index 5854c91..dd019e4 100755 --- a/regress/regress +++ b/regress/regress @@ -58,6 +58,7 @@ run_test test_proxy_relay_to run_test test_proxy_with_certs # run_test test_unknown_host # XXX: breaks on some distro run_test test_include_mime +run_test test_log_file # TODO: add test that uses only a TLSv1.2 or TLSv1.3 # TODO: add a test that attempt to serve a non-regular file diff --git a/regress/tests.sh b/regress/tests.sh index 9aa083a..9020103 100644 --- a/regress/tests.sh +++ b/regress/tests.sh @@ -377,3 +377,23 @@ test_include_mime() { fetch_hdr /foo.1 check_reply '20 text/x-mandoc' || return 1 } + +test_log_file() { + rm -f log log.edited + setup_simple_test 'log access "'$PWD'/log"' '' + + fetch_hdr / + check_reply '20 text/gemini' + + # remove the <ip>:<port> leading part + awk '{$1 = ""; print substr($0, 2)}' log > log.edited + + echo GET gemini://localhost/ 20 text/gemini | cmp -s - log.edited + if [ $? -ne 0 ]; then + # keep the log for post-mortem analysis + return 1 + fi + + rm -f log log.edited + return 0 +} |