summaryrefslogtreecommitdiff
path: root/tox.ini
diff options
context:
space:
mode:
authorChad Smith <chad.smith@canonical.com>2017-07-28 14:28:47 -0600
committerChad Smith <chad.smith@canonical.com>2017-07-28 14:28:47 -0600
commite586fe35a692b7519000005c8024ebd2bcbc82e0 (patch)
treeb29b6a5a1a5536ede273a131c55241b191fc45e2 /tox.ini
parent664a22021ce278dc4120a5737b21bf6fe5448166 (diff)
downloadvyos-cloud-init-e586fe35a692b7519000005c8024ebd2bcbc82e0.tar.gz
vyos-cloud-init-e586fe35a692b7519000005c8024ebd2bcbc82e0.zip
cloudinit.net: add initialize_network_device function and tests
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 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
Diffstat (limited to 'tox.ini')
-rw-r--r--tox.ini14
1 files changed, 11 insertions, 3 deletions
diff --git a/tox.ini b/tox.ini
index 1140f9b2..ef768847 100644
--- a/tox.ini
+++ b/tox.ini
@@ -21,7 +21,11 @@ setenv =
LC_ALL = en_US.utf-8
[testenv:pylint]
-deps = pylint==1.7.1
+deps =
+ # requirements
+ pylint==1.7.1
+ # test-requirements because unit tests are now present in cloudinit tree
+ -r{toxinidir}/test-requirements.txt
commands = {envpython} -m pylint {posargs:cloudinit}
[testenv:py3]
@@ -29,7 +33,7 @@ basepython = python3
deps = -r{toxinidir}/test-requirements.txt
commands = {envpython} -m nose {posargs:--with-coverage \
--cover-erase --cover-branches --cover-inclusive \
- --cover-package=cloudinit tests/unittests}
+ --cover-package=cloudinit tests/unittests cloudinit}
[testenv:py27]
basepython = python2.7
@@ -98,7 +102,11 @@ deps = pyflakes
[testenv:tip-pylint]
commands = {envpython} -m pylint {posargs:cloudinit}
-deps = pylint
+deps =
+ # requirements
+ pylint
+ # test-requirements
+ -r{toxinidir}/test-requirements.txt
[testenv:citest]
basepython = python3