| 1 |
# |
| 2 |
# Copyright 2017 Mirantis Inc. |
| 3 |
# |
| 4 |
# Copyright (c) 2022 Dell Inc. or its subsidiaries. |
| 5 |
# |
| 6 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 7 |
# not use this file except in compliance with the License. You may obtain |
| 8 |
# a copy of the License at |
| 9 |
# |
| 10 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 11 |
# |
| 12 |
# Unless required by applicable law or agreed to in writing, software |
| 13 |
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 14 |
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 15 |
# License for the specific language governing permissions and limitations |
| 16 |
# under the License. |
| 17 |
|
| 18 |
from tempest.common import utils |
| 19 |
from tempest import config |
| 20 |
from tempest.lib import decorators |
| 21 |
|
| 22 |
from ironic_tempest_plugin.tests.scenario import \ |
| 23 |
baremetal_standalone_manager as bsm |
| 24 |
|
| 25 |
CONF = config.CONF |
| 26 |
|
| 27 |
|
| 28 |
class BaremetalDriverIscsiWholedisk(bsm.BaremetalStandaloneScenarioTest): |
| 29 |
|
| 30 |
api_microversion = '1.31' # to set the deploy_interface |
| 31 |
if 'redfish' in CONF.baremetal.enabled_hardware_types: |
| 32 |
driver = 'redfish' |
| 33 |
else: |
| 34 |
driver = 'ipmi' |
| 35 |
|
| 36 |
deploy_interface = 'iscsi' |
| 37 |
image_ref = CONF.baremetal.whole_disk_image_ref |
| 38 |
wholedisk_image = True |
| 39 |
|
| 40 |
@classmethod |
| 41 |
def skip_checks(cls): |
| 42 |
super(BaremetalDriverIscsiWholedisk, cls).skip_checks() |
| 43 |
if cls.driver == 'redfish': |
| 44 |
skip_msg = ("Test covered when using ipmi") |
| 45 |
raise cls.skipException(skip_msg) |
| 46 |
|
| 47 |
@decorators.idempotent_id('f25b71df-2150-45d7-a780-7f5b07124808') |
| 48 |
@utils.services('image', 'network') |
| 49 |
def test_ip_access_to_server(self): |
| 50 |
self.boot_and_verify_node() |
| 51 |
|
| 52 |
|
| 53 |
class BaremetalDriverDirectWholedisk(bsm.BaremetalStandaloneScenarioTest): |
| 54 |
|
| 55 |
api_microversion = '1.31' # to set the deploy_interface |
| 56 |
if 'redfish' in CONF.baremetal.enabled_hardware_types: |
| 57 |
driver = 'redfish' |
| 58 |
else: |
| 59 |
driver = 'ipmi' |
| 60 |
deploy_interface = 'direct' |
| 61 |
image_ref = CONF.baremetal.whole_disk_image_ref |
| 62 |
wholedisk_image = True |
| 63 |
|
| 64 |
@classmethod |
| 65 |
def skip_checks(cls): |
| 66 |
super(BaremetalDriverDirectWholedisk, cls).skip_checks() |
| 67 |
if cls.driver == 'ipmi': |
| 68 |
skip_msg = ("Test covered when using redfish") |
| 69 |
raise cls.skipException(skip_msg) |
| 70 |
|
| 71 |
@decorators.idempotent_id('c2db24e7-07dc-4a20-8f93-d4efae2bfd4e') |
| 72 |
@utils.services('image', 'network') |
| 73 |
def test_ip_access_to_server(self): |
| 74 |
self.boot_and_verify_node() |
| 75 |
|
| 76 |
|
| 77 |
class BaremetalDriverIscsiPartitioned(bsm.BaremetalStandaloneScenarioTest): |
| 78 |
|
| 79 |
api_microversion = '1.31' # to set the deploy_interface |
| 80 |
if 'redfish' in CONF.baremetal.enabled_hardware_types: |
| 81 |
driver = 'redfish' |
| 82 |
else: |
| 83 |
driver = 'ipmi' |
| 84 |
deploy_interface = 'iscsi' |
| 85 |
image_ref = CONF.baremetal.partition_image_ref |
| 86 |
wholedisk_image = False |
| 87 |
boot_option = 'netboot' if CONF.baremetal.partition_netboot else 'local' |
| 88 |
|
| 89 |
@classmethod |
| 90 |
def skip_checks(cls): |
| 91 |
super(BaremetalDriverIscsiPartitioned, cls).skip_checks() |
| 92 |
if cls.driver == 'ipmi': |
| 93 |
skip_msg = ("Test covered when using redfish") |
| 94 |
raise cls.skipException(skip_msg) |
| 95 |
|
| 96 |
@decorators.idempotent_id('7d0b205e-edbc-4e2d-9f6d-95cd74eefecb') |
| 97 |
@utils.services('image', 'network') |
| 98 |
def test_ip_access_to_server(self): |
| 99 |
self.boot_and_verify_node() |
| 100 |
|
| 101 |
|
| 102 |
class BaremetalDriverDirectPartitioned(bsm.BaremetalStandaloneScenarioTest): |
| 103 |
|
| 104 |
api_microversion = '1.31' # to set the deploy_interface |
| 105 |
if 'redfish' in CONF.baremetal.enabled_hardware_types: |
| 106 |
driver = 'redfish' |
| 107 |
else: |
| 108 |
driver = 'ipmi' |
| 109 |
deploy_interface = 'direct' |
| 110 |
image_ref = CONF.baremetal.partition_image_ref |
| 111 |
wholedisk_image = False |
| 112 |
boot_option = 'netboot' if CONF.baremetal.partition_netboot else 'local' |
| 113 |
|
| 114 |
@classmethod |
| 115 |
def skip_checks(cls): |
| 116 |
super(BaremetalDriverDirectPartitioned, cls).skip_checks() |
| 117 |
if cls.driver == 'redfish': |
| 118 |
skip_msg = ("Test covered when using ipmi") |
| 119 |
raise cls.skipException(skip_msg) |
| 120 |
|
| 121 |
@decorators.idempotent_id('7b4b2dcd-2bbb-44f5-991f-0964300af6b7') |
| 122 |
@utils.services('image', 'network') |
| 123 |
def test_ip_access_to_server(self): |
| 124 |
self.boot_and_verify_node() |
| 125 |
|
| 126 |
|
| 127 |
class BaremetalDriverAnsibleWholedisk(bsm.BaremetalStandaloneScenarioTest): |
| 128 |
|
| 129 |
api_microversion = '1.31' # to set the deploy_interface |
| 130 |
if 'redfish' in CONF.baremetal.enabled_hardware_types: |
| 131 |
driver = 'redfish' |
| 132 |
else: |
| 133 |
driver = 'ipmi' |
| 134 |
deploy_interface = 'ansible' |
| 135 |
image_ref = CONF.baremetal.whole_disk_image_ref |
| 136 |
wholedisk_image = True |
| 137 |
|
| 138 |
@decorators.unstable_test(bug='2101021') |
| 139 |
@decorators.idempotent_id('cde532cc-81ba-4489-b374-b4a85cc203eb') |
| 140 |
@utils.services('image', 'network') |
| 141 |
def test_ip_access_to_server(self): |
| 142 |
self.boot_and_verify_node() |
| 143 |
|
| 144 |
|
| 145 |
class BaremetalIpmiRescueWholedisk(bsm.BaremetalStandaloneScenarioTest): |
| 146 |
|
| 147 |
api_microversion = '1.38' |
| 148 |
min_microversion = '1.38' |
| 149 |
driver = 'ipmi' |
| 150 |
rescue_interface = 'agent' |
| 151 |
image_ref = CONF.baremetal.whole_disk_image_ref |
| 152 |
wholedisk_image = True |
| 153 |
|
| 154 |
# NOTE(tiendc) Using direct deploy interface and a whole disk |
| 155 |
# image may lead to the bug: |
| 156 |
# https://bugs.launchpad.net/ironic/+bug/1750958 |
| 157 |
# This is a workaround by using iscsi deploy interface. |
| 158 |
deploy_interface = 'iscsi' |
| 159 |
|
| 160 |
@decorators.idempotent_id('d6a1780f-c4bb-4136-8144-29e822e14d66') |
| 161 |
@utils.services('image', 'network') |
| 162 |
def test_rescue_mode(self): |
| 163 |
self.set_node_to_active(self.image_ref) |
| 164 |
self.rescue_unrescue() |
| 165 |
|
| 166 |
|
| 167 |
class BaremetalIpmiRescuePartitioned(bsm.BaremetalStandaloneScenarioTest): |
| 168 |
|
| 169 |
api_microversion = '1.38' |
| 170 |
min_microversion = '1.38' |
| 171 |
driver = 'ipmi' |
| 172 |
rescue_interface = 'agent' |
| 173 |
image_ref = CONF.baremetal.partition_image_ref |
| 174 |
wholedisk_image = False |
| 175 |
boot_option = 'netboot' if CONF.baremetal.partition_netboot else 'local' |
| 176 |
|
| 177 |
# NOTE(jroll) the ansible deploy interface doesn't support partition images |
| 178 |
# with netboot mode. Since that's what is happening here, explicitly choose |
| 179 |
# a deploy interface to be sure we don't end up with a node using the |
| 180 |
# ansible interface here. |
| 181 |
deploy_interface = 'iscsi' |
| 182 |
|
| 183 |
@decorators.idempotent_id('113acd0a-9872-4631-b3ee-54da7e3bb262') |
| 184 |
@utils.services('image', 'network') |
| 185 |
def test_rescue_mode(self): |
| 186 |
self.set_node_to_active(self.image_ref) |
| 187 |
self.rescue_unrescue() |
| 188 |
|
| 189 |
|
| 190 |
class BaremetalIloDirectWholediskHttpLink( |
| 191 |
bsm.BaremetalStandaloneScenarioTest): |
| 192 |
|
| 193 |
api_microversion = '1.31' # to set the deploy_interface |
| 194 |
driver = 'ilo' |
| 195 |
deploy_interface = 'direct' |
| 196 |
boot_interface = 'ilo-virtual-media' |
| 197 |
image_ref = CONF.baremetal.whole_disk_image_url |
| 198 |
image_checksum = CONF.baremetal.whole_disk_image_checksum |
| 199 |
wholedisk_image = True |
| 200 |
|
| 201 |
@decorators.idempotent_id('c2db24e7-b9bb-44df-6765-e60134346fd0') |
| 202 |
@utils.services('network') |
| 203 |
def test_ip_access_to_server(self): |
| 204 |
self.boot_and_verify_node() |
| 205 |
|
| 206 |
|
| 207 |
class BaremetalIloDirectPartitioned(bsm.BaremetalStandaloneScenarioTest): |
| 208 |
|
| 209 |
api_microversion = '1.31' # to set the deploy_interface |
| 210 |
driver = 'ilo' |
| 211 |
deploy_interface = 'direct' |
| 212 |
boot_interface = 'ilo-virtual-media' |
| 213 |
image_ref = CONF.baremetal.partition_image_ref |
| 214 |
wholedisk_image = False |
| 215 |
|
| 216 |
@decorators.idempotent_id('ea85e19c-d8dc-4577-4d05-fbbbe4ce3f8c') |
| 217 |
@utils.services('image', 'network') |
| 218 |
def test_ip_access_to_server(self): |
| 219 |
self.boot_and_verify_node() |
| 220 |
|
| 221 |
|
| 222 |
class BaremetalIloIscsiWholediskHttpLink( |
| 223 |
bsm.BaremetalStandaloneScenarioTest): |
| 224 |
|
| 225 |
api_microversion = '1.31' # to set the deploy_interface |
| 226 |
driver = 'ilo' |
| 227 |
deploy_interface = 'iscsi' |
| 228 |
boot_interface = 'ilo-virtual-media' |
| 229 |
image_ref = CONF.baremetal.whole_disk_image_url |
| 230 |
image_checksum = CONF.baremetal.whole_disk_image_checksum |
| 231 |
wholedisk_image = True |
| 232 |
|
| 233 |
@decorators.idempotent_id('71ccf06f-45db-8f93-afd0-d4efae2bfd4e') |
| 234 |
@utils.services('network') |
| 235 |
def test_ip_access_to_server(self): |
| 236 |
self.boot_and_verify_node() |
| 237 |
|
| 238 |
|
| 239 |
class BaremetalIloIscsiPartitioned(bsm.BaremetalStandaloneScenarioTest): |
| 240 |
|
| 241 |
api_microversion = '1.31' # to set the deploy_interface |
| 242 |
driver = 'ilo' |
| 243 |
deploy_interface = 'iscsi' |
| 244 |
boot_interface = 'ilo-virtual-media' |
| 245 |
image_ref = CONF.baremetal.partition_image_ref |
| 246 |
wholedisk_image = False |
| 247 |
|
| 248 |
@decorators.idempotent_id('d926c683-4d05-8252-b9bb-35babbed6e86') |
| 249 |
@utils.services('image', 'network') |
| 250 |
def test_ip_access_to_server(self): |
| 251 |
self.boot_and_verify_node() |
| 252 |
|
| 253 |
|
| 254 |
class BaremetalIloPxeWholediskHttpLink( |
| 255 |
bsm.BaremetalStandaloneScenarioTest): |
| 256 |
|
| 257 |
api_microversion = '1.31' # to set the deploy_interface |
| 258 |
driver = 'ilo' |
| 259 |
deploy_interface = 'direct' |
| 260 |
boot_interface = 'ilo-pxe' |
| 261 |
image_ref = CONF.baremetal.whole_disk_image_url |
| 262 |
image_checksum = CONF.baremetal.whole_disk_image_checksum |
| 263 |
wholedisk_image = True |
| 264 |
|
| 265 |
@decorators.idempotent_id('d926c683-1a32-edbc-07dc-95cd74eefecb') |
| 266 |
@utils.services('network') |
| 267 |
def test_ip_access_to_server(self): |
| 268 |
self.boot_and_verify_node() |
| 269 |
|
| 270 |
|
| 271 |
class BaremetalIloPxePartitioned(bsm.BaremetalStandaloneScenarioTest): |
| 272 |
|
| 273 |
api_microversion = '1.31' # to set the deploy_interface |
| 274 |
driver = 'ilo' |
| 275 |
deploy_interface = 'direct' |
| 276 |
boot_interface = 'ilo-pxe' |
| 277 |
image_ref = CONF.baremetal.partition_image_ref |
| 278 |
wholedisk_image = False |
| 279 |
|
| 280 |
@decorators.idempotent_id('71ccf06f-07dc-4577-6869-1b1bfa423b9b') |
| 281 |
@utils.services('image', 'network') |
| 282 |
def test_ip_access_to_server(self): |
| 283 |
self.boot_and_verify_node() |
| 284 |
|
| 285 |
|
| 286 |
class BaremetalIloIPxeWholediskHttpLink( |
| 287 |
bsm.BaremetalStandaloneScenarioTest): |
| 288 |
|
| 289 |
api_microversion = '1.31' # to set the deploy_interface |
| 290 |
driver = 'ilo' |
| 291 |
deploy_interface = 'direct' |
| 292 |
boot_interface = 'ilo-ipxe' |
| 293 |
image_ref = CONF.baremetal.whole_disk_image_url |
| 294 |
image_checksum = CONF.baremetal.whole_disk_image_checksum |
| 295 |
wholedisk_image = True |
| 296 |
|
| 297 |
@decorators.idempotent_id('d926c683-1a32-edbc-07dc-95cd74eefecb') |
| 298 |
@utils.services('network') |
| 299 |
def test_ip_access_to_server(self): |
| 300 |
self.boot_and_verify_node() |
| 301 |
|
| 302 |
|
| 303 |
class BaremetalIlo5UefiHTTPSWholediskHttpsLink( |
| 304 |
bsm.BaremetalStandaloneScenarioTest): |
| 305 |
|
| 306 |
api_microversion = '1.31' # to set the deploy_interface |
| 307 |
driver = 'ilo5' |
| 308 |
deploy_interface = 'direct' |
| 309 |
boot_interface = 'ilo-uefi-https' |
| 310 |
image_ref = CONF.baremetal.whole_disk_image_url |
| 311 |
image_checksum = CONF.baremetal.whole_disk_image_checksum |
| 312 |
wholedisk_image = True |
| 313 |
|
| 314 |
@decorators.idempotent_id('d926c683-1a32-edbc-07dc-95cd74eefecb') |
| 315 |
@utils.services('network') |
| 316 |
def test_ip_access_to_server(self): |
| 317 |
self.boot_and_verify_node() |
| 318 |
|
| 319 |
|
| 320 |
class BaremetalRedfishDirectWholediskHttpLink( |
| 321 |
bsm.BaremetalStandaloneScenarioTest): |
| 322 |
|
| 323 |
api_microversion = '1.31' # to set the deploy_interface |
| 324 |
driver = 'redfish' |
| 325 |
deploy_interface = 'direct' |
| 326 |
boot_interface = 'redfish-virtual-media' |
| 327 |
image_ref = CONF.baremetal.whole_disk_image_url |
| 328 |
image_checksum = CONF.baremetal.whole_disk_image_checksum |
| 329 |
wholedisk_image = True |
| 330 |
|
| 331 |
@decorators.idempotent_id('113acd0a-9872-4631-b3ee-54da7e3bb262') |
| 332 |
@utils.services('network') |
| 333 |
def test_ip_access_to_server(self): |
| 334 |
self.boot_and_verify_node() |
| 335 |
|
| 336 |
|
| 337 |
class BaremetalRedfishIPxeWholediskHttpLink( |
| 338 |
bsm.BaremetalStandaloneScenarioTest): |
| 339 |
|
| 340 |
api_microversion = '1.31' # to set the deploy_interface |
| 341 |
driver = 'redfish' |
| 342 |
deploy_interface = 'direct' |
| 343 |
boot_interface = 'ipxe' |
| 344 |
image_ref = CONF.baremetal.whole_disk_image_url |
| 345 |
image_checksum = CONF.baremetal.whole_disk_image_checksum |
| 346 |
wholedisk_image = True |
| 347 |
|
| 348 |
@decorators.idempotent_id('113acd0a-9872-4631-b3ee-54da7e3bb262') |
| 349 |
@utils.services('network') |
| 350 |
def test_ip_access_to_server(self): |
| 351 |
self.boot_and_verify_node() |
| 352 |
|
| 353 |
|
| 354 |
class BaremetalRedfishDirectPxeWholedisk( |
| 355 |
bsm.BaremetalStandaloneScenarioTest): |
| 356 |
|
| 357 |
mandatory_attr = ['driver'] |
| 358 |
api_microversion = '1.31' # to set the deploy_interface |
| 359 |
driver = 'redfish' |
| 360 |
image_ref = CONF.baremetal.whole_disk_image_ref |
| 361 |
wholedisk_image = True |
| 362 |
boot_interface = 'pxe' |
| 363 |
deploy_interface = 'direct' |
| 364 |
|
| 365 |
@classmethod |
| 366 |
def skip_checks(cls): |
| 367 |
super(BaremetalRedfishDirectPxeWholedisk, cls).skip_checks() |
| 368 |
if CONF.baremetal_feature_enabled.ipxe_enabled: |
| 369 |
skip_msg = ("Skipping the test case since ipxe is enabled") |
| 370 |
raise cls.skipException(skip_msg) |
| 371 |
|
| 372 |
@utils.services('image', 'network') |
| 373 |
@decorators.idempotent_id('2bf34541-5514-4ea7-b073-7707d408ce99') |
| 374 |
def test_deploy_node(self): |
| 375 |
self.boot_and_verify_node() |
| 376 |
|
| 377 |
|
| 378 |
class BaremetalIdracDirectIPxeWholedisk( |
| 379 |
bsm.BaremetalStandaloneScenarioTest): |
| 380 |
|
| 381 |
mandatory_attr = ['driver'] |
| 382 |
api_microversion = '1.31' # to set the deploy_interface |
| 383 |
driver = 'idrac' |
| 384 |
image_ref = CONF.baremetal.whole_disk_image_ref |
| 385 |
wholedisk_image = True |
| 386 |
boot_interface = 'ipxe' |
| 387 |
deploy_interface = 'direct' |
| 388 |
|
| 389 |
@classmethod |
| 390 |
def skip_checks(cls): |
| 391 |
super(BaremetalIdracDirectIPxeWholedisk, cls).skip_checks() |
| 392 |
if not CONF.baremetal_feature_enabled.ipxe_enabled: |
| 393 |
skip_msg = ("Skipping the test case since ipxe is disabled") |
| 394 |
raise cls.skipException(skip_msg) |
| 395 |
|
| 396 |
@utils.services('image', 'network') |
| 397 |
@decorators.idempotent_id('b467889b-aba4-4696-9e6f-4ef60a3f78a4') |
| 398 |
def test_deploy_node(self): |
| 399 |
self.boot_and_verify_node() |
| 400 |
|
| 401 |
|
| 402 |
class BaremetalIdracDirectPxeWholedisk( |
| 403 |
bsm.BaremetalStandaloneScenarioTest): |
| 404 |
|
| 405 |
mandatory_attr = ['driver'] |
| 406 |
api_microversion = '1.31' # to set the deploy_interface |
| 407 |
driver = 'idrac' |
| 408 |
image_ref = CONF.baremetal.whole_disk_image_ref |
| 409 |
wholedisk_image = True |
| 410 |
boot_interface = 'pxe' |
| 411 |
deploy_interface = 'direct' |
| 412 |
|
| 413 |
@classmethod |
| 414 |
def skip_checks(cls): |
| 415 |
super(BaremetalIdracDirectPxeWholedisk, cls).skip_checks() |
| 416 |
if CONF.baremetal_feature_enabled.ipxe_enabled: |
| 417 |
skip_msg = ("Skipping the test case since ipxe is enabled") |
| 418 |
raise cls.skipException(skip_msg) |
| 419 |
|
| 420 |
@utils.services('image', 'network') |
| 421 |
@decorators.idempotent_id('20c0f2f4-723b-4d1e-a4f2-bea11ffb1513') |
| 422 |
def test_deploy_node(self): |
| 423 |
self.boot_and_verify_node() |
| 424 |
|
| 425 |
|
| 426 |
class BaremetalIdracRedfishDirectIPxeWholedisk( |
| 427 |
BaremetalIdracDirectIPxeWholedisk): |
| 428 |
|
| 429 |
power_interface = 'idrac-redfish' |
| 430 |
management_interface = 'idrac-redfish' |
| 431 |
|
| 432 |
|
| 433 |
class BaremetalIdracRedfishDirectPxeWholedisk( |
| 434 |
BaremetalIdracDirectPxeWholedisk): |
| 435 |
|
| 436 |
power_interface = 'idrac-redfish' |
| 437 |
management_interface = 'idrac-redfish' |
| 438 |
|
| 439 |
|
| 440 |
class BaremetalIpmiDirectIPxeWholedisk( |
| 441 |
bsm.BaremetalStandaloneScenarioTest): |
| 442 |
|
| 443 |
mandatory_attr = ['driver'] |
| 444 |
api_microversion = '1.31' # to set the deploy_interface |
| 445 |
driver = 'ipmi' |
| 446 |
image_ref = CONF.baremetal.whole_disk_image_ref |
| 447 |
wholedisk_image = True |
| 448 |
boot_interface = 'ipxe' |
| 449 |
deploy_interface = 'direct' |
| 450 |
|
| 451 |
@classmethod |
| 452 |
def skip_checks(cls): |
| 453 |
super(BaremetalIpmiDirectIPxeWholedisk, cls).skip_checks() |
| 454 |
if not CONF.baremetal_feature_enabled.ipxe_enabled: |
| 455 |
skip_msg = ("Skipping the test case since ipxe is disabled") |
| 456 |
raise cls.skipException(skip_msg) |
| 457 |
|
| 458 |
@utils.services('image', 'network') |
| 459 |
@decorators.idempotent_id('9cd5a47b-ef96-4d64-9118-be467b24d1bf') |
| 460 |
def test_deploy_node(self): |
| 461 |
self.boot_and_verify_node() |
| 462 |
|
| 463 |
|
| 464 |
class BaremetalIpmiDirectPxeWholedisk( |
| 465 |
bsm.BaremetalStandaloneScenarioTest): |
| 466 |
|
| 467 |
mandatory_attr = ['driver'] |
| 468 |
api_microversion = '1.31' # to set the deploy_interface |
| 469 |
driver = 'ipmi' |
| 470 |
image_ref = CONF.baremetal.whole_disk_image_ref |
| 471 |
wholedisk_image = True |
| 472 |
boot_interface = 'pxe' |
| 473 |
deploy_interface = 'direct' |
| 474 |
|
| 475 |
@classmethod |
| 476 |
def skip_checks(cls): |
| 477 |
super(BaremetalIpmiDirectPxeWholedisk, cls).skip_checks() |
| 478 |
if CONF.baremetal_feature_enabled.ipxe_enabled: |
| 479 |
skip_msg = ("Skipping the test case since ipxe is enabled") |
| 480 |
raise cls.skipException(skip_msg) |
| 481 |
|
| 482 |
@utils.services('image', 'network') |
| 483 |
@decorators.idempotent_id('d68a38aa-b731-403a-9d40-b3b49ea75e9b') |
| 484 |
def test_deploy_node(self): |
| 485 |
self.boot_and_verify_node() |
| 486 |
|
| 487 |
|
| 488 |
class BaremetalIdracVirtualMediaWholedisk( |
| 489 |
bsm.BaremetalStandaloneScenarioTest): |
| 490 |
|
| 491 |
mandatory_attr = ['driver', 'boot_interface'] |
| 492 |
api_microversion = '1.31' # to set the deploy_interface |
| 493 |
driver = 'idrac' |
| 494 |
boot_interface = 'idrac-redfish-virtual-media' |
| 495 |
image_ref = CONF.baremetal.whole_disk_image_ref |
| 496 |
wholedisk_image = True |
| 497 |
deploy_interface = 'direct' |
| 498 |
|
| 499 |
@decorators.idempotent_id('b0bc87a5-4324-4134-bd5f-4bb1cf549e5c') |
| 500 |
@utils.services('image', 'network') |
| 501 |
def test_deploy_virtual_media_boot(self): |
| 502 |
self.boot_and_verify_node() |
| 503 |
|
| 504 |
|
| 505 |
class BaremetalIdracSyncBootModeDirectWholedisk( |
| 506 |
bsm.BaremetalStandaloneScenarioTest): |
| 507 |
|
| 508 |
mandatory_attr = ['driver', 'power_interface', 'management_interface', |
| 509 |
'bios_interface'] |
| 510 |
|
| 511 |
api_microversion = '1.40' # to get list_node_bios_settings |
| 512 |
driver = 'idrac' |
| 513 |
|
| 514 |
# NOTE: Image with UEFI support is necessary |
| 515 |
image_ref = CONF.baremetal.whole_disk_image_ref |
| 516 |
wholedisk_image = True |
| 517 |
boot_interface = 'ipxe' |
| 518 |
power_interface = 'idrac-redfish' |
| 519 |
management_interface = 'idrac-redfish' |
| 520 |
bios_interface = 'idrac-redfish' |
| 521 |
deploy_interface = 'direct' |
| 522 |
bios_mode = {'boot_mode': 'bios'} |
| 523 |
uefi_mode = {'boot_mode': 'uefi'} |
| 524 |
|
| 525 |
def _get_boot_mode_to_update(self): |
| 526 |
_, bios_settings = self.baremetal_client.\ |
| 527 |
list_node_bios_settings(self.node['uuid']) |
| 528 |
for attr_name in bios_settings['bios']: |
| 529 |
if attr_name['name'] == 'BootMode': |
| 530 |
if attr_name['value'] == 'Uefi': |
| 531 |
boot_mode = self.bios_mode |
| 532 |
else: |
| 533 |
boot_mode = self.uefi_mode |
| 534 |
return boot_mode |
| 535 |
|
| 536 |
@decorators.idempotent_id('c2bebda2-fd27-4b10-9015-f7d877f0eb60') |
| 537 |
@utils.services('image', 'network') |
| 538 |
def test_sync_boot_mode(self): |
| 539 |
boot_mode_path = '/instance_info/capabilities' |
| 540 |
mode_to_update = self._get_boot_mode_to_update() |
| 541 |
self.update_node(self.node['uuid'], [{'op': 'replace', |
| 542 |
'path': boot_mode_path, |
| 543 |
'value': mode_to_update}]) |
| 544 |
self.boot_and_verify_node() |
| 545 |
if mode_to_update == self.uefi_mode: |
| 546 |
mode_to_update = self.bios_mode |
| 547 |
else: |
| 548 |
mode_to_update = self.uefi_mode |
| 549 |
self.update_node(self.node['uuid'], [{'op': 'replace', |
| 550 |
'path': boot_mode_path, |
| 551 |
'value': mode_to_update}]) |
| 552 |
self.set_node_provision_state(self.node['uuid'], 'rebuild') |
| 553 |
self.wait_provisioning_state(self.node['uuid'], 'active', |
| 554 |
timeout=CONF.baremetal.active_timeout, |
| 555 |
interval=30) |
| 556 |
|
| 557 |
|
| 558 |
class BaremetalRedfishIPxeAnacondaNoGlance( |
| 559 |
bsm.BaremetalStandaloneScenarioTest): |
| 560 |
|
| 561 |
api_microversion = '1.78' # to set the deploy_interface |
| 562 |
driver = 'redfish' |
| 563 |
deploy_interface = 'anaconda' |
| 564 |
boot_interface = 'ipxe' |
| 565 |
image_ref = CONF.baremetal.anaconda_image_ref |
| 566 |
wholedisk_image = None |
| 567 |
|
| 568 |
@classmethod |
| 569 |
def skip_checks(cls): |
| 570 |
super(BaremetalRedfishIPxeAnacondaNoGlance, cls).skip_checks() |
| 571 |
if 'anaconda' not in CONF.baremetal.enabled_deploy_interfaces: |
| 572 |
skip_msg = ("Skipping the test case since anaconda is not " |
| 573 |
"enabled.") |
| 574 |
raise cls.skipException(skip_msg) |
| 575 |
|
| 576 |
def test_ip_access_to_server_without_stage2(self): |
| 577 |
# Tests deploy from a URL, or a pre-existing anaconda reference in |
| 578 |
# glance. |
| 579 |
if CONF.baremetal.anaconda_stage2_ramdisk_ref is not None: |
| 580 |
skip_msg = ("Skipping the test case as an anaconda stage2 " |
| 581 |
"ramdisk has been defined, and that test can " |
| 582 |
"run instead.") |
| 583 |
raise self.skipException(skip_msg) |
| 584 |
|
| 585 |
self.boot_and_verify_anaconda_node( |
| 586 |
image_ref=self.image_ref, |
| 587 |
kernel_ref=CONF.baremetal.anaconda_kernel_ref, |
| 588 |
ramdisk_ref=CONF.baremetal.anaconda_initial_ramdisk_ref) |
| 589 |
|
| 590 |
def test_ip_access_to_server_using_stage2(self): |
| 591 |
# Tests anaconda with a second stage ramdisk |
| 592 |
if CONF.baremetal.anaconda_stage2_ramdisk_ref is None: |
| 593 |
skip_msg = ("Skipping as stage2 ramdisk ref pointer has " |
| 594 |
"not been configured.") |
| 595 |
raise self.skipException(skip_msg) |
| 596 |
|
| 597 |
self.boot_and_verify_anaconda_node( |
| 598 |
image_ref=self.image_ref, |
| 599 |
kernel_ref=CONF.baremetal.anaconda_kernel_ref, |
| 600 |
ramdisk_ref=CONF.baremetal.anaconda_initial_ramdisk_ref, |
| 601 |
stage2_ref=CONF.baremetal.anaconda_stage2_ramdisk_ref) |
| 602 |
|
| 603 |
|
| 604 |
class BaremetalChangeBaseBootInterface( |
| 605 |
bsm.BaremetalStandaloneScenarioTest): |
| 606 |
|
| 607 |
# NOTE(TheJulia): The resource setup class *already* auto-sets the |
| 608 |
# requested boot interface. We just never tried to articulate |
| 609 |
# this sort of configuration before this class. |
| 610 |
# The goal: Test as many boot interfaces to ensure they are functional |
| 611 |
# under the base context |
| 612 |
|
| 613 |
api_microversion = '1.31' # to set the boot_interface |
| 614 |
driver = None |
| 615 |
# This is intentionally meant to be a relatively light weight test, |
| 616 |
# but one that covers the common cases, i.e. direct is most appropriate |
| 617 |
# here. Ramdisk/anaconda/ansible and friends are all more specific |
| 618 |
# cased. |
| 619 |
deploy_interface = 'direct' |
| 620 |
image_ref = CONF.baremetal.whole_disk_image_url |
| 621 |
image_checksum = CONF.baremetal.whole_disk_image_checksum |
| 622 |
wholedisk_image = True |
| 623 |
|
| 624 |
# This is a special override which allows us to just use the base |
| 625 |
# driver interface defined on the node, and not have to special case it |
| 626 |
# and focus on the "driver". |
| 627 |
use_available_driver = True |
| 628 |
|
| 629 |
# List of valid drivers which these tests *can* attempt to utilize. |
| 630 |
# Generally these should be the most common, stock, upstream drivers. |
| 631 |
valid_driver_list = ['ipmi', 'redfish'] |
| 632 |
|
| 633 |
# Bypass secondary attribute presence check as these tests don't require |
| 634 |
# the driver to be set. |
| 635 |
mandatory_attr = ['image_ref'] |
| 636 |
|
| 637 |
|
| 638 |
class BaremetalPXEBootTestClass(BaremetalChangeBaseBootInterface): |
| 639 |
|
| 640 |
boot_interface = 'pxe' |
| 641 |
|
| 642 |
@decorators.idempotent_id('62c12d2c-8c9f-4526-b9ab-b9cd63e0ea8a') |
| 643 |
@utils.services('network') |
| 644 |
def test_ip_access_to_server(self): |
| 645 |
self.boot_and_verify_node() |
| 646 |
|
| 647 |
|
| 648 |
class BaremetalIPXEBootTestClass(BaremetalChangeBaseBootInterface): |
| 649 |
|
| 650 |
boot_interface = 'ipxe' |
| 651 |
|
| 652 |
@decorators.idempotent_id('113acd0a-9872-4631-b3ee-54da7e3bb262') |
| 653 |
@utils.services('network') |
| 654 |
def test_ip_access_to_server(self): |
| 655 |
self.boot_and_verify_node() |
| 656 |
|
| 657 |
|
| 658 |
class BaremetalHTTPBootTestClass(BaremetalChangeBaseBootInterface): |
| 659 |
|
| 660 |
boot_interface = 'http' |
| 661 |
|
| 662 |
@decorators.idempotent_id('782c43db-77a1-4a3a-b46e-0ce9cbb7fba5') |
| 663 |
@utils.services('network') |
| 664 |
def test_ip_access_to_server(self): |
| 665 |
self.boot_and_verify_node() |
| 666 |
|
| 667 |
|
| 668 |
class BaremetalHttpIPXEBootTestClass(BaremetalChangeBaseBootInterface): |
| 669 |
|
| 670 |
boot_interface = 'http-ipxe' |
| 671 |
|
| 672 |
@decorators.idempotent_id('45400d8e-55a5-4ba6-81f5-935a4183ed90') |
| 673 |
@utils.services('network') |
| 674 |
def test_ip_access_to_server(self): |
| 675 |
self.boot_and_verify_node() |
| 676 |
|
| 677 |
|
| 678 |
class BaremetalRedfishVmediaBootTestClass(BaremetalChangeBaseBootInterface): |
| 679 |
|
| 680 |
boot_interface = 'redfish-virtual-media' |
| 681 |
driver = 'redfish' |
| 682 |
|
| 683 |
@decorators.idempotent_id('10535270-27e5-4616-9013-9507b1960dfa') |
| 684 |
@utils.services('network') |
| 685 |
def test_ip_access_to_server(self): |
| 686 |
self.boot_and_verify_node() |