Test cases for iLO drivers in standalone ironic

This commit adds test cases to support iLO drivers for end
to end deployment using standalone ironic.

Change-Id: Iba962e8e31c2275cc278ecf06220c66dfdb64a08
diff --git a/ironic_tempest_plugin/config.py b/ironic_tempest_plugin/config.py
index c4fb185..7cabf69 100644
--- a/ironic_tempest_plugin/config.py
+++ b/ironic_tempest_plugin/config.py
@@ -129,6 +129,9 @@
     cfg.ListOpt('enabled_rescue_interfaces',
                 default=['no-rescue'],
                 help="List of Ironic enabled rescue interfaces."),
+    cfg.ListOpt('enabled_boot_interfaces',
+                default=['fake', 'pxe'],
+                help="List of Ironic enabled boot 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 c7d6b50..94780a8 100644
--- a/ironic_tempest_plugin/tests/scenario/baremetal_standalone_manager.py
+++ b/ironic_tempest_plugin/tests/scenario/baremetal_standalone_manager.py
@@ -418,6 +418,12 @@
     # been set via a different test).
     rescue_interface = None
 
+    # The boot interface to use by the HW type. The boot interface of the
+    # node used in the test will be set to this value. If set to None, the
+    # node will retain its existing boot_interface value (which may have been
+    # set via a different test).
+    boot_interface = None
+
     # Boolean value specify if image is wholedisk or not.
     wholedisk_image = None
 
@@ -463,6 +469,13 @@
                 "in the list of enabled rescue interfaces %(enabled)s" % {
                     'iface': cls.rescue_interface,
                     'enabled': CONF.baremetal.enabled_rescue_interfaces})
+        if (cls.boot_interface and cls.boot_interface not in
+                CONF.baremetal.enabled_boot_interfaces):
+            raise cls.skipException(
+                "Boot interface %(iface)s required by test is not "
+                "in the list of enabled boot interfaces %(enabled)s" % {
+                    'iface': cls.boot_interface,
+                    'enabled': CONF.baremetal.enabled_boot_interfaces})
         if not cls.wholedisk_image and CONF.baremetal.use_provision_network:
             raise cls.skipException(
                 'Partitioned images are not supported with multitenancy.')
@@ -497,6 +510,8 @@
             boot_kwargs['deploy_interface'] = cls.deploy_interface
         if cls.rescue_interface:
             boot_kwargs['rescue_interface'] = cls.rescue_interface
+        if cls.boot_interface:
+            boot_kwargs['boot_interface'] = cls.boot_interface
 
         # just get an available node
         cls.node = cls.get_and_reserve_node()
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 5aa7543..45b5271 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
@@ -237,3 +237,99 @@
         self.unrescue_node(self.node['uuid'])
         self.assertTrue(self.ping_ip_address(self.node_ip,
                                              should_succeed=True))
+
+
+class BaremetalIloDirectWholediskHttpLink(
+        bsm.BaremetalStandaloneScenarioTest):
+
+    api_microversion = '1.31'  # to set the deploy_interface
+    driver = 'ilo'
+    deploy_interface = 'direct'
+    boot_interface = 'ilo-virtual-media'
+    image_ref = CONF.baremetal.whole_disk_image_url
+    image_checksum = CONF.baremetal.whole_disk_image_checksum
+    wholedisk_image = True
+
+    @decorators.idempotent_id('c2db24e7-b9bb-44df-6765-e60134346fd0')
+    @utils.services('network')
+    def test_ip_access_to_server(self):
+        self.boot_and_verify_node()
+
+
+class BaremetalIloDirectPartitioned(bsm.BaremetalStandaloneScenarioTest):
+
+    api_microversion = '1.31'  # to set the deploy_interface
+    driver = 'ilo'
+    deploy_interface = 'direct'
+    boot_interface = 'ilo-virtual-media'
+    image_ref = CONF.baremetal.partition_image_ref
+    wholedisk_image = False
+
+    @decorators.idempotent_id('ea85e19c-d8dc-4577-4d05-fbbbe4ce3f8c')
+    @utils.services('image', 'network')
+    def test_ip_access_to_server(self):
+        self.boot_and_verify_node()
+
+
+class BaremetalIloIscsiWholediskHttpLink(
+        bsm.BaremetalStandaloneScenarioTest):
+
+    api_microversion = '1.31'  # to set the deploy_interface
+    driver = 'ilo'
+    deploy_interface = 'iscsi'
+    boot_interface = 'ilo-virtual-media'
+    image_ref = CONF.baremetal.whole_disk_image_url
+    image_checksum = CONF.baremetal.whole_disk_image_checksum
+    wholedisk_image = True
+
+    @decorators.idempotent_id('71ccf06f-45db-8f93-afd0-d4efae2bfd4e')
+    @utils.services('network')
+    def test_ip_access_to_server(self):
+        self.boot_and_verify_node()
+
+
+class BaremetalIloIscsiPartitioned(bsm.BaremetalStandaloneScenarioTest):
+
+    api_microversion = '1.31'  # to set the deploy_interface
+    driver = 'ilo'
+    deploy_interface = 'iscsi'
+    boot_interface = 'ilo-virtual-media'
+    image_ref = CONF.baremetal.partition_image_ref
+    wholedisk_image = False
+
+    @decorators.idempotent_id('d926c683-4d05-8252-b9bb-35babbed6e86')
+    @utils.services('image', 'network')
+    def test_ip_access_to_server(self):
+        self.boot_and_verify_node()
+
+
+class BaremetalIloPxeWholediskHttpLink(
+        bsm.BaremetalStandaloneScenarioTest):
+
+    api_microversion = '1.31'  # to set the deploy_interface
+    driver = 'ilo'
+    deploy_interface = 'direct'
+    boot_interface = 'ilo-pxe'
+    image_ref = CONF.baremetal.whole_disk_image_url
+    image_checksum = CONF.baremetal.whole_disk_image_checksum
+    wholedisk_image = True
+
+    @decorators.idempotent_id('d926c683-1a32-edbc-07dc-95cd74eefecb')
+    @utils.services('network')
+    def test_ip_access_to_server(self):
+        self.boot_and_verify_node()
+
+
+class BaremetalIloPxePartitioned(bsm.BaremetalStandaloneScenarioTest):
+
+    api_microversion = '1.31'  # to set the deploy_interface
+    driver = 'ilo'
+    deploy_interface = 'direct'
+    boot_interface = 'ilo-pxe'
+    image_ref = CONF.baremetal.partition_image_ref
+    wholedisk_image = False
+
+    @decorators.idempotent_id('71ccf06f-07dc-4577-6869-1b1bfa423b9b')
+    @utils.services('image', 'network')
+    def test_ip_access_to_server(self):
+        self.boot_and_verify_node()