Use 'wait_for_external_config' for customizations
The following CRs provide new mechanism for customizations setup before master node bootstrap: https://review.openstack.org/#/c/214749/ https://review.openstack.org/#/c/225132/ This patch adjusts system tests to use 'wait_for_external_config' kernel parameter for customization of master node setup. Change-Id: Ie89f544b9747255f7a4e75d42367a629fada8dfd Related-bug: #1485626
This commit is contained in:
parent
9a2b38af3d
commit
96fb2bfb05
|
@ -250,13 +250,6 @@ class AdminActions(BaseActions):
|
|||
config = '/etc/fuel/astute.yaml'
|
||||
resolv = '/etc/resolv.conf'
|
||||
|
||||
# wait until fuelmenu fill the astute.yaml
|
||||
cmd = "fgrep 'dhcp_gateway' {0}".format(config)
|
||||
wait(lambda: not self.admin_remote.execute(cmd)['exit_code'], 60)
|
||||
# wait until fuelmenu is finished
|
||||
cmd = "ps -C fuelmenu"
|
||||
wait(lambda: self.admin_remote.execute(cmd)['exit_code'], 60)
|
||||
|
||||
cmd = ("sed -i 's/\"dhcp_gateway\":.*/\"dhcp_gateway\": \"{0}\"/' {1} "
|
||||
"&& sed -i 's/\\(\"DNS_UPSTREAM\":\\).*/\\1 \"{0}\"/' {1} &&"
|
||||
"sed -i 's/\\(nameserver\\) \\(.*\\)/\\1 {0} \\2/' {2}"
|
||||
|
|
|
@ -38,6 +38,7 @@ from fuelweb_test.helpers.fuel_actions import NailgunActions
|
|||
from fuelweb_test.helpers.fuel_actions import PostgresActions
|
||||
from fuelweb_test.helpers.fuel_actions import NessusActions
|
||||
from fuelweb_test.helpers.ntp import GroupNtpSync
|
||||
from fuelweb_test.helpers.utils import run_on_remote
|
||||
from fuelweb_test.helpers.utils import timestat
|
||||
from fuelweb_test.helpers import multiple_networks_hacks
|
||||
from fuelweb_test.models.fuel_web_client import FuelWebClient
|
||||
|
@ -146,7 +147,8 @@ class EnvironmentModel(object):
|
|||
settings.DNS_SUFFIX)),
|
||||
'nat_interface': self.d_env.nat_interface,
|
||||
'dns1': settings.DNS,
|
||||
'showmenu': 'yes' if custom else 'no',
|
||||
'showmenu': 'no',
|
||||
'wait_for_external_config': 'yes',
|
||||
'build_images': '1' if build_images else '0'
|
||||
}
|
||||
keys = ''
|
||||
|
@ -166,6 +168,7 @@ class EnvironmentModel(object):
|
|||
" hostname=%(hostname)s\n"
|
||||
" dhcp_interface=%(nat_interface)s\n"
|
||||
" showmenu=%(showmenu)s\n"
|
||||
" wait_for_external_config=%(wait_for_external_config)s\n"
|
||||
" build_images=%(build_images)s\n"
|
||||
" <Enter>\n"
|
||||
) % params
|
||||
|
@ -184,6 +187,7 @@ class EnvironmentModel(object):
|
|||
" hostname=%(hostname)s\n"
|
||||
" dhcp_interface=%(nat_interface)s\n"
|
||||
" showmenu=%(showmenu)s\n"
|
||||
" wait_for_external_config=%(wait_for_external_config)s\n"
|
||||
" build_images=%(build_images)s\n"
|
||||
" <Enter>\n"
|
||||
) % params
|
||||
|
@ -355,15 +359,18 @@ class EnvironmentModel(object):
|
|||
admin.send_keys(self.get_keys(admin, custom=custom,
|
||||
build_images=build_images,
|
||||
iso_connect_as=iso_connect_as))
|
||||
self.wait_for_provisioning()
|
||||
self.wait_for_external_config()
|
||||
if custom:
|
||||
self.setup_customisation()
|
||||
if security:
|
||||
nessus_node = NessusActions(self.d_env)
|
||||
nessus_node.add_nessus_node()
|
||||
# wait while installation complete
|
||||
admin.await(self.d_env.admin_net, timeout=10 * 60)
|
||||
|
||||
self.set_admin_ssh_password()
|
||||
self.admin_actions.modify_configs(self.d_env.router())
|
||||
self.kill_wait_for_external_config()
|
||||
self.wait_bootstrap()
|
||||
self.docker_actions.wait_for_ready_containers()
|
||||
time.sleep(10)
|
||||
|
@ -404,21 +411,31 @@ class EnvironmentModel(object):
|
|||
|
||||
@update_packages
|
||||
@upload_manifests
|
||||
def wait_for_provisioning(self):
|
||||
def setup_customisation(self):
|
||||
logger.info('Installing custom packages/manifests '
|
||||
'before master node bootstrap...')
|
||||
|
||||
@logwrap
|
||||
def wait_for_provisioning(self, timeout=10 * 60):
|
||||
_wait(lambda: _tcp_ping(
|
||||
self.d_env.nodes(
|
||||
).admin.get_ip_address_by_network_name
|
||||
(self.d_env.admin_net), 22), timeout=7 * 60)
|
||||
(self.d_env.admin_net), 22), timeout=timeout)
|
||||
|
||||
def setup_customisation(self):
|
||||
self.wait_for_provisioning()
|
||||
try:
|
||||
cmd = "pkill -sigusr1 -f '^.*/fuelmenu$'"
|
||||
with self.d_env.get_admin_remote() as remote:
|
||||
wait(lambda: remote.execute(cmd)['exit_code'] == 0, timeout=60)
|
||||
except Exception:
|
||||
logger.error("Could not kill process of fuelmenu")
|
||||
raise
|
||||
@logwrap
|
||||
def wait_for_external_config(self, timeout=120):
|
||||
check_cmd = 'pkill -0 -f wait_for_external_config'
|
||||
with self.d_env.get_admin_remote() as remote:
|
||||
wait(lambda: remote.execute(check_cmd)['exit_code'] == 0,
|
||||
timeout=timeout)
|
||||
|
||||
@logwrap
|
||||
def kill_wait_for_external_config(self):
|
||||
kill_cmd = 'pkill -f "^wait_for_external_config"'
|
||||
check_cmd = 'pkill -0 -f "^wait_for_external_config"; [[ $? -eq 1 ]]'
|
||||
with self.d_env.get_admin_remote() as remote:
|
||||
run_on_remote(remote, kill_cmd)
|
||||
run_on_remote(remote, check_cmd)
|
||||
|
||||
@retry(count=3, delay=60)
|
||||
def sync_time(self, nailgun_nodes=[]):
|
||||
|
|
|
@ -118,9 +118,9 @@ class SetupEnvironment(TestBasic):
|
|||
"""Setup master node with custom manifests
|
||||
Scenario:
|
||||
1. Start installation of master
|
||||
2. Enter "fuelmenu"
|
||||
2. Enable option 'wait_for_external_config'
|
||||
3. Upload custom manifests
|
||||
4. Kill "fuelmenu" pid
|
||||
4. Kill 'wait_for_external_config' countdown
|
||||
Snapshot: empty_custom_manifests
|
||||
|
||||
Duration 20m
|
||||
|
|
Loading…
Reference in New Issue