diff --git a/cts/cts.in b/cts/cts.in index c71ce31675..5fc9313094 100755 --- a/cts/cts.in +++ b/cts/cts.in @@ -1,224 +1,205 @@ #!@BASH_PATH@ # # Copyright 2012-2025 the Pacemaker project contributors # # The version control history for this file may have further details. # # This source code is licensed under the GNU General Public License version 2 # or later (GPLv2+) WITHOUT ANY WARRANTY. # cts_root=`dirname $0` summary=0 verbose=0 -watch=0 tests="" clean=0 run=0 boot=0 custom_log="" patterns="-e CTS:" helpmsg=$(cat </dev/null if [ $? != 0 ]; then echo $0 needs the cluster-helper script to be in your path exit 1 fi which cluster-clean &>/dev/null if [ $? != 0 ]; then echo $0 needs the cluster-clean script to be in your path exit 1 fi if [ "x$cluster_name" = x ] ; then clusters=`ls -1 ~/.dsh/group/[a-z]+[0-9] | sed s/.*group.// | tr '\n' ' ' ` echo "custom) interactively define a cluster" for i in $clusters; do echo "$i) `cluster-helper --list short -g $i`" done read -p "Choose a cluster [custom]: " cluster_name echo fi if [ -z $cluster_name ]; then cluster_name=custom fi case $cluster_name in custom) read -p "Cluster name: " cluster_name read -p "Cluster hosts: " cluster_hosts read -p "Cluster log file: " cluster_log cluster-helper add -g "$cluster_name" -w "$cluster_hosts" ;; *) cluster_hosts=`cluster-helper --list short -g $cluster_name` cluster_log=~/cluster-$cluster_name.log ;; esac if [ $run = 1 ]; then clean=1 fi if [ $clean = 1 ]; then rm -f $cluster_log cluster-clean -g $cluster_name --kill fi if [ $boot = 1 ]; then $cts_root/cts-lab -r -c -g $cluster_name --boot rc=$? if [ $rc = 0 ]; then echo "The cluster is ready..." fi exit $rc elif [ $run = 1 ]; then $cts_root/cts-lab -r -c -g $cluster_name 500 "$@" exit $? elif [ $clean = 1 ]; then exit 0 fi if [ ! -z $custom_log ]; then cluster_log=$custom_log fi if [ "x$tests" != x ] && [ "x$tests" != "x " ]; then for t in $tests; do echo "crm_report --cts-log $cluster_log -d -T $t" crm_report --cts-log $cluster_log -d -T $t done elif [ $summary = 1 ]; then echo $cluster_log case $verbose in 0) cat -n $cluster_log | grep $patterns | grep -v "CTS: debug:" ;; 1) cat -n $cluster_log | grep $patterns | grep -v "CTS:.* cmd:" ;; *) cat -n $cluster_log | grep $patterns ;; esac echo "" - -elif [ $watch = 1 ]; then - case $verbose in - 0) - tail -F $cluster_log | grep $patterns | grep -v "CTS: debug:" - ;; - 1) - tail -F $cluster_log | grep $patterns | grep -v "CTS:.* cmd:" - ;; - *) - tail -F $cluster_log | grep $patterns - ;; - esac fi # vim: set filetype=sh: