|
266 | 266 |
|
267 | 267 | 0 5275 0 0x0001 0x0004 - 0 1 -"""
|
268 | 268 |
|
| 269 | +output_Innodisk_missing_names_ssd = """smartctl 6.6 2017-11-05 r4594 [armv7l-linux-4.19.0-12-2-armmp] (local build) |
| 270 | +Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org |
| 271 | +
|
| 272 | +=== START OF INFORMATION SECTION === |
| 273 | +Model Family: Innodisk 3IE3/3ME3/3ME4 SSDs |
| 274 | +Device Model: M.2 (S42) 3ME4 |
| 275 | +Serial Number: YCA12003110020080 |
| 276 | +LU WWN Device Id: 5 02b2a2 01d1c1b1a |
| 277 | +Firmware Version: L17606 |
| 278 | +User Capacity: 16,013,942,784 bytes [16.0 GB] |
| 279 | +Sector Size: 512 bytes logical/physical |
| 280 | +Rotation Rate: Solid State Device |
| 281 | +Device is: In smartctl database [for details use: -P show] |
| 282 | +ATA Version is: ACS-3 T13/2161-D revision 4 |
| 283 | +SATA Version is: SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s) |
| 284 | +Local Time is: Tue Apr 26 00:57:00 2022 UTC |
| 285 | +SMART support is: Available - device has SMART capability. |
| 286 | +SMART support is: Enabled |
| 287 | +
|
| 288 | +=== START OF READ SMART DATA SECTION === |
| 289 | +SMART overall-health self-assessment test result: PASSED |
| 290 | +
|
| 291 | +General SMART Values: |
| 292 | +Offline data collection status: (0x02) Offline data collection activity |
| 293 | + was completed without error. |
| 294 | + Auto Offline Data Collection: Disabled. |
| 295 | +Total time to complete Offline |
| 296 | +data collection: ( 32) seconds. |
| 297 | +Offline data collection |
| 298 | +capabilities: (0x00) Offline data collection not supported. |
| 299 | +SMART capabilities: (0x0002) Does not save SMART data before |
| 300 | + entering power-saving mode. |
| 301 | + Supports SMART auto save timer. |
| 302 | +Error logging capability: (0x00) Error logging NOT supported. |
| 303 | + General Purpose Logging supported. |
| 304 | +
|
| 305 | +SMART Attributes Data Structure revision number: 16 |
| 306 | +Vendor Specific SMART Attributes with Thresholds: |
| 307 | +ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE |
| 308 | + 1 Raw_Read_Error_Rate 0x0000 000 000 000 Old_age Offline - 0 |
| 309 | + 2 Throughput_Performance 0x0000 000 000 000 Old_age Offline - 0 |
| 310 | + 5 Later_Bad_Block 0x0012 100 100 001 Old_age Always - 0 |
| 311 | + 7 Seek_Error_Rate 0x0000 000 000 000 Old_age Offline - 0 |
| 312 | + 8 Seek_Time_Performance 0x0000 000 000 000 Old_age Offline - 0 |
| 313 | + 9 Power_On_Hours 0x0012 253 000 000 Old_age Always - 14151 |
| 314 | + 10 Spin_Retry_Count 0x0000 000 000 000 Old_age Offline - 0 |
| 315 | + 12 Power_Cycle_Count 0x0012 036 000 000 Old_age Always - 36 |
| 316 | +163 Total_Bad_Block_Count 0x0000 000 000 000 Old_age Offline - 9 |
| 317 | +168 SATA_PHY_Error_Count 0x0000 000 000 000 Old_age Offline - 0 |
| 318 | +169 Unknown Attribute 0x0000 094 000 000 Old_age Offline - 94 |
| 319 | +175 Bad_Cluster_Table_Count 0x0000 000 000 000 Old_age Offline - 0 |
| 320 | +192 Power-Off_Retract_Count 0x0012 000 000 000 Old_age Always - 3 |
| 321 | +194 Unknown Attribute 0x0002 039 100 000 Old_age Always - 39 (3 42 0 33 0) |
| 322 | +197 Current_Pending_Sector 0x0000 000 000 000 Old_age Offline - 0 |
| 323 | +225 Data_Log_Write_Count 0x0000 000 000 000 Old_age Offline - 0 |
| 324 | +240 Write_Head 0x0000 000 000 000 Old_age Offline - 0 |
| 325 | +165 Max_Erase_Count 0x0012 223 100 000 Old_age Always - 223 |
| 326 | +167 Average_Erase_Count 0x0012 000 100 000 Old_age Always - 187 |
| 327 | +170 Spare_Block_Count 0x0013 100 100 010 Pre-fail Always - 72 |
| 328 | +171 Program_Fail_Count 0x0012 000 100 000 Old_age Always - 0 |
| 329 | +172 Erase_Fail_Count 0x0012 000 100 000 Old_age Always - 0 |
| 330 | +176 RANGE_RECORD_Count 0x0000 000 000 000 Old_age Offline - 0 |
| 331 | +184 End-to-End_Error 0x0012 000 000 000 Old_age Always - 0 |
| 332 | +187 Reported_Uncorrect 0x0012 000 000 000 Old_age Always - 0 |
| 333 | +229 Flash_ID 0x0000 100 100 000 Old_age Offline - 0x51769394de98 |
| 334 | +232 Spares_Remaining_Perc 0x0013 000 000 000 Pre-fail Always - 0 |
| 335 | +235 Later_Bad_Blk_Inf_R/W/E 0x0002 000 000 000 Old_age Always - 0 0 0 |
| 336 | +241 Host_Writes_32MiB 0x0002 100 100 000 Old_age Always - 14452 |
| 337 | +242 Host_Reads_32MiB 0x0002 100 100 000 Old_age Always - 42566 |
| 338 | +
|
| 339 | +SMART Error Log not supported |
| 340 | +
|
| 341 | +SMART Self-test Log not supported |
| 342 | +
|
| 343 | +Selective Self-tests/Logging not supported |
| 344 | +
|
| 345 | +""" |
| 346 | + |
269 | 347 | class TestSsdGeneric:
|
270 | 348 | @mock.patch('sonic_platform_base.sonic_ssd.ssd_generic.SsdUtil._execute_shell', mock.MagicMock(return_value=output_nvme_ssd))
|
271 | 349 | def test_nvme_ssd(self):
|
@@ -325,3 +403,12 @@ def test_Innodisk_ssd(self):
|
325 | 403 | assert(Innodisk_ssd.get_temperature() == '0')
|
326 | 404 | assert(Innodisk_ssd.get_serial() == "20171126AAAA11730156")
|
327 | 405 |
|
| 406 | + @mock.patch('sonic_platform_base.sonic_ssd.ssd_generic.SsdUtil._execute_shell', mock.MagicMock(return_value=output_Innodisk_missing_names_ssd)) |
| 407 | + def test_Innodisk_missing_names_ssd(self): |
| 408 | + # Test parsing Innodisk ssd info |
| 409 | + Innodisk_ssd = SsdUtil('/dev/sda') |
| 410 | + Innodisk_ssd.vendor_ssd_info = '' |
| 411 | + Innodisk_ssd.parse_vendor_ssd_info('InnoDisk') |
| 412 | + assert(Innodisk_ssd.get_health() == '94') |
| 413 | + assert(Innodisk_ssd.get_temperature() == '39') |
| 414 | + |
0 commit comments