Merge ~smoser/cloud-init:feature/ds-identify-test into cloud-init:master
| Status: | Merged |
|---|---|
| Merged at revision: | 370a04e8d7b530c1ef8280e15eb628ff6880c736 |
| Proposed branch: | ~smoser/cloud-init:feature/ds-identify-test |
| Merge into: | cloud-init:master |
| Diff against target: |
384 lines (+313/-8) 3 files modified
tests/unittests/helpers.py (+7/-0) tests/unittests/test_ds_identify.py (+290/-0) tools/ds-identify (+16/-8) |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Server Team CI bot | continuous-integration | Approve on 2017-05-10 | |
| Chad Smith | Approve on 2017-05-09 | ||
| cloud-init commiters | 2017-04-24 | Pending | |
|
Review via email:
|
|||
Commit Message
Add unit tests for ds-identify, fix Ec2 bug found.
This adds several unit tests for ds-identify, and fixes a bug
in Ec2 detection that I found while writing these tests.
The method of testing is to use the ds-identify code as a shell
library. The TestDsIdentify:call basically does:
* populate a (temp) directory with files that represent what
ds-identify would see in /sys or other locations it reads.
* create a file '_shwrap' that replaces the 3 programs that are executed
in ds-identify code path. It supports setting their stdout, stderr,
and exit code.
* set the default policies explicitly (DI_DEFAULT_POLICY) so we can
support testing different builtins. This is necessary because the
Ubuntu branches patch the builtin value. If we did not explicilty set
it, then testing there would fail.
* execute sh to source the script and call its main.
FAILED: Continuous integration, rev:c871fa26490
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
FAILED: Continuous integration, rev:426d9c451b5
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
FAILED: Continuous integration, rev:9e2de035ab5
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
FAILED: Continuous integration, rev:ee51740e55f
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
| Ryan Harper (raharper) wrote : | # |
This looks really good.
Would you be opposed to putting the infrastructure in one of the helper files and have only the inputs/unittests in the test_dsidentify class?
| Scott Moser (smoser) wrote : | # |
with respect to the infrastructure to test this being elsewhere... most of it is specific to ds-identify, so I dont think it makes a lot of sense to hide it all away from the testing of ds-identify.
FAILED: Continuous integration, rev:df554469507
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
FAILED: Continuous integration, rev:9ca73e761fc
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
FAILED: Continuous integration, rev:
https:/
Executed test runs:
ABORTED: https:/
ABORTED: https:/
ABORTED: https:/
ABORTED: https:/
Click here to trigger a rebuild:
https:/
FAILED: Continuous integration, rev:7fe5047b2d8
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
FAILED: Continuous integration, rev:b78cc5e7324
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
| Chad Smith (chad.smith) wrote : | # |
Initial comments added
PASSED: Continuous integration, rev:d648260b81c
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
FAILED: Continuous integration, rev:6e3efe9fd7a
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
FAILED: Continuous integration, rev:0d176700738
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
FAILED: Continuous integration, rev:35f72db8276
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
PASSED: Continuous integration, rev:00487bb8a7c
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
PASSED: Continuous integration, rev:3dd81be5b30
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
PASSED: Continuous integration, rev:8a0b5287cdb
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/


FAILED: Continuous integration, rev:cbe6651ab03 566b4f1957d9d73 841e3b37a0a6f1 /code.launchpad .net/~smoser/ cloud-init/ +git/cloud- init/+merge/ 323059/ +edit-commit- message
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
https:/ /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 267/ /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- amd64/267/ console /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- arm64/267/ console /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- ppc64el/ 267/console /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- s390x/267/ console /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=vm- i386/267/ console
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild: /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 267/rebuild
https:/