ocket8888 commented on code in PR #6588:
URL: https://github.com/apache/trafficcontrol/pull/6588#discussion_r847624789


##########
.github/workflows/tr-ultimate-test-harness.yml:
##########
@@ -71,8 +78,124 @@ jobs:
           key: ${{ runner.os }}-node-modules-${{ 
hashFiles('traffic_portal/**/package*.json') }}-
           restore-keys: |
             ${{ runner.os }}-node-modules-
-      - name: Run Traffic Router Ultimate Test Harness
-        run: 
./.github/actions/tr-ultimate-test-harness/tr-ultimate-test-harness.sh
+      - name: Start the Dev CDN in a Box
+        run: docker-compose up -d
+      - name: Wait until Traffic Ops is ready to accept requests
+        run: |
+          trap 'echo "Error on line ${LINENO} of setting interface IP 
addresses"; exit 1' ERR
+          set -o errexit -o nounset -o pipefail
+
+          # Get atc-ready function
+          source dev/atc.dev.sh
+          export -f atc-ready
+
+          echo 'Waiting until Traffic Ops is ready to accept requests...'
+          if ! timeout 10m bash -c 'atc-ready -w'; then
+            echo 'Traffic Ops was not available within 10 minutes!'
+            trap - ERR
+            echo 'Exiting...'
+            exit 1
+          fi
+
+      - name: Set interface IP addresses
+        run: |2
+          trap 'echo "Error on line ${LINENO} of setting interface IP 
addresses"; exit 1' ERR
+          # set -o xtrace
+          # uncomment this line ^ to check interface data
+          set -o errexit -o nounset -o pipefail
+
+          source infrastructure/cdn-in-a-box/traffic_ops/to-access.sh
+
+          declare -A service_by_hostname
+          service_by_hostname[trafficrouter]=trafficrouter
+          service_by_hostname[edge]=t3c
+
+          for hostname in trafficrouter edge; do
+            container_id="$(docker-compose ps -q 
"${service_by_hostname[$hostname]}")"
+            interface="$(<<'JSON' jq
+            {
+              "mtu": 1500,
+              "monitor": true,
+              "ipAddresses": [],
+              "name": "eth0"
+            }
+          JSON
+            )"
+            docker_network="$(docker network inspect dev.ciab.test)"
+            for ip_address_field in IPv4Address IPv6Address; do
+              ip_address="$(<<<"$docker_network" jq -r --arg CONTAINER_ID 
"$container_id" --arg IP_ADDRESS_FIELD "$ip_address_field" 
'.[0].Containers[$CONTAINER_ID][$IP_ADDRESS_FIELD]')"
+              if [[ "$ip_address" == null ]]; then
+                echo "Could not find ${ip_address_field} for ${hostname} 
service!"
+                exit 1
+              fi
+              interface="$(<<<"$interface" jq --arg IP_ADDRESS "$ip_address" 
'.ipAddresses += [{} | .address = $IP_ADDRESS | .serviceAddress = true]')"
+            done
+
+            # Get server JSON
+            server="$(to-get 
"api/$TO_API_VERSION/servers?hostName=${hostname}" | jq '.response[0]')"
+            if [[ -z "$server" ]]; then
+              echo "Could not get JSON for server ${hostname}"
+              exit 1
+            fi
+
+            # Update server's interface with its IP addresses
+            server="$(<<<"$server" jq ".interfaces = [${interface}]")"
+            server_id="$(<<<"$server" jq .id)"
+            if ! to-put "api/$TO_API_VERSION/servers/${server_id}" "$server"; 
then
+              echo "Could not update server ${hostname} with ${server}"
+              exit 1
+            fi
+          done
+
+          # Snapshot
+          cdn_id="$(<<<"$server" jq .cdnId)"
+          to-put "api/$TO_API_VERSION/snapshot?cdnID=${cdn_id}"
+
+      - name: Wait for Traffic Monitor to serve a snapshot
+        run: |
+          echo "Waiting for Traffic Monitor to serve a snapshot..."
+          if ! timeout 10m curl \
+            --retry 99999 \
+            --retry-delay 5 \
+            --show-error \
+            -fIso/dev/null \
+            http://localhost/publish/CrConfig
+          then
+            echo "CrConfig was not available from Traffic Monitor within 10 
minutes!"
+            trap - ERR
+            echo 'Exiting...'
+            exit 1
+          fi
+
+      - name: Compile the tests
+        run: go test -c ./traffic_router/ultimate-test-harness
+
+      - name: Wait for Delivery Service to become available
+        id: wait-for-ds
+        run: |
+          trap 'echo "Error on line ${LINENO} of waiting for the Delivery 
Service to become available"; exit 1' ERR
+          set -o errexit -o nounset -o pipefail
+
+          # Get atc-ready function
+          source dev/atc.dev.sh
+          export -f atc-ready
+
+          deliveryservice=cdn.dev-ds.ciab.test
+          echo "Waiting for Delivery Service ${deliveryservice} to become 
available..."
+          if ! timeout 10m bash -c 'atc-ready -d'; then

Review Comment:
   Oh, I guess GitHub decided not to show me all the changes



-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to