├── .gitignore ├── .gitreview ├── CONTRIBUTING.rst ├── HACKING.rst ├── LICENSE ├── README.rst ├── doc ├── requirements.txt └── source │ ├── client-api.rst │ ├── conf.py │ ├── contributing.rst │ ├── index.rst │ └── usage.rst ├── dracclient ├── __init__.py ├── client.py ├── constants.py ├── exceptions.py ├── resources │ ├── __init__.py │ ├── bios.py │ ├── idrac_card.py │ ├── inventory.py │ ├── job.py │ ├── lifecycle_controller.py │ ├── nic.py │ ├── raid.py │ ├── system.py │ └── uris.py ├── tests │ ├── __init__.py │ ├── base.py │ ├── test_bios.py │ ├── test_client.py │ ├── test_idrac_card.py │ ├── test_inventory.py │ ├── test_job.py │ ├── test_lifecycle_controller.py │ ├── test_nic.py │ ├── test_raid.py │ ├── test_system.py │ ├── test_utils.py │ ├── test_wsman.py │ ├── utils.py │ └── wsman_mocks │ │ ├── bios_enumeration-enum-ok.xml │ │ ├── bios_integer-enum-mutable.xml │ │ ├── bios_integer-enum-ok.xml │ │ ├── bios_service-invoke-create_targeted_config_job-error.xml │ │ ├── bios_service-invoke-create_targeted_config_job-ok.xml │ │ ├── bios_service-invoke-delete_pending_configuration-error.xml │ │ ├── bios_service-invoke-delete_pending_configuration-ok.xml │ │ ├── bios_service-invoke-set_attributes-error.xml │ │ ├── bios_service-invoke-set_attributes-ok.xml │ │ ├── bios_string-enum-colliding.xml │ │ ├── bios_string-enum-ok.xml │ │ ├── bios_string-enum-regexp.xml │ │ ├── boot_config_setting-enum-ok.xml │ │ ├── boot_config_setting-invoke-change_boot_order_by_instance_id-error.xml │ │ ├── boot_config_setting-invoke-change_boot_order_by_instance_id-ok.xml │ │ ├── boot_source_setting-enum-ok-11g.xml │ │ ├── boot_source_setting-enum-ok.xml │ │ ├── computer_system-enum-ok.xml │ │ ├── computer_system-invoke-request_state_change-error.xml │ │ ├── computer_system-invoke-request_state_change-ok.xml │ │ ├── controller_view-enum-ok.xml │ │ ├── cpu_view-enum-empty_flag.xml │ │ ├── cpu_view-enum-missing_flags.xml │ │ ├── cpu_view-enum-ok.xml │ │ ├── idrac_service-invoke-set_attributes-ok.xml │ │ ├── idrac_service-reset-error.xml │ │ ├── idrac_service-reset-ok.xml │ │ ├── idraccard_enumeration-enum-ok.xml │ │ ├── idraccard_integer-enum-ok.xml │ │ ├── idraccard_string-enum-ok.xml │ │ ├── job_service-delete-job-id-error.xml │ │ ├── job_service-delete-job-id-ok.xml │ │ ├── lc_enumeration-enum-ok.xml │ │ ├── lc_getremoteservicesapistatus_not_ready.xml │ │ ├── lc_getremoteservicesapistatus_ready.xml │ │ ├── lc_getremoteservicesapistatus_recovery.xml │ │ ├── lc_service-invoke-create_config_job-error.xml │ │ ├── lc_service-invoke-create_config_job-ok.xml │ │ ├── lc_service-invoke-set_attributes-error.xml │ │ ├── lc_service-invoke-set_attributes-ok.xml │ │ ├── lc_string-enum-ok.xml │ │ ├── lifecycle_job-enum-not_found.xml │ │ ├── lifecycle_job-enum-ok.xml │ │ ├── memory_view-enum-ok.xml │ │ ├── nic_enumeration-enum-ok.xml │ │ ├── nic_integer-enum-ok.xml │ │ ├── nic_service-invoke-set_attributes-error.xml │ │ ├── nic_service-invoke-set_attributes-ok.xml │ │ ├── nic_string-enum-colliding.xml │ │ ├── nic_string-enum-ok.xml │ │ ├── nic_view-enum-ok.xml │ │ ├── physical_disk_view-enum-ok.xml │ │ ├── raid_enumeration-enum-ok.xml │ │ ├── raid_integer-enum-ok.xml │ │ ├── raid_service-invoke-clear_foreign_config-invalid_controller.xml │ │ ├── raid_service-invoke-clear_foreign_config-no_foreign_drive.xml │ │ ├── raid_service-invoke-clear_foreign_config-not_supported.xml │ │ ├── raid_service-invoke-clear_foreign_config-ok.xml │ │ ├── raid_service-invoke-convert_physical_disks-error.xml │ │ ├── raid_service-invoke-convert_physical_disks-ok.xml │ │ ├── raid_service-invoke-create_virtual_disk-error.xml │ │ ├── raid_service-invoke-create_virtual_disk-ok.xml │ │ ├── raid_service-invoke-delete_virtual_disk-error.xml │ │ ├── raid_service-invoke-delete_virtual_disk-ok.xml │ │ ├── raid_service-invoke-reset_raid_config-error.xml │ │ ├── raid_service-invoke-reset_raid_config-ok.xml │ │ ├── raid_service-invoke-set_attributes-error.xml │ │ ├── raid_service-invoke-set_attributes-ok.xml │ │ ├── raid_string-enum-ok.xml │ │ ├── system_enumeration-enum-ok.xml │ │ ├── system_integer-enum-ok.xml │ │ ├── system_string-enum-ok.xml │ │ ├── system_view-enum-ok.xml │ │ ├── virtual_disk_view-enum-ok.xml │ │ ├── virtual_disk_view-enum-with-raid-status-ok.xml │ │ ├── wsman-enum_context-1.xml │ │ ├── wsman-enum_context-2.xml │ │ ├── wsman-enum_context-3.xml │ │ └── wsman-enum_context-4.xml ├── utils.py └── wsman.py ├── requirements.txt ├── setup.cfg ├── setup.py ├── test-requirements.txt ├── tox.ini └── zuul.d └── project.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | *.egg-info/ 23 | .installed.cfg 24 | *.egg 25 | 26 | # PyInstaller 27 | # Usually these files are written by a python script from a template 28 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 29 | *.manifest 30 | *.spec 31 | 32 | # Installer logs 33 | pip-log.txt 34 | pip-delete-this-directory.txt 35 | 36 | # Unit test / coverage reports 37 | htmlcov/ 38 | .tox/ 39 | .coverage 40 | .coverage.* 41 | .cache 42 | nosetests.xml 43 | coverage.xml 44 | *,cover 45 | 46 | # Translations 47 | *.mo 48 | *.pot 49 | 50 | # Django stuff: 51 | *.log 52 | 53 | # Sphinx documentation 54 | docs/_build/ 55 | 56 | # PyBuilder 57 | target/ 58 | 59 | # PBR 60 | AUTHORS 61 | ChangeLog -------------------------------------------------------------------------------- /.gitreview: -------------------------------------------------------------------------------- 1 | [gerrit] 2 | host=review.opendev.org 3 | port=29418 4 | project=openstack/python-dracclient.git 5 | -------------------------------------------------------------------------------- /CONTRIBUTING.rst: -------------------------------------------------------------------------------- 1 | How To Contribute 2 | ================= 3 | 4 | If you would like to contribute to the development of OpenStack, you must 5 | follow the steps in this page: 6 | 7 | http://docs.openstack.org/infra/manual/developers.html 8 | 9 | If you already have a good understanding of how the system works and your 10 | OpenStack accounts are set up, you can skip to the development workflow 11 | section of this documentation to learn how changes to OpenStack should be 12 | submitted for review via the Gerrit tool: 13 | 14 | http://docs.openstack.org/infra/manual/developers.html#development-workflow 15 | 16 | Pull requests submitted through GitHub will be ignored. 17 | 18 | Bugs should be filed on Launchpad, not GitHub: 19 | 20 | https://bugs.launchpad.net/python-dracclient 21 | -------------------------------------------------------------------------------- /HACKING.rst: -------------------------------------------------------------------------------- 1 | python-dracclient Style Commandments 2 | ==================================== 3 | 4 | Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/ 5 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ======================== 2 | Team and repository tags 3 | ======================== 4 | 5 | .. image:: https://governance.openstack.org/tc/badges/python-dracclient.svg 6 | :target: https://governance.openstack.org/tc/reference/tags/index.html 7 | 8 | .. Change things from this point on 9 | 10 | python-dracclient 11 | ================= 12 | 13 | Library for managing machines with Dell iDRAC cards. 14 | 15 | * Free software: Apache license 16 | * Documentation: https://docs.openstack.org/python-dracclient/latest 17 | * Source: http://opendev.org/openstack/python-dracclient 18 | * Bugs: https://bugs.launchpad.net/python-dracclient 19 | -------------------------------------------------------------------------------- /doc/requirements.txt: -------------------------------------------------------------------------------- 1 | # The order of packages is significant, because pip processes them in the order 2 | # of appearance. Changing the order has an impact on the overall integration 3 | # process, which may cause wedges in the gate later. 4 | 5 | sphinx!=1.6.6,!=1.6.7,!=2.1.0;python_version>='3.4' # BSD 6 | openstackdocstheme # Apache-2.0 7 | -------------------------------------------------------------------------------- /doc/source/client-api.rst: -------------------------------------------------------------------------------- 1 | Client API 2 | ========== 3 | 4 | 5 | Power management 6 | ---------------- 7 | 8 | get_power_state 9 | ~~~~~~~~~~~~~~~ 10 | Returns the current power state of the node. 11 | 12 | set_power_state 13 | ~~~~~~~~~~~~~~~ 14 | Turns the server power on/off or do a reboot. 15 | 16 | Required parameters: 17 | 18 | * ``target_state``: target power state. Valid options are: ``POWER_ON``, 19 | ``POWER_OFF`` and ``REBOOT``. 20 | 21 | 22 | Boot management 23 | --------------- 24 | 25 | list_boot_modes 26 | ~~~~~~~~~~~~~~~ 27 | Returns the list of boot modes. 28 | 29 | list_boot_devices 30 | ~~~~~~~~~~~~~~~~~ 31 | Returns the list of boot devices. 32 | 33 | change_boot_device_order 34 | ~~~~~~~~~~~~~~~~~~~~~~~~ 35 | Changes the boot device sequence for a boot mode. 36 | 37 | Required parameters: 38 | 39 | * ``boot_mode``: boot mode for which the boot device list is to be changed. 40 | 41 | * ``boot_device_list``: a list of boot device ids in an order representing the 42 | desired boot sequence. 43 | 44 | 45 | BIOS configuration 46 | ------------------ 47 | 48 | list_bios_settings 49 | ~~~~~~~~~~~~~~~~~~ 50 | Lists the BIOS configuration settings. 51 | 52 | set_bios_settings 53 | ~~~~~~~~~~~~~~~~~ 54 | Sets the BIOS configuration. To be more precise, it sets the ``pending_value`` 55 | parameter for each of the attributes passed in. It returns a dictionary 56 | containing the ``commit_needed`` key with a boolean value indicating whether a 57 | config job must be created for the values to be applied. 58 | 59 | Required parameters: 60 | 61 | * ``settings``: a dictionary containing the proposed values, with each key 62 | being the name of attribute and the value being the proposed value. 63 | 64 | commit_pending_bios_changes 65 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 66 | Applies all pending changes on the BIOS by creating a config job and returns 67 | the id of the created job. 68 | 69 | Optional parameters: 70 | 71 | * ``reboot``: indicates whether a RebootJob should also be created or not. 72 | Defaults to ``False``. 73 | 74 | abandon_pending_bios_changes 75 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 76 | Deletes all pending changes on the BIOS. 77 | 78 | .. note:: 79 | Once a config job has been submitted, it can no longer be abandoned. 80 | 81 | RAID management 82 | --------------- 83 | 84 | list_raid_controllers 85 | ~~~~~~~~~~~~~~~~~~~~~ 86 | Returns the list of RAID controllers. 87 | 88 | list_virtual_disks 89 | ~~~~~~~~~~~~~~~~~~ 90 | Returns the list of RAID arrays. 91 | 92 | list_physical_disks 93 | ~~~~~~~~~~~~~~~~~~~ 94 | Returns the list of physical disks. 95 | 96 | create_virtual_disk 97 | ~~~~~~~~~~~~~~~~~~~ 98 | Creates a virtual disk and returns a dictionary containing the 99 | ``commit_needed`` key with a boolean value indicating whether a config job must 100 | be created for the values to be applied. 101 | 102 | .. note:: 103 | The created virtual disk will be in pending state. 104 | 105 | Required parameters: 106 | 107 | * ``raid_controller``: id of the RAID controller. 108 | 109 | * ``physical_disks``: ids of the physical disks. 110 | 111 | * ``raid_level``: RAID level of the virtual disk. 112 | 113 | * ``size_mb``: size of the virtual disk in megabytes. 114 | 115 | Optional parameters: 116 | 117 | * ``disk_name``: name of the virtual disk. 118 | 119 | * ``span_length``: number of disks per span. 120 | 121 | * ``span_depth``: number of spans in virtual disk. 122 | 123 | delete_virtual_disk 124 | ~~~~~~~~~~~~~~~~~~~ 125 | Deletes a virtual disk and returns a dictionary containing the 126 | ``commit_needed`` key with a boolean value indicating whether a config job must 127 | be created for the values to be applied. 128 | 129 | .. note:: 130 | The deleted virtual disk will be in pending state. For the changes to be 131 | applied, a config job must be created and the node must be rebooted. 132 | 133 | Required parameters: 134 | 135 | * ``virtual_disk``: id of the virtual disk. 136 | 137 | commit_pending_raid_changes 138 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 139 | Applies all pending changes on a RAID controller by creating a config job and 140 | returns the id of the created job. 141 | 142 | Required parameters: 143 | 144 | * ``raid_controller``: id of the RAID controller. 145 | 146 | Optional parameters: 147 | 148 | * ``reboot``: indicates whether a RebootJob should also be created or not. 149 | Defaults to ``False``. 150 | 151 | abandon_pending_raid_changes 152 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 153 | Deletes all pending changes on a RAID controller. 154 | 155 | .. note:: 156 | Once a config job has been submitted, it can no longer be abandoned. 157 | 158 | Required parameters: 159 | 160 | * ``raid_controller``: id of the RAID controller. 161 | 162 | Inventory Management 163 | -------------------- 164 | 165 | list_cpus 166 | ~~~~~~~~~ 167 | Returns a list of installed CPUs. 168 | 169 | list_memory 170 | ~~~~~~~~~~~ 171 | Returns a list of installed memory modules. 172 | 173 | list_nics 174 | ~~~~~~~~~ 175 | Returns a list of NICs. 176 | 177 | Job management 178 | -------------- 179 | 180 | list_jobs 181 | ~~~~~~~~~ 182 | Returns a list of jobs from the job queue. 183 | 184 | Optional parameters: 185 | 186 | * ``only_unfinished``: indicates whether only unfinished jobs should be 187 | returned. Defaults to ``False``. 188 | 189 | get_job 190 | ~~~~~~~ 191 | Returns a job from the job queue. 192 | 193 | Required parameters: 194 | 195 | * ``job_id``: id of the job. 196 | 197 | create_config_job 198 | ~~~~~~~~~~~~~~~~~ 199 | Creates a config job and returns the id of the created job. 200 | 201 | .. note:: 202 | In CIM (Common Information Model), weak association is used to name an 203 | instance of one class in the context of an instance of another class. 204 | ``SystemName`` and ``SystemCreationClassName`` are the attributes of the 205 | scoping system, while ``Name`` and ``CreationClassName`` are the attributes 206 | of the instance of the class, on which the ``CreateTargetedConfigJob`` 207 | method is invoked. 208 | 209 | Required parameters: 210 | 211 | * ``resource_uri``: URI of resource to invoke. 212 | 213 | * ``cim_creation_class_name``: creation class name of the CIM object. 214 | 215 | * ``cim_name``: name of the CIM object. 216 | 217 | * ``target``: target device. 218 | 219 | Optional parameters: 220 | 221 | * ``cim_system_creation_class_name``: creation class name of the scoping 222 | system. Defaults to ``DCIM_ComputerSystem``. 223 | 224 | * ``cim_system_name``: name of the scoping system. Defaults to 225 | ``DCIM:ComputerSystem``. 226 | 227 | * ``reboot``: indicates whether a RebootJob should also be created or not. 228 | Defaults to ``False``. 229 | 230 | delete_pending_config 231 | ~~~~~~~~~~~~~~~~~~~~~ 232 | Cancels pending configuration. 233 | 234 | .. note:: 235 | Once a config job has been submitted, it can no longer be abandoned. 236 | 237 | .. note:: 238 | In CIM (Common Information Model), weak association is used to name an 239 | instance of one class in the context of an instance of another class. 240 | ``SystemName`` and ``SystemCreationClassName`` are the attributes of the 241 | scoping system, while ``Name`` and ``CreationClassName`` are the attributes 242 | of the instance of the class, on which the ``CreateTargetedConfigJob`` 243 | method is invoked. 244 | 245 | Required parameters: 246 | 247 | * ``resource_uri``: URI of resource to invoke. 248 | 249 | * ``cim_creation_class_name``: creation class name of the CIM object. 250 | 251 | * ``cim_name``: name of the CIM object. 252 | 253 | * ``target``: target device. 254 | 255 | Optional parameters: 256 | 257 | * ``cim_system_creation_class_name``: creation class name of the scoping 258 | system. Defaults to ``DCIM_ComputerSystem``. 259 | 260 | * ``cim_system_name``: name of the scoping system. Defaults to 261 | ``DCIM:ComputerSystem``. 262 | 263 | * ``reboot``: indicates whether a RebootJob should also be created or not. 264 | Defaults to ``False``. 265 | 266 | 267 | Lifecycle controller management 268 | ------------------------------- 269 | 270 | get_lifecycle_controller_version 271 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 272 | Returns the Lifecycle controller version as a tuple of integers. 273 | -------------------------------------------------------------------------------- /doc/source/conf.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); 2 | # you may not use this file except in compliance with the License. 3 | # You may obtain 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, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 10 | # implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | import os 15 | import sys 16 | 17 | sys.path.insert(0, os.path.abspath('../..')) 18 | # -- General configuration ---------------------------------------------------- 19 | 20 | # Add any Sphinx extension module names here, as strings. They can be 21 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. 22 | extensions = [ 23 | 'sphinx.ext.autodoc', 24 | 'openstackdocstheme' 25 | ] 26 | 27 | # autodoc generation is a bit aggressive and a nuisance when doing heavy 28 | # text edit cycles. 29 | # execute "export SPHINX_DEBUG=1" in your terminal to disable 30 | 31 | # The suffix of source filenames. 32 | source_suffix = '.rst' 33 | 34 | # The master toctree document. 35 | master_doc = 'index' 36 | 37 | # General information about the project. 38 | project = u'python-dracclient' 39 | copyright = u'OpenStack Foundation' 40 | 41 | # If true, '()' will be appended to :func: etc. cross-reference text. 42 | add_function_parentheses = True 43 | 44 | # If true, the current module name will be prepended to all description 45 | # unit titles (such as .. function::). 46 | add_module_names = True 47 | 48 | # The name of the Pygments (syntax highlighting) style to use. 49 | pygments_style = 'sphinx' 50 | 51 | # -- Options for HTML output -------------------------------------------------- 52 | 53 | # The theme to use for HTML and HTML Help pages. Major themes that come with 54 | # Sphinx are currently 'default' and 'sphinxdoc'. 55 | # html_theme_path = ["."] 56 | # html_theme = '_theme' 57 | # html_static_path = ['static'] 58 | html_theme = 'openstackdocs' 59 | 60 | # Output file base name for HTML help builder. 61 | htmlhelp_basename = '%sdoc' % project 62 | 63 | # Grouping the document tree into LaTeX files. List of tuples 64 | # (source start file, target name, title, author, documentclass 65 | # [howto/manual]). 66 | latex_documents = [ 67 | ('index', 68 | '%s.tex' % project, 69 | u'%s Documentation' % project, 70 | u'OpenStack Foundation', 'manual'), 71 | ] 72 | 73 | # Example configuration for intersphinx: refer to the Python standard library. 74 | #intersphinx_mapping = {'http://docs.python.org/': None} 75 | 76 | # openstackdocstheme options 77 | repository_name = 'openstack/python-dracclient' 78 | -------------------------------------------------------------------------------- /doc/source/contributing.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../../CONTRIBUTING.rst 2 | -------------------------------------------------------------------------------- /doc/source/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to python-dracclient's documentation! 2 | ============================================= 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | usage 8 | client-api 9 | Contributing 10 | 11 | Indices and tables 12 | ================== 13 | 14 | * :ref:`genindex` 15 | * :ref:`modindex` 16 | * :ref:`search` 17 | -------------------------------------------------------------------------------- /doc/source/usage.rst: -------------------------------------------------------------------------------- 1 | Usage 2 | ===== 3 | 4 | Create a client object by providing the connection details of the DRAC card:: 5 | 6 | client = dracclient.client.DRACClient('1.2.3.4', 'username', 's3cr3t') 7 | 8 | .. note:: 9 | By default it will use port 443, '/wsman' as path and https protocol. 10 | 11 | You can override the default port, path and protocol:: 12 | 13 | client = dracclient.client.DRACClient('1.2.3.4', 'username', 's3cr3t', 14 | port=443, path='/wsman', 15 | protocol='https') 16 | -------------------------------------------------------------------------------- /dracclient/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/python-dracclient/3e52db051151237a0348ed146b537a862c442d0b/dracclient/__init__.py -------------------------------------------------------------------------------- /dracclient/constants.py: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | # not use this file except in compliance with the License. You may obtain 4 | # a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | 14 | # iDRAC is ready retry constants 15 | DEFAULT_IDRAC_IS_READY_RETRIES = 96 16 | DEFAULT_IDRAC_IS_READY_RETRY_DELAY_SEC = 10 17 | 18 | # Web Services Management (WS-Management and WS-Man) SSL retry on error 19 | # behavior constants 20 | DEFAULT_WSMAN_SSL_ERROR_RETRIES = 3 21 | DEFAULT_WSMAN_SSL_ERROR_RETRY_DELAY_SEC = 0 22 | 23 | NOT_SUPPORTED_MSG = " operation is not supported on th" 24 | 25 | # power states 26 | POWER_ON = 'POWER_ON' 27 | POWER_OFF = 'POWER_OFF' 28 | REBOOT = 'REBOOT' 29 | 30 | PRIMARY_STATUS = { 31 | '0': 'unknown', 32 | '1': 'ok', 33 | '2': 'degraded', 34 | '3': 'error' 35 | } 36 | 37 | # binary unit constants 38 | UNITS_KI = 2 ** 10 39 | 40 | # Lifecycle Controller status constant 41 | LC_IN_RECOVERY = '4' 42 | 43 | 44 | # Reboot required indicator 45 | # Note: When the iDRAC returns optional for this value, this indicates that 46 | # either a reboot may be performed to complete the operation or a real time 47 | # config job may be created to complete the operation without performing a 48 | # reboot. This library does not currently support creating a real time config 49 | # job, so a reboot must be performed when a value of "optional" is returned. 50 | class RebootRequired(object): 51 | true = 'true' 52 | optional = 'optional' 53 | false = 'false' 54 | 55 | @classmethod 56 | def all(cls): 57 | return [cls.true, cls.optional, cls.false] 58 | 59 | 60 | class RebootJobType(object): 61 | """Enumeration of different reboot job types.""" 62 | 63 | power_cycle = 'power_cycle' 64 | """Hard power off, power on cycle""" 65 | 66 | graceful_reboot = 'graceful_reboot' 67 | """OS level reboot and wait for OS shutdown""" 68 | 69 | reboot_forced_shutdown = 'reboot_forced_shutdown' 70 | """OS level reboot and force power cycle if OS does not shut 71 | down 72 | """ 73 | 74 | @classmethod 75 | def all(cls): 76 | return [cls.power_cycle, 77 | cls.graceful_reboot, 78 | cls.reboot_forced_shutdown] 79 | 80 | 81 | class RaidStatus(object): 82 | """Enumeration of different volume types.""" 83 | 84 | jbod = 'JBOD' 85 | """Just a Bunch of Disks""" 86 | 87 | raid = 'RAID' 88 | """Redundant Array of Independent Disks""" 89 | 90 | @classmethod 91 | def all(cls): 92 | return [cls.jbod, 93 | cls.raid] 94 | -------------------------------------------------------------------------------- /dracclient/exceptions.py: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | # not use this file except in compliance with the License. You may obtain 4 | # a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | 14 | 15 | class BaseClientException(Exception): 16 | 17 | msg_fmt = 'An unknown exception occurred' 18 | 19 | def __init__(self, message=None, **kwargs): 20 | message = self.msg_fmt % kwargs 21 | super(BaseClientException, self).__init__(message) 22 | 23 | 24 | class DRACRequestFailed(BaseClientException): 25 | pass 26 | 27 | 28 | class DRACOperationFailed(DRACRequestFailed): 29 | msg_fmt = ('DRAC operation failed. Messages: %(drac_messages)s') 30 | 31 | 32 | class DRACUnexpectedReturnValue(DRACRequestFailed): 33 | msg_fmt = ('DRAC operation yielded return value %(actual_return_value)s ' 34 | 'that is neither error nor the expected ' 35 | '%(expected_return_value)s') 36 | 37 | 38 | class DRACEmptyResponseField(BaseClientException): 39 | msg_fmt = ("Attribute '%(attr)s' is not nullable, but no value received") 40 | 41 | 42 | class DRACMissingResponseField(BaseClientException, AttributeError): 43 | msg_fmt = ("Attribute '%(attr)s' is missing from the response") 44 | 45 | 46 | class InvalidParameterValue(BaseClientException): 47 | msg_fmt = '%(reason)s' 48 | 49 | 50 | class WSManRequestFailure(BaseClientException): 51 | msg_fmt = ('WSMan request failed') 52 | 53 | 54 | class WSManInvalidResponse(BaseClientException): 55 | msg_fmt = ('Invalid response received. Status code: "%(status_code)s", ' 56 | 'reason: "%(reason)s"') 57 | 58 | 59 | class WSManInvalidFilterDialect(BaseClientException): 60 | msg_fmt = ('Invalid filter dialect "%(invalid_filter)s". ' 61 | 'Supported options are %(supported)s') 62 | -------------------------------------------------------------------------------- /dracclient/resources/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/python-dracclient/3e52db051151237a0348ed146b537a862c442d0b/dracclient/resources/__init__.py -------------------------------------------------------------------------------- /dracclient/resources/inventory.py: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | # not use this file except in compliance with the License. You may obtain 4 | # a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | 14 | import collections 15 | 16 | from dracclient import constants 17 | from dracclient.resources import uris 18 | from dracclient import utils 19 | 20 | CPU_CHARACTERISTICS_64BIT = '4' 21 | 22 | NIC_LINK_SPEED_MBPS = { 23 | '0': None, 24 | '1': 10, 25 | '2': 100, 26 | '3': 1000, 27 | '4': 2.5 * constants.UNITS_KI, 28 | '5': 10 * constants.UNITS_KI, 29 | '6': 20 * constants.UNITS_KI, 30 | '7': 40 * constants.UNITS_KI, 31 | '8': 100 * constants.UNITS_KI, 32 | '9': 25 * constants.UNITS_KI, 33 | '10': 50 * constants.UNITS_KI 34 | } 35 | 36 | NIC_LINK_DUPLEX = { 37 | '0': 'unknown', 38 | '1': 'full duplex', 39 | '2': 'half duplex' 40 | } 41 | 42 | NIC_MODE = { 43 | '0': 'unknown', 44 | '2': 'enabled', 45 | '3': 'disabled'} 46 | 47 | CPU = collections.namedtuple( 48 | 'CPU', 49 | ['id', 'cores', 'speed_mhz', 'model', 'status', 'ht_enabled', 50 | 'cpu_count', 'turbo_enabled', 'vt_enabled', 'arch64']) 51 | 52 | Memory = collections.namedtuple( 53 | 'Memory', 54 | ['id', 'size_mb', 'speed_mhz', 'manufacturer', 'model', 'status']) 55 | 56 | NIC = collections.namedtuple( 57 | 'NIC', 58 | ['id', 'mac', 'model', 'speed_mbps', 'duplex', 'media_type']) 59 | 60 | System = collections.namedtuple( 61 | 'System', 62 | ['id', 'lcc_version', 'model', 'service_tag', 'uuid']) 63 | 64 | 65 | class InventoryManagement(object): 66 | 67 | def __init__(self, client): 68 | """Creates InventoryManagement object 69 | 70 | :param client: an instance of WSManClient 71 | """ 72 | self.client = client 73 | 74 | def list_cpus(self): 75 | """Returns the list of CPUs 76 | 77 | :returns: a list of CPU objects 78 | :raises: WSManRequestFailure on request failures 79 | :raises: WSManInvalidResponse when receiving invalid response 80 | :raises: DRACOperationFailed on error reported back by the DRAC 81 | """ 82 | 83 | doc = self.client.enumerate(uris.DCIM_CPUView) 84 | 85 | cpus = utils.find_xml(doc, 'DCIM_CPUView', 86 | uris.DCIM_CPUView, 87 | find_all=True) 88 | 89 | return [self._parse_cpus(cpu) for cpu in cpus] 90 | 91 | def _parse_cpus(self, cpu): 92 | drac_characteristics = self._get_cpu_attr(cpu, 'Characteristics') 93 | arch64 = (CPU_CHARACTERISTICS_64BIT == drac_characteristics) 94 | 95 | return CPU( 96 | id=self._get_cpu_attr(cpu, 'FQDD'), 97 | cores=int(self._get_cpu_attr(cpu, 'NumberOfProcessorCores')), 98 | speed_mhz=int(self._get_cpu_attr(cpu, 'CurrentClockSpeed')), 99 | model=self._get_cpu_attr(cpu, 'Model'), 100 | status=constants.PRIMARY_STATUS[ 101 | self._get_cpu_attr(cpu, 'PrimaryStatus')], 102 | ht_enabled=bool(self._get_cpu_attr(cpu, 'HyperThreadingEnabled', 103 | allow_missing=True)), 104 | turbo_enabled=bool(self._get_cpu_attr(cpu, 'TurboModeEnabled', 105 | allow_missing=True)), 106 | cpu_count=self._get_cpu_count( 107 | int(self._get_cpu_attr(cpu, 'NumberOfProcessorCores')), 108 | bool(self._get_cpu_attr(cpu, 'HyperThreadingEnabled', 109 | allow_missing=True))), 110 | vt_enabled=bool(self._get_cpu_attr( 111 | cpu, 'VirtualizationTechnologyEnabled', allow_missing=True)), 112 | arch64=arch64) 113 | 114 | def _get_cpu_count(self, cores, ht_enabled): 115 | if ht_enabled: 116 | return int(cores * 2) 117 | else: 118 | return int(cores) 119 | 120 | def _get_cpu_attr(self, cpu, attr_name, allow_missing=False): 121 | return utils.get_wsman_resource_attr( 122 | cpu, uris.DCIM_CPUView, attr_name, allow_missing=allow_missing) 123 | 124 | def list_memory(self): 125 | """Returns the list of installed memory 126 | 127 | :returns: a list of Memory objects 128 | :raises: WSManRequestFailure on request failures 129 | :raises: WSManInvalidResponse when receiving invalid response 130 | :raises: DRACOperationFailed on error reported back by the DRAC 131 | """ 132 | 133 | doc = self.client.enumerate(uris.DCIM_MemoryView) 134 | 135 | installed_memory = utils.find_xml(doc, 'DCIM_MemoryView', 136 | uris.DCIM_MemoryView, 137 | find_all=True) 138 | 139 | return [self._parse_memory(memory) for memory in installed_memory] 140 | 141 | def _parse_memory(self, memory): 142 | return Memory( 143 | id=self._get_memory_attr(memory, 'FQDD'), 144 | size_mb=int(self._get_memory_attr(memory, 'Size')), 145 | speed_mhz=int(self._get_memory_attr(memory, 'Speed')), 146 | manufacturer=self._get_memory_attr(memory, 'Manufacturer'), 147 | model=self._get_memory_attr(memory, 'Model'), 148 | status=constants.PRIMARY_STATUS[ 149 | self._get_memory_attr(memory, 'PrimaryStatus')]) 150 | 151 | def _get_memory_attr(self, memory, attr_name): 152 | return utils.get_wsman_resource_attr(memory, uris.DCIM_MemoryView, 153 | attr_name) 154 | 155 | def list_nics(self, sort=False): 156 | """Returns the list of NICs 157 | 158 | :returns: a list of NIC objects 159 | :raises: WSManRequestFailure on request failures 160 | :raises: WSManInvalidResponse when receiving invalid response 161 | :raises: DRACOperationFailed on error reported back by the DRAC 162 | interface 163 | """ 164 | 165 | doc = self.client.enumerate(uris.DCIM_NICView) 166 | drac_nics = utils.find_xml(doc, 'DCIM_NICView', uris.DCIM_NICView, 167 | find_all=True) 168 | nics = [self._parse_drac_nic(nic) for nic in drac_nics] 169 | if sort: 170 | nics.sort(key=lambda nic: nic.id) 171 | 172 | return nics 173 | 174 | def _parse_drac_nic(self, drac_nic): 175 | fqdd = self._get_nic_attr(drac_nic, 'FQDD') 176 | drac_speed = self._get_nic_attr(drac_nic, 'LinkSpeed') 177 | drac_duplex = self._get_nic_attr(drac_nic, 'LinkDuplex') 178 | 179 | return NIC( 180 | id=fqdd, 181 | mac=self._get_nic_attr(drac_nic, 'CurrentMACAddress'), 182 | model=self._get_nic_attr(drac_nic, 'ProductName'), 183 | speed_mbps=NIC_LINK_SPEED_MBPS[drac_speed], 184 | duplex=NIC_LINK_DUPLEX[drac_duplex], 185 | media_type=self._get_nic_attr(drac_nic, 'MediaType')) 186 | 187 | def _get_nic_attr(self, drac_nic, attr_name): 188 | return utils.get_wsman_resource_attr(drac_nic, uris.DCIM_NICView, 189 | attr_name) 190 | 191 | def get_system(self): 192 | """Returns a System object 193 | 194 | :returns: a System object 195 | :raises: WSManRequestFailure on request failures 196 | :raises: WSManInvalidRespons when receiving invalid response 197 | """ 198 | doc = self.client.enumerate(uris.DCIM_SystemView) 199 | drac_system = utils.find_xml(doc, 200 | 'DCIM_SystemView', 201 | uris.DCIM_SystemView, 202 | find_all=False) 203 | 204 | return self._parse_drac_system(drac_system) 205 | 206 | def _parse_drac_system(self, drac_system): 207 | return System( 208 | id=self._get_system_attr(drac_system, 'InstanceID'), 209 | uuid=self._get_system_attr(drac_system, 'UUID'), 210 | service_tag=self._get_system_attr(drac_system, 'ServiceTag'), 211 | model=self._get_system_attr(drac_system, 'Model'), 212 | lcc_version=self._get_system_attr(drac_system, 213 | 'LifecycleControllerVersion')) 214 | 215 | def _get_system_attr(self, drac_system, attr_name): 216 | return utils.get_wsman_resource_attr(drac_system, 217 | uris.DCIM_SystemView, 218 | attr_name) 219 | -------------------------------------------------------------------------------- /dracclient/resources/uris.py: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | # not use this file except in compliance with the License. You may obtain 4 | # a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | 14 | """ 15 | Schema definitions and resource URIs for the classes implemented by the DRAC 16 | WS-Man API. 17 | """ 18 | 19 | DCIM_BIOSEnumeration = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 20 | 'DCIM_BIOSEnumeration') 21 | 22 | DCIM_BIOSInteger = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 23 | 'DCIM_BIOSInteger') 24 | 25 | DCIM_BIOSService = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 26 | 'DCIM_BIOSService') 27 | 28 | DCIM_BIOSString = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 29 | 'DCIM_BIOSString') 30 | 31 | DCIM_BootConfigSetting = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 32 | 'DCIM_BootConfigSetting') 33 | 34 | DCIM_BootSourceSetting = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 35 | 'DCIM_BootSourceSetting') 36 | 37 | DCIM_ComputerSystem = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2' 38 | '/DCIM_ComputerSystem') 39 | 40 | DCIM_ControllerView = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 41 | 'DCIM_ControllerView') 42 | 43 | DCIM_CPUView = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 44 | 'DCIM_CPUView') 45 | 46 | DCIM_iDRACCardEnumeration = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/' 47 | '2/DCIM_iDRACCardEnumeration') 48 | 49 | DCIM_iDRACCardInteger = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 50 | 'DCIM_iDRACCardInteger') 51 | 52 | DCIM_iDRACCardService = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 53 | 'DCIM_iDRACCardService') 54 | 55 | DCIM_iDRACCardString = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 56 | 'DCIM_iDRACCardString') 57 | 58 | DCIM_JobService = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 59 | 'DCIM_JobService') 60 | 61 | DCIM_LCEnumeration = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 62 | 'DCIM_LCEnumeration') 63 | 64 | DCIM_LCService = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 65 | 'DCIM_LCService') 66 | 67 | DCIM_LCString = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 68 | 'DCIM_LCString') 69 | 70 | DCIM_LifecycleJob = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 71 | 'DCIM_LifecycleJob') 72 | 73 | DCIM_MemoryView = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 74 | 'DCIM_MemoryView') 75 | 76 | DCIM_NICEnumeration = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 77 | 'DCIM_NICEnumeration') 78 | 79 | DCIM_NICInteger = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 80 | 'DCIM_NICInteger') 81 | 82 | DCIM_NICService = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 83 | 'DCIM_NICService') 84 | 85 | DCIM_NICString = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 86 | 'DCIM_NICString') 87 | 88 | DCIM_NICView = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 89 | 'DCIM_NICView') 90 | 91 | DCIM_PCIeSSDView = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 92 | 'DCIM_PCIeSSDView') 93 | 94 | DCIM_PhysicalDiskView = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 95 | 'DCIM_PhysicalDiskView') 96 | 97 | DCIM_RAIDEnumeration = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 98 | 'DCIM_RAIDEnumeration') 99 | 100 | DCIM_RAIDInteger = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 101 | 'DCIM_RAIDInteger') 102 | 103 | DCIM_RAIDService = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 104 | 'DCIM_RAIDService') 105 | 106 | 107 | DCIM_RAIDString = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 108 | 'DCIM_RAIDString') 109 | 110 | DCIM_SystemEnumeration = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 111 | 'DCIM_SystemEnumeration') 112 | 113 | DCIM_SystemInteger = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 114 | 'DCIM_SystemInteger') 115 | 116 | DCIM_SystemString = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 117 | 'DCIM_SystemString') 118 | 119 | DCIM_SystemView = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 120 | 'DCIM_SystemView') 121 | 122 | DCIM_VirtualDiskView = ('http://schemas.dell.com/wbem/wscim/1/cim-schema/2/' 123 | 'DCIM_VirtualDiskView') 124 | -------------------------------------------------------------------------------- /dracclient/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/python-dracclient/3e52db051151237a0348ed146b537a862c442d0b/dracclient/tests/__init__.py -------------------------------------------------------------------------------- /dracclient/tests/base.py: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | # not use this file except in compliance with the License. You may obtain 4 | # a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | 14 | 15 | import logging 16 | import sys 17 | import unittest 18 | 19 | logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) 20 | 21 | 22 | class BaseTest(unittest.TestCase): 23 | pass 24 | -------------------------------------------------------------------------------- /dracclient/tests/test_client.py: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | # not use this file except in compliance with the License. You may obtain 4 | # a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | 14 | from unittest import mock 15 | 16 | import requests_mock 17 | 18 | import dracclient.client 19 | from dracclient import constants 20 | from dracclient import exceptions 21 | from dracclient.resources import uris 22 | from dracclient.tests import base 23 | from dracclient.tests import utils as test_utils 24 | 25 | 26 | @requests_mock.Mocker() 27 | class WSManClientTestCase(base.BaseTest): 28 | 29 | @mock.patch.object(dracclient.client.WSManClient, 30 | 'wait_until_idrac_is_ready', spec_set=True, 31 | autospec=True) 32 | def test_enumerate(self, mock_requests, mock_wait_until_idrac_is_ready): 33 | mock_requests.post('https://1.2.3.4:443/wsman', 34 | text='yay!') 35 | 36 | client = dracclient.client.WSManClient(**test_utils.FAKE_ENDPOINT) 37 | resp = client.enumerate('http://resource') 38 | mock_wait_until_idrac_is_ready.assert_called_once_with(client) 39 | self.assertEqual('yay!', resp.text) 40 | 41 | @mock.patch.object(dracclient.client.WSManClient, 42 | 'wait_until_idrac_is_ready', spec_set=True, 43 | autospec=True) 44 | def test_enumerate_without_wait_for_idrac( 45 | self, mock_requests, mock_wait_until_idrac_is_ready): 46 | mock_requests.post('https://1.2.3.4:443/wsman', 47 | text='yay!') 48 | 49 | client = dracclient.client.WSManClient(**test_utils.FAKE_ENDPOINT) 50 | resp = client.enumerate('http://resource', wait_for_idrac=False) 51 | self.assertFalse(mock_wait_until_idrac_is_ready.called) 52 | self.assertEqual('yay!', resp.text) 53 | 54 | @mock.patch.object(dracclient.client.WSManClient, 55 | 'wait_until_idrac_is_ready', spec_set=True, 56 | autospec=True) 57 | def test_invoke(self, mock_requests, mock_wait_until_idrac_is_ready): 58 | xml = """ 59 | 60 | 42 61 | yay! 62 | 63 | """ # noqa 64 | mock_requests.post('https://1.2.3.4:443/wsman', text=xml) 65 | 66 | client = dracclient.client.WSManClient(**test_utils.FAKE_ENDPOINT) 67 | resp = client.invoke('http://resource', 'Foo') 68 | mock_wait_until_idrac_is_ready.assert_called_once_with(client) 69 | self.assertEqual('yay!', resp.find('result').text) 70 | 71 | @mock.patch.object(dracclient.client.WSManClient, 72 | 'wait_until_idrac_is_ready', spec_set=True, 73 | autospec=True) 74 | def test_invoke_without_wait_for_idrac( 75 | self, mock_requests, mock_wait_until_idrac_is_ready): 76 | xml = """ 77 | 78 | 42 79 | yay! 80 | 81 | """ # noqa 82 | mock_requests.post('https://1.2.3.4:443/wsman', text=xml) 83 | 84 | client = dracclient.client.WSManClient(**test_utils.FAKE_ENDPOINT) 85 | resp = client.invoke('http://resource', 'Foo', wait_for_idrac=False) 86 | self.assertFalse(mock_wait_until_idrac_is_ready.called) 87 | self.assertEqual('yay!', resp.find('result').text) 88 | 89 | def test_invoke_with_expected_return_value(self, mock_requests): 90 | xml = """ 91 | 92 | 42 93 | yay! 94 | 95 | """ # noqa 96 | mock_requests.post('https://1.2.3.4:443/wsman', text=xml) 97 | 98 | client = dracclient.client.WSManClient(**test_utils.FAKE_ENDPOINT) 99 | resp = client.invoke('http://resource', 'Foo', 100 | expected_return_value='42', wait_for_idrac=False) 101 | self.assertEqual('yay!', resp.find('result').text) 102 | 103 | def test_invoke_with_error_return_value(self, mock_requests): 104 | xml = """ 105 | 106 | 2 107 | yay! 108 | 109 | """ # noqa 110 | mock_requests.post('https://1.2.3.4:443/wsman', text=xml) 111 | 112 | client = dracclient.client.WSManClient(**test_utils.FAKE_ENDPOINT) 113 | self.assertRaises(exceptions.DRACOperationFailed, client.invoke, 114 | 'http://resource', 'Foo', wait_for_idrac=False) 115 | 116 | def test_invoke_with_unchecked_return_value(self, mock_requests): 117 | xml = """ 118 | 119 | 2 120 | yay! 121 | 122 | """ # noqa 123 | mock_requests.post('https://1.2.3.4:443/wsman', text=xml) 124 | 125 | client = dracclient.client.WSManClient(**test_utils.FAKE_ENDPOINT) 126 | resp = client.invoke('http://resource', 'Foo', 127 | wait_for_idrac=False, check_return_value=False) 128 | self.assertEqual('yay!', resp.find('result').text) 129 | 130 | def test_invoke_with_unexpected_return_value(self, mock_requests): 131 | xml = """ 132 | 133 | 42 134 | yay! 135 | 136 | """ # noqa 137 | mock_requests.post('https://1.2.3.4:443/wsman', text=xml) 138 | 139 | client = dracclient.client.WSManClient(**test_utils.FAKE_ENDPOINT) 140 | self.assertRaises(exceptions.DRACUnexpectedReturnValue, client.invoke, 141 | 'http://resource', 'Foo', 142 | expected_return_value='4242', wait_for_idrac=False) 143 | 144 | def test_is_idrac_ready_ready(self, mock_requests): 145 | expected_text = test_utils.LifecycleControllerInvocations[ 146 | uris.DCIM_LCService]['GetRemoteServicesAPIStatus']['is_ready'] 147 | mock_requests.post('https://1.2.3.4:443/wsman', 148 | text=expected_text) 149 | 150 | client = dracclient.client.WSManClient(**test_utils.FAKE_ENDPOINT) 151 | self.assertTrue(client.is_idrac_ready()) 152 | 153 | def test_is_idrac_ready_not_ready(self, mock_requests): 154 | expected_text = test_utils.LifecycleControllerInvocations[ 155 | uris.DCIM_LCService]['GetRemoteServicesAPIStatus']['is_not_ready'] 156 | mock_requests.post('https://1.2.3.4:443/wsman', 157 | text=expected_text) 158 | 159 | client = dracclient.client.WSManClient(**test_utils.FAKE_ENDPOINT) 160 | self.assertFalse(client.is_idrac_ready()) 161 | 162 | @mock.patch.object(dracclient.client.WSManClient, 'is_idrac_ready', 163 | autospec=True) 164 | @mock.patch('time.sleep', autospec=True) 165 | def test_wait_until_idrac_is_ready_with_none_arguments( 166 | self, mock_requests, mock_ts, mock_is_idrac_ready): 167 | ready_retries = 2 168 | ready_retry_delay = 1 169 | 170 | side_effect = (ready_retries - 1) * [False] 171 | side_effect.append(True) 172 | mock_is_idrac_ready.side_effect = side_effect 173 | 174 | fake_endpoint = test_utils.FAKE_ENDPOINT.copy() 175 | fake_endpoint['ready_retries'] = ready_retries 176 | fake_endpoint['ready_retry_delay'] = ready_retry_delay 177 | 178 | client = dracclient.client.WSManClient(**fake_endpoint) 179 | client.wait_until_idrac_is_ready(retries=None, retry_delay=None) 180 | 181 | self.assertEqual(mock_is_idrac_ready.call_count, ready_retries) 182 | self.assertEqual(mock_ts.call_count, ready_retries - 1) 183 | mock_ts.assert_called_with(ready_retry_delay) 184 | 185 | @mock.patch.object(dracclient.client.WSManClient, 'is_idrac_ready', 186 | autospec=True) 187 | @mock.patch('time.sleep', autospec=True) 188 | def test_wait_until_idrac_is_ready_with_non_none_arguments( 189 | self, mock_requests, mock_ts, mock_is_idrac_ready): 190 | retries = 2 191 | self.assertNotEqual(retries, constants.DEFAULT_IDRAC_IS_READY_RETRIES) 192 | 193 | retry_delay = 1 194 | self.assertNotEqual( 195 | retry_delay, constants.DEFAULT_IDRAC_IS_READY_RETRY_DELAY_SEC) 196 | 197 | side_effect = (retries - 1) * [False] 198 | side_effect.append(True) 199 | mock_is_idrac_ready.side_effect = side_effect 200 | 201 | fake_endpoint = test_utils.FAKE_ENDPOINT.copy() 202 | fake_endpoint['ready_retries'] = ( 203 | constants.DEFAULT_IDRAC_IS_READY_RETRIES) 204 | fake_endpoint['ready_retry_delay'] = ( 205 | constants.DEFAULT_IDRAC_IS_READY_RETRY_DELAY_SEC) 206 | 207 | client = dracclient.client.WSManClient(**fake_endpoint) 208 | client.wait_until_idrac_is_ready(retries, retry_delay) 209 | 210 | self.assertEqual(mock_is_idrac_ready.call_count, retries) 211 | self.assertEqual(mock_ts.call_count, retries - 1) 212 | mock_ts.assert_called_with(retry_delay) 213 | 214 | def test_wait_until_idrac_is_ready_ready(self, mock_requests): 215 | expected_text = test_utils.LifecycleControllerInvocations[ 216 | uris.DCIM_LCService]['GetRemoteServicesAPIStatus']['is_ready'] 217 | mock_requests.post('https://1.2.3.4:443/wsman', 218 | text=expected_text) 219 | 220 | client = dracclient.client.WSManClient(**test_utils.FAKE_ENDPOINT) 221 | 222 | try: 223 | client.wait_until_idrac_is_ready() 224 | except exceptions.DRACOperationFailed: 225 | self.fail('wait_until_idrac_is_ready() timed out when it should ' 226 | 'not have!') 227 | 228 | @mock.patch('time.sleep', autospec=True) 229 | def test_wait_until_idrac_is_ready_timeout(self, 230 | mock_requests, 231 | mock_ts): 232 | expected_text = test_utils.LifecycleControllerInvocations[ 233 | uris.DCIM_LCService]['GetRemoteServicesAPIStatus']['is_not_ready'] 234 | mock_requests.post('https://1.2.3.4:443/wsman', 235 | text=expected_text) 236 | 237 | client = dracclient.client.WSManClient(**test_utils.FAKE_ENDPOINT) 238 | self.assertRaises(exceptions.DRACOperationFailed, 239 | client.wait_until_idrac_is_ready) 240 | -------------------------------------------------------------------------------- /dracclient/tests/test_inventory.py: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | # not use this file except in compliance with the License. You may obtain 4 | # a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | 14 | from unittest import mock 15 | 16 | import requests_mock 17 | 18 | import dracclient.client 19 | from dracclient.resources import inventory 20 | import dracclient.resources.job 21 | from dracclient.resources import uris 22 | from dracclient.tests import base 23 | from dracclient.tests import utils as test_utils 24 | 25 | 26 | @requests_mock.Mocker() 27 | @mock.patch.object(dracclient.client.WSManClient, 'wait_until_idrac_is_ready', 28 | spec_set=True, autospec=True) 29 | class ClientInventoryManagementTestCase(base.BaseTest): 30 | 31 | def setUp(self): 32 | super(ClientInventoryManagementTestCase, self).setUp() 33 | self.drac_client = dracclient.client.DRACClient( 34 | **test_utils.FAKE_ENDPOINT) 35 | 36 | def test_list_cpus(self, mock_requests, mock_wait_until_idrac_is_ready): 37 | expected_cpu = [inventory.CPU( 38 | id='CPU.Socket.1', 39 | cores=6, 40 | speed_mhz=2400, 41 | model='Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz', 42 | status='ok', 43 | ht_enabled=True, 44 | cpu_count=12, 45 | turbo_enabled=True, 46 | vt_enabled=True, 47 | arch64=True)] 48 | 49 | mock_requests.post( 50 | 'https://1.2.3.4:443/wsman', 51 | text=test_utils.InventoryEnumerations[uris.DCIM_CPUView]['ok']) 52 | 53 | self.assertEqual( 54 | expected_cpu, 55 | self.drac_client.list_cpus()) 56 | 57 | def test_list_cpus_with_missing_flags(self, mock_requests, 58 | mock_wait_until_idrac_is_ready): 59 | expected_cpu = [inventory.CPU( 60 | id='CPU.Socket.1', 61 | cores=8, 62 | speed_mhz=1900, 63 | model='Intel(R) Xeon(R) CPU E5-2440 v2 @ 1.90GHz', 64 | status='ok', 65 | ht_enabled=False, 66 | cpu_count=8, 67 | turbo_enabled=False, 68 | vt_enabled=False, 69 | arch64=False)] 70 | 71 | mock_requests.post( 72 | 'https://1.2.3.4:443/wsman', 73 | text=test_utils.InventoryEnumerations[ 74 | uris.DCIM_CPUView]['missing_flags']) 75 | 76 | self.assertEqual( 77 | expected_cpu, 78 | self.drac_client.list_cpus()) 79 | 80 | def test_list_memory(self, mock_requests, mock_wait_until_idrac_is_ready): 81 | expected_memory = [inventory.Memory( 82 | id='DIMM.Socket.A1', 83 | size_mb=16384, 84 | speed_mhz=2133, 85 | manufacturer='Samsung', 86 | model='DDR4 DIMM', 87 | status='ok')] 88 | 89 | mock_requests.post( 90 | 'https://1.2.3.4:443/wsman', 91 | text=test_utils.InventoryEnumerations[uris.DCIM_MemoryView]['ok']) 92 | 93 | self.assertEqual( 94 | expected_memory, 95 | self.drac_client.list_memory()) 96 | 97 | def test_list_nics(self, mock_requests, mock_wait_until_idrac_is_ready): 98 | expected_nics = [ 99 | inventory.NIC( 100 | id='NIC.Embedded.1-1-1', 101 | mac='B0:83:FE:C6:6F:A1', 102 | model='Broadcom Gigabit Ethernet BCM5720 - B0:83:FE:C6:6F:A1', 103 | speed_mbps=1000, 104 | duplex='full duplex', 105 | media_type='Base T'), 106 | inventory.NIC( 107 | id='NIC.Slot.2-1-1', 108 | mac='A0:36:9F:52:7D:1E', 109 | model='Intel(R) Gigabit 2P I350-t Adapter - A0:36:9F:52:7D:1E', 110 | speed_mbps=1000, 111 | duplex='full duplex', 112 | media_type='Base T'), 113 | inventory.NIC( 114 | id='NIC.Slot.2-2-1', 115 | mac='A0:36:9F:52:7D:1F', 116 | model='Intel(R) Gigabit 2P I350-t Adapter - A0:36:9F:52:7D:1F', 117 | speed_mbps=1000, 118 | duplex='full duplex', 119 | media_type='Base T'), 120 | inventory.NIC( 121 | id='NIC.Embedded.2-1-1', 122 | mac='B0:83:FE:C6:6F:A2', 123 | model='Broadcom Gigabit Ethernet BCM5720 - B0:83:FE:C6:6F:A2', 124 | speed_mbps=1000, 125 | duplex='full duplex', 126 | media_type='Base T')] 127 | 128 | mock_requests.post( 129 | 'https://1.2.3.4:443/wsman', 130 | text=test_utils.InventoryEnumerations[uris.DCIM_NICView]['ok']) 131 | 132 | self.assertEqual( 133 | expected_nics, 134 | self.drac_client.list_nics()) 135 | 136 | def test_get_system(self, mock_requests, mock_wait_until_idrac_is_ready): 137 | expected_system = inventory.System( 138 | id='System.Embedded.1', 139 | uuid='ebd4edd3-dfd7-4c7d-a2c8-562b3c23b811', 140 | service_tag='A1B2C3D', 141 | model='PowerEdge R630', 142 | lcc_version='2.1.0') 143 | mock_requests.post( 144 | 'https://1.2.3.4:443/wsman', 145 | text=test_utils.LifecycleControllerEnumerations[ 146 | uris.DCIM_SystemView]['ok']) 147 | self.assertEqual( 148 | expected_system, 149 | self.drac_client.get_system()) 150 | -------------------------------------------------------------------------------- /dracclient/tests/test_system.py: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | # not use this file except in compliance with the License. You may obtain 4 | # a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | 14 | from unittest import mock 15 | 16 | import requests_mock 17 | 18 | import dracclient.client 19 | from dracclient.resources import system 20 | from dracclient.resources import uris 21 | from dracclient.tests import base 22 | from dracclient.tests import utils as test_utils 23 | 24 | 25 | class ClientSystemConfigurationTestCase(base.BaseTest): 26 | 27 | def setUp(self): 28 | super(ClientSystemConfigurationTestCase, self).setUp() 29 | self.drac_client = dracclient.client.DRACClient( 30 | **test_utils.FAKE_ENDPOINT) 31 | 32 | @requests_mock.Mocker() 33 | @mock.patch.object(dracclient.client.WSManClient, 34 | 'wait_until_idrac_is_ready', spec_set=True, 35 | autospec=True) 36 | def test_list_system_settings( 37 | self, mock_requests, mock_wait_until_idrac_is_ready): 38 | expected_enum_attr = system.SystemEnumerableAttribute( 39 | name='ChassisLEDState', 40 | instance_id='System.Embedded.1#ChassisPwrState.1#ChassisLEDState', # noqa 41 | read_only=False, 42 | current_value='Off', 43 | pending_value=None, 44 | fqdd='System.Embedded.1', 45 | group_id='ChassisPwrState.1', 46 | possible_values=['Unknown', 'Blinking', 'Off']) 47 | expected_string_attr = system.SystemStringAttribute( 48 | name='UserDefinedString', 49 | instance_id='System.Embedded.1#LCD.1#UserDefinedString', 50 | read_only=False, 51 | current_value=None, 52 | pending_value=None, 53 | fqdd='System.Embedded.1', 54 | group_id='LCD.1', 55 | min_length=0, 56 | max_length=62) 57 | expected_integer_attr = system.SystemIntegerAttribute( 58 | name='PowerCapValue', 59 | instance_id='System.Embedded.1#ServerPwr.1#PowerCapValue', 60 | read_only=False, 61 | current_value=555, 62 | pending_value=None, 63 | fqdd='System.Embedded.1', 64 | group_id='ServerPwr.1', 65 | lower_bound=302, 66 | upper_bound=578) 67 | 68 | mock_requests.post('https://1.2.3.4:443/wsman', [ 69 | {'text': test_utils.SystemEnumerations[ 70 | uris.DCIM_SystemEnumeration]['ok']}, 71 | {'text': test_utils.SystemEnumerations[ 72 | uris.DCIM_SystemString]['ok']}, 73 | {'text': test_utils.SystemEnumerations[ 74 | uris.DCIM_SystemInteger]['ok']}]) 75 | 76 | system_settings = self.drac_client.list_system_settings() 77 | 78 | self.assertEqual(44, len(system_settings)) 79 | # enumerable attribute 80 | self.assertIn('System.Embedded.1#ChassisPwrState.1#ChassisLEDState', 81 | system_settings) 82 | self.assertEqual(expected_enum_attr, system_settings[ 83 | 'System.Embedded.1#ChassisPwrState.1#ChassisLEDState']) # noqa 84 | # string attribute 85 | self.assertIn('System.Embedded.1#LCD.1#UserDefinedString', 86 | system_settings) 87 | self.assertEqual(expected_string_attr, system_settings[ 88 | 'System.Embedded.1#LCD.1#UserDefinedString']) 89 | self.assertIn('System.Embedded.1#ServerPwr.1#PowerCapValue', 90 | system_settings) 91 | self.assertEqual(expected_integer_attr, 92 | system_settings['System.Embedded.1#ServerPwr.1#PowerCapValue']) # noqa 93 | -------------------------------------------------------------------------------- /dracclient/tests/test_utils.py: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | # not use this file except in compliance with the License. You may obtain 4 | # a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | 14 | import re 15 | 16 | from lxml import etree 17 | 18 | from dracclient import exceptions 19 | from dracclient.resources import uris 20 | from dracclient.tests import base 21 | from dracclient.tests import utils as test_utils 22 | from dracclient import utils 23 | 24 | 25 | class UtilsTestCase(base.BaseTest): 26 | 27 | def setUp(self): 28 | super(UtilsTestCase, self).setUp() 29 | 30 | def test__is_attr_non_nil_True(self): 31 | doc = etree.fromstring( 32 | test_utils.RAIDEnumerations[ 33 | uris.DCIM_ControllerView]['ok']) 34 | controllers = utils.find_xml(doc, 'DCIM_ControllerView', 35 | uris.DCIM_ControllerView, find_all=True) 36 | version = utils.find_xml(controllers[0], 'Bus', 37 | uris.DCIM_ControllerView) 38 | 39 | self.assertTrue(utils._is_attr_non_nil(version)) 40 | 41 | def test__is_attr_non_nil_False(self): 42 | doc = etree.fromstring( 43 | test_utils.RAIDEnumerations[ 44 | uris.DCIM_ControllerView]['ok']) 45 | controllers = utils.find_xml(doc, 'DCIM_ControllerView', 46 | uris.DCIM_ControllerView, find_all=True) 47 | version = utils.find_xml(controllers[0], 'DriverVersion', 48 | uris.DCIM_ControllerView) 49 | 50 | self.assertFalse(utils._is_attr_non_nil(version)) 51 | 52 | def test_get_wsman_resource_attr(self): 53 | doc = etree.fromstring( 54 | test_utils.InventoryEnumerations[uris.DCIM_CPUView]['ok']) 55 | cpus = utils.find_xml(doc, 'DCIM_CPUView', uris.DCIM_CPUView, 56 | find_all=True) 57 | 58 | val = utils.get_wsman_resource_attr( 59 | cpus[0], uris.DCIM_CPUView, 'HyperThreadingEnabled', 60 | allow_missing=False) 61 | 62 | self.assertEqual('1', val) 63 | 64 | def test_get_wsman_resource_attr_missing_attr(self): 65 | expected_message = ("Attribute 'HyperThreadingEnabled' is missing " 66 | "from the response") 67 | doc = etree.fromstring( 68 | test_utils.InventoryEnumerations[ 69 | uris.DCIM_CPUView]['missing_flags']) 70 | cpus = utils.find_xml(doc, 'DCIM_CPUView', uris.DCIM_CPUView, 71 | find_all=True) 72 | 73 | self.assertRaisesRegexp( 74 | exceptions.DRACMissingResponseField, re.escape(expected_message), 75 | utils.get_wsman_resource_attr, cpus[0], uris.DCIM_CPUView, 76 | 'HyperThreadingEnabled', allow_missing=False) 77 | 78 | def test_get_wsman_resource_attr_missing_attr_allowed(self): 79 | doc = etree.fromstring( 80 | test_utils.InventoryEnumerations[ 81 | uris.DCIM_CPUView]['missing_flags']) 82 | cpus = utils.find_xml(doc, 'DCIM_CPUView', uris.DCIM_CPUView, 83 | find_all=True) 84 | 85 | val = utils.get_wsman_resource_attr( 86 | cpus[0], uris.DCIM_CPUView, 'HyperThreadingEnabled', 87 | allow_missing=True) 88 | 89 | self.assertIsNone(val) 90 | 91 | def test_get_wsman_resource_attr_missing_text(self): 92 | expected_message = ("Attribute 'HyperThreadingEnabled' is not nullable" 93 | ", but no value received") 94 | doc = etree.fromstring( 95 | test_utils.InventoryEnumerations[ 96 | uris.DCIM_CPUView]['empty_flag']) 97 | cpus = utils.find_xml(doc, 'DCIM_CPUView', uris.DCIM_CPUView, 98 | find_all=True) 99 | 100 | self.assertRaisesRegexp( 101 | exceptions.DRACEmptyResponseField, re.escape(expected_message), 102 | utils.get_wsman_resource_attr, cpus[0], uris.DCIM_CPUView, 103 | 'HyperThreadingEnabled', allow_missing=False) 104 | 105 | def test_get_wsman_resource_attr_missing_text_allowed(self): 106 | doc = etree.fromstring( 107 | test_utils.RAIDEnumerations[ 108 | uris.DCIM_ControllerView]['ok']) 109 | controllers = utils.find_xml(doc, 'DCIM_ControllerView', 110 | uris.DCIM_ControllerView, find_all=True) 111 | 112 | result = utils.get_wsman_resource_attr( 113 | controllers[0], uris.DCIM_ControllerView, 'DriverVersion', 114 | allow_missing=False, nullable=True) 115 | self.assertIsNone(result) 116 | 117 | def test_get_all_wsman_resource_attrs(self): 118 | doc = etree.fromstring( 119 | test_utils.RAIDEnumerations[uris.DCIM_VirtualDiskView]['ok']) 120 | vdisks = utils.find_xml(doc, 'DCIM_VirtualDiskView', 121 | uris.DCIM_VirtualDiskView, find_all=True) 122 | 123 | vals = utils.get_all_wsman_resource_attrs( 124 | vdisks[0], uris.DCIM_VirtualDiskView, 'PhysicalDiskIDs') 125 | 126 | expected_pdisks = [ 127 | 'Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1', 128 | 'Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1' 129 | ] 130 | self.assertListEqual(expected_pdisks, vals) 131 | 132 | def test_get_all_wsman_resource_attrs_missing_attr_allowed(self): 133 | doc = etree.fromstring( 134 | test_utils.InventoryEnumerations[ 135 | uris.DCIM_CPUView]['missing_flags']) 136 | cpus = utils.find_xml(doc, 'DCIM_CPUView', uris.DCIM_CPUView, 137 | find_all=True) 138 | 139 | vals = utils.get_all_wsman_resource_attrs( 140 | cpus[0], uris.DCIM_CPUView, 'HyperThreadingEnabled') 141 | 142 | self.assertListEqual([], vals) 143 | 144 | def test_get_all_wsman_resource_attrs_missing_text(self): 145 | expected_message = ("Attribute 'HyperThreadingEnabled' is not nullable" 146 | ", but no value received") 147 | doc = etree.fromstring( 148 | test_utils.InventoryEnumerations[ 149 | uris.DCIM_CPUView]['empty_flag']) 150 | cpus = utils.find_xml(doc, 'DCIM_CPUView', uris.DCIM_CPUView, 151 | find_all=True) 152 | 153 | self.assertRaisesRegexp( 154 | exceptions.DRACEmptyResponseField, re.escape(expected_message), 155 | utils.get_all_wsman_resource_attrs, cpus[0], uris.DCIM_CPUView, 156 | 'HyperThreadingEnabled') 157 | 158 | def test_get_all_wsman_resource_attrs_missing_text_allowed(self): 159 | doc = etree.fromstring( 160 | test_utils.RAIDEnumerations[ 161 | uris.DCIM_ControllerView]['ok']) 162 | controllers = utils.find_xml(doc, 'DCIM_ControllerView', 163 | uris.DCIM_ControllerView, find_all=True) 164 | 165 | result = utils.get_all_wsman_resource_attrs( 166 | controllers[0], uris.DCIM_ControllerView, 'DriverVersion', 167 | nullable=True) 168 | self.assertEqual(result, []) 169 | 170 | def test_build_return_dict_fail(self): 171 | self.assertRaises(exceptions.InvalidParameterValue, 172 | utils.build_return_dict, 173 | doc=None, 174 | resource_uri=None, 175 | is_reboot_required_value='foo') 176 | -------------------------------------------------------------------------------- /dracclient/tests/utils.py: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | # not use this file except in compliance with the License. You may obtain 4 | # a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | 14 | import os 15 | 16 | from dracclient.resources import uris 17 | 18 | FAKE_ENDPOINT = { 19 | 'host': '1.2.3.4', 20 | 'port': '443', 21 | 'path': '/wsman', 22 | 'protocol': 'https', 23 | 'username': 'admin', 24 | 'password': 's3cr3t' 25 | } 26 | 27 | 28 | def load_wsman_xml(name): 29 | """Helper function to load a WSMan XML response from a file.""" 30 | 31 | with open(os.path.join(os.path.dirname(__file__), 'wsman_mocks', 32 | '%s.xml' % name), 'r') as f: 33 | xml_body = f.read() 34 | 35 | return xml_body 36 | 37 | 38 | WSManEnumerations = { 39 | 'context': [ 40 | load_wsman_xml('wsman-enum_context-1'), 41 | load_wsman_xml('wsman-enum_context-2'), 42 | load_wsman_xml('wsman-enum_context-3'), 43 | load_wsman_xml('wsman-enum_context-4'), 44 | ] 45 | } 46 | 47 | BIOSEnumerations = { 48 | uris.DCIM_BIOSEnumeration: { 49 | 'ok': load_wsman_xml('bios_enumeration-enum-ok') 50 | }, 51 | uris.DCIM_BIOSInteger: { 52 | 'mutable': load_wsman_xml('bios_integer-enum-mutable'), 53 | 'ok': load_wsman_xml('bios_integer-enum-ok') 54 | }, 55 | uris.DCIM_BIOSString: { 56 | 'colliding': load_wsman_xml('bios_string-enum-colliding'), 57 | 'ok': load_wsman_xml('bios_string-enum-ok'), 58 | 'regexp': load_wsman_xml('bios_string-enum-regexp') 59 | }, 60 | uris.DCIM_BootConfigSetting: { 61 | 'ok': load_wsman_xml('boot_config_setting-enum-ok') 62 | }, 63 | uris.DCIM_BootSourceSetting: { 64 | 'ok': load_wsman_xml('boot_source_setting-enum-ok'), 65 | 'ok-11g': load_wsman_xml('boot_source_setting-enum-ok-11g') 66 | }, 67 | uris.DCIM_ComputerSystem: { 68 | 'ok': load_wsman_xml('computer_system-enum-ok') 69 | }, 70 | } 71 | 72 | BIOSInvocations = { 73 | uris.DCIM_ComputerSystem: { 74 | 'RequestStateChange': { 75 | 'ok': load_wsman_xml( 76 | 'computer_system-invoke-request_state_change-ok'), 77 | 'error': load_wsman_xml( 78 | 'computer_system-invoke-request_state_change-error'), 79 | }, 80 | }, 81 | uris.DCIM_BIOSService: { 82 | 'SetAttributes': { 83 | 'ok': load_wsman_xml( 84 | 'bios_service-invoke-set_attributes-ok'), 85 | 'error': load_wsman_xml( 86 | 'bios_service-invoke-set_attributes-error'), 87 | } 88 | }, 89 | uris.DCIM_BootConfigSetting: { 90 | 'ChangeBootOrderByInstanceID': { 91 | 'ok': load_wsman_xml( 92 | 'boot_config_setting-invoke-change_boot_order_by_instance_id-' 93 | 'ok'), 94 | 'error': load_wsman_xml( 95 | 'boot_config_setting-invoke-change_boot_order_by_instance_id-' 96 | 'error'), 97 | } 98 | } 99 | } 100 | 101 | InventoryEnumerations = { 102 | uris.DCIM_CPUView: { 103 | 'ok': load_wsman_xml('cpu_view-enum-ok'), 104 | 'missing_flags': load_wsman_xml('cpu_view-enum-missing_flags'), 105 | 'empty_flag': load_wsman_xml('cpu_view-enum-empty_flag'), 106 | }, 107 | uris.DCIM_MemoryView: { 108 | 'ok': load_wsman_xml('memory_view-enum-ok') 109 | }, 110 | uris.DCIM_NICView: { 111 | 'ok': load_wsman_xml('nic_view-enum-ok') 112 | } 113 | } 114 | 115 | JobEnumerations = { 116 | uris.DCIM_LifecycleJob: { 117 | 'ok': load_wsman_xml('lifecycle_job-enum-ok'), 118 | 'not_found': load_wsman_xml('lifecycle_job-enum-not_found'), 119 | }, 120 | } 121 | 122 | JobInvocations = { 123 | uris.DCIM_BIOSService: { 124 | 'CreateTargetedConfigJob': { 125 | 'ok': load_wsman_xml( 126 | 'bios_service-invoke-create_targeted_config_job-ok'), 127 | 'error': load_wsman_xml( 128 | 'bios_service-invoke-create_targeted_config_job-error'), 129 | }, 130 | 'DeletePendingConfiguration': { 131 | 'ok': load_wsman_xml( 132 | 'bios_service-invoke-delete_pending_configuration-ok'), 133 | 'error': load_wsman_xml( 134 | 'bios_service-invoke-delete_pending_configuration-error'), 135 | }, 136 | }, 137 | uris.DCIM_LCService: { 138 | 'CreateConfigJob': { 139 | 'ok': load_wsman_xml( 140 | 'lc_service-invoke-create_config_job-ok'), 141 | 'error': load_wsman_xml( 142 | 'lc_service-invoke-create_config_job-error'), 143 | }, 144 | } 145 | } 146 | 147 | JobService = { 148 | uris.DCIM_JobService: { 149 | 'DeleteJobQueue': { 150 | 'ok': load_wsman_xml( 151 | 'job_service-delete-job-id-ok'), 152 | 'error': load_wsman_xml( 153 | 'job_service-delete-job-id-error'), 154 | } 155 | } 156 | } 157 | 158 | iDracCardEnumerations = { 159 | uris.DCIM_iDRACCardEnumeration: { 160 | 'ok': load_wsman_xml('idraccard_enumeration-enum-ok') 161 | }, 162 | uris.DCIM_iDRACCardString: { 163 | 'ok': load_wsman_xml('idraccard_string-enum-ok') 164 | }, 165 | uris.DCIM_iDRACCardInteger: { 166 | 'ok': load_wsman_xml('idraccard_integer-enum-ok') 167 | }, 168 | } 169 | 170 | iDracCardInvocations = { 171 | uris.DCIM_iDRACCardService: { 172 | 'SetAttributes': { 173 | 'ok': load_wsman_xml( 174 | 'idrac_service-invoke-set_attributes-ok') 175 | }, 176 | 'iDRACReset': { 177 | 'ok': load_wsman_xml( 178 | 'idrac_service-reset-ok'), 179 | 'error': load_wsman_xml( 180 | 'idrac_service-reset-error') 181 | } 182 | 183 | } 184 | } 185 | 186 | LifecycleControllerEnumerations = { 187 | uris.DCIM_SystemView: { 188 | 'ok': load_wsman_xml('system_view-enum-ok') 189 | }, 190 | uris.DCIM_LCEnumeration: { 191 | 'ok': load_wsman_xml('lc_enumeration-enum-ok') 192 | }, 193 | uris.DCIM_LCString: { 194 | 'ok': load_wsman_xml('lc_string-enum-ok') 195 | } 196 | } 197 | 198 | LifecycleControllerInvocations = { 199 | uris.DCIM_LCService: { 200 | 'GetRemoteServicesAPIStatus': { 201 | 'is_ready': load_wsman_xml('lc_getremoteservicesapistatus_ready'), 202 | 'is_not_ready': load_wsman_xml( 203 | 'lc_getremoteservicesapistatus_not_ready'), 204 | 'is_recovery': load_wsman_xml( 205 | 'lc_getremoteservicesapistatus_recovery'), 206 | }, 207 | 'SetAttributes': { 208 | 'ok': load_wsman_xml( 209 | 'lc_service-invoke-set_attributes-ok'), 210 | 'error': load_wsman_xml( 211 | 'lc_service-invoke-set_attributes-error'), 212 | } 213 | } 214 | } 215 | 216 | NICEnumerations = { 217 | uris.DCIM_NICEnumeration: { 218 | 'ok': load_wsman_xml('nic_enumeration-enum-ok'), 219 | }, 220 | uris.DCIM_NICString: { 221 | 'ok': load_wsman_xml('nic_string-enum-ok'), 222 | # this duplicates the LinkStatus from nic_enumeration-enum-ok 223 | 'colliding': load_wsman_xml('nic_string-enum-colliding'), 224 | }, 225 | uris.DCIM_NICInteger: { 226 | 'ok': load_wsman_xml('nic_integer-enum-ok') 227 | }, 228 | } 229 | 230 | NICInvocations = { 231 | uris.DCIM_NICService: { 232 | 'SetAttributes': { 233 | 'ok': load_wsman_xml( 234 | 'nic_service-invoke-set_attributes-ok'), 235 | 'error': load_wsman_xml( 236 | 'nic_service-invoke-set_attributes-error'), 237 | } 238 | }, 239 | } 240 | 241 | RAIDEnumerations = { 242 | uris.DCIM_ControllerView: { 243 | 'ok': load_wsman_xml('controller_view-enum-ok') 244 | }, 245 | uris.DCIM_PhysicalDiskView: { 246 | 'ok': load_wsman_xml('physical_disk_view-enum-ok') 247 | }, 248 | uris.DCIM_VirtualDiskView: { 249 | 'Raid_Status_ok': load_wsman_xml( 250 | 'virtual_disk_view-enum-with-raid-status-ok'), 251 | 'ok': load_wsman_xml('virtual_disk_view-enum-ok') 252 | }, 253 | uris.DCIM_RAIDEnumeration: { 254 | 'ok': load_wsman_xml('raid_enumeration-enum-ok') 255 | }, 256 | uris.DCIM_RAIDString: { 257 | 'ok': load_wsman_xml('raid_string-enum-ok') 258 | }, 259 | uris.DCIM_RAIDInteger: { 260 | 'ok': load_wsman_xml('raid_integer-enum-ok') 261 | } 262 | } 263 | 264 | RAIDInvocations = { 265 | uris.DCIM_RAIDService: { 266 | 'CreateVirtualDisk': { 267 | 'ok': load_wsman_xml( 268 | 'raid_service-invoke-create_virtual_disk-ok'), 269 | 'error': load_wsman_xml( 270 | 'raid_service-invoke-create_virtual_disk-error'), 271 | }, 272 | 'DeleteVirtualDisk': { 273 | 'ok': load_wsman_xml( 274 | 'raid_service-invoke-delete_virtual_disk-ok'), 275 | 'error': load_wsman_xml( 276 | 'raid_service-invoke-delete_virtual_disk-error'), 277 | }, 278 | 'ConvertToRAID': { 279 | 'ok': load_wsman_xml( 280 | 'raid_service-invoke-convert_physical_disks-ok'), 281 | 'error': load_wsman_xml( 282 | 'raid_service-invoke-convert_physical_disks-error'), 283 | }, 284 | 'ResetConfig': { 285 | 'ok': load_wsman_xml( 286 | 'raid_service-invoke-reset_raid_config-ok'), 287 | 'error': load_wsman_xml( 288 | 'raid_service-invoke-reset_raid_config-error'), 289 | }, 290 | 'ClearForeignConfig': { 291 | 'ok': load_wsman_xml( 292 | 'raid_service-invoke-clear_foreign_config-ok'), 293 | 'no_foreign_drive': load_wsman_xml( 294 | 'raid_service-invoke-clear_foreign_config-no_foreign_drive'), 295 | 'invalid_controller_id': load_wsman_xml( 296 | 'raid_service-invoke-clear_foreign_config-invalid_controller'), 297 | 'foreign_drive_operation_not_supported': load_wsman_xml( 298 | 'raid_service-invoke-clear_foreign_config-not_supported'), 299 | }, 300 | 'SetAttributes': { 301 | 'ok': load_wsman_xml( 302 | 'raid_service-invoke-set_attributes-ok'), 303 | 'error': load_wsman_xml( 304 | 'raid_service-invoke-set_attributes-error'), 305 | } 306 | } 307 | } 308 | 309 | SystemEnumerations = { 310 | uris.DCIM_SystemEnumeration: { 311 | 'ok': load_wsman_xml('system_enumeration-enum-ok'), 312 | }, 313 | uris.DCIM_SystemString: { 314 | 'ok': load_wsman_xml('system_string-enum-ok'), 315 | }, 316 | uris.DCIM_SystemInteger: { 317 | 'ok': load_wsman_xml('system_integer-enum-ok'), 318 | } 319 | } 320 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/bios_integer-enum-mutable.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 9 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse 10 | uuid:382b3463-6ab7-4998-85d5-0ac3f4d3044d 11 | uuid:319dc294-2213-1213-8eeb-a36fc6fe83b0 12 | 13 | 14 | 15 | 16 | 17 | Number of Cores 18 | Proc1NumCores 19 | 8 20 | 21 | 446 22 | BIOS.Setup.1-1 23 | Processor Settings 24 | ProcSettings 25 | BIOS.Setup.1-1:Proc1NumCores 26 | false 27 | 0 28 | 29 | 65535 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/bios_integer-enum-ok.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 9 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse 10 | uuid:382b3463-6ab7-4998-85d5-0ac3f4d3044d 11 | uuid:319dc294-2213-1213-8eeb-a36fc6fe83b0 12 | 13 | 14 | 15 | 16 | 17 | Number of Cores 18 | Proc1NumCores 19 | 8 20 | 21 | 446 22 | BIOS.Setup.1-1 23 | Processor Settings 24 | ProcSettings 25 | BIOS.Setup.1-1:Proc1NumCores 26 | true 27 | 0 28 | 29 | 65535 30 | 31 | 32 | User Defined Delay (60s to 240s) 33 | AcPwrRcvryUserDelay 34 | 60 35 | 37 | 38 | Off 39 | User 40 | ]]> 41 | 1431 42 | BIOS.Setup.1-1 43 | System Security 44 | SysSecurity 45 | BIOS.Setup.1-1:AcPwrRcvryUserDelay 46 | true 47 | 60 48 | 49 | 240 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/bios_service-invoke-create_targeted_config_job-error.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_BIOSService/CreateTargetedConfigJobResponse 7 | uuid:80cf5e1b-b109-4ef5-87c8-5b03ce6ba117 8 | uuid:e57fa514-2189-1189-8ec1-a36fc6fe83b0 9 | 10 | 11 | 12 | Configuration job already created, cannot create another config job on specified target until existing job is completed or is cancelled 13 | BIOS007 14 | 2 15 | 16 | 17 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/bios_service-invoke-create_targeted_config_job-ok.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 7 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_BIOSService/CreateTargetedConfigJobResponse 8 | uuid:fc2fdae5-6ac2-4338-9b2e-e69b813af829 9 | uuid:d7d89957-2189-1189-8ec0-a36fc6fe83b0 10 | 11 | 12 | 13 | 14 | 15 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 16 | 17 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_LifecycleJob 18 | 19 | JID_442507917525 20 | root/dcim 21 | 22 | 23 | 24 | 25 | 4096 26 | 27 | 28 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/bios_service-invoke-delete_pending_configuration-error.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_BIOSService/DeletePendingConfigurationResponse 7 | uuid:6bd49922-f63b-44d9-abf7-b902f08ec932 8 | uuid:87a16ea4-2189-1189-8eb5-a36fc6fe83b0 9 | 10 | 11 | 12 | Configuration job already created, pending data cannot be deleted 13 | BIOS011 14 | 2 15 | 16 | 17 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/bios_service-invoke-delete_pending_configuration-ok.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 4 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_BIOSService/DeletePendingConfigurationResponse 5 | uuid:33b4948b-79e6-42ff-8670-19fbb25702c8 6 | uuid:d578f646-2189-1189-8ebe-a36fc6fe83b0 7 | 8 | 9 | 10 | The command was successful. 11 | BIOS001 12 | 0 13 | 14 | 15 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/bios_service-invoke-set_attributes-error.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_BIOSService/SetAttributesResponse 7 | uuid:f06dfc6d-b102-43d8-a61e-722b7ec8b7b2 8 | uuid:2bfaa9a2-223c-123c-8f55-a36fc6fe83b0 9 | 10 | 11 | 12 | Invalid AttributeValue for AttributeName ProcVirtualization 13 | ProcVirtualization 14 | BIOS014 15 | Yes 16 | 2 17 | Set PendingValue 18 | 19 | 20 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/bios_service-invoke-set_attributes-ok.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_BIOSService/SetAttributesResponse 7 | uuid:9ffdced1-8f2e-441c-a42a-e6c56d9859c8 8 | uuid:d139ff73-223b-123b-8f47-a36fc6fe83b0 9 | 10 | 11 | 12 | The command was successful. 13 | BIOS001 14 | Yes 15 | 0 16 | Set PendingValue 17 | 18 | 19 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/bios_string-enum-colliding.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 9 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse 10 | uuid:1d8b3e77-8919-4459-8f06-2d63284c15c1 11 | uuid:31707306-2213-1213-8ee9-a36fc6fe83b0 12 | 13 | 14 | 15 | 16 | 17 | System Memory Testing 18 | MemTest 19 | PowerEdge R320 20 | 21 | 200 22 | BIOS.Setup.1-1 23 | System Information 24 | SysInformation 25 | BIOS.Setup.1-1:SystemModelName 26 | true 27 | 32 28 | 0 29 | 30 | 31 | 32 | 33 | Memory Operating Mode 34 | MemOpMode 35 | 2.3.3 36 | 37 | 201 38 | BIOS.Setup.1-1 39 | System Information 40 | SysInformation 41 | BIOS.Setup.1-1:SystemBiosVersion 42 | true 43 | 48 44 | 0 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/bios_string-enum-regexp.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 9 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse 10 | uuid:1d8b3e77-8919-4459-8f06-2d63284c15c1 11 | uuid:31707306-2213-1213-8ee9-a36fc6fe83b0 12 | 13 | 14 | 15 | 16 | 17 | System Model Name 18 | SystemModelName 19 | PowerEdge R320 20 | 21 | 200 22 | BIOS.Setup.1-1 23 | System Information 24 | SysInformation 25 | BIOS.Setup.1-1:SystemModelName 26 | false 27 | 32 28 | 0 29 | 30 | foo 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/boot_config_setting-enum-ok.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 8 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse 9 | uuid:0fa1f933-4c3c-480f-8a35-75035f9fbfad 10 | uuid:6fa24f5f-2170-1170-8ea5-a36fc6fe83b0 11 | 12 | 13 | 14 | 15 | 16 | BootSeq 17 | IPL 18 | 1 19 | 0 20 | 1 21 | 22 | 23 | HddSeq 24 | BCV 25 | 2 26 | 0 27 | 2 28 | 29 | 30 | UefiBootSeq 31 | UEFI 32 | 2 33 | 0 34 | 2 35 | 36 | 37 | OneTimeBootMode 38 | OneTime 39 | 2 40 | 0 41 | 2 42 | 43 | 44 | vFlash Boot Configuration 45 | vFlash 46 | 2 47 | 0 48 | 2 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/boot_config_setting-invoke-change_boot_order_by_instance_id-error.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_BootConfigSetting/ChangeBootOrderByInstanceIDResponse 7 | uuid:9c14b4d7-9d68-4240-a523-bfe733ec3c19 8 | uuid:072e2dd9-2188-1188-8ea8-a36fc6fe83b0 9 | 10 | 11 | 12 | Boot Source does not belong to specified Boot Configuration 13 | BOOT007 14 | 2 15 | 16 | 17 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/boot_config_setting-invoke-change_boot_order_by_instance_id-ok.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_BootConfigSetting/ChangeBootOrderByInstanceIDResponse 7 | uuid:6489f08e-43f8-4616-9c8e-46502a0d297e 8 | uuid:14c20b22-2188-1188-8ead-a36fc6fe83b0 9 | 10 | 11 | 12 | The command was successful 13 | BOOT001 14 | 0 15 | 16 | 17 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/boot_source_setting-enum-ok-11g.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 8 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse 9 | uuid:307f8c7a-e08f-491c-906f-97917d12aca3 10 | uuid:a6d469c4-0340-1340-8003-96a61a2b2b84 11 | 12 | 13 | 14 | 15 | 16 | Embedded NIC 1: BRCM MBA Slot 0200 v7.2.3 BootSeq 17 | Embedded NIC 1: BRCM MBA Slot 0200 v7.2.3 BootSeq 18 | 0 19 | 1 20 | Embedded NIC 1: BRCM MBA Slot 0200 v7.2.3 BootSeq 21 | 1 22 | IPL:NIC.Embedded.1-1:082927b7c62a9f52ef0d65a33416d76c 23 | 0 24 | 1 25 | 26 | 27 | Hard drive C: BootSeq 28 | Hard drive C: BootSeq 29 | 1 30 | 1 31 | Hard drive C: BootSeq 32 | 1 33 | IPL:HardDisk.List.1-1:c9203080df84781e2ca3d512883dee6f 34 | 1 35 | 1 36 | 37 | 38 | Embedded SATA Port A Optical: SATA Optical Drive BootSeq 39 | Embedded SATA Port A Optical: SATA Optical Drive BootSeq 40 | 2 41 | 1 42 | Embedded SATA Port A Optical: SATA Optical Drive BootSeq 43 | 1 44 | IPL:Optical.SATAEmbedded.A-1:eb8aeb15796fb85f8e1447f0cfb8a68e 45 | 2 46 | 1 47 | 48 | 49 | Integrated SAS: #0100 ID0B LUN0 FUJITSU MBD2147RC HddSeq 50 | Integrated SAS: #0100 ID0B LUN0 FUJITSU MBD2147RC HddSeq 51 | 0 52 | 1 53 | Integrated SAS: #0100 ID0B LUN0 FUJITSU MBD2147RC HddSeq 54 | 2 55 | BCV:RAID.Integrated.1-1:b0288ef62190fe49448c0c8bd58e3299 56 | 0 57 | 1 58 | 59 | 60 | Embedded SATA Port A Optical: TEAC DVD-ROM DV-28SW UefiBootSeq 61 | Embedded SATA Port A Optical: TEAC DVD-ROM DV-28SW UefiBootSeq 62 | 0 63 | 1 64 | Embedded SATA Port A Optical: TEAC DVD-ROM DV-28SW UefiBootSeq 65 | 1 66 | UEFI:Optical.SATAEmbedded.A-1:f4517f4fe99654f4b3d1f2cf5ffa1236 67 | 0 68 | 1 69 | 70 | 71 | Embedded NIC 1: Broadcom NetXtreme II Gigabit Ethernet (BCM5709) UefiBootSeq 72 | Embedded NIC 1: Broadcom NetXtreme II Gigabit Ethernet (BCM5709) UefiBootSeq 73 | 1 74 | 1 75 | Embedded NIC 1: Broadcom NetXtreme II Gigabit Ethernet (BCM5709) UefiBootSeq 76 | 1 77 | UEFI:NIC.Embedded.1-1:764aa69cc6ae153bf9aa038a0cf31bf2 78 | 1 79 | 1 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/boot_source_setting-enum-ok.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 8 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse 9 | uuid:8228360f-4368-4377-a020-7b86001ec6a2 10 | uuid:9daff045-2172-1172-8ea7-a36fc6fe83b0 11 | 12 | 13 | 14 | 15 | 16 | Embedded SATA Port Optical Drive E: HL-DT-ST DVD-ROM DU90N BootSeq 17 | IPL 18 | Embedded SATA Port Optical Drive E: HL-DT-ST DVD-ROM DU90N BootSeq 19 | 1 20 | 1 21 | Embedded SATA Port Optical Drive E: HL-DT-ST DVD-ROM DU90N BootSeq 22 | 1 23 | IPL:BIOS.Setup.1-1#BootSeq#Optical.SATAEmbedded.E-1#9cfba379c4a2890f7f419c75db47d605 24 | 1 25 | 1 26 | 27 | 28 | Embedded NIC 1 Port 1 Partition 1: BRCM MBA Slot 0200 v16.4.3 BootSeq 29 | IPL 30 | Embedded NIC 1 Port 1 Partition 1: BRCM MBA Slot 0200 v16.4.3 BootSeq 31 | 0 32 | 1 33 | Embedded NIC 1 Port 1 Partition 1: BRCM MBA Slot 0200 v16.4.3 BootSeq 34 | 1 35 | IPL:BIOS.Setup.1-1#BootSeq#NIC.Embedded.1-1-1#fbeeb18f19fd4e768c941e66af4fc424 36 | 0 37 | 1 38 | 39 | 40 | Hard drive C: BootSeq 41 | IPL 42 | Hard drive C: BootSeq 43 | 2 44 | 1 45 | Hard drive C: BootSeq 46 | 1 47 | IPL:BIOS.Setup.1-1#BootSeq#HardDisk.List.1-1#c9203080df84781e2ca3d512883dee6f 48 | 2 49 | 1 50 | 51 | 52 | Integrated RAID Controller 1: PERC H710 Mini(bus 01 dev 00) HddSeq 53 | BCV 54 | Integrated RAID Controller 1: PERC H710 Mini(bus 01 dev 00) HddSeq 55 | 0 56 | 1 57 | Integrated RAID Controller 1: PERC H710 Mini(bus 01 dev 00) HddSeq 58 | 2 59 | BCV:BIOS.Setup.1-1#HddSeq#RAID.Integrated.1-1#aa80b1ccc4782ee46ad0015e60b9f8bc 60 | 0 61 | 1 62 | 63 | 64 | Embedded SATA Port Optical Drive E: HL-DT-ST DVD-ROM DU90N UefiBootSeq 65 | UEFI 66 | Embedded SATA Port Optical Drive E: HL-DT-ST DVD-ROM DU90N UefiBootSeq 67 | 0 68 | 1 69 | Embedded SATA Port Optical Drive E: HL-DT-ST DVD-ROM DU90N UefiBootSeq 70 | 1 71 | UEFI:BIOS.Setup.1-1#UefiBootSeq#Optical.SATAEmbedded.E-1#e63a20057ae7c7a24a2dcfe561ab3059 72 | 0 73 | 1 74 | 75 | 76 | Embedded NIC 1 Port 1 Partition 1: EFI Network 1 UefiBootSeq 77 | UEFI 78 | Embedded NIC 1 Port 1 Partition 1: EFI Network 1 UefiBootSeq 79 | 1 80 | 0 81 | Embedded NIC 1 Port 1 Partition 1: EFI Network 1 UefiBootSeq 82 | 1 83 | UEFI:BIOS.Setup.1-1#UefiBootSeq#NIC.Embedded.1-1-1#4957070f0aa1fcff841e886b4011e6e5 84 | 1 85 | 0 86 | 87 | 88 | Embedded NIC 2 Port 1 Partition 1: EFI Network 2 UefiBootSeq 89 | UEFI 90 | Embedded NIC 2 Port 1 Partition 1: EFI Network 2 UefiBootSeq 91 | 2 92 | 0 93 | Embedded NIC 2 Port 1 Partition 1: EFI Network 2 UefiBootSeq 94 | 1 95 | UEFI:BIOS.Setup.1-1#UefiBootSeq#NIC.Embedded.2-1-1#236af982351f674f952c4db458fe40ab 96 | 2 97 | 0 98 | 99 | 100 | NIC in Slot 2 Port 1 Partition 1: EFI Network 3 UefiBootSeq 101 | UEFI 102 | NIC in Slot 2 Port 1 Partition 1: EFI Network 3 UefiBootSeq 103 | 3 104 | 0 105 | NIC in Slot 2 Port 1 Partition 1: EFI Network 3 UefiBootSeq 106 | 1 107 | UEFI:BIOS.Setup.1-1#UefiBootSeq#NIC.Slot.2-1-1#d4dcb3203b7a0e381ffa1c5df5873890 108 | 3 109 | 0 110 | 111 | 112 | NIC in Slot 2 Port 2 Partition 1: EFI Network 4 UefiBootSeq 113 | UEFI 114 | NIC in Slot 2 Port 2 Partition 1: EFI Network 4 UefiBootSeq 115 | 4 116 | 0 117 | NIC in Slot 2 Port 2 Partition 1: EFI Network 4 UefiBootSeq 118 | 1 119 | UEFI:BIOS.Setup.1-1#UefiBootSeq#NIC.Slot.2-2-1#f438b57a48e180b211662c463cd406b1 120 | 4 121 | 0 122 | 123 | 124 | Unavailable: Windows Boot Manager UefiBootSeq 125 | UEFI 126 | Unavailable: Windows Boot Manager UefiBootSeq 127 | 5 128 | 1 129 | Unavailable: Windows Boot Manager UefiBootSeq 130 | 1 131 | UEFI:BIOS.Setup.1-1#UefiBootSeq#Unknown.Unknown.6-1#f80cdb0ddd723411affd9b05852b3f4a 132 | 5 133 | 1 134 | 135 | 136 | 137 | 138 | 139 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/computer_system-enum-ok.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 7 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/PullResponse 8 | uuid:2b1f3c28-1ca3-1ca3-8003-fd0aa2bdb228 9 | uuid:5ba7c817-1ca7-1ca7-8a31-a36fc6fe83b0 10 | 11 | 12 | 13 | 14 | 15 | DCIM_ComputerSystem 16 | 2 17 | srv:system 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/computer_system-invoke-request_state_change-error.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_ComputerSystem/RequestStateChangeResponse 7 | uuid:0e1e69c7-1ca6-1ca6-8002-fd0aa2bdb228 8 | uuid:3f2d0db0-1caa-1caa-8003-fcc71555dbe0 9 | 10 | 11 | 12 | The command failed to set RequestedState 13 | RequestedState 14 | SYS021 15 | 2 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/computer_system-invoke-request_state_change-ok.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_ComputerSystem/RequestStateChangeResponse 7 | uuid:11302b44-1ca6-1ca6-8002-fd0aa2bdb228 8 | uuid:4244f4ca-1caa-1caa-8004-fcc71555dbe0 9 | 10 | 11 | 12 | 0 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/controller_view-enum-ok.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 9 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse 10 | uuid:4eccb42a-103a-103a-8002-fd0aa2bdb228 11 | uuid:55b0f8ed-103f-103f-8988-a36fc6fe83b0 12 | 13 | 14 | 15 | 16 | 17 | 1 18 | 512 19 | 1 20 | 21.3.0-0009 21 | 0 22 | Unknown 23 | DELL 24 | 2 25 | Unknown 26 | Integrated RAID Controller 1 27 | 28 | 1 29 | 0 30 | RAID.Integrated.1-1 31 | 0 32 | RAID.Integrated.1-1 33 | 34 | 20150226175957.000000+000 35 | 20150226175950.000000+000 36 | Generation 2 37 | Generation 3 38 | 5B 39 | 1 40 | 1F38 41 | 1028 42 | 1000 43 | 0 44 | 1 45 | PERC H710 Mini 46 | 1 47 | 1 48 | 5B083FE0D2D0F200 49 | 1 50 | 1 51 | 1 52 | 1 53 | 0 54 | 0 55 | 56 | 57 | 2 58 | 512 59 | 1 60 | 2.5.13.2009 61 | 1 62 | Unknown 63 | DELL 64 | 2 65 | Unknown 66 | AHCI.Integrated.1-1 67 | 68 | 1 69 | 0 70 | AHCI.Integrated.1-1 71 | 0 72 | AHCI.Integrated.1-1 73 | 74 | 20150226175957.000000+000 75 | 20150226175950.000000+000 76 | Generation 2 77 | Generation 3 78 | 5B 79 | 1 80 | 1F38 81 | 1028 82 | 1000 83 | 0 84 | 1 85 | BOSS-S1 86 | 0 87 | 1 88 | 5B083FE0D2D0F201 89 | 1 90 | 1 91 | 1 92 | 1 93 | 0 94 | 0 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/cpu_view-enum-empty_flag.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 8 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse 9 | uuid:dd7ea19a-8633-4fa4-a43a-66ae8220f689 10 | uuid:247e710c-29de-19de-93c9-f148d4fe83b0 11 | 12 | 13 | 14 | 15 | 16 | B3 17 | 1 18 | 7 19 | 4 20 | 0 21 | 0 22 | 1 23 | 2 24 | 384 25 | 5 26 | 1 27 | 7 28 | 5 29 | 1 30 | 0 31 | 1 32 | 2 33 | 1536 34 | 5 35 | 1 36 | 14 37 | 5 38 | 2 39 | 0 40 | 1 41 | 2 42 | 15360 43 | 5 44 | 1 45 | 4 46 | 2400 47 | CPU 1 48 | 0 49 | 0 50 | 6400 51 | CPU.Socket.1 52 | 53 | 54 | CPU.Socket.1 55 | 20160107171416.000000+000 56 | 20151112172601.000000+000 57 | Intel 58 | 4000 59 | Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz 60 | 6 61 | 12 62 | 6 63 | 1 64 | 1 65 | 1 66 | 1 67 | 1 68 | 1.3 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/cpu_view-enum-missing_flags.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 8 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse 9 | uuid:bde5656e-1253-4545-87dd-a111346efebe 10 | uuid:35d42397-376d-176d-8062-a36fc6fe83b0 11 | 12 | 13 | 14 | 15 | 16 | B3 17 | 1 18 | 7 19 | 5 20 | 0 21 | 1 22 | 2 23 | 256 24 | 4 25 | 1 26 | 7 27 | 5 28 | 1 29 | 1 30 | 2 31 | 2048 32 | 5 33 | 1 34 | 14 35 | 5 36 | 2 37 | 1 38 | 2 39 | 20480 40 | 5 41 | 1 42 | 2 43 | 1900 44 | CPU 1 45 | 6400 46 | CPU.Socket.1 47 | CPU.Socket.1 48 | 20160706154809.000000+000 49 | 20141016232016.000000+000 50 | Intel 51 | 3600 52 | Intel(R) Xeon(R) CPU E5-2440 v2 @ 1.90GHz 53 | 8 54 | 16 55 | 8 56 | 1 57 | 1.2 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/cpu_view-enum-ok.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 8 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse 9 | uuid:dd7ea19a-8633-4fa4-a43a-66ae8220f689 10 | uuid:247e710c-29de-19de-93c9-f148d4fe83b0 11 | 12 | 13 | 14 | 15 | 16 | B3 17 | 1 18 | 7 19 | 4 20 | 0 21 | 0 22 | 1 23 | 2 24 | 384 25 | 5 26 | 1 27 | 7 28 | 5 29 | 1 30 | 0 31 | 1 32 | 2 33 | 1536 34 | 5 35 | 1 36 | 14 37 | 5 38 | 2 39 | 0 40 | 1 41 | 2 42 | 15360 43 | 5 44 | 1 45 | 4 46 | 2400 47 | CPU 1 48 | 0 49 | 0 50 | 6400 51 | CPU.Socket.1 52 | 1 53 | 1 54 | CPU.Socket.1 55 | 20160107171416.000000+000 56 | 20151112172601.000000+000 57 | Intel 58 | 4000 59 | Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz 60 | 6 61 | 12 62 | 6 63 | 1 64 | 1 65 | 1 66 | 1 67 | 1 68 | 1.3 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/idrac_service-invoke-set_attributes-ok.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_iDRACCardService/SetAttributesResponse 7 | uuid:305ed6f4-2269-43c5-8c28-00b85e81099d 8 | uuid:683c34bc-53c4-13c4-8064-17c1f0d9bed4 9 | 10 | 11 | 12 | The command was successful 13 | RAC001 14 | No 15 | 0 16 | Set PendingValue 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/idrac_service-reset-error.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | 7 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_iDRACCardService/iDRACResetResponse 8 | 9 | uuid:a65ce3df-3690-42dd-af45-5c1f2cd0793b 10 | 11 | uuid:e8f2cbe0-6fd0-1fd0-8057-dc9c046694d0 12 | 13 | 14 | 15 | 16 | Invalid parameter value for Force 17 | Force 18 | RAC004 19 | 2 20 | 21 | 22 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/idrac_service-reset-ok.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | 7 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_iDRACCardService/iDRACResetResponse 8 | 9 | uuid:a4a1cd1a-7c10-4dfc-98d9-d0cc2cd7c80c 10 | 11 | uuid:6f9ecf40-6fd1-1fd1-a60b-dc9c046694d0 12 | 13 | 14 | 15 | 16 | iDRAC was successfully reset. 17 | RAC064 18 | 0 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/job_service-delete-job-id-error.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | 7 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_JobService/DeleteJobQueueResponse 8 | 9 | uuid:bd334a80-bd6f-4fc9-88cc-9c9cb79d41e8 10 | 11 | uuid:ce21f862-70ac-10ac-b40d-64b5b4da6618 12 | 13 | 14 | 15 | 16 | Invalid Job ID 17 | SUP011 18 | 2 19 | 20 | 21 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/job_service-delete-job-id-ok.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | 7 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_JobService/DeleteJobQueueResponse 8 | 9 | uuid:5f1b62ee-19d4-4679-b083-477086856c79 10 | 11 | uuid:07b2e831-70ae-10ae-b56f-64b5b4da6618 12 | 13 | 14 | 15 | 16 | The specified job was deleted 17 | SUP020 18 | 0 19 | 20 | 21 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/lc_enumeration-enum-ok.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 9 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse 10 | uuid:68f2fe2e-1424-4833-9ac0-756f24db2542 11 | uuid:3ae5f7b2-40a9-10a9-8061-de7e4e771814 12 | 13 | 14 | 15 | 16 | 17 | Collect System Inventory on Restart 18 | Enabled 19 | Enabled 20 | LC.emb.1 21 | LifecycleController.Embedded.1#LCAttributes.1#CollectSystemInventoryOnRestart 22 | false 23 | 24 | Disabled 25 | Enabled 26 | 27 | 28 | Part Configuration Update 29 | Apply always 30 | Apply always 31 | LC.emb.1 32 | LifecycleController.Embedded.1#LCAttributes.1#PartConfigurationUpdate 33 | false 34 | 35 | Disabled 36 | Apply always 37 | Apply only if firmware match 38 | 39 | 40 | Part Firmware Update 41 | Match firmware of replaced part 42 | Match firmware of replaced part 43 | LC.emb.1 44 | LifecycleController.Embedded.1#LCAttributes.1#PartFirmwareUpdate 45 | false 46 | 47 | Disable 48 | Allow version upgrade only 49 | Match firmware of replaced part 50 | 51 | 52 | Lifecycle Controller State 53 | Enabled 54 | Enabled 55 | LC.emb.1 56 | LifecycleController.Embedded.1#LCAttributes.1#LifecycleControllerState 57 | false 58 | 59 | Disabled 60 | Enabled 61 | Recovery 62 | 63 | 64 | Licensed 65 | Yes 66 | No 67 | LC.emb.1 68 | LifecycleController.Embedded.1#LCAttributes.1#Licensed 69 | true 70 | 71 | No 72 | Yes 73 | 74 | 75 | Auto Discovery 76 | Off 77 | Off 78 | LC.emb.1 79 | LifecycleController.Embedded.1#LCAttributes.1#AutoDiscovery 80 | true 81 | 82 | Off 83 | On 84 | 85 | 86 | Discovery Factory Defaults 87 | Off 88 | Off 89 | LC.emb.1 90 | LifecycleController.Embedded.1#LCAttributes.1#DiscoveryFactoryDefaults 91 | true 92 | 93 | Off 94 | On 95 | 96 | 97 | IPChangeNotifyPS 98 | Off 99 | Off 100 | LC.emb.1 101 | LifecycleController.Embedded.1#LCAttributes.1#IPChangeNotifyPS 102 | false 103 | 104 | Off 105 | On 106 | 107 | 108 | BIOS Reset To Defaults Requested 109 | False 110 | False 111 | LC.emb.1 112 | LifecycleController.Embedded.1#LCAttributes.1#BIOSRTDRequested 113 | false 114 | 115 | False 116 | True 117 | 118 | 119 | Automatic Update Feature 120 | Enabled 121 | Disabled 122 | LC.emb.1 123 | LifecycleController.Embedded.1#LCAttributes.1#AutoUpdate 124 | false 125 | 126 | Disabled 127 | Enabled 128 | 129 | Automatic Backup Feature 130 | Disabled 131 | Disabled 132 | LC.emb.1 133 | LifecycleController.Embedded.1#LCAttributes.1#AutoBackup 134 | false 135 | 136 | Disabled 137 | Enabled 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/lc_getremoteservicesapistatus_not_ready.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 4 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_LCService/GetRemoteServicesAPIStatusResponse 5 | uuid:3ef0c018-3169-4184-9d81-ee1a73059940 6 | uuid:9d5ff7cc-4fc0-1fc0-8090-98d61742a844 7 | 8 | 9 | 10 | 5 11 | Lifecycle Controller Remote Services is not ready. 12 | LC060 13 | 0 14 | 0 15 | 2 16 | 1 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/lc_getremoteservicesapistatus_ready.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 4 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_LCService/GetRemoteServicesAPIStatusResponse 5 | uuid:18745811-2782-4d30-a288-8f001a895215 6 | uuid:9ec203ba-4fc0-1fc0-8094-98d61742a844 7 | 8 | 9 | 10 | 0 11 | Lifecycle Controller Remote Services is ready. 12 | LC061 13 | 0 14 | 0 15 | 2 16 | 0 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/lc_getremoteservicesapistatus_recovery.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 4 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_LCService/GetRemoteServicesAPIStatusResponse 5 | uuid:18745811-2782-4d30-a288-8f001a895215 6 | uuid:9ec203ba-4fc0-1fc0-8094-98d61742a844 7 | 8 | 9 | 10 | 4 11 | Lifecycle Controller Remote Services is not ready. 12 | LC060 13 | 0 14 | 0 15 | 7 16 | 1 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/lc_service-invoke-create_config_job-error.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_LCService/CreateConfigJobResponse 7 | uuid:80cf5e1b-b109-4ef5-87c8-5b03ce6ba117 8 | uuid:e57fa514-2189-1189-8ec1-a36fc6fe83b0 9 | 10 | 11 | 12 | Configuration job already created, cannot create another config job on specified target until existing job is completed or is cancelled 13 | LC007 14 | 2 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/lc_service-invoke-create_config_job-ok.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 7 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_LCService/CreateConfigJobResponse 8 | uuid:fc2fdae5-6ac2-4338-9b2e-e69b813af829 9 | uuid:d7d89957-2189-1189-8ec0-a36fc6fe83b0 10 | 11 | 12 | 13 | 14 | 15 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 16 | 17 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_LifecycleJob 18 | 19 | JID_442507917525 20 | root/dcim 21 | 22 | 23 | 24 | 25 | 4096 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/lc_service-invoke-set_attributes-error.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | 7 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_LCService/SetAttributesResponse 8 | 9 | uuid:bf8adefe-6fc0-456d-b97c-fd8d4aca2d6c 10 | 11 | uuid:84abf7b9-7176-1176-a11c-a53ffbd9bed4 12 | 13 | 14 | 15 | 16 | Invalid AttributeName. 17 | LC057 18 | 2 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/lc_service-invoke-set_attributes-ok.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | 7 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_LCService/SetAttributesResponse 8 | 9 | uuid:bf8adefe-6fc0-456d-b97c-fd8d4aca2d6c 10 | 11 | uuid:84abf7b9-7176-1176-a11c-a53ffbd9bed4 12 | 13 | 14 | 15 | 16 | LC001 17 | The command was successful 18 | 0 19 | No 20 | Set PendingValue 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/lc_string-enum-ok.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 9 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse 10 | uuid:d0ede1a5-1f68-4bf6-a4ed-b528e92419db 11 | uuid:159ae3a2-40aa-10aa-8171-de7e4e771814 12 | 13 | 14 | 15 | 16 | 17 | SYSID 18 | 639 19 | LC.emb.1 20 | LifecycleController.Embedded.1#LCAttributes.1#SystemID 21 | true 22 | 3 23 | 0 24 | 25 | 3 26 | 27 | 28 | VirtualAddressManagementApplication 29 | 30 | 31 | LC.emb.1 32 | LifecycleController.Embedded.1#LCAttributes.1#VirtualAddressManagementApplication 33 | false 34 | 32 35 | 0 36 | 37 | 2 38 | 39 | 40 | Provisioning Server 41 | 42 | LC.emb.1 43 | LifecycleController.Embedded.1#LCAttributes.1#ProvisioningServer 44 | false 45 | 255 46 | 0 47 | 48 | 2 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/lifecycle_job-enum-not_found.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 8 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse 9 | uuid:2453cc4f-104c-104c-8002-fd0aa2bdb228 10 | uuid:28c00f71-1051-1051-8003-fcc71555dbe0 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/lifecycle_job-enum-ok.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 4 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse 5 | uuid:f3ee3b82-210b-110b-8002-fd0aa2bdb228 6 | uuid:f4327d65-210b-110b-836c-0581b4d9bed4 7 | 8 | 9 | 10 | 11 | 12 | JID_CLEARALL 13 | TIME_NA 14 | Pending 15 | TIME_NA 16 | NA 17 | NA 18 | CLEARALL 19 | 0 20 | 21 | 22 | JID_001436912645 23 | 00000101000000 24 | Completed 25 | TIME_NA 26 | Job completed successfully 27 | PR19 28 | ConfigBIOS:BIOS.Setup.1-1 29 | 100 30 | 31 | 32 | JID_001436960861 33 | 00000101000000 34 | Completed 35 | TIME_NA 36 | Job completed successfully 37 | PR19 38 | ConfigBIOS:BIOS.Setup.1-1 39 | 100 40 | 41 | 42 | JID_001436966148 43 | 00000101000000 44 | Completed 45 | TIME_NA 46 | Job completed successfully 47 | PR19 48 | ConfigBIOS:BIOS.Setup.1-1 49 | 100 50 | 51 | 52 | JID_001436980372 53 | 00000101000000 54 | Completed 55 | TIME_NA 56 | Job completed successfully 57 | PR19 58 | ConfigBIOS:BIOS.Setup.1-1 59 | 100 60 | 61 | 62 | JID_001436981582 63 | 00000101000000 64 | Running 65 | TIME_NA 66 | Job in progress 67 | PR20 68 | ConfigBIOS:BIOS.Setup.1-1 69 | 34 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/memory_view-enum-ok.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 9 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse 10 | uuid:6a7e85cd-00a9-49a2-a781-d047063b9975 11 | uuid:09c85e7c-2fda-1fda-bf81-f148d4fe83b0 12 | 13 | 14 | 15 | 16 | 17 | A 18 | 1866 19 | DIMM A1 20 | DIMM.Socket.A1 21 | DIMM.Socket.A1 22 | 20160215025015.000000+000 23 | 20151112191452.000000+000 24 | Mon Sep 22 07:00:00 2014 UTC 25 | Samsung 26 | 26 27 | DDR4 DIMM 28 | M393A2G40DB0-CPB 29 | 1 30 | 2 31 | 39406867 32 | 16384 33 | 2133 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/nic_service-invoke-set_attributes-error.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | 7 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_NICService/SetAttributesResponse 8 | 9 | uuid:e24aa9e2-28f3-487d-8f69-ab4234a2c9ba 10 | 11 | uuid:d3770d92-7202-1202-b927-a53ffbd9bed4 12 | 13 | 14 | 15 | 16 | Invalid parameter value for Target 17 | Target 18 | NIC004 19 | 2 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/nic_service-invoke-set_attributes-ok.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | 7 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_NICService/SetAttributesResponse 8 | 9 | uuid:bf8adefe-6fc0-456d-b97c-fd8d4aca2d6c 10 | 11 | uuid:84abf7b9-7176-1176-a11c-a53ffbd9bed4 12 | 13 | 14 | 15 | 16 | The command was successful. 17 | NIC001 18 | Yes 19 | 0 20 | Set PendingValue 21 | 22 | 23 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/raid_service-invoke-clear_foreign_config-invalid_controller.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_RAIDService/ClearForeignConfigResponse 7 | uuid:f9487fcf-103a-103a-8002-fd0aa2bdb228 8 | uuid:000852e6-1040-1040-8997-a36fc6fe83b0 9 | 10 | 11 | 12 | Controller not found 13 | STOR030 14 | 2 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/raid_service-invoke-clear_foreign_config-no_foreign_drive.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_RAIDService/ClearForeignConfigResponse 7 | uuid:f9487fcf-103a-103a-8002-fd0aa2bdb228 8 | uuid:000852e6-1040-1040-8997-a36fc6fe83b0 9 | 10 | 11 | 12 | No foreign drives detected 13 | STOR018 14 | 2 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/raid_service-invoke-clear_foreign_config-not_supported.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_RAIDService/ClearForeignConfigResponse 7 | uuid:473f8ede-9a1a-441a-aaf6-699c1476aa97 8 | uuid:55d91de0-90a1-10a1-8147-8c0c498fd94c 9 | 10 | 11 | 12 | The operation cannot be completed either because the operation is not supported on the target device, 13 | or the RAIDType of "MD Software RAID" does not allow the operation. 14 | STOR058 15 | 2 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/raid_service-invoke-clear_foreign_config-ok.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_RAIDService/ClearForeignConfigResponse 7 | uuid:fefa06de-103a-103a-8002-fd0aa2bdb228 8 | uuid:05bc00f4-1040-1040-899d-a36fc6fe83b0 9 | 10 | 11 | 12 | OPTIONAL 13 | 0 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/raid_service-invoke-convert_physical_disks-error.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 4 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_RAIDService/ConvertToRAIDResponse 5 | uuid:6364e38d-4e3c-4769-8c67-ff4332ea603a 6 | uuid:ad08919a-34b2-14b2-a4b0-ea19c46a0064 7 | 8 | 9 | 10 | Invalid parameter value 11 | NULL 12 | STOR004 13 | 2 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/raid_service-invoke-convert_physical_disks-ok.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 4 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_RAIDService/ConvertToRAIDResponse 5 | uuid:c6c4bcf6-c340-4f0b-9aef-3c7be94f0d61 6 | uuid:3223ac5b-3439-1439-9855-ea19c46a0064 7 | 8 | 9 | 10 | YES 11 | 0 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/raid_service-invoke-create_virtual_disk-error.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_RAIDService/CreateVirtualDiskResponse 7 | uuid:1a12188d-103b-103b-8002-fd0aa2bdb228 8 | uuid:20ade7ab-1040-1040-89a6-a36fc6fe83b0 9 | 10 | 11 | 12 | Physical disk not found 13 | STOR029 14 | 2 15 | 16 | 17 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/raid_service-invoke-create_virtual_disk-ok.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 7 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_RAIDService/CreateVirtualDiskResponse 8 | uuid:2a48cc56-103b-103b-8002-fd0aa2bdb228 9 | uuid:31086b42-1040-1040-89ab-a36fc6fe83b0 10 | 11 | 12 | 13 | 14 | 15 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 16 | 17 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_VirtualDiskView 18 | 19 | DISK.Virtual.267386880:RAID.Integrated.1-1 20 | root/dcim 21 | 22 | 23 | 24 | 25 | YES 26 | 0 27 | 28 | 29 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/raid_service-invoke-delete_virtual_disk-error.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_RAIDService/DeleteVirtualDiskResponse 7 | uuid:f9487fcf-103a-103a-8002-fd0aa2bdb228 8 | uuid:000852e6-1040-1040-8997-a36fc6fe83b0 9 | 10 | 11 | 12 | Virtual Disk not found 13 | STOR028 14 | 2 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/raid_service-invoke-delete_virtual_disk-ok.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_RAIDService/DeleteVirtualDiskResponse 7 | uuid:fefa06de-103a-103a-8002-fd0aa2bdb228 8 | uuid:05bc00f4-1040-1040-899d-a36fc6fe83b0 9 | 10 | 11 | 12 | YES 13 | 0 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/raid_service-invoke-reset_raid_config-error.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_RAIDService/ResetConfigResponse 7 | uuid:f9487fcf-103a-103a-8002-fd0aa2bdb228 8 | uuid:000852e6-1040-1040-8997-a36fc6fe83b0 9 | 10 | 11 | 12 | Virtual Disk not found 13 | STOR028 14 | 2 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/raid_service-invoke-reset_raid_config-ok.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_RAIDService/ResetConfigResponse 7 | uuid:fefa06de-103a-103a-8002-fd0aa2bdb228 8 | uuid:05bc00f4-1040-1040-899d-a36fc6fe83b0 9 | 10 | 11 | 12 | OPTIONAL 13 | 0 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/raid_service-invoke-set_attributes-error.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | 7 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_RAIDService/SetAttributesResponse 8 | 9 | uuid:bf8adefe-6fc0-456d-b97c-fd8d4aca2d6c 10 | 11 | uuid:84abf7b9-7176-1176-a11c-a53ffbd9bed4 12 | 13 | 14 | 15 | 16 | Invalid parameter value 17 | STOR004 18 | 2 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/raid_service-invoke-set_attributes-ok.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 6 | 7 | http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_RAIDService/SetAttributesResponse 8 | 9 | uuid:bf8adefe-6fc0-456d-b97c-fd8d4aca2d6c 10 | 11 | uuid:84abf7b9-7176-1176-a11c-a53ffbd9bed4 12 | 13 | 14 | 15 | 16 | STOR001 17 | The command was successful for all attributes 18 | 0 19 | Yes 20 | Set PendingValue 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/raid_string-enum-ok.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 9 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse 10 | uuid:6f1e7eae-511a-4268-9913-c1ce1bb414be 11 | uuid:6da65cf0-9cbb-1cbb-9773-deda878fd94c 12 | 13 | 14 | 15 | 16 | 17 | Name 18 | Virtual Disk 0 19 | Disk.Virtual.0:RAID.Integrated.1-1 20 | Disk.Virtual.0:RAID.Integrated.1-1:Name 21 | true 22 | 129 23 | 0 24 | 25 | 26 | 27 | Name 28 | Virtual Disk 1 29 | Disk.Virtual.1:RAID.Integrated.1-1 30 | Disk.Virtual.1:RAID.Integrated.1-1:Name 31 | true 32 | 129 33 | 0 34 | 35 | 36 | 37 | RAIDEffectiveSASAddress 38 | 500056B3239C1AFD 39 | Enclosure.Internal.0-1:RAID.Integrated.1-1 40 | Enclosure.Internal.0-1:RAID.Integrated.1-1:RAIDEffectiveSASAddress 41 | true 42 | 16 43 | 16 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/system_string-enum-ok.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 9 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse 10 | uuid:2c1819b5-9c87-44ee-bde1-88e43cd73edd 11 | uuid:7c734ea8-41ee-11ee-a83b-de7e4e771814 12 | 13 | 14 | 15 | 16 | 17 | Active Power Cap Policy Name 18 | ActivePolicyName 19 | iDRAC 20 | 21 | 22 | 1410 23 | System.Embedded.1 24 | Server Power 25 | ServerPwr.1 26 | System.Embedded.1#ServerPwr.1#ActivePolicyName 27 | true 28 | 128 29 | 0 30 | 31 | 32 | 33 | Data Center Name 34 | DataCenterName 35 | 36 | 37 | 38 | 1421 39 | System.Embedded.1 40 | Server Topology 41 | ServerTopology.1 42 | System.Embedded.1#ServerTopology.1#DataCenterName 43 | false 44 | 128 45 | 0 46 | 47 | 48 | 49 | Aisle Name 50 | AisleName 51 | 52 | 53 | 54 | 1422 55 | System.Embedded.1 56 | Server Topology 57 | ServerTopology.1 58 | System.Embedded.1#ServerTopology.1#AisleName 59 | false 60 | 128 61 | 0 62 | 63 | 64 | 65 | Rack Name 66 | RackName 67 | 68 | 69 | 70 | 1423 71 | System.Embedded.1 72 | Server Topology 73 | ServerTopology.1 74 | System.Embedded.1#ServerTopology.1#RackName 75 | false 76 | 128 77 | 0 78 | 79 | 80 | 81 | Room Name 82 | RoomName 83 | 84 | 85 | 86 | 1428 87 | System.Embedded.1 88 | Server Topology 89 | ServerTopology.1 90 | System.Embedded.1#ServerTopology.1#RoomName 91 | false 92 | 128 93 | 0 94 | 95 | 96 | 97 | Current LCD Display String 98 | CurrentDisplay 99 | ST: 1234567 100 | 101 | 102 | 1431 103 | System.Embedded.1 104 | LCD 105 | LCD.1 106 | System.Embedded.1#LCD.1#CurrentDisplay 107 | true 108 | 62 109 | 0 110 | 111 | 112 | 113 | User Defined String for LCD 114 | UserDefinedString 115 | 116 | 117 | 118 | 1433 119 | System.Embedded.1 120 | LCD 121 | LCD.1 122 | System.Embedded.1#LCD.1#UserDefinedString 123 | false 124 | 62 125 | 0 126 | 127 | 128 | 129 | Host Name 130 | HostName 131 | test-host1-1-dc.ops.domain.net 132 | 133 | 134 | 1450 135 | System.Embedded.1 136 | Server Operating System 137 | ServerOS.1 138 | System.Embedded.1#ServerOS.1#HostName 139 | false 140 | 62 141 | 0 142 | 143 | 144 | 145 | Operating System Name 146 | OSName 147 | CentOS 148 | 149 | 150 | 1451 151 | System.Embedded.1 152 | Server Operating System 153 | ServerOS.1 154 | System.Embedded.1#ServerOS.1#OSName 155 | false 156 | 62 157 | 0 158 | 159 | 160 | 161 | Operating System Version 162 | OSVersion 163 | release 6.8 (Final) Kernel 2.6.32-642.3.1.el6.x86_64 (x86_64) 164 | 165 | 166 | 1452 167 | System.Embedded.1 168 | Server Operating System 169 | ServerOS.1 170 | System.Embedded.1#ServerOS.1#OSVersion 171 | true 172 | 62 173 | 0 174 | 175 | 176 | 177 | OEM Operating System Version 178 | OEMOSVersion 179 | release 6.8 (Final) Kernel 2.6.32-642.3.1.el6.x86_64 (x86_64) 180 | 181 | 182 | 1454 183 | System.Embedded.1 184 | Server Operating System 185 | ServerOS.1 186 | System.Embedded.1#ServerOS.1#OEMOSVersion 187 | true 188 | 62 189 | 0 190 | 191 | 192 | 193 | OS App Collection Time 194 | OSAppCollectionTime 195 | N/A 196 | 197 | 198 | 2310 199 | System.Embedded.1 200 | Server Information 201 | Diagnostics.1 202 | System.Embedded.1#Diagnostics.1#OSAppCollectionTime 203 | true 204 | 64 205 | 0 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/system_view-enum-ok.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 8 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse 9 | uuid:c4710f54-6fd5-4719-859c-7e69080b99e6 10 | uuid:3b67422f-215c-115c-8e9f-a36fc6fe83b0 11 | 12 | 13 | 14 | 15 | 16 | System.Embedded.1 17 | 2.1.0 18 | PowerEdge R630 19 | A1B2C3D 20 | ebd4edd3-dfd7-4c7d-a2c8-562b3c23b811 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/virtual_disk_view-enum-ok.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 9 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse 10 | uuid:b182f1ee-103a-103a-8002-fd0aa2bdb228 11 | uuid:b80f21ed-103f-103f-8992-a36fc6fe83b0 12 | 13 | 14 | 15 | 16 | 17 | 512 18 | 6 19 | 0 20 | Virtual Disk 0 on Integrated RAID Controller 1 21 | 1024 22 | Disk.Virtual.0:RAID.Integrated.1-1 23 | Disk.Virtual.0:RAID.Integrated.1-1 24 | 20150301200527.000000+000 25 | 20150301200527.000000+000 26 | 0 27 | 1 28 | disk 0 29 | 0 30 | Background Intialization 31 | 8 32 | 0 33 | Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1 34 | Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1 35 | 1 36 | 2 37 | 4 38 | 16 39 | 1 40 | 1 41 | 599550590976 42 | 1 43 | 2 44 | 0 45 | 128 46 | 0 47 | 0 48 | 2 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/virtual_disk_view-enum-with-raid-status-ok.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 9 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse 10 | uuid:b182f1ee-103a-103a-8002-fd0aa2bdb228 11 | uuid:b80f21ed-103f-103f-8992-a36fc6fe83b0 12 | 13 | 14 | 15 | 16 | 17 | 512 18 | 6 19 | 0 20 | Virtual Disk 0 on Integrated RAID Controller 1 21 | 1024 22 | Disk.Virtual.0:RAID.Integrated.1-1 23 | Disk.Virtual.0:RAID.Integrated.1-1 24 | 20150301200527.000000+000 25 | 20150301200527.000000+000 26 | 0 27 | 1 28 | disk 0 29 | 0 30 | Background Intialization 31 | 8 32 | 0 33 | Disk.Bay.4:Enclosure.Internal.0-1:RAID.Integrated.1-1 34 | Disk.Bay.5:Enclosure.Internal.0-1:RAID.Integrated.1-1 35 | 1 36 | 2 37 | 4 38 | 16 39 | 1 40 | 1 41 | 599550590976 42 | 1 43 | 2 44 | 0 45 | 128 46 | 0 47 | 0 48 | 2 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/wsman-enum_context-1.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 8 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse 9 | uuid:89afbea0-2005-1005-8002-fd0aa2bdb228 10 | uuid:babd467b-2009-1009-8096-fcc71555dbe0 11 | 12 | 13 | 14 | enum-context-uuid 15 | 16 | 17 | 1 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/wsman-enum_context-2.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 8 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/PullResponse 9 | uuid:89ec4d7c-2005-1005-8003-fd0aa2bdb228 10 | uuid:bac57212-2009-1009-8097-fcc71555dbe0 11 | 12 | 13 | 14 | enum-context-uuid 15 | 16 | 17 | 2 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/wsman-enum_context-3.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 7 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/PullResponse 8 | uuid:89f3b75a-2005-1005-8004-fd0aa2bdb228 9 | uuid:baccc4b1-2009-1009-8098-fcc71555dbe0 10 | 11 | 12 | 13 | enum-context-uuid 14 | 15 | 16 | 3 17 | 18 | 19 | 4 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /dracclient/tests/wsman_mocks/wsman-enum_context-4.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 7 | http://schemas.xmlsoap.org/ws/2004/09/enumeration/PullResponse 8 | uuid:8b0bcd65-2005-1005-8026-fd0aa2bdb228 9 | uuid:bbe513cd-2009-1009-80ba-fcc71555dbe0 10 | 11 | 12 | 13 | 14 | 15 | 5 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # The order of packages is significant, because pip processes them in the order 2 | # of appearance. Changing the order has an impact on the overall integration 3 | # process, which may cause wedges in the gate later. 4 | 5 | lxml>=2.3 6 | pbr>=1.6 7 | requests>=2.10.0 8 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | name = python-dracclient 3 | summary = Library for managing machines with Dell iDRAC cards 4 | description-file = README.rst 5 | maintainer = DracClient Team 6 | author-email = openstack-discuss@lists.openstack.org 7 | home-page = https://launchpad.net/python-dracclient 8 | license = Apache-2 9 | classifier = 10 | Intended Audience :: Developers 11 | Intended Audience :: Information Technology 12 | License :: OSI Approved :: Apache Software License 13 | Operating System :: POSIX 14 | Programming Language :: Python 15 | Programming Language :: Python :: 3 16 | Programming Language :: Python :: 3.6 17 | Programming Language :: Python :: 3.7 18 | Programming Language :: Python :: 3.8 19 | 20 | [files] 21 | packages = 22 | dracclient 23 | 24 | [build_sphinx] 25 | all_files = 1 26 | build-dir = doc/build 27 | source-dir = doc/source 28 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | # not use this file except in compliance with the License. You may obtain 4 | # a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | 14 | import setuptools 15 | 16 | # In python < 2.7.4, a lazy loading of package `pbr` will break 17 | # setuptools if some other modules registered functions in `atexit`. 18 | # solution from: http://bugs.python.org/issue15881#msg170215 19 | try: 20 | import multiprocessing # noqa 21 | except ImportError: 22 | pass 23 | 24 | setuptools.setup( 25 | setup_requires=['pbr>=1.8'], 26 | pbr=True) 27 | -------------------------------------------------------------------------------- /test-requirements.txt: -------------------------------------------------------------------------------- 1 | # The order of packages is significant, because pip processes them in the order 2 | # of appearance. Changing the order has an impact on the overall integration 3 | # process, which may cause wedges in the gate later. 4 | 5 | coverage>=3.6 6 | doc8 7 | hacking>=1.1.0,<1.2.0 # Apache-2.0 8 | requests-mock>=1.0 9 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | minversion = 3.1.0 3 | envlist = py38,py36,pep8 4 | ignore_basepython_conflict=true 5 | 6 | [testenv] 7 | usedevelop = True 8 | install_command = pip install -U -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt} {opts} {packages} 9 | deps = 10 | -r{toxinidir}/requirements.txt 11 | -r{toxinidir}/test-requirements.txt 12 | basepython = python3 13 | setenv = PYTHONDONTWRITEBYTECODE=1 14 | commands = 15 | coverage run --branch --source dracclient --omit "dracclient/tests*" -m unittest discover dracclient.tests 16 | coverage report -m --fail-under 90 17 | 18 | [testenv:venv] 19 | commands = {posargs} 20 | 21 | [testenv:pep8] 22 | commands = 23 | flake8 dracclient 24 | doc8 README.rst CONTRIBUTING.rst doc/source 25 | 26 | [testenv:docs] 27 | deps = 28 | -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt} 29 | -r{toxinidir}/requirements.txt 30 | -r{toxinidir}/doc/requirements.txt 31 | commands = 32 | sphinx-build -b html doc/source doc/build/html 33 | 34 | [flake8] 35 | max-complexity=15 36 | show-source = True 37 | -------------------------------------------------------------------------------- /zuul.d/project.yaml: -------------------------------------------------------------------------------- 1 | - project: 2 | templates: 3 | - openstack-python3-victoria-jobs 4 | --------------------------------------------------------------------------------