Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Adam Osuchowski
Kea
Commits
d26eac8d
Commit
d26eac8d
authored
Jul 08, 2013
by
Michal 'vorner' Vaner
Committed by
Michal 'vorner' Vaner
Jul 12, 2013
Browse files
[2862] Tests for subscribing to the readers
parent
465c3330
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/bin/auth/auth_srv.cc
View file @
d26eac8d
...
...
@@ -939,3 +939,8 @@ void
AuthSrv
::
setTCPRecvTimeout
(
size_t
timeout
)
{
dnss_
->
setTCPRecvTimeout
(
timeout
);
}
void
AuthSrv
::
listsReconfigured
()
{
// TODO: Here comes something.
}
src/bin/auth/auth_srv.h
View file @
d26eac8d
...
...
@@ -273,6 +273,9 @@ public:
/// open forever.
void
setTCPRecvTimeout
(
size_t
timeout
);
// TODO: Doxygen
void
listsReconfigured
();
private:
AuthSrvImpl
*
impl_
;
isc
::
asiolink
::
SimpleCallback
*
checkin_
;
...
...
src/bin/auth/tests/auth_srv_unittest.cc
View file @
d26eac8d
...
...
@@ -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"
,
"*"
));
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment