Files
MaxScale/maxscale-system-test/labels_table.h
2019-09-16 12:17:12 +03:00

40 lines
1.2 KiB
C++

#pragma once
#include <string>
struct labels_table_t
{
std::string test_label;
std::string mdbci_label;
};
const labels_table_t labels_table [] __attribute__((unused)) =
{
{"REPL_BACKEND", "REPL_BACKEND"},
{"BIG_REPL_BACKEND", "BIG_REPL_BACKEND"},
{"GALERA_BACKEND", "GALERA_BACKEND"},
{"TWO_MAXSCALES", "SECOND_MAXSCALE"},
{"COLUMNSTORE_BACKEND", "COLUMNSTORE_BACKEND"},
{"CLUSTRIX_BACKEND", "CLUSTRIX_BACKEND"},
};
/**
* @brief get_mdbci_lables Finds all MDBCI labels which are needed by test
* Every test has a number of labels defined in the CMakeLists.txt,
* some of these lables defines which nodes (virtual machines) are needed
* for this particular test. Function finds such labels and forms labels string
* in the 'mdbci up' command format
* @param labels_string All lables from CMakeLists.txt
* @return Labels string in the 'mdbci up' --labels parameter format
*/
std::string get_mdbci_lables(const char * labels_string);
/**
* @brief check_label Checks if givel lable belogs to current test labels
* @param labels String with all labels of the test
* @param label Labels to find
* @return true if label present
*/
bool has_label(std::string labels, std::string label);