From 4f486061a9e44f4e2993cd12199d96f873ef7f9e Mon Sep 17 00:00:00 2001 From: Alexandr Kostrikov Date: Tue, 25 Oct 2016 18:44:01 +0300 Subject: [PATCH] Add reset of admin node after hang The first hang can be fixed with reset. If any other errors appear on that stage, the error should not be tolerated. Change-Id: I056879a89cb3cfab45852573730f0ced58043511 Closes-bug: 1587411 --- fuelweb_test/models/environment.py | 35 ++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/fuelweb_test/models/environment.py b/fuelweb_test/models/environment.py index 7e7376e11..4b3e11a1d 100644 --- a/fuelweb_test/models/environment.py +++ b/fuelweb_test/models/environment.py @@ -413,18 +413,29 @@ class EnvironmentModel(six.with_metaclass(SingletonMeta, object)): admin = self.d_env.nodes().admin self.d_env.start([admin]) - logger.info("Waiting for admin node to start up") - wait(lambda: admin.driver.node_active(admin), 60, - timeout_msg='Admin node startup timeout') - logger.info("Proceed with installation") - # update network parameters at boot screen - admin.send_keys(self.get_keys(admin, custom=custom, - build_images=build_images, - iso_connect_as=iso_connect_as)) - if settings.SHOW_FUELMENU: - self.wait_for_fuelmenu() - else: - self.wait_for_provisioning() + def provision_admin(admin_node): + logger.info("Waiting for admin node to start up") + wait(lambda: admin.driver.node_active(admin_node), 60, + timeout_msg='Admin node startup timeout') + logger.info("Proceed with installation") + # update network parameters at boot screen + admin_node.send_keys(self.get_keys( + admin_node, + custom=custom, + build_images=build_images, + iso_connect_as=iso_connect_as)) + if settings.SHOW_FUELMENU: + self.wait_for_fuelmenu() + else: + self.wait_for_provisioning() + + try: + provision_admin(admin) + except Exception as e: + logger.info('Master node restart: LP1587411') + logger.info('Exception is: {e}'.format(e=e)) + admin.reset() + provision_admin(admin) self.set_admin_ssh_password()