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

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