]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
test/py: Add basic mii and mdio tests
authorMichal Simek <michal.simek@xilinx.com>
Fri, 6 May 2016 11:30:48 +0000 (13:30 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Fri, 15 Jul 2016 07:04:59 +0000 (09:04 +0200)
Add simple mii and mdio testing functions.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
test/py/tests/test_mdio.py [new file with mode: 0644]
test/py/tests/test_mii.py [new file with mode: 0644]

diff --git a/test/py/tests/test_mdio.py b/test/py/tests/test_mdio.py
new file mode 100644 (file)
index 0000000..493157a
--- /dev/null
@@ -0,0 +1,11 @@
+# Copyright (c) 2016, Xilinx Inc. Michal Simek
+#
+# SPDX-License-Identifier: GPL-2.0
+
+import pytest
+
+@pytest.mark.buildconfigspec("cmd_mdio")
+def test_mii_list(u_boot_console):
+    expected_response = "<-->"
+    response = u_boot_console.run_command("mdio list")
+    assert(expected_response in response)
diff --git a/test/py/tests/test_mii.py b/test/py/tests/test_mii.py
new file mode 100644 (file)
index 0000000..718dda0
--- /dev/null
@@ -0,0 +1,17 @@
+# Copyright (c) 2016, Xilinx Inc. Michal Simek
+#
+# SPDX-License-Identifier: GPL-2.0
+
+import pytest
+
+@pytest.mark.buildconfigspec("cmd_mii")
+def test_mii_info(u_boot_console):
+    expected_response = "PHY"
+    response = u_boot_console.run_command("mii info")
+    assert(expected_response in response)
+
+@pytest.mark.buildconfigspec("cmd_mii")
+def test_mii_list(u_boot_console):
+    expected_response = "Current device"
+    response = u_boot_console.run_command("mii device")
+    assert(expected_response in response)