Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/gold_tests/proxy_protocol/gold/access-cp.gold
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions tests/gold_tests/proxy_protocol/gold/access-nocp.gold
Original file line number Diff line number Diff line change
@@ -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
15 changes: 11 additions & 4 deletions tests/gold_tests/proxy_protocol/proxy_protocol.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down