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 B92BCA0353; Thu, 24 Feb 2022 08:42:54 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B48D94116A; Thu, 24 Feb 2022 08:42:54 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 0D9374117D for ; Thu, 24 Feb 2022 08:42:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645688573; x=1677224573; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VJiGB6hQgLBMOkHQRM6jWuXhx09RWTNAmfiBx4IxMhw=; b=hW4gc/axIwEBB5pP9BQCaP/5Y2Nb+P+Ykm8tMb1UEQtjg0pFupaarsPm /9zTfCxYMc4k1aLnXuovlY18QwMJEJq+c1c/mpR0jfZ8ViqriBEaIhTnU Z4lqW09UT9xPWLf0Jt7Bvgk3PBiAmC/9tiY520HU5xpEqOCId50X2QWxV SRUIt7rkoR0P3BoSSScjRJJD80Naazz63uSsViaho5hNmBrCkEW2BsZg7 40Ym/MR6wGdu7yDl7nIOXwOlyy3xOTGCnrNnqoHAZke+WF8EasIxt8V45 oziPvXPVahL+WYd9bTxrQc7n/Ax9S1fVBSd0E3CCuHEMfpC7D26Eq9fPL Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10267"; a="232793359" X-IronPort-AV: E=Sophos;i="5.88,393,1635231600"; d="scan'208";a="232793359" 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:52 -0800 X-IronPort-AV: E=Sophos;i="5.88,393,1635231600"; d="scan'208";a="639626973" 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:50 -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, 24 Feb 2022 15:42:21 +0000 Message-Id: <20220224154221.1516892-3-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 short_live: 1, use new method: is_interface_up to ensure iface's link status. 2, when launch example frequently, need wait for more than 0.5s to restart example after kill example abnormally. Signed-off-by: Yu Jiang --- tests/TestSuite_short_live.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/TestSuite_short_live.py b/tests/TestSuite_short_live.py index 1b8fbb94..556728b9 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) @@ -135,6 +136,8 @@ class TestShortLiveApp(TestCase): time.sleep(1) delay = delay + 1 else: + # need wait for 1s to restart example after kill example abnormally. + time.sleep(1) break self.verify(delay < delay_max, "Failed to kill the process within %s seconds" % delay_max) @@ -144,7 +147,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>") -- 2.25.1