Skip to content
This repository was archived by the owner on Apr 20, 2021. It is now read-only.

Commit c936941

Browse files
committed
DNM: add zuul vyos testing
This is an example job to start testing vyos Depends-On: ansible/ansible-zuul-jobs#34 Signed-off-by: Paul Belanger <[email protected]>
1 parent 58b40c9 commit c936941

File tree

6 files changed

+34
-4
lines changed

6 files changed

+34
-4
lines changed

.zuul.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
- job:
2+
name: network-vyos-test
3+
parent: ansible-network-vyos-base
4+
run: tests/foo.yaml
5+
6+
- project:
7+
check:
8+
jobs:
9+
- network-vyos-test

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ansible>=2.4.0

tests/ansible.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[defaults]
2+
callback_whitelist = profile_tasks, timer
3+
retry_files_enabled = false
4+
stdout_callback = yaml
5+
6+
[ssh_connection]
7+
pipelining = true

tests/foo.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
- hosts: controller
2+
tasks:
3+
- name: Bootstrap tox environment
4+
args:
5+
chdir: ~/src/github.com/ansible/network
6+
shell: tox -v -evenv --notest
7+
8+
- name: Run ansible tests
9+
args:
10+
chdir: ~/src/github.com/ansible/network
11+
shell: tox -evenv -- ansible-playbook -v -c network_cli tests/vyos/modules/interfaces/main.yaml

tests/vyos/modules/interfaces/main.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
---
22
- hosts: appliance
33
gather_facts: true
4-
gather_subset:
5-
- net_configuration_interfaces
64
tasks:
75
- import_role:
8-
name: ~/collections/network
6+
name: network
97

108
- include_tasks: "{{ item }}.yaml"
119
loop:

tox.ini

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ envlist = linters
66
[testenv]
77
basepython = python3
88
install_command = pip install {opts} {packages}
9-
deps = -r{toxinidir}/test-requirements.txt
9+
deps = -r{toxinidir}/requirements.txt
10+
-r{toxinidir}/test-requirements.txt
1011

1112
[testenv:linters]
1213
basepython = python3
@@ -15,6 +16,9 @@ commands =
1516
flake8 {posargs}
1617

1718
[testenv:venv]
19+
setenv =
20+
ANSIBLE_CONFIG = {toxinidir}/tests/ansible.cfg
21+
ANSIBLE_ROLES_PATH = {toxinidir}/..
1822
basepython = python3
1923
commands = {posargs}
2024

0 commit comments

Comments
 (0)