diff --git a/doc/appendices/command-line/traffic_ctl_jsonrpc.en.rst b/doc/appendices/command-line/traffic_ctl_jsonrpc.en.rst index 89de8961fa8..6b165b23a4b 100644 --- a/doc/appendices/command-line/traffic_ctl_jsonrpc.en.rst +++ b/doc/appendices/command-line/traffic_ctl_jsonrpc.en.rst @@ -570,38 +570,9 @@ Configure Traffic Server to insert ``Via`` header in the response to the client Autest ====== -If you want to interact with |TS| under a unit test, then a few things need to be considered. - -- Runroot needs to be configured in order to let `traffic_ctl` knows where to find the socket. - - There are currently two ways to do this: - - 1. Using `run-root` param. - - 1. Let `Test.MakeATSProcess` to create the runroot file under the |TS| config directory. This can be done by passing `dump_runroot=True` to the above function: - - .. code-block:: python - - ts = Test.MakeATSProcess(..., dump_runroot=True) - - - `dump_runroot` will write out some of the keys inside the runroot file, in this case the `runtimedir`. - - 1. Then you should specify the :option:`traffic_ctl --run-root` when invoking the command: - - .. code-block:: python - - tr.Processes.Default.Command = f'traffic_ctl config reload --run-root {ts.Disk.runroot_yaml.Name}' - - 2. Setting up the `TS_RUNROOT` environment variable. - This is very similar to `1` but, instead of passing the `--run-root` param to `traffic_ctl`, you just need to specify the - `TS_RUNROOT` environment variable. To do that, just do as 1.1 shows and then: - - .. code-block:: python - - ts.SetRunRootEnv() - - The above call will set the variable, please be aware that this variable will also be read by TS. +Runroot needs to be configured in order to let `traffic_ctl` know where to find the socket. This is done by default +and there is no change you have to do to interact with it, but make sure that you are not overriding the `dump_runroot=False` +when creating the ATS Process, otherwise the `runroot.yaml` will not be set. See also ======== diff --git a/tests/gold_tests/autest-site/trafficserver.test.ext b/tests/gold_tests/autest-site/trafficserver.test.ext index 44b968f3774..e9b0f1056e7 100755 --- a/tests/gold_tests/autest-site/trafficserver.test.ext +++ b/tests/gold_tests/autest-site/trafficserver.test.ext @@ -40,7 +40,7 @@ default_log_data = { def MakeATSProcess(obj, name, command='traffic_server', select_ports=True, enable_tls=False, enable_cache=True, enable_quic=False, - block_for_debug=False, log_data=default_log_data, dump_runroot=False): + block_for_debug=False, log_data=default_log_data, dump_runroot=True): ##################################### # common locations @@ -307,14 +307,18 @@ def MakeATSProcess(obj, name, command='traffic_server', select_ports=True, tmpname = os.path.join(config_dir, fname) p.Disk.File(tmpname, id=make_id(fname), typename="ats:config") - # Expect the instruction to set the variables inside the runroot. This is not mandatory + # Fill in the runroot file and set the config var, this will be used traffic_server + # and traffic_ctl if dump_runroot: - p.Disk.runroot_yaml.AddLine(f'runtimedir: {runtime_dir}') - - def SetRunRootEnv(self): - self.Env['TS_RUNROOT'] = os.path.join(config_dir, "runroot.yaml") - - AddMethodToInstance(p, SetRunRootEnv) + p.Disk.runroot_yaml.AddLines([f'runtimedir: {runtime_dir}', + f'cachedir: {cache_dir}', + f'localstatedir: {runtime_dir}', + f'bindir: {bin_dir}', + f'prefix: {ts_dir}', + f'logdir: {log_dir}', + f'sysconfdir: {config_dir}']) + # Add more if needed + p.Env['TS_RUNROOT'] = os.path.join(config_dir, "runroot.yaml") ########################################################## # set up default ports diff --git a/tests/gold_tests/cache/cache-generation-clear.test.py b/tests/gold_tests/cache/cache-generation-clear.test.py index df2af0be5c0..64021298702 100644 --- a/tests/gold_tests/cache/cache-generation-clear.test.py +++ b/tests/gold_tests/cache/cache-generation-clear.test.py @@ -23,7 +23,7 @@ ''' Test.ContinueOnFail = True # Define default ATS -ts = Test.MakeATSProcess("ts", command="traffic_server", select_ports=True, dump_runroot=True) +ts = Test.MakeATSProcess("ts", command="traffic_server", select_ports=True) # setup some config file for this server ts.Disk.records_config.update({ @@ -63,7 +63,7 @@ # Call traffic_ctrl to set new generation tr = Test.AddTestRun() -tr.Processes.Default.Command = f'traffic_ctl --debug config set proxy.config.http.cache.generation 77 --run-root {ts.Disk.runroot_yaml.Name}' +tr.Processes.Default.Command = f'traffic_ctl --debug config set proxy.config.http.cache.generation 77' tr.Processes.Default.ForceUseShell = False tr.Processes.Default.ReturnCode = 0 tr.Processes.Default.Env = ts.Env # set the environment for traffic_control to run in diff --git a/tests/gold_tests/continuations/double.test.py b/tests/gold_tests/continuations/double.test.py index 1ed9f86077b..6180affba8c 100644 --- a/tests/gold_tests/continuations/double.test.py +++ b/tests/gold_tests/continuations/double.test.py @@ -24,12 +24,9 @@ Test.ContinueOnFail = True # Define default ATS. Disable the cache to simplify the test. -ts = Test.MakeATSProcess("ts", select_ports=True, command="traffic_server", enable_cache=False, dump_runroot=True) +ts = Test.MakeATSProcess("ts", select_ports=True, command="traffic_server", enable_cache=False) server = Test.MakeOriginServer("server") -# Set TS_RUNROOT, traffic_ctl needs it to find the socket. -ts.SetRunRootEnv() - Test.testName = "" request_header = {"headers": "GET / HTTP/1.1\r\nHost: double_h2.test\r\n\r\n", "timestamp": "1469733493.993", "body": ""} # expected response from the origin server diff --git a/tests/gold_tests/continuations/double_h2.test.py b/tests/gold_tests/continuations/double_h2.test.py index e825f80fafe..3984d78fc0d 100644 --- a/tests/gold_tests/continuations/double_h2.test.py +++ b/tests/gold_tests/continuations/double_h2.test.py @@ -26,14 +26,11 @@ ) Test.ContinueOnFail = True # Define default ATS. Disable the cache to simplify the test. -ts = Test.MakeATSProcess("ts", select_ports=True, enable_tls=True, command="traffic_server", enable_cache=False, dump_runroot=True) +ts = Test.MakeATSProcess("ts", select_ports=True, enable_tls=True, command="traffic_server", enable_cache=False) server = Test.MakeOriginServer("server") server2 = Test.MakeOriginServer("server2") -# Set TS_RUNROOT, traffic_ctl needs it to find the socket. -ts.SetRunRootEnv() - Test.testName = "" request_header = {"headers": "GET / HTTP/1.1\r\nHost: double_h2.test\r\n\r\n", "timestamp": "1469733493.993", "body": ""} # expected response from the origin server diff --git a/tests/gold_tests/continuations/openclose.test.py b/tests/gold_tests/continuations/openclose.test.py index b451464fde1..682a3220e54 100644 --- a/tests/gold_tests/continuations/openclose.test.py +++ b/tests/gold_tests/continuations/openclose.test.py @@ -23,7 +23,7 @@ ''' # Define default ATS. Disable the cache to simplify the test. -ts = Test.MakeATSProcess("ts", command="traffic_server", enable_cache=False, dump_runroot=True) +ts = Test.MakeATSProcess("ts", command="traffic_server", enable_cache=False) server = Test.MakeOriginServer("server") server2 = Test.MakeOriginServer("server2") @@ -72,8 +72,6 @@ tr.StillRunningAfter = ts -# Set TS_RUNROOT, traffic_ctl needs it to find the socket. -ts.SetRunRootEnv() # Signal that all the curl processes have completed tr = Test.AddTestRun("Curl Done") tr.DelayStart = 2 # Delaying a couple seconds to make sure the global continuation's lock contention resolves. diff --git a/tests/gold_tests/continuations/openclose_h2.test.py b/tests/gold_tests/continuations/openclose_h2.test.py index 19dcd84a3af..cab03ae4eb5 100644 --- a/tests/gold_tests/continuations/openclose_h2.test.py +++ b/tests/gold_tests/continuations/openclose_h2.test.py @@ -27,7 +27,7 @@ ) # Define default ATS. Disable the cache to simplify the test. -ts = Test.MakeATSProcess("ts", select_ports=True, enable_tls=True, command="traffic_server", enable_cache=False, dump_runroot=True) +ts = Test.MakeATSProcess("ts", select_ports=True, enable_tls=True, command="traffic_server", enable_cache=False) server = Test.MakeOriginServer("server") @@ -85,9 +85,6 @@ server.StartAfter(*ps) tr.StillRunningAfter = ts -# Set TS_RUNROOT, traffic_ctl needs it to find the socket. -ts.SetRunRootEnv() - # Signal that all the curl processes have completed tr = Test.AddTestRun("Curl Done") tr.DelayStart = 2 # Delaying a couple seconds to make sure the global continuation's lock contention resolves. diff --git a/tests/gold_tests/headers/forwarded.test.py b/tests/gold_tests/headers/forwarded.test.py index 600f1769dc2..671033cd5de 100644 --- a/tests/gold_tests/headers/forwarded.test.py +++ b/tests/gold_tests/headers/forwarded.test.py @@ -192,7 +192,7 @@ def TestHttp1_1(host): TestHttp1_1('www.forwarded-connection-std.com') TestHttp1_1('www.forwarded-connection-full.com') -ts2 = Test.MakeATSProcess("ts2", command="traffic_server", enable_tls=True, dump_runroot=True) +ts2 = Test.MakeATSProcess("ts2", command="traffic_server", enable_tls=True) baselineTsSetup(ts2) @@ -205,8 +205,6 @@ def TestHttp1_1(host): 'map https://www.no-oride.com http://127.0.0.1:{0}'.format(server.Variables.Port) ) -# Set TS_RUNROOT, traffic_ctl needs it to find the socket. -ts2.SetRunRootEnv() # Forwarded header with UUID of 2nd ATS. tr = Test.AddTestRun() diff --git a/tests/gold_tests/jsonrpc/jsonrpc_api_schema.test.py b/tests/gold_tests/jsonrpc/jsonrpc_api_schema.test.py index 8d6eda0a282..cf052a5f919 100644 --- a/tests/gold_tests/jsonrpc/jsonrpc_api_schema.test.py +++ b/tests/gold_tests/jsonrpc/jsonrpc_api_schema.test.py @@ -94,9 +94,7 @@ def add_testrun_for_jsonrpc_request( return tr -ts = Test.MakeATSProcess('ts', enable_cache=True, dump_runroot=True) -# Set TS_RUNROOT, traffic_ctl needs it to find the socket. -ts.SetRunRootEnv() +ts = Test.MakeATSProcess('ts', enable_cache=True) Test.testName = 'Basic JSONRPC API test' diff --git a/tests/gold_tests/logging/log_retention.test.py b/tests/gold_tests/logging/log_retention.test.py index 5eb559d62f2..b3637ccf745 100644 --- a/tests/gold_tests/logging/log_retention.test.py +++ b/tests/gold_tests/logging/log_retention.test.py @@ -110,7 +110,7 @@ def __create_ts(self, records_config, command="traffic_server"): """ ts_name = "ts{counter}".format(counter=TestLogRetention.__ts_counter) TestLogRetention.__ts_counter += 1 - self.ts = Test.MakeATSProcess(ts_name, command=command, dump_runroot=True) + self.ts = Test.MakeATSProcess(ts_name, command=command) combined_records_config = TestLogRetention.__base_records_config.copy() combined_records_config.update(records_config) @@ -526,9 +526,6 @@ def get_command_to_rotate_thrice(self): test.tr.StillRunningAfter = test.ts test.tr.StillRunningAfter = test.server -# Set TS_RUNROOT, traffic_ctl needs it to find the socket. -test.ts.SetRunRootEnv() - tr = Test.AddTestRun("Perform a config reload") tr.Processes.Default.Command = "traffic_ctl config reload" tr.Processes.Default.Env = test.ts.Env diff --git a/tests/gold_tests/pluginTest/cert_update/cert_update.test.py b/tests/gold_tests/pluginTest/cert_update/cert_update.test.py index 69bf0ba68d1..0a1c91aeb86 100644 --- a/tests/gold_tests/pluginTest/cert_update/cert_update.test.py +++ b/tests/gold_tests/pluginTest/cert_update/cert_update.test.py @@ -36,7 +36,7 @@ server.addResponse("sessionlog.json", request_header, response_header) # Set up ATS -ts = Test.MakeATSProcess("ts", command="traffic_server", enable_tls=1, dump_runroot=True) +ts = Test.MakeATSProcess("ts", command="traffic_server", enable_tls=1) # Set up ssl files ts.addSSLfile("ssl/server1.pem") @@ -44,9 +44,6 @@ ts.addSSLfile("ssl/client1.pem") ts.addSSLfile("ssl/client2.pem") -# Set TS_RUNROOT, traffic_ctl needs it to find the socket. -ts.SetRunRootEnv() - # reserve port, attach it to 'ts' so it is released later ports.get_port(ts, 's_server_port') diff --git a/tests/gold_tests/pluginTest/client_context_dump/client_context_dump.test.py b/tests/gold_tests/pluginTest/client_context_dump/client_context_dump.test.py index a3ae401b1c0..7cd8984b05c 100644 --- a/tests/gold_tests/pluginTest/client_context_dump/client_context_dump.test.py +++ b/tests/gold_tests/pluginTest/client_context_dump/client_context_dump.test.py @@ -25,7 +25,7 @@ Test.SkipUnless(Condition.PluginExists('client_context_dump.so')) # Set up ATS -ts = Test.MakeATSProcess("ts", command="traffic_server", select_ports=True, enable_tls=True, dump_runroot=True) +ts = Test.MakeATSProcess("ts", command="traffic_server", select_ports=True, enable_tls=True) # Set up ssl files ts.addSSLfile("ssl/one.com.pem") @@ -73,6 +73,6 @@ tr = Test.AddTestRun() tr.Processes.Default.Env = ts.Env tr.Processes.Default.Command = ( - '{0}/traffic_ctl plugin msg client_context_dump.t 1 --run-root {1}'.format(ts.Variables.BINDIR, ts.Disk.runroot_yaml.Name) + '{0}/traffic_ctl plugin msg client_context_dump.t 1'.format(ts.Variables.BINDIR) ) tr.Processes.Default.ReturnCode = 0 diff --git a/tests/gold_tests/pluginTest/lua/lua_states_stats.test.py b/tests/gold_tests/pluginTest/lua/lua_states_stats.test.py index 75fc97d2f2c..3ac32328f5a 100644 --- a/tests/gold_tests/pluginTest/lua/lua_states_stats.test.py +++ b/tests/gold_tests/pluginTest/lua/lua_states_stats.test.py @@ -30,8 +30,8 @@ # It is necessary to redirect stderr to a file so it will be available for examination by a test run. ts = Test.MakeATSProcess( - "ts", command="traffic_server 2> " + Test.RunDirectory + "/ts.stderr.txt", select_ports=True, dump_runroot=True -) + "ts", command="traffic_server 2> " + Test.RunDirectory + "/ts.stderr.txt", select_ports=True) + ts.ReturnCode = 0 Test.testName = "Lua states and stats" @@ -64,9 +64,6 @@ 'proxy.config.plugin.lua.max_states': 4, }) -# Set TS_RUNROOT, traffic_ctl needs it to find the socket. -ts.SetRunRootEnv() - curl_and_args = 'curl -s -D /dev/stdout -o /dev/stderr -x localhost:{} '.format(ts.Variables.port) # 0 Test - Check for configured lua states diff --git a/tests/gold_tests/pluginTest/regex_revalidate/metrics.sh b/tests/gold_tests/pluginTest/regex_revalidate/metrics.sh index 7616bf28398..4365a0e6e02 100755 --- a/tests/gold_tests/pluginTest/regex_revalidate/metrics.sh +++ b/tests/gold_tests/pluginTest/regex_revalidate/metrics.sh @@ -18,7 +18,7 @@ N=60 while (( N > 0 )) do rm -f metrics.out - traffic_ctl metric match regex_revalidate --run-root $1 > metrics.out + traffic_ctl metric match regex_revalidate > metrics.out sleep 1 if diff metrics.out ${AUTEST_TEST_DIR}/gold/metrics.gold then diff --git a/tests/gold_tests/pluginTest/regex_revalidate/metrics_miss.sh b/tests/gold_tests/pluginTest/regex_revalidate/metrics_miss.sh index 0102961ae7a..164a4e45277 100755 --- a/tests/gold_tests/pluginTest/regex_revalidate/metrics_miss.sh +++ b/tests/gold_tests/pluginTest/regex_revalidate/metrics_miss.sh @@ -18,7 +18,7 @@ N=60 while (( N > 0 )) do rm -f metrics.out - traffic_ctl metric match regex_revalidate --run-root $1 > metrics.out + traffic_ctl metric match regex_revalidate > metrics.out sleep 1 if diff metrics.out ${AUTEST_TEST_DIR}/gold/metrics_miss.gold then diff --git a/tests/gold_tests/pluginTest/regex_revalidate/regex_revalidate.test.py b/tests/gold_tests/pluginTest/regex_revalidate/regex_revalidate.test.py index 0e2082f57dd..095afe59a10 100644 --- a/tests/gold_tests/pluginTest/regex_revalidate/regex_revalidate.test.py +++ b/tests/gold_tests/pluginTest/regex_revalidate/regex_revalidate.test.py @@ -44,7 +44,7 @@ server = Test.MakeOriginServer("server") # Define ATS and configure -ts = Test.MakeATSProcess("ts", command="traffic_server", select_ports=True, dump_runroot=True) +ts = Test.MakeATSProcess("ts", command="traffic_server", select_ports=True) Test.testName = "regex_revalidate" Test.Setup.Copy("metrics.sh") @@ -279,7 +279,8 @@ # 12 Stats check tr = Test.AddTestRun("Check stats") tr.DelayStart = 5 -tr.Processes.Default.Command = f"bash -c './metrics.sh {ts.Disk.runroot_yaml.Name}'" +# tr.Processes.Default.Command = f"bash -c './metrics.sh {ts.Disk.runroot_yaml.Name}'" +tr.Processes.Default.Command = f"bash -c './metrics.sh'" tr.Processes.Default.Env = ts.Env tr.Processes.Default.ReturnCode = 0 tr.StillRunningAfter = ts diff --git a/tests/gold_tests/pluginTest/regex_revalidate/regex_revalidate_miss.test.py b/tests/gold_tests/pluginTest/regex_revalidate/regex_revalidate_miss.test.py index 1499e5157eb..e2125f5867a 100644 --- a/tests/gold_tests/pluginTest/regex_revalidate/regex_revalidate_miss.test.py +++ b/tests/gold_tests/pluginTest/regex_revalidate/regex_revalidate_miss.test.py @@ -38,7 +38,7 @@ server = Test.MakeOriginServer("server") # Define ATS and configure -ts = Test.MakeATSProcess("ts", command="traffic_server", dump_runroot=True) +ts = Test.MakeATSProcess("ts", command="traffic_server") Test.testName = "regex_revalidate_miss" Test.Setup.Copy("metrics_miss.sh") @@ -149,7 +149,7 @@ # 3 Test - Revalidate path1 tr = Test.AddTestRun("Revalidate MISS path1") ps = tr.Processes.Default -tr.DelayStart = 5 +tr.DelayStart = 7 ps.Command = curl_and_args + ' http://ats/path1' ps.ReturnCode = 0 ps.Streams.stdout.Content = Testers.ContainsExpression("X-Cache: miss", "expected cache miss response") @@ -178,7 +178,7 @@ # 6 Test - Cache stale tr = Test.AddTestRun("Cache stale path1") ps = tr.Processes.Default -tr.DelayStart = 5 +tr.DelayStart = 7 ps.Command = curl_and_args + ' http://ats/path1' ps.ReturnCode = 0 ps.Streams.stdout.Content = Testers.ContainsExpression("X-Cache: hit-stale", "expected cache hit stale response") @@ -199,7 +199,7 @@ # 8 Test - Cache stale tr = Test.AddTestRun("Cache stale path1") ps = tr.Processes.Default -tr.DelayStart = 5 +tr.DelayStart = 7 ps.Command = curl_and_args + ' http://ats/path1' ps.ReturnCode = 0 ps.Streams.stdout.Content = Testers.ContainsExpression("X-Cache: miss", "expected cache miss response") @@ -220,7 +220,7 @@ # 10 Test - Cache stale tr = Test.AddTestRun("Cache stale path1") ps = tr.Processes.Default -tr.DelayStart = 5 +tr.DelayStart = 7 ps.Command = curl_and_args + ' http://ats/path1' ps.ReturnCode = 0 ps.Streams.stdout.Content = Testers.ContainsExpression("X-Cache: hit-fresh", "expected cache hit response") @@ -229,7 +229,7 @@ # 11 Stats check tr = Test.AddTestRun("Check stats") tr.DelayStart = 5 -tr.Processes.Default.Command = f"bash -c './metrics_miss.sh {ts.Disk.runroot_yaml.Name}'" +tr.Processes.Default.Command = f"bash -c ./metrics_miss.sh" tr.Processes.Default.Env = ts.Env tr.Processes.Default.ReturnCode = 0 tr.StillRunningAfter = ts diff --git a/tests/gold_tests/pluginTest/remap_stats/remap_stats.test.py b/tests/gold_tests/pluginTest/remap_stats/remap_stats.test.py index 3dafdb98d43..cb02e1bc1ee 100644 --- a/tests/gold_tests/pluginTest/remap_stats/remap_stats.test.py +++ b/tests/gold_tests/pluginTest/remap_stats/remap_stats.test.py @@ -29,7 +29,7 @@ "timestamp": "1469733493.993", "body": ""} server.addResponse("sessionlog.json", request_header, response_header) -ts = Test.MakeATSProcess("ts", command="traffic_server", select_ports=True, dump_runroot=True) +ts = Test.MakeATSProcess("ts", command="traffic_server", select_ports=True) ts.Disk.plugin_config.AddLine('remap_stats.so') diff --git a/tests/gold_tests/remap/conf_remap_float.py b/tests/gold_tests/remap/conf_remap_float.py index 92449b5c012..f14e2a40bf9 100644 --- a/tests/gold_tests/remap/conf_remap_float.py +++ b/tests/gold_tests/remap/conf_remap_float.py @@ -24,10 +24,7 @@ ''' Test.testName = 'Float in conf_remap Config Test' -ts = Test.MakeATSProcess("ts", command="traffic_server", select_ports=True, dump_runroot=True) - -# Set TS_RUNROOT, traffic_ctl needs it to find the socket. -ts.SetRunRootEnv() +ts = Test.MakeATSProcess("ts", command="traffic_server", select_ports=True) # Add dummy remap rule ts.Disk.remap_config.AddLine( @@ -50,6 +47,6 @@ tr.StillRunningAfter = ts p = tr.Processes.Default -p.Command = f"traffic_ctl config describe proxy.config.http.background_fill_completed_threshold --run-root {ts.Disk.runroot_yaml.Name}" +p.Command = f"traffic_ctl config describe proxy.config.http.background_fill_completed_threshold" p.ReturnCode = 0 p.StartBefore(Test.Processes.ts, ready=When.FileExists(os.path.join(tr.RunDirectory, 'ts/log/diags.log'))) diff --git a/tests/gold_tests/runroot/runroot_manager.test.py b/tests/gold_tests/runroot/runroot_manager.test.py index a6294e95eec..90023fda4a8 100644 --- a/tests/gold_tests/runroot/runroot_manager.test.py +++ b/tests/gold_tests/runroot/runroot_manager.test.py @@ -48,7 +48,7 @@ def StopProcess(event, time): tr.ChownForATSProcess(trafficserver_dir) p = tr.Processes.Default -p.Command = "$ATS_BIN/traffic_manager --run-root=" + rr_file +p.Command = "$ATS_BIN/traffic_server --run-root=" + rr_file p.RunningEvent.Connect(Testers.Lambda(lambda ev: StopProcess(ev, 10))) p.Streams.All = Testers.ContainsExpression("traffic_server: using root directory '" + runroot_path + "'", "check if the right runroot is passed down") diff --git a/tests/gold_tests/tls/tls_check_cert_select_plugin.test.py b/tests/gold_tests/tls/tls_check_cert_select_plugin.test.py index 3cf99a01aea..24fb0c2a58b 100644 --- a/tests/gold_tests/tls/tls_check_cert_select_plugin.test.py +++ b/tests/gold_tests/tls/tls_check_cert_select_plugin.test.py @@ -23,8 +23,7 @@ ''' # Define default ATS -ts = Test.MakeATSProcess("ts", command="traffic_server", select_ports=True, enable_tls=True, dump_runroot=True) -ts.SetRunRootEnv() +ts = Test.MakeATSProcess("ts", command="traffic_server", select_ports=True, enable_tls=True) server = Test.MakeOriginServer("server", ssl=True) dns = Test.MakeDNServer("dns") diff --git a/tests/gold_tests/tls/tls_check_cert_selection_reload.test.py b/tests/gold_tests/tls/tls_check_cert_selection_reload.test.py index 75227b7f020..439c33788c2 100644 --- a/tests/gold_tests/tls/tls_check_cert_selection_reload.test.py +++ b/tests/gold_tests/tls/tls_check_cert_selection_reload.test.py @@ -21,8 +21,7 @@ ''' # Define default ATS -ts = Test.MakeATSProcess("ts", command="traffic_server", enable_tls=True, dump_runroot=True) -ts.SetRunRootEnv() +ts = Test.MakeATSProcess("ts", command="traffic_server", enable_tls=True) server = Test.MakeOriginServer("server", ssl=True) server3 = Test.MakeOriginServer("server3", ssl=True) diff --git a/tests/gold_tests/tls/tls_client_cert.test.py b/tests/gold_tests/tls/tls_client_cert.test.py index 67e2fbd70df..04569c88dc6 100644 --- a/tests/gold_tests/tls/tls_client_cert.test.py +++ b/tests/gold_tests/tls/tls_client_cert.test.py @@ -21,7 +21,7 @@ Test different combinations of TLS handshake hooks to ensure they are applied consistently. ''' -ts = Test.MakeATSProcess("ts", command="traffic_server", select_ports=True, dump_runroot=True) +ts = Test.MakeATSProcess("ts", command="traffic_server", select_ports=True) cafile = "{0}/signer.pem".format(Test.RunDirectory) cafile2 = "{0}/signer2.pem".format(Test.RunDirectory) # --clientverify: "" empty string because microserver does store_true for argparse, but options is a dictionary @@ -190,9 +190,6 @@ tr2.Processes.Default.Env = ts.Env tr2.Processes.Default.ReturnCode = 0 -# Set TS_RUNROOT, traffic_ctl needs it to find the socket. -ts.SetRunRootEnv() - tr2reload = Test.AddTestRun("Reload config") tr2reload.StillRunningAfter = ts tr2reload.StillRunningAfter = server diff --git a/tests/gold_tests/tls/tls_client_cert_override_plugin.test.py b/tests/gold_tests/tls/tls_client_cert_override_plugin.test.py index bbf7e2c3eae..5e5c18da9a5 100644 --- a/tests/gold_tests/tls/tls_client_cert_override_plugin.test.py +++ b/tests/gold_tests/tls/tls_client_cert_override_plugin.test.py @@ -21,8 +21,8 @@ ''' -ts = Test.MakeATSProcess("ts", command="traffic_server", select_ports=True, dump_runroot=True) -ts.SetRunRootEnv() +ts = Test.MakeATSProcess("ts", command="traffic_server", select_ports=True) + cafile = "{0}/signer.pem".format(Test.RunDirectory) cafile2 = "{0}/signer2.pem".format(Test.RunDirectory) server = Test.MakeOriginServer("server", diff --git a/tests/gold_tests/tls/tls_client_cert_plugin.test.py b/tests/gold_tests/tls/tls_client_cert_plugin.test.py index 504add979ea..04e30a8c198 100644 --- a/tests/gold_tests/tls/tls_client_cert_plugin.test.py +++ b/tests/gold_tests/tls/tls_client_cert_plugin.test.py @@ -24,8 +24,7 @@ Test offering client cert to origin, but using plugin for cert loading ''' -ts = Test.MakeATSProcess("ts", command="traffic_server", select_ports=True, dump_runroot=True) -ts.SetRunRootEnv() +ts = Test.MakeATSProcess("ts", command="traffic_server", select_ports=True) cafile = "{0}/signer.pem".format(Test.RunDirectory) cafile2 = "{0}/signer2.pem".format(Test.RunDirectory) # --clientverify: "" empty string because microserver does store_true for argparse, but options is a dictionary diff --git a/tests/gold_tests/tls/tls_tunnel.test.py b/tests/gold_tests/tls/tls_tunnel.test.py index 940f91344ba..18b14e3d43b 100644 --- a/tests/gold_tests/tls/tls_tunnel.test.py +++ b/tests/gold_tests/tls/tls_tunnel.test.py @@ -21,7 +21,7 @@ ''' # Define default ATS -ts = Test.MakeATSProcess("ts", command="traffic_server", select_ports=True, enable_tls=True, dump_runroot=True) +ts = Test.MakeATSProcess("ts", command="traffic_server", select_ports=True, enable_tls=True) server_foo = Test.MakeOriginServer("server_foo", ssl=True) server_bar = Test.MakeOriginServer("server_bar", ssl=True) server2 = Test.MakeOriginServer("server2") @@ -184,7 +184,7 @@ trreload.StillRunningAfter = ts trreload.StillRunningAfter = server_foo trreload.StillRunningAfter = server_bar -trreload.Processes.Default.Command = 'traffic_ctl config reload --run-root {}'.format(ts.Disk.runroot_yaml.Name) +trreload.Processes.Default.Command = 'traffic_ctl config reload' # Need to copy over the environment so traffic_ctl knows where to find the unix domain socket trreload.Processes.Default.Env = ts.Env trreload.Processes.Default.ReturnCode = 0 diff --git a/tests/gold_tests/traffic_ctl/remap_inc/remap_inc.test.py b/tests/gold_tests/traffic_ctl/remap_inc/remap_inc.test.py index 83a51d2bf81..67180cf7e8e 100644 --- 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,7 @@ Test.Setup.Copy("wait_reload.sh") # Define ATS and configure -ts = Test.MakeATSProcess("ts", command="traffic_server", enable_cache=False, dump_runroot=True) +ts = Test.MakeATSProcess("ts", command="traffic_server", enable_cache=False) ts.Disk.File(ts.Variables.CONFIGDIR + "/test.inc", id="test_cfg", typename="ats:config") ts.Disk.test_cfg.AddLine( @@ -60,7 +60,7 @@ tr = Test.AddTestRun("Reload config") tr.StillRunningAfter = ts -tr.Processes.Default.Command = f'traffic_ctl config reload --run-root {ts.Disk.runroot_yaml.Name}' +tr.Processes.Default.Command = f'traffic_ctl config reload' # Need to copy over the environment so traffic_ctl knows where to find the unix domain socket tr.Processes.Default.Env = ts.Env tr.Processes.Default.ReturnCode = 0