Skip tests that cannot be run

If a test requires Galera but it is not available, it is now skipped. All
tests that explicitly use the `test.galera` member as well as all tests
that use a Galera configuration now require that Galera is present.
This commit is contained in:
Markus Mäkelä
2018-11-16 00:10:16 +02:00
parent 11f607de8d
commit 74ec1e7400
16 changed files with 31 additions and 2 deletions

View File

@ -17,6 +17,8 @@
#include "testconnections.h"
using namespace mxb;
using std::cout;
using std::endl;
namespace maxscale
{
@ -27,6 +29,7 @@ static bool manual_debug = false;
static std::string required_repl_version;
static std::string required_galera_version;
static bool restart_galera = false;
static bool require_galera = false;
static bool multiple_maxscales = false;
}
@ -83,6 +86,11 @@ void TestConnections::require_galera_version(const char* version)
maxscale::required_galera_version = version;
}
void TestConnections::require_galera(bool value)
{
maxscale::require_galera = value;
}
void TestConnections::restart_galera(bool value)
{
maxscale::restart_galera = value;
@ -249,6 +257,12 @@ TestConnections::TestConnections(int argc, char* argv[])
test_dir);
setenv("ssl_options", ssl_options, 1);
if (no_galera && maxscale::require_galera)
{
cout << "Galera not in use, skipping test" <<endl;
exit(0);
}
repl = new Mariadb_nodes("node", test_dir, verbose);
if (!no_galera)
{