From 9f4c5d84873272c3f43e7974c6e772159e10f1ba Mon Sep 17 00:00:00 2001 From: Artem Panchenko Date: Sun, 13 Dec 2015 18:16:12 +0200 Subject: [PATCH] Check bootstrap image after Fuel installation Add check in tests that bootstrap image is successfully built and activated, so slave nodes could be booted via PXE. Related-bug: #1524855 Change-Id: I88a8be8f0c906780711438ea6667aa2051220008 --- fuelweb_test/models/environment.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/fuelweb_test/models/environment.py b/fuelweb_test/models/environment.py index 00504786f..cee31519b 100644 --- a/fuelweb_test/models/environment.py +++ b/fuelweb_test/models/environment.py @@ -569,6 +569,7 @@ class EnvironmentModel(object): "complete' '%s'" % log_path)['exit_code'] if result != 0: raise Exception('Fuel node deployment failed.') + self.bootstrap_image_check() def dhcrelay_check(self): # CentOS 7 is pretty stable with admin iface. @@ -584,6 +585,20 @@ class EnvironmentModel(object): assert_true(self.get_admin_node_ip() in "".join(out), "dhcpcheck doesn't discover master ip") + def bootstrap_image_check(self): + fuel_settings = self.admin_actions.get_fuel_settings() + if fuel_settings['BOOTSTRAP']['flavor'].lower() != 'ubuntu': + logger.warning('Default image for bootstrap ' + 'is not based on Ubuntu!') + return + with self.d_env.get_admin_remote() as admin_remote: + cmd = 'fuel-bootstrap --quiet list' + bootstrap_images = run_on_remote(admin_remote, cmd) + assert_true(any('active' in line for line in bootstrap_images), + 'Ubuntu bootstrap image wasn\'t built and activated! ' + 'See logs in /var/log/fuel-bootstrap-image-build.log ' + 'for details.') + def admin_install_pkg(self, pkg_name): """Install a package on the admin node""" with self.d_env.get_admin_remote() as remote: