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
Sebastian Schrader
Kea
Commits
b131dd71
Commit
b131dd71
authored
Aug 25, 2011
by
Michal 'vorner' Vaner
Browse files
[1176] Test for query dnssec positive support
parent
84d83c1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bin/auth/tests/query_unittest.cc
View file @
b131dd71
...
...
@@ -141,7 +141,7 @@ private:
typedef
map
<
RRType
,
ConstRRsetPtr
>
RRsetStore
;
typedef
map
<
Name
,
RRsetStore
>
Domains
;
Domains
domains_
;
void
loadRRset
(
Const
RRsetPtr
rrset
)
{
void
loadRRset
(
RRsetPtr
rrset
)
{
domains_
[
rrset
->
getName
()][
rrset
->
getType
()]
=
rrset
;
if
(
rrset
->
getName
()
==
delegation_name_
&&
rrset
->
getType
()
==
RRType
::
NS
())
{
...
...
@@ -149,6 +149,26 @@ private:
}
else
if
(
rrset
->
getName
()
==
dname_name_
&&
rrset
->
getType
()
==
RRType
::
DNAME
())
{
dname_rrset_
=
rrset
;
// Add some signatures
}
else
if
(
rrset
->
getName
()
==
Name
(
"example.com."
)
&&
rrset
->
getType
()
==
RRType
::
NS
())
{
rrset
->
addRRsig
(
RdataPtr
(
new
generic
::
RRSIG
(
"NS 5 3 3600 "
"20000101000000 "
"20000201000000 "
"12345 example.com. "
"FAKEFAKEFAKE"
)));
}
else
if
(
rrset
->
getType
()
==
RRType
::
A
())
{
rrset
->
addRRsig
(
RdataPtr
(
new
generic
::
RRSIG
(
"A 5 3 3600 "
"20000101000000 "
"20000201000000 "
"12345 example.com. "
"FAKEFAKEFAKE"
)));
}
else
if
(
rrset
->
getType
()
==
RRType
::
AAAA
())
{
rrset
->
addRRsig
(
RdataPtr
(
new
generic
::
RRSIG
(
"AAAA 5 3 3600 "
"20000101000000 "
"20000201000000 "
"12345 example.com. "
"FAKEFAKEFAKE"
)));
}
}
...
...
@@ -304,6 +324,38 @@ TEST_F(QueryTest, exactMatch) {
www_a_txt
,
zone_ns_txt
,
ns_addrs_txt
);
}
TEST_F
(
QueryTest
,
dnssecPositive
)
{
// Just like exactMatch, but the signatures should be included as well
Query
query
(
memory_client
,
qname
,
qtype
,
response
,
true
);
EXPECT_NO_THROW
(
query
.
process
());
// find match rrset
responseCheck
(
response
,
Rcode
::
NOERROR
(),
AA_FLAG
,
1
,
3
,
3
,
(
www_a_txt
+
std
::
string
(
"www.example.com. 3600 IN RRSIG "
"AAAA 5 3 3600 20000101000000 "
"20000201000000 12345 example.com. "
"FAKEFAKEFAKE
\n
"
)).
c_str
(),
(
zone_ns_txt
+
std
::
string
(
"example.com. 3600 IN RRSIG NS 5 "
"3 3600 20000101000000 "
"20000201000000 12345 "
"example.com. FAKEFAKEFAKE
\n
"
)).
c_str
(),
(
ns_addrs_txt
+
std
::
string
(
"glue.delegation.example.com. "
"3600 IN RRSIG A 5 3 3600 "
"20000101000000 20000201000000 "
"12345 example.com. "
"FAKEFAKEFAKE
\n
"
"glue.delegation.example.com. "
"3600 IN RRSIG AAAA 5 3 3600 "
"20000101000000 20000201000000 "
"12345 example.com. "
"FAKEFAKEFAKE
\n
"
"noglue.example.com. 3600 IN "
"RRSIG A 5 3 3600 "
"20000101000000 20000201000000 "
"12345 example.com. "
"FAKEFAKEFAKE
\n
"
)).
c_str
());
}
TEST_F
(
QueryTest
,
exactAddrMatch
)
{
// find match rrset, omit additional data which has already been provided
// in the answer section from the additional.
...
...
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