@@ -120,6 +120,7 @@ class Dut(Crb):
:return: eal_str eg:'-c 0xf -a 0000:88:00.0 -a 0000:88:00.1 --file-prefix=dpdk_1112_20190809143420',
if dpdk version < 20.11-rc4, eal_str eg: '-c 0xf -w 0000:88:00.0 --file-prefix=dpdk_1112_20190809143420',
"""
+ self.prefix_subfix = str(os.getpid()) + '_' + time.strftime("%Y%m%d%H%M%S", time.localtime())
default_cores = '1S/2C/1T'
blank = ' '
os_type = self.get_os_type()
@@ -663,8 +663,10 @@ class TestKni(TestCase):
# Ports and cores configuration set in set_up_all function
self.dut.kill_all()
self.start_kni()
- for port in self.config['ports']:
+ file_name='packet.log'
+ for port in self.config['ports']:
+ self.dut.send_expect(f"rm -rf {file_name}","#")
virtual_interface = self.virtual_interface_name(port)
tx_port = self.tester.get_local_port(port)
@@ -674,12 +676,11 @@ class TestKni(TestCase):
self.dut.send_expect("ifconfig %s up" % virtual_interface, "# ")
time.sleep(5)
-
# Start tcpdump with filters for src and dst MAC address, this avoids
# unwanted broadcast, ICPM6... packets
out = self.dut.send_expect(
- 'tcpdump -i %s -e -w packet.log "ether src %s and ether dst %s"' %
- (virtual_interface, tx_mac, rx_mac),
+ 'tcpdump -i %s -e -w %s "ether src %s and ether dst %s"' %
+ (virtual_interface,file_name, tx_mac, rx_mac),
"listening on %s" % virtual_interface, 30)
packets_to_send = [
@@ -67,7 +67,7 @@ class TestShortLiveApp(TestCase):
self.app_l2fwd_path = self.dut.apps_name['l2fwd']
self.app_l3fwd_path = self.dut.apps_name['l3fwd']
self.app_testpmd = self.dut.apps_name['test-pmd']
- self.eal_para = self.dut.create_eal_parameters()
+ self.eal_para = self.dut.create_eal_parameters
def set_up(self):
"""
@@ -142,7 +142,7 @@ class TestShortLiveApp(TestCase):
Basic rx/tx forwarding test
"""
#dpdk start
- self.dut.send_expect("./%s %s -- -i --portmask=0x3" % (self.app_testpmd, self.eal_para), "testpmd>", 120)
+ self.dut.send_expect("./%s %s -- -i --portmask=0x3" % (self.app_testpmd, self.eal_para()), "testpmd>", 120)
time.sleep(5)
self.dut.send_expect("set fwd mac", "testpmd>")
self.dut.send_expect("set promisc all off", "testpmd>")
@@ -175,7 +175,7 @@ class TestShortLiveApp(TestCase):
for i in range(repeat_time):
#dpdk start
print("clean_up_with_signal_testpmd round %d" % (i + 1))
- self.dut.send_expect("./%s %s -- -i --portmask=0x3" % (self.app_testpmd, self.eal_para), "testpmd>", 120)
+ self.dut.send_expect("./%s %s -- -i --portmask=0x3" % (self.app_testpmd, self.eal_para()), "testpmd>", 120)
self.dut.send_expect("set fwd mac", "testpmd>")
self.dut.send_expect("set promisc all off", "testpmd>")
self.dut.send_expect("start", "testpmd>")
@@ -200,7 +200,7 @@ class TestShortLiveApp(TestCase):
for i in range(repeat_time):
#dpdk start
print("clean_up_with_signal_l2fwd round %d" % (i + 1))
- self.dut.send_expect("%s %s -- -p 0x3 &" % (self.app_l2fwd_path, self.eal_para), "L2FWD: entering main loop", 60)
+ self.dut.send_expect("%s %s -- -p 0x3 &" % (self.app_l2fwd_path, self.eal_para()), "L2FWD: entering main loop", 60)
self.check_forwarding([0, 1], self.nic)
# kill with different Signal
@@ -216,7 +216,7 @@ class TestShortLiveApp(TestCase):
for i in range(repeat_time):
#dpdk start
print("clean_up_with_signal_l3fwd round %d" % (i + 1))
- self.dut.send_expect("%s %s -- -p 0x3 --config='(0,0,1),(1,0,2)' &" % (self.app_l3fwd_path, self.eal_para), "L3FWD: entering main loop", 120)
+ self.dut.send_expect("%s %s -- -p 0x3 --config='(0,0,1),(1,0,2)' &" % (self.app_l3fwd_path, self.eal_para()), "L3FWD: entering main loop", 120)
self.check_forwarding([0, 0], self.nic)
# kill with different Signal