BIND 10 trac2862, updated. 16a1ed85d4bf1135008baad41952adcf2195b9a3 [2862] Tests for subscribing to the readers
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Jul 8 10:16:33 UTC 2013
The branch, trac2862 has been updated
via 16a1ed85d4bf1135008baad41952adcf2195b9a3 (commit)
from d2cf6a85554d5d9e02f1073bf41c61206a82effc (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 16a1ed85d4bf1135008baad41952adcf2195b9a3
Author: Michal 'vorner' Vaner <vorner at vorner.cz>
Date: Mon Jul 8 12:14:50 2013 +0200
[2862] Tests for subscribing to the readers
-----------------------------------------------------------------------
Summary of changes:
src/bin/auth/auth_srv.cc | 5 +++++
src/bin/auth/auth_srv.h | 3 +++
src/bin/auth/tests/auth_srv_unittest.cc | 34 +++++++++++++++++++++++++++++--
3 files changed, 40 insertions(+), 2 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/auth/auth_srv.cc b/src/bin/auth/auth_srv.cc
index 27779a9..c19c17d 100644
--- a/src/bin/auth/auth_srv.cc
+++ b/src/bin/auth/auth_srv.cc
@@ -939,3 +939,8 @@ void
AuthSrv::setTCPRecvTimeout(size_t timeout) {
dnss_->setTCPRecvTimeout(timeout);
}
+
+void
+AuthSrv::listsReconfigured() {
+ // TODO: Here comes something.
+}
diff --git a/src/bin/auth/auth_srv.h b/src/bin/auth/auth_srv.h
index 8ad72be..018ccd2 100644
--- a/src/bin/auth/auth_srv.h
+++ b/src/bin/auth/auth_srv.h
@@ -273,6 +273,9 @@ public:
/// open forever.
void setTCPRecvTimeout(size_t timeout);
+ // TODO: Doxygen
+ void listsReconfigured();
+
private:
AuthSrvImpl* impl_;
isc::asiolink::SimpleCallback* checkin_;
diff --git a/src/bin/auth/tests/auth_srv_unittest.cc b/src/bin/auth/tests/auth_srv_unittest.cc
index f17d91e..7a4d950 100644
--- a/src/bin/auth/tests/auth_srv_unittest.cc
+++ b/src/bin/auth/tests/auth_srv_unittest.cc
@@ -39,6 +39,9 @@
#include <auth/statistics_items.h>
#include <auth/datasrc_config.h>
+#include <config/tests/fake_session.h>
+#include <config/ccsession.h>
+
#include <util/unittests/mock_socketsession.h>
#include <dns/tests/unittest_util.h>
#include <testutils/dnsmessage_test.h>
@@ -265,14 +268,15 @@ updateDatabase(AuthSrv& server, const char* params) {
void
updateInMemory(AuthSrv& server, const char* origin, const char* filename,
- bool with_static = true)
+ bool with_static = true, bool mapped = false)
{
string spec_txt = "{"
"\"IN\": [{"
" \"type\": \"MasterFiles\","
" \"params\": {"
" \"" + string(origin) + "\": \"" + string(filename) + "\""
- " },"
+ " }," +
+ string(mapped ? "\"cache-type\": \"mapped\"," : "") +
" \"cache-enable\": true"
"}]";
if (with_static) {
@@ -2138,4 +2142,30 @@ TEST_F(AuthSrvTest, loadZoneCommand) {
sendCommand(server, "loadzone", args, 0);
}
+// Test that the auth server subscribes to the segment readers group when
+// there's a remotely mapped segment.
+TEST_F(AuthSrvTest, postReconfigure) {
+ FakeSession session(ElementPtr(new ListElement),
+ ElementPtr(new ListElement),
+ ElementPtr(new ListElement));
+ const string specfile(string(TEST_OWN_DATA_DIR) + "/spec.spec");
+ session.getMessages()->add(isc::config::createAnswer());
+ isc::config::ModuleCCSession mccs(specfile, session, NULL, NULL, false,
+ false);
+ server.setConfigSession(&mccs);
+ // First, no lists are there, so no reason to subscribe
+ server.listsReconfigured();
+ EXPECT_FALSE(session.haveSubscription("SegmentReader", "*"));
+ // Enable remote segment
+ updateInMemory(server, "example.", CONFIG_INMEMORY_EXAMPLE, false, true);
+ {
+ DataSrcClientsMgr &mgr(server.getDataSrcClientsMgr());
+ DataSrcClientsMgr::Holder holder(mgr);
+ EXPECT_EQ(SEGMENT_WAITING, holder.findClientList(RRClass::IN())->
+ getStatus()[0].getSegmentState());
+ }
+ server.listsReconfigured();
+ EXPECT_TRUE(session.haveSubscription("SegmentReader", "*"));
+}
+
}
More information about the bind10-changes
mailing list