clean:
rm -rf gen
+ find . -name __pycache__ | xargs rm -rf
distclean:
- rm -f pyhttpd/config.ini
\ No newline at end of file
+ rm -f pyhttpd/config.ini
Infrastructure
--------------
-The test cases rely on the classes provided in 'test/pyhttpd'
-for common code in managing a httpd test instance and do
-provide some base setups:
+The test cases rely on the classes provided in `test/pyhttpd/` (where
+`test/pyhttpd/runtests.sh` runs the suite) for common code in managing
+a httpd test instance and do provide some base setups:
- a small set of virtual hosts with some files
- access to paths and definitions (env fixture)
- start/stop httpd and inspect the error log
metafunc.fixturenames.append('tmp_ct')
metafunc.parametrize('repeat', range(count))
+
@pytest.fixture(autouse=True, scope="function")
def _function_scope(env, request):
env.set_current_test_name(request.node.name)
yield
+ env.check_error_log()
env.set_current_test_name(None)
+
+@pytest.fixture(autouse=True, scope="module")
+def _module_scope(env):
+ yield
+ env.check_error_log()
+
+
+@pytest.fixture(autouse=True, scope="package")
+def _package_scope(env):
+ env.httpd_error_log.clear_ignored_matches()
+ env.httpd_error_log.clear_ignored_lognos()
+ yield
+ assert env.apache_stop() == 0
+ env.check_error_log()
NAMES=$*
fi
-if ! openssl version | grep -q OpenSSL; then
+if ! openssl version | grep -Eq 'LibreSSL|OpenSSL'; then
echo Aborted - your openssl is very old or misconfigured.
exit 1
fi