tsqa: support running tests as root

Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/c0622e67
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/c0622e67
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/c0622e67

Branch: refs/heads/master
Commit: c0622e67acb3e71a60e4579e6c18703e3ecae09d
Parents: 79bc7e2
Author: James Peach <jpe...@apache.org>
Authored: Fri Sep 26 12:32:42 2014 -0700
Committer: James Peach <jpe...@apache.org>
Committed: Thu Oct 2 15:52:38 2014 -0700

----------------------------------------------------------------------
 ci/tsqa/functions | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c0622e67/ci/tsqa/functions
----------------------------------------------------------------------
diff --git a/ci/tsqa/functions b/ci/tsqa/functions
index 1fd64ed..60783b1 100644
--- a/ci/tsqa/functions
+++ b/ci/tsqa/functions
@@ -245,6 +245,7 @@ bootstrap() {
   local prefix=$(tsxs -q PREFIX)
   local sysconfdir=$(tsxs -q SYSCONFDIR | sed -es+$prefix/++)
   local dir
+  local userid=${SUDO_USER:-$(whoami)}
 
   # Create runtime directories in the test root.
   for dir in SYSCONFDIR LOCALSTATEDIR RUNTIMEDIR LOGDIR ; do
@@ -271,7 +272,7 @@ CONFIG proxy.config.bin_path STRING $(tsxs -q BINDIR)
 CONFIG proxy.config.plugin.plugin_dir STRING $(tsxs -q LIBEXECDIR)
 CONFIG proxy.config.body_factory.template_sets_dir STRING $(tsxs -q 
SYSCONFDIR)/body_factory
 
-CONFIG proxy.config.admin.user_id STRING $(whoami)
+CONFIG proxy.config.admin.user_id STRING $userid
 CONFIG proxy.config.http.server_ports STRING $PORT
 
 # Flush config updates every 0.5s so that we don't have to sleep so long 
making config changes.
@@ -293,6 +294,8 @@ CONFIG proxy.config.diags.debug.tags STRING NULL
 CONFIG proxy.config.diags.show_location INT 1
 EOF
 
+  chown -R "$userid" $TSQA_ROOT
+
   msg bootstrapped Traffic Server into $TSQA_ROOT
   tsexec traffic_layout
 }

Reply via email to