Skip to content

Commit

Permalink
Add test checking COM_REGISTER_SLAVE enables fast_forward
Browse files Browse the repository at this point in the history
This test runs a custom binlog client, that uses libslave, to test that
ProxySQL activates fast forward automatically after receiving the
command, and to test that it can read the binlog events. The custom
client reads the binlog after sending a query that do not disables
multiplexing and after sending a query that disables multiplexing.
  • Loading branch information
javsanpar committed Jan 13, 2023
1 parent 86fd69a commit b1b3fc4
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/tap/tests/test_com_register_slave_enables_fast_forward-t.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* @file test_com_register_slave_enables_fast_forward-t.cpp @brief Test
* COM_REGISTER_SLAVE enables fast forward. @details Test checks if
* test_binlog_reader is executed successfully using a user with fast forward
* flag set to false. test_binlog_reader sends command COM_REGISTER_SLAVE, then
* ProxySQL enables fast forward. test_binlog_reader then uses libslave to
* listen binlog events. It listen two times, one after sending a query that do
* not disable multiplexing and the other after sending a query that disables
* multiplexing.
*/

#include <string>

#include "tap.h"

int main(int argc, char** argv) {
const std::string test_deps_path = getenv("TEST_DEPS");

const int test_binlog_reader_res = system((test_deps_path + "/test_binlog_reader-t").c_str());
ok(
test_binlog_reader_res == 0,
"'test_binlog_reader-t' should be correctly executed. Err code was: %d",
test_binlog_reader_res
);

return exit_status();
}

0 comments on commit b1b3fc4

Please sign in to comment.