Skip to content

Commit

Permalink
[dhcp relay test] adding more test scenarios (#440)
Browse files Browse the repository at this point in the history
- Test that dhcp relay service continue to work after teamd service
  restarted
- Test that dhcp relay service continue to work after teamd service
  stopped and then started
  • Loading branch information
yxieca authored Mar 8, 2018
1 parent af5f05f commit b6d39e3
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions ansible/roles/test/tasks/dhcp_relay.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,59 @@
- relay_iface_mac=\"{{ relay_iface_mac }}\"
- relay_iface_netmask=\"{{ minigraph_vlan_interfaces[0]['mask'] }}\"

# Service restart and service stop -> start exhibited different behaviors.
# Therefore testing them separately.
- name: Restart teamd on DUT
shell: systemctl restart teamd
become: yes

- name: sleep 60 seconds for lag and bgp to come up
pause: seconds=60

- include: ptf_runner.yml
vars:
ptf_test_name: DHCP Relay Test
ptf_test_dir: ptftests
ptf_test_path: dhcp_relay_test.DHCPTest
ptf_platform: remote
ptf_platform_dir: ptftests
ptf_test_params:
- hostname=\"{{ inventory_hostname }}\"
- client_port_index=\"{{ client_port_index }}\"
- client_iface_alias=\"{{ client_iface_alias }}\"
- leaf_port_indices=\"{{ leaf_port_indices }}\"
- num_dhcp_servers=\"{{ dhcp_servers | length }}\"
- server_ip=\"{{ dhcp_servers[0] }}\"
- relay_iface_ip=\"{{ minigraph_vlan_interfaces[0]['addr'] }}\"
- relay_iface_mac=\"{{ relay_iface_mac }}\"
- relay_iface_netmask=\"{{ minigraph_vlan_interfaces[0]['mask'] }}\"

- name: Stop teamd on DUT
shell: systemctl stop teamd
become: yes

- name: Start teamd on DUT
shell: systemctl start teamd
become: yes

- name: sleep 60 seconds for lag and bgp to come up
pause: seconds=60

- include: ptf_runner.yml
vars:
ptf_test_name: DHCP Relay Test
ptf_test_dir: ptftests
ptf_test_path: dhcp_relay_test.DHCPTest
ptf_platform: remote
ptf_platform_dir: ptftests
ptf_test_params:
- hostname=\"{{ inventory_hostname }}\"
- client_port_index=\"{{ client_port_index }}\"
- client_iface_alias=\"{{ client_iface_alias }}\"
- leaf_port_indices=\"{{ leaf_port_indices }}\"
- num_dhcp_servers=\"{{ dhcp_servers | length }}\"
- server_ip=\"{{ dhcp_servers[0] }}\"
- relay_iface_ip=\"{{ minigraph_vlan_interfaces[0]['addr'] }}\"
- relay_iface_mac=\"{{ relay_iface_mac }}\"
- relay_iface_netmask=\"{{ minigraph_vlan_interfaces[0]['mask'] }}\"

0 comments on commit b6d39e3

Please sign in to comment.