Add linters check

This patch adds linters check with help of ansible-lint tool

Change-Id: Id7d11416ac7cf375211f9b9fb9c5bf2028cba496
This commit is contained in:
Dmitriy Rabotyagov 2020-06-26 17:39:24 +03:00 committed by Dmitriy Rabotyagov (noonedeadpunk)
parent b1ed318d22
commit c706aedb95
5 changed files with 41 additions and 1 deletions

View File

@ -8,6 +8,8 @@
check:
jobs:
- ffrouting-deploy
- tox-linters
gate:
jobs:
- ffrouting-deploy
- tox-linters

1
test-requirements.txt Normal file
View File

@ -0,0 +1 @@
ansible-lint

View File

@ -29,6 +29,7 @@
shell: |
set -e
ping -c2 "{{ item.address }}"
changed_when: false
register: _ping_vlan
until: _ping_vlan is success
retries: 5

View File

@ -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

36
tox.ini Normal file
View File

@ -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