Merge "Allow kwargs in create_timestamp"

This commit is contained in:
Zuul 2020-11-26 22:40:35 +00:00 committed by Gerrit Code Review
commit 2852123abd
1 changed files with 6 additions and 4 deletions

View File

@ -830,18 +830,20 @@ class ScenarioTest(tempest.test.BaseTestCase):
return floating_ip
def create_timestamp(self, ip_address, dev_name=None, mount_path='/mnt',
private_key=None, server=None):
private_key=None, server=None, username=None,
fs='ext4'):
"""Creates timestamp
This wrapper utility does ssh, creates timestamp and returns the
created timestamp.
"""
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.make_fs(dev_name)
ssh_client.make_fs(dev_name, fs=fs)
ssh_client.exec_command('sudo mount /dev/%s %s' % (dev_name,
mount_path))
cmd_timestamp = 'sudo sh -c "date > %s/timestamp; sync"' % mount_path