Add functest-kubernetes verification for iec 02/502/3
authorJingzhao <Jingzhao.Ni@arm.com>
Mon, 25 Mar 2019 09:50:13 +0000 (17:50 +0800)
committerJingzhao <Jingzhao.Ni@arm.com>
Tue, 26 Mar 2019 06:09:26 +0000 (14:09 +0800)
Add a shell scripts for running functest-k8s-healthcheck images.
It help us to verify the basic function of K8s. On the other hand,
the functest is a good framework for functional test in future.

Change-Id: I837737a18446a3ae57ce610a570fa1aafe7f94ef
Signed-off-by: Jingzhao <Jingzhao.Ni@arm.com>
src/foundation/scripts/functest.sh [new file with mode: 0755]

diff --git a/src/foundation/scripts/functest.sh b/src/foundation/scripts/functest.sh
new file mode 100755 (executable)
index 0000000..a3e4bae
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/bash
+# Run the functest-kubernetes on master node for checking
+# K8s environments
+set -e
+
+K8S_MASTER_IP=$1
+
+
+if [ -z "${K8S_MASTER_IP}" ]
+then
+  echo "Error:K8S_MASTER_IP is empty."
+  echo "Please input the k8s master ip address."
+  echo "Just as:"
+  echo "./functest.sh 10.1.1.1"
+  exit 1
+fi
+
+
+cat <<EOF > "${HOME}/k8.creds"
+export KUBERNETES_PROVIDER=local
+export KUBE_MASTER_URL=https://${K8S_MASTER_IP}:6443
+export KUBE_MASTER_IP=${K8S_MASTER_IP}
+EOF
+
+mkdir -p "${HOME}/functest/results"
+
+sudo docker run --rm -e DEPLOY_SCENARIO=k8-nosdn-nofeature-noha \
+       -v "${HOME}/k8.creds:/home/opnfv/functest/conf/env_file" \
+       -v "${HOME}/functest/results:/home/opnfv/functest/results" \
+       -v "${HOME}/.kube/config:/root/.kube/config" opnfv/functest-kubernetes-healthcheck:latest \
+       /bin/bash -c 'run_tests -r -t all'