From patchwork Thu Feb 10 16:32:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiang X-Patchwork-Id: 107218 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 840BDA034D; Thu, 10 Feb 2022 09:33:07 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7251B41176; Thu, 10 Feb 2022 09:33:07 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 7CB1240041 for ; Thu, 10 Feb 2022 09:33:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644481985; x=1676017985; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jDCqSjNixJMZQyOYJX/o7NLmuKv1qV4RGhA30cmFfeM=; b=RJi8n616sY8fWPgoy56J/Kj8RgTrrh5CIoRpXPbKx0cQMrMBU9daHCWO ilFz85aXuqsPe1jiOcxNZOHU6iJaw4S8c3rSDoJ8Kv9sBN/XkL9XCCPt6 tFGsFJIAn+DBoaxCk8J4ypyIi44SRr8fhdQwA/jEhby1kmBMwiwdHfPmN fVlarRd5ZSeRkGSNt3xs7YLUKM3UmntUPqTRpVzOfmBtNSVZ3Y8tZXZTJ n+xUQmeBJTvN43JfEQ05kenhtvg8DuQZnkaaKpjzOtD1obLCdn44XhtCq LWJ3xPuVeszdVcjKXtoJyMSEFTkHXs/Z0YZba523QEnaaMJ1UUoLX+NcD A==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="310180670" X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="310180670" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 00:33:05 -0800 X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="541515201" Received: from unknown (HELO localhost.localdomain) ([10.239.251.226]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 00:33:03 -0800 From: Yu Jiang To: lijuan.tu@intel.com, dts@dpdk.org Cc: Yu Jiang Subject: [dts][PATCH V1 1/2] tests/kni: wait for interface up Date: Thu, 10 Feb 2022 16:32:25 +0000 Message-Id: <20220210163226.2442488-2-yux.jiang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220210163226.2442488-1-yux.jiang@intel.com> References: <20220210163226.2442488-1-yux.jiang@intel.com> MIME-Version: 1.0 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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 use new method: is_interface_up/down to to ensure iface's link status. Signed-off-by: Yu Jiang --- tests/TestSuite_kni.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/TestSuite_kni.py b/tests/TestSuite_kni.py index c2b05bad..c2036625 100644 --- a/tests/TestSuite_kni.py +++ b/tests/TestSuite_kni.py @@ -687,7 +687,8 @@ class TestKni(TestCase): tx_interface = self.tester.get_interface(tx_port) self.dut.send_expect("ifconfig %s up" % virtual_interface, "# ") - time.sleep(5) + # ensure virtual_interface link up + self.verify(self.dut.is_interface_up(intf=virtual_interface), "Wrong link status, should be up") # Start tcpdump with filters for src and dst MAC address, this avoids # unwanted broadcast, ICPM6... packets out = self.dut.send_expect( @@ -733,7 +734,8 @@ class TestKni(TestCase): out = self.dut.send_expect( "ifconfig %s up" % virtual_interface, "# ") - time.sleep(5) + # ensure virtual_interface up + self.verify(self.dut.is_interface_up(intf=virtual_interface), "virtual_interface should be up") out = self.dut.send_expect("ifconfig %s" % virtual_interface, "# ") m = re.search(rx_match, out) previous_rx_packets = int(m.group(1)) @@ -751,6 +753,8 @@ class TestKni(TestCase): pkt = packet.Packet() pkt.update_pkt(scapy_str) + # ensure tester's interface up + self.verify(self.tester.is_interface_up(intf=tx_interface), "Tester's interface should be up") pkt.send_pkt(self.tester, tx_port=tx_interface, count=200) out = self.dut.send_expect("ifconfig %s" % virtual_interface, "# ") @@ -909,7 +913,6 @@ class TestKni(TestCase): self.verify("ERROR" not in out, "Device not found") self.dut.send_expect("ifconfig br_kni up", "# ") - time.sleep(3) tx_port = self.tester.get_local_port(self.config['ports'][0]) rx_port = self.tester.get_local_port(self.config['ports'][1]) @@ -919,7 +922,7 @@ class TestKni(TestCase): if step['flows'] == 2: tgenInput.append((rx_port, tx_port, pcap)) - time.sleep(1) + self.verify(self.dut.is_interface_up(intf="br_kni"), "br_kni should be up") # clear streams before add new streams self.tester.pktgen.clear_streams() @@ -975,7 +978,7 @@ class TestKni(TestCase): self.dut.send_expect("brctl addif br1 %s" % port_virtual_interaces[1], "# ") self.dut.send_expect("ifconfig br1 up", "# ") - time.sleep(3) + self.verify(self.dut.is_interface_up(intf='br1'), "Wrong link status, should be up") tx_port = self.tester.get_local_port(dut_ports[0]) rx_port = self.tester.get_local_port(dut_ports[1]) @@ -997,6 +1000,7 @@ class TestKni(TestCase): self.result_table_add([flows, float(pps) / 10 ** 6]) self.dut.send_expect("ifconfig br1 down", "# ") + self.verify(self.dut.is_interface_down(intf='br1'), "Wrong link status, should be down") self.dut.send_expect("brctl delbr \"br1\"", "# ", 30) for port in allow_list: From patchwork Thu Feb 10 16:32:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiang X-Patchwork-Id: 107219 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9EF10A034E; Thu, 10 Feb 2022 09:33:08 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9313441170; Thu, 10 Feb 2022 09:33:08 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 188E840041 for ; Thu, 10 Feb 2022 09:33:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644481987; x=1676017987; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OMv0L7QB0m36uh5uBxsA0VuKX3Rfsw1ZzMyyPqvJhTE=; b=DGOSMpb6Ck43uTi4aFz1wiAJxP+ihaSkFpWXKpT9jfRcxQZNVgBJCduo s7ULwTvyiqTID44vQFzypdqbLUTLwjKTJb0hE+jvau9DYvh/FNSpLE+QQ XxLcfQsisxSMtxQc5sKoNH2l5aY9TpihErMP2cMhniWwFPtcCOKpCkGc1 fa6FQDUXLi4tZBwf6pGxyCJv3vmVhNer38sRUsu33Sef9xFTxQ2+yp8Z2 TLtz7VBWaWzJvWn2sw+WrlHh6FaEiAk6t88dCM/v40AwKYPn8+Xly8h1H 8XoO3Lx1unchFP3THo3za2aOnGWeVIeTKyQKxTb6X1tmBL3+k0fjfhCLH A==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="310180671" X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="310180671" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 00:33:06 -0800 X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="541515209" Received: from unknown (HELO localhost.localdomain) ([10.239.251.226]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 00:33:05 -0800 From: Yu Jiang To: lijuan.tu@intel.com, dts@dpdk.org Cc: Yu Jiang Subject: [dts][PATCH V1 2/2] tests/short_live: wait for interface up Date: Thu, 10 Feb 2022 16:32:26 +0000 Message-Id: <20220210163226.2442488-3-yux.jiang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220210163226.2442488-1-yux.jiang@intel.com> References: <20220210163226.2442488-1-yux.jiang@intel.com> MIME-Version: 1.0 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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 use new method: is_interface_up/down to to ensure iface's link status. Signed-off-by: Yu Jiang --- tests/TestSuite_short_live.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/TestSuite_short_live.py b/tests/TestSuite_short_live.py index 1b8fbb94..0d090682 100644 --- a/tests/TestSuite_short_live.py +++ b/tests/TestSuite_short_live.py @@ -106,7 +106,8 @@ class TestShortLiveApp(TestCase): # rx and tx packet are list if (txPort == rxPort): count = 2 - + # ensure tester's link up + self.verify(self.tester.is_interface_up(intf=rxitf), "Wrong link status, should be up") filter_list = [{'layer': 'ether', 'config': {'type': 'not IPv6'}}, {'layer': 'userdefined', 'config': {'pcap-filter': 'not udp'}}] inst = self.tester.tcpdump_sniff_packets(rxitf, count=count,filters=filter_list) @@ -144,7 +145,6 @@ class TestShortLiveApp(TestCase): """ #dpdk start 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>") self.dut.send_expect("start", "testpmd>")