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.

Depends-On: ansible/ansible#56126
Depends-On: ansible/ansible#56131
Depends-On: ansible/ansible#56136
Depends-On: ansible/ansible#56140
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
  • Loading branch information
pabelanger committed May 7, 2019
1 parent 77ecd01 commit 21420d4
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 6 deletions.
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
- hosts: controller
gather_facts: false
connection: local
tasks:
- name: Install pexpect requirement
pip:
name: pexpect
extra_args: --user

- hosts: controller
gather_facts: false
connection: local
tasks:
- name: Enable eAPI access with default configuration
expect:
command: "ssh {{ hostvars['eos-4.20.10'].ansible_host }}"
responses:
'.*>': enable
'.*#':
- config terminal
- exit
'.*\(config\)#':
- management api http-commands
- write memory
- exit
'.*\(config-mgmt-api-http-cmds\)#':
- protocol http
- protocol https
- protocol unix-socket
- no shutdown
- exit
timeout: 60
register: result
delay: 5
retries: 3
until: result.rc == 0
9 changes: 9 additions & 0 deletions playbooks/ansible-test-network-integration-eos/pre.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- hosts: controller
tasks:
- name: Setup tox role
include_role:
name: tox
vars:
tox_extra_args: -- ansible-playbook -vvvv 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
Original file line number Diff line number Diff line change
@@ -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 --continue-on-error --diff --tox --tox-sitepackages --python 3.7 --inventory /home/zuul/inventory eos_.* -vv
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 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]
debug=False
cli={'transport': 'cli', 'authorize': 'yes'}
eapi={'transport': 'eapi', 'use_ssl': 'no', 'port': '80', 'authorize': 'yes'}
44 changes: 44 additions & 0 deletions zuul.d/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,50 @@
- 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-eos-devel
parent: ansible-test-network-integration-eos
required-projects:
- name: github.com/ansible/ansible
override-checkout: devel

- job:
name: ansible-test-network-integration-eos-stable-2.8
parent: ansible-test-network-integration-eos
required-projects:
- name: github.com/ansible/ansible
override-checkout: stable-2.8

- job:
name: ansible-test-network-integration-eos-stable-2.7
parent: ansible-test-network-integration-eos
required-projects:
- name: github.com/ansible/ansible
override-checkout: stable-2.7

- job:
name: ansible-test-network-integration-eos-stable-2.6
parent: ansible-test-network-integration-eos
required-projects:
- name: github.com/ansible/ansible
override-checkout: stable-2.6

- job:
name: ansible-test-network-integration-eos-stable-2.5
parent: ansible-test-network-integration-eos
required-projects:
- name: github.com/ansible/ansible
override-checkout: stable-2.5

- job:
name: ansible-test-network-integration-vyos
parent: ansible-network-vyos-appliance
Expand Down
11 changes: 5 additions & 6 deletions zuul.d/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
- 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-devel
- ansible-test-network-integration-eos-stable-2.8
- ansible-test-network-integration-eos-stable-2.7
- ansible-test-network-integration-eos-stable-2.6
- ansible-test-network-integration-eos-stable-2.5

0 comments on commit 21420d4

Please sign in to comment.