Merge "Remove six"
diff --git a/ironic_tempest_plugin/config.py b/ironic_tempest_plugin/config.py
index acf2542..d5c1ebf 100644
--- a/ironic_tempest_plugin/config.py
+++ b/ironic_tempest_plugin/config.py
@@ -1,6 +1,8 @@
# Copyright 2015 NEC Corporation
# All Rights Reserved.
#
+# Copyright (c) 2022 Dell Inc. or its subsidiaries.
+#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
@@ -153,6 +155,12 @@
cfg.ListOpt('enabled_raid_interfaces',
default=['no-raid', 'agent'],
help="List of Ironic enabled RAID interfaces."),
+ cfg.ListOpt('enabled_management_interfaces',
+ default=['fake', 'ipmitool', 'noop'],
+ help="List of Ironic enabled management interfaces."),
+ cfg.ListOpt('enabled_power_interfaces',
+ default=['fake', 'ipmitool'],
+ help="List of Ironic enabled power interfaces."),
cfg.StrOpt('default_rescue_interface',
help="Ironic default rescue interface."),
cfg.IntOpt('adjusted_root_disk_size_gb',
diff --git a/ironic_tempest_plugin/tests/scenario/baremetal_standalone_manager.py b/ironic_tempest_plugin/tests/scenario/baremetal_standalone_manager.py
index 176f912..da7db4c 100644
--- a/ironic_tempest_plugin/tests/scenario/baremetal_standalone_manager.py
+++ b/ironic_tempest_plugin/tests/scenario/baremetal_standalone_manager.py
@@ -1,6 +1,8 @@
#
# Copyright 2017 Mirantis Inc.
#
+# Copyright (c) 2022 Dell Inc. or its subsidiaries.
+#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
@@ -451,6 +453,18 @@
# set via a different test).
raid_interface = None
+ # The management interface to use by the HW type. The management interface
+ # of the node used in the test will be set to this value. If set to None,
+ # the node will retain its existing management_interface value (which may
+ # have been set via a different test).
+ management_interface = None
+
+ # The power interface to use by the HW type. The power interface of the
+ # node used in the test will be set to this value. If set to None, the
+ # node will retain its existing power_interface value (which may have been
+ # set via a different test).
+ power_interface = None
+
# Boolean value specify if image is wholedisk or not.
wholedisk_image = None
@@ -510,6 +524,20 @@
"in the list of enabled RAID interfaces %(enabled)s" % {
'iface': cls.raid_interface,
'enabled': CONF.baremetal.enabled_raid_interfaces})
+ if (cls.management_interface and cls.management_interface not in
+ CONF.baremetal.enabled_management_interfaces):
+ raise cls.skipException(
+ "Management interface %(iface)s required by test is not "
+ "in the list of enabled management interfaces %(enabled)s" % {
+ 'iface': cls.management_interface,
+ 'enabled': CONF.baremetal.enabled_management_interfaces})
+ if (cls.power_interface and cls.power_interface not in
+ CONF.baremetal.enabled_power_interfaces):
+ raise cls.skipException(
+ "Power interface %(iface)s required by test is not "
+ "in the list of enabled power interfaces %(enabled)s" % {
+ 'iface': cls.power_interface,
+ 'enabled': CONF.baremetal.enabled_power_interfaces})
if not cls.wholedisk_image and CONF.baremetal.use_provision_network:
raise cls.skipException(
'Partitioned images are not supported with multitenancy.')
@@ -548,6 +576,10 @@
boot_kwargs['boot_interface'] = cls.boot_interface
if cls.raid_interface:
boot_kwargs['raid_interface'] = cls.raid_interface
+ if cls.management_interface:
+ boot_kwargs['management_interface'] = cls.management_interface
+ if cls.power_interface:
+ boot_kwargs['power_interface'] = cls.power_interface
# just get an available node
cls.node = cls.get_and_reserve_node()
diff --git a/ironic_tempest_plugin/tests/scenario/ironic_standalone/test_cleaning.py b/ironic_tempest_plugin/tests/scenario/ironic_standalone/test_cleaning.py
index 08abcfa..13fcd9b 100644
--- a/ironic_tempest_plugin/tests/scenario/ironic_standalone/test_cleaning.py
+++ b/ironic_tempest_plugin/tests/scenario/ironic_standalone/test_cleaning.py
@@ -1,6 +1,8 @@
#
# Copyright 2017 Mirantis Inc.
#
+# Copyright (c) 2022 Dell Inc. or its subsidiaries.
+#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
@@ -166,3 +168,62 @@
# and remove it before exiting the test.
self.remove_root_device_hint()
self.terminate_node(self.node['uuid'], force_delete=True)
+
+
+class BaremetalIdracManagementCleaning(
+ bsm.BaremetalStandaloneScenarioTest):
+
+ mandatory_attr = ['driver', 'management_interface',
+ 'power_interface']
+
+ driver = 'idrac'
+ delete_node = False
+ # Minimum version for manual cleaning is 1.15 (# v1.15: Add ability to
+ # do manual cleaning of nodes). The test cases clean up at the end by
+ # detaching the VIF. Support for VIFs was introduced by version 1.28
+ # (# v1.28: Add vifs subcontroller to node).
+ api_microversion = '1.28'
+
+ @decorators.idempotent_id('d085ff72-abef-4931-a5b0-06efd5f9a037')
+ def test_reset_idrac(self):
+ clean_steps = [
+ {
+ "interface": "management",
+ "step": "reset_idrac"
+ }
+ ]
+ self.manual_cleaning(self.node, clean_steps=clean_steps)
+
+ @decorators.idempotent_id('9252ec6f-6b5b-447e-a323-c52775b88b4e')
+ def test_clear_job_queue(self):
+ clean_steps = [
+ {
+ "interface": "management",
+ "step": "clear_job_queue"
+ }
+ ]
+ self.manual_cleaning(self.node, clean_steps=clean_steps)
+
+ @decorators.idempotent_id('7baeff52-7d6e-4dea-a48f-a85a6bfc9f62')
+ def test_known_good_state(self):
+ clean_steps = [
+ {
+ "interface": "management",
+ "step": "known_good_state"
+ }
+ ]
+ self.manual_cleaning(self.node, clean_steps=clean_steps)
+
+
+class BaremetalIdracRedfishManagementCleaning(
+ BaremetalIdracManagementCleaning):
+
+ management_interface = 'idrac-redfish'
+ power_interface = 'idrac-redfish'
+
+
+class BaremetalIdracWSManManagementCleaning(
+ BaremetalIdracManagementCleaning):
+
+ management_interface = 'idrac-wsman'
+ power_interface = 'idrac-wsman'