EXPECT_EQ(expected, response);
}
+/// Verify that kea-lfc-start requires a lease backend.
+TEST_F(CtrlChannelDhcpv4SrvTest, keaLfcStartNoBackend) {
+ ASSERT_NO_THROW(server_.reset(new NakedControlledDhcpv4Srv()));
+ ConstElementPtr command = createCommand("kea-lfc-start");
+ ConstElementPtr response;
+ ASSERT_NO_THROW(response = CommandMgr::instance().processCommand(command));
+ ASSERT_TRUE(response);
+ EXPECT_EQ("{ \"result\": 2, \"text\": \"no lease backend\" }",
+ response->str());
+}
+
+/// Verify that kea-lfc-start requires persist true.
+TEST_F(CtrlChannelDhcpv4SrvTest, keaLfcStartPersistFalse) {
+ createUnixChannelServer();
+ std::string response;
+
+ sendUnixCommand("{ \"command\" : \"kea-lfc-start\" }", response);
+ std::string expected = "{ \"result\": 2, \"text\": ";
+ expected += "\"'persist` parameter of `memfile` lease backend ";
+ expected += "was configured to `false`\" }";
+ EXPECT_EQ(expected, response);
+}
+
/// Verify that concurrent connections over the control channel can be
/// established.
/// @todo Future Kea 1.3 tickets will modify the behavior of the CommandMgr
// the origin-id.
void testDhcpEnableOriginId();
+ // This test verifies that kea-lfc-start requires persist true.
+ void testKeaLfcStartPersistFalse();
+
// This test verifies that the server can receive and process a
// large command.
void testLongCommand();
testDhcpEnableOriginId();
}
+/// Verify that kea-lfc-start requires persist true.
+void
+BaseCtrlChannelDhcpv4Test::testKeaLfcStartPersistFalse() {
+ createHttpChannelServer();
+ std::string response;
+
+ sendHttpCommand("{ \"command\" : \"kea-lfc-start\" }", response);
+ std::string expected = "[ { \"result\": 2, \"text\": ";
+ expected += "\"'persist` parameter of `memfile` lease backend ";
+ expected += "was configured to `false`\" } ]";
+ EXPECT_EQ(expected, response);
+}
+
+TEST_F(HttpCtrlChannelDhcpv4Test, keaLfcStartPersistFalse) {
+ testKeaLfcStartPersistFalse();
+}
+
+TEST_F(HttpsCtrlChannelDhcpv4Test, keaLfcStartPersistFalse) {
+ testKeaLfcStartPersistFalse();
+}
+
/// Verify that concurrent connections over the HTTP control channel can be
/// established.
TEST_F(HttpCtrlChannelDhcpv4Test, concurrentConnections) {
EXPECT_EQ(expected, response);
}
+/// Verify that kea-lfc-start requires a lease backend.
+TEST_F(CtrlChannelDhcpv6SrvTest, keaLfcStartNoBackend) {
+ ASSERT_NO_THROW(server_.reset(new NakedControlledDhcpv6Srv()));
+ ConstElementPtr command = createCommand("kea-lfc-start");
+ ConstElementPtr response;
+ ASSERT_NO_THROW(response = CommandMgr::instance().processCommand(command));
+ ASSERT_TRUE(response);
+ EXPECT_EQ("{ \"result\": 2, \"text\": \"no lease backend\" }",
+ response->str());
+}
+
+/// Verify that kea-lfc-start requires persist true.
+TEST_F(CtrlChannelDhcpv6SrvTest, keaLfcStartPersistFalse) {
+ createUnixChannelServer();
+ std::string response;
+
+ sendUnixCommand("{ \"command\" : \"kea-lfc-start\" }", response);
+ std::string expected = "{ \"result\": 2, \"text\": ";
+ expected += "\"'persist` parameter of `memfile` lease backend ";
+ expected += "was configured to `false`\" }";
+ EXPECT_EQ(expected, response);
+}
+
/// Verify that concurrent connections over the control channel can be
/// established.
/// @todo Future Kea 1.3 tickets will modify the behavior of the CommandMgr
// the origin-id.
void testDhcpEnableOriginId();
+ // This test verifies that kea-lfc-start requires persist true.
+ void testKeaLfcStartPersistFalse();
+
// This test verifies that the server can receive and process a
// large command.
void testLongCommand();
testDhcpEnableOriginId();
}
+/// Verify that kea-lfc-start requires persist true.
+void
+BaseCtrlChannelDhcpv6Test::testKeaLfcStartPersistFalse() {
+ createHttpChannelServer();
+ std::string response;
+
+ sendHttpCommand("{ \"command\" : \"kea-lfc-start\" }", response);
+ std::string expected = "[ { \"result\": 2, \"text\": ";
+ expected += "\"'persist` parameter of `memfile` lease backend ";
+ expected += "was configured to `false`\" } ]";
+ EXPECT_EQ(expected, response);
+}
+
+TEST_F(HttpCtrlChannelDhcpv6Test, keaLfcStartPersistFalse) {
+ testKeaLfcStartPersistFalse();
+}
+
+TEST_F(HttpsCtrlChannelDhcpv6Test, keaLfcStartPersistFalse) {
+ testKeaLfcStartPersistFalse();
+}
+
/// Verify that concurrent connections over the HTTP control channel can be
/// established.
TEST_F(HttpCtrlChannelDhcpv6Test, concurrentConnections) {