Skip to content

Commit

Permalink
Fixed NVME testing capabilities detection
Browse files Browse the repository at this point in the history
(issue NVMe Windows self-test seems a bit off #64)
  • Loading branch information
ralequi committed Mar 28, 2023
1 parent 3610f6a commit 9a7a18f
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 16 deletions.
6 changes: 6 additions & 0 deletions pySMART/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,12 @@ class members, including the SMART attribute table and self-test log.
self.test_capabilities['long'] = 'No' not in line
continue

# Parse SMART test capabilities (NVMe only)
if 'Optional Admin Commands' in line:
if 'Self_Test' in line:
self.test_capabilities['short'] = True
self.test_capabilities['long'] = True

# SMART Attribute table parsing
if all_in(line, '0x0', '_') and not interface == 'nvme':
# Replace multiple space separators with a single space, then
Expand Down
4 changes: 2 additions & 2 deletions tests/dataset/singletests/issue_63_nvme/device.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@
],
"test_capabilities": {
"offline": false,
"short": false,
"long": false,
"short": true,
"long": true,
"conveyance": false,
"selective": false
},
Expand Down
4 changes: 2 additions & 2 deletions tests/dataset/singletests/nvme_0/device.json
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@
],
"test_capabilities": {
"offline": false,
"short": false,
"long": false,
"short": true,
"long": true,
"conveyance": false,
"selective": false
},
Expand Down
4 changes: 2 additions & 2 deletions tests/dataset/singletests/nvme_1_issue_37/device.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@
],
"test_capabilities": {
"offline": false,
"short": false,
"long": false,
"short": true,
"long": true,
"conveyance": false,
"selective": false
},
Expand Down
4 changes: 2 additions & 2 deletions tests/dataset/singletests/nvme_2_issue_46/device.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@
],
"test_capabilities": {
"offline": false,
"short": false,
"long": false,
"short": true,
"long": true,
"conveyance": false,
"selective": false
},
Expand Down
4 changes: 2 additions & 2 deletions tests/dataset/singletests/nvme_3_issue_52/device.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@
],
"test_capabilities": {
"offline": false,
"short": false,
"long": false,
"short": true,
"long": true,
"conveyance": false,
"selective": false
},
Expand Down
4 changes: 2 additions & 2 deletions tests/dataset/singletests/nvme_4_issue_53/device.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@
],
"test_capabilities": {
"offline": false,
"short": false,
"long": false,
"short": true,
"long": true,
"conveyance": false,
"selective": false
},
Expand Down
4 changes: 2 additions & 2 deletions tests/dataset/singletests/nvme_5_issue_46/device.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@
],
"test_capabilities": {
"offline": false,
"short": false,
"long": false,
"short": true,
"long": true,
"conveyance": false,
"selective": false
},
Expand Down
4 changes: 2 additions & 2 deletions tests/dataset/singletests/nvme_6/device.json
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@
],
"test_capabilities": {
"offline": false,
"short": false,
"long": false,
"short": true,
"long": true,
"conveyance": false,
"selective": false
},
Expand Down

0 comments on commit 9a7a18f

Please sign in to comment.