| 1 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 2 |
# not use this file except in compliance with the License. You may obtain |
| 3 |
# a copy of the License at |
| 4 |
# |
| 5 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 6 |
# |
| 7 |
# Unless required by applicable law or agreed to in writing, software |
| 8 |
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 9 |
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 10 |
# License for the specific language governing permissions and limitations |
| 11 |
# under the License. |
| 12 |
|
| 13 |
from oslo_log import log as logging |
| 14 |
from tempest.common import utils |
| 15 |
from tempest import config |
| 16 |
from tempest.lib import decorators |
| 17 |
|
| 18 |
from ironic_tempest_plugin.tests.scenario import \ |
| 19 |
baremetal_standalone_manager as bsm |
| 20 |
|
| 21 |
LOG = logging.getLogger(__name__) |
| 22 |
CONF = config.CONF |
| 23 |
|
| 24 |
|
| 25 |
class BaremetalRamdiskBootIsoIPMIIPXE(bsm.BaremetalStandaloneScenarioTest): |
| 26 |
|
| 27 |
driver = 'ipmi' |
| 28 |
boot_interface = 'ipxe' |
| 29 |
delete_node = False |
| 30 |
deploy_interface = 'ramdisk' |
| 31 |
api_microversion = '1.66' |
| 32 |
image_ref = CONF.baremetal.ramdisk_iso_image_ref |
| 33 |
wholedisk_image = False |
| 34 |
|
| 35 |
@classmethod |
| 36 |
def skip_checks(cls): |
| 37 |
super().skip_checks() |
| 38 |
if not cls.image_ref: |
| 39 |
raise cls.skipException('Skipping ramdisk ISO booting as' |
| 40 |
'no ramdisk_iso_image_ref is defined.') |
| 41 |
|
| 42 |
@decorators.idempotent_id('2859d115-9266-4461-9286-79b146e65dc9') |
| 43 |
@utils.services('image', 'network') |
| 44 |
def test_ramdisk_boot(self): |
| 45 |
self.boot_and_verify_ramdisk_node(self.image_ref, iso=True) |
| 46 |
|
| 47 |
|
| 48 |
class BaremetalRamdiskBootIsoRedfishVMedia( |
| 49 |
bsm.BaremetalStandaloneScenarioTest): |
| 50 |
|
| 51 |
driver = 'redfish' |
| 52 |
boot_interface = 'redfish-virtual-media' |
| 53 |
delete_node = False |
| 54 |
deploy_interface = 'ramdisk' |
| 55 |
api_microversion = '1.66' |
| 56 |
image_ref = CONF.baremetal.ramdisk_iso_image_ref |
| 57 |
wholedisk_image = False |
| 58 |
|
| 59 |
@classmethod |
| 60 |
def skip_checks(cls): |
| 61 |
super().skip_checks() |
| 62 |
if not cls.image_ref: |
| 63 |
raise cls.skipException('Skipping ramdisk ISO booting as' |
| 64 |
'no ramdisk_iso_image_ref is defined.') |
| 65 |
|
| 66 |
@decorators.idempotent_id('2859d115-9266-4461-9286-79b146e65dc9') |
| 67 |
@utils.services('image', 'network') |
| 68 |
def test_ramdisk_boot(self): |
| 69 |
self.boot_and_verify_ramdisk_node(self.image_ref, iso=True) |
| 70 |
|
| 71 |
|
| 72 |
class BaremetalRamdiskBootIsoSNMPIPXE(bsm.BaremetalStandaloneScenarioTest): |
| 73 |
|
| 74 |
driver = 'snmp' |
| 75 |
boot_interface = 'ipxe' |
| 76 |
delete_node = False |
| 77 |
deploy_interface = 'ramdisk' |
| 78 |
api_microversion = '1.66' |
| 79 |
image_ref = CONF.baremetal.ramdisk_iso_image_ref |
| 80 |
wholedisk_image = False |
| 81 |
|
| 82 |
@classmethod |
| 83 |
def skip_checks(cls): |
| 84 |
super().skip_checks() |
| 85 |
if not cls.image_ref: |
| 86 |
raise cls.skipException('Skipping ramdisk ISO booting as' |
| 87 |
'no ramdisk_iso_image_ref is defined.') |
| 88 |
|
| 89 |
@decorators.idempotent_id('2859d115-9266-4461-9286-79b146e65dc9') |
| 90 |
@utils.services('image', 'network') |
| 91 |
def test_ramdisk_boot(self): |
| 92 |
self.boot_and_verify_ramdisk_node(self.image_ref, iso=True) |