Merge remote-tracking branch 'ungleich/master' into parallel-global-explorers-execution

This commit is contained in:
Darko Poljak 2016-08-14 22:27:39 +02:00
commit f858191976
127 changed files with 2156 additions and 238 deletions

View file

@ -1,6 +1,8 @@
#!/bin/sh
echo "echo __target_host: $__target_host"
echo "echo __target_hostname: $__target_hostname"
echo "echo __target_fqdn: $__target_fqdn"
echo "echo __global: $__global"
echo "echo __type: $__type"
echo "echo __object: $__object"

View file

@ -44,10 +44,14 @@ class LocalTestCase(test.CdistTestCase):
def setUp(self):
target_host = 'localhost'
target_host = (
'localhost',
'localhost',
'localhost',
)
self.temp_dir = self.mkdtemp()
self.out_parent_path = self.temp_dir
self.hostdir = cdist.str_hash(target_host)
self.hostdir = cdist.str_hash(target_host[0])
self.host_base_path = op.join(self.out_parent_path, self.hostdir)
self.out_path = op.join(self.host_base_path, "data")
@ -111,7 +115,11 @@ class LocalTestCase(test.CdistTestCase):
test_type = "__file"
link_test_local = local.Local(
target_host='localhost',
target_host=(
'localhost',
'localhost',
'localhost',
),
base_root_path=self.host_base_path,
host_dir_name=self.hostdir,
exec_path=test.cdist_exec_path,
@ -130,7 +138,11 @@ class LocalTestCase(test.CdistTestCase):
test_type = "__cdist_test_type"
link_test_local = local.Local(
target_host='localhost',
target_host=(
'localhost',
'localhost',
'localhost',
),
base_root_path=self.host_base_path,
host_dir_name=self.hostdir,
exec_path=test.cdist_exec_path,
@ -152,7 +164,11 @@ class LocalTestCase(test.CdistTestCase):
os.environ['CDIST_PATH'] = conf_dir
link_test_local = local.Local(
target_host='localhost',
target_host=(
'localhost',
'localhost',
'localhost',
),
base_root_path=self.host_base_path,
host_dir_name=self.hostdir,
exec_path=test.cdist_exec_path,

View file

@ -35,7 +35,11 @@ class RemoteTestCase(test.CdistTestCase):
def setUp(self):
self.temp_dir = self.mkdtemp()
self.target_host = 'localhost'
self.target_host = (
'localhost',
'localhost',
'localhost',
)
self.base_path = self.temp_dir
user = getpass.getuser()
remote_exec = "ssh -o User=%s -q" % user
@ -153,7 +157,7 @@ class RemoteTestCase(test.CdistTestCase):
r = remote.Remote(self.target_host, base_path=self.base_path,
remote_exec=remote_exec, remote_copy=remote_copy)
self.assertEqual(r.run('true', return_output=True),
"%s\n" % self.target_host)
"%s\n" % self.target_host[0])
def test_run_script_target_host_in_env(self):
handle, remote_exec_path = self.mkstemp(dir=self.temp_dir)
@ -168,7 +172,7 @@ class RemoteTestCase(test.CdistTestCase):
with os.fdopen(handle, "w") as fd:
fd.writelines(["#!/bin/sh\n", "true"])
self.assertEqual(r.run_script(script, return_output=True),
"%s\n" % self.target_host)
"%s\n" % self.target_host[0])
def test_run_script_with_env_target_host_in_env(self):
handle, script = self.mkstemp(dir=self.temp_dir)