Use MaaS in system tests
Change-Id: Ibaa90ab8a5f290c2a076976243ec0d2511ce8295
diff --git a/tcp_tests/managers/envmanager_devops.py b/tcp_tests/managers/envmanager_devops.py
index 1e7f66c..d17c6bd 100644
--- a/tcp_tests/managers/envmanager_devops.py
+++ b/tcp_tests/managers/envmanager_devops.py
@@ -25,12 +25,12 @@
AuthenticationException,
BadAuthenticationType)
-from tcp_tests.helpers import env_config
-from tcp_tests.helpers import exceptions
-from tcp_tests.helpers import ext
-from tcp_tests import logger
from tcp_tests import settings
from tcp_tests import settings_oslo
+from tcp_tests.helpers import env_config
+from tcp_tests.helpers import ext
+from tcp_tests.helpers import exceptions
+from tcp_tests import logger
LOG = logger.logger
diff --git a/tcp_tests/managers/saltmanager.py b/tcp_tests/managers/saltmanager.py
index 2b06dc3..b5d5f04 100644
--- a/tcp_tests/managers/saltmanager.py
+++ b/tcp_tests/managers/saltmanager.py
@@ -19,8 +19,8 @@
from datetime import datetime
from pepper import libpepper
from tcp_tests.helpers import utils
-from tcp_tests import settings
from tcp_tests import logger
+from tcp_tests import settings
from tcp_tests.managers.execute_commands import ExecuteCommandsMixin
LOG = logger.logger
@@ -234,7 +234,7 @@
self.__api = None
self.run_state(
tgt,
- 'cmd.run', 'service ntp stop; ntpd -gq; service ntp start')
+ 'cmd.run', 'service ntp stop; if [ -x /usr/sbin/ntpdate ]; then ntpdate -s ntp.ubuntu.com; else ntpd -gq ; fi; service ntp start') # noqa
new_time_res = self.run_state(tgt, 'cmd.run', 'date')
for node_name, time in sorted(new_time_res[0]['return'][0].items()):
LOG.info("{0}: {1}".format(node_name, time))
diff --git a/tcp_tests/managers/underlay_ssh_manager.py b/tcp_tests/managers/underlay_ssh_manager.py
index 2c9ed55..5f919ce 100644
--- a/tcp_tests/managers/underlay_ssh_manager.py
+++ b/tcp_tests/managers/underlay_ssh_manager.py
@@ -236,7 +236,8 @@
address_pool=address_pool)
return ssh_data['host']
- def remote(self, node_name=None, host=None, address_pool=None):
+ def remote(self, node_name=None, host=None, address_pool=None,
+ username=None):
"""Get SSHClient by a node name or hostname.
One of the following arguments should be specified:
@@ -249,7 +250,7 @@
ssh_data = self.__ssh_data(node_name=node_name, host=host,
address_pool=address_pool)
ssh_auth = ssh_client.SSHAuth(
- username=ssh_data['login'],
+ username=username or ssh_data['login'],
password=ssh_data['password'],
keys=[rsakey.RSAKey(file_obj=StringIO.StringIO(key))
for key in ssh_data['keys']])