This is an automated email from the ASF dual-hosted git repository.

cmcfarlen pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 6ac417d718924ddcadd16209ee820fef9dd53690
Author: Masakazu Kitajo <[email protected]>
AuthorDate: Mon Sep 15 16:03:08 2025 -0600

    test: make test_layout independent of TS_ROOT part 2 (#12514)
    
    (cherry picked from commit 9a7e21c67ec2dd8b85173d115e5c8925cd9caa07)
    (cherry picked from commit f68e11f8f80abc7061da299db88826c4518c461e)
---
 src/tscore/unit_tests/test_layout.cc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/tscore/unit_tests/test_layout.cc 
b/src/tscore/unit_tests/test_layout.cc
index 237701c8f4..94a41044a3 100644
--- a/src/tscore/unit_tests/test_layout.cc
+++ b/src/tscore/unit_tests/test_layout.cc
@@ -60,6 +60,7 @@ TEST_CASE("environment variable constructor test", 
"[env_constructor]")
 
 TEST_CASE("layout create test", "[create]")
 {
+  unsetenv("TS_ROOT");
   Layout::create();
   REQUIRE(Layout::get()->prefix == TS_BUILD_PREFIX);
   REQUIRE(Layout::get()->sysconfdir == 
Layout::get()->relative(TS_BUILD_SYSCONFDIR));
@@ -68,6 +69,8 @@ TEST_CASE("layout create test", "[create]")
 // tests below based on the created layout
 TEST_CASE("relative test", "[relative]")
 {
+  unsetenv("TS_ROOT");
+  Layout::create();
   // relative (1 argument)
   std::string_view sv("file");
   std::string      str1 = append_slash(TS_BUILD_PREFIX) + "file";
@@ -76,6 +79,8 @@ TEST_CASE("relative test", "[relative]")
 
 TEST_CASE("relative to test", "[relative_to]")
 {
+  unsetenv("TS_ROOT");
+  Layout::create();
   // relative to (2 parameters)
   std::string str1 = append_slash(TS_BUILD_PREFIX) + "file";
   REQUIRE(Layout::relative_to(Layout::get()->prefix, "file") == str1);
@@ -90,6 +95,8 @@ TEST_CASE("relative to test", "[relative_to]")
 
 TEST_CASE("update_sysconfdir test", "[update_sysconfdir]")
 {
+  unsetenv("TS_ROOT");
+  Layout::create();
   Layout::get()->update_sysconfdir("/abc");
   REQUIRE(Layout::get()->sysconfdir == "/abc");
 }

Reply via email to