tripleo-ci/scripts/generate-kill-heat.sh
Steve Kowalik 61c15b68a0 Add generate-kill-heat
This script is used to generate a shell script that will utilise
os-collect-config to cause a large amount of load in heat, nova
and keystone. It is a horrible script, but this is the simplest place
to store it so it does not get lost.

Change-Id: Ibdd9b70966b7e4ce600f2d88701dfa9f155ad167
2014-07-04 15:52:44 +10:00

27 lines
783 B
Bash
Executable File

#!/bin/bash
set -eu
set -o pipefail
TMPFILE=$(mktemp)
TMP2FILE=$(mktemp)
function heat_resource_metadata() {
# Build os-collect-config command line arguments for the given heat
# resource, which when run, allow us to collect the heat completion
# signals.
heat resource-metadata overcloud $1 | jq '.["os-collect-config"]["cfn"]' | grep \" | tr -d '\n' | sed -e 's/"//g' -e 's/_/-/g' -e 's/: / /g' -e 's/, / --cfn-/g' -e 's/^ /--cfn-/' -e 's/$/ --print/'
echo
}
>$TMPFILE
heat_resource_metadata controller0 >>$TMPFILE
for i in $(seq 0 34) ; do
heat_resource_metadata NovaCompute$i >>$TMPFILE
done
sed -e 's/^/os-collect-config /' -e 's/$/ \&/' < $TMPFILE > $TMP2FILE
echo "#!/bin/sh\nset -e\n" > $TMPFILE
cat $TMPFILE $TMP2FILE > "kill-heat"
chmod +x "kill-heat"