Sean Anderson | 97c7ac2 | 2020-04-06 10:23:09 -0400 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | # Copyright (C) 2020 Sean Anderson |
| 3 | |
| 4 | import pytest |
| 5 | |
| 6 | @pytest.mark.buildconfigspec('cmd_dm') |
| 7 | def 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 |