You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bn...@apache.org on 2022/08/31 20:50:53 UTC
[trafficserver] 01/01: Merge latest master into 10-Dev
This is an automated email from the ASF dual-hosted git repository.
bneradt pushed a commit to branch 10-Dev
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit b48b69b74e9a98f26a8b9d6a6a2a674bf1b11aa5
Merge: ad6ae1351 c58edbb6b
Author: Brian Neradt <br...@gmail.com>
AuthorDate: Wed Aug 31 19:37:07 2022 +0000
Merge latest master into 10-Dev
Conflicts:
include/records/I_RecAlarms.h
include/records/I_RecEvents.h
include/records/I_RecSignals.h
lib/records/I_RecAlarms.h
lib/records/I_RecEvents.h
lib/records/I_RecSignals.h
mgmt/Alarms.h
mgmt/rpc/jsonrpc/Context.cc
mgmt/rpc/jsonrpc/unit_tests/unit_test_main.cc
mgmt/rpc/server/unit_tests/unit_test_main.cc
proxy/http/HttpSM.cc
src/records/RecLocal.cc
src/traffic_ctl/Makefile.inc
src/traffic_manager/Makefile.inc
src/traffic_top/Makefile.inc
tests/gold_tests/pluginTest/transform/transaction_data_sink.test.py
tests/gold_tests/traffic_ctl/remap_inc/remap_inc.test.py
.asf.yaml | 5 +-
.gitignore | 4 +-
CMakeLists.txt | 4 +-
Makefile.am | 7 +-
build/libswoc.m4 | 2 +-
configure.ac | 6 +-
doc/Doxyfile | 2 +-
doc/admin-guide/plugins/header_rewrite.en.rst | 15 ++
doc/developer-guide/config-vars.en.rst | 2 +-
{lib => include}/records/DynamicStats.h | 0
{lib => include}/records/I_RecCore.h | 0
{lib => include}/records/I_RecDefs.h | 0
{lib => include}/records/I_RecHttp.h | 0
{lib => include}/records/I_RecLocal.h | 0
{lib => include}/records/I_RecMutex.h | 0
{lib => include}/records/I_RecProcess.h | 0
{lib => include}/records/P_RecCore.h | 0
{lib => include}/records/P_RecDefs.h | 0
{lib => include}/records/P_RecFile.h | 0
{lib => include}/records/P_RecLocal.h | 0
{lib => include}/records/P_RecMessage.h | 0
{lib => include}/records/P_RecProcess.h | 0
{lib => include}/records/P_RecUtils.h | 0
{lib => include}/records/test_RecordsConfig.h | 0
iocore/aio/Makefile.am | 2 +-
iocore/cache/Makefile.am | 2 +-
iocore/eventsystem/Makefile.am | 2 +-
iocore/hostdb/Makefile.am | 2 +-
iocore/net/Makefile.am | 4 +-
iocore/net/quic/Makefile.am | 4 +-
lib/Makefile.am | 34 ++-
plugins/experimental/slice/Config.h | 1 +
plugins/experimental/slice/server.cc | 17 +-
plugins/experimental/slice/slice.cc | 7 +-
plugins/header_rewrite/Makefile.inc | 2 +
plugins/header_rewrite/condition.cc | 4 +
plugins/header_rewrite/conditions.cc | 95 +++++--
plugins/header_rewrite/conditions.h | 6 +-
.../header_rewrite/ipranges_helper.cc | 56 ++--
.../header_rewrite/ipranges_helper.h | 40 ++-
plugins/header_rewrite/matcher.h | 57 ++++-
plugins/header_rewrite/ruleset.cc | 4 +-
proxy/hdrs/Makefile.am | 4 +-
proxy/hdrs/VersionConverter.cc | 2 +-
proxy/http/HttpTransact.cc | 6 +-
proxy/http/Makefile.am | 2 +-
proxy/http/remap/Makefile.am | 10 +-
proxy/http2/Makefile.am | 4 +-
proxy/http3/Makefile.am | 4 +-
{lib => src}/records/Makefile.am | 6 +-
{lib => src}/records/P_RecCore.cc | 8 +-
{lib => src}/records/RecConfigParse.cc | 8 +-
{lib => src}/records/RecCore.cc | 6 +-
{lib => src}/records/RecDebug.cc | 4 +-
{lib => src}/records/RecFile.cc | 6 +-
{lib => src}/records/RecHttp.cc | 0
{lib => src}/records/RecMessage.cc | 10 +-
{lib => src}/records/RecMutex.cc | 2 +-
{lib => src}/records/RecProcess.cc | 10 +-
{lib => src}/records/RecRawStats.cc | 4 +-
{lib => src}/records/RecUtils.cc | 4 +-
{lib => src}/records/test_I_RecLocal.cc | 0
{lib => src}/records/test_I_RecProcess.cc | 0
{lib => src}/records/test_P_RecProcess.cc | 0
{lib => src}/records/test_RecProcess.i | 0
{lib => src}/records/test_RecTree.cc | 0
{lib => src}/records/test_RecordsConfig.cc | 0
{lib => src}/records/test_records.config | 0
{lib => src}/records/unit_tests/test_Diags.h | 0
.../records/unit_tests/test_DynamicStats.cc | 4 +-
{lib => src}/records/unit_tests/test_RecHttp.cc | 0
{lib => src}/records/unit_tests/unit_test_main.cc | 0
.../unit_tests/unit_test_main_on_eventsystem.cc | 0
src/traffic_crashlog/Makefile.inc | 2 +-
src/traffic_layout/Makefile.inc | 2 +-
src/traffic_logcat/Makefile.inc | 2 +-
src/traffic_logstats/Makefile.inc | 2 +-
src/traffic_quic/Makefile.inc | 4 +-
src/traffic_server/Makefile.inc | 2 +-
src/traffic_server/traffic_server.cc | 34 ++-
.../gold_tests/cache/cache-request-method.test.py | 17 ++
.../cache/replay/head_with_get_cached.replay.yaml | 285 +++++++++++++++++++++
.../gold_tests/logging/log-debug-client-ip.test.py | 3 +
.../transform/transaction_data_sink.test.py | 6 +
.../proxy_protocol/proxy_serve_stale.test.py | 5 +
.../proxy_serve_stale_dns_fail.test.py | 7 +
tests/gold_tests/timeout/active_timeout.test.py | 12 +-
tests/gold_tests/tls/tls_bad_alpn.test.py | 2 +-
.../traffic_ctl/remap_inc/remap_inc.test.py | 3 +
89 files changed, 706 insertions(+), 172 deletions(-)
diff --cc src/records/RecProcess.cc
index c1bbe72bb,86fbd7345..c046fb214
--- a/src/records/RecProcess.cc
+++ b/src/records/RecProcess.cc
@@@ -27,12 -27,15 +27,12 @@@
#include "I_Tasks.h"
#include "P_EventSystem.h"
- #include "P_RecCore.h"
- #include "P_RecProcess.h"
- #include "P_RecMessage.h"
- #include "P_RecUtils.h"
- #include "P_RecFile.h"
+ #include "records/P_RecCore.h"
+ #include "records/P_RecProcess.h"
+ #include "records/P_RecMessage.h"
+ #include "records/P_RecUtils.h"
+ #include "records/P_RecFile.h"
-#include "mgmtapi.h"
-#include "ProcessManager.h"
-
// Marks whether the message handler has been initialized.
static bool message_initialized_p = false;
static bool g_started = false;
diff --cc src/traffic_server/Makefile.inc
index 409953d82,caf65f140..746ae1657
--- a/src/traffic_server/Makefile.inc
+++ b/src/traffic_server/Makefile.inc
@@@ -83,12 -80,8 +83,12 @@@ traffic_server_traffic_server_LDADD =
$(top_builddir)/src/tscpp/util/libtscpputil.la \
$(top_builddir)/proxy/libproxy.a \
$(top_builddir)/iocore/net/libinknet.a \
- $(top_builddir)/lib/records/librecords_p.a \
+ $(top_builddir)/src/records/librecords_p.a \
$(top_builddir)/iocore/eventsystem/libinkevent.a \
+ $(top_builddir)/mgmt/rpc/libjsonrpc_server.la \
+ $(top_builddir)/mgmt/rpc/libjsonrpc_protocol.la \
+ $(top_builddir)/mgmt/config/libconfigmanager.la \
+ $(top_builddir)/mgmt/rpc/librpcpublichandlers.la \
@HWLOC_LIBS@ \
@LIBPCRE@ \
@LIBRESOLV@ \
diff --cc tests/gold_tests/pluginTest/transform/transaction_data_sink.test.py
index 63686d772,b31cef5dd..f561f1305
--- a/tests/gold_tests/pluginTest/transform/transaction_data_sink.test.py
+++ b/tests/gold_tests/pluginTest/transform/transaction_data_sink.test.py
@@@ -24,75 -26,29 +24,81 @@@ Test.SkipUnless
Condition.PluginExists('txn_data_sink.so'),
)
-replay_file = "transaction-with-body.replays.yaml"
-server = Test.MakeVerifierServerProcess("server", replay_file)
-nameserver = Test.MakeDNServer("dns", default='127.0.0.1')
-
-ts = Test.MakeATSProcess("ts", enable_cache=False)
-ts.Disk.records_config.update({
- 'proxy.config.diags.debug.enabled': 1,
- 'proxy.config.diags.debug.tags': 'txn_data_sink',
- 'proxy.config.dns.nameservers': f"127.0.0.1:{nameserver.Variables.Port}",
-})
-ts.Disk.remap_config.AddLine(
- f'map / http://localhost:{server.Variables.http_port}/'
-)
-ts.Disk.plugin_config.AddLine('txn_data_sink.so')
-
-# Verify that the various aspects of the expected debug output for the
-# transaction are logged.
-ts.Disk.traffic_out.Content = Testers.ContainsExpression(
- '"http1.1_response_body"',
- "The response body should be printed by the plugin.")
-
-tr = Test.AddTestRun()
-tr.Processes.Default.StartBefore(server)
-tr.Processes.Default.StartBefore(ts)
-tr.Processes.Default.StartBefore(nameserver)
-tr.AddVerifierClientProcess("client-1", replay_file, http_ports=[ts.Variables.port])
+
+class TransactionDataSyncTest:
+
+ replay_file = "transaction-with-body.replays.yaml"
+
+ def __init__(self):
+ self._setupOriginServer()
++ self._setupNameserver()
+ self._setupTS()
+
+ def _setupOriginServer(self):
+ self.server = Test.MakeVerifierServerProcess(
+ "server", self.replay_file)
+
++ def _setupNameserver(self):
++ self.nameserver = Test.MakeDNServer("dns", default='127.0.0.1')
++
+ def _setupTS(self):
+ self.ts = Test.MakeATSProcess("ts", enable_cache=False, enable_tls=True)
+ self.ts.Disk.records_config.update({
+ "proxy.config.ssl.server.cert.path": f'{self.ts.Variables.SSLDir}',
+ "proxy.config.ssl.server.private_key.path": f'{self.ts.Variables.SSLDir}',
+ "proxy.config.ssl.client.verify.server.policy": 'PERMISSIVE',
++ "proxy.config.dns.nameservers": f"127.0.0.1:{self.nameserver.Variables.Port}",
+
+ 'proxy.config.diags.debug.enabled': 1,
+ 'proxy.config.diags.debug.tags': 'http|txn_data_sink',
+ })
+ self.ts.addDefaultSSLFiles()
+ self.ts.Disk.remap_config.AddLine(
+ f'map / http://localhost:{self.server.Variables.http_port}/'
+ )
+ self.ts.Disk.ssl_multicert_config.AddLine(
+ 'dest_ip=* ssl_cert_name=server.pem ssl_key_name=server.key'
+ )
+ self.ts.Disk.plugin_config.AddLine('txn_data_sink.so')
+
+ # All of the bodies that contained "not_dumped" were not configured to
+ # be dumped. Therefore it is a bug if they show up in the logs.
+ self.ts.Disk.traffic_out.Content += Testers.ExcludesExpression(
+ 'body_not_dumped',
+ "An unexpected body was dumped.")
+
+ # Verify that each of the configured transaction bodies were dumped.
+ self.ts.Disk.traffic_out.Content += Testers.ContainsExpression(
+ 'http1.1_cl_response_body_dumped',
+ "The expected HTTP/1.1 Content-Length response body was dumped.")
+ self.ts.Disk.traffic_out.Content += Testers.ContainsExpression(
+ 'http1.1_chunked_response_body_dumped',
+ "The expected HTTP/1.1 chunked response body was dumped.")
+ self.ts.Disk.traffic_out.Content += Testers.ContainsExpression(
+ 'http1.1_cl_request_body_dumped',
+ "The expected HTTP/1.1 Content-Length request body was dumped.")
+ self.ts.Disk.traffic_out.Content += Testers.ContainsExpression(
+ 'http1.1_chunked_request_body_dumped',
+ "The expected HTTP/1.1 chunked request body was dumped.")
+ self.ts.Disk.traffic_out.Content += Testers.ContainsExpression(
+ '"http2_response_body_dumped"',
+ "The expected HTTP/2 response body was dumped.")
+ self.ts.Disk.traffic_out.Content += Testers.ContainsExpression(
+ 'http2_request_body_dumped',
+ "The expected HTTP/2 request body was dumped.")
+
+ def run(self):
+ """Configure a TestRun for the test."""
+ tr = Test.AddTestRun()
+ tr.Processes.Default.StartBefore(self.server)
++ tr.Processes.Default.StartBefore(self.nameserver)
+ tr.Processes.Default.StartBefore(self.ts)
+ tr.AddVerifierClientProcess(
+ "client",
+ self.replay_file,
+ http_ports=[self.ts.Variables.port],
+ https_ports=[self.ts.Variables.ssl_port],
+ other_args='--thread-limit 1')
+
+
+TransactionDataSyncTest().run()
diff --cc tests/gold_tests/timeout/active_timeout.test.py
index e43b68eaa,dcf999816..316faef12
--- a/tests/gold_tests/timeout/active_timeout.test.py
+++ b/tests/gold_tests/timeout/active_timeout.test.py
@@@ -64,7 -64,10 +64,11 @@@ 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")
-# Commenting out the HTTP/3 test since 9.x and before does not support the
-# latest version of HTTP/3 which is used by curl. ATS 10.x does support this
-# later version, so this test is run for that release and later.
++# Commenting out the HTTP/3 test for now until we fix our QUIC implementation
++# with openssl-quic. If this following test runs in CI it will currently fail.
++# TODO: add this test back in for 10-Dev once ATS can perform HTTP/3 when
++# built against openssl.
+ # 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")
diff --cc tests/gold_tests/traffic_ctl/remap_inc/remap_inc.test.py
index 67180cf7e,44391cbe5..bf08295d6
--- a/tests/gold_tests/traffic_ctl/remap_inc/remap_inc.test.py
+++ b/tests/gold_tests/traffic_ctl/remap_inc/remap_inc.test.py
@@@ -24,7 -24,8 +24,8 @@@ Test.ContinueOnFail = Fals
Test.Setup.Copy("wait_reload.sh")
# Define ATS and configure
-ts = Test.MakeATSProcess("ts", command="traffic_manager", enable_cache=False)
+ts = Test.MakeATSProcess("ts", command="traffic_server", enable_cache=False)
+ nameserver = Test.MakeDNServer("dns", default='127.0.0.1')
ts.Disk.File(ts.Variables.CONFIGDIR + "/test.inc", id="test_cfg", typename="ats:config")
ts.Disk.test_cfg.AddLine(