2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-22 09:57:41 +00:00

[#3793] Fixed getVersion tests

This commit is contained in:
Francis Dupont 2025-03-20 14:53:31 +01:00
parent a8833e16e0
commit 2637ca54ab
6 changed files with 24 additions and 24 deletions

View File

@ -583,12 +583,12 @@ TEST_F(CtrlChannelD2Test, getversion) {
sendUnixCommand("{ \"command\": \"version-get\" }", response); sendUnixCommand("{ \"command\": \"version-get\" }", response);
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("log4cplus") != string::npos); EXPECT_TRUE(response.find("log4cplus") != string::npos);
EXPECT_FALSE(response.find("GTEST_VERSION") != string::npos); EXPECT_FALSE(response.find("Hooks directory: ") != string::npos);
// Send the build-report command. // Send the build-report command.
sendUnixCommand("{ \"command\": \"build-report\" }", response); sendUnixCommand("{ \"command\": \"build-report\" }", response);
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("GTEST_VERSION") != string::npos); EXPECT_TRUE(response.find("Hooks directory: ") != string::npos);
} }
// Tests that the server properly responds to list-commands command. // Tests that the server properly responds to list-commands command.

View File

@ -747,12 +747,12 @@ BaseCtrlChannelD2Test::testGetVersion() {
sendHttpCommand("{ \"command\": \"version-get\" }", response); sendHttpCommand("{ \"command\": \"version-get\" }", response);
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("log4cplus") != string::npos); EXPECT_TRUE(response.find("log4cplus") != string::npos);
EXPECT_FALSE(response.find("GTEST_VERSION") != string::npos); EXPECT_FALSE(response.find("Hooks directory: ") != string::npos);
// Send the build-report command. // Send the build-report command.
sendHttpCommand("{ \"command\": \"build-report\" }", response); sendHttpCommand("{ \"command\": \"build-report\" }", response);
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("GTEST_VERSION") != string::npos); EXPECT_TRUE(response.find("Hooks directory: ") != string::npos);
} }
TEST_F(HttpCtrlChannelD2Test, getVersion) { TEST_F(HttpCtrlChannelD2Test, getVersion) {
@ -1883,13 +1883,13 @@ TEST_F(HttpCtrlChannelD2Test, dualStack) {
sendHttpCommand("{ \"command\": \"version-get\" }", response); sendHttpCommand("{ \"command\": \"version-get\" }", response);
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("log4cplus") != string::npos); EXPECT_TRUE(response.find("log4cplus") != string::npos);
EXPECT_FALSE(response.find("GTEST_VERSION") != string::npos); EXPECT_FALSE(response.find("Hooks directory: ") != string::npos);
// Send the version-get command // Send the version-get command
sendHttpCommand("{ \"command\": \"version-get\" }", response, "::1"); sendHttpCommand("{ \"command\": \"version-get\" }", response, "::1");
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("log4cplus") != string::npos); EXPECT_TRUE(response.find("log4cplus") != string::npos);
EXPECT_FALSE(response.find("GTEST_VERSION") != string::npos); EXPECT_FALSE(response.find("Hooks directory: ") != string::npos);
} }
// Verify that the dual stack scenario works as expect. // Verify that the dual stack scenario works as expect.
@ -1950,13 +1950,13 @@ TEST_F(HttpsCtrlChannelD2Test, dualStack) {
sendHttpCommand("{ \"command\": \"version-get\" }", response); sendHttpCommand("{ \"command\": \"version-get\" }", response);
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("log4cplus") != string::npos); EXPECT_TRUE(response.find("log4cplus") != string::npos);
EXPECT_FALSE(response.find("GTEST_VERSION") != string::npos); EXPECT_FALSE(response.find("Hooks directory: ") != string::npos);
// Send the version-get command // Send the version-get command
sendHttpCommand("{ \"command\": \"version-get\" }", response, "::1"); sendHttpCommand("{ \"command\": \"version-get\" }", response, "::1");
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("log4cplus") != string::npos); EXPECT_TRUE(response.find("log4cplus") != string::npos);
EXPECT_FALSE(response.find("GTEST_VERSION") != string::npos); EXPECT_FALSE(response.find("Hooks directory: ") != string::npos);
} }
// This test verifies that the server signals timeout if the transmission // This test verifies that the server signals timeout if the transmission

View File

@ -1098,12 +1098,12 @@ TEST_F(CtrlChannelDhcpv4SrvTest, getVersion) {
sendUnixCommand("{ \"command\": \"version-get\" }", response); sendUnixCommand("{ \"command\": \"version-get\" }", response);
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("log4cplus") != string::npos); EXPECT_TRUE(response.find("log4cplus") != string::npos);
EXPECT_FALSE(response.find("GTEST_VERSION") != string::npos); EXPECT_FALSE(response.find("Hooks directory: ") != string::npos);
// Send the build-report command // Send the build-report command
sendUnixCommand("{ \"command\": \"build-report\" }", response); sendUnixCommand("{ \"command\": \"build-report\" }", response);
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("GTEST_VERSION") != string::npos); EXPECT_TRUE(response.find("Hooks directory: ") != string::npos);
} }
// This test verifies that the DHCP server handles server-tag-get command // This test verifies that the DHCP server handles server-tag-get command

View File

@ -1768,12 +1768,12 @@ BaseCtrlChannelDhcpv4Test::testGetVersion() {
sendHttpCommand("{ \"command\": \"version-get\" }", response); sendHttpCommand("{ \"command\": \"version-get\" }", response);
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("log4cplus") != string::npos); EXPECT_TRUE(response.find("log4cplus") != string::npos);
EXPECT_FALSE(response.find("GTEST_VERSION") != string::npos); EXPECT_FALSE(response.find("Hooks directory: ") != string::npos);
// Send the build-report command // Send the build-report command
sendHttpCommand("{ \"command\": \"build-report\" }", response); sendHttpCommand("{ \"command\": \"build-report\" }", response);
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("GTEST_VERSION") != string::npos); EXPECT_TRUE(response.find("Hooks directory: ") != string::npos);
} }
TEST_F(HttpCtrlChannelDhcpv4Test, getVersion) { TEST_F(HttpCtrlChannelDhcpv4Test, getVersion) {
@ -3291,13 +3291,13 @@ TEST_F(HttpCtrlChannelDhcpv4Test, dualStack) {
sendHttpCommand("{ \"command\": \"version-get\" }", response); sendHttpCommand("{ \"command\": \"version-get\" }", response);
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("log4cplus") != string::npos); EXPECT_TRUE(response.find("log4cplus") != string::npos);
EXPECT_FALSE(response.find("GTEST_VERSION") != string::npos); EXPECT_FALSE(response.find("Hooks directory: ") != string::npos);
// Send the version-get command // Send the version-get command
sendHttpCommand("{ \"command\": \"version-get\" }", response, "::1"); sendHttpCommand("{ \"command\": \"version-get\" }", response, "::1");
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("log4cplus") != string::npos); EXPECT_TRUE(response.find("log4cplus") != string::npos);
EXPECT_FALSE(response.find("GTEST_VERSION") != string::npos); EXPECT_FALSE(response.find("Hooks directory: ") != string::npos);
// Clean up after the test. // Clean up after the test.
CfgMgr::instance().clear(); CfgMgr::instance().clear();
@ -3355,13 +3355,13 @@ TEST_F(HttpsCtrlChannelDhcpv4Test, dualStack) {
sendHttpCommand("{ \"command\": \"version-get\" }", response); sendHttpCommand("{ \"command\": \"version-get\" }", response);
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("log4cplus") != string::npos); EXPECT_TRUE(response.find("log4cplus") != string::npos);
EXPECT_FALSE(response.find("GTEST_VERSION") != string::npos);; EXPECT_FALSE(response.find("Hooks directory: ") != string::npos);;
// Send the version-get command // Send the version-get command
sendHttpCommand("{ \"command\": \"version-get\" }", response, "::1"); sendHttpCommand("{ \"command\": \"version-get\" }", response, "::1");
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("log4cplus") != string::npos); EXPECT_TRUE(response.find("log4cplus") != string::npos);
EXPECT_FALSE(response.find("GTEST_VERSION") != string::npos); EXPECT_FALSE(response.find("Hooks directory: ") != string::npos);
// Clean up after the test. // Clean up after the test.
CfgMgr::instance().clear(); CfgMgr::instance().clear();

View File

@ -1118,12 +1118,12 @@ TEST_F(CtrlChannelDhcpv6SrvTest, getVersion) {
sendUnixCommand("{ \"command\": \"version-get\" }", response); sendUnixCommand("{ \"command\": \"version-get\" }", response);
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("log4cplus") != string::npos); EXPECT_TRUE(response.find("log4cplus") != string::npos);
EXPECT_FALSE(response.find("GTEST_VERSION") != string::npos); EXPECT_FALSE(response.find("Hooks directory: ") != string::npos);
// Send the build-report command // Send the build-report command
sendUnixCommand("{ \"command\": \"build-report\" }", response); sendUnixCommand("{ \"command\": \"build-report\" }", response);
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("GTEST_VERSION") != string::npos); EXPECT_TRUE(response.find("Hooks directory: ") != string::npos);
} }
// This test verifies that the DHCP server handles server-tag-get command // This test verifies that the DHCP server handles server-tag-get command

View File

@ -1777,12 +1777,12 @@ BaseCtrlChannelDhcpv6Test::testGetVersion() {
sendHttpCommand("{ \"command\": \"version-get\" }", response); sendHttpCommand("{ \"command\": \"version-get\" }", response);
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("log4cplus") != string::npos); EXPECT_TRUE(response.find("log4cplus") != string::npos);
EXPECT_FALSE(response.find("GTEST_VERSION") != string::npos); EXPECT_FALSE(response.find("Hooks directory: ") != string::npos);
// Send the build-report command // Send the build-report command
sendHttpCommand("{ \"command\": \"build-report\" }", response); sendHttpCommand("{ \"command\": \"build-report\" }", response);
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("GTEST_VERSION") != string::npos); EXPECT_TRUE(response.find("Hooks directory: ") != string::npos);
} }
TEST_F(HttpCtrlChannelDhcpv6Test, getVersion) { TEST_F(HttpCtrlChannelDhcpv6Test, getVersion) {
@ -3303,13 +3303,13 @@ TEST_F(HttpCtrlChannelDhcpv6Test, dualStack) {
sendHttpCommand("{ \"command\": \"version-get\" }", response); sendHttpCommand("{ \"command\": \"version-get\" }", response);
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("log4cplus") != string::npos); EXPECT_TRUE(response.find("log4cplus") != string::npos);
EXPECT_FALSE(response.find("GTEST_VERSION") != string::npos); EXPECT_FALSE(response.find("Hooks directory: ") != string::npos);
// Send the version-get command // Send the version-get command
sendHttpCommand("{ \"command\": \"version-get\" }", response, "127.0.0.1"); sendHttpCommand("{ \"command\": \"version-get\" }", response, "127.0.0.1");
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("log4cplus") != string::npos); EXPECT_TRUE(response.find("log4cplus") != string::npos);
EXPECT_FALSE(response.find("GTEST_VERSION") != string::npos); EXPECT_FALSE(response.find("Hooks directory: ") != string::npos);
// Clean up after the test. // Clean up after the test.
CfgMgr::instance().clear(); CfgMgr::instance().clear();
@ -3367,13 +3367,13 @@ TEST_F(HttpsCtrlChannelDhcpv6Test, dualStack) {
sendHttpCommand("{ \"command\": \"version-get\" }", response); sendHttpCommand("{ \"command\": \"version-get\" }", response);
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("log4cplus") != string::npos); EXPECT_TRUE(response.find("log4cplus") != string::npos);
EXPECT_FALSE(response.find("GTEST_VERSION") != string::npos); EXPECT_FALSE(response.find("Hooks directory: ") != string::npos);
// Send the version-get command // Send the version-get command
sendHttpCommand("{ \"command\": \"version-get\" }", response, "127.0.0.1"); sendHttpCommand("{ \"command\": \"version-get\" }", response, "127.0.0.1");
EXPECT_TRUE(response.find("\"result\": 0") != string::npos); EXPECT_TRUE(response.find("\"result\": 0") != string::npos);
EXPECT_TRUE(response.find("log4cplus") != string::npos); EXPECT_TRUE(response.find("log4cplus") != string::npos);
EXPECT_FALSE(response.find("GTEST_VERSION") != string::npos); EXPECT_FALSE(response.find("Hooks directory: ") != string::npos);
// Clean up after the test. // Clean up after the test.
CfgMgr::instance().clear(); CfgMgr::instance().clear();