Files
MaxScale/maxscale-system-test/mxs621_unreadable_cnf.cpp
Markus Mäkelä 4b6aab1417 Replace check_log_err with log_includes/log_excludes
The latter are more explicit and easier to understand at the call site.

Also removed the redundant crash checks via the log files.
2018-11-19 20:02:11 +02:00

34 lines
911 B
C++

/**
* @file max621_unreadable_cnf.cpp mxs621 regression case ("MaxScale fails to start silently if config file is
* not readable")
*
* - make maxscale.cnf unreadable
* - try to restart Maxscale
* - check log for error
* - retore access rights to maxscale.cnf
*/
#include <iostream>
#include <unistd.h>
#include "testconnections.h"
using namespace std;
int main(int argc, char* argv[])
{
TestConnections* Test = new TestConnections(argc, argv);
Test->set_timeout(30);
Test->maxscales->ssh_node_f(0, true, "chmod 400 /etc/maxscale.cnf");
Test->set_timeout(30);
Test->maxscales->restart_maxscale(0);
Test->set_timeout(30);
Test->log_includes(0, "Opening file '/etc/maxscale.cnf' for reading failed");
Test->set_timeout(30);
Test->maxscales->ssh_node_f(0, true, "chmod 777 /etc/maxscale.cnf");
int rval = Test->global_result;
delete Test;
return rval;
}