MXS-2252: Add test case
Added a test case that verifies the correct user is used.
This commit is contained in:
parent
db98ecbaa1
commit
511f01a28d
@ -153,6 +153,14 @@ public:
|
||||
int connect(int i, const std::string& db = "test");
|
||||
int connect(const std::string& db = "test");
|
||||
|
||||
/**
|
||||
* Get a Connection to a node
|
||||
*/
|
||||
Connection get_connection(int i, const std::string& db = "test")
|
||||
{
|
||||
return Connection(IP[i], port[i], user_name, password, db, ssl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Repeatedly try to connect with one second sleep in between attempts
|
||||
*
|
||||
|
@ -167,6 +167,20 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* MXS-2252: Proxy Protocol not displaying originating IP address in SHOW PROCESSLIST
|
||||
* https://jira.mariadb.org/browse/MXS-2252
|
||||
*/
|
||||
Connection direct = test.repl->get_connection(0);
|
||||
Connection rwsplit = test.maxscales->rwsplit(0);
|
||||
direct.connect();
|
||||
rwsplit.connect();
|
||||
auto d = direct.field("SELECT USER()");
|
||||
auto r = rwsplit.field("SELECT USER()");
|
||||
test.tprintf("Direct: %s Readwritesplit: %s", d.c_str(), r.c_str());
|
||||
test.expect(d == r, "Both connections should return the same user: %s != %s", d.c_str(), r.c_str());
|
||||
|
||||
if (server_proxy_setting)
|
||||
{
|
||||
// Restore server settings.
|
||||
|
Loading…
x
Reference in New Issue
Block a user