AM_CPPFLAGS += -DINSTALL_PROG=\"$(abs_top_srcdir)/install-sh\"
AM_CPPFLAGS += -DCFG_EXAMPLES=\"$(abs_top_srcdir)/doc/examples/ddns\"
AM_CPPFLAGS += -DSYNTAX_FILE=\"$(abs_srcdir)/../d2_parser.yy\"
-AM_CPPFLAGS += -DTEST_CA_DIR=\"$(srcdir)/../../lib/asiolink/testutils/ca\"
+AM_CPPFLAGS += -DTEST_CA_DIR=\"$(abs_top_srcdir)/src/lib/asiolink/testutils/ca\"
AM_CXXFLAGS = $(KEA_CXXFLAGS)
ASSERT_TRUE(proc);
ConstElementPtr answer = proc->configure(config, false);
ASSERT_TRUE(answer);
- EXPECT_EQ("{ \"arguments\": { \"hash\": \"A6E28D3F41B4502EC72F3599E34D2785442D60C6F4FABAC3D1C4A4C49FE3D3C2\" }, \"result\": 0, \"text\": \"Configuration applied successfully.\" }",
- answer->str());
+ // Verify the configuration was successful. The config contains random
+ // file paths (CA directory), so the hash will be different each time.
+ // As such, we can do simplified checks:
+ // - verify the "result": 0 is there
+ // - verify the "text": "Configuration applied successfully." is there
+ string answer_txt = answer->str();
+ EXPECT_NE(answer_txt.find("\"result\": 0"), std::string::npos);
+ EXPECT_NE(answer_txt.find("\"text\": \"Configuration applied successfully.\""),
+ std::string::npos);
ASSERT_NO_THROW(d2Controller()->registerCommands());
// Check that the config was indeed applied.
ASSERT_TRUE(proc);
ConstElementPtr answer = proc->configure(config, false);
ASSERT_TRUE(answer);
- EXPECT_EQ("{ \"arguments\": { \"hash\": \"A6E28D3F41B4502EC72F3599E34D2785442D60C6F4FABAC3D1C4A4C49FE3D3C2\" }, \"result\": 0, \"text\": \"Configuration applied successfully.\" }",
- answer->str());
+ // Verify the configuration was successful. The config contains random
+ // file paths (CA directory), so the hash will be different each time.
+ // As such, we can do simplified checks:
+ // - verify the "result": 0 is there
+ // - verify the "text": "Configuration applied successfully." is there
+ string answer_txt = answer->str();
+ EXPECT_NE(answer_txt.find("\"result\": 0"), std::string::npos);
+ EXPECT_NE(answer_txt.find("\"text\": \"Configuration applied successfully.\""),
+ std::string::npos);
ASSERT_NO_THROW(d2Controller()->registerCommands());
// Check that the config was indeed applied.
AM_CPPFLAGS += -DCFG_EXAMPLES=\"$(abs_top_srcdir)/doc/examples/kea4\"
AM_CPPFLAGS += -DSYNTAX_FILE=\"$(abs_srcdir)/../dhcp4_parser.yy\"
AM_CPPFLAGS += -DKEA_LFC_EXECUTABLE=\"$(abs_top_builddir)/src/bin/lfc/kea-lfc\"
-AM_CPPFLAGS += -DTEST_CA_DIR=\"$(srcdir)/../../lib/asiolink/testutils/ca\"
+AM_CPPFLAGS += -DTEST_CA_DIR=\"$(abs_top_srcdir)/src/lib/asiolink/testutils/ca\"
AM_CXXFLAGS = $(KEA_CXXFLAGS)
// Send the config-set command
std::string response;
sendHttpCommand(os.str(), response);
- EXPECT_EQ("[ { \"arguments\": { \"hash\": \"B95F3C56211CF07A9A5D8C173568CEC1DE74C6B6E3DAF3EDD4381841CED4A255\" }, \"result\": 0, \"text\": \"Configuration successful.\" } ]",
- response);
+ // Verify the configuration was successful. The config contains random
+ // file paths (CA directory), so the hash will be different each time.
+ // As such, we can do simplified checks:
+ // - verify the "result": 0 is there
+ // - verify the "text": "Configuration successful." is there
+ EXPECT_NE(response.find("\"result\": 0"), std::string::npos);
+ EXPECT_NE(response.find("\"text\": \"Configuration successful.\""),
+ std::string::npos);
// Check that the config was indeed applied.
const Subnet4Collection* subnets =
std::string response;
sendHttpCommand(os.str(), response);
- EXPECT_EQ("[ { \"arguments\": { \"hash\": \"E3369C069976A5EB4CD70B625752E709E855107D49527DEDED8636FCD0F78451\" }, \"result\": 0, \"text\": \"Configuration successful.\" } ]",
- response);
+ // Verify the configuration was successful. The config contains random
+ // file paths (CA directory), so the hash will be different each time.
+ // As such, we can do simplified checks:
+ // - verify the "result": 0 is there
+ // - verify the "text": "Configuration successful." is there
+ EXPECT_NE(response.find("\"result\": 0"), std::string::npos);
+ EXPECT_NE(response.find("\"text\": \"Configuration successful.\""),
+ std::string::npos);
// Check that the config was indeed applied.
const Subnet4Collection* subnets =
AM_CPPFLAGS += -DCFG_EXAMPLES=\"$(abs_top_srcdir)/doc/examples/kea6\"
AM_CPPFLAGS += -DSYNTAX_FILE=\"$(abs_srcdir)/../dhcp6_parser.yy\"
AM_CPPFLAGS += -DKEA_LFC_EXECUTABLE=\"$(abs_top_builddir)/src/bin/lfc/kea-lfc\"
-AM_CPPFLAGS += -DTEST_CA_DIR=\"$(srcdir)/../../lib/asiolink/testutils/ca\"
+AM_CPPFLAGS += -DTEST_CA_DIR=\"$(abs_top_srcdir)/src/lib/asiolink/testutils/ca\"
AM_CXXFLAGS = $(KEA_CXXFLAGS)
// Send the config-set command
std::string response;
sendHttpCommand(os.str(), response);
- EXPECT_EQ("[ { \"arguments\": { \"hash\": \"19DC7B91AB2806C11494FA4AB3D2ACF144E1F6CDDD24859F5E8F277D06B06454\" }, \"result\": 0, \"text\": \"Configuration successful.\" } ]",
- response);
+ // Verify the configuration was successful. The config contains random
+ // file paths (CA directory), so the hash will be different each time.
+ // As such, we can do simplified checks:
+ // - verify the "result": 0 is there
+ // - verify the "text": "Configuration successful." is there
+ EXPECT_NE(response.find("\"result\": 0"), std::string::npos);
+ EXPECT_NE(response.find("\"text\": \"Configuration successful.\""),
+ std::string::npos);
// Check that the config was indeed applied.
const Subnet6Collection* subnets =
std::string response;
sendHttpCommand(os.str(), response);
- EXPECT_EQ("[ { \"arguments\": { \"hash\": \"F985ED10D250FDF13F10DF7E409EA4F467D46BC77F8FACE95AF7CB5208E6B6B2\" }, \"result\": 0, \"text\": \"Configuration successful.\" } ]",
- response);
+ // Verify the configuration was successful. The config contains random
+ // file paths (CA directory), so the hash will be different each time.
+ // As such, we can do simplified checks:
+ // - verify the "result": 0 is there
+ // - verify the "text": "Configuration successful." is there
+ EXPECT_NE(response.find("\"result\": 0"), std::string::npos);
+ EXPECT_NE(response.find("\"text\": \"Configuration successful.\""),
+ std::string::npos);
// Check that the config was indeed applied.
const Subnet6Collection* subnets =