From 5155e5070c964b896b47e89d8c4e2c3584ff6653 Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Tue, 13 Jan 2015 00:54:59 +0000 Subject: [PATCH] Don't run functionalities/tty under sudo / as root. The terminal window will be opened under the ownership of the real userid and it won't be able to open the socket talking back to lldb -- the testsuite will hang here. The same thing probably should be done for lldb when run on a remote system over ssh. I added a line for that but commented it out for now because I haven't tested it. llvm-svn: 225748 --- lldb/test/functionalities/tty/TestTerminal.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lldb/test/functionalities/tty/TestTerminal.py b/lldb/test/functionalities/tty/TestTerminal.py index 6a05c4a000ab..3226d4d7caf0 100644 --- a/lldb/test/functionalities/tty/TestTerminal.py +++ b/lldb/test/functionalities/tty/TestTerminal.py @@ -16,6 +16,16 @@ class LaunchInTerminalTestCase(TestBase): # a program in a separate terminal window. It would be great if other platforms # added support for this. @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") + + + # If the test is being run under sudo, the spawned terminal won't retain that elevated + # privilege so it can't open the socket to talk back to the test case + @unittest2.skipUnless(os.geteuid() != 0, "test cannot be run as root") + + # Do we need to disable this test if the testsuite is being run on a rmeote system? + # This env var is only defined when the shell is running in a local mac terminal window + # @unittest2.skipUnless(os.environ.has_key('TERM_PROGRAM'), "test must be run on local system") + def test_launch_in_terminal (self): exe = "/bin/ls" target = self.dbg.CreateTarget(exe)