blob: 844cd3d9367c9614731b027174241a928de5bf30 [file] [log] [blame]
Asherah Connorab1975b2021-03-19 18:21:41 +11001# SPDX-License-Identifier: GPL-2.0+
2# Copyright (c) 2021, Asherah Connor <ashe@kivikakk.ee>
3
4# Test qfw command implementation
5
6import pytest
7
8@pytest.mark.buildconfigspec('cmd_qfw')
Simon Glassddba5202025-02-09 09:07:14 -07009def test_qfw_cpus(ubman):
Asherah Connorab1975b2021-03-19 18:21:41 +110010 "Test QEMU firmware config reports the CPU count."
11
Simon Glassddba5202025-02-09 09:07:14 -070012 output = ubman.run_command('qfw cpus')
Asherah Connorab1975b2021-03-19 18:21:41 +110013 # The actual number varies depending on the board under test, so only
14 # assert a non-zero output.
15 assert 'cpu(s) online' in output
16 assert '0 cpu(s) online' not in output
17
18@pytest.mark.buildconfigspec('cmd_qfw')
Simon Glassddba5202025-02-09 09:07:14 -070019def test_qfw_list(ubman):
Asherah Connorab1975b2021-03-19 18:21:41 +110020 "Test QEMU firmware config lists devices."
21
Simon Glassddba5202025-02-09 09:07:14 -070022 output = ubman.run_command('qfw list')
Asherah Connorab1975b2021-03-19 18:21:41 +110023 # Assert either:
24 # 1) 'test-one', from the sandbox driver, or
25 # 2) 'bootorder', found in every real QEMU implementation.
26 assert ("bootorder" in output) or ("test-one" in output)