Fix ssh mux socket file error.

ssh ControlPath socket file needs to be unique for each host.
To avoid using ssh ControlPath option placeholders move socket file
to host's temp directory. Since each host has unique temp
directory then, although file name for socket file is fixed, its path
is unique.
This commit is contained in:
Darko Poljak 2016-07-23 16:13:59 +02:00
commit 6f28fc2db2
9 changed files with 221 additions and 160 deletions

View file

@ -47,11 +47,14 @@ class LocalTestCase(test.CdistTestCase):
target_host = 'localhost'
self.temp_dir = self.mkdtemp()
self.out_parent_path = self.temp_dir
self.out_path = op.join(self.out_parent_path, target_host)
self.hostdir = cdist.str_hash(target_host)
self.host_base_path = op.join(self.out_parent_path, self.hostdir)
self.out_path = op.join(self.host_base_path, "data")
self.local = local.Local(
target_host=target_host,
base_path=self.out_parent_path,
base_root_path=self.host_base_path,
host_dir_name=self.hostdir,
exec_path=test.cdist_exec_path
)
@ -109,7 +112,8 @@ class LocalTestCase(test.CdistTestCase):
link_test_local = local.Local(
target_host='localhost',
base_path=self.out_parent_path,
base_root_path=self.host_base_path,
host_dir_name=self.hostdir,
exec_path=test.cdist_exec_path,
)
@ -127,7 +131,8 @@ class LocalTestCase(test.CdistTestCase):
link_test_local = local.Local(
target_host='localhost',
base_path=self.out_parent_path,
base_root_path=self.host_base_path,
host_dir_name=self.hostdir,
exec_path=test.cdist_exec_path,
add_conf_dirs=[conf_dir]
)
@ -148,7 +153,8 @@ class LocalTestCase(test.CdistTestCase):
link_test_local = local.Local(
target_host='localhost',
base_path=self.out_parent_path,
base_root_path=self.host_base_path,
host_dir_name=self.hostdir,
exec_path=test.cdist_exec_path,
)