check-patroni/vagrant/check_patroni.sh
benoit d99faeba15 Add tests for the output of the script and support pre/post 3.0.4
* Change all replica status from `running` to `streaming`
* Add an option to pytest to change the state back to `running`
* Also tests the output of the script
* Add a quick test script for live clusters
2023-08-23 10:53:09 +02:00

24 lines
929 B
Bash
Executable file

#!/bin/bash
if [[ -z "$1" ]]; then
echo "usage: $0 PATRONI_END_POINT"
exit 1
fi
echo "-- Running patroni checks using endpoint $1"
echo "-- Cluster checks"
check_patroni -e "$1" cluster_config_has_changed --state-file cluster.sate_file --save &>/dev/null
check_patroni -e "$1" cluster_config_has_changed --state-file cluster.sate_file
check_patroni -e "$1" cluster_has_leader
check_patroni -e "$1" cluster_has_replica
check_patroni -e "$1" cluster_is_in_maintenance
check_patroni -e "$1" cluster_node_count
echo "-- Node checks"
check_patroni -e "$1" node_is_alive
check_patroni -e "$1" node_is_pending_restart
check_patroni -e "$1" node_is_primary
check_patroni -e "$1" node_is_replica
check_patroni -e "$1" node_patroni_version --patroni-version 3.1.0
check_patroni -e "$1" node_tl_has_changed --state-file cluster.sate_file --save &>/dev/null
check_patroni -e "$1" node_tl_has_changed --state-file cluster.sate_file