diff --git a/ansible/README.deploy.md b/ansible/README.deploy.md index cfc3def6442..1ee2dd8a336 100644 --- a/ansible/README.deploy.md +++ b/ansible/README.deploy.md @@ -12,16 +12,16 @@ and public [sonicdev Docker registry](https://sonicdev-microsoft.azurecr.io/). ## Deploy SONiC - Update [inventory](/ansible/inventory/) file with correct information for your environment. - * ansible_host = management ip address - * sonic_hwsku = Supported Hardware SKU, e.g. Force10-S6000, ACS-MSN2700 + - ansible_host = management ip address + - sonic_hwsku = Supported Hardware SKU, e.g. Force10-S6000, ACS-MSN2700 - Update [group_vars/sonic/vars](/ansible/group_vars/sonic/vars/) file with: - * Replace ```sonicadmin_user``` and ```ansible_ssh_user``` with the username you built into the baseimage - * Replace ```sonicadmin_initial_password``` with the password you built into baseimage. - * Update ```[ntp,syslog,dns]_servers``` with a list of your server IPs for these services. - * Update APT repository if you are using private repo. - * Update Docker [registry](/ansible/vars/docker_registry.yml/) if you are using private registry. + - Replace `sonicadmin_user` and `ansible_ssh_user` with the username you built into the baseimage + - Replace `sonicadmin_initial_password` with the password you built into baseimage. + - Update `[ntp,syslog,dns]_servers` with a list of your server IPs for these services. + - Update APT repository if you are using private repo. + - Update Docker [registry](/ansible/vars/docker_registry.yml/) if you are using private registry. - Update management IP of switch1 - * Find the ManagementIPInterfaces xml block in [minigraph/switch1.xml](/ansible/minigraph/switch1.xml/) and change both IP addresses. + - Find the ManagementIPInterfaces xml block in [minigraph/switch1.xml](/ansible/minigraph/switch1.xml/) and change both IP addresses. - Run the playbook: @@ -29,4 +29,4 @@ and public [sonicdev Docker registry](https://sonicdev-microsoft.azurecr.io/). ansible-playbook deploy_sonic.yml -i inventory --limit switch1 --become -e "bootstrap=yes" ``` -Note: ```-e "bootstrap=yes"``` passes a special flag to update the initial admin password to the permanent password. This is not required after the first run. +*Note: `-e "bootstrap=yes"` passes a special flag to update the initial admin password to the permanent password. This is not required after the first run.* diff --git a/ansible/README.md b/ansible/README.md index 5967a819f23..0e0ad846dab 100644 --- a/ansible/README.md +++ b/ansible/README.md @@ -1,6 +1,6 @@ # Overview of SONiC deployment, testbed setup and tests -This ansible playbook consists following functionalities: +This ansible playbook consists of the following functionality: - [Deploy SONiC](README.deploy.md) - [Setup SONiC testbed](README.testbed.md) - [Run SONiC tests](README.test.md) @@ -17,9 +17,9 @@ git submodule update --init --recursive make sudo make install ``` -Note: v2.0.0.2 is the currently tested Ansible version. Other versions may not work correctly. +*Note: v2.0.0.2 is the currently tested Ansible version. Other versions may not work correctly.* -# Ansible playbood layout +# Ansible playbook layout ``` # Ansible top level file and directory structure diff --git a/ansible/README.test.md b/ansible/README.test.md index 4d3e7ed6532..373a8331a9b 100644 --- a/ansible/README.test.md +++ b/ansible/README.test.md @@ -1,36 +1,75 @@ -# ansible playbooks for SONiC testing +# Ansible Playbooks for Testing SONiC ## Requirements - A testbed needed to be set up before hand. See [Testbed](README.testbed.md) for more information. -- Depending on the test, either a PTF testbed or a VM set testbed might be required. -## Run Tests -- Replace {DUT_NAME} in each command line with the host name of switch under test. +## How to Run Tests +- Replace {DUT_NAME} in each command line with the host name of switch under test +- Replace {PTF_HOST} in each command line with the host name or IP of the PTF testbed host +- Replace {TESTBED_TYPE} in each command line with the type of the testbed being used -### NTP test + +### ARP tests ``` -ansible-playbook test_sonic.yml -i inventory --limit {DUT_NAME} --become --tags ntp +ansible-playbook test_sonic.yml -i inventory --limit {DUT_NAME} --become --tags arp --extra-vars "ptf_host={PTF_HOST}" ``` +- Requires switch connected to a PTF testbed -### Syslog test +### BGP facts verification test ``` -ansible-playbook test_sonic.yml -i inventory --limit {DUT_NAME} --become --tags syslog +ansible-playbook test_sonic.yml -i inventory --limit {DUT_NAME} --become --tags bgp_fact ``` +- Requires switch connected to a VM set testbed -### SNMP tests +### CoPP test ``` -ansible-playbook test_sonic.yml -i inventory --limit {DUT_NAME} --become --tags snmp,snmp_cpu,snmp_interfaces +ansible-playbook test_sonic.yml -i inventory --limit {DUT_NAME} --become --tags copp --extra-vars "ptf_host={PTF_HOST}" +``` +- Requires switch connected to a PTF testbed + +### DHCP relay test +``` +ansible-playbook test_sonic.yml -i inventory --limit {DUT_NAME} --become --tags dhcp_relay --extra-vars "ptf_host={PTF_HOST}" +``` +- Requires switch connected to a PTF testbed + +### FIB test +``` +ansible-playbook test_sonic.yml -i inventory --limit {DUT_NAME} --tags fib --extra-vars "testbed_type={TESTBED_TYPE} ptf_host={PTF_HOST}" +``` +- Requires switch connected to a PTF testbed + +### Fast-Reboot test +``` +ansible-playbook test_sonic.yml -i inventory --limit {DUT_NAME} --become --tags fast_reboot --extra-vars "ptf_host={PTF_HOST}" ``` +- Requires switch connected to a PTF testbed ### LLDP test ``` ansible-playbook test_sonic.yml -i inventory --limit {DUT_NAME},lldp_neighbors --become --tags lldp ``` -- Required switch connected to a VM set testbed. +- Requires switch connected to a VM set testbed -### BGP facts verification test +### Link flap test ``` -ansible-playbook test_sonic.yml -i inventory --limit {DUT_NAME} --become --tags bgp_fact +ansible-playbook test_sonic.yml -i inventory --limit {DUT_NAME}, --become --tags link_flap +``` +- Requires switch connected to a VM set testbed + +### NTP test +``` +ansible-playbook test_sonic.yml -i inventory --limit {DUT_NAME} --become --tags ntp +``` + +### SNMP tests +``` +ansible-playbook test_sonic.yml -i inventory --limit {DUT_NAME} --become --tags snmp,snmp_cpu,snmp_interfaces +``` + +### Syslog test +``` +ansible-playbook test_sonic.yml -i inventory --limit {DUT_NAME} --become --tags syslog ``` -- Required switch connected to a VM set testbed. diff --git a/ansible/roles/test/tasks/sonic.yml b/ansible/roles/test/tasks/sonic.yml index 14dc47572b4..74194422ca2 100644 --- a/ansible/roles/test/tasks/sonic.yml +++ b/ansible/roles/test/tasks/sonic.yml @@ -61,8 +61,8 @@ tags: sync - name: Test Interface Flap from Neighbor - include: interface_up_down.yml - tags: link + include: link_flap.yml + tags: link_flap ### when calling this ARP test, please add command line of which PTF docker image host to test against ### -e "ptf_host=10.0.0.200"