tripleo-ha-utils/tools/ha-test-suite/ha-test-suite.sh
Raoul Scarazzini 54bec14470 Use Heat template to verify tests
This commit introduces the usage of heat to verify each HA test made.
The test template involves:

- Orchestration (heat);
- Volumes (cinder);
- Images (glance);
- Network, public and private (neutron);
- Server (nova);

Summary of what this commit does:

- Get rid of the workarounds;
- Get rid of undercloud options and its ha-test-suite local copy (now
  useless);
- Get rid of the old environment file needed to spawn instances;
- Get rid of instance test from ha-test-suite;
- Add Heat template verification method;

Change-Id: I2dd9d67f494717654e39c60ac5fb067afb9e1835
2018-02-02 04:51:39 -05:00

81 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
# Raoul Scarazzini (rasca@redhat.com)
# This script provides a testing suite for TripleO HA environments
# Define main workdir
WORKDIR=$(dirname $0)
# Source function library.
. $WORKDIR/include/functions
# Fixed parameters
# How much time wait in seconds for a resource to change status (i.e. from started to stopped)
RESOURCE_CHANGE_STATUS_TIMEOUT=600
# How much time wait in seconds before starting recovery
DEFAULT_RECOVERY_WAIT_TIME=10
# Command line parameters
if [ $# -gt 0 ]
then
while :; do
case $1 in
-h|-\?|--help)
usage
exit
;;
-t|--test)
test_sequence="$2"
shift
;;
-r|--recover)
recovery_sequence="$2"
shift
;;
--)
shift
break
;;
-?*)
usage
exit 1
;;
*)
break
esac
shift
done
else
usage
exit 1
fi
# Populating overcloud elements
echo -n "$(date) - Populationg overcloud elements..."
OVERCLOUD_CORE_RESOURCES="galera redis rabbitmq"
OVERCLOUD_RESOURCES=$(sudo pcs resource show | egrep '^ (C|[a-Z])' | sed 's/.* \[\(.*\)\]/\1/g' | sed 's/ \(.*\)(.*):.*/\1/g' | sort)
OVERCLOUD_SYSTEMD_RESOURCES=$(sudo pcs config show | egrep "Resource:.*systemd"|grep -v "haproxy"|awk '{print $2}')
echo "OK"
if [ -f "$test_sequence" ]
then
echo "$(date) - Test: $(grep '^#.*Test:' $test_sequence | sed 's/^#.*Test: //')"
. $test_sequence
else
echo "No test file passed or unable to read test file."
fi
if [ -f "$recovery_sequence" ]
then
echo "$(date) - Waiting $DEFAULT_RECOVERY_WAIT_TIME seconds to recover environment"
sleep $DEFAULT_RECOVERY_WAIT_TIME
echo "$(date) - Recovery: $(grep '^#.*Recovery:' $recovery_sequence | sed 's/^#.*Recovery: //')"
. $recovery_sequence
else
echo "No recovery file passed or unable to read recovery file."
fi
echo "$(date) - End"