Skip to content

Commit 42c0bff

Browse files
authored
Add test playbook and tasks/main.yml, tasks/sonic.yml (#15)
* Add test playbook and tasks/main.yml, tasks/sonic.yml Signed-Off-By: John Arnold <[email protected]>
1 parent 1e50d5d commit 42c0bff

3 files changed

Lines changed: 106 additions & 0 deletions

File tree

ansible/roles/test/tasks/main.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
3+
# Actions for SONiC switches
4+
- include: sonic.yml
5+
when: scope == 'sonic'
6+
7+
# Actions for lldp_neighbors
8+
- include: lldp_neighbor.yml
9+
when: scope == 'lldp_neighbors'
10+

ansible/roles/test/tasks/sonic.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
- name: Test LLDP
2+
include: lldp.yml
3+
tags: lldp
4+
5+
- name: Test NTP
6+
include: ntp.yml
7+
tags: ntp
8+
9+
- name: Test SNMP Basic
10+
include: snmp.yml
11+
tags: snmp
12+
13+
### when calling this QoS test, please add command line of which PTF docker image host to test against
14+
### -e "ptf_host=10.0.0.200"
15+
- fail: msg="Please set ptf_host variable"
16+
when: ptf_host is not defined
17+
tags: qos
18+
19+
- name: Test QOS
20+
include: qos.yml
21+
when: host_saithrift is not defined
22+
tags: qos
23+
24+
- name: Test QoS using SAI
25+
include: qos_sai.yml
26+
when: host_saithrift is defined
27+
tags: qos
28+
29+
### when callng BGP flaps test, please add command line of which VMs host to test against
30+
### -e "vmhost_num='01'"
31+
- fail: msg="Please set vmhost_num variable"
32+
when: vmhost_num is not defined
33+
tags: sync
34+
35+
- name: Test SyncD BGP Flaps
36+
include: bgp_flap.yml
37+
tags: sync
38+
39+
- name: Test Syslog Basic
40+
include: syslog.yml
41+
tags: syslog
42+
43+
- name: Test SNMP CPU
44+
include: snmp/cpu.yml
45+
tags: snmp_cpu
46+
47+
- name: Test SNMP Interfaces
48+
include: snmp/interfaces.yml
49+
tags: snmp_interfaces
50+
51+
- name: Test Interface Flap from Neighbor
52+
include: interface_up_down.yml
53+
tags: link
54+
55+
### when calling this ARP test, please add command line of which PTF docker image host to test against
56+
### -e "ptf_host=10.0.0.200"
57+
- fail: msg="Please set ptf_host variable"
58+
when: ptf_host is not defined
59+
tags: arp
60+
61+
- name: Test kernel ARP behavior
62+
include: arpall.yml
63+
tags: arp
64+
65+
### When calling this basic_route, Chip is setup with proper parameters and
66+
### SAI API used by syncd daemon are called. This test is mainly for validation purpose used by external vendors.
67+
- name: Test basic_router
68+
include: basic_router.yml
69+
tags: basic_router
70+

ansible/test_sonic.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
# This Playbook would test all the devices.
3+
#
4+
# Examples of running this playbook:
5+
#
6+
## QoS tests using sonic switch1 and ptf_host 10.0.0.200
7+
# ansible-playbook -i inventory --limit switch1 test.yml -b --ask-vault-pass -e "ptf_host=10.0.0.200" --tags qos
8+
#
9+
## Test CPU SNMP utilization
10+
# ansible-playbook -i inventory --limit switch1 test.yml -b --ask-vault-pass --tags snmp_cpu
11+
#
12+
## Basic test of syslog functionality
13+
# ansible-playbook -i inventory --limit switch1 test.yml -b --ask-vault-pass --tags syslog
14+
15+
16+
- hosts: sonic
17+
vars_files:
18+
- vars/docker_registry.yml
19+
roles:
20+
- { role: test, scope: 'sonic' }
21+
22+
- hosts: [lldp_neighbors]
23+
gather_facts: no
24+
roles:
25+
- { role: test, scope: 'lldp_neighbors' }
26+

0 commit comments

Comments
 (0)