From 9b6ecfca76b3024070c55594e3c0b951cb8fe1ad Mon Sep 17 00:00:00 2001 From: Jingzhao Date: Mon, 25 Mar 2019 17:50:13 +0800 Subject: [PATCH] Add functest-kubernetes verification for iec 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 --- src/foundation/scripts/functest.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 src/foundation/scripts/functest.sh diff --git a/src/foundation/scripts/functest.sh b/src/foundation/scripts/functest.sh new file mode 100755 index 0000000..a3e4bae --- /dev/null +++ b/src/foundation/scripts/functest.sh @@ -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 < "${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' -- 2.16.6