Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
ee21a81d
Commit
ee21a81d
authored
Dec 19, 2011
by
Stephen Morris
Browse files
Merge branch 'master' into trac1470
parents
ad1fd67b
4feacbc1
Changes
77
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
ee21a81d
348. [bug] stephen
By default the logging output stream is now flushed after each write.
This fixes a problem seen on some systems where the log output from
different processes was jumbled up. Flushing can be disabled by setting
the appropriate option in the logging configuration.
(Trac #1405, git 2f0aa20b44604b671e6bde78815db39381e563bf)
347. [bug] jelte
Fixed a bug where adding Zonemgr/secondary_zones without explicitely
setting the class value of the added zone resulted in a cryptic
error in bindctl ("Error: class"). It will now correctly default to
IN if not set. This also adds better checks on the name and class
values, and better errors if they are bad.
(Trac #1414, git 7b122af8489acf0f28f935a19eca2c5509a3677f)
346. [build]* jreed
Renamed libdhcp to libdhcp++.
(Trac #1446, git d394e64f4c44f16027b1e62b4ac34e054b49221d)
345. [func] tomek
dhcp4: Dummy DHCPv4 component implemented. Currently it does
nothing useful, except providing skeleton implementation that can
be expanded in the future.
(Trac #992, git d6e33479365c8f8f62ef2b9aa5548efe6b194601)
344. [func] y-aharen
src/lib/statistics: Added statistics counter library for entire server
items and per zone items. Also, modified b10-auth to use it. It is
also intended to use in the other modules such as b10-resolver.
(Trac #510, git afddaf4c5718c2a0cc31f2eee79c4e0cc625499f)
343. [func] jelte
Added IXFR-out system tests, based on the first two test sets of
http://bind10.isc.org/wiki/IxfrSystemTests.
(Trac #1314, git 1655bed624866a766311a01214597db01b4c7cec)
342. [bug] stephen
In the resolver, a FORMERR received from an upstream nameserver
now rsults in a SERVFAIL being returned as a response to the original
now r
e
sults in a SERVFAIL being returned as a response to the original
query. Additional debug messages added to distinguish between
different errors in packets received from upstream nameservers.
(Trac #1383, git 9b2b249d23576c999a65d8c338e008cabe45f0c9)
...
...
@@ -69,12 +105,12 @@
potential problems and were fixed.
(Trac #1389, git 3fdce88046bdad392bd89ea656ec4ac3c858ca2f)
333.
[bug] dvv
Solaris needs "-z now" to force non-lazy binding and prevent
g++ static
initialization code from deadlocking.
333.
[bug] dvv
Solaris needs "-z now" to force non-lazy binding and prevent
g++ static
initialization code from deadlocking.
(Trac #1439, git c789138250b33b6b08262425a08a2a0469d90433)
332.
[bug] vorner
332.
[bug] vorner
C++ exceptions in the isc.dns.Rdata wrapper are now converted
to python ones instead of just aborting the interpretter.
(Trac #1407, git 5b64e839be2906b8950f5b1e42a3fadd72fca033)
...
...
@@ -109,7 +145,7 @@ bind10-devel-20111128 released on November 28, 2011
always respond to IXFR requests according to RFC1995).
(Trac #1371 and #1372, git 80c131f5b0763753d199b0fb9b51f10990bcd92b)
326. [build]* jinmei
326. [build]*
jinmei
Added a check script for the SQLite3 schema version. It will be
run at the beginning of 'make install', and if it detects an old
version of schema, installation will stop. You'll then need to
...
...
configure.ac
View file @
ee21a81d
...
...
@@ -730,7 +730,7 @@ then
GTEST_FOUND="true"
# There is no gtest-config script on this
# system, which is supposed to inform us
# whether we need pthreads as well (a
# whether we need pthreads as well (a
# gtest compile-time option). So we still
# need to test that manually.
CPPFLAGS_SAVED="$CPPFLAGS"
...
...
@@ -892,6 +892,8 @@ AC_CONFIG_FILES([Makefile
src/bin/auth/benchmarks/Makefile
src/bin/dhcp6/Makefile
src/bin/dhcp6/tests/Makefile
src/bin/dhcp4/Makefile
src/bin/dhcp4/tests/Makefile
src/bin/resolver/Makefile
src/bin/resolver/tests/Makefile
src/bin/sockcreator/Makefile
...
...
@@ -984,6 +986,8 @@ AC_CONFIG_FILES([Makefile
src/lib/util/tests/Makefile
src/lib/acl/Makefile
src/lib/acl/tests/Makefile
src/lib/statistics/Makefile
src/lib/statistics/tests/Makefile
tests/Makefile
tests/system/Makefile
tests/tools/Makefile
...
...
@@ -1031,6 +1035,7 @@ AC_OUTPUT([doc/version.ent
src/bin/msgq/run_msgq.sh
src/bin/auth/auth.spec.pre
src/bin/auth/spec_config.h.pre
src/bin/dhcp4/spec_config.h.pre
src/bin/dhcp6/spec_config.h.pre
src/bin/tests/process_rename_test.py
src/lib/config/tests/data_def_unittests_config.h
...
...
doc/guide/bind10-guide.xml
View file @
ee21a81d
...
...
@@ -1502,6 +1502,49 @@ what if a NOTIFY is sent?
-->
<section
id=
"zonemgr"
>
<title>
Secondary Manager
</title>
<para>
The
<command>
b10-zonemgr
</command>
process is started by
<command>
bind10
</command>
.
It keeps track of SOA refresh, retry, and expire timers
and other details for BIND 10 to perform as a slave.
When the
<command>
b10-auth
</command>
authoritative DNS server
receives a NOTIFY message,
<command>
b10-zonemgr
</command>
may tell
<command>
b10-xfrin
</command>
to do a refresh
to start an inbound zone transfer.
The secondary manager resets its counters when a new zone is
transferred in.
</para>
<note><simpara>
Access control (such as allowing notifies) is not yet provided.
The primary/secondary service is not yet complete.
</simpara></note>
<para>
The following example shows using
<command>
bindctl
</command>
to configure the server to be a secondary for the example zone:
<screen>
>
<userinput>
config add Zonemgr/secondary_zones
</userinput>
>
<userinput>
config set Zonemgr/secondary_zones[0]/name "
<option>
example.com
</option>
"
</userinput>
>
<userinput>
config set Zonemgr/secondary_zones[0]/class "
<option>
IN
</option>
"
</userinput>
>
<userinput>
config commit
</userinput></screen>
<!-- TODO: remove the IN class example above when it is the default -->
</para>
<para>
If the zone does not exist in the data source already
(i.e. no SOA record for it),
<command>
b10-zonemgr
</command>
will automatically tell
<command>
b10-xfrin
</command>
to transfer the zone in.
</para>
</section>
<section>
<title>
Trigger an Incoming Zone Transfer Manually
</title>
...
...
@@ -1514,7 +1557,6 @@ what if a NOTIFY is sent?
</para>
</section>
<!-- TODO: can that retransfer be used to identify a new zone? -->
<!-- TODO: what if doesn't exist at that master IP? -->
...
...
@@ -1606,31 +1648,6 @@ what is XfroutClient xfr_client??
</chapter>
<chapter
id=
"zonemgr"
>
<title>
Secondary Manager
</title>
<para>
The
<command>
b10-zonemgr
</command>
process is started by
<command>
bind10
</command>
.
It keeps track of SOA refresh, retry, and expire timers
and other details for BIND 10 to perform as a slave.
When the
<command>
b10-auth
</command>
authoritative DNS server
receives a NOTIFY message,
<command>
b10-zonemgr
</command>
may tell
<command>
b10-xfrin
</command>
to do a refresh
to start an inbound zone transfer.
The secondary manager resets its counters when a new zone is
transferred in.
</para>
<note><simpara>
Access control (such as allowing notifies) is not yet provided.
The primary/secondary service is not yet complete.
</simpara></note>
<!-- TODO: lots to describe for zonemgr -->
</chapter>
<chapter
id=
"resolverserver"
>
<title>
Recursive Name Server
</title>
...
...
src/bin/Makefile.am
View file @
ee21a81d
SUBDIRS
=
bind10 bindctl cfgmgr loadzone msgq host cmdctl auth xfrin xfrout
\
usermgr zonemgr stats tests resolver sockcreator dhcp6
usermgr zonemgr stats tests resolver sockcreator dhcp6
dhcp4
check-recursive
:
all-recursive
src/bin/auth/Makefile.am
View file @
ee21a81d
...
...
@@ -71,6 +71,7 @@ b10_auth_LDADD += $(top_builddir)/src/lib/asiolink/libasiolink.la
b10_auth_LDADD
+=
$(top_builddir)
/src/lib/log/liblog.la
b10_auth_LDADD
+=
$(top_builddir)
/src/lib/xfr/libxfr.la
b10_auth_LDADD
+=
$(top_builddir)
/src/lib/server_common/libserver_common.la
b10_auth_LDADD
+=
$(top_builddir)
/src/lib/statistics/libstatistics.la
b10_auth_LDADD
+=
$(SQLITE_LIBS)
# TODO: config.h.in is wrong because doesn't honor pkgdatadir
...
...
src/bin/auth/auth_srv.cc
View file @
ee21a81d
...
...
@@ -671,9 +671,9 @@ void
AuthSrvImpl
::
incCounter
(
const
int
protocol
)
{
// Increment query counter.
if
(
protocol
==
IPPROTO_UDP
)
{
counters_
.
inc
(
AuthCounters
::
COUNT
ER_UDP_QUERY
);
counters_
.
inc
(
AuthCounters
::
SERV
ER_UDP_QUERY
);
}
else
if
(
protocol
==
IPPROTO_TCP
)
{
counters_
.
inc
(
AuthCounters
::
COUNT
ER_TCP_QUERY
);
counters_
.
inc
(
AuthCounters
::
SERV
ER_TCP_QUERY
);
}
else
{
// unknown protocol
isc_throw
(
Unexpected
,
"Unknown protocol: "
<<
protocol
);
...
...
@@ -766,7 +766,7 @@ bool AuthSrv::submitStatistics() const {
}
uint64_t
AuthSrv
::
getCounter
(
const
AuthCounters
::
CounterType
type
)
const
{
AuthSrv
::
getCounter
(
const
AuthCounters
::
Server
CounterType
type
)
const
{
return
(
impl_
->
counters_
.
getCounter
(
type
));
}
...
...
src/bin/auth/auth_srv.h
View file @
ee21a81d
...
...
@@ -343,7 +343,7 @@ public:
/// \param type Type of a counter to get the value of
///
/// \return the value of the counter.
uint64_t
getCounter
(
const
AuthCounters
::
CounterType
type
)
const
;
uint64_t
getCounter
(
const
AuthCounters
::
Server
CounterType
type
)
const
;
/**
* \brief Set and get the addresses we listen on.
...
...
src/bin/auth/benchmarks/Makefile.am
View file @
ee21a81d
...
...
@@ -35,5 +35,6 @@ query_bench_LDADD += $(top_builddir)/src/lib/nsas/libnsas.la
query_bench_LDADD
+=
$(top_builddir)
/src/lib/asiolink/libasiolink.la
query_bench_LDADD
+=
$(top_builddir)
/src/lib/server_common/libserver_common.la
query_bench_LDADD
+=
$(top_builddir)
/src/lib/asiodns/libasiodns.la
query_bench_LDADD
+=
$(top_builddir)
/src/lib/statistics/libstatistics.la
query_bench_LDADD
+=
$(SQLITE_LIBS)
src/bin/auth/statistics.cc
View file @
ee21a81d
...
...
@@ -18,48 +18,67 @@
#include <cc/data.h>
#include <cc/session.h>
#include <statistics/counter.h>
#include <statistics/counter_dict.h>
#include <sstream>
#include <iostream>
#include <boost/noncopyable.hpp>
using
namespace
isc
::
auth
;
using
namespace
isc
::
statistics
;
// TODO: We need a namespace ("auth_server"?) to hold
// AuthSrv and AuthCounters.
class
AuthCountersImpl
{
private:
// prohibit copy
AuthCountersImpl
(
const
AuthCountersImpl
&
source
);
AuthCountersImpl
&
operator
=
(
const
AuthCountersImpl
&
source
);
// TODO: Make use of wrappers like isc::dns::Opcode
// for counter item type.
class
AuthCountersImpl
:
boost
::
noncopyable
{
public:
AuthCountersImpl
();
~
AuthCountersImpl
();
void
inc
(
const
AuthCounters
::
CounterType
type
);
void
inc
(
const
AuthCounters
::
ServerCounterType
type
);
void
inc
(
const
std
::
string
&
zone
,
const
AuthCounters
::
PerZoneCounterType
type
);
bool
submitStatistics
()
const
;
void
setStatisticsSession
(
isc
::
cc
::
AbstractSession
*
statistics_session
);
void
registerStatisticsValidator
(
AuthCounters
::
validator_type
validator
);
// Currently for testing purpose only
uint64_t
getCounter
(
const
AuthCounters
::
CounterType
type
)
const
;
uint64_t
getCounter
(
const
AuthCounters
::
Server
CounterType
type
)
const
;
private:
std
::
vector
<
uint64_t
>
counters_
;
Counter
server_counter_
;
CounterDictionary
per_zone_counter_
;
isc
::
cc
::
AbstractSession
*
statistics_session_
;
AuthCounters
::
validator_type
validator_
;
};
AuthCountersImpl
::
AuthCountersImpl
()
:
// initialize counter
// size: AuthCounters::COUNTER_TYPES, initial value: 0
counters_
(
AuthCounters
::
COUNTER_TYPES
,
0
),
// size of server_counter_: AuthCounters::SERVER_COUNTER_TYPES
// size of per_zone_counter_: AuthCounters::PER_ZONE_COUNTER_TYPES
server_counter_
(
AuthCounters
::
SERVER_COUNTER_TYPES
),
per_zone_counter_
(
AuthCounters
::
PER_ZONE_COUNTER_TYPES
),
statistics_session_
(
NULL
)
{}
{
per_zone_counter_
.
addElement
(
"_SERVER_"
);
}
AuthCountersImpl
::~
AuthCountersImpl
()
{}
void
AuthCountersImpl
::
inc
(
const
AuthCounters
::
CounterType
type
)
{
++
counters_
.
at
(
type
);
AuthCountersImpl
::
inc
(
const
AuthCounters
::
ServerCounterType
type
)
{
server_counter_
.
inc
(
type
);
}
void
AuthCountersImpl
::
inc
(
const
std
::
string
&
zone
,
const
AuthCounters
::
PerZoneCounterType
type
)
{
per_zone_counter_
[
zone
].
inc
(
type
);
}
bool
...
...
@@ -73,9 +92,9 @@ AuthCountersImpl::submitStatistics() const {
<<
"{
\"
owner
\"
:
\"
Auth
\"
,"
<<
"
\"
data
\"
:"
<<
"{
\"
queries.udp
\"
: "
<<
counter
s
_
.
a
t
(
AuthCounters
::
COUNT
ER_UDP_QUERY
)
<<
server_
counter_
.
ge
t
(
AuthCounters
::
SERV
ER_UDP_QUERY
)
<<
",
\"
queries.tcp
\"
: "
<<
counter
s
_
.
a
t
(
AuthCounters
::
COUNT
ER_TCP_QUERY
)
<<
server_
counter_
.
ge
t
(
AuthCounters
::
SERV
ER_TCP_QUERY
)
<<
" }"
<<
"}"
<<
"]}"
;
...
...
@@ -126,19 +145,17 @@ AuthCountersImpl::registerStatisticsValidator
// Currently for testing purpose only
uint64_t
AuthCountersImpl
::
getCounter
(
const
AuthCounters
::
CounterType
type
)
const
{
return
(
counter
s
_
.
a
t
(
type
));
AuthCountersImpl
::
getCounter
(
const
AuthCounters
::
Server
CounterType
type
)
const
{
return
(
server_
counter_
.
ge
t
(
type
));
}
AuthCounters
::
AuthCounters
()
:
impl_
(
new
AuthCountersImpl
())
{}
AuthCounters
::~
AuthCounters
()
{
delete
impl_
;
}
AuthCounters
::~
AuthCounters
()
{}
void
AuthCounters
::
inc
(
const
AuthCounters
::
CounterType
type
)
{
AuthCounters
::
inc
(
const
AuthCounters
::
Server
CounterType
type
)
{
impl_
->
inc
(
type
);
}
...
...
@@ -155,7 +172,7 @@ AuthCounters::setStatisticsSession
}
uint64_t
AuthCounters
::
getCounter
(
const
AuthCounters
::
CounterType
type
)
const
{
AuthCounters
::
getCounter
(
const
AuthCounters
::
Server
CounterType
type
)
const
{
return
(
impl_
->
getCounter
(
type
));
}
...
...
src/bin/auth/statistics.h
View file @
ee21a81d
...
...
@@ -17,6 +17,7 @@
#include <cc/session.h>
#include <stdint.h>
#include <boost/scoped_ptr.hpp>
class
AuthCountersImpl
;
...
...
@@ -51,13 +52,18 @@ class AuthCountersImpl;
/// \todo Consider overhead of \c AuthCounters::inc()
class
AuthCounters
{
private:
AuthCountersImpl
*
impl_
;
boost
::
scoped_ptr
<
AuthCountersImpl
>
impl_
;
public:
// Enum for the type of counter
enum
CounterType
{
COUNTER_UDP_QUERY
=
0
,
///< COUNTER_UDP_QUERY: counter for UDP queries
COUNTER_TCP_QUERY
=
1
,
///< COUNTER_TCP_QUERY: counter for TCP queries
COUNTER_TYPES
=
2
///< The number of defined counters
enum
ServerCounterType
{
SERVER_UDP_QUERY
,
///< SERVER_UDP_QUERY: counter for UDP queries
SERVER_TCP_QUERY
,
///< SERVER_TCP_QUERY: counter for TCP queries
SERVER_COUNTER_TYPES
///< The number of defined counters
};
enum
PerZoneCounterType
{
ZONE_UDP_QUERY
,
///< ZONE_UDP_QUERY: counter for UDP queries
ZONE_TCP_QUERY
,
///< ZONE_TCP_QUERY: counter for TCP queries
PER_ZONE_COUNTER_TYPES
///< The number of defined counters
};
/// The constructor.
///
...
...
@@ -77,9 +83,9 @@ public:
///
/// \throw std::out_of_range \a type is unknown.
///
/// usage: counter.inc(Counter
Type::COUNT
ER_UDP_QUERY);
/// usage: counter.inc(
Auth
Counter
s::SERV
ER_UDP_QUERY);
///
void
inc
(
const
CounterType
type
);
void
inc
(
const
Server
CounterType
type
);
/// \brief Submit statistics counters to statistics module.
///
...
...
@@ -130,7 +136,7 @@ public:
///
/// \return the value of the counter specified by \a type.
///
uint64_t
getCounter
(
const
AuthCounters
::
CounterType
type
)
const
;
uint64_t
getCounter
(
const
AuthCounters
::
Server
CounterType
type
)
const
;
/// \brief A type of validation function for the specification in
/// isc::config::ModuleSpec.
...
...
src/bin/auth/tests/Makefile.am
View file @
ee21a81d
...
...
@@ -65,6 +65,7 @@ run_unittests_LDADD += $(top_builddir)/src/lib/log/liblog.la
run_unittests_LDADD
+=
$(top_builddir)
/src/lib/server_common/libserver_common.la
run_unittests_LDADD
+=
$(top_builddir)
/src/lib/nsas/libnsas.la
run_unittests_LDADD
+=
$(top_builddir)
/src/lib/util/unittests/libutil_unittests.la
run_unittests_LDADD
+=
$(top_builddir)
/src/lib/statistics/libstatistics.la
endif
noinst_PROGRAMS
=
$(TESTS)
src/bin/auth/tests/auth_srv_unittest.cc
View file @
ee21a81d
...
...
@@ -778,7 +778,7 @@ TEST_F(AuthSrvTest, cacheSlots) {
// Submit UDP normal query and check query counter
TEST_F
(
AuthSrvTest
,
queryCounterUDPNormal
)
{
// The counter should be initialized to 0.
EXPECT_EQ
(
0
,
server
.
getCounter
(
AuthCounters
::
COUNT
ER_UDP_QUERY
));
EXPECT_EQ
(
0
,
server
.
getCounter
(
AuthCounters
::
SERV
ER_UDP_QUERY
));
// Create UDP message and process.
UnitTestUtil
::
createRequestMessage
(
request_message
,
Opcode
::
QUERY
(),
default_qid
,
Name
(
"example.com"
),
...
...
@@ -787,13 +787,13 @@ TEST_F(AuthSrvTest, queryCounterUDPNormal) {
server
.
processMessage
(
*
io_message
,
parse_message
,
response_obuffer
,
&
dnsserv
);
// After processing UDP query, the counter should be 1.
EXPECT_EQ
(
1
,
server
.
getCounter
(
AuthCounters
::
COUNT
ER_UDP_QUERY
));
EXPECT_EQ
(
1
,
server
.
getCounter
(
AuthCounters
::
SERV
ER_UDP_QUERY
));
}
// Submit TCP normal query and check query counter
TEST_F
(
AuthSrvTest
,
queryCounterTCPNormal
)
{
// The counter should be initialized to 0.
EXPECT_EQ
(
0
,
server
.
getCounter
(
AuthCounters
::
COUNT
ER_TCP_QUERY
));
EXPECT_EQ
(
0
,
server
.
getCounter
(
AuthCounters
::
SERV
ER_TCP_QUERY
));
// Create TCP message and process.
UnitTestUtil
::
createRequestMessage
(
request_message
,
Opcode
::
QUERY
(),
default_qid
,
Name
(
"example.com"
),
...
...
@@ -802,13 +802,13 @@ TEST_F(AuthSrvTest, queryCounterTCPNormal) {
server
.
processMessage
(
*
io_message
,
parse_message
,
response_obuffer
,
&
dnsserv
);
// After processing TCP query, the counter should be 1.
EXPECT_EQ
(
1
,
server
.
getCounter
(
AuthCounters
::
COUNT
ER_TCP_QUERY
));
EXPECT_EQ
(
1
,
server
.
getCounter
(
AuthCounters
::
SERV
ER_TCP_QUERY
));
}
// Submit TCP AXFR query and check query counter
TEST_F
(
AuthSrvTest
,
queryCounterTCPAXFR
)
{
// The counter should be initialized to 0.
EXPECT_EQ
(
0
,
server
.
getCounter
(
AuthCounters
::
COUNT
ER_TCP_QUERY
));
EXPECT_EQ
(
0
,
server
.
getCounter
(
AuthCounters
::
SERV
ER_TCP_QUERY
));
UnitTestUtil
::
createRequestMessage
(
request_message
,
opcode
,
default_qid
,
Name
(
"example.com"
),
RRClass
::
IN
(),
RRType
::
AXFR
());
createRequestPacket
(
request_message
,
IPPROTO_TCP
);
...
...
@@ -817,13 +817,13 @@ TEST_F(AuthSrvTest, queryCounterTCPAXFR) {
server
.
processMessage
(
*
io_message
,
parse_message
,
response_obuffer
,
&
dnsserv
);
EXPECT_FALSE
(
dnsserv
.
hasAnswer
());
// After processing TCP AXFR query, the counter should be 1.
EXPECT_EQ
(
1
,
server
.
getCounter
(
AuthCounters
::
COUNT
ER_TCP_QUERY
));
EXPECT_EQ
(
1
,
server
.
getCounter
(
AuthCounters
::
SERV
ER_TCP_QUERY
));
}
// Submit TCP IXFR query and check query counter
TEST_F
(
AuthSrvTest
,
queryCounterTCPIXFR
)
{
// The counter should be initialized to 0.
EXPECT_EQ
(
0
,
server
.
getCounter
(
AuthCounters
::
COUNT
ER_TCP_QUERY
));
EXPECT_EQ
(
0
,
server
.
getCounter
(
AuthCounters
::
SERV
ER_TCP_QUERY
));
UnitTestUtil
::
createRequestMessage
(
request_message
,
opcode
,
default_qid
,
Name
(
"example.com"
),
RRClass
::
IN
(),
RRType
::
IXFR
());
createRequestPacket
(
request_message
,
IPPROTO_TCP
);
...
...
@@ -832,7 +832,7 @@ TEST_F(AuthSrvTest, queryCounterTCPIXFR) {
server
.
processMessage
(
*
io_message
,
parse_message
,
response_obuffer
,
&
dnsserv
);
EXPECT_FALSE
(
dnsserv
.
hasAnswer
());
// After processing TCP IXFR query, the counter should be 1.
EXPECT_EQ
(
1
,
server
.
getCounter
(
AuthCounters
::
COUNT
ER_TCP_QUERY
));
EXPECT_EQ
(
1
,
server
.
getCounter
(
AuthCounters
::
SERV
ER_TCP_QUERY
));
}
// class for queryCounterUnexpected test
...
...
src/bin/auth/tests/statistics_unittest.cc
View file @
ee21a81d
...
...
@@ -150,25 +150,24 @@ AuthCountersTest::MockSession::setThrowSessionTimeout(bool flag) {
TEST_F
(
AuthCountersTest
,
incrementUDPCounter
)
{
// The counter should be initialized to 0.
EXPECT_EQ
(
0
,
counters
.
getCounter
(
AuthCounters
::
COUNT
ER_UDP_QUERY
));
EXPECT_NO_THROW
(
counters
.
inc
(
AuthCounters
::
COUNT
ER_UDP_QUERY
));
EXPECT_EQ
(
0
,
counters
.
getCounter
(
AuthCounters
::
SERV
ER_UDP_QUERY
));
EXPECT_NO_THROW
(
counters
.
inc
(
AuthCounters
::
SERV
ER_UDP_QUERY
));
// After increment, the counter should be 1.
EXPECT_EQ
(
1
,
counters
.
getCounter
(
AuthCounters
::
COUNT
ER_UDP_QUERY
));
EXPECT_EQ
(
1
,
counters
.
getCounter
(
AuthCounters
::
SERV
ER_UDP_QUERY
));
}
TEST_F
(
AuthCountersTest
,
incrementTCPCounter
)
{
// The counter should be initialized to 0.
EXPECT_EQ
(
0
,
counters
.
getCounter
(
AuthCounters
::
COUNT
ER_TCP_QUERY
));
EXPECT_NO_THROW
(
counters
.
inc
(
AuthCounters
::
COUNT
ER_TCP_QUERY
));
EXPECT_EQ
(
0
,
counters
.
getCounter
(
AuthCounters
::
SERV
ER_TCP_QUERY
));
EXPECT_NO_THROW
(
counters
.
inc
(
AuthCounters
::
SERV
ER_TCP_QUERY
));
// After increment, the counter should be 1.
EXPECT_EQ
(
1
,
counters
.
getCounter
(
AuthCounters
::
COUNT
ER_TCP_QUERY
));
EXPECT_EQ
(
1
,
counters
.
getCounter
(
AuthCounters
::
SERV
ER_TCP_QUERY
));
}
TEST_F
(
AuthCountersTest
,
incrementInvalidCounter
)
{
// Expect to throw isc::InvalidParameter if the type of the counter is
// invalid.
EXPECT_THROW
(
counters
.
inc
(
AuthCounters
::
COUNTER_TYPES
),
std
::
out_of_range
);
// Expect to throw an isc::OutOfRange
EXPECT_THROW
(
counters
.
inc
(
AuthCounters
::
SERVER_COUNTER_TYPES
),
isc
::
OutOfRange
);
}
TEST_F
(
AuthCountersTest
,
submitStatisticsWithoutSession
)
{
...
...
@@ -195,14 +194,14 @@ TEST_F(AuthCountersTest, submitStatisticsWithoutValidator) {
// Validate if it submits correct data.
// Counters should be initialized to 0.
EXPECT_EQ
(
0
,
counters
.
getCounter
(
AuthCounters
::
COUNT
ER_UDP_QUERY
));
EXPECT_EQ
(
0
,
counters
.
getCounter
(
AuthCounters
::
COUNT
ER_TCP_QUERY
));
EXPECT_EQ
(
0
,
counters
.
getCounter
(
AuthCounters
::
SERV
ER_UDP_QUERY
));
EXPECT_EQ
(
0
,
counters
.
getCounter
(
AuthCounters
::
SERV
ER_TCP_QUERY
));
// UDP query counter is set to 2.
counters
.
inc
(
AuthCounters
::
COUNT
ER_UDP_QUERY
);
counters
.
inc
(
AuthCounters
::
COUNT
ER_UDP_QUERY
);
counters
.
inc
(
AuthCounters
::
SERV
ER_UDP_QUERY
);
counters
.
inc
(
AuthCounters
::
SERV
ER_UDP_QUERY
);
// TCP query counter is set to 1.
counters
.
inc
(
AuthCounters
::
COUNT
ER_TCP_QUERY
);
counters
.
inc
(
AuthCounters
::
SERV
ER_TCP_QUERY
);
counters
.
submitStatistics
();
// Destination is "Stats".
...
...
@@ -237,14 +236,14 @@ TEST_F(AuthCountersTest, submitStatisticsWithValidator) {
counters
.
registerStatisticsValidator
(
validator
);
// Counters should be initialized to 0.
EXPECT_EQ
(
0
,
counters
.
getCounter
(
AuthCounters
::
COUNT
ER_UDP_QUERY
));
EXPECT_EQ
(
0
,
counters
.
getCounter
(
AuthCounters
::
COUNT
ER_TCP_QUERY
));
EXPECT_EQ
(
0
,
counters
.
getCounter
(
AuthCounters
::
SERV
ER_UDP_QUERY
));
EXPECT_EQ
(
0
,
counters
.
getCounter
(
AuthCounters
::
SERV
ER_TCP_QUERY
));
// UDP query counter is set to 2.
counters
.
inc
(
AuthCounters
::
COUNT
ER_UDP_QUERY
);
counters
.
inc
(
AuthCounters
::
COUNT
ER_UDP_QUERY
);
counters
.
inc
(
AuthCounters
::
SERV
ER_UDP_QUERY
);
counters
.
inc
(
AuthCounters
::
SERV
ER_UDP_QUERY
);
// TCP query counter is set to 1.
counters
.
inc
(
AuthCounters
::
COUNT
ER_TCP_QUERY
);
counters
.
inc
(
AuthCounters
::
SERV
ER_TCP_QUERY
);
// checks the value returned by submitStatistics
EXPECT_TRUE
(
counters
.
submitStatistics
());
...
...
src/bin/cfgmgr/plugins/logging.spec
View file @
ee21a81d
...
...
@@ -57,7 +57,7 @@
{ "item_name": "flush",
"item_type": "boolean",
"item_optional": false,
"item_default":
fals
e
"item_default":
tru
e
},
{ "item_name": "maxsize",
"item_type": "integer",
...
...
src/bin/dhcp4/Makefile.am
0 → 100644
View file @
ee21a81d
SUBDIRS
=
.
tests
AM_CPPFLAGS
=
-I
$(top_srcdir)
/src/lib
-I
$(top_builddir)
/src/lib
AM_CPPFLAGS
+=
-I
$(top_srcdir)
/src/bin
-I
$(top_builddir)
/src/bin
AM_CPPFLAGS
+=
$(BOOST_INCLUDES)
AM_CXXFLAGS
=
$(B10_CXXFLAGS)
if
USE_STATIC_LINK
AM_LDFLAGS
=
-static
endif
pkglibexecdir
=
$(libexecdir)
/@PACKAGE@
CLEANFILES
=
spec_config.h
man_MANS
=
b10-dhcp4.8
EXTRA_DIST
=
$(man_MANS)
dhcp4.spec
if
ENABLE_MAN
b10-dhcp4.8
:
b10-dhcp4.xml
xsltproc
--novalid
--xinclude
--nonet
-o
$@
http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
$(srcdir)
/b10-dhcp4.xml
endif
spec_config.h
:
spec_config.h.pre
$(SED)
-e
"s|@@LOCALSTATEDIR@@|
$(localstatedir)
|"
spec_config.h.pre
>
$@
BUILT_SOURCES
=
spec_config.h
pkglibexec_PROGRAMS
=
b10-dhcp4
b10_dhcp4_SOURCES
=
main.cc dhcp4_srv.cc dhcp4_srv.h
b10_dhcp4_LDADD
=
$(top_builddir)
/src/lib/dhcp/libdhcp++.la
b10_dhcp4_LDADD
+=
$(top_builddir)
/src/lib/exceptions/libexceptions.la
b10_dhcp4_LDADD
+=
$(top_builddir)
/src/lib/asiolink/libasiolink.la
b10_dhcp4_LDADD
+=
$(top_builddir)
/src/lib/log/liblog.la
# TODO: config.h.in is wrong because doesn't honor pkgdatadir