Skip to content

Commit

Permalink
Add an autest testcase for HTTP3 (apache#7063)
Browse files Browse the repository at this point in the history
  • Loading branch information
maskit committed Sep 15, 2020
1 parent dd74548 commit b090964
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
14 changes: 11 additions & 3 deletions tests/gold_tests/autest-site/trafficserver.test.ext
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def make_id(s):


def MakeATSProcess(obj, name, command='traffic_server', select_ports=True,
enable_tls=False, enable_cache=True):
enable_tls=False, enable_cache=True, enable_quic=False):
#####################################
# common locations

Expand Down Expand Up @@ -304,15 +304,23 @@ def MakeATSProcess(obj, name, command='traffic_server', select_ports=True,
'proxy.config.http.cache.http': 0
})

if enable_quic:
p.Disk.records_config.update({
'proxy.config.udp.threads': 1,
})

# The following message was added so that tests and users can know when
# Traffic Server is ready to both receive and optimize traffic.
p.Ready = When.FileContains(p.Disk.diags_log.AbsPath, "NOTE: Traffic Server is fully initialized")

if select_ports:
# default config
port_str = "{port} {v6_port}:ipv6 ".format(port=p.Variables.port, v6_port=p.Variables.portv6)
port_str = "{port} {v6_port}:ipv6".format(port=p.Variables.port, v6_port=p.Variables.portv6)
if enable_tls:
port_str += "{ssl_port}:ssl {ssl_portv6}:ssl:ipv6".format(
port_str += " {ssl_port}:ssl {ssl_portv6}:ssl:ipv6".format(
ssl_port=p.Variables.ssl_port, ssl_portv6=p.Variables.ssl_portv6)
if enable_quic:
port_str += " {ssl_port}:quic {ssl_portv6}:quic:ipv6".format(
ssl_port=p.Variables.ssl_port, ssl_portv6=p.Variables.ssl_portv6)
#p.Env['PROXY_CONFIG_HTTP_SERVER_PORTS'] = port_str
p.Disk.records_config.update({
Expand Down
7 changes: 6 additions & 1 deletion tests/gold_tests/timeout/active_timeout.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
Condition.HasCurlFeature('http2')
)

ts = Test.MakeATSProcess("ts", select_ports=True, enable_tls=True)
ts = Test.MakeATSProcess("ts", select_ports=True, enable_tls=True, enable_quic=True)
server = Test.MakeOriginServer("server", delay=8)

request_header = {"headers": "GET /file HTTP/1.1\r\nHost: *\r\n\r\n", "timestamp": "5678", "body": ""}
Expand Down Expand Up @@ -60,3 +60,8 @@
tr3 = Test.AddTestRun("tr")
tr3.Processes.Default.Command = 'curl -k -i --http2 https://127.0.0.1:{0}/file'.format(ts.Variables.ssl_port)
tr3.Processes.Default.Streams.stdout = Testers.ContainsExpression("Activity Timeout", "Request should fail with active timeout")

if Condition.HasATSFeature('TS_USE_QUIC') and Condition.HasCurlFeature('http3'):
tr4= Test.AddTestRun("tr")
tr4.Processes.Default.Command = 'curl -k -i --http3 https://127.0.0.1:{0}/file'.format(ts.Variables.ssl_port)
tr4.Processes.Default.Streams.stdout = Testers.ContainsExpression("Activity Timeout", "Request should fail with active timeout")

0 comments on commit b090964

Please sign in to comment.