Skip to content
Open
Show file tree
Hide file tree
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
14 changes: 11 additions & 3 deletions tests/acl/test_src_mac_rewrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ def fixture_setUp(rand_selected_dut, tbinfo, ptfadapter):
tunnel_name=data['vxlan_tunnel_name'],
src_ip=data['loopback_src_ip'],
portchannel_name=selected_pc,
router_mac=rand_selected_dut.facts['router_mac']
router_mac=rand_selected_dut.facts['router_mac'],
asic_type=rand_selected_dut.facts.get('asic_type')
)

def _check_vnet_route(duthost):
Expand Down Expand Up @@ -525,7 +526,8 @@ def _check_acl_rule_absent(duthost, table_name, rule_name):
pytest_assert(exists_output.strip() == "0", f"ACL rule {state_db_key} still exists in STATE_DB")


def create_vxlan_vnet_config(duthost, tunnel_name, src_ip, portchannel_name="PortChannel101", router_mac=None):
def create_vxlan_vnet_config(duthost, tunnel_name, src_ip, portchannel_name="PortChannel101", router_mac=None,
asic_type=None):
# --- VXLAN parameters ---
vnet_base = VXLAN_VNI
ptf_vtep = PTF_VTEP_IP
Expand All @@ -534,10 +536,16 @@ def create_vxlan_vnet_config(duthost, tunnel_name, src_ip, portchannel_name="Por
ecmp_utils.Constants['KEEP_TEMP_FILES'] = True
ecmp_utils.Constants['DEBUG'] = False

vxlan_tunnel_entry = {"src_ip": dut_vtep}
# On cisco-8000, base topology IP-in-IP decap tunnels may already use pipe TTL mode.
# Set VXLAN decap ttl_mode to pipe so orchagent passes DECAP_TTL_MODE consistently.
if asic_type == "cisco-8000":
vxlan_tunnel_entry["ttl_mode"] = "pipe"

# --- Build overlay config JSON ---
dut_json = {
"VXLAN_TUNNEL": {
tunnel_name: {"src_ip": dut_vtep}
tunnel_name: vxlan_tunnel_entry
},
"VNET": {
"Vnet1": {
Expand Down
13 changes: 9 additions & 4 deletions tests/vxlan/test_scale_ecmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,12 @@ def vxlan_setup_one_vnet(duthost, ptfhost, tbinfo, cfg_facts,

dut_vtep = get_loopback_ip(cfg_facts)
logger.info(f"Creating VXLAN tunnel {TUNNEL_NAME} with source {dut_vtep}")
apply_chunk(duthost, {"VXLAN_TUNNEL": {TUNNEL_NAME: {"src_ip": dut_vtep}}}, "vxlan_tunnel")
vxlan_tunnel_entry = {"src_ip": dut_vtep}
# On cisco-8000, base topology IP-in-IP decap tunnels may already use pipe TTL mode.
# Set VXLAN decap ttl_mode to pipe so orchagent passes DECAP_TTL_MODE consistently.
if duthost.facts.get("asic_type") == "cisco-8000":
vxlan_tunnel_entry["ttl_mode"] = "pipe"
apply_chunk(duthost, {"VXLAN_TUNNEL": {TUNNEL_NAME: vxlan_tunnel_entry}}, "vxlan_tunnel")
apply_chunk(duthost, {"VNET": {VNET_NAME: {"vni": str(VNI), "vxlan_tunnel": TUNNEL_NAME}}}, "vnet")

ptf_port_index = port_indexes[ingress_if]
Expand Down Expand Up @@ -288,7 +293,7 @@ def test_vxlan_mac_vni(ptfhost, one_vnet_setup_teardown):

# --- Build deterministic MAC list ---
# 52:54:00:00:xx:yy (unique per endpoint)
mac_list = [f"52:54:00:{i//256:02x}:{i%256:02x}:aa" for i in range(num_endpoints)]
mac_list = [f"52:54:00:{i//256:02x}:{i % 256:02x}:aa" for i in range(num_endpoints)]
mac_list_str = ",".join(mac_list)
updated_vni = 5001

Expand Down Expand Up @@ -442,7 +447,7 @@ def test_ecmp_scale_modify_mac(ptfhost, one_vnet_setup_teardown):
time.sleep(5)

# Step 2 — Initial MAC list
mac_list = [f"52:54:00:{i//256:02x}:{i%256:02x}:aa" for i in range(num)]
mac_list = [f"52:54:00:{i//256:02x}:{i % 256:02x}:aa" for i in range(num)]
mac_string = ",".join(mac_list)

# Push initial MAC list
Expand All @@ -451,7 +456,7 @@ def test_ecmp_scale_modify_mac(ptfhost, one_vnet_setup_teardown):

# Step 3 — Random index to modify
mod_idx = random.randint(0, num - 1)
new_mac = f"52:54:99:{mod_idx//256:02x}:{mod_idx%256:02x}:cc"
new_mac = f"52:54:99:{mod_idx//256:02x}:{mod_idx % 256:02x}:cc"
logger.info(f"Modifying MAC for endpoint index {mod_idx}: new MAC = {new_mac}")

# Update the list
Expand Down
3 changes: 2 additions & 1 deletion tests/vxlan/test_vnet_decap.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ def setup(request, duthosts, rand_one_dut_hostname, tbinfo, inner_ip_version, ou
topo = tbinfo["topo"]["type"].upper()
vnet_interface = ecmp_utils.select_required_interfaces(duthost, 1, minigraph_facts, outer_ip_version_str,
topo=topo)[0]
vxlan_tunnel = ecmp_utils.create_vxlan_tunnel(duthost, minigraph_facts, outer_ip_version_str)
vxlan_tunnel = ecmp_utils.create_vxlan_tunnel(duthost, minigraph_facts, outer_ip_version_str,
ttl_mode="pipe" if asic_type == "cisco-8000" else None)
inner_ip_version_str = f"v{inner_ip_version}"
encap_type = f"{inner_ip_version_str}_in_{outer_ip_version_str}"
vnet = next(iter(ecmp_utils.create_vnets(duthost, vxlan_tunnel,
Expand Down
3 changes: 2 additions & 1 deletion tests/vxlan/test_vxlan_bfd_tsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ def fixture_setUp(duthosts,
tunnel_names[outer_layer_version] = ecmp_utils.create_vxlan_tunnel(
data['duthost'],
minigraph_data=minigraph_facts,
af=outer_layer_version)
af=outer_layer_version,
ttl_mode="pipe" if data['duthost'].facts.get("asic_type") == "cisco-8000" else None)

payload_version = ecmp_utils.get_payload_version(encap_type)
encap_type = "{}_in_{}".format(payload_version, outer_layer_version)
Expand Down
13 changes: 9 additions & 4 deletions tests/vxlan/test_vxlan_decap.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,17 @@ def generate_vxlan_config_files(duthost, mg_facts):
pytest.fail("ipv4 lo interface not found")

# Generate vxlan tunnel config json file on DUT
vxlan_tunnel_entry = {
"src_ip": loopback_ip,
"dst_ip": VTEP2_IP
}
# On cisco-8000, base topology IP-in-IP decap tunnels may already use pipe TTL mode.
# Set VXLAN decap ttl_mode to pipe so orchagent passes DECAP_TTL_MODE consistently.
if duthost.facts.get("asic_type") == "cisco-8000":
vxlan_tunnel_entry["ttl_mode"] = "pipe"
vxlan_tunnel_cfg = {
"VXLAN_TUNNEL": {
"tlVxlan": {
"src_ip": loopback_ip,
"dst_ip": VTEP2_IP
}
"tlVxlan": vxlan_tunnel_entry
}
}
duthost.copy(content=json.dumps(vxlan_tunnel_cfg, indent=2),
Expand Down
3 changes: 2 additions & 1 deletion tests/vxlan/test_vxlan_ecmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ def fixture_setUp(duthosts,
tunnel_names[outer_layer_version] = ecmp_utils.create_vxlan_tunnel(
data['duthost'],
minigraph_data=minigraph_facts,
af=outer_layer_version)
af=outer_layer_version,
ttl_mode="pipe" if data['duthost'].facts.get("asic_type") == "cisco-8000" else None)

payload_version = ecmp_utils.get_payload_version(encap_type)
encap_type = "{}_in_{}".format(payload_version, outer_layer_version)
Expand Down
3 changes: 2 additions & 1 deletion tests/vxlan/test_vxlan_ecmp_switchover.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ def fixture_setUp(duthosts,
tunnel_names[outer_layer_version] = ecmp_utils.create_vxlan_tunnel(
data['duthost'],
minigraph_data=minigraph_facts,
af=outer_layer_version)
af=outer_layer_version,
ttl_mode="pipe" if data['duthost'].facts.get("asic_type") == "cisco-8000" else None)

payload_version = ecmp_utils.get_payload_version(encap_type)
encap_type = "{}_in_{}".format(payload_version, outer_layer_version)
Expand Down
3 changes: 2 additions & 1 deletion tests/vxlan/test_vxlan_route_advertisement.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ def fixture_setUp(duthosts,
tunnel_names[outer_layer_version] = ecmp_utils.create_vxlan_tunnel(
data['duthost'],
minigraph_data=minigraph_facts,
af=outer_layer_version)
af=outer_layer_version,
ttl_mode="pipe" if data['duthost'].facts.get("asic_type") == "cisco-8000" else None)

payload_version = ecmp_utils.get_payload_version(encap_type)
encap_type = "{}_in_{}".format(payload_version, outer_layer_version)
Expand Down
7 changes: 6 additions & 1 deletion tests/vxlan/test_vxlan_tunnel_route_scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,12 @@ def vxlan_setup_config(config_facts, cfg_facts, duthost, dut_indx, ptfhost,
dut_vtep = get_loopback_ip(cfg_facts)
ptf_vtep = PTF_VTEP
vxlan_tun = TUNNEL_NAME
apply_chunk(duthost, {"VXLAN_TUNNEL": {vxlan_tun: {"src_ip": dut_vtep}}}, "vxlan_tunnel")
vxlan_tunnel_entry = {"src_ip": dut_vtep}
# On cisco-8000, base topology IP-in-IP decap tunnels may already use pipe TTL mode.
# Set VXLAN decap ttl_mode to pipe so orchagent passes DECAP_TTL_MODE consistently.
if duthost.facts.get("asic_type") == "cisco-8000":
vxlan_tunnel_entry["ttl_mode"] = "pipe"
apply_chunk(duthost, {"VXLAN_TUNNEL": {vxlan_tun: vxlan_tunnel_entry}}, "vxlan_tunnel")
res = duthost.shell("redis-cli -n 0 hget 'SWITCH_TABLE:switch' vxlan_router_mac")
vxlan_router_mac = res["stdout"].strip()

Expand Down
11 changes: 7 additions & 4 deletions tests/vxlan/test_vxlan_vnet_bgp_subintf.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ def setup_portchannel_subintfs(duthost, ptfhost, portchannel_info, vnet_vnis, ba
gnmi_set_update_config_db_json(
duthost,
ptfhost,
f"{GNMI_PATH_PREFIX}/VLAN_SUB_INTERFACE/{subintf_name}|{dut_ips[j][i].replace('/','~1')}",
f"{GNMI_PATH_PREFIX}/VLAN_SUB_INTERFACE/{subintf_name}|{dut_ips[j][i].replace('/', '~1')}",
{},
f"{subintf_name}_ip")

Expand Down Expand Up @@ -619,10 +619,13 @@ def setup_vnets(duthost, ptfhost, num_vnets, tunnel, base_vni):


def setup_vxlan_tunnel(duthost, ptfhost, name, src_ip):
tunnel_entry = {"src_ip": src_ip}
# On cisco-8000, base topology IP-in-IP decap tunnels may already use pipe TTL mode.
# Set VXLAN decap ttl_mode to pipe so orchagent passes DECAP_TTL_MODE consistently.
if duthost.facts.get("asic_type") == "cisco-8000":
tunnel_entry["ttl_mode"] = "pipe"
gnmi_set_update_config_db_json(duthost, ptfhost, f"{GNMI_PATH_PREFIX}/VXLAN_TUNNEL", {
name: {
"src_ip": src_ip
}
name: tunnel_entry
}, "vxlan")


Expand Down