From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 1973FA05D3 for ; Thu, 23 May 2019 03:19:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C1FB8A49; Thu, 23 May 2019 03:19:06 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 6E10F9E4 for ; Thu, 23 May 2019 03:19:05 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 May 2019 18:19:03 -0700 X-ExtLoop1: 1 Received: from ubuntu.sh.intel.com ([10.67.118.150]) by fmsmga004.fm.intel.com with ESMTP; 22 May 2019 18:19:03 -0700 From: lihong To: dts@dpdk.org Cc: lihong Date: Thu, 23 May 2019 01:58:31 +0800 Message-Id: <1558547911-3295-1-git-send-email-lihongx.ma@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dts] [PATCH V1] tests/pmd_bonded: get the primary slave port before send packet X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" 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 --- 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