diff --git a/.zuul.yaml b/.zuul.yaml index 79ce9a0..0f823d0 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -8,6 +8,8 @@ check: jobs: - ffrouting-deploy + - tox-linters gate: jobs: - ffrouting-deploy + - tox-linters diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..6dd128e --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ +ansible-lint diff --git a/tests/test.yml b/tests/test.yml index ae1a654..fd77289 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -29,6 +29,7 @@ shell: | set -e ping -c2 "{{ item.address }}" + changed_when: false register: _ping_vlan until: _ping_vlan is success retries: 5 diff --git a/tests/test_vars.yml b/tests/test_vars.yml index e59e1c3..8ffc978 100644 --- a/tests/test_vars.yml +++ b/tests/test_vars.yml @@ -14,7 +14,7 @@ # limitations under the License. frr_vlans: - - vlan-raw-device: eth0 + - vlan-raw-device: "{{ ansible_default_ipv4.interface }}" id: 100 address: 192.168.1.100 netmask: 255.255.255.0 diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..d65313e --- /dev/null +++ b/tox.ini @@ -0,0 +1,36 @@ +[tox] +minversion = 3.1 +skipsdist = True +envlist = linters +ignore_basepython_conflict = True + +[testenv] +basepython = python3 +usedevelop = False +commands = + /usr/bin/find . -type f -name "*.pyc" -delete +deps = + -r{toxinidir}/test-requirements.txt +passenv = + COMMON_TESTS_PATH + HOME + http_proxy + HTTP_PROXY + https_proxy + HTTPS_PROXY + no_proxy + NO_PROXY + TESTING_BRANCH + TESTING_HOME + USER +whitelist_externals = + bash +setenv = + PYTHONUNBUFFERED=1 + TEST_IDEMPOTENCE=false + VIRTUAL_ENV={envdir} + WORKING_DIR={toxinidir} + +[testenv:linters] +commands = + ansible-lint {toxinidir}/tests/test.yml