Allow to pass default interface values to tempest
In case any of those are set in ironic, test that resets interfaces
might fail.
Closes-issue: https://mirantis.jira.com/browse/PRODX-9563
Change-Id: I6f07e25644a92ccac169f84f7c79696d21b58e76
(cherry picked from commit 675c7c0109c8d83f1d8de9b3d28b0e93dd900595)
(cherry picked from commit 2b3bba75492cd93c2140b8e78c4d8fb405486693)
(cherry picked from commit dcb729692f0fd8a804506ba358c9fa2f5c680e3f)
diff --git a/ironic_tempest_plugin/config.py b/ironic_tempest_plugin/config.py
index acf2542..667dc54 100644
--- a/ironic_tempest_plugin/config.py
+++ b/ironic_tempest_plugin/config.py
@@ -18,6 +18,10 @@
from tempest import config # noqa
+_DEFAULT_IFACE_HELP = ('Default {0} interface to be used for nodes that '
+ 'do not have {0}_interface field set.')
+
+
# NOTE(TheJulia): The following options are loaded into a tempest
# plugin configuration option via plugin.py.
ironic_service_option = cfg.BoolOpt('ironic',
@@ -153,8 +157,30 @@
cfg.ListOpt('enabled_raid_interfaces',
default=['no-raid', 'agent'],
help="List of Ironic enabled RAID interfaces."),
+ cfg.StrOpt('default_bios_interface',
+ help=_DEFAULT_IFACE_HELP.format('bios')),
+ cfg.StrOpt('default_boot_interface',
+ help=_DEFAULT_IFACE_HELP.format('boot')),
+ cfg.StrOpt('default_console_interface',
+ help=_DEFAULT_IFACE_HELP.format('console')),
+ cfg.StrOpt('default_deploy_interface',
+ help=_DEFAULT_IFACE_HELP.format('deploy')),
+ cfg.StrOpt('default_inspect_interface',
+ help=_DEFAULT_IFACE_HELP.format('inspect')),
+ cfg.StrOpt('default_management_interface',
+ help=_DEFAULT_IFACE_HELP.format('management')),
+ cfg.StrOpt('default_network_interface',
+ help=_DEFAULT_IFACE_HELP.format('network')),
+ cfg.StrOpt('default_power_interface',
+ help=_DEFAULT_IFACE_HELP.format('power')),
+ cfg.StrOpt('default_raid_interface',
+ help=_DEFAULT_IFACE_HELP.format('raid')),
cfg.StrOpt('default_rescue_interface',
- help="Ironic default rescue interface."),
+ help=_DEFAULT_IFACE_HELP.format('rescue')),
+ cfg.StrOpt('default_storage_interface',
+ help=_DEFAULT_IFACE_HELP.format('storage')),
+ cfg.StrOpt('default_vendor_interface',
+ help=_DEFAULT_IFACE_HELP.format('vendor')),
cfg.IntOpt('adjusted_root_disk_size_gb',
min=0,
help="Ironic adjusted disk size to use in the standalone tests "
diff --git a/ironic_tempest_plugin/tests/api/admin/test_nodes.py b/ironic_tempest_plugin/tests/api/admin/test_nodes.py
index 85c31e0..be64035 100644
--- a/ironic_tempest_plugin/tests/api/admin/test_nodes.py
+++ b/ironic_tempest_plugin/tests/api/admin/test_nodes.py
@@ -472,7 +472,10 @@
[{'path': '/%s' % field,
'op': 'remove'}])
_, node = self.client.show_node(self.node['uuid'])
- self.assertEqual('fake', node[field])
+ default_iface_option = getattr(
+ CONF.baremetal, 'default_%s_interface' % iface)
+ expected_value = default_iface_option or 'fake'
+ self.assertEqual(expected_value, node[field])
class TestResetInterfaces(TestHardwareInterfaces):