]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2212] also ported loadZoneWithoutDataSrc test.
authorJINMEI Tatuya <jinmei@isc.org>
Tue, 23 Oct 2012 07:23:10 +0000 (00:23 -0700)
committerJINMEI Tatuya <jinmei@isc.org>
Thu, 25 Oct 2012 22:03:13 +0000 (15:03 -0700)
src/bin/auth/tests/datasrc_clients_builder_unittest.cc

index 037ced71b6c32ffe85660d8e98683303100cf999..e12817794bf3e652709e32a6dd7711fb6ca05d09 100644 (file)
@@ -442,6 +442,17 @@ TEST_F(DataSrcClientsBuilderTest, loadUnreadableZone) {
     zoneChecks(clients_map, rrclass);     // zone shouldn't be replaced
 }
 
+TEST_F(DataSrcClientsBuilderTest, loadZoneWithoutDataSrc) {
+    // try to execute load command without configuring the zone beforehand.
+    // it should fail.
+    EXPECT_THROW(builder.handleCommand(
+                     Command(LOADZONE,
+                             Element::fromJSON(
+                                 "{\"class\": \"IN\", "
+                                 " \"origin\": \"test1.example\"}"))),
+                 TestDataSrcClientsBuilder::InternalCommandError);
+}
+
 TEST_F(DataSrcClientsBuilderTest, loadZoneInvalidParams) {
     configureZones();