|
|
|
|
@ -6,7 +6,7 @@ from proxysql_base_test import ProxySQLBaseTest
|
|
|
|
|
|
|
|
|
|
class AuthenticationTest(ProxySQLBaseTest):
|
|
|
|
|
|
|
|
|
|
def _test_existing_user_with_correct_password_works(self):
|
|
|
|
|
def test_existing_user_with_correct_password_works(self):
|
|
|
|
|
version1 = self.run_query_mysql(
|
|
|
|
|
"SELECT @@version_comment LIMIT 1", "test",
|
|
|
|
|
return_result=True,
|
|
|
|
|
@ -19,10 +19,7 @@ class AuthenticationTest(ProxySQLBaseTest):
|
|
|
|
|
|
|
|
|
|
self.assertEqual(version1, version2)
|
|
|
|
|
|
|
|
|
|
def test_existing_user_with_correct_password_works(self):
|
|
|
|
|
self.run_in_docker_scenarios(self._test_existing_user_with_correct_password_works)
|
|
|
|
|
|
|
|
|
|
def _test_existing_user_with_correct_password_but_not_registerd_within_proxysql_does_not_work(self):
|
|
|
|
|
def test_existing_user_with_correct_password_but_not_registerd_within_proxysql_does_not_work(self):
|
|
|
|
|
try:
|
|
|
|
|
self.run_query_proxysql("SELECT @@version_comment LIMIT 1", "test",
|
|
|
|
|
return_result=True,
|
|
|
|
|
@ -33,10 +30,7 @@ class AuthenticationTest(ProxySQLBaseTest):
|
|
|
|
|
except OperationalError:
|
|
|
|
|
self.assertEqual(1, 1)
|
|
|
|
|
|
|
|
|
|
def test_existing_user_with_correct_password_but_not_registerd_within_proxysql_does_not_work(self):
|
|
|
|
|
self.run_in_docker_scenarios(self._test_existing_user_with_correct_password_works)
|
|
|
|
|
|
|
|
|
|
def _test_existing_user_with_incorrect_password_does_not_work(self):
|
|
|
|
|
def test_existing_user_with_incorrect_password_does_not_work(self):
|
|
|
|
|
try:
|
|
|
|
|
self.run_query_proxysql("SELECT @@version_comment LIMIT 1", "test",
|
|
|
|
|
return_result=True,
|
|
|
|
|
@ -47,17 +41,11 @@ class AuthenticationTest(ProxySQLBaseTest):
|
|
|
|
|
except OperationalError:
|
|
|
|
|
self.assertEqual(1, 1)
|
|
|
|
|
|
|
|
|
|
def test_existing_user_with_incorrect_password_does_not_work(self):
|
|
|
|
|
self.run_in_docker_scenarios(self._test_existing_user_with_incorrect_password_does_not_work)
|
|
|
|
|
|
|
|
|
|
def _test_inexisting_user_with_random_password_does_not_work(self):
|
|
|
|
|
def test_inexisting_user_with_random_password_does_not_work(self):
|
|
|
|
|
try:
|
|
|
|
|
self.run_query_proxysql("SELECT @@version_comment LIMIT 1", "test",
|
|
|
|
|
return_result=True,
|
|
|
|
|
username="johnny", password="randomdoe")
|
|
|
|
|
self.assertEqual(1, 0)
|
|
|
|
|
except OperationalError:
|
|
|
|
|
self.assertEqual(1, 1)
|
|
|
|
|
|
|
|
|
|
def test_inexisting_user_with_random_password_does_not_work(self):
|
|
|
|
|
self.run_in_docker_scenarios(self._test_inexisting_user_with_random_password_does_not_work)
|
|
|
|
|
self.assertEqual(1, 1)
|