forked from metal3-io/metal3-dev-env
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path05_test.sh
executable file
·34 lines (24 loc) · 1011 Bytes
/
05_test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
set -xe
METAL3_DIR="$(dirname "$(readlink -f "${0}")")"
# shellcheck disable=SC1090
# shellcheck disable=SC1091
source "${METAL3_DIR}/lib/common.sh"
export ACTION="ci_test_provision"
"${METAL3_DIR}"/scripts/run.sh
# wait until status of Metal3Machine is rebuilt
while [ -z "${status}" ]
do
status=$(kubectl get m3m -n "${NAMESPACE}" -o=jsonpath="{.items[*]['status.ready']}")
sleep 1s
done
"${METAL3_DIR}"/scripts/fetch_manifests.sh
kubectl get secrets "${CLUSTER_NAME}-kubeconfig" -n "${NAMESPACE}" -o json | jq -r '.data.value'| base64 -d > "/tmp/kubeconfig-${CLUSTER_NAME}.yaml"
NUM_DEPLOYED_NODES="$(kubectl get nodes --kubeconfig "/tmp/kubeconfig-${CLUSTER_NAME}.yaml" | grep -c -w Ready)"
process_status $? "Fetch number of deployed nodes"
if [ "${NUM_DEPLOYED_NODES}" -ne "$((NUM_OF_MASTER_REPLICAS + NUM_OF_WORKER_REPLICAS))" ]; then
echo "Failed with incorrect number of nodes deployed"
exit 1
fi
export ACTION="ci_test_deprovision"
"${METAL3_DIR}"/scripts/run.sh