Skip to content
Merged
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
12 changes: 8 additions & 4 deletions tests/vlan/test_host_vlan.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from tests.common.utilities import is_ipv4_address
from tests.common.utilities import wait_until, delete_running_config
from tests.common.utilities import skip_release

from tests.common.helpers.assertions import pytest_assert

pytestmark = [
pytest.mark.topology("t0", "m0", "mx")
Expand Down Expand Up @@ -90,10 +90,16 @@ def setup_host_vlan_intf_mac(duthosts, rand_one_dut_hostname, testbed_params, ve
if duthost.get_facts()['asic_type'] == 'mellanox':
DUT_VLAN_INTF_MAC = get_new_vlan_intf_mac_mellanox(dut_vlan_mac)
duthost.shell('redis-cli -n 4 hmset "VLAN|%s" mac %s' % (vlan_intf["attachto"], DUT_VLAN_INTF_MAC))
wait_until(10, 2, 2, lambda: duthost.get_dut_iface_mac(vlan_intf["attachto"]) == DUT_VLAN_INTF_MAC)
pytest_assert(wait_until(10, 2, 2, lambda: duthost.get_dut_iface_mac(vlan_intf["attachto"]) == DUT_VLAN_INTF_MAC),
"Failed to set mac address for vlan interface %s" % vlan_intf["attachto"])

yield

# Restore the original mac address of the vlan interface
duthost.shell('redis-cli -n 4 hmset "VLAN|%s" mac %s' % (vlan_intf["attachto"], dut_vlan_mac))
pytest_assert(wait_until(10, 2, 2, lambda: duthost.get_dut_iface_mac(vlan_intf["attachto"]) == dut_vlan_mac),
"Failed to restore mac address for vlan interface %s" % vlan_intf["attachto"])

if "dualtor" not in tbinfo["topo"]["name"]:
del_vlan_json = json.loads("""
[{
Expand All @@ -106,8 +112,6 @@ def setup_host_vlan_intf_mac(duthosts, rand_one_dut_hostname, testbed_params, ve
""" % (vlan_intf["attachto"], dut_vlan_mac))
delete_running_config(del_vlan_json, duthost)

wait_until(10, 2, 2, lambda: duthost.get_dut_iface_mac(vlan_intf["attachto"]) == dut_vlan_mac)


def test_host_vlan_no_floodling(
duthosts,
Expand Down