Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions ansible/README.deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ 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:

```
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.*
6 changes: 3 additions & 3 deletions ansible/README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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
Expand Down
65 changes: 52 additions & 13 deletions ansible/README.test.md
Original file line number Diff line number Diff line change
@@ -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.

4 changes: 2 additions & 2 deletions ansible/roles/test/tasks/sonic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down