test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts][PATCH V1] tests/kni:test ping add ip6 addr
@ 2021-11-24 15:43 Lingli Chen
  0 siblings, 0 replies; only message in thread
From: Lingli Chen @ 2021-11-24 15:43 UTC (permalink / raw)
  To: dts; +Cc: Lingli Chen

When the test environment has no IPv6 address, add it manually.

Signed-off-by: Lingli Chen <linglix.chen@intel.com>
---
 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-24  7:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-24 15:43 [dts][PATCH V1] tests/kni:test ping add ip6 addr Lingli Chen

test suite reviews and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ http://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git