Browse Source

Merge "iLO firmware update fails with 'update_firmware_sum' clean step" into stable/rocky

stable/rocky
Zuul 4 weeks ago
parent
commit
a303778f15

+ 3
- 0
ironic/drivers/modules/ilo/management.py View File

@@ -472,6 +472,9 @@ class IloManagement(base.ManagementInterface):
472 472
             url = firmware_processor.get_swift_url(urlparse.urlparse(url))
473 473
             node.clean_step['args']['url'] = url
474 474
 
475
+        # Insert SPP ISO into virtual media CDROM
476
+        ilo_common.attach_vmedia(node, 'CDROM', url)
477
+
475 478
         step = node.clean_step
476 479
         return deploy_utils.agent_execute_clean_step(task, step)
477 480
 

+ 18
- 4
ironic/tests/unit/drivers/modules/ilo/test_management.py View File

@@ -539,9 +539,12 @@ class IloManagementTestCase(test_common.BaseIloTest):
539 539
             remove_mock.assert_has_calls([mock.call(fw_loc_obj_1),
540 540
                                           mock.call(fw_loc_obj_2)])
541 541
 
542
+    @mock.patch.object(ilo_common, 'attach_vmedia', spec_set=True,
543
+                       autospec=True)
542 544
     @mock.patch.object(deploy_utils, 'agent_execute_clean_step',
543 545
                        autospec=True)
544
-    def test_update_firmware_sum_mode_with_component(self, execute_mock):
546
+    def test_update_firmware_sum_mode_with_component(
547
+            self, execute_mock, attach_vmedia_mock):
545 548
         with task_manager.acquire(self.context, self.node.uuid,
546 549
                                   shared=False) as task:
547 550
             execute_mock.return_value = states.CLEANWAIT
@@ -558,15 +561,19 @@ class IloManagementTestCase(test_common.BaseIloTest):
558 561
             return_value = task.driver.management.update_firmware_sum(
559 562
                 task, **firmware_update_args)
560 563
             # | THEN |
564
+            attach_vmedia_mock.assert_any_call(
565
+                task.node, 'CDROM', 'http://any_url')
561 566
             self.assertEqual(states.CLEANWAIT, return_value)
562 567
             execute_mock.assert_called_once_with(task, clean_step)
563 568
 
569
+    @mock.patch.object(ilo_common, 'attach_vmedia', spec_set=True,
570
+                       autospec=True)
564 571
     @mock.patch.object(ilo_management.firmware_processor,
565 572
                        'get_swift_url', autospec=True)
566 573
     @mock.patch.object(deploy_utils, 'agent_execute_clean_step',
567 574
                        autospec=True)
568
-    def test_update_firmware_sum_mode_swift_url(self, execute_mock,
569
-                                                swift_url_mock):
575
+    def test_update_firmware_sum_mode_swift_url(
576
+            self, execute_mock, swift_url_mock, attach_vmedia_mock):
570 577
         with task_manager.acquire(self.context, self.node.uuid,
571 578
                                   shared=False) as task:
572 579
             swift_url_mock.return_value = "http://path-to-file"
@@ -584,13 +591,18 @@ class IloManagementTestCase(test_common.BaseIloTest):
584 591
             return_value = task.driver.management.update_firmware_sum(
585 592
                 task, **firmware_update_args)
586 593
             # | THEN |
594
+            attach_vmedia_mock.assert_any_call(
595
+                task.node, 'CDROM', 'http://path-to-file')
587 596
             self.assertEqual(states.CLEANWAIT, return_value)
588 597
             self.assertEqual(task.node.clean_step['args']['url'],
589 598
                              "http://path-to-file")
590 599
 
600
+    @mock.patch.object(ilo_common, 'attach_vmedia', spec_set=True,
601
+                       autospec=True)
591 602
     @mock.patch.object(deploy_utils, 'agent_execute_clean_step',
592 603
                        autospec=True)
593
-    def test_update_firmware_sum_mode_without_component(self, execute_mock):
604
+    def test_update_firmware_sum_mode_without_component(
605
+            self, execute_mock, attach_vmedia_mock):
594 606
         with task_manager.acquire(self.context, self.node.uuid,
595 607
                                   shared=False) as task:
596 608
             execute_mock.return_value = states.CLEANWAIT
@@ -606,6 +618,8 @@ class IloManagementTestCase(test_common.BaseIloTest):
606 618
             return_value = task.driver.management.update_firmware_sum(
607 619
                 task, **firmware_update_args)
608 620
             # | THEN |
621
+            attach_vmedia_mock.assert_any_call(
622
+                task.node, 'CDROM', 'any_valid_url')
609 623
             self.assertEqual(states.CLEANWAIT, return_value)
610 624
             execute_mock.assert_called_once_with(task, clean_step)
611 625
 

+ 8
- 0
releasenotes/notes/story-2006223-ilo-hpsum-firmware-update-fails-622883e4785313c1.yaml View File

@@ -0,0 +1,8 @@
1
+---
2
+fixes:
3
+  - |
4
+    Fixes an issue in updating firmware using ``update_firmware_sum`` clean
5
+    step from management interface of ``ilo`` hardware type with an error
6
+    stating that unable to connect to iLO address due to authentication
7
+    failure. See `story 2006223
8
+    <https://storyboard.openstack.org/#!/story/2006223>`__ for details.

Loading…
Cancel
Save