promenade/tools/g2/lib/validate.sh
Mark Burnett 15658a088e Use Kubernetes lease endpoint reconciler
In the resiliency gate:
* Enable the --endpoint-reconciler-type=least option for the apiserver.
* Extract etcd validation into its own stages.
* Test joining a node while one control plane node is down.

Change-Id: Id89b0816e91ab6427c5e2f4833ad4ec4e1e3d133
Depends-On: I2150d40e917567a4072a1565c1b96089f3d6fd2b
2018-06-15 13:13:02 -05:00

26 lines
837 B
Bash

validate_cluster() {
NAME=${1}
log Validating cluster via VM "${NAME}"
rsync_cmd "${TEMP_DIR}/scripts/validate-cluster.sh" "${NAME}:/root/promenade/"
ssh_cmd "${NAME}" /root/promenade/validate-cluster.sh
}
validate_etcd_membership() {
CLUSTER=${1}
VM=${2}
shift 2
EXPECTED_MEMBERS="${*}"
# NOTE(mark-burnett): Wait a moment for disks in test environment to settle.
sleep 10
log Validating "${CLUSTER}" etcd membership via "${VM}" for members: "${EXPECTED_MEMBERS[@]}"
FOUND_MEMBERS=$(etcdctl_member_list "${CLUSTER}" "${VM}" | tr '\n' ' ' | sed 's/ $//')
if [[ "x${EXPECTED_MEMBERS}" != "x${FOUND_MEMBERS}" ]]; then
log Etcd membership check failed for cluster "${CLUSTER}"
log "Found \"${FOUND_MEMBERS}\", expected \"${EXPECTED_MEMBERS}\""
exit 1
fi
}