Page Menu
Home
ClusterLabs Projects
Search
Configure Global Search
Log In
Files
F1842187
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/cts/cluster_test b/cts/cluster_test
index e2c33c8b52..3e186a8e6c 100755
--- a/cts/cluster_test
+++ b/cts/cluster_test
@@ -1,170 +1,169 @@
#!/bin/bash
anyAsked=0
if [ -e ~/.cts ]; then
. ~/.cts
fi
CTS_master=`uname -n`
CTS_numtests=$1
if [ -z "$CTS_master" ]; then
anyAsked=1
echo "This script should only be executed on the test master."
echo "The test master will remotely execute the actions required by the tests and should not be part of the cluster itself."
read -p "Is this host intended to be the test master? (yN)" CTS_master
if [ "$CTS_master" != "y" ]; then
echo "This script must be executed on the test master"
exit 1
fi
fi
if [ -z "$CTS_node_list" ]; then
anyAsked=1
read -p "Please list your cluster nodes (eg. node1 node2 node3): " CTS_node_list
else
echo "Beginning test of cluster: $CTS_node_list"
fi
if [ -z "$CTS_stack" ]; then
anyAsked=1
read -p "Which cluster stack are you using? ([corosync], openais, or heartbeat): " CTS_stack
[ -n "$CTS_stack" ] || CTS_stack=corosync
else
echo "Using the $CTS_stack cluster stack"
fi
-tmp=`echo "${CTS_node_list}" | sed "s/$HOSTNAME//"`
-if [ "${CTS_node_list}" != "${tmp}" ]; then
+if [ "${CTS_node_list}" != "${CTS_node_list/$HOSTNAME/}" ]; then
echo "This script must be executed on the test master and the test master cannot be part of the cluster"
exit 1
fi
printf "+ Bootstraping ssh... "
if [ -z "$SSH_AUTH_SOCK" ]; then
printf "\n + Initializing SSH "
agent_tmp=/tmp/.$$.ssh
ssh-agent > $agent_tmp
. "$agent_tmp"
rm "$agent_tmp"
echo " + Adding identities..."
ssh-add
rc=$?
if [ $rc -ne 0 ]; then
echo " -- No identities added"
printf "\nThe ability to open key-based 'ssh' connections (as the user 'root') is required to use CTS.\n"
read -p " - Do you want this program to help you create one? (yN)" auto_fix
if [ "$auto_fix" = "y" ]; then
ssh-keygen -t dsa
ssh-add
else
echo "Please run 'ssh-keygen -t dsa' to create a new key"
exit 1
fi
fi
else
echo "OK"
fi
test_ok=1
printf "+ Testing ssh configuration... "
for n in $CTS_node_list; do
ssh -l root -o PasswordAuthentication=no -o ConnectTimeout=5 "$n" /bin/true
rc=$?
if [ $rc -ne 0 ]; then
echo " - connection to $n failed"
test_ok=0
fi
done
if [ $test_ok -eq 0 ]; then
printf "\n\nThe ability to open key-based 'ssh' connections (as the user 'root') is required to use CTS.\n"
printf " Please install one of your SSH public keys to root's account on all cluster nodes\n"
# todo - look for identities and guide the installation of one
exit 1
fi
echo "OK"
if [ -z "$CTS_logfile" ]; then
anyAsked=1
read -p " + Where does/should syslog store logs from remote hosts? (/var/log/messages) " CTS_logfile
[ -n "$CTS_logfile" ] || CTS_logfile=/var/log/messages
fi
if [ ! -e "$CTS_logfile" ]; then
echo "$CTS_logfile doesn't exist"
exit 1
fi
if [ -z "$CTS_logfacility" ]; then
anyAsked=1
read -p " + Which log facility does the cluster use? (daemon) " CTS_logfacility
[ -n "$CTS_logfacility" ] || CTS_logfacility=daemon
fi
if [ -z "$CTS_boot" ]; then
read -p "+ Is the cluster software started automatically when a node boots? [yN] " CTS_boot
if [ -z "$CTS_boot" ]; then
CTS_boot=0
else
case $CTS_boot in
1|y|Y) CTS_boot=1;;
*) CTS_boot=0;;
esac
fi
fi
if [ -z "$CTS_numtests" ]; then
read -p "+ How many test iterations should be performed? (500) " CTS_numtests
[ -n "$CTS_numtests" ] || CTS_numtests=500
fi
if [ -z "$CTS_asked_once" ]; then
anyAsked=1
read -p "+ What type of STONITH agent do you use? (none) " CTS_stonith
[ -z "$CTS_stonith" ] \
|| read -p "+ List any STONITH agent parameters (eq. device_host=switch.power.com): " CTS_stonith_args
[ -n "$CTS_adv" ] \
|| read -p "+ (Advanced) Any extra CTS parameters? (none) " CTS_adv
fi
[ $anyAsked -eq 0 ] \
|| read -p "+ Save values to ~/.cts for next time? (yN) " doSave
if [ "$doSave" = "y" ]; then
cat > ~/.cts <<-EOF
# CTS Test data
CTS_master="$CTS_master"
CTS_stack="$CTS_stack"
CTS_node_list="$CTS_node_list"
CTS_logfile="$CTS_logfile"
CTS_logport="$CTS_logport"
CTS_logfacility="$CTS_logfacility"
CTS_asked_once=1
CTS_adv="$CTS_adv"
CTS_stonith="$CTS_stonith"
CTS_stonith_args="$CTS_stonith_args"
CTS_boot="$CTS_boot"
EOF
fi
cts_extra=""
if [ -n "$CTS_stonith" ]; then
cts_extra="$cts_extra --stonith-type $CTS_stonith"
[ -z "$CTS_stonith_args" ] \
|| cts_extra="$cts_extra --stonitha-params \"$CTS_stonith_args\""
else
cts_extra="$cts_extra --stonith 0"
echo " - Testing a cluster without STONITH is like a blunt pencil... pointless"
fi
printf "\nAll set to go for %d iterations!\n" "$CTS_numtests"
[ $anyAsked -ne 0 ] \
|| echo "+ To use a different configuration, remove ~/.cts and re-run cts (or edit it manually)."
echo Now paste the following command into this shell:
echo "python `dirname "$0"`/CTSlab.py -L \"$CTS_logfile\" --syslog-facility \"$CTS_logfacility\" --no-unsafe-tests --stack \"$CTS_stack\" $CTS_adv --at-boot \"$CTS_boot\" $cts_extra \"$CTS_numtests\" --nodes \"$CTS_node_list\""
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Nov 23, 1:43 PM (19 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1018760
Default Alt Text
(5 KB)
Attached To
Mode
rP Pacemaker
Attached
Detach File
Event Timeline
Log In to Comment