Merge "Enable boot_option to be specified"
This commit is contained in:
commit
0cbe05eff6
@ -143,7 +143,14 @@ BaremetalGroup = [
|
||||
"as instance_info/root_gb value."),
|
||||
cfg.IntOpt('available_nodes', min=0, default=None,
|
||||
help="The number of baremetal hosts available to use for "
|
||||
"the tests.")
|
||||
"the tests."),
|
||||
cfg.BoolOpt('partition_netboot',
|
||||
default=True,
|
||||
help="Treat partition images as netbooted as opposed to "
|
||||
"attempting to populate a boot loader. IF cirros is "
|
||||
"being used, this option should be set to True as "
|
||||
"it lacks the needed components to make it locally "
|
||||
"from a partition image."),
|
||||
]
|
||||
|
||||
BaremetalFeaturesGroup = [
|
||||
|
@ -37,6 +37,7 @@ class BaremetalStandaloneManager(bm.BaremetalScenarioTest,
|
||||
|
||||
image_ref = None
|
||||
image_checksum = None
|
||||
boot_option = None
|
||||
|
||||
@classmethod
|
||||
def skip_checks(cls):
|
||||
@ -223,7 +224,8 @@ class BaremetalStandaloneManager(bm.BaremetalScenarioTest,
|
||||
return nodes[0]
|
||||
|
||||
@classmethod
|
||||
def boot_node(cls, image_ref=None, image_checksum=None):
|
||||
def boot_node(cls, image_ref=None, image_checksum=None,
|
||||
boot_option=None):
|
||||
"""Boot ironic node.
|
||||
|
||||
The following actions are executed:
|
||||
@ -236,11 +238,16 @@ class BaremetalStandaloneManager(bm.BaremetalScenarioTest,
|
||||
:param image_ref: Reference to user image to boot node with.
|
||||
:param image_checksum: md5sum of image specified in image_ref.
|
||||
Needed only when direct HTTP link is provided.
|
||||
:param boot_option: The defaut boot option to utilize. If not
|
||||
specified, the ironic deployment default shall
|
||||
be utilized.
|
||||
"""
|
||||
if image_ref is None:
|
||||
image_ref = cls.image_ref
|
||||
if image_checksum is None:
|
||||
image_checksum = cls.image_checksum
|
||||
if boot_option is None:
|
||||
boot_option = cls.boot_option
|
||||
|
||||
network, subnet, router = cls.create_networks()
|
||||
n_port = cls.create_neutron_port(network_id=network['id'])
|
||||
@ -255,6 +262,11 @@ class BaremetalStandaloneManager(bm.BaremetalScenarioTest,
|
||||
patch.append({'path': '/instance_info/root_gb',
|
||||
'op': 'add',
|
||||
'value': CONF.baremetal.adjusted_root_disk_size_gb})
|
||||
|
||||
if boot_option:
|
||||
patch.append({'path': '/instance_info/capabilities',
|
||||
'op': 'add',
|
||||
'value': {'boot_option': boot_option}})
|
||||
# TODO(vsaienko) add testing for custom configdrive
|
||||
cls.update_node(cls.node['uuid'], patch=patch)
|
||||
cls.set_node_provision_state(cls.node['uuid'], 'active')
|
||||
|
@ -148,6 +148,7 @@ class BaremetalIpmiIscsiPartitioned(bsm.BaremetalStandaloneScenarioTest):
|
||||
deploy_interface = 'iscsi'
|
||||
image_ref = CONF.baremetal.partition_image_ref
|
||||
wholedisk_image = False
|
||||
boot_option = 'netboot' if CONF.baremetal.partition_netboot else 'local'
|
||||
|
||||
@decorators.idempotent_id('7d0b205e-edbc-4e2d-9f6d-95cd74eefecb')
|
||||
@utils.services('image', 'network')
|
||||
@ -162,6 +163,7 @@ class BaremetalIpmiDirectPartitioned(bsm.BaremetalStandaloneScenarioTest):
|
||||
deploy_interface = 'direct'
|
||||
image_ref = CONF.baremetal.partition_image_ref
|
||||
wholedisk_image = False
|
||||
boot_option = 'netboot' if CONF.baremetal.partition_netboot else 'local'
|
||||
|
||||
@decorators.idempotent_id('7b4b2dcd-2bbb-44f5-991f-0964300af6b7')
|
||||
@utils.services('image', 'network')
|
||||
@ -219,6 +221,7 @@ class BaremetalIpmiRescuePartitioned(bsm.BaremetalStandaloneScenarioTest):
|
||||
rescue_interface = 'agent'
|
||||
image_ref = CONF.baremetal.partition_image_ref
|
||||
wholedisk_image = False
|
||||
boot_option = 'netboot' if CONF.baremetal.partition_netboot else 'local'
|
||||
|
||||
# NOTE(jroll) the ansible deploy interface doesn't support partition images
|
||||
# with netboot mode. Since that's what is happening here, explicitly choose
|
||||
|
Loading…
Reference in New Issue
Block a user