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
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
# Do not start the origin server: We wish to simulate connection refused while hopefully no one else uses this port.
tr.Processes.Default.Command = \
(f"{sys.executable} tcp_client.py 127.0.0.1 {ts.Variables.port} www.connectfail502.test-get.txt | "
"sed -e '/^Date: /d' -e '/^Server: ATS\//d'")
r"sed -e '/^Date: /d' -e '/^Server: ATS\//d'")
tr.Processes.Default.ReturnCode = 0
tr.Processes.Default.Streams.stdout = 'general-connection-failure-502.gold'
8 changes: 4 additions & 4 deletions tests/gold_tests/tls/tls_hooks_client_verify.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@
tr3.Processes.Default.Streams.all = Testers.ContainsExpression("error", "Curl attempt should have failed")

ts.Disk.traffic_out.Content += Testers.ContainsExpression(
"Client verify callback 0 [\da-fx]+? - event is good good HS", "verify callback happens 2 times")
r"Client verify callback 0 [\da-fx]+? - event is good good HS", "verify callback happens 2 times")
ts.Disk.traffic_out.Content += Testers.ContainsExpression(
"Client verify callback 1 [\da-fx]+? - event is good good HS", "verify callback happens 2 times")
r"Client verify callback 1 [\da-fx]+? - event is good good HS", "verify callback happens 2 times")
ts.Disk.traffic_out.Content += Testers.ContainsExpression(
"Client verify callback 0 [\da-fx]+? - event is good error HS", "verify callback happens 2 times")
r"Client verify callback 0 [\da-fx]+? - event is good error HS", "verify callback happens 2 times")
ts.Disk.traffic_out.Content += Testers.ContainsExpression(
"Client verify callback 1 [\da-fx]+? - event is good error HS", "verify callback happens 2 times")
r"Client verify callback 1 [\da-fx]+? - event is good error HS", "verify callback happens 2 times")
12 changes: 6 additions & 6 deletions tests/gold_tests/tls/tls_hooks_verify.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@
ts.Disk.diags_log.Content += Testers.ExcludesExpression("SNI=foo.com", "foo.com should not fail in any way")

ts.Disk.traffic_out.Content += Testers.ContainsExpression(
"Server verify callback 0 [\da-fx]+? - event is good SNI=foo.com good HS", "verify callback happens 2 times")
r"Server verify callback 0 [\da-fx]+? - event is good SNI=foo.com good HS", "verify callback happens 2 times")
ts.Disk.traffic_out.Content += Testers.ContainsExpression(
"Server verify callback 1 [\da-fx]+? - event is good SNI=foo.com good HS", "verify callback happens 2 times")
r"Server verify callback 1 [\da-fx]+? - event is good SNI=foo.com good HS", "verify callback happens 2 times")
ts.Disk.traffic_out.Content += Testers.ContainsExpression(
"Server verify callback 0 [\da-fx]+? - event is good SNI=random.com error HS", "verify callback happens 2 times")
r"Server verify callback 0 [\da-fx]+? - event is good SNI=random.com error HS", "verify callback happens 2 times")
ts.Disk.traffic_out.Content += Testers.ContainsExpression(
"Server verify callback 1 [\da-fx]+? - event is good SNI=random.com error HS", "verify callback happens 2 times")
r"Server verify callback 1 [\da-fx]+? - event is good SNI=random.com error HS", "verify callback happens 2 times")
ts.Disk.traffic_out.Content += Testers.ContainsExpression(
"Server verify callback 0 [\da-fx]+? - event is good SNI=bar.com error HS", "verify callback happens 2 times")
r"Server verify callback 0 [\da-fx]+? - event is good SNI=bar.com error HS", "verify callback happens 2 times")
ts.Disk.traffic_out.Content += Testers.ContainsExpression(
"Server verify callback 1 [\da-fx]+? - event is good SNI=bar.com error HS", "verify callback happens 2 times")
r"Server verify callback 1 [\da-fx]+? - event is good SNI=bar.com error HS", "verify callback happens 2 times")
ts.Disk.traffic_out.Content += Testers.ContainsExpression("Server verify callback SNI APIs match=true", "verify SNI names match")
2 changes: 1 addition & 1 deletion tests/gold_tests/tls/tls_verify.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,4 @@
# Over riding the built in ERROR check since we expect tr3 to fail
ts.Disk.diags_log.Content = Testers.ExcludesExpression("verification failed", "Make sure the signatures didn't fail")
ts.Disk.diags_log.Content += Testers.ContainsExpression(
"WARNING: SNI \(bad_bar.com\) not in certificate", "Make sure bad_bar name checked failed.")
r"WARNING: SNI \(bad_bar.com\) not in certificate", "Make sure bad_bar name checked failed.")
10 changes: 5 additions & 5 deletions tests/gold_tests/tls/tls_verify2.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,13 @@

# No name checking for the sig-only permissive override for bad_bar
ts.Disk.diags_log.Content += Testers.ExcludesExpression(
"WARNING: SNI \(bad_bar.com\) not in certificate", "bad_bar name checked should be skipped.")
r"WARNING: SNI \(bad_bar.com\) not in certificate", "bad_bar name checked should be skipped.")
ts.Disk.diags_log.Content = Testers.ExcludesExpression(
"WARNING: SNI \(foo.com\) not in certificate", "foo name checked should be skipped.")
r"WARNING: SNI \(foo.com\) not in certificate", "foo name checked should be skipped.")
# No checking for the self-signed on random.com. No messages
ts.Disk.diags_log.Content += Testers.ExcludesExpression(
"WARNING: Core server certificate verification failed for \(random.com\)", "signature check for random.com should be skipped")
r"WARNING: Core server certificate verification failed for \(random.com\)", "signature check for random.com should be skipped")
ts.Disk.diags_log.Content += Testers.ContainsExpression(
"WARNING: Core server certificate verification failed for \(random2.com\)", "signature check for random.com should fail'")
r"WARNING: Core server certificate verification failed for \(random2.com\)", "signature check for random.com should fail'")
ts.Disk.diags_log.Content += Testers.ContainsExpression(
"WARNING: SNI \(bad_foo.com\) not in certificate", "bad_foo name checked should be checked.")
r"WARNING: SNI \(bad_foo.com\) not in certificate", "bad_foo name checked should be checked.")
2 changes: 1 addition & 1 deletion tests/gold_tests/tls/tls_verify3.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@

# Over riding the built in ERROR check since we expect tr3 to fail
ts.Disk.diags_log.Content = Testers.ContainsExpression(
"WARNING: SNI \(bob.bar.com\) not in certificate", "Make sure bob.bar name checked failed.")
r"WARNING: SNI \(bob.bar.com\) not in certificate", "Make sure bob.bar name checked failed.")
ts.Disk.diags_log.Content += Testers.ContainsExpression(
r"WARNING: Core server certificate verification failed for \(my.foo.com\). Action=Continue",
"Make sure default permissive action takes")
4 changes: 2 additions & 2 deletions tests/gold_tests/tls/tls_verify4.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,6 @@

# No name checking for the sig-only permissive override for bad_bar
ts.Disk.diags_log.Content += Testers.ContainsExpression(
"Core server certificate verification failed for \(random3.com\). Action=Continue", "Permissive can connect")
r"Core server certificate verification failed for \(random3.com\). Action=Continue", "Permissive can connect")
ts.Disk.diags_log.Content += Testers.ContainsExpression(
"Core server certificate verification failed for \(random2.com\). Action=Terminate", "Enforced cannot connect")
r"Core server certificate verification failed for \(random2.com\). Action=Terminate", "Enforced cannot connect")
4 changes: 2 additions & 2 deletions tests/gold_tests/tls/tls_verify_base.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,6 @@

# Over riding the built in ERROR check since we expect tr3 to fail
ts.Disk.diags_log.Content = Testers.ContainsExpression(
"WARNING: SNI \(bad_bar.com\) not in certificate. Action=Terminate", "Make sure bad_bar name checked failed.")
r"WARNING: SNI \(bad_bar.com\) not in certificate. Action=Terminate", "Make sure bad_bar name checked failed.")
ts.Disk.diags_log.Content += Testers.ContainsExpression(
"WARNING: SNI \(random.com\) not in certificate. Action=Continue ", "Permissive failure for random")
r"WARNING: SNI \(random.com\) not in certificate. Action=Continue ", "Permissive failure for random")
2 changes: 1 addition & 1 deletion tests/gold_tests/tls/tls_verify_not_pristine.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,5 @@

# Over riding the built in ERROR check since we expect tr3 to fail
ts.Disk.diags_log.Content = Testers.ExcludesExpression("verification failed", "Make sure the signatures didn't fail")
ts.Disk.diags_log.Content += Testers.ContainsExpression("WARNING: SNI \(bar.com\) not in certificate",
ts.Disk.diags_log.Content += Testers.ContainsExpression(r"WARNING: SNI \(bar.com\) not in certificate",
"Make sure bad_bar name checked failed.")
2 changes: 1 addition & 1 deletion tests/gold_tests/tls/tls_verify_override.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,4 +268,4 @@
"Failure on missing name for bar.com")
# See if the explicitly set default sni_policy of remap works.
ts.Disk.diags_log.Content += Testers.ExcludesExpression(
"WARNING: SNI \(foo.com\) not in certificate. Action=Continue", "Warning on missing name for foo.com")
r"WARNING: SNI \(foo.com\) not in certificate. Action=Continue", "Warning on missing name for foo.com")
4 changes: 2 additions & 2 deletions tests/gold_tests/tls/tls_verify_override_sni.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,6 @@

# Over riding the built in ERROR check since we expect some cases to fail
ts.Disk.diags_log.Content = Testers.ContainsExpression(
"WARNING: SNI \(bar.com\) not in certificate. Action=Continue server=bar.com", "Warning for mismatch name not enforcing")
r"WARNING: SNI \(bar.com\) not in certificate. Action=Continue server=bar.com", "Warning for mismatch name not enforcing")
ts.Disk.diags_log.Content += Testers.ContainsExpression(
" WARNING: SNI \(bar.com\) not in certificate. Action=Terminate server=bar.com", "Warning for enforcing mismatch")
r" WARNING: SNI \(bar.com\) not in certificate. Action=Terminate server=bar.com", "Warning for enforcing mismatch")
2 changes: 1 addition & 1 deletion tests/gold_tests/tls_hooks/tls_hooks16.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

snistring = "Client Hello callback 0"
ts.Disk.traffic_out.Content = Testers.ContainsExpression(
"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(snistring), "Client Hello message appears only once", reflags=re.S | re.M)
r"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(snistring), "Client Hello message appears only once", reflags=re.S | re.M)

tr.Processes.Default.TimeOut = 15
tr.TimeOut = 15
2 changes: 1 addition & 1 deletion tests/gold_tests/tls_hooks/tls_hooks17.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

snistring = "Client Hello callback 0"
ts.Disk.traffic_out.Content = Testers.ContainsExpression(
"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(snistring), "Client Hello message appears only once", reflags=re.S | re.M)
r"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(snistring), "Client Hello message appears only once", reflags=re.S | re.M)

tr.Processes.Default.TimeOut = 15
tr.TimeOut = 15
4 changes: 2 additions & 2 deletions tests/gold_tests/tls_hooks/tls_hooks18.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
certstring0 = "Client Hello callback 0"
certstring1 = "Client Hello callback 1"
ts.Disk.traffic_out.Content = Testers.ContainsExpression(
"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(certstring0), "Cert message appears only once", reflags=re.S | re.M)
r"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(certstring0), "Cert message appears only once", reflags=re.S | re.M)
ts.Disk.traffic_out.Content = Testers.ContainsExpression(
"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(certstring1), "Cert message appears only once", reflags=re.S | re.M)
r"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(certstring1), "Cert message appears only once", reflags=re.S | re.M)

tr.Processes.Default.TimeOut = 15
tr.TimeOut = 15
2 changes: 1 addition & 1 deletion tests/gold_tests/tls_hooks/tls_hooks2.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

snistring = "SNI callback 0"
ts.Disk.traffic_out.Content = Testers.ContainsExpression(
"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(snistring), "SNI message appears only once", reflags=re.S | re.M)
r"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(snistring), "SNI message appears only once", reflags=re.S | re.M)

tr.Processes.Default.TimeOut = 15
tr.TimeOut = 15
2 changes: 1 addition & 1 deletion tests/gold_tests/tls_hooks/tls_hooks3.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

certstring = "Cert callback 0"
ts.Disk.traffic_out.Content = Testers.ContainsExpression(
"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(certstring), "Cert message appears only once", reflags=re.S | re.M)
r"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(certstring), "Cert message appears only once", reflags=re.S | re.M)

tr.Processes.Default.TimeOut = 15
tr.TimeOut = 15
6 changes: 3 additions & 3 deletions tests/gold_tests/tls_hooks/tls_hooks4.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@
preacceptstring = "Pre accept callback 0"
certstring = "Cert callback 0"
ts.Disk.traffic_out.Content = Testers.ContainsExpression(
"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(snistring), "SNI message appears only once", reflags=re.S | re.M)
r"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(snistring), "SNI message appears only once", reflags=re.S | re.M)
# the preaccept may get triggered twice because the test framework creates a TCP connection before handing off to traffic_server
ts.Disk.traffic_out.Content += Testers.ContainsExpression("\A(?:(?!{0}).)*{0}.*({0})?(?!.*{0}).*\Z".format(
ts.Disk.traffic_out.Content += Testers.ContainsExpression(r"\A(?:(?!{0}).)*{0}.*({0})?(?!.*{0}).*\Z".format(
preacceptstring), "Pre accept message appears only once or twice", reflags=re.S | re.M)
ts.Disk.traffic_out.Content += Testers.ContainsExpression("\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(certstring),
ts.Disk.traffic_out.Content += Testers.ContainsExpression(r"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(certstring),
"Cert message appears only once", reflags=re.S | re.M)

tr.Processes.Default.TimeOut = 15
Expand Down
4 changes: 2 additions & 2 deletions tests/gold_tests/tls_hooks/tls_hooks7.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
snistring0 = "SNI callback 0"
snistring1 = "SNI callback 1"
ts.Disk.traffic_out.Content = Testers.ContainsExpression(
"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(snistring0), "SNI message appears only once", reflags=re.S | re.M)
r"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(snistring0), "SNI message appears only once", reflags=re.S | re.M)
ts.Disk.traffic_out.Content = Testers.ContainsExpression(
"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(snistring1), "SNI message appears only once", reflags=re.S | re.M)
r"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(snistring1), "SNI message appears only once", reflags=re.S | re.M)

tr.Processes.Default.TimeOut = 15
tr.TimeOut = 15
4 changes: 2 additions & 2 deletions tests/gold_tests/tls_hooks/tls_hooks8.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
certstring0 = "Cert callback 0"
certstring1 = "Cert callback 1"
ts.Disk.traffic_out.Content = Testers.ContainsExpression(
"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(certstring0), "Cert message appears only once", reflags=re.S | re.M)
r"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(certstring0), "Cert message appears only once", reflags=re.S | re.M)
ts.Disk.traffic_out.Content = Testers.ContainsExpression(
"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(certstring1), "Cert message appears only once", reflags=re.S | re.M)
r"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(certstring1), "Cert message appears only once", reflags=re.S | re.M)

tr.Processes.Default.TimeOut = 15
tr.TimeOut = 15
2 changes: 1 addition & 1 deletion tests/gold_tests/tls_hooks/tls_hooks9.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@

certstring0 = "Cert callback 0"
ts.Disk.traffic_out.Content = Testers.ContainsExpression(
"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(certstring0), "Cert message appears only once", reflags=re.S | re.M)
r"\A(?:(?!{0}).)*{0}(?!.*{0}).*\Z".format(certstring0), "Cert message appears only once", reflags=re.S | re.M)
tr.Processes.Default.TimeOut = 15
tr.TimeOut = 15