Commit 2e4f58b9 authored by Han Feng's avatar Han Feng
Browse files

add unitest for notify

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac221@2220 e5f2f494-b856-4b98-b285-d166d9295462
parent 36f31d1b
...@@ -348,7 +348,7 @@ AuthSrvImpl::processAxfrQuery(const IOMessage& io_message, Message& message, ...@@ -348,7 +348,7 @@ AuthSrvImpl::processAxfrQuery(const IOMessage& io_message, Message& message,
axfr_client_.sendXfroutRequestInfo(io_message.getSocket().getNative(), axfr_client_.sendXfroutRequestInfo(io_message.getSocket().getNative(),
io_message.getData(), io_message.getData(),
io_message.getDataSize()); io_message.getDataSize());
} catch (const XfroutError& err) { // XXX: avoid catch-all catch!! } catch (const XfroutError& err) {
if (is_xfrin_connection_established_) { if (is_xfrin_connection_established_) {
axfr_client_.disconnect(); axfr_client_.disconnect();
is_xfrin_connection_established_ = false; is_xfrin_connection_established_ = false;
......
...@@ -128,7 +128,9 @@ headerCheck(const Message& message, const qid_t qid, const Rcode& rcode, ...@@ -128,7 +128,9 @@ headerCheck(const Message& message, const qid_t qid, const Rcode& rcode,
TEST_F(AuthSrvTest, unsupportedRequest) { TEST_F(AuthSrvTest, unsupportedRequest) {
for (unsigned int i = 1; i < 16; ++i) { for (unsigned int i = 1; i < 16; ++i) {
// set Opcode to 'i', which iterators over all possible codes except // set Opcode to 'i', which iterators over all possible codes except
// the standard query (0) // the standard query (0) and notify(4)
if (i == 4)
continue;
createDataFromFile("simplequery_fromWire"); createDataFromFile("simplequery_fromWire");
data[2] = ((i << 3) & 0xff); data[2] = ((i << 3) & 0xff);
...@@ -242,6 +244,17 @@ TEST_F(AuthSrvTest, ednsBadVers) { ...@@ -242,6 +244,17 @@ TEST_F(AuthSrvTest, ednsBadVers) {
EXPECT_FALSE(parse_message.isDNSSECSupported()); EXPECT_FALSE(parse_message.isDNSSECSupported());
} }
// notify-in teset.
TEST_F(AuthSrvTest, notifyInTest) {
createDataFromFile("notifyin_fromwire");
parse_message.clear(Message::PARSE);
EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
response_renderer));
headerCheck(parse_message, default_qid, Rcode::NOERROR(), Opcode::NOTIFY().getCode(), QR_FLAG,
1, 0, 0, 0);
}
void void
updateConfig(AuthSrv* server, const char* const dbfile, updateConfig(AuthSrv* server, const char* const dbfile,
const bool expect_success) const bool expect_success)
......
###
### This data file was auto-generated from simplequery_fromWire.spec
###
# Header Section
# ID=4149 QR=Query Opcode=NOTIFY(4) Rcode=NOERROR(0)
1035 2400
# QDCNT=1, ANCNT=0, NSCNT=0, ARCNT=0
0001 0000 0000 0000
# Question Section
# QNAME=example.com. QTYPE=SOA(6) QCLASS=IN(1)
076578616d706c6503636f6d00 0006 0001
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment