mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 22:15:23 +00:00
[#3477] Aligned v4 and v6 unit test files
This commit is contained in:
@@ -811,9 +811,10 @@ TEST_F(CtrlChannelDhcpv4SrvTest, configSet) {
|
|||||||
// Verify the control channel socket no longer exists.
|
// Verify the control channel socket no longer exists.
|
||||||
EXPECT_FALSE(fileExists(socket_path_));
|
EXPECT_FALSE(fileExists(socket_path_));
|
||||||
|
|
||||||
// With no command channel, should still receive the response. The config contains random
|
// With no command channel, should still receive the response.
|
||||||
// socket name (/tmp/kea-<value-changing-each-time>/kea4.sock), so the
|
// The config contains random socket name
|
||||||
// hash will be different each time. As such, we can do simplified checks:
|
// (/tmp/kea-<value-changing-each-time>/kea4.sock), so the hash will
|
||||||
|
// be different each time. As such, we can do simplified checks:
|
||||||
// - verify the "result": 0 is there
|
// - verify the "result": 0 is there
|
||||||
// - verify the "text": "Configuration successful." is there
|
// - verify the "text": "Configuration successful." is there
|
||||||
EXPECT_NE(response.find("\"result\": 0"), std::string::npos);
|
EXPECT_NE(response.find("\"result\": 0"), std::string::npos);
|
||||||
@@ -868,7 +869,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, configHashGet) {
|
|||||||
int status;
|
int status;
|
||||||
ConstElementPtr args = parseAnswer(status, rsp);
|
ConstElementPtr args = parseAnswer(status, rsp);
|
||||||
EXPECT_EQ(CONTROL_RESULT_SUCCESS, status);
|
EXPECT_EQ(CONTROL_RESULT_SUCCESS, status);
|
||||||
// the parseAnswer is trying to be smart with ignoring hash.
|
// The parseAnswer is trying to be smart with ignoring hash.
|
||||||
// But this time we really want to see the hash, so we'll retrieve
|
// But this time we really want to see the hash, so we'll retrieve
|
||||||
// the arguments manually.
|
// the arguments manually.
|
||||||
args = rsp->get(CONTROL_ARGUMENTS);
|
args = rsp->get(CONTROL_ARGUMENTS);
|
||||||
|
@@ -263,7 +263,7 @@ public:
|
|||||||
/// @param response_str a string containing the whole HTTP
|
/// @param response_str a string containing the whole HTTP
|
||||||
/// response received.
|
/// response received.
|
||||||
///
|
///
|
||||||
/// @return An HttpResponse constructed from parsing the response string.
|
/// @return An HttpResponse constructed by parsing the response string.
|
||||||
HttpResponsePtr parseResponse(const std::string response_str) {
|
HttpResponsePtr parseResponse(const std::string response_str) {
|
||||||
HttpResponsePtr hr(new HttpResponse());
|
HttpResponsePtr hr(new HttpResponse());
|
||||||
HttpResponseParser parser(*hr);
|
HttpResponseParser parser(*hr);
|
||||||
@@ -299,8 +299,8 @@ public:
|
|||||||
ASSERT_TRUE(client);
|
ASSERT_TRUE(client);
|
||||||
|
|
||||||
// Send the command. This will trigger server's handler which receives
|
// Send the command. This will trigger server's handler which receives
|
||||||
// data over the HTTP socket. The server will start sending
|
// data over the HTTP socket. The server will start sending response
|
||||||
// response to the client.
|
// to the client.
|
||||||
ASSERT_NO_THROW(client->startRequest(buildPostStr(command)));
|
ASSERT_NO_THROW(client->startRequest(buildPostStr(command)));
|
||||||
runIOService();
|
runIOService();
|
||||||
ASSERT_TRUE(client->receiveDone());
|
ASSERT_TRUE(client->receiveDone());
|
||||||
|
@@ -726,7 +726,7 @@ TEST_F(CtrlChannelDhcpv6SrvTest, configSet) {
|
|||||||
EXPECT_FALSE(fileExists(socket_path_));
|
EXPECT_FALSE(fileExists(socket_path_));
|
||||||
|
|
||||||
// With no command channel, should still receive the response.
|
// With no command channel, should still receive the response.
|
||||||
// The config contains random socket name socket name
|
// The config contains random socket name
|
||||||
// (/tmp/kea-<value-changing-each-time>/kea6.sock), so the hash will
|
// (/tmp/kea-<value-changing-each-time>/kea6.sock), so the hash will
|
||||||
// be different each time. As such, we can do simplified checks:
|
// be different each time. As such, we can do simplified checks:
|
||||||
// - verify the "result": 0 is there
|
// - verify the "result": 0 is there
|
||||||
|
Reference in New Issue
Block a user