Esempio n. 1
0
    def test_list_boot_devices_11g(self, mock_requests,
                                   mock_get_lifecycle_controller_version,
                                   mock_wait_until_idrac_is_ready):
        expected_boot_device = bios.BootDevice(
            id=('IPL:NIC.Embedded.1-1:082927b7c62a9f52ef0d65a33416d76c'),
            boot_mode='IPL',
            pending_assigned_sequence=0,
            current_assigned_sequence=0,
            bios_boot_string=('Embedded NIC 1: '
                              'BRCM MBA Slot 0200 v7.2.3 BootSeq'))

        mock_requests.post('https://1.2.3.4:443/wsman',
                           text=test_utils.BIOSEnumerations[
                               uris.DCIM_BootSourceSetting]['ok-11g'])
        mock_get_lifecycle_controller_version.return_value = (1, 0, 0)

        boot_devices = self.drac_client.list_boot_devices()

        self.assertEqual(3, len(boot_devices))
        self.assertIn('IPL', boot_devices)
        self.assertIn('BCV', boot_devices)
        self.assertIn('UEFI', boot_devices)
        self.assertEqual(3, len(boot_devices['IPL']))
        self.assertIn(expected_boot_device, boot_devices['IPL'])
        self.assertEqual(0, boot_devices['IPL'][0].pending_assigned_sequence)
        self.assertEqual(1, boot_devices['IPL'][1].pending_assigned_sequence)
        self.assertEqual(2, boot_devices['IPL'][2].pending_assigned_sequence)
Esempio n. 2
0
    def test_list_boot_devices(self, mock_requests,
                               mock_wait_until_idrac_is_ready):
        expected_boot_device = bios.BootDevice(
            id=('IPL:BIOS.Setup.1-1#BootSeq#NIC.Embedded.1-1-1#'
                'fbeeb18f19fd4e768c941e66af4fc424'),
            boot_mode='IPL',
            pending_assigned_sequence=0,
            current_assigned_sequence=0,
            bios_boot_string=('Embedded NIC 1 Port 1 Partition 1: '
                              'BRCM MBA Slot 0200 v16.4.3 BootSeq'))
        mock_requests.post('https://1.2.3.4:443/wsman',
                           text=test_utils.BIOSEnumerations[
                               uris.DCIM_BootSourceSetting]['ok'])

        boot_devices = self.drac_client.list_boot_devices()

        self.assertEqual(3, len(boot_devices))
        self.assertIn('IPL', boot_devices)
        self.assertIn('BCV', boot_devices)
        self.assertIn('UEFI', boot_devices)
        self.assertEqual(3, len(boot_devices['IPL']))
        self.assertIn(expected_boot_device, boot_devices['IPL'])
        self.assertEqual(0, boot_devices['IPL'][0].pending_assigned_sequence)
        self.assertEqual(1, boot_devices['IPL'][1].pending_assigned_sequence)
        self.assertEqual(2, boot_devices['IPL'][2].pending_assigned_sequence)