blob: 0405a9b9d385cc5731b6f3ecf097ba4d223d4f80 [file] [log] [blame]
Heinrich Schuchardtdd604692024-01-25 16:54:36 +01001# SPDX-License-Identifier: GPL-2.0-or-later
2
3"""Test smbios command"""
4
5import pytest
6
7@pytest.mark.buildconfigspec('cmd_smbios')
8@pytest.mark.notbuildconfigspec('qfw_smbios')
9@pytest.mark.notbuildconfigspec('sandbox')
10def test_cmd_smbios(u_boot_console):
11 """Run the smbios command"""
12 output = u_boot_console.run_command('smbios')
13 assert 'DMI type 127,' in output
14
15@pytest.mark.buildconfigspec('cmd_smbios')
16@pytest.mark.buildconfigspec('qfw_smbios')
17@pytest.mark.notbuildconfigspec('sandbox')
18# TODO:
19# QEMU v8.2.0 lacks SMBIOS support for RISC-V
20# Once support is available in our Docker image we can remove the constraint.
21@pytest.mark.notbuildconfigspec('riscv')
22def test_cmd_smbios_qemu(u_boot_console):
23 """Run the smbios command on QEMU"""
24 output = u_boot_console.run_command('smbios')
25 assert 'DMI type 1,' in output
26 assert 'Manufacturer: QEMU' in output
27 assert 'DMI type 127,' in output
28
29@pytest.mark.buildconfigspec('cmd_smbios')
30@pytest.mark.buildconfigspec('sandbox')
31def test_cmd_smbios_sandbox(u_boot_console):
32 """Run the smbios command on the sandbox"""
33 output = u_boot_console.run_command('smbios')
34 assert 'DMI type 0,' in output
Raymond Mao6a125b32024-12-06 14:54:26 -080035 assert 'Vendor: U-Boot' in output
Heinrich Schuchardtdd604692024-01-25 16:54:36 +010036 assert 'DMI type 1,' in output
37 assert 'Manufacturer: sandbox' in output
38 assert 'DMI type 2,' in output
39 assert 'DMI type 3,' in output
40 assert 'DMI type 4,' in output
41 assert 'DMI type 127,' in output
Raymond Mao6a125b32024-12-06 14:54:26 -080042
43@pytest.mark.buildconfigspec('cmd_smbios')
44@pytest.mark.buildconfigspec('sysinfo_smbios')
45@pytest.mark.buildconfigspec('generate_smbios_table_verbose')
46def test_cmd_smbios_sysinfo_verbose(u_boot_console):
47 """Run the smbios command"""
48 output = u_boot_console.run_command('smbios')
49 assert 'DMI type 0,' in output
50 assert 'Vendor: U-Boot' in output
51 assert 'DMI type 1,' in output
52 assert 'Manufacturer: linux' in output
53 assert 'DMI type 2,' in output
54 assert 'DMI type 3,' in output
55 assert 'DMI type 7,' in output
56 assert 'DMI type 4,' in output
57 assert 'DMI type 127,' in output