From af1a266670d040d2f4083ff309d732d648afba2a Mon Sep 17 00:00:00 2001
From: Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com>
Date: Tue, 10 Oct 2023 14:33:42 +0000
Subject: Add submodule dependency files

Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
---
 roms/u-boot/test/py/tests/test_dm.py | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 roms/u-boot/test/py/tests/test_dm.py

(limited to 'roms/u-boot/test/py/tests/test_dm.py')

diff --git a/roms/u-boot/test/py/tests/test_dm.py b/roms/u-boot/test/py/tests/test_dm.py
new file mode 100644
index 000000000..97203b536
--- /dev/null
+++ b/roms/u-boot/test/py/tests/test_dm.py
@@ -0,0 +1,35 @@
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (C) 2020 Sean Anderson
+
+import pytest
+
+@pytest.mark.buildconfigspec('cmd_dm')
+def test_dm_compat(u_boot_console):
+    """Test that each driver in `dm tree` is also listed in `dm compat`."""
+    response = u_boot_console.run_command('dm tree')
+    driver_index = response.find('Driver')
+    assert driver_index != -1
+    drivers = (line[driver_index:].split()[0]
+               for line in response[:-1].split('\n')[2:])
+
+    response = u_boot_console.run_command('dm compat')
+    for driver in drivers:
+        assert driver in response
+
+@pytest.mark.buildconfigspec('cmd_dm')
+def test_dm_drivers(u_boot_console):
+    """Test that each driver in `dm compat` is also listed in `dm drivers`."""
+    response = u_boot_console.run_command('dm compat')
+    drivers = (line[:20].rstrip() for line in response[:-1].split('\n')[2:])
+    response = u_boot_console.run_command('dm drivers')
+    for driver in drivers:
+        assert driver in response
+
+@pytest.mark.buildconfigspec('cmd_dm')
+def test_dm_static(u_boot_console):
+    """Test that each driver in `dm static` is also listed in `dm drivers`."""
+    response = u_boot_console.run_command('dm static')
+    drivers = (line[:25].rstrip() for line in response[:-1].split('\n')[2:])
+    response = u_boot_console.run_command('dm drivers')
+    for driver in drivers:
+        assert driver in response
-- 
cgit