Merge "Enable boot_option to be specified"
diff --git a/ironic_tempest_plugin/config.py b/ironic_tempest_plugin/config.py
index 004612a..5fc9333 100644
--- a/ironic_tempest_plugin/config.py
+++ b/ironic_tempest_plugin/config.py
@@ -143,7 +143,14 @@
"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 = [
diff --git a/ironic_tempest_plugin/tests/scenario/baremetal_standalone_manager.py b/ironic_tempest_plugin/tests/scenario/baremetal_standalone_manager.py
index 98e335d..eac82f3 100644
--- a/ironic_tempest_plugin/tests/scenario/baremetal_standalone_manager.py
+++ b/ironic_tempest_plugin/tests/scenario/baremetal_standalone_manager.py
@@ -37,6 +37,7 @@
image_ref = None
image_checksum = None
+ boot_option = None
@classmethod
def skip_checks(cls):
@@ -223,7 +224,8 @@
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 @@
: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 @@
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')
diff --git a/ironic_tempest_plugin/tests/scenario/ironic_standalone/test_basic_ops.py b/ironic_tempest_plugin/tests/scenario/ironic_standalone/test_basic_ops.py
index 45b5271..ecd4463 100644
--- a/ironic_tempest_plugin/tests/scenario/ironic_standalone/test_basic_ops.py
+++ b/ironic_tempest_plugin/tests/scenario/ironic_standalone/test_basic_ops.py
@@ -148,6 +148,7 @@
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 @@
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 @@
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