diff --git a/src/applib/selftest.cpp b/src/applib/selftest.cpp index aa7b6a6..21e7a02 100644 --- a/src/applib/selftest.cpp +++ b/src/applib/selftest.cpp @@ -167,8 +167,11 @@ bool SelfTest::is_supported() const return false; // not supported by nvme case TestType::ShortTest: case TestType::LongTest: - // NVMe spec - return true; + { + // Both short and long should be supported if the drive has a self-test log + const StorageProperty p = drive_->get_property_repository().lookup_property("nvme_self_test_log/_tests_supported"); + return (!p.empty() && p.get_value()); + } } } else if (drive_->get_detected_type() == StorageDeviceDetectedType::AtaAny diff --git a/src/applib/smartctl_json_nvme_parser.cpp b/src/applib/smartctl_json_nvme_parser.cpp index 5416d5a..220727c 100644 --- a/src/applib/smartctl_json_nvme_parser.cpp +++ b/src/applib/smartctl_json_nvme_parser.cpp @@ -384,6 +384,17 @@ hz::ExpectedVoid SmartctlJsonNvmeParser::parse_section_self bool section_properties_found = false; + // If nvme_self_test_log is present, the drive supports tests + { + StorageProperty p; + p.set_name("nvme_self_test_log/_tests_supported", "nvme_self_test_log/_tests_supported", _("Self-tests supported")); + p.section = StoragePropertySection::SelftestLog; + // p.show_in_ui = false; + p.value = get_node_exists(json_root_node, "nvme_self_test_log").value_or(false); + add_property(p); + } + + { StorageProperty p; p.set_name("nvme_self_test_log/current_self_test_operation/value/_decoded",