diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test_access_log.py | 24 | ||||
-rw-r--r-- | test/unit/applications/lang/java.py | 2 |
2 files changed, 25 insertions, 1 deletions
diff --git a/test/test_access_log.py b/test/test_access_log.py index 1b0ec8ad..47099bd0 100644 --- a/test/test_access_log.py +++ b/test/test_access_log.py @@ -298,6 +298,12 @@ def test_access_log_format(wait_for_record): check_format(log_format, log_format) check_format('$uri $status $uri $status', '/ 200 / 200') + log_format = { + 'status': '$status', + 'uri': '$uri' + } + check_format(log_format, '{"status":"200","uri":"/"}') + def test_access_log_variables(wait_for_record): load('mirror') @@ -368,6 +374,24 @@ def test_access_log_if_njs(require, search_in_file, wait_for_record): assert search_in_file(r'^/foo_2$', 'access.log') is None +def test_access_log_format_njs(require, search_in_file, wait_for_record): + require({'modules': {'njs': 'any'}}) + + load('empty') + + def check_format(log_format, expect, url='/'): + set_format(log_format) + + assert client.get(url=url)['status'] == 200 + assert wait_for_record(expect, 'access.log') is not None, 'found' + + log_format = { + 'status': '$status', + 'uri': '`${vars.uri}`' + } + check_format(log_format, '{"status":"200","uri":"/"}') + + def test_access_log_incorrect(temp_dir, skip_alert): skip_alert(r'failed to apply new conf') diff --git a/test/unit/applications/lang/java.py b/test/unit/applications/lang/java.py index 2b3194ae..2416278b 100644 --- a/test/unit/applications/lang/java.py +++ b/test/unit/applications/lang/java.py @@ -53,7 +53,7 @@ class ApplicationJava(ApplicationProto): os.makedirs(classes_path) classpath = ( - f'{option.current_dir}/build/tomcat-servlet-api-9.0.93.jar' + f'{option.current_dir}/build/tomcat-servlet-api-9.0.98.jar' ) ws_jars = glob.glob( |