From a8487a945a5128dfdfa621d658ac9e51fda8a995 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Wed, 22 May 2019 12:04:08 +0300 Subject: [PATCH] MXS-2481 When Clustrix [un]block health port as well In the case of Clustrix, it is not sufficient to block the MariaDB port alone, but the health-check port must be blocked as well. --- maxscale-system-test/clustrix_nodes.cpp | 26 +++++++++++++++++++++++++ maxscale-system-test/clustrix_nodes.h | 3 +++ 2 files changed, 29 insertions(+) diff --git a/maxscale-system-test/clustrix_nodes.cpp b/maxscale-system-test/clustrix_nodes.cpp index 5e5dba584..c2588b391 100644 --- a/maxscale-system-test/clustrix_nodes.cpp +++ b/maxscale-system-test/clustrix_nodes.cpp @@ -87,3 +87,29 @@ int Clustrix_nodes::check_replication() return res; } + +string Clustrix_nodes::block_command(int node) const +{ + string command = Mariadb_nodes::block_command(node); + + // Block health-check port as well. + command += ";"; + command += "iptables -I INPUT -p tcp --dport 3581 -j REJECT"; + command += ";"; + command += "ip6tables -I INPUT -p tcp --dport 3581 -j REJECT"; + + return command; +} + +string Clustrix_nodes::unblock_command(int node) const +{ + string command = Mariadb_nodes::unblock_command(node); + + // Unblock health-check port as well. + command += ";"; + command += "iptables -I INPUT -p tcp --dport 3581 -j ACCEPT"; + command += ";"; + command += "ip6tables -I INPUT -p tcp --dport 3581 -j ACCEPT"; + + return command; +} diff --git a/maxscale-system-test/clustrix_nodes.h b/maxscale-system-test/clustrix_nodes.h index a342b3e4c..af6643339 100644 --- a/maxscale-system-test/clustrix_nodes.h +++ b/maxscale-system-test/clustrix_nodes.h @@ -54,4 +54,7 @@ public: * @return 0 in case of success */ int prepare_server(int i); + + std::string block_command(int node) const override; + std::string unblock_command(int node) const override; };