diff options
Diffstat (limited to 'test/test_access_log.py')
-rw-r--r-- | test/test_access_log.py | 47 |
1 files changed, 8 insertions, 39 deletions
diff --git a/test/test_access_log.py b/test/test_access_log.py index 8dc87524..94f6e7bf 100644 --- a/test/test_access_log.py +++ b/test/test_access_log.py @@ -12,7 +12,11 @@ class TestAccessLog(TestApplicationPython): def load(self, script): super().load(script) - self.conf('"' + self.testdir + '/access.log"', 'access_log') + self.assertIn( + 'success', + self.conf('"' + self.testdir + '/access.log"', 'access_log'), + 'access_log configure', + ) def wait_for_record(self, pattern, name='access.log'): return super().wait_for_record(pattern, name) @@ -111,7 +115,9 @@ Connection: close addr = self.testdir + '/sock' - self.conf({"unix:" + addr: {"pass": "applications/empty"}}, 'listeners') + self.conf( + {"unix:" + addr: {"pass": "applications/empty"}}, 'listeners' + ) self.get(sock_type='unix', addr=addr) @@ -292,42 +298,5 @@ Connection: close 'change', ) - def test_access_log_reopen(self): - self.load('empty') - - log_path = self.testdir + '/access.log' - - self.assertTrue(self.waitforfiles(log_path), 'open') - - log_path_new = self.testdir + '/new.log' - - os.rename(log_path, log_path_new) - - self.get() - - self.assertIsNotNone( - self.wait_for_record(r'"GET / HTTP/1.1" 200 0 "-" "-"', 'new.log'), - 'rename new', - ) - self.assertFalse(os.path.isfile(log_path), 'rename old') - - with open(self.testdir + '/unit.pid', 'r') as f: - pid = f.read().rstrip() - - call(['kill', '-s', 'USR1', pid]) - - self.assertTrue(self.waitforfiles(log_path), 'reopen') - - self.get(url='/usr1') - - self.assertIsNotNone( - self.wait_for_record(r'"GET /usr1 HTTP/1.1" 200 0 "-" "-"'), - 'reopen 2', - ) - self.assertIsNone( - self.search_in_log(r'/usr1', 'new.log'), 'rename new 2' - ) - - if __name__ == '__main__': TestAccessLog.main() |