From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2FBD5A0471 for ; Thu, 15 Aug 2019 05:05:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E95051BE8F; Thu, 15 Aug 2019 05:05:37 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id ADBB91BE8E for ; Thu, 15 Aug 2019 05:05:35 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Aug 2019 20:05:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,387,1559545200"; d="scan'208";a="260697798" Received: from unknown (HELO dpdk-wenjielx-KVM193.icx.intel.com) ([10.240.176.193]) by orsmga001.jf.intel.com with ESMTP; 14 Aug 2019 20:05:33 -0700 From: Wenjie Li To: dts@dpdk.org Cc: Wenjie Li Date: Thu, 15 Aug 2019 12:00:28 +0000 Message-Id: <1565870428-29269-1-git-send-email-wenjiex.a.li@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH V1] tests/kni:del the ip before verify results 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" Remove the ip from tester before verify results; otehrwise, if the case is fail, the ip is still existing on tester. Signed-off-by: Wenjie Li --- tests/TestSuite_kni.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/TestSuite_kni.py b/tests/TestSuite_kni.py index f1f85df..630dcdd 100644 --- a/tests/TestSuite_kni.py +++ b/tests/TestSuite_kni.py @@ -579,20 +579,19 @@ class TestKni(TestCase): virtual_interface = self.virtual_interface_name(port) - out = self.dut.send_expect( + out1 = self.dut.send_expect( "ping -w 2 -I %s 192.168.%d.2" % (virtual_interface, port), "# ", 10) - self.verify("64 bytes from 192.168.%d.2:" % - port in out, "ping not supported") - - out = self.tester.send_expect( + out2 = self.tester.send_expect( "ping -w 1 -I %s 192.168.%d.1" % (tx_interface, port), "# ", 10) - self.verify("64 bytes from 192.168.%d.1:" % - port in out, "kni cannot reply ping packet") - - out = self.dut.send_expect( + out3 = self.dut.send_expect( "ping -w 1 -I %s 192.168.%d.123" % (virtual_interface, port), "# ", 10) - self.verify( - "0 received, 100% packet loss" in out, "ping not supported") + + # remove ip from tester + self.tester.send_expect("ip addr del 192.168.%d.2 dev %s" % (port, tx_interface), "# ") + + self.verify("64 bytes from 192.168.%d.2:" %port in out1, "ping not supported") + self.verify("64 bytes from 192.168.%d.1:" %port in out2, "kni cannot reply ping packet") + self.verify("0 received, 100% packet loss" in out3, "ping not supported") out = self.dut.send_expect( "ip -family inet6 address show dev %s | awk '/inet6/ { print $2 }'| cut -d'/' -f1" % virtual_interface, "# ", 10) -- 2.17.1