From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 325A7F72 for ; Wed, 10 May 2017 08:47:54 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 May 2017 23:47:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,318,1491289200"; d="scan'208";a="1128505216" Received: from unknown (HELO dpdk-fedora20.icx.intel.com) ([10.240.176.135]) by orsmga001.jf.intel.com with ESMTP; 09 May 2017 23:47:52 -0700 From: Lijuan Tu To: dts@dpdk.org Cc: Lijuan Tu Date: Wed, 10 May 2017 14:49:16 +0800 Message-Id: <1494398956-39481-1-git-send-email-lijuanx.a.tu@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH V1]framework/tester: workaround random packet check issue. 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: , X-List-Received-Date: Wed, 10 May 2017 06:47:55 -0000 Random packet check maybe failed for received misc packets. Make a workaround of this issue. When the received-packet not in the sent-packets, continue to check next packet. Signed-off-by: Lijuan Tu --- framework/tester.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/framework/tester.py b/framework/tester.py index 5cf5e00..8f927ea 100644 --- a/framework/tester.py +++ b/framework/tester.py @@ -607,17 +607,21 @@ class Tester(Crb): recv_pkts = load_f(rx_inst[rxport]) # only report when recevied number not matched - if len(tx_pkts[txport]) != len(recv_pkts): - print "Pkt number not matched,%d sent and %d received\n" \ - % (len(tx_pkts[txport]), len(recv_pkts)) + if len(tx_pkts[txport]) > len(recv_pkts): + print ("Pkt number not matched,%d sent and %d received\n" \ + % (len(tx_pkts[txport]), len(recv_pkts))) + if allow_miss is False: return False # check each received packet content print GREEN("Comparing sniffed packets, please wait few minutes...") for idx in range(len(recv_pkts)): - l3_type = recv_pkts[idx].strip_element_layer2('type') - sip = recv_pkts[idx].strip_element_layer3('src') + try: + l3_type = recv_pkts[idx].strip_element_layer2('type') + sip = recv_pkts[idx].strip_element_layer3('src') + except: + continue # ipv4 packet if l3_type == 2048: t_idx = convert_ip2int(sip, 4) -- 1.9.3