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

     1  [
     2    {
     3      "testname": "azure api times out, no vendor hash or supportability metric reported",
     4      "uri": {
     5        "http://169.254.169.254/metadata/instance/compute?api-version=2017-03-01": {
     6          "response": {
     7            "location": null,
     8            "name": null,
     9            "vmId": null,
    10            "vmSize": null
    11          },
    12          "timeout": true
    13        }
    14      },
    15      "expected_vendors_hash": null,
    16      "expected_metrics": {
    17        "Supportability/utilization/azure/error": {
    18          "call_count": 0
    19        }
    20      }
    21    },
    22    {
    23      "testname": "vmId, location, name, vmSize are all happy",
    24      "uri": {
    25        "http://169.254.169.254/metadata/instance/compute?api-version=2017-03-01": {
    26          "response": {
    27            "location": "CentralUS",
    28            "name": "IMDSCanary",
    29            "vmId": "5c08b38e-4d57-4c23-ac45-aca61037f084",
    30            "vmSize": "Standard_DS2"
    31          },
    32          "timeout": false
    33        }
    34      },
    35      "expected_vendors_hash": {
    36        "azure": {
    37          "location": "CentralUS",
    38          "name": "IMDSCanary",
    39          "vmId": "5c08b38e-4d57-4c23-ac45-aca61037f084",
    40          "vmSize": "Standard_DS2"
    41        }
    42      }
    43    },
    44    {
    45      "testname": "vmSize with invalid characters",
    46      "uri": {
    47        "http://169.254.169.254/metadata/instance/compute?api-version=2017-03-01": {
    48          "response": {
    49            "location": "CentralUS",
    50            "name": "IMDSCanary",
    51            "vmId": "5c08b38e-4d57-4c23-ac45-aca61037f084",
    52            "vmSize": "<script>lol</script>"
    53          },
    54          "timeout": false
    55        }
    56      },
    57      "expected_vendors_hash": null,
    58      "expected_metrics": {
    59        "Supportability/utilization/azure/error": {
    60          "call_count": 1
    61        }
    62      }
    63    },
    64    {
    65      "testname": "vmSize too long",
    66      "uri": {
    67        "http://169.254.169.254/metadata/instance/compute?api-version=2017-03-01": {
    68          "response": {
    69            "location": "CentralUS",
    70            "name": "IMDSCanary",
    71            "vmId": "5c08b38e-4d57-4c23-ac45-aca61037f084",
    72            "vmSize": "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
    73          },
    74          "timeout": false
    75        }
    76      },
    77      "expected_vendors_hash": null,
    78      "expected_metrics": {
    79        "Supportability/utilization/azure/error": {
    80          "call_count": 1
    81        }
    82      }
    83    },
    84    {
    85      "testname": "vmId with invalid characters",
    86      "uri": {
    87        "http://169.254.169.254/metadata/instance/compute?api-version=2017-03-01": {
    88          "response": {
    89            "location": "CentralUS",
    90            "name": "IMDSCanary",
    91            "vmId": "<script>lol</script>",
    92            "vmSize": "Standard_DS2"
    93          },
    94          "timeout": false
    95        }
    96      },
    97      "expected_vendors_hash": null,
    98      "expected_metrics": {
    99        "Supportability/utilization/azure/error": {
   100          "call_count": 1
   101        }
   102      }
   103    },
   104    {
   105      "testname": "vmId too long",
   106      "uri": {
   107        "http://169.254.169.254/metadata/instance/compute?api-version=2017-03-01": {
   108          "response": {
   109            "location": "CentralUS",
   110            "name": "IMDSCanary",
   111            "vmId": "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz",
   112            "vmSize": "Standard_DS2"
   113          },
   114          "timeout": false
   115        }
   116      },
   117      "expected_vendors_hash": null,
   118      "expected_metrics": {
   119        "Supportability/utilization/azure/error": {
   120          "call_count": 1
   121        }
   122      }
   123    },
   124    {
   125      "testname": "location with invalid characters",
   126      "uri": {
   127        "http://169.254.169.254/metadata/instance/compute?api-version=2017-03-01": {
   128          "response": {
   129            "location": "<script>lol</script>",
   130            "name": "IMDSCanary",
   131            "vmId": "5c08b38e-4d57-4c23-ac45-aca61037f084",
   132            "vmSize": "Standard_DS2"
   133          },
   134          "timeout": false
   135        }
   136      },
   137      "expected_vendors_hash": null,
   138      "expected_metrics": {
   139        "Supportability/utilization/azure/error": {
   140          "call_count": 1
   141        }
   142      }
   143    },
   144    {
   145      "testname": "location too long",
   146      "uri": {
   147        "http://169.254.169.254/metadata/instance/compute?api-version=2017-03-01": {
   148          "response": {
   149            "location": "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz",
   150            "name": "IMDSCanary",
   151            "vmId": "5c08b38e-4d57-4c23-ac45-aca61037f084",
   152            "vmSize": "Standard_DS2"
   153          },
   154          "timeout": false
   155        }
   156      },
   157      "expected_vendors_hash": null,
   158      "expected_metrics": {
   159        "Supportability/utilization/azure/error": {
   160          "call_count": 1
   161        }
   162      }
   163    },
   164    {
   165      "testname": "name with invalid characters",
   166      "uri": {
   167        "http://169.254.169.254/metadata/instance/compute?api-version=2017-03-01": {
   168          "response": {
   169            "location": "CentralUS",
   170            "name": "<script>lol</script>",
   171            "vmId": "5c08b38e-4d57-4c23-ac45-aca61037f084",
   172            "vmSize": "Standard_DS2"
   173          },
   174          "timeout": false
   175        }
   176      },
   177      "expected_vendors_hash": null,
   178      "expected_metrics": {
   179        "Supportability/utilization/azure/error": {
   180          "call_count": 1
   181        }
   182      }
   183    },
   184    {
   185      "testname": "name too long",
   186      "uri": {
   187        "http://169.254.169.254/metadata/instance/compute?api-version=2017-03-01": {
   188          "response": {
   189            "location": "CentralUS",
   190            "name": "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz",
   191            "vmId": "5c08b38e-4d57-4c23-ac45-aca61037f084",
   192            "vmSize": "Standard_DS2"
   193          },
   194          "timeout": false
   195        }
   196      },
   197      "expected_metrics": {
   198        "Supportability/utilization/azure/error": {
   199          "call_count": 1
   200        }
   201      }
   202    },
   203    {
   204      "testname": "UTF-8 high codepoints",
   205      "uri": {
   206        "http://169.254.169.254/metadata/instance/compute?api-version=2017-03-01": {
   207          "response": {
   208            "location": "CentralUS",
   209            "name": "IMDSCanary",
   210            "vmId": "滈 橀槶澉 鞻饙騴 鱙鷭黂 甗糲 紁羑 嗂 蛶觢豥 餤駰鬳 釂鱞鸄",
   211            "vmSize": "Standard_DS2"
   212          },
   213          "timeout": false
   214        }
   215      },
   216      "expected_vendors_hash": {
   217        "azure": {
   218          "location": "CentralUS",
   219          "name": "IMDSCanary",
   220          "vmId": "滈 橀槶澉 鞻饙騴 鱙鷭黂 甗糲 紁羑 嗂 蛶觢豥 餤駰鬳 釂鱞鸄",
   221          "vmSize": "Standard_DS2"
   222        }
   223      }
   224    },
   225    {
   226      "testname": "comma with multibyte characters",
   227      "uri": {
   228        "http://169.254.169.254/metadata/instance/compute?api-version=2017-03-01": {
   229          "response": {
   230            "location": "CentralUS",
   231            "name": "滈 橀槶澉 鞻饙騴 鱙鷭黂 甗糲, 紁羑 嗂 蛶觢豥 餤駰鬳 釂鱞鸄",
   232            "vmId": "5c08b38e-4d57-4c23-ac45-aca61037f084",
   233            "vmSize": "Standard_DS2"
   234          },
   235          "timeout": false
   236        }
   237      },
   238      "expected_vendors_hash": null,
   239      "expected_metrics": {
   240        "Supportability/utilization/azure/error": {
   241          "call_count": 1
   242        }
   243      }
   244    },
   245    {
   246      "testname": "Exclamation point in response",
   247      "uri": {
   248        "http://169.254.169.254/metadata/instance/compute?api-version=2017-03-01": {
   249          "response": {
   250            "location": "CentralUS",
   251            "name": "Bang!",
   252            "vmId": "5c08b38e-4d57-4c23-ac45-aca61037f084",
   253            "vmSize": "Standard_DS2"
   254          },
   255          "timeout": false
   256        }
   257      },
   258      "expected_vendors_hash": null,
   259      "expected_metrics": {
   260        "Supportability/utilization/azure/error": {
   261          "call_count": 1
   262        }
   263      }
   264    },
   265    {
   266      "testname": "Valid punctuation in response",
   267      "uri": {
   268        "http://169.254.169.254/metadata/instance/compute?api-version=2017-03-01": {
   269          "response": {
   270            "location": "CentralUS",
   271            "name": "IMDSCanary",
   272            "vmId": "5c08b38e-4d57-4c23-ac45-aca61037f084",
   273            "vmSize": "a-b_c.3... and/or 503 867-5309"
   274          },
   275          "timeout": false
   276        }
   277      },
   278      "expected_vendors_hash": {
   279        "azure": {
   280          "location": "CentralUS",
   281          "name": "IMDSCanary",
   282          "vmId": "5c08b38e-4d57-4c23-ac45-aca61037f084",
   283          "vmSize": "a-b_c.3... and/or 503 867-5309"
   284        }
   285      }
   286    }
   287  ]