summaryrefslogtreecommitdiff
path: root/ironic_python_agent/tests/hardware.py
Commit message (Collapse)AuthorAgeFilesLines
* Add base for IPA functional testsJosh Gachnang2015-08-181-632/+0
| | | | | | | | | | | Starts up an agent in a thread and then runs functional tests against it. Add the first functional test of the API: a simple test of the commands API. Co-Authored-By: Mario Villaplana <mario.villaplana@gmail.com> Change-Id: If4ad611929d388a2a9454224646cb296bd0ba0ce
* Convert Int to String for shred executeJacob McCann2015-07-011-4/+4
| | | | | | | | Was running into 'expected string, int found' when calling shred with an Int for iterations. Change-Id: Iffce247caba5b0d62ac89b6411402c8d975cfd2f Closes-Bug: #1469838
* IPA:'shred' utility to use configured iterationsAnusha Ramineni2015-06-181-14/+18
| | | | | | | | | | Today, there is no option to configure number of iterations to be done for shred block device erasing and defaults it to 1. This patch adds a configuration option to change the number of passes to be done to erase a block device. Change-Id: I1921d33a6b364c4682b6c9baaf61ac092cfa11d7 Partial-Bug:#1465130
* Update hacking and fix hacking violationsJim Rollenhagen2015-06-031-1/+5
| | | | | | | | | | | | | | | This does a few things: * Update hacking to the version in global-requirements. Old hacking was installing a version of pbr that was breaking other packages. * Fix all the hacking/pep8 rules that updating hacking raised. * Do some general docstring cleanup, while already in there cleaning up a bunch of docstrings due to H405 violations. Change-Id: I1fc1e59d4c3d7b14631f8b576e3f3854bc452188 Closes-Bug: #1461717
* Fix error in in-band disk erase using shredAnusha Ramineni2015-05-081-0/+21
| | | | | | | | in-band disk erase using shred fails with error "'module' object has no attribute 'ProcessExecutionError'". This commit is to fix the issue. Change-Id: Ia0c426074b2f0e9d534ed96a3e213933160edc61 Closes-Bug:#144799
* Fix inband disk erase using agent_ilo driverAnusha Ramineni2015-05-071-0/+48
| | | | | | | | | In-band disk erase using shred fails for agent_ilo driver as it tries to erase the virtual floppy device attached.This fix is to skip the virtual media devices and continue with other disks. Change-Id: I26745985382d440f7d4b3fbfffb14545067fcca6 Closes-Bug:#1450298
* Add fallback secure erase using shredJay Faulkner2015-03-181-14/+35
| | | | | | | | This prevents devices from failing cleaning if they don't support ATA security erase. Instead, the device will be erased by overwriting using GNU shred. Change-Id: Ie4f88b97c8c34efe2397538662622abd0b963aea
* Add support for root device hintsLucas Alvares Gomes2015-03-131-2/+58
| | | | | | | | | | | This patch add support for root device hints on IPA. Instead of picking the first disk >= 4G, if the hints are specified IPA will look at it to decide which device it should pick for the deployment. The initial patch supports the following hints: Size, model, WWN, serial, vendor. Implements: blueprint ipa-as-default-ramdisk Implements: blueprint root-device-hints Change-Id: I2b00b3fb3b61001033750dd8951f9353d6f2e361
* Added support for secure erase enhancedClif Houck2015-02-061-1/+38
| | | | | | | | | Added support for secure erase enhanced option when doing an ATA secure erase. Also made it prefer the enhanced version if hdparm claims the device supports it. Change-Id: I2ce04d0b967d6c176acd40ea10a05bcab5dbf2d0
* Allow use of multiple simultaneous HW managersJay Faulkner2015-01-081-14/+3
| | | | | | | | | | | | | Currently we pick the most specific manager and use it. Instead, call each method on each hardware manager in priority order, and consider the call successful if the method exists and doesn't throw IncompatibleHardwareMethodError. This is an API breaking change for anyone with out-of-tree HardwareManagers. Closes-bug: 1408469 Change-Id: I30c65c9259acd4f200cb554e7d688344b7486a58
* Add support for psutil v1 as well as v2Jay Faulkner2014-07-291-2/+2
| | | | | | | Openstack global requirements updated to specify version 1 only, and we only supported version 2. Change-Id: Iee97e4b14cae00238028ef936d2f96fbc8e2604c
* Improve Disk DetectionJosh Gachnang2014-07-181-19/+59
| | | | | | | | | | | | | | | The previous implementation of list_block_devices used blockdev, which would list partitions, software RAID and other devices as block devices. By switching to lsblk, the agent can filter down to only physical block devices, which is all the agent cares about for any of its operations. This change adds two new fields to the BlockDevice class: model, a string of the block devices reported model, and rotational, a boolean representing a spinning disk (True) or a solid state disk (False). This data can be useful for vendor hardware managers. Change-Id: I385c3bb378c2c49385bca14a1d7efa074933becf Closes-Bug: 1344351
* Fix HardwareManager loading order bugRussell Haering2014-06-161-0/+45
| | | | | | | | | | | The agent attempts to sort the HardwareManager implementations found by stevedore in order of suitability. This patch fixes a bug in the sorting order that caused the GenericHardwareManager to always be loaded. Fixes bug 1327923 Change-Id: I1cc20e5351a704325f0cf41dab205c9164799f6a
* Add a HardwareManager method to erase devicesRussell Haering2014-06-061-0/+205
| | | | | | | | | | | Add erase_devices method to the HardwareManager class. By default this method iterates block devices, and calls a new abstract erase_block_device method for each device. This patch includes a simple implementation of erase_block_device on the GenericHardwareManager which attempts to issue an ATA secure erase on supported devices. Change-Id: I81da065395b8785f636f1b0a0d60c9f1c045441e
* Merge "Use # instead of """ for copyright blocks"Jenkins2014-04-111-15/+13
|\
| * Use # instead of """ for copyright blocksJim Rollenhagen2014-04-101-15/+13
| | | | | | | | | | | | | | Reformats copyright messages to be comments rather than docstring-style blocks. Change-Id: I4d863f53b67bb49d03bda0952b9e6179b6d23c59
* | Implement version 2 payload with more hw infoJay Faulkner2014-04-101-6/+90
| | | | | | | | | | | | | | | | | | | | Bumping the payload version to two, and adding CPU, Memory, and Block Device information to the inventory. Added dependency on psutil for available memory and cpu_count. Requirements line copied from global requirements Change-Id: Ia39c85c91b1d60468667787a7978020084dc6c2a
* | Deprecate hardware._cmd in favor of utils.executeJay Faulkner2014-04-101-4/+7
| | | | | | | | | | | | | | This removes the custom function that was in place before our move to Openstack in favor of the utils method integrated with oslo. Change-Id: If668e53ccc97743b00c4beae39d153ee63ed015a
* | Close file handle after useJay Faulkner2014-04-101-1/+4
|/ | | | | | | | The file handle for addr_info was left open, meaning we were leaking file handles when sending system information. This ensures the handle is closed. Change-Id: I4b117d4f9ec32ad3f16f43632ffe9dc96da5ab7f
* Compatibility fixes for Python 3.3Jay Faulkner2014-04-071-1/+7
| | | | | | | | | | | | | 1) Added a py33 environment to tox 2) Updated tests to mock the correctly named builtins.open based on python version 3) Other minor compatibility fixes Tests for Python 3.3 will not pass due to this bug: https://github.com/eventlet/eventlet/issues/83 among possibly others in eventlet. Change-Id: Ie4b512a926fa690ee77a71a89851c871ea1f6be0
* Adding oslotest to improve debuggingJosh Gachnang2014-04-031-2/+3
| | | | | | | | oslotest includes things like showing log messages/stdout on test errors, which makes debugging much easier. Also moved mock to second group in imports, as it's a 3rd party library. Change-Id: I016ae0a376d42dec28085687ea7194df4cd44eda
* Replacing teeth/overlord with ipa/ironicJosh Gachnang2014-03-191-1/+1
|
* Renaming to IPAJosh Gachnang2014-03-191-0/+67