Switch to use exec_command instead of mount/umount

Both mount and umount are internal methods on Tempest side and these
methods need to be cleaned up for avoiding deep stacktrace.
The commit I914b09e0b242fbfba92cf35341941e5426c623eb will remove these
methods, so this patch is helpful for avoiding the gate issue.

Change-Id: Ia540d0b4a6da0e9bf0180dfcafe34c60499a4356
This commit is contained in:
Ken'ichi Ohmichi 2017-03-07 11:24:02 -08:00
parent 1fbfd3c065
commit 935afa35eb

@ -635,13 +635,14 @@ class ScenarioTest(tempest.test.BaseTestCase):
private_key=private_key)
if dev_name is not None:
ssh_client.make_fs(dev_name)
ssh_client.mount(dev_name, mount_path)
ssh_client.exec_command('sudo mount /dev/%s %s' % (dev_name,
mount_path))
cmd_timestamp = 'sudo sh -c "date > %s/timestamp; sync"' % mount_path
ssh_client.exec_command(cmd_timestamp)
timestamp = ssh_client.exec_command('sudo cat %s/timestamp'
% mount_path)
if dev_name is not None:
ssh_client.umount(mount_path)
ssh_client.exec_command('sudo umount %s' % mount_path)
return timestamp
def get_timestamp(self, ip_address, dev_name=None, mount_path='/mnt',
@ -649,11 +650,12 @@ class ScenarioTest(tempest.test.BaseTestCase):
ssh_client = self.get_remote_client(ip_address,
private_key=private_key)
if dev_name is not None:
ssh_client.mount(dev_name, mount_path)
ssh_client.exec_command('sudo mount /dev/%s %s' % (dev_name,
mount_path))
timestamp = ssh_client.exec_command('sudo cat %s/timestamp'
% mount_path)
if dev_name is not None:
ssh_client.umount(mount_path)
ssh_client.exec_command('sudo umount %s' % mount_path)
return timestamp
def get_server_ip(self, server):