Files
MaxScale/maxscale-system-test/mxs1045.cpp
Niclas Antti c447e5cf15 Uncrustify maxscale
See script directory for method. The script to run in the top level
MaxScale directory is called maxscale-uncrustify.sh, which uses
another script, list-src, from the same directory (so you need to set
your PATH). The uncrustify version was 0.66.
2018-09-09 22:26:19 +03:00

37 lines
962 B
C++

/**
* @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.maxscales->ssh_node(0,
"if [ \"`ps -ef|grep defunct|grep -v grep`\" != \"\" ]; then exit 1; fi",
false);
test.add_result(res, "Zombie processes were found");
test.repl->unblock_node(0);
return test.global_result;
}