blob: f6fbf8ba4c5b0b9c85d40b555c0cd4af51fc74d7 [file] [log] [blame]
Sean Anderson97c7ac22020-04-06 10:23:09 -04001# SPDX-License-Identifier: GPL-2.0
2# Copyright (C) 2020 Sean Anderson
3
4import pytest
5
6@pytest.mark.buildconfigspec('cmd_dm')
7def test_dm_drivers(u_boot_console):
8 """Test that each driver in `dm tree` is also listed in `dm drivers`."""
9 response = u_boot_console.run_command('dm tree')
10 driver_index = response.find('Driver')
11 assert driver_index != -1
12 drivers = (line[driver_index:].split()[0]
13 for line in response[:-1].split('\n')[2:])
14
15 response = u_boot_console.run_command('dm drivers')
16 for driver in drivers:
17 assert driver in response