github.com/lulzWill/go-agent@v2.1.2+incompatible/internal/crossagent/cross_agent_tests/utilization/boot_id.json (about)

     1  [
     2    {
     3      "testname": "boot_id file not found",
     4      "input_total_ram_mib": 1024,
     5      "input_logical_processors": 8,
     6      "input_hostname": "myhost",
     7      "input_boot_id": null,
     8      "expected_output_json": {
     9        "metadata_version": 3,
    10        "logical_processors": 8,
    11        "total_ram_mib": 1024,
    12        "hostname": "myhost"
    13      },
    14      "expected_metrics": {
    15        "Supportability/utilization/boot_id/error": {
    16          "call_count": 1
    17        }
    18      }
    19    },
    20    {
    21      "testname": "valid boot_id, should be 36 characters",
    22      "input_total_ram_mib": 1024,
    23      "input_logical_processors": 8,
    24      "input_hostname": "myhost",
    25      "input_boot_id": "8e84c4ab-943d-46c2-8675-fdf0ab61e1c4",
    26      "expected_output_json": {
    27        "metadata_version": 3,
    28        "logical_processors": 8,
    29        "total_ram_mib": 1024,
    30        "hostname": "myhost",
    31        "boot_id": "8e84c4ab-943d-46c2-8675-fdf0ab61e1c4"
    32      }
    33    },
    34    {
    35      "testname": "boot_id too long, should be truncated to 128 characters max",
    36      "input_total_ram_mib": 1024,
    37      "input_logical_processors": 8,
    38      "input_hostname": "myhost",
    39      "input_boot_id": "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz",
    40      "expected_output_json": {
    41        "metadata_version": 3,
    42        "logical_processors": 8,
    43        "total_ram_mib": 1024,
    44        "hostname": "myhost",
    45        "boot_id": "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
    46      },
    47      "expected_metrics": {
    48        "Supportability/utilization/boot_id/error": {
    49          "call_count": 1
    50        }
    51      }
    52    },
    53    {
    54      "testname": "boot_id too short, should be reported as is",
    55      "input_total_ram_mib": 1024,
    56      "input_logical_processors": 8,
    57      "input_hostname": "myhost",
    58      "input_boot_id": "1234",
    59      "expected_output_json": {
    60        "metadata_version": 3,
    61        "logical_processors": 8,
    62        "total_ram_mib": 1024,
    63        "hostname": "myhost",
    64        "boot_id": "1234"
    65      },
    66      "expected_metrics": {
    67        "Supportability/utilization/boot_id/error": {
    68          "call_count": 1
    69        }
    70      }
    71    },
    72    {
    73      "testname": "boot_id too short with non-alphanumeric characters, should be reported as is",
    74      "input_total_ram_mib": 1024,
    75      "input_logical_processors": 8,
    76      "input_hostname": "myhost",
    77      "input_boot_id": "<script>lol</script>",
    78      "expected_output_json": {
    79        "metadata_version": 3,
    80        "logical_processors": 8,
    81        "total_ram_mib": 1024,
    82        "hostname": "myhost",
    83        "boot_id": "<script>lol</script>"
    84      },
    85      "expected_metrics": {
    86        "Supportability/utilization/boot_id/error": {
    87          "call_count": 1
    88        }
    89      }
    90    },
    91    {
    92      "testname": "boot_id file empty",
    93      "input_total_ram_mib": 1024,
    94      "input_logical_processors": 8,
    95      "input_hostname": "myhost",
    96      "input_boot_id": "",
    97      "expected_output_json": {
    98        "metadata_version": 3,
    99        "logical_processors": 8,
   100        "total_ram_mib": 1024,
   101        "hostname": "myhost"
   102      },
   103      "expected_metrics": {
   104        "Supportability/utilization/boot_id/error": {
   105          "call_count": 1
   106        }
   107      }
   108    }
   109  ]