Ensure USER environment variable is always set within autoserv.
Many server side tests depend on it & it doesn't hurt to be a pedant
about environment vars.

Signed-off-by: Gregory Smith <[email protected]>

--- autotest/server/autoserv    2009-12-29 14:16:16.000000000 -0800
+++ autotest/server/autoserv    2009-12-29 14:16:16.000000000 -0800
@@ -6,7 +6,7 @@
 Run an control file through the server side engine
 """
 
-import sys, os, re, traceback, signal, time, logging
+import sys, os, re, traceback, signal, time, logging, getpass
 
 import common
 
@@ -53,6 +53,10 @@
     # Set signal handler
     signal.signal(signal.SIGTERM, handle_sigterm)
 
+    # Server side tests that call shell scripts often depend on $USER being set
+    # but depending on how you launch your autotest scheduler it may not be 
set.
+    os.environ['USER'] = getpass.getuser()
+
     if parser.options.machines:
         machines = parser.options.machines.replace(',', ' ').strip().split()
     else:
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to