Fix disk resource job to fetch SMART status (BugFix)#940
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #940 +/- ##
==========================================
+ Coverage 38.98% 39.18% +0.19%
==========================================
Files 315 315
Lines 34893 34899 +6
Branches 5971 5972 +1
==========================================
+ Hits 13604 13676 +72
+ Misses 20678 20610 -68
- Partials 611 613 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
kissiel
left a comment
There was a problem hiding this comment.
The version on main doesn't crash on problems with smartctl. With this patch it crashes on my system.
|
The "crash-y" setup I've got: The nvme2c2n1 doesn't exist at The |
kissiel
left a comment
There was a problem hiding this comment.
TYVM for the improvements!
Works better now!
* Black block_device_resource.py * Add new validator and change flags to smartctl * Small refactor, remove some dead code * Add unittests for block_device_resource.py * Remove warning inhibitor * Handle errors and test the failure
* Black block_device_resource.py * Add new validator and change flags to smartctl * Small refactor, remove some dead code * Add unittests for block_device_resource.py * Remove warning inhibitor * Handle errors and test the failure
Description
Currently the disk_block_device_resource script doesn't correctly fetch the SMART support status of some devices. The reason is that some devices (namely, nvme drives, although more may exist) fail to be reported as supporting SMART by smartctl even though they do. This is due to the fact that this support is not reported in
smartctl -ibut it is there insmartctl -x, although in a slightly different format.This changes the command that the resource job runs. This also includes some new unit tests for this resource and a small refactoring.
Resolved issues
Fixes: #102
Documentation
N/A
Tests
I have an nvme drive that was wrongly reported by this resource as not supporting SMART. After these changes it correctly reports the SMART status.