Add functest-kubernetes verification for iec
[iec.git] / src / foundation / scripts / functest.sh
1 #!/bin/bash
2 # Run the functest-kubernetes on master node for checking
3 # K8s environments
4 set -e
5
6 K8S_MASTER_IP=$1
7
8
9 if [ -z "${K8S_MASTER_IP}" ]
10 then
11   echo "Error:K8S_MASTER_IP is empty."
12   echo "Please input the k8s master ip address."
13   echo "Just as:"
14   echo "./functest.sh 10.1.1.1"
15   exit 1
16 fi
17
18
19 cat <<EOF > "${HOME}/k8.creds"
20 export KUBERNETES_PROVIDER=local
21 export KUBE_MASTER_URL=https://${K8S_MASTER_IP}:6443
22 export KUBE_MASTER_IP=${K8S_MASTER_IP}
23 EOF
24
25 mkdir -p "${HOME}/functest/results"
26
27 sudo docker run --rm -e DEPLOY_SCENARIO=k8-nosdn-nofeature-noha \
28        -v "${HOME}/k8.creds:/home/opnfv/functest/conf/env_file" \
29        -v "${HOME}/functest/results:/home/opnfv/functest/results" \
30        -v "${HOME}/.kube/config:/root/.kube/config" opnfv/functest-kubernetes-healthcheck:latest \
31        /bin/bash -c 'run_tests -r -t all'