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