The purpose is to test the DHCP relay service can survive the max load that we lift to CPU.
CoPP is to limit the rate of traffic sent to CPU, and then generating packets above this maximum rate, the test is to ensure the DHCP relay service can handle the maximum load without failure.
- Verfy DHCP Container Status.
- CPU should remain within acceptable range, indicating the DUT is not overwhelmed.
- Check whether the function is still normal.
- No errors in the logs related to DHCP or CoPP.
Command | Comment |
---|---|
docker ps | grep dhcp | check the status of DHCP container |
show processes cpu --verbose | grep dhcp | awk '{print $9}' | check the resource utilisation |
docker exec dhcp_relay supervisorctl status | grep dhcp | awk '{print $2}' | verify the status of processes in dhcp are running |
loganalyzer | check no error keywords related to DHCP and CoPP |
===============
- def setup_copp_policy(): define a CoPP policy on the test device, and limit DHCP traffic to a maximum rate 600.
- def client_send_discover(): simulate client sending DHCPDISCOVER message from different source MAC by broadcast. Duration: 120s. e.g. PTF will send 10,000 packets per second.
- def server_send_offer(): simulate the server sending DHCPOFFER message to the client. At a rate up to 600 packets per second with a tolerance of 10%.
- def client_send_request(): simulate client sending DHCPREQUEST message from different source MAC or through different interface.
- def server_send_ack(): simulate the server sending DHCPACK message to the client under the same conditions (up tp 600 packets per second with a tolerance of 10%).
- def verify_dhcp_container_alive(): verify the DHCP container is still alive.
- def verify_cpu_utilisation(): verify the %cpu is within an acceptable range, the acceptable range will be adjusted after checking the device.
- def verify_supervisor_process_running(): verify the status of processes managed by Supervisor is normal.
- def verify_relay_packet_count_with_delay(): check DHCP relay packet count within a reasonable delay time range. Note that the packet count for DHCP offer and ack messages is around 72,000 packets (600 packets per second with 2 minutes) with a tolerance of 10%, and the packet count for DHCP discover and request messages should be 1,200,000 packets (10,000 packets per second for 120 seconds).
- No errors in the logs related to DHCP or CoPP, just using loganalyzer.
Test objective: To test the DHCP relay service can survive the max load that we lift to CPU.
Test steps:
- Configure CoPP policy
- Clients broadcast a discover message
- The DHCP server sends a offer message to client
- Clients broadcast a request message
- The DHCP server sends a offer message
# | Test Description | Expected Result |
---|---|---|
a. | verify_dhcp_container_alive() | Ensure the DHCP container is running by using the command docker ps | grep dhcp . |
b. | verify_cpu_utilisation() | Verify the cpu is less than the maximum allowed CPU usage percentage. |
c. | verify_supervisor_process_running() | Verify that all DHCP-related processes are running normally. |
d. | verify_relay_packet_count_with_delay() | The function checks the packet count for DHCP messages within a reasonable delay. |
e. | loganaylzer | Ensure there are no errors in the logs. |