Expaning the Verify Scope 63/40163/1
authormbeierl <mark.beierl@dell.com>
Thu, 24 Aug 2017 20:45:31 +0000 (16:45 -0400)
committermbeierl <mark.beierl@dell.com>
Thu, 24 Aug 2017 20:45:31 +0000 (16:45 -0400)
Adds a new verify job that does docker-compose build and up,
and checks for HTTP responses from each of the endpoints.

Change-Id: Idcb74c8b8337a74a2b624f93ea6b34707d7e5516
JIRA: STORPERF-199
Signed-off-by: mbeierl <mark.beierl@dell.com>
ci/merge.sh
ci/verify-build.sh [new file with mode: 0755]

index 80ffdb6..333a05c 100755 (executable)
@@ -8,5 +8,4 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
-# Just run the verify again for now
-`dirname $0`/verify.sh
\ No newline at end of file
+exit 0
diff --git a/ci/verify-build.sh b/ci/verify-build.sh
new file mode 100755 (executable)
index 0000000..dfa999c
--- /dev/null
@@ -0,0 +1,80 @@
+#!/bin/bash
+##############################################################################
+# Copyright (c) 2017 Dell EMC and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+cd `dirname $0`
+ci=`pwd`
+
+cd ${ci}/../docker
+
+export ENV_FILE=${ci}/job/admin.rc
+export CARBON_DIR=${ci}/job/carbon/
+
+touch ${ENV_FILE}
+mkdir -p ${CARBON_DIR}
+
+if [ -z $ARCH ]
+then
+    ARCH=x86_64
+fi
+
+export ARCH
+
+docker-compose -f local-docker-compose.yaml down
+docker-compose -f local-docker-compose.yaml build
+docker-compose -f local-docker-compose.yaml up -d
+
+function check_for_life() {
+    NAME=$1
+    URI=$2
+
+    echo "Waiting for ${NAME} to become active"
+    ATTEMPTS=10
+
+    while [ $(curl -s -o /dev/null -I -w "%{http_code}" -X GET http://127.0.0.1:5000${URI}) != "200" ]
+    do
+        ATTEMPTS=$((ATTEMPTS - 1))
+        if [ ${ATTEMPTS} -le 1 ]
+        then
+            echo "Failed to get a start up of ${NAME}"
+            return 1
+        fi
+        sleep 2
+    done
+}
+
+FAILURES=0
+
+check_for_life storperf-httpfrontend "/"
+FAILURES=$((FAILURES + $?))
+
+check_for_life storperf-master "/api/v1.0/configurations"
+FAILURES=$((FAILURES + $?))
+
+check_for_life storperf-reporting "/reporting/"
+FAILURES=$((FAILURES + $?))
+
+check_for_life storperf-swagger "/swagger/?url=http://127.0.0.1:5000/api/spec.json"
+FAILURES=$((FAILURES + $?))
+
+check_for_life storperf-graphite "/graphite/"
+FAILURES=$((FAILURES + $?))
+
+
+for container in master graphite httpfrontend swaggerui reporting
+do
+    echo "====================================="
+    echo "Log for storperf-${container}"
+    docker logs storperf-${container}
+done
+echo "====================================="
+
+docker-compose -f local-docker-compose.yaml down
+
+exit ${FAILURES}