test_qfw.py 882 B

1234567891011121314151617181920212223242526
  1. # SPDX-License-Identifier: GPL-2.0+
  2. # Copyright (c) 2021, Asherah Connor <ashe@kivikakk.ee>
  3. # Test qfw command implementation
  4. import pytest
  5. @pytest.mark.buildconfigspec('cmd_qfw')
  6. def test_qfw_cpus(u_boot_console):
  7. "Test QEMU firmware config reports the CPU count."
  8. output = u_boot_console.run_command('qfw cpus')
  9. # The actual number varies depending on the board under test, so only
  10. # assert a non-zero output.
  11. assert 'cpu(s) online' in output
  12. assert '0 cpu(s) online' not in output
  13. @pytest.mark.buildconfigspec('cmd_qfw')
  14. def test_qfw_list(u_boot_console):
  15. "Test QEMU firmware config lists devices."
  16. output = u_boot_console.run_command('qfw list')
  17. # Assert either:
  18. # 1) 'test-one', from the sandbox driver, or
  19. # 2) 'bootorder', found in every real QEMU implementation.
  20. assert ("bootorder" in output) or ("test-one" in output)