diff options
author | Francis Dupont <fdupont@isc.org> | 2021-12-22 14:08:18 +0100 |
---|---|---|
committer | Francis Dupont <fdupont@isc.org> | 2022-01-06 13:12:40 +0100 |
commit | bd39cad27d3257b75c5344f792451f72a20522da (patch) | |
tree | 68872916ed3a3907650590db6e0b9449c433aa6f /src | |
parent | [#34] Addressed some comments (diff) | |
download | kea-bd39cad27d3257b75c5344f792451f72a20522da.tar.xz kea-bd39cad27d3257b75c5344f792451f72a20522da.zip |
[#34] Added VALID_HOST_TCP
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/database/testutils/schema.cc | 1 | ||||
-rw-r--r-- | src/lib/database/testutils/schema.h | 1 | ||||
-rw-r--r-- | src/lib/mysql/tests/mysql_connection_unittest.cc | 10 |
3 files changed, 7 insertions, 5 deletions
diff --git a/src/lib/database/testutils/schema.cc b/src/lib/database/testutils/schema.cc index 1edc48209c..9ad27e2d48 100644 --- a/src/lib/database/testutils/schema.cc +++ b/src/lib/database/testutils/schema.cc @@ -23,6 +23,7 @@ const char* INVALID_TYPE = "type=unknown"; const char* VALID_NAME = "name=keatest"; const char* INVALID_NAME = "name=invalidname"; const char* VALID_HOST = "host=localhost"; +const char* VALID_HOST_TCP = "host=127.0.0.1"; const char* INVALID_HOST = "host=invalidhost"; const char* VALID_USER = "user=keatest"; const char* VALID_READONLY_USER = "user=keatest_readonly"; diff --git a/src/lib/database/testutils/schema.h b/src/lib/database/testutils/schema.h index 41139ea38f..38b72ff43d 100644 --- a/src/lib/database/testutils/schema.h +++ b/src/lib/database/testutils/schema.h @@ -19,6 +19,7 @@ extern const char* INVALID_TYPE; extern const char* VALID_NAME; extern const char* INVALID_NAME; extern const char* VALID_HOST; +extern const char* VALID_HOST_TCP; extern const char* INVALID_HOST; extern const char* VALID_USER; extern const char* VALID_READONLY_USER; diff --git a/src/lib/mysql/tests/mysql_connection_unittest.cc b/src/lib/mysql/tests/mysql_connection_unittest.cc index c8106fe5ff..972f5f683b 100644 --- a/src/lib/mysql/tests/mysql_connection_unittest.cc +++ b/src/lib/mysql/tests/mysql_connection_unittest.cc @@ -699,7 +699,7 @@ TEST_F(MySqlSecureConnectionTest, Tls) { return; } std::string conn_str = connectionString(MYSQL_VALID_TYPE, VALID_NAME, - VALID_HOST, VALID_SECURE_USER, + VALID_HOST_TCP, VALID_SECURE_USER, VALID_PASSWORD, 0, 0, VALID_CERT, VALID_KEY, VALID_CA, VALID_CIPHER); @@ -719,7 +719,7 @@ TEST_F(MySqlSecureConnectionTest, TlsInvalidPassword) { return; } std::string conn_str = connectionString(MYSQL_VALID_TYPE, VALID_NAME, - VALID_HOST, VALID_SECURE_USER, + VALID_HOST_TCP, VALID_SECURE_USER, INVALID_PASSWORD, 0, 0, VALID_CERT, VALID_KEY, VALID_CA, VALID_CIPHER); @@ -735,7 +735,7 @@ TEST_F(MySqlSecureConnectionTest, TlsNoCrypto) { return; } std::string conn_str = connectionString(MYSQL_VALID_TYPE, VALID_NAME, - VALID_HOST, VALID_SECURE_USER, + VALID_HOST_TCP, VALID_SECURE_USER, VALID_PASSWORD); MySqlConnection conn(DatabaseConnection::parse(conn_str)); EXPECT_THROW(conn.openDatabase(), DbOpenError); @@ -749,7 +749,7 @@ TEST_F(MySqlSecureConnectionTest, TlsInvalidKey) { return; } std::string conn_str = connectionString(MYSQL_VALID_TYPE, VALID_NAME, - VALID_HOST, VALID_SECURE_USER, + VALID_HOST_TCP, VALID_SECURE_USER, VALID_PASSWORD, 0, 0, VALID_CERT, INVALID_KEY, VALID_CA, VALID_CIPHER); @@ -765,7 +765,7 @@ TEST_F(MySqlSecureConnectionTest, TlsNoKey) { return; } std::string conn_str = connectionString(MYSQL_VALID_TYPE, VALID_NAME, - VALID_HOST, VALID_SECURE_USER, + VALID_HOST_TCP, VALID_SECURE_USER, VALID_PASSWORD, 0, 0, VALID_CERT, 0, VALID_CA, VALID_CIPHER); |