[dts] [PATCH V1] tests/pmd_bonded: get the primary slave port before send packet
Zhu, WenhuiX
wenhuix.zhu at intel.com
Thu May 23 05:06:34 CEST 2019
Tested-by: Zhu, WenhuiX <wenhuix.zhu at intel.com>
-----Original Message-----
From: dts [mailto:dts-bounces at dpdk.org] On Behalf Of lihong
Sent: Thursday, May 23, 2019 1:59 AM
To: dts at dpdk.org
Cc: Ma, LihongX <lihongx.ma at intel.com>
Subject: [dts] [PATCH V1] tests/pmd_bonded: get the primary slave port before send packet
When bonding mode is 5, after set the promisc off on bond port, the primary slave port should also change to promisc off, so should get the primary port before send packet to verify it.
Signed-off-by: lihong <lihongx.ma at intel.com>
---
tests/TestSuite_pmd_bonded.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tests/TestSuite_pmd_bonded.py b/tests/TestSuite_pmd_bonded.py index 78d5d21..9ae6d32 100644
--- a/tests/TestSuite_pmd_bonded.py
+++ b/tests/TestSuite_pmd_bonded.py
@@ -965,6 +965,7 @@ UDP(sport=srcport, dport=destport)/Raw(load="\x50"*%s)], iface="%s", count=%d)'
slaves = {}
slaves['active'] = [self.dut_ports[0]]
slaves['inactive'] = []
+ curr_primary = self.dut_ports[0]
pkt_now, summary = self.send_customized_packet_to_slave(unbound_port, bond_port, *pkt_info, **slaves)
if mode_set == MODE_LACP:
@@ -997,6 +998,8 @@ UDP(sport=srcport, dport=destport)/Raw(load="\x50"*%s)], iface="%s", count=%d)'
self.verify(port_disabled_num == 2,
"Not only the primary slave turn promiscous mode off in mode %d, " % mode_set +
" when bonded device promiscous disabled.")
+ curr_primary = int(self.get_bond_primary(bond_port))
+ slaves['active'] = [curr_primary]
if mode_set != MODE_LACP:
send_param['verify'] = True @@ -1011,7 +1014,7 @@ UDP(sport=srcport, dport=destport)/Raw(load="\x50"*%s)], iface="%s", count=%d)'
pkt_size == LACP_MESSAGE_SIZE,
"Data received by slave or bonding device when promiscuous disabled")
else:
- self.verify(pkt_now[self.dut_ports[0]][0] == 0 and
+ self.verify(pkt_now[curr_primary][0] == 0 and
pkt_now[bond_port][0] == 0,
"Data received by slave or bonding device when promiscuous disabled")
@@ -1026,7 +1029,7 @@ UDP(sport=srcport, dport=destport)/Raw(load="\x50"*%s)], iface="%s", count=%d)'
pkt_size != LACP_MESSAGE_SIZE,
"RX or TX packet number not correct when promiscuous disabled")
else:
- self.verify(pkt_now[self.dut_ports[0]][0] == pkt_now[bond_port][0] and
+ self.verify(pkt_now[curr_primary][0] ==
+ pkt_now[bond_port][0] and
pkt_now[self.dut_ports[3]][0] == pkt_now[bond_port][0] and
pkt_now[bond_port][0] == pkt_count,
"RX or TX packet number not correct when promiscuous disabled")
--
2.7.4
More information about the dts
mailing list