Skip to content

Commit b89b2d9

Browse files
authored
Update test for TSHttpTxnVerifiedAddr (#12515)
* Remove settings for TLS * Use AddLine instead of AddLines * Add a description * Remove ssl_multicert_config.AddLine
1 parent bf7c217 commit b89b2d9

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

tests/gold_tests/pluginTest/tsapi/test_TSHttpTxnVerifiedAddr.test.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,9 @@
3232
# ----
3333
# Setup ATS
3434
# ----
35-
ts = Test.MakeATSProcess("ts", enable_tls=True)
35+
ts = Test.MakeATSProcess("ts")
3636

37-
# add ssl materials like key, certificates for the server
38-
ts.addDefaultSSLFiles()
39-
40-
ts.Disk.remap_config.AddLines([f'map /httpbin/ http://127.0.0.1:{httpbin.Variables.Port}/'])
41-
42-
ts.Disk.ssl_multicert_config.AddLine('dest_ip=* ssl_cert_name=server.pem ssl_key_name=server.key')
37+
ts.Disk.remap_config.AddLine(f'map /httpbin/ http://127.0.0.1:{httpbin.Variables.Port}/')
4338

4439
Test.PrepareTestPlugin(
4540
os.path.join(Test.Variables.AtsBuildGoldTestsDir, 'pluginTest', 'tsapi', '.libs', 'test_TSHttpTxnVerifiedAddr.so'), ts)
@@ -51,15 +46,15 @@
5146
{
5247
'proxy.config.diags.debug.enabled': 1,
5348
'proxy.config.diags.debug.tags': 'http|test_TSHttpTxnVerifiedAddr',
54-
'proxy.config.ssl.server.cert.path': f'{ts.Variables.SSLDir}',
55-
'proxy.config.ssl.server.private_key.path': f'{ts.Variables.SSLDir}'
5649
})
5750

5851
# ----
5952
# Test Cases
6053
# ----
6154

62-
tr = Test.AddTestRun()
55+
# The test plugin sets an hard coded IP address as a verified address.
56+
# The verified address should be read by header_rewrite plugin and returned in "ip" response header.
57+
tr = Test.AddTestRun("Test that a verified address is set by a plugin and read by another plugin")
6358
tr.MakeCurlCommand(f'-v http://127.0.0.1:{ts.Variables.port}/httpbin/get', ts=ts)
6459
tr.Processes.Default.ReturnCode = 0
6560
tr.Processes.Default.StartBefore(httpbin)

0 commit comments

Comments
 (0)