add tests

This commit is contained in:
Timofey Turenko
2017-05-17 18:16:06 +03:00
committed by Markus Mäkelä
parent dbfd631fed
commit 8c6ca38a8a
594 changed files with 48376 additions and 0 deletions

View File

@ -0,0 +1,34 @@
/**
* @file mxs1045.cpp Regression case for the bug "Defunct processes after maxscale have executed script during failover"
* - configure monitor:
* @verbatim
script=/bin/sh -c "echo hello world!"
events=master_down,server_down
* @endverbatim
* - block one node
* - Check that script execution doesn't leave zombie processes
*/
#include "testconnections.h"
int main(int argc, char *argv[])
{
TestConnections test(argc, argv);
test.tprintf("Block master");
test.repl->block_node(0);
test.tprintf("Wait for monitor to see it");
sleep(10);
test.tprintf("Check that there are no zombies");
int res = test.ssh_maxscale(false,
"if [ \"`ps -ef|grep defunct|grep -v grep`\" != \"\" ]; then exit 1; fi");
test.add_result(res, "Zombie processes were found");
test.repl->unblock_node(0);
return test.global_result;
}