Add shared sl tests yaml
Change-Id: Ic9422d44e58e2ce5d08a6371a855b7e60f8766e2
Reviewed-on: https://review.gerrithub.io/377203
Reviewed-by: Tatyanka Leontovich <tleontovich@mirantis.com>
Tested-by: Tatyanka Leontovich <tleontovich@mirantis.com>
diff --git a/tcp_tests/managers/k8s/cluster.py b/tcp_tests/managers/k8s/cluster.py
index 424ab32..4bda03f 100644
--- a/tcp_tests/managers/k8s/cluster.py
+++ b/tcp_tests/managers/k8s/cluster.py
@@ -58,7 +58,7 @@
auth = base64.encodestring(auth_string.encode()).decode()[:-1]
auth = "Basic {}".format(auth)
self._client = api_client.ApiClient(
- '{schema}://{host}:{port}/'.format(
+ '{schema}://{host}:{port}'.format(
schema=schema, host=host, port=port))
self._client.set_default_header('Authorization', auth)
restcli_impl = self._client.RESTClient.IMPL
@@ -67,7 +67,7 @@
else:
self._client = api_client.ApiClient(
- '{schema}://{host}:{port}/'.format(
+ '{schema}://{host}:{port}'.format(
schema=schema, host=host, port=port))
self._api = apiv_api.ApivApi(self._client)
self._bapi = apisbatchv_api.ApisbatchvApi(self._client)
diff --git a/tcp_tests/managers/sl_manager.py b/tcp_tests/managers/sl_manager.py
index ccb6030..705816d 100644
--- a/tcp_tests/managers/sl_manager.py
+++ b/tcp_tests/managers/sl_manager.py
@@ -12,6 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
+import os
+
from tcp_tests.managers.execute_commands import ExecuteCommandsMixin
from tcp_tests.managers.clients.prometheus import prometheus_client
from tcp_tests import logger
@@ -76,3 +78,22 @@
tmp = line.split(':')
service_stat_dict.update({tmp[0]: tmp[1]})
return service_stat_dict
+
+ def run_sl_functional_tests(self, node_to_run, path_tests_to_run):
+ target_node_name = [node_name for node_name
+ in self.__underlay.node_names()
+ if node_to_run in node_name]
+ with self.__underlay.remote(node_name=target_node_name[0]) as node_remote:
+ cmd = "python -k {}".format(path_tests_to_run)
+ result = node_remote.execute(cmd)
+ LOG.debug("Test execution result is {}".format(result))
+ return result
+
+ def download_sl_test_report(self, stored_node, file_path):
+ target_node_name = [node_name for node_name
+ in self.__underlay.node_names()
+ if stored_node in node_name]
+ with self.__underlay.remote(node_name=target_node_name[0]) as r:
+ r.download(
+ destination=file_path,
+ target=os.getcwd())