Browse Source

[2212] also ported loadZoneWithoutDataSrc test.

JINMEI Tatuya 12 years ago
parent
commit
d12b460fbb
1 changed files with 11 additions and 0 deletions
  1. 11 0
      src/bin/auth/tests/datasrc_clients_builder_unittest.cc

+ 11 - 0
src/bin/auth/tests/datasrc_clients_builder_unittest.cc

@@ -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();