The proposal to merge ~chad.smith/cloud-init:unittests-in-cloudinit-package
into cloud-init:master has been updated.
Description changed to:
cloudinit.net: add initialize_network_device function and unittest.
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.net.__init__ module,
this branch adds a bunch of coverage to the functions in cloudinit.net.__init.
We can also now have unit tests local to the cloudinit modules. The benefits of
having unittests under cloudinit module:
- 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_module.py
- 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_network_device; initialize_network_device("eth0", "ip-addr",
"netmask", "broadcast")'
For more details, see:
https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/327827
--
Your team cloud-init commiters is requested to review the proposed merge of
~chad.smith/cloud-init:unittests-in-cloudinit-package into cloud-init:master.
_______________________________________________
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : [email protected]
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help : https://help.launchpad.net/ListHelp