-
Notifications
You must be signed in to change notification settings - Fork 1.1k
DHCP Relay Agent Test Plan
Joe LeVeque edited this page Feb 22, 2017
·
26 revisions
This test is aimed at confirming some of the features in the isc-dhcp-relay implementation. We must insure the basic objective the dhcp relay agent is met. This involves validating that DHCP discover, offer, request, and ack packets are successfully relayed from client to server(s). We must also insure that features such as attaching an Option 82 header are supported by this agent.
- Basic DHCP packet construction functions have been added to p4/ptf/testutils (dhcp discover, offer, request, ack)
- PTF test simulates a DHCP client acquiring a lease
- We simulate a DHCP client (a server under the ToR) booting up by manually creating DHCP packets and sending them on an interface that is part of the ToR's VLAN.
- Create a DHCPDISCOVER packet and send it to the ToR on an interface that is part of the ToR's VLAN. The DHCP relay should receive this packet, add and Option 82 header and forward the packet to all known DHCP servers via it's uplinks.
- Listen to all packets on the ToR's uplinks and count the number of forwarded DHCPDISCOVER packets to ensure one is sent to every known DHCP server.
- Create a DHCPOFFER packet and send it to the ToR via one of its uplinks. The DHCP relay should forward this packet to the "client" on its VLAN
- Listen for the DHCPOFFER on the "client's" interface to ensure it would be received
- Create a DHCPREQUEST packet and send it to the ToR on an interface that is part of the ToR's VLAN. The DHCP relay should receive this packet, add and Option 82 header and forward the packet to all known DHCP servers via it's uplinks.
- Listen to all packets on the ToR's uplinks and count the number of forwarded DHCPREQUEST packets to ensure one is sent to every known DHCP server.
- Create a DHCPACK packet and send it to the ToR via one of its uplinks. The DHCP relay should forward this packet to the "client" on its VLAN
- Listen for the DHCPACK on the "client's" interface to ensure it would be received
-
sonic-mgmt/ansible/roles/test/files/ptftests/dhcp_relay_test.py
- Main PTF testing script
-
sonic-mgmt/ansible/roles/test/tasks/dhcp_relay.yml
- Ansible playbook for deploying/running test on switch
-
sonic-mgmt/ansible/roles/sonic-common/templates/dhcp_relay.yml.j2
- Jinja2 template used with sonic-mgmt/ansible/roles/test/tasks/dhcp_relay.yml to populate DHCP server IP addresses.
DHCP servers should be defined in sonic-mgmt/ansible/group_vars/ as an attribute of your test environment, similar to the following:
# DHCP servers
dhcp_servers: ["192.0.0.1", "192.0.0.2", "192.0.0.3", "192.0.0.4"]
- ansible-playbook -i str --limit <switch-running-relay-agent> test.yml -e "ptf_host=<IP-address-of-PTF-container>" --tags=dhcp_relay --vault-password-file <path-to-vault-password-file> -vvvv
-
For Users
-
For Developers
-
Subgroups/Working Groups
-
Presentations
-
Join Us