Skip to content

Commit 71fba4e

Browse files
xwjiang-msyutongzhang-microsoft
authored andcommitted
Set default kvm_support to False in ptf_runner (sonic-net#15380)
What is the motivation for this PR? In PR sonic-net#12598, we set default kvm_support to True in ptf_runner params, but most of tests do not support traffic test in KVM, to minimize code change in testcases, it's better to set default kvm_support to False How did you do it? Set default kvm_support to False and set kvm_support to True in tests currently running ptf_runner How did you verify/test it?
1 parent d928460 commit 71fba4e

13 files changed

Lines changed: 54 additions & 26 deletions

tests/arp/test_arpall.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ def test_arp_unicast_reply(common_setup_teardown, intfs_for_test, enum_frontend_
2626
clear_dut_arp_cache(duthost, asichost.cli_ns_option)
2727
params = {
2828
'acs_mac': router_mac,
29-
'port': intf1_indice
29+
'port': intf1_indice,
30+
'kvm_support': True
3031
}
3132
log_file = "/tmp/arptest.VerifyUnicastARPReply.{0}.log".format(datetime.now().strftime("%Y-%m-%d-%H:%M:%S"))
3233
ptf_runner(ptfhost, 'ptftests', "arptest.VerifyUnicastARPReply", '/root/ptftests',
@@ -45,7 +46,8 @@ def test_arp_expect_reply(common_setup_teardown, intfs_for_test, enum_frontend_a
4546
asichost = duthost.asic_instance(enum_frontend_asic_index)
4647
params = {
4748
'acs_mac': router_mac,
48-
'port': intf1_indice
49+
'port': intf1_indice,
50+
'kvm_support': True
4951
}
5052

5153
# Start PTF runner and send correct arp packets
@@ -69,7 +71,8 @@ def test_arp_no_reply_other_intf(common_setup_teardown, intfs_for_test, enum_fro
6971
clear_dut_arp_cache(duthost, asichost.cli_ns_option)
7072
intf2_params = {
7173
'acs_mac': router_mac,
72-
'port': intf2_indice
74+
'port': intf2_indice,
75+
'kvm_support': True
7376
}
7477
log_file = "/tmp/arptest.SrcOutRangeNoReply.{0}.log".format(datetime.now().strftime("%Y-%m-%d-%H:%M:%S"))
7578
ptf_runner(ptfhost, 'ptftests', "arptest.SrcOutRangeNoReply", '/root/ptftests',
@@ -87,7 +90,8 @@ def test_arp_no_reply_src_out_range(common_setup_teardown, intfs_for_test, enum_
8790
asichost = duthost.asic_instance(enum_frontend_asic_index)
8891
params = {
8992
'acs_mac': router_mac,
90-
'port': intf1_indice
93+
'port': intf1_indice,
94+
'kvm_support': True
9195
}
9296

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

114119
# Test Gratuitous ARP behavior, no Gratuitous ARP installed when arp was not resolved before

tests/bgp/test_bgp_speaker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,8 @@ def bgp_speaker_announce_routes_common(common_setup_teardown, tbinfo, duthost,
334334
"ipv6": ipv6,
335335
"testbed_mtu": mtu,
336336
"asic_type": asic_type,
337-
"test_balancing": False},
337+
"test_balancing": False,
338+
"kvm_support": True},
338339
log_file="/tmp/bgp_speaker_test.FibTest.log",
339340
socket_recv_size=16384,
340341
is_python3=True)

tests/dhcp_relay/test_dhcp_relay.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ def test_dhcp_relay_default(ptfhost, dut_dhcp_relay_data, validate_dut_routes_ex
254254
"client_udp_src_port": DEFAULT_DHCP_CLIENT_PORT,
255255
"switch_loopback_ip": dhcp_relay['switch_loopback_ip'],
256256
"uplink_mac": str(dhcp_relay['uplink_mac']),
257-
"testing_mode": testing_mode},
257+
"testing_mode": testing_mode,
258+
"kvm_support": True},
258259
log_file="/tmp/dhcp_relay_test.DHCPTest.log", is_python3=True)
259260
if not skip_dhcpmon:
260261
time.sleep(36) # dhcpmon debug counter prints every 18 seconds
@@ -343,7 +344,8 @@ def test_dhcp_relay_with_source_port_ip_in_relay_enabled(ptfhost, dut_dhcp_relay
343344
"switch_loopback_ip": dhcp_relay['switch_loopback_ip'],
344345
"uplink_mac": str(dhcp_relay['uplink_mac']),
345346
"testing_mode": testing_mode,
346-
"enable_source_port_ip_in_relay": True},
347+
"enable_source_port_ip_in_relay": True,
348+
"kvm_support": True},
347349
log_file="/tmp/dhcp_relay_test.DHCPTest.log", is_python3=True)
348350
if not skip_dhcpmon:
349351
time.sleep(36) # dhcpmon debug counter prints every 18 seconds
@@ -404,7 +406,8 @@ def test_dhcp_relay_after_link_flap(ptfhost, dut_dhcp_relay_data, validate_dut_r
404406
"client_udp_src_port": DEFAULT_DHCP_CLIENT_PORT,
405407
"switch_loopback_ip": dhcp_relay['switch_loopback_ip'],
406408
"uplink_mac": str(dhcp_relay['uplink_mac']),
407-
"testing_mode": testing_mode},
409+
"testing_mode": testing_mode,
410+
"kvm_support": True},
408411
log_file="/tmp/dhcp_relay_test.DHCPTest.log", is_python3=True)
409412

410413

@@ -460,7 +463,8 @@ def test_dhcp_relay_start_with_uplinks_down(ptfhost, dut_dhcp_relay_data, valida
460463
"client_udp_src_port": DEFAULT_DHCP_CLIENT_PORT,
461464
"switch_loopback_ip": dhcp_relay['switch_loopback_ip'],
462465
"uplink_mac": str(dhcp_relay['uplink_mac']),
463-
"testing_mode": testing_mode},
466+
"testing_mode": testing_mode,
467+
"kvm_support": True},
464468
log_file="/tmp/dhcp_relay_test.DHCPTest.log", is_python3=True)
465469

466470

@@ -495,7 +499,8 @@ def test_dhcp_relay_unicast_mac(ptfhost, dut_dhcp_relay_data, validate_dut_route
495499
"client_udp_src_port": DEFAULT_DHCP_CLIENT_PORT,
496500
"switch_loopback_ip": dhcp_relay['switch_loopback_ip'],
497501
"uplink_mac": str(dhcp_relay['uplink_mac']),
498-
"testing_mode": testing_mode},
502+
"testing_mode": testing_mode,
503+
"kvm_support": True},
499504
log_file="/tmp/dhcp_relay_test.DHCPTest.log", is_python3=True)
500505

501506

@@ -529,7 +534,8 @@ def test_dhcp_relay_random_sport(ptfhost, dut_dhcp_relay_data, validate_dut_rout
529534
"client_udp_src_port": RANDOM_CLIENT_PORT,
530535
"switch_loopback_ip": dhcp_relay['switch_loopback_ip'],
531536
"uplink_mac": str(dhcp_relay['uplink_mac']),
532-
"testing_mode": testing_mode},
537+
"testing_mode": testing_mode,
538+
"kvm_support": True},
533539
log_file="/tmp/dhcp_relay_test.DHCPTest.log", is_python3=True)
534540

535541

@@ -597,7 +603,8 @@ def test_dhcp_relay_counter(ptfhost, dut_dhcp_relay_data, validate_dut_routes_ex
597603
"client_udp_src_port": DEFAULT_DHCP_CLIENT_PORT,
598604
"switch_loopback_ip": dhcp_relay['switch_loopback_ip'],
599605
"uplink_mac": str(dhcp_relay['uplink_mac']),
600-
"testing_mode": testing_mode},
606+
"testing_mode": testing_mode,
607+
"kvm_support": True},
601608
log_file="/tmp/dhcp_relay_test_counter.DHCPTest.log", is_python3=True)
602609
for type in dhcp_message_types:
603610
if type in ["Discover", "Request"]:

tests/dhcp_relay/test_dhcp_relay_stress.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ def test_dhcp_relay_restart_with_stress(ptfhost, dut_dhcp_relay_data, validate_d
5555
"uplink_mac": str(dut_dhcp_relay_data[0]['uplink_mac']),
5656
"testing_mode": testing_mode,
5757
"duration": duration,
58-
"pps": pps},
58+
"pps": pps,
59+
"kvm_support": True},
5960
log_file="/tmp/dhcp_relay_stress_test.DHCPContinuousStressTest.log", is_python3=True,
6061
async_mode=True)
6162

@@ -95,7 +96,8 @@ def _check_socket_buffer():
9596
"client_udp_src_port": DEFAULT_DHCP_CLIENT_PORT,
9697
"switch_loopback_ip": dut_dhcp_relay_data[0]['switch_loopback_ip'],
9798
"uplink_mac": str(dut_dhcp_relay_data[0]['uplink_mac']),
98-
"testing_mode": testing_mode},
99+
"testing_mode": testing_mode,
100+
"kvm_support": True},
99101
log_file="/tmp/dhcp_relay_test.stress.DHCPTest.log", is_python3=True)
100102

101103

@@ -162,7 +164,8 @@ def test_dhcp_relay_stress(ptfhost, ptfadapter, dut_dhcp_relay_data, validate_du
162164
"uplink_mac": str(dhcp_relay['uplink_mac']),
163165
"packets_send_duration": packets_send_duration,
164166
"client_packets_per_sec": client_packets_per_sec,
165-
"testing_mode": testing_mode
167+
"testing_mode": testing_mode,
168+
"kvm_support": True
166169
}
167170
count_file = '/tmp/dhcp_stress_test_{}.json'.format(dhcp_type)
168171

tests/dhcp_relay/test_dhcpv6_relay.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ def test_dhcpv6_relay_counter(ptfhost, duthosts, rand_one_dut_hostname, dut_dhcp
324324
"dut_mac": str(dhcp_relay['uplink_mac']),
325325
"vlan_ip": str(dhcp_relay['downlink_vlan_iface']['addr']),
326326
"loopback_ipv6": str(dhcp_relay['loopback_ipv6']),
327-
"is_dualtor": str(dhcp_relay['is_dualtor'])},
327+
"is_dualtor": str(dhcp_relay['is_dualtor']),
328+
"kvm_support": True},
328329
log_file="/tmp/dhcpv6_relay_test.DHCPCounterTest.log", is_python3=True)
329330

330331
for type in message_types:

tests/fdb/test_fdb_flush.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ def dynamic_fdb_oper(self, duthost, tbinfo, ptfhost, create_or_clear):
324324
"router_mac": duthost.facts["router_mac"],
325325
"fdb_info": self.FDB_INFO_FILE,
326326
"dummy_mac_prefix": self.DUMMY_MAC_PREFIX,
327+
"kvm_support": True
327328
}
328329
self.__runPtfTest(ptfhost, "fdb_flush_test.FdbFlushTest", testParams)
329330
elif 'clear' == create_or_clear:

tests/fdb/test_fdb_mac_expire.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ def testFdbMacExpire(self, request, tbinfo, rand_selected_dut, ptfhost, refresh_
222222
"fdb_info": self.FDB_INFO_FILE,
223223
"dummy_mac_prefix": self.DUMMY_MAC_PREFIX,
224224
"refresh_type": refresh_type,
225-
"aging_time": fdbAgingTime
225+
"aging_time": fdbAgingTime,
226+
"kvm_support": True
226227
}
227228
self.__runPtfTest(ptfhost, "fdb_mac_expire_test.FdbMacExpireTest", testParams)
228229

tests/fdb/test_fdb_mac_learning.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ def dynamic_fdb_oper(self, duthost, tbinfo, ptfhost, dut_ptf_ports):
167167
"router_mac": duthost.facts["router_mac"],
168168
"dut_ptf_ports": dut_ptf_ports,
169169
"dummy_mac_prefix": self.DUMMY_MAC_PREFIX,
170+
"kvm_support": True
170171
}
171172
self.__runPtfTest(ptfhost, "fdb_mac_learning_test.FdbMacLearningTest", testParams)
172173

tests/ipfwd/test_mtu.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ def test_mtu(tbinfo, ptfhost, mtu, gather_facts):
3535
"src_router_ipv6": gather_facts['src_router_ipv6'],
3636
"dst_host_ipv6": gather_facts['dst_host_ipv6'],
3737
"src_ptf_port_list": gather_facts['src_port_ids'],
38-
"dst_ptf_port_list": gather_facts['dst_port_ids']
38+
"dst_ptf_port_list": gather_facts['dst_port_ids'],
39+
"kvm_support": True
3940
},
4041
log_file=log_file,
4142
socket_recv_size=16384,

tests/pc/test_lag_2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ def __verify_lag_lacp_timing(self, lacp_timer, exp_iface):
100100
'timeout': 35,
101101
'packet_timing': lacp_timer,
102102
'ether_type': 0x8809,
103-
'interval_count': 3
103+
'interval_count': 3,
104+
'kvm_support': True
104105
}
105106
ptf_runner(self.ptfhost, 'acstests', "lag_test.LacpTimingTest",
106107
'/root/ptftests', params=params, is_python3=True)

0 commit comments

Comments
 (0)