]> git.proxmox.com Git - mirror_corosync.git/blob - test/ploadstart.sh
build: make path to bash configurable at build time
[mirror_corosync.git] / test / ploadstart.sh
1 #!@BASHPATH@
2
3 set -e
4
5 msg_count=""
6 msg_size=""
7
8 usage() {
9 echo "ploadstart [options]"
10 echo ""
11 echo "Options:"
12 echo " -c msg_count Number of messages to send (max UINT32_T default 1500000)"
13 echo " -s msg_size Size of messages in bytes (max 1000000 default 300)"
14 echo " -h display this help"
15 }
16
17 while getopts "hs:c:" optflag; do
18 case "$optflag" in
19 h)
20 usage
21 exit 0
22 ;;
23 c)
24 msg_count="$OPTARG"
25 ;;
26 s)
27 msg_size="$OPTARG"
28 ;;
29 \?|:)
30 usage
31 exit 1
32 ;;
33 esac
34 done
35
36 [ -n "$msg_count" ] && corosync-cmapctl -s pload.count u32 $msg_count
37 [ -n "$msg_size" ] && corosync-cmapctl -s pload.size u32 $msg_size
38
39 echo "***** WARNING *****"
40 echo ""
41 echo "Running pload test will kill your cluster and all corosync daemons will exit"
42 echo "at the end of the load test"
43 echo ""
44 echo "***** END OF WARNING *****"
45 echo ""
46 echo "YOU HAVE BEEN WARNED"
47 echo ""
48 echo "If you agree, and want to proceed, please type:"
49 echo "Yes, I fully understand the risks of what I am doing"
50 echo ""
51 read -p "type here: " ans
52
53 [ "$ans" = "Yes, I fully understand the risks of what I am doing" ] || {
54 echo "Wise choice.. or you simply didn't type it right"
55 exit 0
56 }
57
58 corosync-cmapctl -s pload.start str i_totally_understand_pload_will_crash_my_cluster_and_kill_corosync_on_exit
59
60 echo "PLOAD started, please see corosync.log for final results"