Skip to content

Commit

Permalink
[dhcp_relay][telemetry] Update events test for dhcp6relay bind issue
Browse files Browse the repository at this point in the history
  • Loading branch information
yaqiangz committed Dec 24, 2024
1 parent d62e7a1 commit 52a48c0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/telemetry/events/dhcp-relay_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,18 @@ def trigger_dhcp_relay_bind_failure(duthost):

vlan = dhcp_test_info["vlan"]
dhcp6_relay_process = dhcp_test_info["dhcp6relay_process"]
ipv6_ip = dhcp_test_info["ipv6_address"]
ipv6_global_unique_ip = dhcp_test_info["ipv6_address"]

try:
# Flush ipv6 address from vlan
duthost.shell("ip -6 address flush dev {}".format(vlan))
# Flush ipv6 global unique address from vlan
duthost.shell("ip -6 address del {} dev {}".format(ipv6_global_unique_ip, vlan))

# Restart dhcrelay process
duthost.shell("docker exec dhcp_relay supervisorctl restart {}".format(dhcp6_relay_process))

finally:
# Add back ipv6 address to vlan
duthost.shell("ip address add {} dev {}".format(ipv6_ip, vlan))
duthost.shell("ip address add {} dev {}".format(ipv6_global_unique_ip, vlan))

# Restart dhcrelay process
duthost.shell("docker exec dhcp_relay supervisorctl restart {}".format(dhcp6_relay_process))
Expand Down

0 comments on commit 52a48c0

Please sign in to comment.