adding test files.

pull/1/head
Jason Kulatunga 4 years ago
parent d636709aa1
commit 92d54df022

@ -12,7 +12,7 @@ import (
func TestFromCollectorSmartInfo(t *testing.T) {
//setup
smartDataFile, err := os.Open("../testdata/smart.json")
smartDataFile, err := os.Open("../testdata/smart-ata.json")
require.NoError(t, err)
defer smartDataFile.Close()

@ -0,0 +1,498 @@
{
"json_format_version": [
1,
0
],
"smartctl": {
"version": [
7,
0
],
"svn_revision": "4883",
"platform_info": "x86_64-w64-mingw32-win7-sp1",
"build_info": "(sf-7.0-1)",
"argv": [
"smartctl",
"--all",
"-j",
"/dev/sda"
],
"exit_status": 0
},
"device": {
"name": "/dev/sda",
"info_name": "/dev/sda",
"type": "ata",
"protocol": "ATA"
},
"model_family": "X based SSDs",
"model_name": "X SSD 850 PRO 128GB",
"serial_number": "S24ZN902000L",
"wwn": {
"naa": 5,
"oui": 9528,
"id": 35436182597
},
"firmware_version": "EB6Q",
"user_capacity": {
"blocks": 250069680,
"bytes": 128035676160
},
"logical_block_size": 512,
"physical_block_size": 512,
"rotation_rate": 0,
"in_smartctl_database": true,
"ata_version": {
"string": "ACS-2, ATA8-ACS T13/1699-D revision 4c",
"major_value": 1020,
"minor_value": 57
},
"sata_version": {
"string": "SATA 3.1",
"value": 127
},
"interface_speed": {
"max": {
"sata_value": 14,
"string": "6.0 Gb/s",
"units_per_second": 60,
"bits_per_unit": 100000000
},
"current": {
"sata_value": 3,
"string": "6.0 Gb/s",
"units_per_second": 60,
"bits_per_unit": 100000000
}
},
"local_time": {
"time_t": 1564664713,
"asctime": "Thu Aug 01 15:05:13 2019 WEDT"
},
"smart_status": {
"passed": true
},
"ata_smart_data": {
"offline_data_collection": {
"status": {
"value": 0,
"string": "was never started"
},
"completion_seconds": 0
},
"self_test": {
"status": {
"value": 0,
"string": "completed without error",
"passed": true
},
"polling_minutes": {
"short": 2,
"extended": 68
}
},
"capabilities": {
"values": [
83,
3
],
"exec_offline_immediate_supported": true,
"offline_is_aborted_upon_new_cmd": false,
"offline_surface_scan_supported": false,
"self_tests_supported": true,
"conveyance_self_test_supported": false,
"selective_self_test_supported": true,
"attribute_autosave_enabled": true,
"error_logging_supported": true,
"gp_logging_supported": true
}
},
"ata_sct_capabilities": {
"value": 61,
"error_recovery_control_supported": true,
"feature_control_supported": true,
"data_table_supported": true
},
"ata_smart_attributes": {
"revision": 1,
"table": [
{
"id": 5,
"name": "Reallocated_Sector_Ct",
"value": 100,
"worst": 100,
"thresh": 10,
"when_failed": "",
"flags": {
"value": 51,
"string": "PO--CK ",
"prefailure": true,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 9,
"name": "Power_On_Hours",
"value": 99,
"worst": 99,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 846,
"string": "846"
}
},
{
"id": 12,
"name": "Power_Cycle_Count",
"value": 99,
"worst": 99,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 168,
"string": "168"
}
},
{
"id": 177,
"name": "Wear_Leveling_Count",
"value": 99,
"worst": 99,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 19,
"string": "PO--C- ",
"prefailure": true,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": false
},
"raw": {
"value": 5,
"string": "5"
}
},
{
"id": 179,
"name": "Used_Rsvd_Blk_Cnt_Tot",
"value": 100,
"worst": 100,
"thresh": 10,
"when_failed": "",
"flags": {
"value": 19,
"string": "PO--C- ",
"prefailure": true,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": false
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 181,
"name": "Program_Fail_Cnt_Total",
"value": 100,
"worst": 100,
"thresh": 10,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 182,
"name": "Erase_Fail_Count_Total",
"value": 100,
"worst": 100,
"thresh": 10,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 183,
"name": "Runtime_Bad_Block",
"value": 100,
"worst": 100,
"thresh": 10,
"when_failed": "",
"flags": {
"value": 19,
"string": "PO--C- ",
"prefailure": true,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": false
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 187,
"name": "Uncorrectable_Error_Cnt",
"value": 100,
"worst": 100,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 190,
"name": "Airflow_Temperature_Cel",
"value": 68,
"worst": 61,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 32,
"string": "32"
}
},
{
"id": 195,
"name": "ECC_Error_Rate",
"value": 200,
"worst": 200,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 26,
"string": "-O-RC- ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": true,
"event_count": true,
"auto_keep": false
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 199,
"name": "CRC_Error_Count",
"value": 100,
"worst": 100,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 62,
"string": "-OSRCK ",
"prefailure": false,
"updated_online": true,
"performance": true,
"error_rate": true,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 235,
"name": "POR_Recovery_Count",
"value": 99,
"worst": 99,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 18,
"string": "-O--C- ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": false
},
"raw": {
"value": 21,
"string": "21"
}
},
{
"id": 241,
"name": "Total_LBAs_Written",
"value": 99,
"worst": 99,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 1047174917,
"string": "1047174917"
}
}
]
},
"power_on_time": {
"hours": 846
},
"power_cycle_count": 168,
"temperature": {
"current": 32
},
"ata_smart_error_log": {
"summary": {
"revision": 1,
"count": 0
}
},
"ata_smart_self_test_log": {
"standard": {
"revision": 1,
"count": 0
}
},
"ata_smart_selective_self_test_log": {
"revision": 1,
"table": [
{
"lba_min": 0,
"lba_max": 0,
"status": {
"value": 0,
"string": "Not_testing"
}
},
{
"lba_min": 0,
"lba_max": 0,
"status": {
"value": 0,
"string": "Not_testing"
}
},
{
"lba_min": 0,
"lba_max": 0,
"status": {
"value": 0,
"string": "Not_testing"
}
},
{
"lba_min": 0,
"lba_max": 0,
"status": {
"value": 0,
"string": "Not_testing"
}
},
{
"lba_min": 0,
"lba_max": 0,
"status": {
"value": 0,
"string": "Not_testing"
}
}
],
"flags": {
"value": 0,
"remainder_scan_enabled": false
},
"power_up_scan_resume_minutes": 0
}
}

@ -0,0 +1,28 @@
{
"json_format_version": [
1,
0
],
"smartctl": {
"version": [
7,
0
],
"svn_revision": "4883",
"platform_info": "x86_64-w64-mingw32-win7-sp1",
"build_info": "(sf-7.0-1)",
"argv": [
"smartctl",
"--all",
"-j",
"/dev/sda"
],
"messages": [
{
"string": "Smartctl open device: /dev/sda failed: \\\\.\\PhysicalDrive0: Open failed, Error=5",
"severity": "error"
}
],
"exit_status": 2
}
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,97 @@
{
"json_format_version": [
1,
0
],
"smartctl": {
"version": [
7,
1
],
"svn_revision": "5022",
"platform_info": "x86_64-linux-5.4.0-33-generic",
"build_info": "(local build)",
"argv": [
"smartctl",
"--all",
"--json",
"/dev/testfoobarpass"
],
"exit_status": 0
},
"device": {
"name": "/dev/testfoobarpass",
"info_name": "/dev/testfoobarpass",
"type": "nvme",
"protocol": "NVMe"
},
"model_name": "INTEL SSDPEKNW010T8",
"serial_number": "BTNH93710FS91P0B",
"firmware_version": "002C",
"nvme_pci_vendor": {
"id": 32902,
"subsystem_id": 32902
},
"nvme_ieee_oui_identifier": 6083300,
"nvme_controller_id": 1,
"nvme_number_of_namespaces": 1,
"nvme_namespaces": [
{
"id": 1,
"size": {
"blocks": 2000409264,
"bytes": 1024209543168
},
"capacity": {
"blocks": 2000409264,
"bytes": 1024209543168
},
"utilization": {
"blocks": 2000409264,
"bytes": 1024209543168
},
"formatted_lba_size": 512
}
],
"user_capacity": {
"blocks": 2000409264,
"bytes": 1024209543168
},
"logical_block_size": 512,
"local_time": {
"time_t": 1591790462,
"asctime": "Wed Jun 10 14:01:02 2020 CEST"
},
"smart_status": {
"passed": true,
"nvme": {
"value": 0
}
},
"nvme_smart_health_information_log": {
"critical_warning": 0,
"temperature": 36,
"available_spare": 100,
"available_spare_threshold": 10,
"percentage_used": 0,
"data_units_read": 9511859,
"data_units_written": 7773431,
"host_reads": 111303174,
"host_writes": 83170961,
"controller_busy_time": 3060,
"power_cycles": 266,
"power_on_hours": 2401,
"unsafe_shutdowns": 43,
"media_errors": 0,
"num_err_log_entries": 0,
"warning_temp_time": 0,
"critical_comp_time": 0
},
"temperature": {
"current": 36
},
"power_cycle_count": 266,
"power_on_time": {
"hours": 2401
}
}

@ -0,0 +1,30 @@
{
"json_format_version": [
1,
0
],
"smartctl": {
"version": [
7,
0
],
"svn_revision": "4883",
"platform_info": "x86_64-linux-5.4.6-arch3-1",
"build_info": "(local build)",
"argv": [
"smartctl",
"-jH",
"/dev/sdc"
],
"exit_status": 0
},
"device": {
"name": "/dev/sdc",
"info_name": "/dev/sdc [SAT]",
"type": "sat",
"protocol": "ATA"
},
"smart_status": {
"passed": true
}
}

@ -0,0 +1,53 @@
{
"json_format_version": [
1,
0
],
"smartctl": {
"version": [
7,
0
],
"svn_revision": "4883",
"platform_info": "x86_64-w64-mingw32-w10-1809",
"build_info": "(sf-7.0-1)",
"argv": [
"smartctl",
"--all",
"-j",
"/dev/sdb"
],
"exit_status": 4
},
"device": {
"name": "/dev/sdb",
"info_name": "/dev/sdb",
"type": "scsi",
"protocol": "SCSI"
},
"vendor": "Intel",
"product": "Raid 1 Volume",
"model_name": "Intel Raid 1 Volume",
"revision": "1.0.",
"scsi_version": "SPC-3",
"user_capacity": {
"blocks": 1953519616,
"bytes": 1000202043392
},
"logical_block_size": 512,
"physical_block_size": 4096,
"rotation_rate": 7200,
"serial_number": "Volume1",
"device_type": {
"scsi_value": 0,
"name": "disk"
},
"local_time": {
"time_t": 1570609867,
"asctime": "Wed Oct 09 10:31:07 2019 RDT"
},
"temperature": {
"current": 0,
"drive_trip": 0
}
}

@ -0,0 +1,520 @@
{
"json_format_version": [
1,
0
],
"smartctl": {
"version": [
7,
0
],
"svn_revision": "4883",
"platform_info": "x86_64-linux-5.4.6-arch3-1",
"build_info": "(local build)",
"argv": [
"smartctl",
"-jA",
"/dev/sdc"
],
"exit_status": 0
},
"device": {
"name": "/dev/sdc",
"info_name": "/dev/sdc [SAT]",
"type": "sat",
"protocol": "ATA"
},
"ata_smart_attributes": {
"revision": 10,
"table": [
{
"id": 1,
"name": "Raw_Read_Error_Rate",
"value": 115,
"worst": 100,
"thresh": 34,
"when_failed": "",
"flags": {
"value": 15,
"string": "POSR-- ",
"prefailure": true,
"updated_online": true,
"performance": true,
"error_rate": true,
"event_count": false,
"auto_keep": false
},
"raw": {
"value": 83905456,
"string": "83905456"
}
},
{
"id": 3,
"name": "Spin_Up_Time",
"value": 99,
"worst": 99,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 3,
"string": "PO---- ",
"prefailure": true,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": false,
"auto_keep": false
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 4,
"name": "Start_Stop_Count",
"value": 100,
"worst": 100,
"thresh": 20,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 355,
"string": "355"
}
},
{
"id": 5,
"name": "Reallocated_Sector_Ct",
"value": 100,
"worst": 100,
"thresh": 36,
"when_failed": "",
"flags": {
"value": 51,
"string": "PO--CK ",
"prefailure": true,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 7,
"name": "Seek_Error_Rate",
"value": 71,
"worst": 60,
"thresh": 30,
"when_failed": "",
"flags": {
"value": 15,
"string": "POSR-- ",
"prefailure": true,
"updated_online": true,
"performance": true,
"error_rate": true,
"event_count": false,
"auto_keep": false
},
"raw": {
"value": 13407112,
"string": "13407112"
}
},
{
"id": 9,
"name": "Power_On_Hours",
"value": 97,
"worst": 97,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 167031278144165,
"string": "2725 (151 234 0)"
}
},
{
"id": 10,
"name": "Spin_Retry_Count",
"value": 100,
"worst": 100,
"thresh": 97,
"when_failed": "",
"flags": {
"value": 19,
"string": "PO--C- ",
"prefailure": true,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": false
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 12,
"name": "Power_Cycle_Count",
"value": 100,
"worst": 100,
"thresh": 20,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 354,
"string": "354"
}
},
{
"id": 184,
"name": "End-to-End_Error",
"value": 100,
"worst": 100,
"thresh": 99,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 187,
"name": "Reported_Uncorrect",
"value": 100,
"worst": 100,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 188,
"name": "Command_Timeout",
"value": 100,
"worst": 100,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 189,
"name": "High_Fly_Writes",
"value": 100,
"worst": 100,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 58,
"string": "-O-RCK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": true,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 190,
"name": "Airflow_Temperature_Cel",
"value": 71,
"worst": 51,
"thresh": 45,
"when_failed": "",
"flags": {
"value": 34,
"string": "-O---K ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": false,
"auto_keep": true
},
"raw": {
"value": 487784477,
"string": "29 (Min/Max 19/29)"
}
},
{
"id": 191,
"name": "G-Sense_Error_Rate",
"value": 100,
"worst": 100,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 47,
"string": "47"
}
},
{
"id": 192,
"name": "Power-Off_Retract_Count",
"value": 100,
"worst": 100,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 59,
"string": "59"
}
},
{
"id": 193,
"name": "Load_Cycle_Count",
"value": 93,
"worst": 93,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 15952,
"string": "15952"
}
},
{
"id": 194,
"name": "Temperature_Celsius",
"value": 29,
"worst": 49,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 34,
"string": "-O---K ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": false,
"auto_keep": true
},
"raw": {
"value": 77309411357,
"string": "29 (0 18 0 0 0)"
}
},
{
"id": 196,
"name": "Reallocated_Event_Count",
"value": 98,
"worst": 98,
"thresh": 30,
"when_failed": "",
"flags": {
"value": 15,
"string": "POSR-- ",
"prefailure": true,
"updated_online": true,
"performance": true,
"error_rate": true,
"event_count": false,
"auto_keep": false
},
"raw": {
"value": 53416508262463,
"string": "2111 (12437 0)"
}
},
{
"id": 197,
"name": "Current_Pending_Sector",
"value": 100,
"worst": 100,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 18,
"string": "-O--C- ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": false
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 198,
"name": "Offline_Uncorrectable",
"value": 100,
"worst": 100,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 16,
"string": "----C- ",
"prefailure": false,
"updated_online": false,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": false
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 199,
"name": "UDMA_CRC_Error_Count",
"value": 200,
"worst": 200,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 62,
"string": "-OSRCK ",
"prefailure": false,
"updated_online": true,
"performance": true,
"error_rate": true,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 254,
"name": "Free_Fall_Sensor",
"value": 100,
"worst": 100,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 0,
"string": "0"
}
}
]
},
"power_cycle_count": 354,
"temperature": {
"current": 29
}
}
Loading…
Cancel
Save