diff --git a/pySMART/device.py b/pySMART/device.py index 8ccc11b..2a508cf 100644 --- a/pySMART/device.py +++ b/pySMART/device.py @@ -181,6 +181,19 @@ def __init__(self, name: str, interface: Optional[str] = None, abridged: bool = # Note: The above are just default values and can/will be changed # upon update() when the attributes and type of the disk is actually # determined. + self.test_polling_time = { + 'short': 10, + 'long': 1000, + 'conveyance': 20, + } + """ + **(dict): ** This dictionary contains key == 'Test Name' and + value == int of approximate times to run each test type that this + device is capable of. + """ + # Note: The above are just default values and can/will be changed + # upon update() when the attributes and type of the disk is actually + # determined. self.tests: List[TestEntry] = [] """ **(list of `TestEntry`):** Contains the complete SMART self-test log @@ -962,6 +975,7 @@ class members, including the SMART attribute table and self-test log. parse_self_tests = False parse_running_test = False parse_ascq = False + polling_minute_type = None message = '' self.tests = [] self._test_running = False @@ -1206,6 +1220,21 @@ class members, including the SMART attribute table and self-test log. self.test_capabilities['short'] = True self.test_capabilities['long'] = True + if 'Short self-test routine' in line: + polling_minute_type = 'short' + continue + if 'Extended self-test routine' in line: + polling_minute_type = 'long' + continue + if 'Conveyance self-test routine' in line: + polling_minute_type = 'conveyance' + continue + if 'recommended polling time:' in line: + self.test_polling_time[polling_minute_type] = float( + re.sub("[^0-9]", "", line) + ) + continue + # For some reason smartctl does not show a currently running test # for 'ATA' in the Test log so I just have to catch it this way i guess! # For 'scsi' I still do it since it is the only place I get % remaining in scsi diff --git a/tests/dataset/singletests/megaraid_ph_sas_hdd_0/device.json b/tests/dataset/singletests/megaraid_ph_sas_hdd_0/device.json index c865bb6..09feae8 100644 --- a/tests/dataset/singletests/megaraid_ph_sas_hdd_0/device.json +++ b/tests/dataset/singletests/megaraid_ph_sas_hdd_0/device.json @@ -342,6 +342,11 @@ "selective": false, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 1000, + "short": 10 + }, "tests": [ { "asc": "-", diff --git a/tests/dataset/singletests/megaraid_ph_sata_hdd_0/device.json b/tests/dataset/singletests/megaraid_ph_sata_hdd_0/device.json index 029db18..9ea5a08 100644 --- a/tests/dataset/singletests/megaraid_ph_sata_hdd_0/device.json +++ b/tests/dataset/singletests/megaraid_ph_sata_hdd_0/device.json @@ -1111,6 +1111,11 @@ "selective": true, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 574.0, + "short": 1.0 + }, "tests": [ { "asc": null, diff --git a/tests/dataset/singletests/megaraid_ph_sata_hdd_1_issue_56/device.json b/tests/dataset/singletests/megaraid_ph_sata_hdd_1_issue_56/device.json index 89de813..1d8e55f 100644 --- a/tests/dataset/singletests/megaraid_ph_sata_hdd_1_issue_56/device.json +++ b/tests/dataset/singletests/megaraid_ph_sata_hdd_1_issue_56/device.json @@ -1411,6 +1411,11 @@ "selective": true, "short": true }, + "test_polling_time": { + "conveyance": 2.0, + "long": 2.0, + "short": 1.0 + }, "tests": [], "vendor": "Intel" } diff --git a/tests/dataset/singletests/megaraid_ph_sata_ssd_0/device.json b/tests/dataset/singletests/megaraid_ph_sata_ssd_0/device.json index a972d11..ecd7626 100644 --- a/tests/dataset/singletests/megaraid_ph_sata_ssd_0/device.json +++ b/tests/dataset/singletests/megaraid_ph_sata_ssd_0/device.json @@ -1351,6 +1351,11 @@ "selective": true, "short": true }, + "test_polling_time": { + "conveyance": 2.0, + "long": 2.0, + "short": 1.0 + }, "tests": [ { "asc": null, diff --git a/tests/dataset/singletests/megaraid_vd_0/device.json b/tests/dataset/singletests/megaraid_vd_0/device.json index 9c1c70d..94d0c40 100644 --- a/tests/dataset/singletests/megaraid_vd_0/device.json +++ b/tests/dataset/singletests/megaraid_vd_0/device.json @@ -341,6 +341,11 @@ "selective": false, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 1000, + "short": 10 + }, "tests": [], "vendor": "Intel" } diff --git a/tests/dataset/singletests/nvme_0/device.json b/tests/dataset/singletests/nvme_0/device.json index 6187bd1..147d890 100644 --- a/tests/dataset/singletests/nvme_0/device.json +++ b/tests/dataset/singletests/nvme_0/device.json @@ -379,6 +379,11 @@ "selective": false, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 1000, + "short": 10 + }, "tests": [], "vendor": "KBG" } diff --git a/tests/dataset/singletests/nvme_10_issue_73/device.json b/tests/dataset/singletests/nvme_10_issue_73/device.json index 1583b6b..b1d3f9f 100644 --- a/tests/dataset/singletests/nvme_10_issue_73/device.json +++ b/tests/dataset/singletests/nvme_10_issue_73/device.json @@ -368,6 +368,11 @@ "selective": false, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 1000, + "short": 10 + }, "tests": [], "vendor": "Netac" } diff --git a/tests/dataset/singletests/nvme_11_issue_75/device.json b/tests/dataset/singletests/nvme_11_issue_75/device.json index a8f93ff..227e5a3 100644 --- a/tests/dataset/singletests/nvme_11_issue_75/device.json +++ b/tests/dataset/singletests/nvme_11_issue_75/device.json @@ -416,6 +416,11 @@ "selective": false, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 1000, + "short": 10 + }, "tests": [ { "asc": null, diff --git a/tests/dataset/singletests/nvme_1_issue_37/device.json b/tests/dataset/singletests/nvme_1_issue_37/device.json index 651886f..3341176 100644 --- a/tests/dataset/singletests/nvme_1_issue_37/device.json +++ b/tests/dataset/singletests/nvme_1_issue_37/device.json @@ -368,6 +368,11 @@ "selective": false, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 1000, + "short": 10 + }, "tests": [], "vendor": "Samsung" } diff --git a/tests/dataset/singletests/nvme_2_issue_46/device.json b/tests/dataset/singletests/nvme_2_issue_46/device.json index 08f509d..680ecd6 100644 --- a/tests/dataset/singletests/nvme_2_issue_46/device.json +++ b/tests/dataset/singletests/nvme_2_issue_46/device.json @@ -365,6 +365,11 @@ "selective": false, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 1000, + "short": 10 + }, "tests": [], "vendor": "WDC" } diff --git a/tests/dataset/singletests/nvme_3_issue_52/device.json b/tests/dataset/singletests/nvme_3_issue_52/device.json index 97e6a56..b8e885a 100644 --- a/tests/dataset/singletests/nvme_3_issue_52/device.json +++ b/tests/dataset/singletests/nvme_3_issue_52/device.json @@ -365,6 +365,11 @@ "selective": false, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 1000, + "short": 10 + }, "tests": [], "vendor": "WDC" } diff --git a/tests/dataset/singletests/nvme_4_issue_53/device.json b/tests/dataset/singletests/nvme_4_issue_53/device.json index 0685f0f..ee83b11 100644 --- a/tests/dataset/singletests/nvme_4_issue_53/device.json +++ b/tests/dataset/singletests/nvme_4_issue_53/device.json @@ -378,6 +378,11 @@ "selective": false, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 1000, + "short": 10 + }, "tests": [], "vendor": "KCM" } diff --git a/tests/dataset/singletests/nvme_5_issue_46/device.json b/tests/dataset/singletests/nvme_5_issue_46/device.json index 2af4bda..f690167 100644 --- a/tests/dataset/singletests/nvme_5_issue_46/device.json +++ b/tests/dataset/singletests/nvme_5_issue_46/device.json @@ -368,6 +368,11 @@ "selective": false, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 1000, + "short": 10 + }, "tests": [], "vendor": "WD" } diff --git a/tests/dataset/singletests/nvme_6/device.json b/tests/dataset/singletests/nvme_6/device.json index 9c64d63..3236e04 100644 --- a/tests/dataset/singletests/nvme_6/device.json +++ b/tests/dataset/singletests/nvme_6/device.json @@ -392,6 +392,11 @@ "selective": false, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 1000, + "short": 10 + }, "tests": [ { "asc": null, diff --git a/tests/dataset/singletests/nvme_7_issue_63/device.json b/tests/dataset/singletests/nvme_7_issue_63/device.json index 9395a38..9e1040d 100644 --- a/tests/dataset/singletests/nvme_7_issue_63/device.json +++ b/tests/dataset/singletests/nvme_7_issue_63/device.json @@ -365,6 +365,11 @@ "selective": false, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 1000, + "short": 10 + }, "tests": [], "vendor": "WDS" } diff --git a/tests/dataset/singletests/nvme_8/device.json b/tests/dataset/singletests/nvme_8/device.json index 64bdf1b..5bfd878 100644 --- a/tests/dataset/singletests/nvme_8/device.json +++ b/tests/dataset/singletests/nvme_8/device.json @@ -365,6 +365,11 @@ "selective": false, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 1000, + "short": 10 + }, "tests": [], "vendor": "WDS" } diff --git a/tests/dataset/singletests/nvme_9_issue_72/device.json b/tests/dataset/singletests/nvme_9_issue_72/device.json index 174aab9..4a39e5c 100644 --- a/tests/dataset/singletests/nvme_9_issue_72/device.json +++ b/tests/dataset/singletests/nvme_9_issue_72/device.json @@ -365,6 +365,11 @@ "selective": false, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 1000, + "short": 10 + }, "tests": [], "vendor": "KINGSTON" } diff --git a/tests/dataset/singletests/nvme_win10_0_issue_64/device.json b/tests/dataset/singletests/nvme_win10_0_issue_64/device.json index 73bf086..61ee33d 100644 --- a/tests/dataset/singletests/nvme_win10_0_issue_64/device.json +++ b/tests/dataset/singletests/nvme_win10_0_issue_64/device.json @@ -453,6 +453,11 @@ "selective": false, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 1000, + "short": 10 + }, "tests": [ { "asc": null, diff --git a/tests/dataset/singletests/nvme_win10_mingw32_0_issue_48/device.json b/tests/dataset/singletests/nvme_win10_mingw32_0_issue_48/device.json index aaa8640..2c2a185 100644 --- a/tests/dataset/singletests/nvme_win10_mingw32_0_issue_48/device.json +++ b/tests/dataset/singletests/nvme_win10_mingw32_0_issue_48/device.json @@ -364,6 +364,11 @@ "selective": false, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 1000, + "short": 10 + }, "tests": [], "vendor": "WDS" } diff --git a/tests/dataset/singletests/sas_hdd_0_issue_51/device.json b/tests/dataset/singletests/sas_hdd_0_issue_51/device.json index c105ae8..8b43135 100644 --- a/tests/dataset/singletests/sas_hdd_0_issue_51/device.json +++ b/tests/dataset/singletests/sas_hdd_0_issue_51/device.json @@ -342,6 +342,11 @@ "selective": false, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 1000, + "short": 10 + }, "tests": [], "vendor": "HGST" } diff --git a/tests/dataset/singletests/sas_ssd_0_issue_57/device.json b/tests/dataset/singletests/sas_ssd_0_issue_57/device.json index 1d80de0..148225b 100644 --- a/tests/dataset/singletests/sas_ssd_0_issue_57/device.json +++ b/tests/dataset/singletests/sas_ssd_0_issue_57/device.json @@ -342,6 +342,11 @@ "selective": false, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 1000, + "short": 10 + }, "tests": [ { "asc": "-", diff --git a/tests/dataset/singletests/sat_hdd_0_issue70/device.json b/tests/dataset/singletests/sat_hdd_0_issue70/device.json index b84ec51..c44e3b1 100644 --- a/tests/dataset/singletests/sat_hdd_0_issue70/device.json +++ b/tests/dataset/singletests/sat_hdd_0_issue70/device.json @@ -1260,6 +1260,11 @@ "selective": true, "short": true }, + "test_polling_time": { + "conveyance": 2.0, + "long": 196.0, + "short": 1.0 + }, "tests": [ { "asc": null, diff --git a/tests/dataset/singletests/sat_ssd_0_issue_65/device.json b/tests/dataset/singletests/sat_ssd_0_issue_65/device.json index 4652003..78579f2 100644 --- a/tests/dataset/singletests/sat_ssd_0_issue_65/device.json +++ b/tests/dataset/singletests/sat_ssd_0_issue_65/device.json @@ -1380,6 +1380,11 @@ "selective": true, "short": true }, + "test_polling_time": { + "conveyance": 2.0, + "long": 85.0, + "short": 2.0 + }, "tests": [], "vendor": "HS" } diff --git a/tests/dataset/singletests/sata_hdd_0_issue42/device.json b/tests/dataset/singletests/sata_hdd_0_issue42/device.json index baaee1d..c4eba0f 100644 --- a/tests/dataset/singletests/sata_hdd_0_issue42/device.json +++ b/tests/dataset/singletests/sata_hdd_0_issue42/device.json @@ -1261,6 +1261,11 @@ "selective": true, "short": true }, + "test_polling_time": { + "conveyance": 2.0, + "long": 1082.0, + "short": 1.0 + }, "tests": [ { "asc": null, diff --git a/tests/dataset/singletests/sata_hdd_1_issue46/device.json b/tests/dataset/singletests/sata_hdd_1_issue46/device.json index 02fcb1a..0f63c1c 100644 --- a/tests/dataset/singletests/sata_hdd_1_issue46/device.json +++ b/tests/dataset/singletests/sata_hdd_1_issue46/device.json @@ -1141,6 +1141,11 @@ "selective": true, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 1822.0, + "short": 2.0 + }, "tests": [], "vendor": "Western" } diff --git a/tests/dataset/singletests/sata_ssd_0_issue_49/device.json b/tests/dataset/singletests/sata_ssd_0_issue_49/device.json index ef13afe..e1a7719 100644 --- a/tests/dataset/singletests/sata_ssd_0_issue_49/device.json +++ b/tests/dataset/singletests/sata_ssd_0_issue_49/device.json @@ -1051,6 +1051,11 @@ "selective": false, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 10.0, + "short": 1.0 + }, "tests": [ { "asc": null, diff --git a/tests/dataset/singletests/sata_ssd_1_issue_72/device.json b/tests/dataset/singletests/sata_ssd_1_issue_72/device.json index f2c2272..47a80f0 100644 --- a/tests/dataset/singletests/sata_ssd_1_issue_72/device.json +++ b/tests/dataset/singletests/sata_ssd_1_issue_72/device.json @@ -1471,6 +1471,11 @@ "selective": true, "short": true }, + "test_polling_time": { + "conveyance": 2.0, + "long": 90.0, + "short": 2.0 + }, "tests": [], "vendor": "Apacer" } diff --git a/tests/dataset/singletests/sata_ssd_macos_0/device.json b/tests/dataset/singletests/sata_ssd_macos_0/device.json index 0d3b9fa..228ec2c 100644 --- a/tests/dataset/singletests/sata_ssd_macos_0/device.json +++ b/tests/dataset/singletests/sata_ssd_macos_0/device.json @@ -991,6 +991,11 @@ "selective": true, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 10.0, + "short": 2.0 + }, "tests": [], "vendor": "Apple" } diff --git a/tests/dataset/singletests/unsupported_0/device.json b/tests/dataset/singletests/unsupported_0/device.json index 5612c28..c5e1ad1 100644 --- a/tests/dataset/singletests/unsupported_0/device.json +++ b/tests/dataset/singletests/unsupported_0/device.json @@ -341,6 +341,11 @@ "selective": false, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 1000, + "short": 10 + }, "tests": [], "vendor": "AVAGO" } diff --git a/tests/dataset/singletests/usb_ssd_0_issue_50/device.json b/tests/dataset/singletests/usb_ssd_0_issue_50/device.json index a38928b..c69246e 100644 --- a/tests/dataset/singletests/usb_ssd_0_issue_50/device.json +++ b/tests/dataset/singletests/usb_ssd_0_issue_50/device.json @@ -1351,6 +1351,11 @@ "selective": false, "short": true }, + "test_polling_time": { + "conveyance": 20, + "long": 10.0, + "short": 1.0 + }, "tests": [ { "asc": null,