diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/dm/sysinfo.c | 6 | ||||
-rw-r--r-- | test/py/tests/test_smbios.py | 18 |
2 files changed, 23 insertions, 1 deletions
diff --git a/test/dm/sysinfo.c b/test/dm/sysinfo.c index 6c0d2d7e4df..14ebe6b42e7 100644 --- a/test/dm/sysinfo.c +++ b/test/dm/sysinfo.c @@ -19,6 +19,9 @@ static int dm_test_sysinfo(struct unit_test_state *uts) bool called_detect = false; char str[64]; int i; + void *data = NULL; + size_t data_size = 0; + u32 gdata[] = {0xabcdabcd, 0xdeadbeef}; ut_assertok(sysinfo_get(&sysinfo)); ut_assert(sysinfo); @@ -57,6 +60,9 @@ static int dm_test_sysinfo(struct unit_test_state *uts) str)); ut_assertok(strcmp(str, "Yuggoth")); + ut_assertok(sysinfo_get_data(sysinfo, DATA_TEST, &data, &data_size)); + ut_assertok(memcmp(gdata, data, data_size)); + return 0; } DM_TEST(dm_test_sysinfo, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/py/tests/test_smbios.py b/test/py/tests/test_smbios.py index 82b0b689830..0405a9b9d38 100644 --- a/test/py/tests/test_smbios.py +++ b/test/py/tests/test_smbios.py @@ -32,10 +32,26 @@ def test_cmd_smbios_sandbox(u_boot_console): """Run the smbios command on the sandbox""" output = u_boot_console.run_command('smbios') assert 'DMI type 0,' in output - assert 'String 1: U-Boot' in output + assert 'Vendor: U-Boot' in output assert 'DMI type 1,' in output assert 'Manufacturer: sandbox' in output assert 'DMI type 2,' in output assert 'DMI type 3,' in output assert 'DMI type 4,' in output assert 'DMI type 127,' in output + +@pytest.mark.buildconfigspec('cmd_smbios') +@pytest.mark.buildconfigspec('sysinfo_smbios') +@pytest.mark.buildconfigspec('generate_smbios_table_verbose') +def test_cmd_smbios_sysinfo_verbose(u_boot_console): + """Run the smbios command""" + output = u_boot_console.run_command('smbios') + assert 'DMI type 0,' in output + assert 'Vendor: U-Boot' in output + assert 'DMI type 1,' in output + assert 'Manufacturer: linux' in output + assert 'DMI type 2,' in output + assert 'DMI type 3,' in output + assert 'DMI type 7,' in output + assert 'DMI type 4,' in output + assert 'DMI type 127,' in output |