|
1129 | 1129 | If Selective self-test is pending on power-up, resume after 0 minute delay. |
1130 | 1130 | """ |
1131 | 1131 |
|
| 1132 | +output_vitrium_nvme_generic = """ |
| 1133 | +smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.1.0-11-2-amd64] (local build) |
| 1134 | +Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org |
| 1135 | +=== START OF INFORMATION SECTION === |
| 1136 | +Model Number: Virtium VTPM24CEXI080-BM110006 |
| 1137 | +Serial Number: 64008-0094 |
| 1138 | +Firmware Version: CE00A400 |
| 1139 | +PCI Vendor/Subsystem ID: 0x1f9f |
| 1140 | +IEEE OUI Identifier: 0x00e04c |
| 1141 | +Controller ID: 1 |
| 1142 | +NVMe Version: 1.4 |
| 1143 | +Number of Namespaces: 1 |
| 1144 | +Namespace 1 Size/Capacity: 80,026,361,856 [80.0 GB] |
| 1145 | +Namespace 1 Formatted LBA Size: 512 |
| 1146 | +Namespace 1 IEEE EUI-64: 00e04c 00a6105150 |
| 1147 | +Local Time is: Fri May 31 09:42:45 2024 IDT |
| 1148 | +Firmware Updates (0x02): 1 Slot |
| 1149 | +Optional Admin Commands (0x0017): Security Format Frmw_DL Self_Test |
| 1150 | +Optional NVM Commands (0x005e): Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat Timestmp |
| 1151 | +Log Page Attributes (0x02): Cmd_Eff_Lg |
| 1152 | +Maximum Data Transfer Size: 32 Pages |
| 1153 | +Warning Comp. Temp. Threshold: 100 Celsius |
| 1154 | +Critical Comp. Temp. Threshold: 110 Celsius |
| 1155 | +Supported Power States |
| 1156 | +St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat |
| 1157 | + 0 + 8.00W - - 0 0 0 0 230000 50000 |
| 1158 | + 1 + 4.00W - - 1 1 1 1 4000 50000 |
| 1159 | + 2 + 3.00W - - 2 2 2 2 4000 250000 |
| 1160 | + 3 - 0.0300W - - 3 3 3 3 5000 10000 |
| 1161 | + 4 - 0.0050W - - 4 4 4 4 20000 45000 |
| 1162 | +Supported LBA Sizes (NSID 0x1) |
| 1163 | +Id Fmt Data Metadt Rel_Perf |
| 1164 | + 0 + 512 0 0 |
| 1165 | +=== START OF SMART DATA SECTION === |
| 1166 | +SMART overall-health self-assessment test result: PASSED |
| 1167 | +SMART/Health Information (NVMe Log 0x02) |
| 1168 | +Critical Warning: 0x00 |
| 1169 | +Temperature: 53 Celsius |
| 1170 | +Available Spare: 100% |
| 1171 | +Available Spare Threshold: 32% |
| 1172 | +Percentage Used: 0% |
| 1173 | +Data Units Read: 253,310 [129 GB] |
| 1174 | +Data Units Written: 598,492 [306 GB] |
| 1175 | +Host Read Commands: 3,015,892 |
| 1176 | +Host Write Commands: 5,589,998 |
| 1177 | +Controller Busy Time: 0 |
| 1178 | +Power Cycles: 79 |
| 1179 | +Power On Hours: 265 |
| 1180 | +Unsafe Shutdowns: 77 |
| 1181 | +Media and Data Integrity Errors: 0 |
| 1182 | +Error Information Log Entries: 0 |
| 1183 | +Warning Comp. Temperature Time: 0 |
| 1184 | +Critical Comp. Temperature Time: 0 |
| 1185 | +""" |
| 1186 | + |
| 1187 | +output_smartcmd_vitrium_error = """ |
| 1188 | +[Error] Cannot read SMART information on device /dev/nvme0n1 |
| 1189 | +""" |
| 1190 | + |
1132 | 1191 | class TestSsd: |
1133 | 1192 | @mock.patch('sonic_platform_base.sonic_storage.ssd.SsdUtil._execute_shell', mock.MagicMock(return_value=output_nvme_ssd)) |
1134 | 1193 | def test_nvme_ssd(self): |
@@ -1338,3 +1397,9 @@ def test_intel_ssd(self): |
1338 | 1397 | assert(intel_ssd.get_disk_io_reads() == '18922') |
1339 | 1398 | assert(intel_ssd.get_disk_io_writes() == '44554') |
1340 | 1399 | assert(intel_ssd.get_reserved_blocks() == '0') |
| 1400 | + |
| 1401 | + @mock.patch('sonic_platform_base.sonic_storage.ssd.SsdUtil._execute_shell') |
| 1402 | + def test_temperature_virtrium_nvme(self, mock_exec): |
| 1403 | + mock_exec.side_effect = [output_vitrium_nvme_generic, output_smartcmd_vitrium_error] |
| 1404 | + vitrium_ssd = SsdUtil('/dev/nvme0n1') |
| 1405 | + assert vitrium_ssd.get_temperature() == 53.0 |
0 commit comments