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 4A056A0C52; Wed, 24 Nov 2021 08:43:00 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 414EA40A4B; Wed, 24 Nov 2021 08:43:00 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 373C640688 for ; Wed, 24 Nov 2021 08:42:59 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10177"; a="233944984" X-IronPort-AV: E=Sophos;i="5.87,260,1631602800"; d="scan'208";a="233944984" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2021 23:42:58 -0800 X-IronPort-AV: E=Sophos;i="5.87,260,1631602800"; d="scan'208";a="509773966" Received: from unknown (HELO dpdk.lan) ([10.240.183.77]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2021 23:42:56 -0800 From: Lingli Chen To: dts@dpdk.org Cc: Lingli Chen Subject: [dts][PATCH V1] tests/kni:test ping add ip6 addr Date: Wed, 24 Nov 2021 15:43:38 +0000 Message-Id: <20211124154338.132083-1-linglix.chen@intel.com> X-Mailer: git-send-email 2.33.1 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 When the test environment has no IPv6 address, add it manually. Signed-off-by: Lingli Chen --- tests/TestSuite_kni.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/TestSuite_kni.py b/tests/TestSuite_kni.py index 85289d37..c2b05bad 100644 --- a/tests/TestSuite_kni.py +++ b/tests/TestSuite_kni.py @@ -611,6 +611,17 @@ class TestKni(TestCase): expected_str = "0 received, 100% packet loss" self.verify(all([expected_str in out, expected_str in out1]), "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) + out1 = self.tester.send_expect( + "ip -family inet6 address show dev %s | awk '/inet6/ { print $2 }'| cut -d'/' -f1" % tx_interface, + "# ", 10) + if out.strip()=='': + self.dut.send_expect("ip -6 addr add fe80::742e:c5ef:bb9:b4c8/64 dev %s" % virtual_interface, "# ", 3) + if out1.strip()=='': + self.tester.send_expect("ip -6 addr add fe80::742e:c5ef:bb9:b4c9/64 dev %s" % tx_interface, "# ", 3) + time.sleep(3) out = self.dut.send_expect( "ip -family inet6 address show dev %s | awk '/inet6/ { print $2 }'| cut -d'/' -f1" % virtual_interface, "# ", 10) ipv6_address = out.split('\r\n')[0] -- 2.33.1