Commit 8321dfb0 authored by Harald Sitter's avatar Harald Sitter 💣

add test blob for internal smartctl timeout

this simply asserts that incomplete blobs (due to internal timeouts) are
correctly processed
parent 30abbd96
{
"json_format_version": [
1,
0
],
"smartctl": {
"version": [
7,
1
],
"svn_revision": "5022",
"platform_info": "x86_64-linux-5.9.3-1-MANJARO",
"build_info": "(local build)",
"argv": [
"smartctl",
"--all",
"--json",
"/dev/nvme0n1"
],
"messages": [
{
"string": "Read Error Information Log failed: NVME_IOCTL_ADMIN_CMD: Appel système interrompu",
"severity": "error"
}
],
"exit_status": 4
},
"device": {
"name": "/dev/nvme0n1",
"info_name": "/dev/nvme0n1",
"type": "nvme",
"protocol": "NVMe"
},
"model_name": "PC300 NVMe SK hynix 256GB",
"serial_number": "EJ77N46141180792O",
"firmware_version": "20005A00",
"nvme_pci_vendor": {
"id": 7260,
"subsystem_id": 7260
},
"nvme_ieee_oui_identifier": 11330606,
"nvme_controller_id": 0,
"nvme_number_of_namespaces": 1,
"nvme_namespaces": [
{
"id": 1,
"size": {
"blocks": 500118192,
"bytes": 256060514304
},
"capacity": {
"blocks": 500118192,
"bytes": 256060514304
},
"utilization": {
"blocks": 500118192,
"bytes": 256060514304
},
"formatted_lba_size": 512,
"eui64": {
"oui": 11330606,
"ext_id": 487747682236
}
}
],
"user_capacity": {
"blocks": 500118192,
"bytes": 256060514304
},
"logical_block_size": 512,
"local_time": {
"time_t": 1605000494,
"asctime": "Tue Nov 10 10:28:14 2020 CET"
},
"smart_status": {
"passed": true,
"nvme": {
"value": 0
}
},
"nvme_smart_health_information_log": {
"critical_warning": 0,
"temperature": 30,
"available_spare": 100,
"available_spare_threshold": 10,
"percentage_used": 2,
"data_units_read": 5188835,
"data_units_written": 21146267,
"host_reads": 66725315,
"host_writes": 282306897,
"controller_busy_time": 1018,
"power_cycles": 1826,
"power_on_hours": 158,
"unsafe_shutdowns": 112,
"media_errors": 0,
"num_err_log_entries": 218352,
"warning_temp_time": 0,
"critical_comp_time": 0,
"temperature_sensors": [
30
]
},
"temperature": {
"current": 30
},
"power_cycle_count": 1826,
"power_on_time": {
"hours": 158
}
}
SPDX-License-Identifier: CC0-1.0
SPDX-FileCopyrightText: none
......@@ -47,6 +47,18 @@ private Q_SLOTS:
QCOMPARE(data.m_device, "/dev/sdc");
QCOMPARE(data.m_status.m_passed, false);
}
void testTimeout()
{
// Query timed out but overall status is available and success.
// From https://bugs.kde.org/show_bug.cgi?id=428844
QFile file(QFINDTESTDATA("fixtures/error-info-log-failed.json"));
QVERIFY(file.open(QFile::ReadOnly));
auto doc = QJsonDocument::fromJson(file.readAll());
SMARTData data(doc);
QCOMPARE(data.m_device, "/dev/nvme0n1");
QCOMPARE(data.m_status.m_passed, true);
}
};
QTEST_MAIN(SMARTDataTest)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment