From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A4CFBA04A2; Thu, 24 Feb 2022 08:42:52 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 963E641155; Thu, 24 Feb 2022 08:42:52 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 2DC724114D for ; Thu, 24 Feb 2022 08:42:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645688571; x=1677224571; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yaN/wbajjwheMxo0cuaqMxw+e0O3yg6IyCHRi7rSPFY=; b=BAH9QMuFajJKsO7XBJYBTnzjqtkylh2+PSY5bZ/ZxyKILLAJl9cHQfPW letiUFPh4f6m0j+HVVTy+XL81IlfJmjpUqxWjOsDiFxG1ba+s7xhLeqPM 2ww91HtPx6DqVmIGz4p28g+pnJdRi23wDlflR2bZxkvOF7UR8VC1c9slv urX0Mtm6VALxew2DFVwhvLY7fUdl1nAnd/jkr7BleXgpQisXYU8JZ2xu0 xW/49uV2Kxm2S94pOmo7dsxws6jmqZovbREOmUYGz9k2TX98f5z7ogb6V 0cZ0gMZkLsQ8xfy/154El50sg+1lnqMaSTDhMlFp58CMLFbAIp4WEF0RR A==; X-IronPort-AV: E=McAfee;i="6200,9189,10267"; a="232793351" X-IronPort-AV: E=Sophos;i="5.88,393,1635231600"; d="scan'208";a="232793351" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2022 23:42:50 -0800 X-IronPort-AV: E=Sophos;i="5.88,393,1635231600"; d="scan'208";a="639626965" Received: from unknown (HELO localhost.localdomain) ([10.239.251.226]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2022 23:42:49 -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, 24 Feb 2022 15:42:20 +0000 Message-Id: <20220224154221.1516892-2-yux.jiang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220224154221.1516892-1-yux.jiang@intel.com> References: <20220224154221.1516892-1-yux.jiang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 optimize script kni, use new method: is_interface_up to ensure iface's link status. Signed-off-by: Yu Jiang --- tests/TestSuite_kni.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/TestSuite_kni.py b/tests/TestSuite_kni.py index c2b05bad..a3655ecf 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() -- 2.25.1