Skip to content
Merged
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
15 changes: 10 additions & 5 deletions tests/arp/test_arpall.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ def test_arp_unicast_reply(common_setup_teardown, intfs_for_test, enum_frontend_
clear_dut_arp_cache(duthost, asichost.cli_ns_option)
params = {
'acs_mac': router_mac,
'port': intf1_indice
'port': intf1_indice,
'kvm_support': True
}
log_file = "/tmp/arptest.VerifyUnicastARPReply.{0}.log".format(datetime.now().strftime("%Y-%m-%d-%H:%M:%S"))
ptf_runner(ptfhost, 'ptftests', "arptest.VerifyUnicastARPReply", '/root/ptftests',
Expand All @@ -45,7 +46,8 @@ def test_arp_expect_reply(common_setup_teardown, intfs_for_test, enum_frontend_a
asichost = duthost.asic_instance(enum_frontend_asic_index)
params = {
'acs_mac': router_mac,
'port': intf1_indice
'port': intf1_indice,
'kvm_support': True
}

# Start PTF runner and send correct arp packets
Expand All @@ -69,7 +71,8 @@ def test_arp_no_reply_other_intf(common_setup_teardown, intfs_for_test, enum_fro
clear_dut_arp_cache(duthost, asichost.cli_ns_option)
intf2_params = {
'acs_mac': router_mac,
'port': intf2_indice
'port': intf2_indice,
'kvm_support': True
}
log_file = "/tmp/arptest.SrcOutRangeNoReply.{0}.log".format(datetime.now().strftime("%Y-%m-%d-%H:%M:%S"))
ptf_runner(ptfhost, 'ptftests', "arptest.SrcOutRangeNoReply", '/root/ptftests',
Expand All @@ -87,7 +90,8 @@ def test_arp_no_reply_src_out_range(common_setup_teardown, intfs_for_test, enum_
asichost = duthost.asic_instance(enum_frontend_asic_index)
params = {
'acs_mac': router_mac,
'port': intf1_indice
'port': intf1_indice,
'kvm_support': True
}

# Check DUT won't reply ARP and install ARP entry when src address is not in interface subnet range
Expand All @@ -108,7 +112,8 @@ def test_arp_garp_no_update(common_setup_teardown, intfs_for_test, enum_frontend
asichost = duthost.asic_instance(enum_frontend_asic_index)
params = {
'acs_mac': router_mac,
'port': intf1_indice
'port': intf1_indice,
'kvm_support': True
}

# Test Gratuitous ARP behavior, no Gratuitous ARP installed when arp was not resolved before
Expand Down
3 changes: 2 additions & 1 deletion tests/bgp/test_bgp_speaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@ def bgp_speaker_announce_routes_common(common_setup_teardown, tbinfo, duthost,
"ipv6": ipv6,
"testbed_mtu": mtu,
"asic_type": asic_type,
"test_balancing": False},
"test_balancing": False,
"kvm_support": True},
log_file="/tmp/bgp_speaker_test.FibTest.log",
socket_recv_size=16384,
is_python3=True)
Expand Down
21 changes: 14 additions & 7 deletions tests/dhcp_relay/test_dhcp_relay.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ def test_dhcp_relay_default(ptfhost, dut_dhcp_relay_data, validate_dut_routes_ex
"client_udp_src_port": DEFAULT_DHCP_CLIENT_PORT,
"switch_loopback_ip": dhcp_relay['switch_loopback_ip'],
"uplink_mac": str(dhcp_relay['uplink_mac']),
"testing_mode": testing_mode},
"testing_mode": testing_mode,
"kvm_support": True},
log_file="/tmp/dhcp_relay_test.DHCPTest.log", is_python3=True)
if not skip_dhcpmon:
time.sleep(36) # dhcpmon debug counter prints every 18 seconds
Expand Down Expand Up @@ -343,7 +344,8 @@ def test_dhcp_relay_with_source_port_ip_in_relay_enabled(ptfhost, dut_dhcp_relay
"switch_loopback_ip": dhcp_relay['switch_loopback_ip'],
"uplink_mac": str(dhcp_relay['uplink_mac']),
"testing_mode": testing_mode,
"enable_source_port_ip_in_relay": True},
"enable_source_port_ip_in_relay": True,
"kvm_support": True},
log_file="/tmp/dhcp_relay_test.DHCPTest.log", is_python3=True)
if not skip_dhcpmon:
time.sleep(36) # dhcpmon debug counter prints every 18 seconds
Expand Down Expand Up @@ -404,7 +406,8 @@ def test_dhcp_relay_after_link_flap(ptfhost, dut_dhcp_relay_data, validate_dut_r
"client_udp_src_port": DEFAULT_DHCP_CLIENT_PORT,
"switch_loopback_ip": dhcp_relay['switch_loopback_ip'],
"uplink_mac": str(dhcp_relay['uplink_mac']),
"testing_mode": testing_mode},
"testing_mode": testing_mode,
"kvm_support": True},
log_file="/tmp/dhcp_relay_test.DHCPTest.log", is_python3=True)


Expand Down Expand Up @@ -460,7 +463,8 @@ def test_dhcp_relay_start_with_uplinks_down(ptfhost, dut_dhcp_relay_data, valida
"client_udp_src_port": DEFAULT_DHCP_CLIENT_PORT,
"switch_loopback_ip": dhcp_relay['switch_loopback_ip'],
"uplink_mac": str(dhcp_relay['uplink_mac']),
"testing_mode": testing_mode},
"testing_mode": testing_mode,
"kvm_support": True},
log_file="/tmp/dhcp_relay_test.DHCPTest.log", is_python3=True)


Expand Down Expand Up @@ -495,7 +499,8 @@ def test_dhcp_relay_unicast_mac(ptfhost, dut_dhcp_relay_data, validate_dut_route
"client_udp_src_port": DEFAULT_DHCP_CLIENT_PORT,
"switch_loopback_ip": dhcp_relay['switch_loopback_ip'],
"uplink_mac": str(dhcp_relay['uplink_mac']),
"testing_mode": testing_mode},
"testing_mode": testing_mode,
"kvm_support": True},
log_file="/tmp/dhcp_relay_test.DHCPTest.log", is_python3=True)


Expand Down Expand Up @@ -529,7 +534,8 @@ def test_dhcp_relay_random_sport(ptfhost, dut_dhcp_relay_data, validate_dut_rout
"client_udp_src_port": RANDOM_CLIENT_PORT,
"switch_loopback_ip": dhcp_relay['switch_loopback_ip'],
"uplink_mac": str(dhcp_relay['uplink_mac']),
"testing_mode": testing_mode},
"testing_mode": testing_mode,
"kvm_support": True},
log_file="/tmp/dhcp_relay_test.DHCPTest.log", is_python3=True)


Expand Down Expand Up @@ -597,7 +603,8 @@ def test_dhcp_relay_counter(ptfhost, dut_dhcp_relay_data, validate_dut_routes_ex
"client_udp_src_port": DEFAULT_DHCP_CLIENT_PORT,
"switch_loopback_ip": dhcp_relay['switch_loopback_ip'],
"uplink_mac": str(dhcp_relay['uplink_mac']),
"testing_mode": testing_mode},
"testing_mode": testing_mode,
"kvm_support": True},
log_file="/tmp/dhcp_relay_test_counter.DHCPTest.log", is_python3=True)
for type in dhcp_message_types:
if type in ["Discover", "Request"]:
Expand Down
9 changes: 6 additions & 3 deletions tests/dhcp_relay/test_dhcp_relay_stress.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ def test_dhcp_relay_restart_with_stress(ptfhost, dut_dhcp_relay_data, validate_d
"uplink_mac": str(dut_dhcp_relay_data[0]['uplink_mac']),
"testing_mode": testing_mode,
"duration": duration,
"pps": pps},
"pps": pps,
"kvm_support": True},
log_file="/tmp/dhcp_relay_stress_test.DHCPContinuousStressTest.log", is_python3=True,
async_mode=True)

Expand Down Expand Up @@ -95,7 +96,8 @@ def _check_socket_buffer():
"client_udp_src_port": DEFAULT_DHCP_CLIENT_PORT,
"switch_loopback_ip": dut_dhcp_relay_data[0]['switch_loopback_ip'],
"uplink_mac": str(dut_dhcp_relay_data[0]['uplink_mac']),
"testing_mode": testing_mode},
"testing_mode": testing_mode,
"kvm_support": True},
log_file="/tmp/dhcp_relay_test.stress.DHCPTest.log", is_python3=True)


Expand Down Expand Up @@ -162,7 +164,8 @@ def test_dhcp_relay_stress(ptfhost, ptfadapter, dut_dhcp_relay_data, validate_du
"uplink_mac": str(dhcp_relay['uplink_mac']),
"packets_send_duration": packets_send_duration,
"client_packets_per_sec": client_packets_per_sec,
"testing_mode": testing_mode
"testing_mode": testing_mode,
"kvm_support": True
}
count_file = '/tmp/dhcp_stress_test_{}.json'.format(dhcp_type)

Expand Down
3 changes: 2 additions & 1 deletion tests/dhcp_relay/test_dhcpv6_relay.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ def test_dhcpv6_relay_counter(ptfhost, duthosts, rand_one_dut_hostname, dut_dhcp
"dut_mac": str(dhcp_relay['uplink_mac']),
"vlan_ip": str(dhcp_relay['downlink_vlan_iface']['addr']),
"loopback_ipv6": str(dhcp_relay['loopback_ipv6']),
"is_dualtor": str(dhcp_relay['is_dualtor'])},
"is_dualtor": str(dhcp_relay['is_dualtor']),
"kvm_support": True},
log_file="/tmp/dhcpv6_relay_test.DHCPCounterTest.log", is_python3=True)

for type in message_types:
Expand Down
1 change: 1 addition & 0 deletions tests/fdb/test_fdb_flush.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ def dynamic_fdb_oper(self, duthost, tbinfo, ptfhost, create_or_clear):
"router_mac": duthost.facts["router_mac"],
"fdb_info": self.FDB_INFO_FILE,
"dummy_mac_prefix": self.DUMMY_MAC_PREFIX,
"kvm_support": True
}
self.__runPtfTest(ptfhost, "fdb_flush_test.FdbFlushTest", testParams)
elif 'clear' == create_or_clear:
Expand Down
3 changes: 2 additions & 1 deletion tests/fdb/test_fdb_mac_expire.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ def testFdbMacExpire(self, request, tbinfo, rand_selected_dut, ptfhost, refresh_
"fdb_info": self.FDB_INFO_FILE,
"dummy_mac_prefix": self.DUMMY_MAC_PREFIX,
"refresh_type": refresh_type,
"aging_time": fdbAgingTime
"aging_time": fdbAgingTime,
"kvm_support": True
}
self.__runPtfTest(ptfhost, "fdb_mac_expire_test.FdbMacExpireTest", testParams)

Expand Down
1 change: 1 addition & 0 deletions tests/fdb/test_fdb_mac_learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def dynamic_fdb_oper(self, duthost, tbinfo, ptfhost, dut_ptf_ports):
"router_mac": duthost.facts["router_mac"],
"dut_ptf_ports": dut_ptf_ports,
"dummy_mac_prefix": self.DUMMY_MAC_PREFIX,
"kvm_support": True
}
self.__runPtfTest(ptfhost, "fdb_mac_learning_test.FdbMacLearningTest", testParams)

Expand Down
3 changes: 2 additions & 1 deletion tests/ipfwd/test_mtu.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def test_mtu(tbinfo, ptfhost, mtu, gather_facts):
"src_router_ipv6": gather_facts['src_router_ipv6'],
"dst_host_ipv6": gather_facts['dst_host_ipv6'],
"src_ptf_port_list": gather_facts['src_port_ids'],
"dst_ptf_port_list": gather_facts['dst_port_ids']
"dst_ptf_port_list": gather_facts['dst_port_ids'],
"kvm_support": True
},
log_file=log_file,
socket_recv_size=16384,
Expand Down
3 changes: 2 additions & 1 deletion tests/pc/test_lag_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ def __verify_lag_lacp_timing(self, lacp_timer, exp_iface):
'timeout': 35,
'packet_timing': lacp_timer,
'ether_type': 0x8809,
'interval_count': 3
'interval_count': 3,
'kvm_support': True
}
ptf_runner(self.ptfhost, 'acstests', "lag_test.LacpTimingTest",
'/root/ptftests', params=params, is_python3=True)
Expand Down
3 changes: 2 additions & 1 deletion tests/pc/test_lag_member.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,8 @@ def run_lag_member_traffic_test(duthost, dut_vlan, ptf_ports, ptfhost):
"dut_mac": duthost.facts["router_mac"],
"dut_vlan": dut_vlan,
"ptf_lag": ptf_lag,
ATTR_PORT_NOT_BEHIND_LAG: ptf_not_lag
ATTR_PORT_NOT_BEHIND_LAG: ptf_not_lag,
"kvm_support": True
}
ptf_runner(ptfhost, 'acstests', "lag_test.LagMemberTrafficTest", "/root/ptftests", params=params, is_python3=True)

Expand Down
3 changes: 2 additions & 1 deletion tests/ptf_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ def ptf_runner(host, testdir, testname, platform_dir=None, params={},
module_ignore_errors=False, is_python3=None, async_mode=False, pdb=False):

dut_type = get_dut_type(host)
if dut_type == "kvm" and params.get("kvm_support", True) is False:
kvm_support = params.get("kvm_support", False)
if dut_type == "kvm" and kvm_support is False:
logger.info("Skip test case {} for not support on KVM DUT".format(testname))
return True

Expand Down
12 changes: 8 additions & 4 deletions tests/radv/test_radv_ipv6_ra.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ def test_radv_router_advertisement(
"downlink_vlan_mac": vlan_intf['downlink_vlan_intf']['mac'],
"downlink_vlan_ip6": vlan_intf['downlink_vlan_intf']['ip6'],
"ptf_port_index": vlan_intf['ptf_port']['port_idx'],
"max_ra_interval": RADV_MAX_RA_INTERVAL_SECS},
"max_ra_interval": RADV_MAX_RA_INTERVAL_SECS,
"kvm_support": True},
log_file="/tmp/radv_ipv6_ra_test.RadvUnSolicitedRATest.log", is_python3=True)


Expand All @@ -161,7 +162,8 @@ def test_solicited_router_advertisement(
"downlink_vlan_ip6": vlan_intf['downlink_vlan_intf']['ip6'],
"ptf_port_index": vlan_intf['ptf_port']['port_idx'],
"ptf_port_ip6": vlan_intf['ptf_port']['ip6'],
"max_ra_interval": RADV_MAX_RA_INTERVAL_SECS},
"max_ra_interval": RADV_MAX_RA_INTERVAL_SECS,
"kvm_support": True},
log_file="/tmp/radv_ipv6_ra_test.RadvSolicitedRATest.log", is_python3=True)


Expand All @@ -187,7 +189,8 @@ def test_unsolicited_router_advertisement_with_m_flag(
"downlink_vlan_mac": vlan_intf['downlink_vlan_intf']['mac'],
"downlink_vlan_ip6": vlan_intf['downlink_vlan_intf']['ip6'],
"ptf_port_index": vlan_intf['ptf_port']['port_idx'],
"max_ra_interval": 180},
"max_ra_interval": 180,
"kvm_support": True},
log_file="/tmp/router_adv_mflag_test.RadvUnSolicitedRATest.log", is_python3=True)


Expand All @@ -214,5 +217,6 @@ def test_solicited_router_advertisement_with_m_flag(
"downlink_vlan_ip6": vlan_intf['downlink_vlan_intf']['ip6'],
"ptf_port_index": vlan_intf['ptf_port']['port_idx'],
"ptf_port_ip6": vlan_intf['ptf_port']['ip6'],
"max_ra_interval": RADV_MAX_RA_INTERVAL_SECS},
"max_ra_interval": RADV_MAX_RA_INTERVAL_SECS,
"kvm_support": True},
log_file="/tmp/router_adv_mflag_test.RadvSolicitedRATest.log", is_python3=True)