Move version pronting from call_mdcbi() directly to TestConnectios()

mdbci call can heppen before maxsales object creation and segfault hapens
To avoid it call of ssh for 'maxscale --version-full' is moved to the end
of Testconnections constructor
This commit is contained in:
Timofey Turenko 2019-05-16 14:36:37 +03:00
parent a3e9ce651f
commit 677023a18f

View File

@ -439,6 +439,20 @@ TestConnections::TestConnections(int argc, char *argv[]):
}
}
if (mdbci_call_needed)
{
int ec;
char * ver = maxscales->ssh_node_output(0, "maxscale --version-full", false, &ec);
if (ec)
{
tprintf("Error retrival of Maxscale version info");
}
else
{
tprintf("Maxscale_full_version_start:\n%s\nMaxscale_full_version_end\n", ver);
}
}
char str[1024];
sprintf(str, "mkdir -p LOGS/%s", test_name);
system(str);
@ -2122,16 +2136,6 @@ int TestConnections::call_mdbci(const char * options)
{
maxscales->read_basic_env();
}
int ec;
char * ver = maxscales->ssh_node_output(0, "maxscale --version-full", false, &ec);
if (ec)
{
tprintf("Error retrival of Maxscale version info");
}
else
{
tprintf("Maxscale_full_version_start:\n%s\nMaxscale_full_version_end\n", ver);
}
return 0;
}