Merge "Log server console output during create/get timestamp"
This commit is contained in:
commit
25572c3b55
@ -646,9 +646,10 @@ class ScenarioTest(tempest.test.BaseTestCase):
|
||||
return floating_ip
|
||||
|
||||
def create_timestamp(self, ip_address, dev_name=None, mount_path='/mnt',
|
||||
private_key=None):
|
||||
private_key=None, server=None):
|
||||
ssh_client = self.get_remote_client(ip_address,
|
||||
private_key=private_key)
|
||||
private_key=private_key,
|
||||
server=server)
|
||||
if dev_name is not None:
|
||||
ssh_client.make_fs(dev_name)
|
||||
ssh_client.exec_command('sudo mount /dev/%s %s' % (dev_name,
|
||||
@ -662,9 +663,10 @@ class ScenarioTest(tempest.test.BaseTestCase):
|
||||
return timestamp
|
||||
|
||||
def get_timestamp(self, ip_address, dev_name=None, mount_path='/mnt',
|
||||
private_key=None):
|
||||
private_key=None, server=None):
|
||||
ssh_client = self.get_remote_client(ip_address,
|
||||
private_key=private_key)
|
||||
private_key=private_key,
|
||||
server=server)
|
||||
if dev_name is not None:
|
||||
ssh_client.mount(dev_name, mount_path)
|
||||
timestamp = ssh_client.exec_command('sudo cat %s/timestamp'
|
||||
|
@ -63,7 +63,8 @@ class TestShelveInstance(manager.ScenarioTest):
|
||||
|
||||
instance_ip = self.get_server_ip(server)
|
||||
timestamp = self.create_timestamp(instance_ip,
|
||||
private_key=keypair['private_key'])
|
||||
private_key=keypair['private_key'],
|
||||
server=server)
|
||||
|
||||
# Prevent bug #1257594 from coming back
|
||||
# Unshelve used to boot the instance with the original image, not
|
||||
@ -71,7 +72,8 @@ class TestShelveInstance(manager.ScenarioTest):
|
||||
self._shelve_then_unshelve_server(server)
|
||||
|
||||
timestamp2 = self.get_timestamp(instance_ip,
|
||||
private_key=keypair['private_key'])
|
||||
private_key=keypair['private_key'],
|
||||
server=server)
|
||||
self.assertEqual(timestamp, timestamp2)
|
||||
|
||||
@decorators.attr(type='slow')
|
||||
|
@ -57,7 +57,8 @@ class TestSnapshotPattern(manager.ScenarioTest):
|
||||
|
||||
instance_ip = self.get_server_ip(server)
|
||||
timestamp = self.create_timestamp(instance_ip,
|
||||
private_key=keypair['private_key'])
|
||||
private_key=keypair['private_key'],
|
||||
server=server)
|
||||
|
||||
# snapshot the instance
|
||||
snapshot_image = self.create_server_snapshot(server=server)
|
||||
@ -71,5 +72,6 @@ class TestSnapshotPattern(manager.ScenarioTest):
|
||||
# check the existence of the timestamp file in the second instance
|
||||
server_from_snapshot_ip = self.get_server_ip(server_from_snapshot)
|
||||
timestamp2 = self.get_timestamp(server_from_snapshot_ip,
|
||||
private_key=keypair['private_key'])
|
||||
private_key=keypair['private_key'],
|
||||
server=server_from_snapshot)
|
||||
self.assertEqual(timestamp, timestamp2)
|
||||
|
@ -96,7 +96,8 @@ class TestStampPattern(manager.ScenarioTest):
|
||||
keypair['private_key'])
|
||||
timestamp = self.create_timestamp(ip_for_server,
|
||||
CONF.compute.volume_device_name,
|
||||
private_key=keypair['private_key'])
|
||||
private_key=keypair['private_key'],
|
||||
server=server)
|
||||
self.nova_volume_detach(server, volume)
|
||||
|
||||
# snapshot the volume
|
||||
@ -126,5 +127,6 @@ class TestStampPattern(manager.ScenarioTest):
|
||||
# check the existence of the timestamp file in the volume2
|
||||
timestamp2 = self.get_timestamp(ip_for_snapshot,
|
||||
CONF.compute.volume_device_name,
|
||||
private_key=keypair['private_key'])
|
||||
private_key=keypair['private_key'],
|
||||
server=server_from_snapshot)
|
||||
self.assertEqual(timestamp, timestamp2)
|
||||
|
@ -108,7 +108,8 @@ class TestVolumeBootPattern(manager.EncryptionScenarioTest):
|
||||
LOG.info("Setting timestamp in instance %s", instance_1st)
|
||||
ip_instance_1st = self.get_server_ip(instance_1st)
|
||||
timestamp = self.create_timestamp(ip_instance_1st,
|
||||
private_key=keypair['private_key'])
|
||||
private_key=keypair['private_key'],
|
||||
server=instance_1st)
|
||||
|
||||
# delete instance
|
||||
LOG.info("Deleting first instance: %s", instance_1st)
|
||||
@ -126,7 +127,8 @@ class TestVolumeBootPattern(manager.EncryptionScenarioTest):
|
||||
LOG.info("Getting timestamp in instance %s", instance_2nd)
|
||||
ip_instance_2nd = self.get_server_ip(instance_2nd)
|
||||
timestamp2 = self.get_timestamp(ip_instance_2nd,
|
||||
private_key=keypair['private_key'])
|
||||
private_key=keypair['private_key'],
|
||||
server=instance_2nd)
|
||||
self.assertEqual(timestamp, timestamp2)
|
||||
|
||||
# snapshot a volume
|
||||
@ -150,7 +152,8 @@ class TestVolumeBootPattern(manager.EncryptionScenarioTest):
|
||||
server_from_snapshot)
|
||||
server_from_snapshot_ip = self.get_server_ip(server_from_snapshot)
|
||||
timestamp3 = self.get_timestamp(server_from_snapshot_ip,
|
||||
private_key=keypair['private_key'])
|
||||
private_key=keypair['private_key'],
|
||||
server=server_from_snapshot)
|
||||
self.assertEqual(timestamp, timestamp3)
|
||||
|
||||
@decorators.idempotent_id('05795fb2-b2a7-4c9f-8fac-ff25aedb1489')
|
||||
|
@ -114,7 +114,8 @@ class TestVolumeMigrateRetypeAttached(manager.ScenarioTest):
|
||||
LOG.info("Setting timestamp in instance %s", instance['id'])
|
||||
ip_instance = self.get_server_ip(instance)
|
||||
timestamp = self.create_timestamp(ip_instance,
|
||||
private_key=keypair['private_key'])
|
||||
private_key=keypair['private_key'],
|
||||
server=instance)
|
||||
|
||||
# retype volume with migration from backend #1 to backend #2
|
||||
LOG.info("Retyping Volume %s to new type %s", volume_origin['id'],
|
||||
@ -125,5 +126,6 @@ class TestVolumeMigrateRetypeAttached(manager.ScenarioTest):
|
||||
LOG.info("Getting timestamp in postmigrated instance %s",
|
||||
instance['id'])
|
||||
timestamp2 = self.get_timestamp(ip_instance,
|
||||
private_key=keypair['private_key'])
|
||||
private_key=keypair['private_key'],
|
||||
server=instance)
|
||||
self.assertEqual(timestamp, timestamp2)
|
||||
|
Loading…
x
Reference in New Issue
Block a user