From 31711e9444a202e0657ccde62c113bcddfe733dc Mon Sep 17 00:00:00 2001 From: Imre Farkas Date: Mon, 5 Oct 2015 14:37:55 +0200 Subject: [PATCH] Add boot management Change-Id: I51d712a24948726e7c7c03530cf8fd7953f5f190 --- dracclient/client.py | 86 +++++++++ dracclient/resources/bios.py | 170 +++++++++++++++++ dracclient/resources/lifecycle_controller.py | 44 +++++ dracclient/tests/test_client.py | 175 ++++++++++++++++++ dracclient/tests/utils.py | 23 +++ .../boot_config_setting-enum-ok.xml | 54 ++++++ ...change_boot_order_by_instance_id-error.xml | 17 ++ ...ke-change_boot_order_by_instance_id-ok.xml | 17 ++ .../boot_source_setting-enum-ok-11g.xml | 85 +++++++++ .../boot_source_setting-enum-ok.xml | 139 ++++++++++++++ .../tests/wsman_mocks/system_view-enum-ok.xml | 23 +++ 11 files changed, 833 insertions(+) create mode 100644 dracclient/resources/lifecycle_controller.py create mode 100644 dracclient/tests/wsman_mocks/boot_config_setting-enum-ok.xml create mode 100644 dracclient/tests/wsman_mocks/boot_config_setting-invoke-change_boot_order_by_instance_id-error.xml create mode 100644 dracclient/tests/wsman_mocks/boot_config_setting-invoke-change_boot_order_by_instance_id-ok.xml create mode 100644 dracclient/tests/wsman_mocks/boot_source_setting-enum-ok-11g.xml create mode 100644 dracclient/tests/wsman_mocks/boot_source_setting-enum-ok.xml create mode 100644 dracclient/tests/wsman_mocks/system_view-enum-ok.xml diff --git a/dracclient/client.py b/dracclient/client.py index 140d555..de3f2d5 100644 --- a/dracclient/client.py +++ b/dracclient/client.py @@ -20,6 +20,8 @@ import logging from dracclient import exceptions from dracclient.resources import bios from dracclient.resources import job +from dracclient.resources import lifecycle_controller +from dracclient.resources import uris from dracclient import utils from dracclient import wsman @@ -29,6 +31,8 @@ LOG = logging.getLogger(__name__) class DRACClient(object): """Client for managing DRAC nodes""" + BIOS_DEVICE_FQDD = 'BIOS.Setup.1-1' + def __init__(self, host, username, password, port=443, path='/wsman', protocol='https'): """Creates client object @@ -44,6 +48,7 @@ class DRACClient(object): protocol) self._job_mgmt = job.JobManagement(self.client) self._power_mgmt = bios.PowerManagement(self.client) + self._boot_mgmt = bios.BootManagement(self.client) def get_power_state(self): """Returns the current power state of the node @@ -71,6 +76,46 @@ class DRACClient(object): """ self._power_mgmt.set_power_state(target_state) + def list_boot_modes(self): + """Returns the list of boot modes + + :returns: list of BootMode objects + :raises: WSManRequestFailure on request failures + :raises: WSManInvalidResponse when receiving invalid response + :raises: DRACOperationFailed on error reported back by the DRAC + interface + """ + return self._boot_mgmt.list_boot_modes() + + def list_boot_devices(self): + """Returns the list of boot devices + + :returns: a dictionary with the boot modes and the list of associated + BootDevice objects, ordered by the pending_assigned_sequence + property + :raises: WSManRequestFailure on request failures + :raises: WSManInvalidResponse when receiving invalid response + :raises: DRACOperationFailed on error reported back by the DRAC + interface + """ + return self._boot_mgmt.list_boot_devices() + + def change_boot_device_order(self, boot_mode, boot_device_list): + """Changes the boot device sequence for a boot mode + + :param boot_mode: boot mode for which the boot device list is to be + changed + :param boot_device_list: a list of boot device ids in an order + representing the desired boot sequence + :raises: WSManRequestFailure on request failures + :raises: WSManInvalidResponse when receiving invalid response + :raises: DRACOperationFailed on error reported back by the DRAC + interface + :raises: DRACUnexpectedReturnValue on return value mismatch + """ + return self._boot_mgmt.change_boot_device_order(boot_mode, + boot_device_list) + def list_jobs(self, only_unfinished=False): """Returns a list of jobs from the job queue @@ -163,6 +208,47 @@ class DRACClient(object): resource_uri, cim_creation_class_name, cim_name, target, cim_system_creation_class_name, cim_system_name) + def commit_pending_bios_changes(self): + """Applies all pending changes on the BIOS by creating a config job + + :returns: id of the created job + :raises: WSManRequestFailure on request failures + :raises: WSManInvalidResponse when receiving invalid response + :raises: DRACOperationFailed on error reported back by the DRAC + interface + :raises: DRACUnexpectedReturnValue on return value mismatch + """ + return self._job_mgmt.create_config_job( + resource_uri=uris.DCIM_BIOSService, + cim_creation_class_name='DCIM_BIOSService', + cim_name='DCIM:BIOSService', target=self.BIOS_DEVICE_FQDD) + + def abandon_pending_bios_changes(self): + """Deletes all pending changes on the BIOS + + :raises: WSManRequestFailure on request failures + :raises: WSManInvalidResponse when receiving invalid response + :raises: DRACOperationFailed on error reported back by the DRAC + interface + :raises: DRACUnexpectedReturnValue on return value mismatch + """ + self._job_mgmt.delete_pending_config( + resource_uri=uris.DCIM_BIOSService, + cim_creation_class_name='DCIM_BIOSService', + cim_name='DCIM:BIOSService', target=self.BIOS_DEVICE_FQDD) + + def get_lifecycle_controller_version(self): + """Returns the Lifecycle controller version + + :returns: Lifecycle controller version as a tuple of integers + :raises: WSManRequestFailure on request failures + :raises: WSManInvalidResponse when receiving invalid response + :raises: DRACOperationFailed on error reported back by the DRAC + interface + """ + return lifecycle_controller.LifecycleControllerManagement( + self.client).get_version() + class WSManClient(wsman.Client): """Wrapper for wsman.Client with return value checking""" diff --git a/dracclient/resources/bios.py b/dracclient/resources/bios.py index ff06aa2..eb8a9c3 100644 --- a/dracclient/resources/bios.py +++ b/dracclient/resources/bios.py @@ -11,8 +11,11 @@ # License for the specific language governing permissions and limitations # under the License. +import collections + from dracclient import constants from dracclient import exceptions +from dracclient.resources import lifecycle_controller from dracclient.resources import uris from dracclient import utils @@ -24,6 +27,28 @@ POWER_STATES = { REVERSE_POWER_STATES = dict((v, k) for (k, v) in POWER_STATES.items()) +BOOT_MODE_IS_CURRENT = { + '1': True, + '2': False +} + +BOOT_MODE_IS_NEXT = { + '1': True, # is next + '2': False, # is not next + '3': True # is next for single use (one time boot only) +} + +LC_CONTROLLER_VERSION_12G = (2, 0, 0) + +BootMode = collections.namedtuple('BootMode', ['id', 'name', 'is_current', + 'is_next']) + +BootDevice = collections.namedtuple('BootDevice', + ['id', 'boot_mode', + 'current_assigned_sequence', + 'pending_assigned_sequence', + 'bios_boot_string']) + class PowerManagement(object): @@ -82,3 +107,148 @@ class PowerManagement(object): self.client.invoke(uris.DCIM_ComputerSystem, 'RequestStateChange', selectors, properties) + + +class BootManagement(object): + + def __init__(self, client): + """Creates BootManagement object + + :param client: an instance of WSManClient + """ + self.client = client + + def list_boot_modes(self): + """Returns the list of boot modes + + :returns: list of BootMode objects + :raises: WSManRequestFailure on request failures + :raises: WSManInvalidResponse when receiving invalid response + :raises: DRACOperationFailed on error reported back by the DRAC + interface + """ + + doc = self.client.enumerate(uris.DCIM_BootConfigSetting) + + drac_boot_modes = utils.find_xml(doc, 'DCIM_BootConfigSetting', + uris.DCIM_BootConfigSetting, + find_all=True) + + return [self._parse_drac_boot_mode(drac_boot_mode) + for drac_boot_mode in drac_boot_modes] + + def list_boot_devices(self): + """Returns the list of boot devices + + :returns: a dictionary with the boot modes and the list of associated + BootDevice objects, ordered by the pending_assigned_sequence + property + :raises: WSManRequestFailure on request failures + :raises: WSManInvalidResponse when receiving invalid response + :raises: DRACOperationFailed on error reported back by the DRAC + interface + """ + + doc = self.client.enumerate(uris.DCIM_BootSourceSetting) + + drac_boot_devices = utils.find_xml(doc, 'DCIM_BootSourceSetting', + uris.DCIM_BootSourceSetting, + find_all=True) + try: + boot_devices = [self._parse_drac_boot_device(drac_boot_device) + for drac_boot_device in drac_boot_devices] + except AttributeError: + # DRAC 11g doesn't have the BootSourceType attribute on the + # DCIM_BootSourceSetting resource + controller_version = ( + lifecycle_controller.LifecycleControllerManagement( + self.client).get_version()) + + if controller_version < LC_CONTROLLER_VERSION_12G: + boot_devices = [ + self._parse_drac_boot_device_11g(drac_boot_device) + for drac_boot_device in drac_boot_devices] + else: + raise + + # group devices by boot mode + boot_devices_per_mode = {device.boot_mode: [] + for device in boot_devices} + for device in boot_devices: + boot_devices_per_mode[device.boot_mode].append(device) + + # sort the device list by pending assigned seqeuence + for mode in boot_devices_per_mode.keys(): + boot_devices_per_mode[mode].sort( + key=lambda device: device.pending_assigned_sequence) + + return boot_devices_per_mode + + def change_boot_device_order(self, boot_mode, boot_device_list): + """Changes the boot device sequence for a boot mode + + :param boot_mode: boot mode for which the boot device list is to be + changed + :param boot_device_list: a list of boot device ids in an order + representing the desired boot sequence + :raises: WSManRequestFailure on request failures + :raises: WSManInvalidResponse when receiving invalid response + :raises: DRACOperationFailed on error reported back by the DRAC + interface + :raises: DRACUnexpectedReturnValue on return value mismatch + """ + + selectors = {'InstanceID': boot_mode} + properties = {'source': boot_device_list} + + self.client.invoke(uris.DCIM_BootConfigSetting, + 'ChangeBootOrderByInstanceID', selectors, + properties, expected_return_value=utils.RET_SUCCESS) + + def _parse_drac_boot_mode(self, drac_boot_mode): + return BootMode( + id=self._get_boot_mode_attr(drac_boot_mode, 'InstanceID'), + name=self._get_boot_mode_attr(drac_boot_mode, 'ElementName'), + is_current=BOOT_MODE_IS_CURRENT[self._get_boot_mode_attr( + drac_boot_mode, 'IsCurrent')], + is_next=BOOT_MODE_IS_NEXT[self._get_boot_mode_attr( + drac_boot_mode, 'IsNext')]) + + def _get_boot_mode_attr(self, drac_boot_mode, attr_name): + return utils.get_wsman_resource_attr(drac_boot_mode, + uris.DCIM_BootConfigSetting, + attr_name) + + def _parse_drac_boot_device_common(self, drac_boot_device, instance_id, + boot_mode): + return BootDevice( + id=instance_id, + boot_mode=boot_mode, + current_assigned_sequence=int(self._get_boot_device_attr( + drac_boot_device, 'CurrentAssignedSequence')), + pending_assigned_sequence=int(self._get_boot_device_attr( + drac_boot_device, 'PendingAssignedSequence')), + bios_boot_string=self._get_boot_device_attr(drac_boot_device, + 'BIOSBootString')) + + def _parse_drac_boot_device(self, drac_boot_device): + instance_id = self._get_boot_device_attr(drac_boot_device, + 'InstanceID') + boot_mode = self._get_boot_device_attr(drac_boot_device, + 'BootSourceType') + + return self._parse_drac_boot_device_common(drac_boot_device, + instance_id, boot_mode) + + def _parse_drac_boot_device_11g(self, drac_boot_device): + instance_id = self._get_boot_device_attr(drac_boot_device, + 'InstanceID') + boot_mode = instance_id.split(':')[0] + + return self._parse_drac_boot_device_common(drac_boot_device, + instance_id, boot_mode) + + def _get_boot_device_attr(self, drac_boot_device, attr_name): + return utils.get_wsman_resource_attr(drac_boot_device, + uris.DCIM_BootSourceSetting, + attr_name) diff --git a/dracclient/resources/lifecycle_controller.py b/dracclient/resources/lifecycle_controller.py new file mode 100644 index 0000000..b8a715c --- /dev/null +++ b/dracclient/resources/lifecycle_controller.py @@ -0,0 +1,44 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from dracclient.resources import uris +from dracclient import utils + + +class LifecycleControllerManagement(object): + + def __init__(self, client): + """Creates LifecycleControllerManagement object + + :param client: an instance of WSManClient + """ + self.client = client + + def get_version(self): + """Returns the Lifecycle controller version + + :returns: Lifecycle controller version as a tuple of integers + :raises: WSManRequestFailure on request failures + :raises: WSManInvalidResponse when receiving invalid response + :raises: DRACOperationFailed on error reported back by the DRAC + interface + """ + + filter_query = ('select LifecycleControllerVersion ' + 'from DCIM_SystemView') + doc = self.client.enumerate(uris.DCIM_SystemView, + filter_query=filter_query) + lc_version_str = utils.find_xml(doc, 'LifecycleControllerVersion', + uris.DCIM_SystemView).text + + return tuple(map(int, (lc_version_str.split('.')))) diff --git a/dracclient/tests/test_client.py b/dracclient/tests/test_client.py index c451d32..d62a56c 100644 --- a/dracclient/tests/test_client.py +++ b/dracclient/tests/test_client.py @@ -17,7 +17,9 @@ import requests_mock import dracclient.client from dracclient import exceptions +from dracclient.resources import bios import dracclient.resources.job +from dracclient.resources import lifecycle_controller from dracclient.resources import uris from dracclient.tests import base from dracclient.tests import utils as test_utils @@ -61,6 +63,132 @@ class ClientPowerManagementTestCase(base.BaseTest): self.drac_client.set_power_state, 'foo') +class ClientBootManagementTestCase(base.BaseTest): + + def setUp(self): + super(ClientBootManagementTestCase, self).setUp() + self.drac_client = dracclient.client.DRACClient( + **test_utils.FAKE_ENDPOINT) + + @requests_mock.Mocker() + def test_list_boot_modes(self, mock_requests): + expected_boot_mode = bios.BootMode(id='IPL', name='BootSeq', + is_current=True, is_next=True) + mock_requests.post( + 'https://1.2.3.4:443/wsman', + text=test_utils.BIOSEnumerations[ + uris.DCIM_BootConfigSetting]['ok']) + + boot_modes = self.drac_client.list_boot_modes() + + self.assertEqual(5, len(boot_modes)) + self.assertIn(expected_boot_mode, boot_modes) + + @requests_mock.Mocker() + def test_list_boot_devices(self, mock_requests): + 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) + + @requests_mock.Mocker() + @mock.patch.object(lifecycle_controller.LifecycleControllerManagement, + 'get_version', spec_set=True, autospec=True) + def test_list_boot_devices_11g(self, mock_requests, + mock_get_lifecycle_controller_version): + 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) + + @requests_mock.Mocker() + def test_change_boot_device_order(self, mock_requests): + mock_requests.post( + 'https://1.2.3.4:443/wsman', + text=test_utils.BIOSInvocations[ + uris.DCIM_BootConfigSetting][ + 'ChangeBootOrderByInstanceID']['ok']) + + self.assertIsNone( + self.drac_client.change_boot_device_order('IPL', 'foo')) + + @mock.patch.object(dracclient.client.WSManClient, 'invoke', + spec_set=True, autospec=True) + def test_change_boot_device_order_list(self, mock_invoke): + expected_selectors = {'InstanceID': 'IPL'} + expected_properties = {'source': ['foo', 'bar', 'baz']} + mock_invoke.return_value = lxml.etree.fromstring( + test_utils.BIOSInvocations[uris.DCIM_BootConfigSetting][ + 'ChangeBootOrderByInstanceID']['ok']) + + self.drac_client.change_boot_device_order('IPL', + ['foo', 'bar', 'baz']) + + mock_invoke.assert_called_once_with( + mock.ANY, uris.DCIM_BootConfigSetting, + 'ChangeBootOrderByInstanceID', expected_selectors, + expected_properties, expected_return_value=utils.RET_SUCCESS) + + @requests_mock.Mocker() + def test_change_boot_device_order_error(self, mock_requests): + mock_requests.post( + 'https://1.2.3.4:443/wsman', + text=test_utils.BIOSInvocations[ + uris.DCIM_BootConfigSetting][ + 'ChangeBootOrderByInstanceID']['error']) + + self.assertRaises( + exceptions.DRACOperationFailed, + self.drac_client.change_boot_device_order, 'IPL', 'foo') + + class ClientJobManagementTestCase(base.BaseTest): def setUp(self): @@ -240,6 +368,53 @@ class ClientJobManagementTestCase(base.BaseTest): cim_creation_class_name, cim_name, target) +class ClientBIOSChangesTestCase(base.BaseTest): + + def setUp(self): + super(ClientBIOSChangesTestCase, self).setUp() + self.drac_client = dracclient.client.DRACClient( + **test_utils.FAKE_ENDPOINT) + + @mock.patch.object(dracclient.resources.job.JobManagement, + 'create_config_job', spec_set=True, autospec=True) + def test_commit_pending_bios_changes(self, mock_create_config_job): + self.drac_client.commit_pending_bios_changes() + + mock_create_config_job.assert_called_once_with( + mock.ANY, resource_uri=uris.DCIM_BIOSService, + cim_creation_class_name='DCIM_BIOSService', + cim_name='DCIM:BIOSService', target='BIOS.Setup.1-1') + + @mock.patch.object(dracclient.resources.job.JobManagement, + 'delete_pending_config', spec_set=True, autospec=True) + def test_abandon_pending_bios_changes(self, mock_delete_pending_config): + self.drac_client.abandon_pending_bios_changes() + + mock_delete_pending_config.assert_called_once_with( + mock.ANY, resource_uri=uris.DCIM_BIOSService, + cim_creation_class_name='DCIM_BIOSService', + cim_name='DCIM:BIOSService', target='BIOS.Setup.1-1') + + +class ClientLifecycleControllerManagementTestCase(base.BaseTest): + + def setUp(self): + super(ClientLifecycleControllerManagementTestCase, self).setUp() + self.drac_client = dracclient.client.DRACClient( + **test_utils.FAKE_ENDPOINT) + + @requests_mock.Mocker() + def test_get_lifecycle_controller_version(self, mock_requests): + mock_requests.post( + 'https://1.2.3.4:443/wsman', + text=test_utils.LifecycleControllerEnumerations[ + uris.DCIM_SystemView]['ok']) + + version = self.drac_client.get_lifecycle_controller_version() + + self.assertEqual((2, 1, 0), version) + + @requests_mock.Mocker() class WSManClientTestCase(base.BaseTest): diff --git a/dracclient/tests/utils.py b/dracclient/tests/utils.py index 146e699..1446773 100644 --- a/dracclient/tests/utils.py +++ b/dracclient/tests/utils.py @@ -47,6 +47,13 @@ BIOSEnumerations = { uris.DCIM_ComputerSystem: { 'ok': load_wsman_xml('computer_system-enum-ok') }, + uris.DCIM_BootConfigSetting: { + 'ok': load_wsman_xml('boot_config_setting-enum-ok') + }, + uris.DCIM_BootSourceSetting: { + 'ok': load_wsman_xml('boot_source_setting-enum-ok'), + 'ok-11g': load_wsman_xml('boot_source_setting-enum-ok-11g') + } } BIOSInvocations = { @@ -58,6 +65,16 @@ BIOSInvocations = { 'computer_system-invoke-request_state_change-error'), }, }, + uris.DCIM_BootConfigSetting: { + 'ChangeBootOrderByInstanceID': { + 'ok': load_wsman_xml( + 'boot_config_setting-invoke-change_boot_order_by_instance_id-' + 'ok'), + 'error': load_wsman_xml( + 'boot_config_setting-invoke-change_boot_order_by_instance_id-' + 'error'), + } + } } JobEnumerations = { @@ -83,3 +100,9 @@ JobInvocations = { }, } } + +LifecycleControllerEnumerations = { + uris.DCIM_SystemView: { + 'ok': load_wsman_xml('system_view-enum-ok') + }, +} diff --git a/dracclient/tests/wsman_mocks/boot_config_setting-enum-ok.xml b/dracclient/tests/wsman_mocks/boot_config_setting-enum-ok.xml new file mode 100644 index 0000000..48c7d50 --- /dev/null +++ b/dracclient/tests/wsman_mocks/boot_config_setting-enum-ok.xml @@ -0,0 +1,54 @@ + + + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse + uuid:0fa1f933-4c3c-480f-8a35-75035f9fbfad + uuid:6fa24f5f-2170-1170-8ea5-a36fc6fe83b0 + + + + + + BootSeq + IPL + 1 + 0 + 1 + + + HddSeq + BCV + 2 + 0 + 2 + + + UefiBootSeq + UEFI + 2 + 0 + 2 + + + OneTimeBootMode + OneTime + 2 + 0 + 2 + + + vFlash Boot Configuration + vFlash + 2 + 0 + 2 + + + + + + \ No newline at end of file diff --git a/dracclient/tests/wsman_mocks/boot_config_setting-invoke-change_boot_order_by_instance_id-error.xml b/dracclient/tests/wsman_mocks/boot_config_setting-invoke-change_boot_order_by_instance_id-error.xml new file mode 100644 index 0000000..70e47fe --- /dev/null +++ b/dracclient/tests/wsman_mocks/boot_config_setting-invoke-change_boot_order_by_instance_id-error.xml @@ -0,0 +1,17 @@ + + + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_BootConfigSetting/ChangeBootOrderByInstanceIDResponse + uuid:9c14b4d7-9d68-4240-a523-bfe733ec3c19 + uuid:072e2dd9-2188-1188-8ea8-a36fc6fe83b0 + + + + Boot Source does not belong to specified Boot Configuration + BOOT007 + 2 + + + \ No newline at end of file diff --git a/dracclient/tests/wsman_mocks/boot_config_setting-invoke-change_boot_order_by_instance_id-ok.xml b/dracclient/tests/wsman_mocks/boot_config_setting-invoke-change_boot_order_by_instance_id-ok.xml new file mode 100644 index 0000000..028796a --- /dev/null +++ b/dracclient/tests/wsman_mocks/boot_config_setting-invoke-change_boot_order_by_instance_id-ok.xml @@ -0,0 +1,17 @@ + + + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_BootConfigSetting/ChangeBootOrderByInstanceIDResponse + uuid:6489f08e-43f8-4616-9c8e-46502a0d297e + uuid:14c20b22-2188-1188-8ead-a36fc6fe83b0 + + + + The command was successful + BOOT001 + 0 + + + \ No newline at end of file diff --git a/dracclient/tests/wsman_mocks/boot_source_setting-enum-ok-11g.xml b/dracclient/tests/wsman_mocks/boot_source_setting-enum-ok-11g.xml new file mode 100644 index 0000000..ff92f72 --- /dev/null +++ b/dracclient/tests/wsman_mocks/boot_source_setting-enum-ok-11g.xml @@ -0,0 +1,85 @@ + + + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse + uuid:307f8c7a-e08f-491c-906f-97917d12aca3 + uuid:a6d469c4-0340-1340-8003-96a61a2b2b84 + + + + + + Embedded NIC 1: BRCM MBA Slot 0200 v7.2.3 BootSeq + Embedded NIC 1: BRCM MBA Slot 0200 v7.2.3 BootSeq + 0 + 1 + Embedded NIC 1: BRCM MBA Slot 0200 v7.2.3 BootSeq + 1 + IPL:NIC.Embedded.1-1:082927b7c62a9f52ef0d65a33416d76c + 0 + 1 + + + Hard drive C: BootSeq + Hard drive C: BootSeq + 1 + 1 + Hard drive C: BootSeq + 1 + IPL:HardDisk.List.1-1:c9203080df84781e2ca3d512883dee6f + 1 + 1 + + + Embedded SATA Port A Optical: SATA Optical Drive BootSeq + Embedded SATA Port A Optical: SATA Optical Drive BootSeq + 2 + 1 + Embedded SATA Port A Optical: SATA Optical Drive BootSeq + 1 + IPL:Optical.SATAEmbedded.A-1:eb8aeb15796fb85f8e1447f0cfb8a68e + 2 + 1 + + + Integrated SAS: #0100 ID0B LUN0 FUJITSU MBD2147RC HddSeq + Integrated SAS: #0100 ID0B LUN0 FUJITSU MBD2147RC HddSeq + 0 + 1 + Integrated SAS: #0100 ID0B LUN0 FUJITSU MBD2147RC HddSeq + 2 + BCV:RAID.Integrated.1-1:b0288ef62190fe49448c0c8bd58e3299 + 0 + 1 + + + Embedded SATA Port A Optical: TEAC DVD-ROM DV-28SW UefiBootSeq + Embedded SATA Port A Optical: TEAC DVD-ROM DV-28SW UefiBootSeq + 0 + 1 + Embedded SATA Port A Optical: TEAC DVD-ROM DV-28SW UefiBootSeq + 1 + UEFI:Optical.SATAEmbedded.A-1:f4517f4fe99654f4b3d1f2cf5ffa1236 + 0 + 1 + + + Embedded NIC 1: Broadcom NetXtreme II Gigabit Ethernet (BCM5709) UefiBootSeq + Embedded NIC 1: Broadcom NetXtreme II Gigabit Ethernet (BCM5709) UefiBootSeq + 1 + 1 + Embedded NIC 1: Broadcom NetXtreme II Gigabit Ethernet (BCM5709) UefiBootSeq + 1 + UEFI:NIC.Embedded.1-1:764aa69cc6ae153bf9aa038a0cf31bf2 + 1 + 1 + + + + + + \ No newline at end of file diff --git a/dracclient/tests/wsman_mocks/boot_source_setting-enum-ok.xml b/dracclient/tests/wsman_mocks/boot_source_setting-enum-ok.xml new file mode 100644 index 0000000..1f6535e --- /dev/null +++ b/dracclient/tests/wsman_mocks/boot_source_setting-enum-ok.xml @@ -0,0 +1,139 @@ + + + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse + uuid:8228360f-4368-4377-a020-7b86001ec6a2 + uuid:9daff045-2172-1172-8ea7-a36fc6fe83b0 + + + + + + Embedded SATA Port Optical Drive E: HL-DT-ST DVD-ROM DU90N BootSeq + IPL + Embedded SATA Port Optical Drive E: HL-DT-ST DVD-ROM DU90N BootSeq + 1 + 1 + Embedded SATA Port Optical Drive E: HL-DT-ST DVD-ROM DU90N BootSeq + 1 + IPL:BIOS.Setup.1-1#BootSeq#Optical.SATAEmbedded.E-1#9cfba379c4a2890f7f419c75db47d605 + 1 + 1 + + + Embedded NIC 1 Port 1 Partition 1: BRCM MBA Slot 0200 v16.4.3 BootSeq + IPL + Embedded NIC 1 Port 1 Partition 1: BRCM MBA Slot 0200 v16.4.3 BootSeq + 0 + 1 + Embedded NIC 1 Port 1 Partition 1: BRCM MBA Slot 0200 v16.4.3 BootSeq + 1 + IPL:BIOS.Setup.1-1#BootSeq#NIC.Embedded.1-1-1#fbeeb18f19fd4e768c941e66af4fc424 + 0 + 1 + + + Hard drive C: BootSeq + IPL + Hard drive C: BootSeq + 2 + 1 + Hard drive C: BootSeq + 1 + IPL:BIOS.Setup.1-1#BootSeq#HardDisk.List.1-1#c9203080df84781e2ca3d512883dee6f + 2 + 1 + + + Integrated RAID Controller 1: PERC H710 Mini(bus 01 dev 00) HddSeq + BCV + Integrated RAID Controller 1: PERC H710 Mini(bus 01 dev 00) HddSeq + 0 + 1 + Integrated RAID Controller 1: PERC H710 Mini(bus 01 dev 00) HddSeq + 2 + BCV:BIOS.Setup.1-1#HddSeq#RAID.Integrated.1-1#aa80b1ccc4782ee46ad0015e60b9f8bc + 0 + 1 + + + Embedded SATA Port Optical Drive E: HL-DT-ST DVD-ROM DU90N UefiBootSeq + UEFI + Embedded SATA Port Optical Drive E: HL-DT-ST DVD-ROM DU90N UefiBootSeq + 0 + 1 + Embedded SATA Port Optical Drive E: HL-DT-ST DVD-ROM DU90N UefiBootSeq + 1 + UEFI:BIOS.Setup.1-1#UefiBootSeq#Optical.SATAEmbedded.E-1#e63a20057ae7c7a24a2dcfe561ab3059 + 0 + 1 + + + Embedded NIC 1 Port 1 Partition 1: EFI Network 1 UefiBootSeq + UEFI + Embedded NIC 1 Port 1 Partition 1: EFI Network 1 UefiBootSeq + 1 + 0 + Embedded NIC 1 Port 1 Partition 1: EFI Network 1 UefiBootSeq + 1 + UEFI:BIOS.Setup.1-1#UefiBootSeq#NIC.Embedded.1-1-1#4957070f0aa1fcff841e886b4011e6e5 + 1 + 0 + + + Embedded NIC 2 Port 1 Partition 1: EFI Network 2 UefiBootSeq + UEFI + Embedded NIC 2 Port 1 Partition 1: EFI Network 2 UefiBootSeq + 2 + 0 + Embedded NIC 2 Port 1 Partition 1: EFI Network 2 UefiBootSeq + 1 + UEFI:BIOS.Setup.1-1#UefiBootSeq#NIC.Embedded.2-1-1#236af982351f674f952c4db458fe40ab + 2 + 0 + + + NIC in Slot 2 Port 1 Partition 1: EFI Network 3 UefiBootSeq + UEFI + NIC in Slot 2 Port 1 Partition 1: EFI Network 3 UefiBootSeq + 3 + 0 + NIC in Slot 2 Port 1 Partition 1: EFI Network 3 UefiBootSeq + 1 + UEFI:BIOS.Setup.1-1#UefiBootSeq#NIC.Slot.2-1-1#d4dcb3203b7a0e381ffa1c5df5873890 + 3 + 0 + + + NIC in Slot 2 Port 2 Partition 1: EFI Network 4 UefiBootSeq + UEFI + NIC in Slot 2 Port 2 Partition 1: EFI Network 4 UefiBootSeq + 4 + 0 + NIC in Slot 2 Port 2 Partition 1: EFI Network 4 UefiBootSeq + 1 + UEFI:BIOS.Setup.1-1#UefiBootSeq#NIC.Slot.2-2-1#f438b57a48e180b211662c463cd406b1 + 4 + 0 + + + Unavailable: Windows Boot Manager UefiBootSeq + UEFI + Unavailable: Windows Boot Manager UefiBootSeq + 5 + 1 + Unavailable: Windows Boot Manager UefiBootSeq + 1 + UEFI:BIOS.Setup.1-1#UefiBootSeq#Unknown.Unknown.6-1#f80cdb0ddd723411affd9b05852b3f4a + 5 + 1 + + + + + + \ No newline at end of file diff --git a/dracclient/tests/wsman_mocks/system_view-enum-ok.xml b/dracclient/tests/wsman_mocks/system_view-enum-ok.xml new file mode 100644 index 0000000..ad2d5a5 --- /dev/null +++ b/dracclient/tests/wsman_mocks/system_view-enum-ok.xml @@ -0,0 +1,23 @@ + + + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse + uuid:c4710f54-6fd5-4719-859c-7e69080b99e6 + uuid:3b67422f-215c-115c-8e9f-a36fc6fe83b0 + + + + + + System.Embedded.1 + 2.1.0 + + + + + + \ No newline at end of file