Skip to content

Commit

Permalink
Add ansible-test-network-integration-eos job
Browse files Browse the repository at this point in the history
This now adds support to run eos tests against ansible/ansible.

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
  • Loading branch information
pabelanger committed May 5, 2019
1 parent 77ecd01 commit 6ae85b9
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 6 deletions.
Expand Up @@ -15,6 +15,7 @@
become: true
eos_config:
lines:
- ip name-server 1.1.1.1
- username zuul privilege 15 nopassword
- "username zuul sshkey {{ _ssh_key.split()[0] }} {{ _ssh_key.split()[1] }}"
save_when: always
Expand Down
@@ -0,0 +1,18 @@
---
- hosts: appliance
gather_facts: false
tasks:
# TODO(pabelanger): The eos network-integration tests assume eAPI access
# is enabled.
- name: Enable eAPI access with default configuration
become: true
become_method: enable
eos_eapi:
http: true
https: true
state: started

- name: Setup new user
become: true
eos_config:
save_when: always
9 changes: 9 additions & 0 deletions playbooks/ansible-test-network-integration-eos/pre.yaml
@@ -0,0 +1,9 @@
---
- hosts: controller
tasks:
- name: Setup tox role
include_role:
name: tox
vars:
tox_extra_args: -- ansible-playbook -v -c network_cli playbooks/ansible-test-network-integration-eos/files/bootstrap.yaml
zuul_work_dir: "{{ zuul.projects['github.com/ansible/ansible-zuul-jobs'].src_dir }}"
13 changes: 13 additions & 0 deletions playbooks/ansible-test-network-integration-eos/run.yaml
@@ -0,0 +1,13 @@
---
- hosts: controller
tasks:
- name: Create inventory file
template:
src: inventory.j2
dest: ~/inventory
mode: 0644

- name: Run the integration test suite
args:
chdir: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/ansible/ansible'].src_dir }}"
shell: ./test/runner/ansible-test network-integration --diff --tox --tox-sitepackages --python 3.7 --inventory /home/zuul/inventory eos_.* -vv
@@ -0,0 +1,9 @@
# This file is generated by Ansible
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
#
[eos]
eos-4.20.10 ansible_port=22 ansible_python_interpreter=python ansible_host={{ hostvars['eos-4.20.10'].ansible_host }} ansible_network_os=eos ansible_user=zuul ansible_connection=network_cli ansible_become_method=enable

[eos:vars]
cli={'transport': 'cli', 'authorize': 'yes':}
eapi={'transport': 'eapi', 'use_ssl': 'no', 'port': '80', 'authorize': 'yes'}
9 changes: 9 additions & 0 deletions zuul.d/jobs.yaml
Expand Up @@ -71,6 +71,15 @@
- name: github.com/ansible/ansible-zuul-jobs
nodeset: vyos-1.1.8-python3

- job:
name: ansible-test-network-integration-eos
parent: ansible-network-eos-appliance
pre-run: playbooks/ansible-test-network-integration-eos/pre.yaml
run: playbooks/ansible-test-network-integration-eos/run.yaml
required-projects:
- name: github.com/ansible/ansible
timeout: 3600

- job:
name: ansible-test-network-integration-vyos
parent: ansible-network-vyos-appliance
Expand Down
7 changes: 1 addition & 6 deletions zuul.d/project.yaml
Expand Up @@ -4,9 +4,4 @@
- ansible-python-jobs
check:
jobs:
- ansible-network-eos-appliance
- ansible-network-vyos-appliance
gate:
jobs:
- ansible-network-eos-appliance
- ansible-network-vyos-appliance
- ansible-test-network-integration-eos

0 comments on commit 6ae85b9

Please sign in to comment.