diff --git a/tests/gold_tests/proxy_protocol/gold/access-cp.gold b/tests/gold_tests/proxy_protocol/gold/access-cp.gold index 28d355ac6af..c2f386d799a 100644 --- a/tests/gold_tests/proxy_protocol/gold/access-cp.gold +++ b/tests/gold_tests/proxy_protocol/gold/access-cp.gold @@ -1,8 +1,8 @@ +127.0.0.1 0 127.0.0.1 +127.0.0.1 0 127.0.0.1 127.0.0.1 127.0.0.1 127.0.0.1 127.0.0.1 127.0.0.1 127.0.0.1 127.0.0.1 127.0.0.1 127.0.0.1 127.0.0.1 127.0.0.1 127.0.0.1 198.51.100.1 198.51.100.1 127.0.0.1 -127.0.0.1 0 127.0.0.1 -127.0.0.1 0 127.0.0.1 198.51.100.1 198.51.100.1 127.0.0.1 diff --git a/tests/gold_tests/proxy_protocol/gold/access-nocp.gold b/tests/gold_tests/proxy_protocol/gold/access-nocp.gold index 5511d71605f..ccd785d680a 100644 --- a/tests/gold_tests/proxy_protocol/gold/access-nocp.gold +++ b/tests/gold_tests/proxy_protocol/gold/access-nocp.gold @@ -1,8 +1,8 @@ +127.0.0.1 0 127.0.0.1 +127.0.0.1 0 127.0.0.1 127.0.0.1 127.0.0.1 127.0.0.1 127.0.0.1 127.0.0.1 127.0.0.1 127.0.0.1 127.0.0.1 127.0.0.1 127.0.0.1 127.0.0.1 127.0.0.1 127.0.0.1 198.51.100.1 127.0.0.1 -127.0.0.1 0 127.0.0.1 -127.0.0.1 0 127.0.0.1 127.0.0.1 198.51.100.1 127.0.0.1 diff --git a/tests/gold_tests/proxy_protocol/proxy_protocol.test.py b/tests/gold_tests/proxy_protocol/proxy_protocol.test.py index a3623930965..db4eede8a11 100644 --- a/tests/gold_tests/proxy_protocol/proxy_protocol.test.py +++ b/tests/gold_tests/proxy_protocol/proxy_protocol.test.py @@ -94,15 +94,22 @@ def checkAccessLog(self): """ check access log """ - Test.Disk.File(os.path.join(self.ts.Variables.LOGDIR, 'access.log'), exists=True, content=f"gold/access-{self.name}.gold") + log_file = os.path.join(self.ts.Variables.LOGDIR, 'access.log') + # Transactions can finish on different event threads, so their access + # log records are not guaranteed to be written in replay order. Test.AddAwaitFileContainsTestRun( f'Await PROXY protocol access log lines. {self.name}', - os.path.join(self.ts.Variables.LOGDIR, 'access.log'), - r'^127\.0\.0\.1 0 127\.0\.0\.1$', - 2, + log_file, + r'^(127\.0\.0\.1|198\.51\.100\.1) (0|127\.0\.0\.1|198\.51\.100\.1) 127\.0\.0\.1$', + 8, ) + tr = Test.AddTestRun(f'Verify PROXY protocol access log lines. {self.name}') + tr.Processes.Default.Command = f'LC_ALL=C sort < "{log_file}"' + tr.Processes.Default.Streams.stdout = f"gold/access-{self.name}.gold" + tr.Processes.Default.ReturnCode = 0 + def run(self): self.runTraffic() self.checkAccessLog()