| 1 |
Testsuite for python-hpilo |
| 2 |
-------------------------- |
| 3 |
|
| 4 |
This testsuite consists of two parts: |
| 5 |
- Tests for the XML generator and parser |
| 6 |
- Tests that actually contact iLO's |
| 7 |
|
| 8 |
The former use a corpus of known data, they're safe to run and run pretty |
| 9 |
quickly. The latter will change data on iLO's (and do their best to restore |
| 10 |
the data to previous values), will reset iLO's and take a long time to run. |
| 11 |
|
| 12 |
Test contributions wanted! |
| 13 |
-------------------------- |
| 14 |
For the corpus of test data, we need more people to submit data from their |
| 15 |
machines. This process is safe (no iLO data is changed at all), though can |
| 16 |
leak information about your systems if you are not careful. If you want to |
| 17 |
contribute, please do the following: |
| 18 |
|
| 19 |
$ cd tests/xml |
| 20 |
$ ./fetch_responses hostname-of-your-ilo-here |
| 21 |
|
| 22 |
This creates a new directory named after the hardware model, ilo model and ilo |
| 23 |
firmware of your machine. In it, you find raw and parsed responses of all |
| 24 |
python-hpilo queries. You should inspect this data and see if it's correct. |
| 25 |
You should also redact information you do not wish to share, but please don't |
| 26 |
go overboard. |
| 27 |
|
| 28 |
- Redacting iLO license keys makes perfect sense. |
| 29 |
- Redacting hostnames and IP addresses is acceptable, but please do not redact |
| 30 |
anything else |
| 31 |
- When redacting, replace each letter of the redacted string with an x. Don't |
| 32 |
add or remove characters |
| 33 |
- The .raw files may contain http chunked data, be very careful when editing |
| 34 |
this and don't break the format. Preferably use a hex editor, or an editor |
| 35 |
that does not mess with newlines (vim will do) |
| 36 |
|
| 37 |
You can either send me your datafiles via e-mail, or send a pull request on |
| 38 |
GitHub. If you do not know how to redact the data, or want me to do it for |
| 39 |
you, please send the data by e-mail and I will redact hostnames and iLO |
| 40 |
license keys. |
| 41 |
|
| 42 |
Running the tests |
| 43 |
----------------- |
| 44 |
Running the safe tests is as simple as running: |
| 45 |
|
| 46 |
$ python -munittest tests.test_requests |
| 47 |
$ python -munittest tests.test_responses |
| 48 |
|
| 49 |
You can run any of the tests this way, just replace test_requests with the |
| 50 |
name of the test. To run all tests, you can use: |
| 51 |
|
| 52 |
$ python -munittest discover |
| 53 |
|
| 54 |
However, if you run this without configuring the tests, you'll notice that |
| 55 |
nothing actually attempts to contact an iLO. You will need to tell it which |
| 56 |
iLOs to test. You do this in ~/.ilo.conf by adding test sections like the |
| 57 |
following: |
| 58 |
|
| 59 |
[test test-server] |
| 60 |
hostname = test-server.ilo.example.com |
| 61 |
|
| 62 |
Please don't run these tests on mission-critical servers. While they try very |
| 63 |
hard to restore the settings it changes, bugs and errors happen. |