Browse Source

Refactor finding flag of finishing migrate process

Change-Id: I17d37d7604aee4d5efae7fa4123621f0c2c630d4
Partial-Bug: #1576276
Partial-Bug: #1603488
changes/49/344649/2
zatserklyany 6 years ago
committed by vrovachev
parent
commit
2ef2befa5a
  1. 57
      system_test/tests/test_fuel_migration.py

57
system_test/tests/test_fuel_migration.py

@ -18,7 +18,6 @@ from proboscis import factory
from proboscis.asserts import assert_equal
from fuelweb_test import logger
from fuelweb_test.helpers import checkers
from system_test.helpers.decorators import action
from system_test.helpers.decorators import deferred_decorator
from system_test.helpers.decorators import make_snapshot_if_step_fail
@ -86,48 +85,50 @@ class FuelMasterMigrate(ActionsBase, FuelMasterActions):
def check_migration_status(self):
"""Check periodically the status of Fuel Master migration process"""
with self.env.d_env.get_admin_remote() as remote:
checkers.wait_phrase_in_log(
remote, 60 * 60, interval=0.2,
phrase='Rebooting to begin the data sync process',
log_path='/var/log/fuel-migrate.log')
logger.info(
'Rebooting to begin the data sync process for fuel migrate')
logger.info('First reboot of Master node...')
logger.info('Wait for Master node become offline')
wait(lambda: not icmp_ping(self.env.get_admin_node_ip()),
timeout=60 * 15, timeout_msg='Master node has not become offline '
'after starting reboot')
timeout=60 * 10,
timeout_msg='Master node did not become offline')
logger.info('Wait for echo from Master node')
wait(lambda: icmp_ping(self.env.get_admin_node_ip()),
timeout=60 * 15, timeout_msg='Master node has not become online '
'after rebooting')
timeout=60 * 10,
timeout_msg='Master node did not respond after reboot')
logger.info('Wait for Master node become online')
self.env.d_env.nodes().admin.await(
network_name=self.env.d_env.admin_net,
timeout=60 * 15)
timeout=60 * 10)
with self.env.d_env.get_admin_remote() as remote:
checkers.wait_phrase_in_log(
remote, 60 * 90, interval=0.1,
phrase='Stop network and up with new settings',
log_path='/var/log/fuel-migrate.log')
logger.info('Shutting down network')
logger.info('Second reboot of Master node...')
logger.info('Wait for Master node become offline')
wait(lambda: not icmp_ping(self.env.get_admin_node_ip()),
timeout=60 * 15, interval=0.1,
timeout_msg='Master node has not become offline on '
'shutting network down')
timeout=60 * 40,
timeout_msg='Master node did not become offline')
logger.info('Wait for echo from Master node')
wait(lambda: icmp_ping(self.env.get_admin_node_ip()),
timeout=60 * 15,
timeout_msg='Master node has not become online after '
'shutting network down')
timeout=60 * 10,
timeout_msg='Master node did not respond after reboot')
logger.info('Wait for Master node become online')
self.env.d_env.nodes().admin.await(
network_name=self.env.d_env.admin_net,
timeout=60 * 10)
logger.info("Wait for file 'migration-done' appears")
with self.env.d_env.get_admin_remote() as remote:
wait(lambda: not remote.exists("/notready"),
timeout=900,
timeout_msg=("File wasn't removed in 900 sec"))
wait(lambda: remote.exists("/tmp/migration-done"),
timeout=60 * 10,
timeout_msg="File /tmp/migration-done wasn't appeared")
logger.info("Migration complete!")
logger.info("Wait for Slave nodes become online")
self.fuel_web.wait_nodes_get_online_state(
self.env.d_env.nodes().slaves[:2], timeout=60 * 20)
@factory

Loading…
Cancel
Save