Browse Source

Revert "Add new scenario test cases for live migration"

This reverts commit 5abcecdd52.

Reason for revert: It seems that those new tests introduced some
overload in the Tobiko's CI jobs and a lot of jobs were timing out.
So let's revert it for now to unblock the gate and later figure out
what to do with those tests.

Change-Id: Ife99da61540c3db620a52e30e9ff2b311ae763f2
changes/56/792156/3
Slawek Kaplonski 4 weeks ago
parent
commit
a655a71c7d
4 changed files with 13 additions and 50 deletions
  1. +1
    -1
      tobiko/common/_skip.py
  2. +0
    -1
      tobiko/openstack/nova/__init__.py
  3. +0
    -16
      tobiko/openstack/nova/_client.py
  4. +12
    -32
      tobiko/tests/scenario/nova/test_server.py

+ 1
- 1
tobiko/common/_skip.py View File

@ -29,7 +29,7 @@ SkipTarget = typing.Union[typing.Callable,
SkipDecorator = typing.Callable[[SkipTarget], SkipTarget]
def skip_test(reason: str) -> typing.NoReturn:
def skip_test(reason: str):
"""Interrupt test case execution marking it as skipped for given reason"""
raise SkipException(reason)


+ 0
- 1
tobiko/openstack/nova/__init__.py View File

@ -41,7 +41,6 @@ WaitForServerStatusTimeout = _client.WaitForServerStatusTimeout
shutoff_server = _client.shutoff_server
activate_server = _client.activate_server
ensure_server_status = _client.ensure_server_status
live_migrate_server = _client.live_migrate_server
migrate_server = _client.migrate_server
confirm_resize = _client.confirm_resize
reboot_server = _client.reboot_server


+ 0
- 16
tobiko/openstack/nova/_client.py View File

@ -150,22 +150,6 @@ def migrate_server(server: typing.Optional[ServerType] = None,
info=params)
def live_migrate_server(server: typing.Optional[ServerType] = None,
server_id: typing.Optional[str] = None,
host: typing.Optional[str] = None,
block_migration: typing.Union[str, bool] = True,
disk_over_commit: bool = False,
client: NovaClientType = None,
**params):
server_id = get_server_id(server=server, server_id=server_id)
LOG.debug(f"Start server live migration (server_id='{server_id}', "
f"host={host}, block_migration={block_migration}, "
f"disk_over_commit={disk_over_commit}, info={params})")
return nova_client(client).servers.live_migrate(
server=server_id, host=host, block_migration=block_migration,
disk_over_commit=disk_over_commit, **params)
def confirm_resize(server: typing.Optional[ServerType] = None,
server_id: typing.Optional[str] = None,
client: NovaClientType = None, **params):


+ 12
- 32
tobiko/tests/scenario/nova/test_server.py View File

@ -77,20 +77,19 @@ class MigrateServerStack(stacks.CirrosServerStackFixture):
class MigrateServerTest(testtools.TestCase):
stack = tobiko.required_setup_fixture(MigrateServerStack)
peer_stack = tobiko.required_setup_fixture(stacks.CirrosServerStackFixture)
def test_migrate_server(self, live=False):
def test_migrate_server(self):
"""Tests cold migration actually changes hypervisor
"""
server = self.setup_server()
initial_hypervisor = nova.get_server_hypervisor(server)
server = self.migrate_server(server, live=live)
server = self.migrate_server(server)
final_hypervisor = nova.get_server_hypervisor(server)
self.assertNotEqual(initial_hypervisor, final_hypervisor)
def test_migrate_server_with_host(self, live=False):
def test_migrate_server_with_host(self):
"""Tests cold migration actually ends on target hypervisor
"""
server = self.setup_server()
@ -100,49 +99,30 @@ class MigrateServerTest(testtools.TestCase):
target_hypervisor = hypervisor.hypervisor_hostname
break
else:
target_hypervisor = None
self.skipTest("Cannot find a valid hypervisor host to migrate "
"server to")
server = self.migrate_server(server=server, host=target_hypervisor,
live=live)
server = self.migrate_server(server=server, host=target_hypervisor)
final_hypervisor = nova.get_server_hypervisor(server)
self.assertEqual(target_hypervisor, final_hypervisor)
def test_live_migrate_server(self):
self.test_migrate_server(live=True)
def test_live_migrate_server_with_host(self):
self.test_migrate_server_with_host(live=True)
def setup_server(self):
server = self.stack.ensure_server_status('ACTIVE')
self.assertEqual('ACTIVE', server.status)
return server
def migrate_server(self, server, live=False, **params):
def migrate_server(self, server, **params):
self.assertEqual('ACTIVE', server.status)
nova.migrate_server(server, **params)
if live:
nova.live_migrate_server(server, **params)
server = nova.wait_for_server_status(
server, 'ACTIVE', transient_status=['MIGRATING'])
else:
nova.migrate_server(server, **params)
server = nova.wait_for_server_status(server, 'VERIFY_RESIZE')
self.assertEqual('VERIFY_RESIZE', server.status)
nova.confirm_resize(server)
server = nova.wait_for_server_status(server, 'VERIFY_RESIZE')
self.assertEqual('VERIFY_RESIZE', server.status)
nova.confirm_resize(server)
server = nova.wait_for_server_status(
server, 'ACTIVE', transient_status=['VERIFY_RESIZE'])
server = nova.wait_for_server_status(
server, 'ACTIVE', transient_status={'VERIFY_RESIZE'})
self.assertEqual('ACTIVE', server.status)
# wait until all VM fixed IPs are reachable
ping.assert_reachable_hosts(self.stack.list_fixed_ips(),
timeout=900.,
ssh_client=self.peer_stack.ssh_client)
# check floating IP is reachable
ping.assert_reachable_hosts([self.stack.floating_ip_address])
ping.ping_until_received(self.stack.ip_address).assert_replied()
return server

Loading…
Cancel
Save