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

     1  [
     2    {
     3      "testname": "aws api times out, no vendor hash or supportability metric reported",
     4      "uri": {
     5        "http://169.254.169.254/2016-09-02/dynamic/instance-identity/document": {
     6          "response": {
     7            "instanceId": null,      
     8            "instanceType": null,        
     9            "availabilityZone": null
    10          },
    11          "timeout": true
    12        }
    13      },
    14      "expected_vendors_hash": null,
    15      "expected_metrics": {
    16        "Supportability/utilization/aws/error": {
    17          "call_count": 0
    18        }
    19      }
    20    },
    21    {
    22      "testname": "instance type, instance-id, availability-zone are all happy",
    23      "uri": {
    24        "http://169.254.169.254/2016-09-02/dynamic/instance-identity/document": {
    25          "response": {
    26            "instanceId": "i-test.19characters",
    27            "instanceType": "test.type",          
    28            "availabilityZone": "us-west-2b"
    29          },
    30          "timeout": false
    31        }
    32      },
    33      "expected_vendors_hash": {
    34        "aws": {
    35          "instanceId": "i-test.19characters",
    36          "instanceType": "test.type",
    37          "availabilityZone": "us-west-2b"
    38        }
    39      }
    40    },
    41    {
    42      "testname": "instance type with invalid characters",
    43      "uri": {
    44        "http://169.254.169.254/2016-09-02/dynamic/instance-identity/document": {
    45          "response": {
    46            "instanceId": "test.id",      
    47            "instanceType": "<script>lol</script>",        
    48            "availabilityZone": "us-west-2b"
    49          },
    50          "timeout": false
    51        }
    52      },
    53      "expected_vendors_hash": null,
    54      "expected_metrics": {
    55        "Supportability/utilization/aws/error": {
    56          "call_count": 1
    57        }
    58      }
    59    },
    60    {
    61      "testname": "instance type too long",
    62      "uri": {
    63        "http://169.254.169.254/2016-09-02/dynamic/instance-identity/document": {
    64          "response": {
    65            "instanceId": "test.id",      
    66            "instanceType": "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz",        
    67            "availabilityZone": "us-west-2b"
    68          },
    69          "timeout": false
    70        }
    71      },
    72      "expected_vendors_hash": null,
    73      "expected_metrics": {
    74        "Supportability/utilization/aws/error": {
    75          "call_count": 1
    76        }
    77      }
    78    },
    79    {
    80      "testname": "instance id with invalid characters",
    81      "uri": {
    82        "http://169.254.169.254/2016-09-02/dynamic/instance-identity/document": {
    83          "response": {
    84            "instanceId": "<script>lol</script>",      
    85            "instanceType": "test.type",        
    86            "availabilityZone": "us-west-2b"
    87          },
    88          "timeout": false
    89        }
    90      },
    91      "expected_vendors_hash": null,
    92      "expected_metrics": {
    93        "Supportability/utilization/aws/error": {
    94          "call_count": 1
    95        }
    96      }
    97    },
    98    {
    99      "testname": "instance id too long",
   100      "uri": {
   101        "http://169.254.169.254/2016-09-02/dynamic/instance-identity/document": {
   102          "response": {
   103            "instanceId": "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz",      
   104            "instanceType": "test.type",        
   105            "availabilityZone": "us-west-2b"
   106          },
   107          "timeout": false
   108        }
   109      },
   110      "expected_vendors_hash": null,
   111      "expected_metrics": {
   112        "Supportability/utilization/aws/error": {
   113          "call_count": 1
   114        }
   115      }
   116    },
   117    {
   118      "testname": "availability zone with invalid characters",
   119      "uri": {
   120        "http://169.254.169.254/2016-09-02/dynamic/instance-identity/document": {
   121          "response": {
   122            "instanceId": "test.id",      
   123            "instanceType": "test.type",        
   124            "availabilityZone": "<script>lol</script>"
   125          },
   126          "timeout": false
   127        }
   128      },
   129      "expected_vendors_hash": null,
   130      "expected_metrics": {
   131        "Supportability/utilization/aws/error": {
   132          "call_count": 1
   133        }
   134      }
   135    },
   136    {
   137      "testname": "availability zone too long",
   138      "uri": {
   139        "http://169.254.169.254/2016-09-02/dynamic/instance-identity/document": {
   140          "response": {
   141            "instanceId": "test.id",      
   142            "instanceType": "test.type",        
   143            "availabilityZone": "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
   144          },
   145          "timeout": false
   146        }
   147      },
   148      "expected_vendors_hash": null,
   149      "expected_metrics": {
   150        "Supportability/utilization/aws/error": {
   151          "call_count": 1
   152        }
   153      }
   154    },
   155    {
   156      "testname": "UTF-8 high codepoints",
   157      "uri": {
   158        "http://169.254.169.254/2016-09-02/dynamic/instance-identity/document": {
   159          "response": {
   160            "instanceId": "滈 橀槶澉 鞻饙騴 鱙鷭黂 甗糲 紁羑 嗂 蛶觢豥 餤駰鬳 釂鱞鸄",      
   161            "instanceType": "test.type",        
   162            "availabilityZone": "us-west-2b"
   163          },
   164          "timeout": false
   165        }
   166      },
   167      "expected_vendors_hash": {
   168        "aws": {
   169          "instanceId": "滈 橀槶澉 鞻饙騴 鱙鷭黂 甗糲 紁羑 嗂 蛶觢豥 餤駰鬳 釂鱞鸄",
   170          "instanceType": "test.type",
   171          "availabilityZone": "us-west-2b"
   172        }
   173      }
   174    },
   175    {
   176      "testname": "comma with multibyte characters",
   177      "uri": {
   178        "http://169.254.169.254/2016-09-02/dynamic/instance-identity/document": {
   179          "response": {
   180            "instanceId": "滈 橀槶澉 鞻饙騴 鱙鷭黂 甗糲, 紁羑 嗂 蛶觢豥 餤駰鬳 釂鱞鸄",      
   181            "instanceType": "test.type",        
   182            "availabilityZone": "us-west-2b"
   183          },
   184          "timeout": false
   185        }
   186      },
   187      "expected_vendors_hash": null,
   188      "expected_metrics": {
   189        "Supportability/utilization/aws/error": {
   190          "call_count": 1
   191        }
   192      }
   193    },
   194    {
   195      "testname": "Exclamation point response",
   196      "uri": {
   197        "http://169.254.169.254/2016-09-02/dynamic/instance-identity/document": {
   198          "response": {
   199            "instanceId": "bang!",      
   200            "instanceType": "test.type",        
   201            "availabilityZone": "us-west-2b"
   202          },
   203          "timeout": false
   204        }
   205      },
   206      "expected_vendors_hash": null,
   207      "expected_metrics": {
   208        "Supportability/utilization/aws/error": {
   209          "call_count": 1
   210        }
   211      }
   212    },
   213    {
   214      "testname": "Valid punctuation in response",
   215      "uri": {
   216        "http://169.254.169.254/2016-09-02/dynamic/instance-identity/document": {
   217          "response": {
   218            "instanceId": "test.id",      
   219            "instanceType": "a-b_c.3... and/or 503 867-5309",        
   220            "availabilityZone": "us-west-2b"
   221          },
   222          "timeout": false
   223        }
   224      },
   225      "expected_vendors_hash": {
   226        "aws": {
   227          "instanceId": "test.id",      
   228          "instanceType": "a-b_c.3... and/or 503 867-5309",        
   229          "availabilityZone": "us-west-2b"
   230        }
   231      }
   232    }
   233  ]