|
@@ -385,7 +385,10 @@ TEST_F(DataSrcClientsBuilderTest,
|
|
find(Name("example.org")).finder_->
|
|
find(Name("example.org")).finder_->
|
|
find(Name("example.org"), RRType::SOA())->code);
|
|
find(Name("example.org"), RRType::SOA())->code);
|
|
|
|
|
|
- // attempt of reloading a zone but in-memory cache is disabled.
|
|
|
|
|
|
+ // attempt of reloading a zone but in-memory cache is disabled. In this
|
|
|
|
+ // case the command is simply ignored.
|
|
|
|
+ const size_t orig_lock_count = map_mutex.lock_count;
|
|
|
|
+ const size_t orig_unlock_count = map_mutex.unlock_count;
|
|
const ConstElementPtr config2(Element::fromJSON("{"
|
|
const ConstElementPtr config2(Element::fromJSON("{"
|
|
"\"IN\": [{"
|
|
"\"IN\": [{"
|
|
" \"type\": \"sqlite3\","
|
|
" \"type\": \"sqlite3\","
|
|
@@ -394,11 +397,13 @@ TEST_F(DataSrcClientsBuilderTest,
|
|
" \"cache-zones\": [\"example.org\"]"
|
|
" \"cache-zones\": [\"example.org\"]"
|
|
"}]}"));
|
|
"}]}"));
|
|
clients_map = configureDataSource(config2);
|
|
clients_map = configureDataSource(config2);
|
|
- EXPECT_THROW(builder.handleCommand(
|
|
|
|
|
|
+ builder.handleCommand(
|
|
Command(LOADZONE, Element::fromJSON(
|
|
Command(LOADZONE, Element::fromJSON(
|
|
"{\"class\": \"IN\","
|
|
"{\"class\": \"IN\","
|
|
- " \"origin\": \"example.org\"}"))),
|
|
|
|
- TestDataSrcClientsBuilder::InternalCommandError);
|
|
|
|
|
|
+ " \"origin\": \"example.org\"}")));
|
|
|
|
+ // Only one mutex was needed because there was no actual reload.
|
|
|
|
+ EXPECT_EQ(orig_lock_count + 1, map_mutex.lock_count);
|
|
|
|
+ EXPECT_EQ(orig_unlock_count + 1, map_mutex.unlock_count);
|
|
|
|
|
|
// basically impossible case: in-memory cache is completely disabled.
|
|
// basically impossible case: in-memory cache is completely disabled.
|
|
// In this implementation of manager-builder, this should never happen,
|
|
// In this implementation of manager-builder, this should never happen,
|