Repository: mesos
Updated Branches:
  refs/heads/master 9a42cf84f -> 550d37232


Updated Mesos CLI test base to use shell to start masters and agents.

We use the shell scripts in `build/src` to start masters and agents
for the CLI tests. Instead of running them as executables, we now use
the shell launch them using the new Executable attribute 'shell'.

Review: https://reviews.apache.org/r/65655/


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

Branch: refs/heads/master
Commit: 550d3723210490a47c15b2cd7ba7a2a0322bffcf
Parents: 9a42cf8
Author: Armand Grillet <agril...@mesosphere.io>
Authored: Fri Feb 16 15:45:58 2018 +0100
Committer: Kevin Klues <klue...@gmail.com>
Committed: Fri Feb 16 15:45:58 2018 +0100

----------------------------------------------------------------------
 src/python/cli_new/lib/cli/tests/base.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/550d3723/src/python/cli_new/lib/cli/tests/base.py
----------------------------------------------------------------------
diff --git a/src/python/cli_new/lib/cli/tests/base.py 
b/src/python/cli_new/lib/cli/tests/base.py
index 33c67c1..4ffa27c 100644
--- a/src/python/cli_new/lib/cli/tests/base.py
+++ b/src/python/cli_new/lib/cli/tests/base.py
@@ -87,6 +87,7 @@ class Executable(object):
     def __init__(self):
         self.name = ""
         self.executable = ""
+        self.shell = False
         self.flags = {}
         self.proc = None
 
@@ -106,8 +107,13 @@ class Executable(object):
             flags = ["--{key}={value}".format(key=key, value=value)
                      for key, value in self.flags.iteritems()]
 
+            if self.shell:
+                cmd = ["/bin/sh", self.executable] + flags
+            else:
+                cmd = [self.executable] + flags
+
             proc = subprocess.Popen(
-                [self.executable] + flags,
+                cmd,
                 stdin=subprocess.PIPE,
                 stdout=subprocess.PIPE,
                 stderr=subprocess.STDOUT)
@@ -172,6 +178,7 @@ class Master(Executable):
             CLITestCase.MESOS_BUILD_DIR,
             "bin",
             "mesos-{name}.sh".format(name=self.name))
+        self.shell = True
 
     def __del__(self):
         super(Master, self).__del__()
@@ -224,6 +231,7 @@ class Agent(Executable):
             CLITestCase.MESOS_BUILD_DIR,
             "bin",
             "mesos-{name}.sh".format(name=self.name))
+        self.shell = True
 
     def __del__(self):
         super(Agent, self).__del__()

Reply via email to