Merge ~chad.smith/cloud-init:unittests-in-cloudinit-package into cloud-init:master
| Status: | Merged |
|---|---|
| Approved by: | Scott Moser on 2017-07-31 |
| Approved revision: | 49a4b8327125b4e5105c8508c08cc333480ff7e1 |
| Merged at revision: | e586fe35a692b7519000005c8024ebd2bcbc82e0 |
| Proposed branch: | ~chad.smith/cloud-init:unittests-in-cloudinit-package |
| Merge into: | cloud-init:master |
| Diff against target: |
772 lines (+648/-21) 5 files modified
cloudinit/net/__init__.py (+114/-17) cloudinit/net/tests/__init__.py (+0/-0) cloudinit/net/tests/test_init.py (+522/-0) setup.py (+1/-1) tox.ini (+11/-3) |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Server Team CI bot | continuous-integration | Approve on 2017-07-28 | |
| Scott Moser | 2017-07-20 | Approve on 2017-07-28 | |
|
Review via email:
|
|||
Commit Message
cloudinit.net: add initialize_
This is not yet called, but will be called in a subsequent Ec2-related branch to manually initialize a network interface with the responses using dhcp discovery without any dhcp-script side-effects. The functionality has been tested on Ec2 ubuntu and CentOS vms to ensure that network interface initialization works in both OS-types.
Since there was poor unit test coverage for the cloudinit.
- Proximity of unittest to cloudinit module makes it easier for ongoing devs to know where to augment unit tests. The tests.unittest directory is organizated such that it
- Allows for 1 to 1 name mapping module -> tests/test_
- Improved test and module isolation, if we find unit tests have to import from a number of modules besides the module under test, it will better prompt resturcturing of the module.
This also branch touches:
- tox.ini to run unit tests found in cloudinit as well as include all test-requirements for pylint since we now have unit tests living within cloudinit package
- setup.py to exclude any test modules under cloudinit when packaging
Description of the Change
cloudinit.net: add initialize_
This is not yet called, but will be called in a subsequent Ec2-related branch to manually initialize a network interface with the responses using dhcp discovery without any dhcp-script side-effects. The functionality has been tested on Ec2 ubuntu and CentOS vms to ensure that network interface initialization works in both OS-types.
Since there was poor unit test coverage for the cloudinit.
- Proximity of unittest to cloudinit module makes it easier for ongoing devs to know where to augment unit tests. The tests.unittest directory is organizated such that it
- Allows for 1 to 1 name mapping module -> tests/test_
- Improved test and module isolation, if we find unit tests have to import from a number of modules besides the module under test, it will better prompt resturcturing of the module.
This also branch touches:
- tox.ini to run unit tests found in cloudinit as well as include mock test-requirement for pylint since we now have unit tests living within cloudinit package
- setup.py to exclude any test modules under cloudinit when packaging
To test:
make deb
dpkg -c cloud-init_all.deb | grep test # make sure our package didn't include tests
tox
# on an lxc: ifconfig eth0 0.0.0.0; python -c 'from cloudinit.net import initialize_
| Scott Moser (smoser) wrote : | # |
why did you have to add mock to tox's pylint entries ?
also some inline.
this does look really nice though.
thank you.
FAILED: Continuous integration, rev:ed950d27697
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
FAILED: Continuous integration, rev:4b4989d8943
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
PASSED: Continuous integration, rev:a3692fcda19
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: CentOS 6 & 7: Build & Test
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
- 0f476ef... by Chad Smith on 2017-07-22
FAILED: Continuous integration, rev:0f476ef54a9
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
- 4811785... by Chad Smith on 2017-07-24
- a0bd7a7... by Chad Smith on 2017-07-24
FAILED: Continuous integration, rev:a0bd7a79f08
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
- e37c259... by Chad Smith on 2017-07-24
FAILED: Continuous integration, rev:e37c259841b
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
- 93ace28... by Chad Smith on 2017-07-25
FAILED: Continuous integration, rev:93ace2828ef
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
FAILED: CentOS 6 & 7: Build & Test
Click here to trigger a rebuild:
https:/
| Scott Moser (smoser) wrote : | # |
small questions in line.
PASSED: Continuous integration, rev:93ace2828ef
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: CentOS 6 & 7: Build & Test
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
- b6369bd... by Chad Smith on 2017-07-26
- 787586e... by Chad Smith on 2017-07-26
- cdba67c... by Chad Smith on 2017-07-26
FAILED: Continuous integration, rev:787586e45a5
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
FAILED: Ubuntu LTS: Build
Click here to trigger a rebuild:
https:/
PASSED: Continuous integration, rev:cdba67c453c
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: CentOS 6 & 7: Build & Test
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
- c25b725... by Chad Smith on 2017-07-27
- 9cdbb64... by Chad Smith on 2017-07-27
- 8ef6575... by Chad Smith on 2017-07-27
| Chad Smith (chad.smith) wrote : | # |
Per our discussion today, I simplified logic in EphemeralIPv4Ne
All changes have been made per review comments, I separated out get_ip_info utility function so we can propose it as a separate branch to replace ifconfig parsing.
PASSED: Continuous integration, rev:8ef6575c63e
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: CentOS 6 & 7: Build & Test
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
- 3d85180... by Chad Smith on 2017-07-27
| Chad Smith (chad.smith) wrote : | # |
Just tested on ubuntu AWS. minor fix needed to remove the route before removing the address, because the side-effect of removing the addr is the route is auto-deleted.
| Chad Smith (chad.smith) wrote : | # |
Just validated on cent6 too:
2017-07-27 21:33:19,762 - handlers.py[DEBUG]: finish: init-local/
PASSED: Continuous integration, rev:3d851806873
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: CentOS 6 & 7: Build & Test
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
| Scott Moser (smoser) wrote : | # |
tiny things.
fix that comment, and i approve.
thank you Chad.
- 49a4b83... by Chad Smith on 2017-07-28
PASSED: Continuous integration, rev:49a4b832712
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: CentOS 6 & 7: Build & Test
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/


PASSED: Continuous integration, rev:a3692fcda19 267d6d63b0317cd fb40d6df8b08ed /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 64/
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: CentOS 6 & 7: Build & Test
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild: /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 64/rebuild
https:/