Fix false positive e2e tests operations
Change-Id: Ifcd6f4f8a418df078aa3bc250c9844ec174318c8
diff --git a/tcp_tests/managers/k8smanager.py b/tcp_tests/managers/k8smanager.py
index 7b03fe9..5b43254 100644
--- a/tcp_tests/managers/k8smanager.py
+++ b/tcp_tests/managers/k8smanager.py
@@ -355,12 +355,22 @@
LOG.info(self.controller_check_call(describe, timeout=30))
raise RuntimeError("Conformance failed")
+ def get_node_name(self, tgt):
+ res = [node_name for node_name in
+ self.__underlay.node_names() if tgt in node_name]
+ assert len(res) > 0, 'Can not find node name by tgt {}'.format(tgt)
+ return res[0]
+
def move_file_to_root_folder(self, filepath):
- # Using || true to avoid salt fails if no file found
- cmd = "mv {0} /root/ || true".format(filepath)
+ cmd = "mv {0} /root/".format(filepath)
if self.conformance_node:
+ short_name = self.conformance_node.split('.')[0]
LOG.info("Managing results on {}".format(self.conformance_node))
- self._salt.cmd_run(tgt=self.conformance_node, cmd=cmd)
+ step = {'cmd': cmd, 'node_name': self.get_node_name(
+ tgt=short_name)}
+ LOG.info('Move {0} to /root/ on {1}'.format(
+ filepath, self.conformance_node))
+ self.execute_command(step, 'Move files')
else:
LOG.info("Node is not properly set")
@@ -416,7 +426,7 @@
master_host = self.__config.salt.salt_master_host
with self.__underlay.remote(host=master_host) as r:
for log_file in files:
- cmd = "rsync -r \"{0}:/root/{1}\" /root/".format(
+ cmd = "scp -r \"{0}:/root/{1}\" /root/".format(
node, log_file)
r.check_call(cmd, raise_on_err=True)
LOG.info("Downloading the artifact {0}".format(log_file))