Diskmanage: extract nvme wearout from smartctl text

extract the info from the line:
Percentage Used: XX%

also adapt the tests

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak
2019-06-04 13:05:27 +02:00
committed by Thomas Lamprecht
parent d0a217f624
commit ea928fd41a
3 changed files with 14 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"nvme0n1" : {
"wearout" : "N/A",
"wearout" : 100,
"vendor" : "unknown",
"size" : 512000,
"health" : "PASSED",

View File

@ -1,5 +1,6 @@
{
"text" : "\nSMART/Health Information (NVMe Log 0x02, NSID 0xffffffff)\nCritical Warning: 0x00\nTemperature: 32 Celsius\nAvailable Spare: 100%\nAvailable Spare Threshold: 10%\nPercentage Used: 0%\nData Units Read: 1,299,288 [665 GB]\nData Units Written: 5,592,478 [2.86 TB]\nHost Read Commands: 30,360,807\nHost Write Commands: 470,356,196\nController Busy Time: 12\nPower Cycles: 98\nPower On Hours: 687\nUnsafe Shutdowns: 21\nMedia and Data Integrity Errors: 0\nError Information Log Entries: 0\n",
"health" : "PASSED",
"type" : "text"
"type" : "text",
"wearout": 100
}