diff options
author | oxpa <iippolitov@gmail.com> | 2024-03-26 13:57:15 +0000 |
---|---|---|
committer | oxpa <iippolitov@gmail.com> | 2024-03-26 13:57:15 +0000 |
commit | 0e79d961bb1ea68674961da1703ffedb1ddf6e43 (patch) | |
tree | 19cc39382fb7aebc59e3b989edd50d759e371e60 /test | |
parent | d76761901c4084bcdbc5a449e9bbb47d56b7093c (diff) | |
parent | 48d79170596d9923f2612d25e5a62ca0999b4313 (diff) | |
download | unit-0e79d961bb1ea68674961da1703ffedb1ddf6e43.tar.gz unit-0e79d961bb1ea68674961da1703ffedb1ddf6e43.tar.bz2 |
Merge tag '1.32.1' into packaging1.32.1-1
Unit 1.32.1 release.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_njs.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test_njs.py b/test/test_njs.py index 8ef815fd..23d1df1b 100644 --- a/test/test_njs.py +++ b/test/test_njs.py @@ -116,6 +116,24 @@ def test_njs_variables_cacheable(temp_dir): check_rewrite('/str', '${vars.uri}') +def test_njs_variables_cacheable_access_log(findall, temp_dir): + assert 'success' in client.conf({"return": 200}, 'routes/0/action') + + assert 'success' in client.conf( + { + 'path': f'{temp_dir}/access.log', + 'format': '`${vars.host}, ${vars.status}\n`', + }, + 'access_log' + ), 'access_log configure' + + reqs = 50 + for _ in range(reqs): + client.get() + + assert len(findall(r'localhost, 200', 'access.log')) == reqs + + def test_njs_invalid(skip_alert): skip_alert(r'js exception:') |