test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH] Add link status check test
@ 2020-04-23 13:32 Brandon Lo
  2020-04-24  5:17 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: Brandon Lo @ 2020-04-23 13:32 UTC (permalink / raw)
  To: dts

[-- Attachment #1: Type: text/plain, Size: 3717 bytes --]

This is a simple test meant to check whether or not the
link status changes when we set the link down/up.

Signed-off-by: Brandon Lo <blo@iol.unh.edu>
---
 test_plans/link_status_test_plan.rst | 48 +++++++++++++++++++++
 tests/TestSuite_link_status.py       | 63 ++++++++++++++++++++++++++++
 2 files changed, 111 insertions(+)
 create mode 100644 test_plans/link_status_test_plan.rst
 create mode 100644 tests/TestSuite_link_status.py

diff --git a/test_plans/link_status_test_plan.rst
b/test_plans/link_status_test_plan.rst
new file mode 100644
index 0000000..2d92a68
--- /dev/null
+++ b/test_plans/link_status_test_plan.rst
@@ -0,0 +1,48 @@
+=============================================
+Link Status Check
+=============================================
+
+This check will use testpmd to test whether or not a link can be set as
+down/up and appear as the set status.
+
+
+Prerequisites
+=============
+
+Compile DPDK and testpmd. Be able to have the testpmd run.
+
+Test Case: set links as down
+==========================================
+
+Run testpmd in interactive mode ::
+
+  $ ./dpdk-testpmd -- -i
+
+This can be run with other arguments as well, depending on your setup.
+
+Run this command in testpmd ::
+
+  testpmd> set link-down port 0
+
+Verify the output matches with the port being down ::
+
+  testpmd> show port summary 0
+
+
+Test Case: set links as up
+===========================================
+
+Run testpmd in interactive mode ::
+
+  $ ./dpdk-testpmd -- -i
+
+This can be run with other arguments as well, depending on your setup.
+
+Run this command in testpmd ::
+
+  testpmd> set link-up port 0
+
+Verify the output matches with the port being up ::
+
+  testpmd> show port summary 0
+
diff --git a/tests/TestSuite_link_status.py b/tests/TestSuite_link_status.py
new file mode 100644
index 0000000..0172000
--- /dev/null
+++ b/tests/TestSuite_link_status.py
@@ -0,0 +1,63 @@
+"""
+DPDK Test suite.
+Testing link status in testpmd
+"""
+
+import utils
+import time
+from test_case import TestCase
+from pmd_output import PmdOutput
+
+class TestLinkStatus(TestCase):
+
+    def set_up_all(self):
+        """
+        Run at the start of each test suite.
+        """
+        self.dut.build_install_dpdk(self.target)
+        self.pmdout = PmdOutput(self.dut)
+        self.pmdout.start_testpmd()
+        self.dut_ports = self.dut.get_ports()
+
+    def set_up(self):
+        """
+        Run before each test case.
+        Nothing to do.
+        """
+        pass
+
+    def test_link_down(self):
+        """
+        Run set link-down on ports and check if they are down in summary.
+        """
+        for port in self.dut_ports:
+            self.dut.send_command('set link-down port {}'.format(port))
+            time.sleep(5)
+            self.dut.send_command('show port summary {}'.format(port))
+            self.verify('down' in self.dut.session.history[-1]['output'],
+                    'Link down for port {}'.format(port))
+
+    def test_link_up(self):
+        """
+        Run set link-up on ports and check if they are up in summary.
+        """
+        for port in self.dut_ports:
+            self.dut.send_command('set link-up port {}'.format(port))
+            time.sleep(5)
+            self.dut.send_command('show port summary {}'.format(port))
+            self.verify('up' in self.dut.session.history[-1]['output'],
+                    'Link up for port {}'.format(port))
+
+    def tear_down(self):
+        """
+        Run after each test case.
+        Nothing to do.
+        """
+        pass
+
+    def tear_down_all(self):
+        """
+        Quit out of testpmd
+        """
+        self.dut.send_expect("quit", "# ", 30)
+
-- 
2.17.1

[-- Attachment #2: Type: text/html, Size: 5078 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dts] [PATCH] Add link status check test
  2020-04-23 13:32 [dts] [PATCH] Add link status check test Brandon Lo
@ 2020-04-24  5:17 ` Tu, Lijuan
  0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2020-04-24  5:17 UTC (permalink / raw)
  To: Brandon Lo, dts

[-- Attachment #1: Type: text/plain, Size: 4272 bytes --]

Hi Brandon,

This case is already in dts, test_plans/shutdown_api_test_plan.rst  and tests/TestSuite_shutdown_api.py

And I think the current case is more strict, because it will check the stream when link is up.

From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Brandon Lo
Sent: Thursday, April 23, 2020 9:32 PM
To: dts@dpdk.org
Subject: [dts] [PATCH] Add link status check test

This is a simple test meant to check whether or not the
link status changes when we set the link down/up.

Signed-off-by: Brandon Lo <blo@iol.unh.edu<mailto:blo@iol.unh.edu>>
---
 test_plans/link_status_test_plan.rst | 48 +++++++++++++++++++++
 tests/TestSuite_link_status.py       | 63 ++++++++++++++++++++++++++++
 2 files changed, 111 insertions(+)
 create mode 100644 test_plans/link_status_test_plan.rst
 create mode 100644 tests/TestSuite_link_status.py

diff --git a/test_plans/link_status_test_plan.rst b/test_plans/link_status_test_plan.rst
new file mode 100644
index 0000000..2d92a68
--- /dev/null
+++ b/test_plans/link_status_test_plan.rst
@@ -0,0 +1,48 @@
+=============================================
+Link Status Check
+=============================================
+
+This check will use testpmd to test whether or not a link can be set as
+down/up and appear as the set status.
+
+
+Prerequisites
+=============
+
+Compile DPDK and testpmd. Be able to have the testpmd run.
+
+Test Case: set links as down
+==========================================
+
+Run testpmd in interactive mode ::
+
+  $ ./dpdk-testpmd -- -i
+
+This can be run with other arguments as well, depending on your setup.
+
+Run this command in testpmd ::
+
+  testpmd> set link-down port 0
+
+Verify the output matches with the port being down ::
+
+  testpmd> show port summary 0
+
+
+Test Case: set links as up
+===========================================
+
+Run testpmd in interactive mode ::
+
+  $ ./dpdk-testpmd -- -i
+
+This can be run with other arguments as well, depending on your setup.
+
+Run this command in testpmd ::
+
+  testpmd> set link-up port 0
+
+Verify the output matches with the port being up ::
+
+  testpmd> show port summary 0
+
diff --git a/tests/TestSuite_link_status.py b/tests/TestSuite_link_status.py
new file mode 100644
index 0000000..0172000
--- /dev/null
+++ b/tests/TestSuite_link_status.py
@@ -0,0 +1,63 @@
+"""
+DPDK Test suite.
+Testing link status in testpmd
+"""
+
+import utils
+import time
+from test_case import TestCase
+from pmd_output import PmdOutput
+
+class TestLinkStatus(TestCase):
+
+    def set_up_all(self):
+        """
+        Run at the start of each test suite.
+        """
+        self.dut.build_install_dpdk(self.target)
+        self.pmdout = PmdOutput(self.dut)
+        self.pmdout.start_testpmd()
+        self.dut_ports = self.dut.get_ports()
+
+    def set_up(self):
+        """
+        Run before each test case.
+        Nothing to do.
+        """
+        pass
+
+    def test_link_down(self):
+        """
+        Run set link-down on ports and check if they are down in summary.
+        """
+        for port in self.dut_ports:
+            self.dut.send_command('set link-down port {}'.format(port))
+            time.sleep(5)
+            self.dut.send_command('show port summary {}'.format(port))
+            self.verify('down' in self.dut.session.history[-1]['output'],
+                    'Link down for port {}'.format(port))
+
+    def test_link_up(self):
+        """
+        Run set link-up on ports and check if they are up in summary.
+        """
+        for port in self.dut_ports:
+            self.dut.send_command('set link-up port {}'.format(port))
+            time.sleep(5)
+            self.dut.send_command('show port summary {}'.format(port))
+            self.verify('up' in self.dut.session.history[-1]['output'],
+                    'Link up for port {}'.format(port))
+
+    def tear_down(self):
+        """
+        Run after each test case.
+        Nothing to do.
+        """
+        pass
+
+    def tear_down_all(self):
+        """
+        Quit out of testpmd
+        """
+        self.dut.send_expect("quit", "# ", 30)
+
--
2.17.1

[-- Attachment #2: Type: text/html, Size: 9965 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-24  5:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-23 13:32 [dts] [PATCH] Add link status check test Brandon Lo
2020-04-24  5:17 ` Tu, Lijuan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).