Merge ~powersj/cloud-init:test-set-password-list into cloud-init:master
| Status: | Merged |
|---|---|
| Merged at revision: | 41950e902f5dd6cb3118280d3d27409812702e41 |
| Proposed branch: | ~powersj/cloud-init:test-set-password-list |
| Merge into: | cloud-init:master |
| Diff against target: |
224 lines (+115/-27) 6 files modified
cloudinit/config/cc_set_passwords.py (+2/-2) tests/cloud_tests/configs/modules/set_password_list.yaml (+12/-8) tests/cloud_tests/configs/modules/set_password_list_string.yaml (+37/-0) tests/cloud_tests/testcases/base.py (+52/-0) tests/cloud_tests/testcases/modules/set_password_list.py (+2/-17) tests/cloud_tests/testcases/modules/set_password_list_string.py (+10/-0) |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Scott Moser | 2017-03-14 | Approve on 2017-03-17 | |
| Server Team CI bot | continuous-integration | Approve on 2017-03-17 | |
|
Review via email:
|
|||
This proposal supersedes a proposal from 2017-03-14.
Commit Message
test: Add test for setting password as list
This adds an integration test for setting passwords when given
as a list, rather than a string. This also updates the docs and
tests so that Random is now RANDOM as is correct.
- 5be8342... by Joshua Powers on 2017-03-16
- a881acb... by Joshua Powers on 2017-03-16
- 9cd40a2... by Joshua Powers on 2017-03-16
- 41bf34e... by Joshua Powers on 2017-03-16
| Joshua Powers (powersj) wrote : | # |
Pulled in smoser's changes from https:/
FAILED: Continuous integration, rev:41bf34e63ec
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- d3c2e6c... by Joshua Powers on 2017-03-17
- cc3aaf5... by Joshua Powers on 2017-03-17
PASSED: Continuous integration, rev:cc3aaf5db84
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
| Scott Moser (smoser) wrote : | # |
Josh, this looks great. Thank you.
The only thing I don't like now is the duplication.
There are 2 ways i can think of to reduce it:
a.) both tests extend a base class that has the test_* functions.
this is just less flexible than 'b', but because these things are identical now, its the easiest thing.
I started to write in text how you could do this, but found that it was just as easy to do it myself and describe it that way. I think acceptable: http://
The thing i'm not sure of is if we need to somehow make sure that the 'PasswordListTest' base class somehow doesnt run. In curtin vmtest we always did this with __test__ = False. I'm happy that it doesnt appear we need this, but I didn't yet run a full simple 'run' without specific -t
b.) some helper functions for testing this, and then the test_* functions will have call helper functions and have less in them.
- aba194b... by Joshua Powers on 2017-03-17
- c95f455... by Joshua Powers on 2017-03-17
PASSED: Continuous integration, rev:c95f4552408
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
- 8451d0e... by Joshua Powers on 2017-03-17
- c194276... by Joshua Powers on 2017-03-17
| Joshua Powers (powersj) wrote : | # |
I added class/subclass method you proposed, which I like a lot. There is no reason for duplicate code. My only concern is base.py filling up with a bunch of code, but I think that is ok.
However, I had to modify the parameters slightly so nose actually realizes there are tests to run and added the __test__ = True variable. Both were required for tests to be discovered and ran; I did try without each. I also added the description change that we recently added to curtin since we are now doing this.
Here is output of a run with those two tests:
https:/
PASSED: Continuous integration, rev:c1942769e99
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
- d707e81... by Joshua Powers on 2017-03-17
- 68b67d1... by Joshua Powers on 2017-03-17
PASSED: Continuous integration, rev:68b67d18b10
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/


PASSED: Continuous integration, rev:2ded8b9e37b b65786655cee48f ca3ff48ae1c585 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 115/ /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- amd64/115 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- arm64/115 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- ppc64el/ 115 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- s390x/115 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=vm- i386/115
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild: /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 115/rebuild
https:/