Merge branch '2.3' into 2.4

This commit is contained in:
Timofey Turenko 2020-11-18 15:36:13 +02:00
commit 32b1ca147e
7 changed files with 45 additions and 22 deletions

View File

@ -9,6 +9,15 @@
#include <iostream>
#include <maxtest/testconnections.hh>
int install_kerberos(std::string machine_name, std::string maria_version)
{
int res = system((std::string("mdbci install_product --product kerberos_server ") + machine_name).c_str());
// Ignoring exit code becase in some versions of MariaDB gssapi is included into client/server
system((std::string("mdbci install_product --product plugin_gssapi_client --product-version ") + maria_version + " " + machine_name).c_str());
system((std::string("mdbci install_product --product plugin_gssapi_server --product-version ") + maria_version + " " + machine_name).c_str());
return res;
}
int main(int argc, char* argv[])
{
TestConnections* Test = new TestConnections(argc, argv);
@ -36,14 +45,8 @@ int main(int argc, char* argv[])
sprintf(str, "%s/krb5.conf", test_dir);
for (i = 0; i < Test->repl->N; i++)
{
Test->repl->ssh_node(i,
(char*)
"yum clean all",
true);
Test->repl->ssh_node(i,
(char*)
"yum install -y MariaDB-gssapi-server MariaDB-gssapi-client krb5-workstation pam_krb5",
true);
install_kerberos(Test->get_mdbci_config_name() + "/" + Test->repl->mdbci_node_name(i), get_str_version(std::string(Test->repl->version[i])));
Test->repl->copy_to_node_legacy(str, Test->repl->access_homedir[i], i);
sprintf(str1, "cp %s/krb5.conf /etc/", Test->repl->access_homedir[i]);
Test->repl->ssh_node(i, str1, true);
@ -62,18 +65,9 @@ int main(int argc, char* argv[])
Test->maxscales->ssh_node_f(0, true, (char*) "cp %s/krb5.conf /etc/", Test->maxscales->access_homedir[0]);
Test->tprintf("Instaling Kerberos server packages to Maxscale node\n");
Test->maxscales->ssh_node(0, (char*) "yum clean all", true);
Test->maxscales->ssh_node(0, (char*) "yum install rng-tools -y", true);
Test->maxscales->ssh_node(0, (char*) "rngd -r /dev/urandom -o /dev/random", true);
Test->maxscales->ssh_node(0,
(char*)
"yum install -y MariaDB-gssapi-server MariaDB-gssapi-client krb5-server krb5-workstation pam_krb5",
true);
install_kerberos(Test->get_mdbci_config_name() + "/" + Test->maxscales->mdbci_node_name(0), get_str_version(std::string(Test->repl->version[0])));
Test->maxscales->ssh_node_f(0,
true,
(char*)
"yum install -y MariaDB-gssapi-server MariaDB-gssapi-client krb5-server krb5-workstation pam_krb5");
Test->maxscales->ssh_node(0, (char*) "rngd -r /dev/urandom -o /dev/random", true);
Test->tprintf("Configuring Kerberos server\n");
Test->maxscales->ssh_node(0,

View File

@ -253,6 +253,13 @@ Result get_result(MYSQL* conn, std::string sql);
int get_int_version(std::string version);
/**
* @brief get_str_version Extract version number from full version string
* @param version
* @return MariaDB version in xx.xx.xx format
*/
std::string get_str_version(std::string version);
// Helper class for performing queries
class Connection
{

View File

@ -106,10 +106,17 @@ public:
*/
const char* ip(int i = 0) const;
/**
* @brief mdbci_node_name
* @param node
* @return name of the node in MDBCI format
*/
std::string mdbci_node_name(int node);
/**
* @brief Generate command line to execute command on the node via ssh
* @param cmd result
* @param index index number of the node (index)
* @param node number of the node (index)
* @param ssh command to execute
* @param sudo if true the command is executed with root privelegues
*/
@ -117,7 +124,7 @@ public:
/**
* @brief executes shell command on the node using ssh
* @param index number of the node (index)
* @param node number of the node (index)
* @param ssh command to execute
* @param sudo if true the command is executed with root privelegues
* @param pointer to variable to store process exit code

View File

@ -561,6 +561,8 @@ public:
*/
int reinstall_maxscales();
std::string get_mdbci_config_name() {return m_mdbci_config_name;}
private:
void report_result(const char* format, va_list argp);
void copy_one_mariadb_log(Mariadb_nodes* nrepl, int i, std::string filename);

View File

@ -608,6 +608,15 @@ int get_int_version(std::string version)
return major * 10000 + minor * 100 + patch;
}
std::string get_str_version(std::string version)
{
std::string str_version;
int i = version.find('-');
if (i > 0) return version.substr(0, i);
return version;
}
bool Connection::connect()
{
mysql_close(m_conn);

View File

@ -401,6 +401,11 @@ const char* Nodes::ip(int i) const
return use_ipv6 ? IP6[i] : IP[i];
}
std::string Nodes::mdbci_node_name(int node)
{
return(string_printf("%s_%03d", prefix, node));
}
std::string Nodes::get_nc_item(const char* item_name)
{
size_t start = network_config.find(item_name);

View File

@ -104,7 +104,6 @@ else
eval "arguments=(${test_set})"
ctest -N "${arguments[@]}"
ctest -VV "${arguments[@]}"
ctest --rerun-failed -VV
fi
if [[ "$name" =~ '-gcov' ]]