From 4dc9b56d290d0ee6e25ba8c9b470efe8f8b8d386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 26 Jan 2018 10:41:34 +0200 Subject: [PATCH] Fix check_backend Fixed the core generation and removed obsolete files. --- maxscale-system-test/check_backend.cpp | 17 ++++------------- maxscale-system-test/mdbci/add_core_cnf.sh | 6 +++++- maxscale-system-test/mdbci/configure_core.sh | 11 ----------- 3 files changed, 9 insertions(+), 25 deletions(-) delete mode 100755 maxscale-system-test/mdbci/configure_core.sh diff --git a/maxscale-system-test/check_backend.cpp b/maxscale-system-test/check_backend.cpp index 83579ae48..e84c1ae82 100644 --- a/maxscale-system-test/check_backend.cpp +++ b/maxscale-system-test/check_backend.cpp @@ -8,23 +8,14 @@ int main(int argc, char *argv[]) { - char src[1024]; - char dst[1024]; TestConnections * Test = new TestConnections(argc, argv); - for (int i = 0; i < Test->maxscales->N; i++) - { - sprintf(src, "%s/mdbci/add_core_cnf.sh", test_dir); - Test->maxscales->ssh_node_f(i, false, "mkdir %s/ccore", Test->maxscales->access_homedir[i]); - sprintf(dst, "%s/ccore/", Test->maxscales->access_homedir[i]); - Test->maxscales->copy_to_node(i, src, dst); - sprintf(dst, "%s/ccore/", Test->maxscales->access_homedir[i]); - Test->maxscales->ssh_node_f(i, true, "%s/ccore/add_core_cnf.sh", Test->maxscales->access_homedir[i]); - } + std::string src = std::string(test_dir) + "/mdbci/add_core_cnf.sh"; + Test->copy_to_maxscale(src.c_str(), Test->maxscale_access_homedir); + Test->ssh_maxscale(true, "%s/add_core_cnf.sh %s", Test->maxscale_access_homedir, + Test->verbose ? "verbose" : ""); - /*Test->restart_maxscale(); - sleep(5);*/ Test->set_timeout(10); Test->tprintf("Connecting to Maxscale routers with Master/Slave backend\n"); diff --git a/maxscale-system-test/mdbci/add_core_cnf.sh b/maxscale-system-test/mdbci/add_core_cnf.sh index aa5db1828..21a69f460 100755 --- a/maxscale-system-test/mdbci/add_core_cnf.sh +++ b/maxscale-system-test/mdbci/add_core_cnf.sh @@ -1,4 +1,8 @@ -set -x +if [ "$1" == "verbose" ] +then + set -x +fi + chmod 777 /tmp/ echo 2 > /proc/sys/fs/suid_dumpable sed -i "s/start() {/start() { \n export DAEMON_COREFILE_LIMIT='unlimited'; ulimit -c unlimited; /" /etc/init.d/maxscale diff --git a/maxscale-system-test/mdbci/configure_core.sh b/maxscale-system-test/mdbci/configure_core.sh deleted file mode 100755 index 2c72b5ac9..000000000 --- a/maxscale-system-test/mdbci/configure_core.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -set -x - -ssh -i $maxscale_sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $maxscale_access_user@$maxscale_IP '$maxscale_access_sudo service iptables stop' - -ssh -i $maxscale_sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $maxscale_access_user@$maxscale_IP "$maxscale_access_sudo mkdir ccore; $maxscale_access_sudo chown $maxscale_access_user ccore" - -scp -i $maxscale_sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ${script_dir}/add_core_cnf.sh $maxscale_access_user@$maxscale_IP:./ccore/ -ssh -i $maxscale_sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $maxscale_access_user@$maxscale_IP "$maxscale_access_sudo /home/$maxscale_access_user/ccore/add_core_cnf.sh" - -set +x