Avoid using test.repl->N in MariaDBMonitor tests

The value may not match the nodes used by the test.
This commit is contained in:
Esa Korhonen
2020-11-24 10:42:52 +02:00
parent abd1efefc6
commit 885077b4d0
11 changed files with 20 additions and 19 deletions

View File

@ -29,13 +29,14 @@ int main(int argc, char** argv)
test.repl->connect();
delete_slave_binlogs(test);
const int N = 4;
// Enable the disks-plugin on all servers. Has to be done before MaxScale is on to prevent disk space
// monitoring from disabling itself.
bool disks_plugin_loaded = false;
const char strict_mode[] = "SET GLOBAL gtid_strict_mode=%i;";
test.repl->connect();
for (int i = 0; i < test.repl->N; i++)
for (int i = 0; i < N; i++)
{
MYSQL* conn = test.repl->nodes[i];
test.try_query(conn, "INSTALL SONAME 'disks';");
@ -149,8 +150,8 @@ int main(int argc, char** argv)
if (disks_plugin_loaded)
{
// Enable the disks-plugin on all servers.
for (int i = 0; i < test.repl->N; i++)
// Disable the disks-plugin on all servers.
for (int i = 0; i < N; i++)
{
MYSQL* conn = test.repl->nodes[i];
test.try_query(conn, "UNINSTALL SONAME 'disks';");