29 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
/**
 | 
						|
 * @file regexfilter1.cpp Simple regexfilter tests; aslo regression case for mxs508 ("regex filter ignores
 | 
						|
 * username")
 | 
						|
 *
 | 
						|
 * Three services are configured with regexfilter, each with different parameters.
 | 
						|
 * All services are queried with SELECT 123. The first service should replace it
 | 
						|
 * with SELECT 0 and the second and third services should not replace it.
 | 
						|
 */
 | 
						|
 | 
						|
 | 
						|
#include <iostream>
 | 
						|
#include <maxtest/testconnections.hh>
 | 
						|
 | 
						|
int main(int argc, char* argv[])
 | 
						|
{
 | 
						|
    TestConnections* test = new TestConnections(argc, argv);
 | 
						|
    test->maxscales->connect_maxscale(0);
 | 
						|
    test->add_result(execute_query_check_one(test->maxscales->conn_rwsplit[0], "SELECT 123", "0"),
 | 
						|
                     "Query to first service should have replaced the query.\n");
 | 
						|
    test->add_result(execute_query_check_one(test->maxscales->conn_slave[0], "SELECT 123", "123"),
 | 
						|
                     "Query to second service should not have replaced the query.\n");
 | 
						|
    test->add_result(execute_query_check_one(test->maxscales->conn_master[0], "SELECT 123", "123"),
 | 
						|
                     "Query to third service should not have replaced the query.\n");
 | 
						|
    test->maxscales->close_maxscale_connections(0);
 | 
						|
    int rval = test->global_result;
 | 
						|
    delete test;
 | 
						|
    return rval;
 | 
						|
}
 |