From 2c230eb21ae5d5912a991c10ed2a8f747808b507 Mon Sep 17 00:00:00 2001 From: Lukas Piwowarski Date: Fri, 30 Oct 2020 10:09:18 +0000 Subject: [PATCH] Allow kwargs in get_timestamp As a part of the scenario/manager.py stabilization tracked by the below BP the patch adds kwargs argument to support username parameter of get_remote_client() method. Change-Id: I8e0da8b19b2b0b147b36c392fa4e161115325cd7 Implements: blueprint tempest-scenario-manager-stable --- tempest/scenario/manager.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py index ff860d5b90..df53a85e9f 100644 --- a/tempest/scenario/manager.py +++ b/tempest/scenario/manager.py @@ -848,15 +848,25 @@ class ScenarioTest(tempest.test.BaseTestCase): return timestamp def get_timestamp(self, ip_address, dev_name=None, mount_path='/mnt', - private_key=None, server=None): + private_key=None, server=None, username=None): """Returns timestamp This wrapper utility does ssh and returns the timestamp. + + :param ip_address: The floating IP or fixed IP of the remote server + :param dev_name: Name of the device that stores the timestamp + :param mount_path: Path which should be used as mount point for + dev_name + :param private_key: The SSH private key to use for authentication + :param server: Server dict, used for debugging purposes + :param username: Name of the Linux account on the remote server """ ssh_client = self.get_remote_client(ip_address, private_key=private_key, - server=server) + server=server, + username=username) + if dev_name is not None: ssh_client.mount(dev_name, mount_path) timestamp = ssh_client.exec_command('sudo cat %s/timestamp'