zrhoffman commented on a change in pull request #3707:
URL: https://github.com/apache/trafficcontrol/pull/3707#discussion_r495240433



##########
File path: traffic_monitor/tests/integration/Dockerfile_run.sh
##########
@@ -0,0 +1,394 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# The following environment variables must be set (ordinarily by `docker run 
-e` arguments):
+# TO_URI
+# TO_USER
+# TO_PASS
+# CDN
+
+# Check that env vars are set
+envvars=( TESTTO_URI TESTTO_PORT TESTCACHES_URI TESTCACHES_PORT_START TM_URI )
+for v in $envvars
+do
+       if [[ -z $$v ]]; then echo "$v is unset"; exit 1; fi
+done
+
+
+CFG_FILE=/traffic-monitor-integration-test.cfg
+
+start() {
+       printf "DEBUG traffic_monitor_integration starting\n"
+
+       exec /traffic_monitor_integration_test -test.v -cfg $CFG_FILE
+}
+
+init() {
+  wait_for_to
+
+       curl -Lvsk ${TESTTO_URI}/api/1.2/cdns/fake/snapshot -X POST -d '
+{
+  "config": {
+    "api.cache-control.max_age": "30",
+    "consistent.dns.routing": "true",
+    "coveragezone.polling.interval": "30",
+    "coveragezone.polling.url": "30",
+    "dnssec.dynamic.response.expiration": "60",
+    "dnssec.enabled": "false",
+    "domain_name": "monitor-integration.test",
+    "federationmapping.polling.interval": "60",
+    "federationmapping.polling.url": "foo",
+    "geolocation.polling.interval": "30",
+    "geolocation.polling.url": "foo",
+    "keystore.maintenance.interval": "30",
+    "neustar.polling.interval": "30",
+    "neustar.polling.url": "foo",
+    "soa": {
+
+    },
+    "dnssec.inception": "0",
+    "ttls": {
+      "admin":   "30",
+      "expire":  "30",
+      "minimum": "30",
+      "refresh": "30",
+      "retry":   "30"
+               },
+    "weight": "1",
+    "zonemanager.cache.maintenance.interval": "30",
+    "zonemanager.threadpool.scale": "1"
+       },
+       "contentServers": {
+       "server0": {
+      "cacheGroup": "cg0",
+      "profile": "Edge0",
+      "fqdn": "server0.monitor-integration.test",
+      "hashCount": 1,
+      "hashId": "server0",
+      "httpsPort" : null,
+      "ip": "testcaches",
+      "ip6": null,
+      "locationId": "",
+      "port" : 30000,
+      "status": "REPORTED",
+      "type": "EDGE",
+      "deliveryServices": {"ds0":["ds0.monitor-integration.test"]},
+      "routingDisabled": 0
+      },
+       "server1": {
+      "cacheGroup": "cg0",
+      "profile": "Edge0",
+      "fqdn": "server1.monitor-integration.test",
+      "hashCount": 1,
+      "hashId": "server1",
+      "httpsPort" : null,
+      "ip": "testcaches",
+      "ip6": null,
+      "locationId": "",
+      "port" : 30001,
+      "status": "REPORTED",
+      "type": "EDGE",
+      "deliveryServices": {"ds0":["ds0.monitor-integration.test"]},
+      "routingDisabled": 0
+      }
+       },
+       "deliveryServices": {
+    "ds0": {
+      "anonymousBlockingEnabled": false,
+      "consistentHashQueryParams": [],
+      "consistentHashRegex": "",
+      "coverageZoneOnly": false,
+      "dispersion": {
+                         "limit": 1,
+                               "shuffled": false
+                       },
+      "domains": ["ds0.monitor-integration.test"],
+      "geolocationProvider": null,
+      "matchsets": [
+                         {
+                                 "protocol": "HTTP",
+                                       "matchlist": [
+                                         {
+                                                 "regex": "\\.*ds0\\.*",
+                                                       "match-type": "regex"
+                                               }
+                                       ]
+                               }
+                       ],
+      "missLocation": {"lat": 0, "lon": 0},
+      "protocol": {
+        "acceptHttp": true,
+        "acceptHttps": false,
+        "redirectToHttps": false
+      },
+      "regionalGeoBlocking": "false",
+      "responseHeaders": {},
+      "requestHeaders": [],
+      "soa": {
+        "admin": "60",
+        "expire": "60",
+        "minimum": "60",
+        "refresh": "60",
+        "retry": "60"
+                       },
+      "sslEnabled": false,
+      "ttl": 60,
+      "ttls": {
+        "A": "60",
+        "AAAA": "60",
+        "DNSKEY": "60",
+        "DS": "60",
+        "NS": "60",
+        "SOA": "60"
+                       },
+      "maxDnsIpsForLocation": 3,
+      "ip6RoutingEnabled": false,
+      "routingName": "ccr",
+      "bypassDestination": null,
+      "deepCachingType": null,
+      "geoEnabled": false,
+      "geoLimitRedirectURL": null,
+      "staticDnsEntries": []
+    }
+       },
+       "edgeLocations": {
+         "cg0": {"latitude":0, "longitude":0}
+       },
+       "trafficRouterLocations": {
+         "tr0": {"latitude":0, "longitude":0}
+       },
+       "monitors": {
+    "trafficmonitor": {
+        "fqdn": "trafficmonitor.monitor-integration.test",
+        "httpsPort": null,
+        "ip": "trafficmonitor",
+        "ip6": null,
+        "location": "cg0",
+        "port": 80,
+        "profile": "Monitor0",
+        "status": "REPORTED"
+    }
+       },
+       "stats": {
+    "CDN_name": "fake",
+    "date": 1561000000,
+    "tm_host": "testto",
+    "tm_path": "/fake",
+    "tm_user": "fake",
+    "tm_version": "integrationtest/0.fake"
+       }
+}
+'
+
+       curl -Lvsk ${TESTTO_URI}/api/1.2/cdns/fake/configs/monitoring.json -X 
POST -d '

Review comment:
       As with the rest of the API v2.0 routes, this has become 
`cdns/fake/configs/monitoring`, `json` suffix is no longer supported




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to