Skip to content
Merged
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
13 changes: 9 additions & 4 deletions tests/gold_tests/pluginTest/tsapi/test_TSVConnPPInfo.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@
# plaintext HTTP
tr = Test.AddTestRun()
tr.TimeOut = 10
tr.Processes.Default.Command = f"curl --haproxy-protocol --haproxy-clientip 1.2.3.4 'http://127.0.0.1:{ts.Variables.proxy_protocol_port}/httpbin/get'"
tr.Processes.Default.Command = (
f"curl --haproxy-protocol --haproxy-clientip 1.2.3.4 "
f"'http://127.0.0.1:{ts.Variables.proxy_protocol_port}/httpbin/get'")
tr.Processes.Default.ReturnCode = 0
tr.Processes.Default.StartBefore(httpbin)
tr.Processes.Default.StartBefore(Test.Processes.ts)
Expand All @@ -90,7 +92,9 @@
# HTTPS
tr = Test.AddTestRun()
tr.TimeOut = 10
tr.Processes.Default.Command = f"curl --haproxy-protocol --haproxy-clientip 5.6.7.8 -k 'https://127.0.0.1:{ts.Variables.proxy_protocol_ssl_port}/httpbin/get'"
tr.Processes.Default.Command = (
f"curl --haproxy-protocol --haproxy-clientip 5.6.7.8 -k "
f"'https://127.0.0.1:{ts.Variables.proxy_protocol_ssl_port}/httpbin/get'")
tr.Processes.Default.ReturnCode = 0
tr.Processes.Default.Streams.stdout = "test_TSVConnPPInfo_curl1.gold"
tr.StillRunningAfter = httpbin
Expand All @@ -101,7 +105,8 @@
tr.Processes.Default.ReturnCode = 0
f = tr.Disk.File(log_path)
f.Content = "test_TSVConnPPInfo_plugin_log.gold"
# curl 8.20+ intentionally uses --haproxy-clientip for both PROXY addresses so the address family matches.
f.Content += Testers.ContainsExpression(
"PP Info Received:V1,P2,T1,SRC1.2.3.4,DST127.0.0.1", "Expected information should be received")
r"PP Info Received:V1,P2,T1,SRC1\.2\.3\.4,DST(127\.0\.0\.1|1\.2\.3\.4)", "Expected information should be received")
f.Content += Testers.ContainsExpression(
"PP Info Received:V1,P2,T1,SRC5.6.7.8,DST127.0.0.1", "Expected information should be received")
r"PP Info Received:V1,P2,T1,SRC5\.6\.7\.8,DST(127\.0\.0\.1|5\.6\.7\.8)", "Expected information should be received")