- consolidated test scenarios for NSEC and NSEC3 to avoid duplicates
- also tested the case for findAll()
- also tested when the zone only has NSEC3PARAM or unsigned
[1579] (suggested) cleanup, mainly moving isNSEC[3] to FindDNSSECContext
these are short, and only used in FindDNSSECContext, so it'd make more sense
to enclose them there.
Other cleanups:
- also made FindDNSSECContext::isNSEC/isNSEC3 private as they now don't need
to be called outside the class
- removed isInited(); simpy doesn't see the need for it as a separate method
- simplified the code logic of getResultFlag()
[1579] suggested change: made findNoNameResult completely DNSSEC-agnostic.
same adjustment as the previous comment was made for tests.
also fixed a small bug in getDNSSECRRset(): I should have reversed the
logic for need_nscheck.
[1579] suggested change: made findNoNameResult a bit more DNSSEC-agnostic.
to make a related test pass, incorporated the NotImplemented exception
handling from findNSECCover to getDNSSECRRset.
note: in this commit I reversed the behavior when we encounter the situation
where NSEC is expected but cannot be found; it now returns a NULL pointer,
although the NSEC_SIGNED flag can be still set.
It's a quite broken case of zone config so it's probably up to the
implementation, and in that sense throwing an exception is not necessary
wrong. But we may have such a situation in a valid scenario if and when we
support incremental zone signing. Also, this behavior is consistent with
BIND 9.
The emptyNonterminalNSEC test case was adjusted accordingly.
[1579] suggest change: made findWildcardMatch DNSSEC-agnostic.
to do this, I extended getDNSSECRRset(name) further: it now takes 'covering'
parameter, depending on whether the requested NSEC is for the exact name
or the covering ("previous") name. In the latter case it does the same
thing as findNSECCover() (which will be merged to getDNSSECRRset later).
[1579] suggested change: made findOnNameResult DNSSEC-agnostic about flags.
now FindDNSSECContext has sufficient information to choose the correct flag,
findOnNameResult() can simply call its getResultFlags().
as an additional bonus, we can constify 'flags'.
[1579] suggested change: made findOnNameResult more DNSSEC agnostic
- renamed getNSECRRset to getDNSSECRRset to clarify it's for generic DNSSEC
purpose, even though it's essentially NSEC specific.
- moved the 'isNSEC' check to the now-renamed getDNSSECRRset, thereby removing
the need for checking that within findOnNameResult.
[1579] suggested change: pass a reference of ZoneFinder to DNSSECContext.
instead of a pointer.
IMO, finderp_ should better be a reference than a pointer if we'd
worry about the case where it's NULL later on, like getNSECRRset
does (which shouldn't never happen in our usage).
the NULL pointer check was therefore removed with this change.
[1579] suggested changes: made FindDNSSECContext more focused.
removed origin_ or complete flags_ from the class members. non DNSSEC-specific
processing was recovered from the original version.
also made FindDNSSECContext private inside ZoneFinder; it doesn't have to
be publicly usable.
also made indentation policy more consistent for the class.
in xfrin
- add note about lack of thread-safety
- add note about from-source temporariness
- add test for case-insensitive class strings
- directly replace _memory_zones
move GTEST_LDADD to the end of the list, so that the source tree libs get linked instead of those installed in the same location as gtest
(reviewed on jabber by jinmei)
All in xfrin memory zones handlers;
- normalize zone name and class
- provide strong exception guarantee in _set_memory_zones
- fix comment in _set_db_file
- make _auth_config_update 'protected'
And in the tests:
- extracted memory zones update tests to own class
- added tests for bad data
- added tests for normalization
This one is wrong in many ways. It assumes (without checking) it gets an
exact match, it does not check any wrong data, it expects given order of
results. But it passes the minimal test now, and can be used as a base
for improving the implementation.
[1791] fixed one remaining regression: 'separate_rrs' case was broken.
added a test for that case to confirm the regression and the fix.
also introduced some more cleanups: removed rdata_txt_ so we simplify the
code further, made isSameType static class function (it doesn't refer to
any class attributes), constified separate_rrs_.
[1792] added a simple lettuce for the "inmemory w/ SQLite3 backend" scenario.
right now it does a simple check for loading and query response from the loaded
zone. this is intended to be used for the inmemory-from-xfrin scenarios.
[1792] added supplemental utility for tests using SQLite3 backend.
it creates a temporary SQLite3 DB file from a shared template with a specified
stream of zone data. this will help reduce the number of pre-generated DB
files in the repository (which will be subject to upgrading the schema).
[1791] updated the log description for mismatched TTLs.
it didn't seem correct to say "it's not allowed on the wire". this
restriction is more about the definition of the RRset concept, rather than
what we'd see in the wire. also added a reference to the relevant RFC (2181).
[1791] fixed the bug in database iterator wrt RRs of mixed TTLs.
the previous version didn't always reset it to the smallest TTL; the new test
added in the previous commit uncovered it. this version passed that test.
also made some cleanups in the code reducing temporary variables for better
readability.
[1791] added a database iterator test that would uncover an (unrelated) bug.
it checks the case for RRsets with the TTL of the first RR is later than that
of the second. The original implementation has a bug in this case, but the
previous test was insufficient and fail to discover it.
One test is taken and ported to the database. It does compile partially
(the rest is commented out for now) and does not pass. Also, another
function moved to common file.
[1791] complete inmemory loader from iterator w/ consideration for RRSIGs.
the iterator is now assumed to be created in the 'non separate' mode based
on the bug fix of the previous commit.
tests are updated with RRSIGs, and about how to create the iterator.
doxygen comments clarify this point too.
[1788] removed the default for 'filetype' from the spec file.
for optional items setting the default doesn't make sense, but we also have
test cases where syntax validation is skipped, so changing it to non-optional
will break existing test cases. at least for now, it seems to make most sense
to keep it optional and define the default within the parser code.
[1788] used a simpler version of validateConfig() (not taking 'errors' list).
in this test we are only interested in the specific config is valid or not,
so we didn't need the 'errors'. (actually I didn't notice there was this
version of validateConfig() previously).
[1852] When opening a HTTP socket is unexpectedly failed due to a socket error e.g. Address already in use, it explicitly closes the CC Session already opened before it shuts down.
- added one test case for checking the new "filetype" item is optional.
- also added a test in MemoryDatasrcConfigTest to see whether "filetype" is
accepted.
- others should be trivial editorial cleanup.
Mukund Sivaraman [Thu, 29 Mar 2012 20:22:23 +0000 (01:52 +0530)]
[1220] Add testcase which checks use of trailing slashes with indices
Trailing slashes are supposed to work. It should not result in an error
like this:
> config show Resolver/listen_on
Resolver/listen_on[0]/address "::1" string
Resolver/listen_on[0]/port 53 integer
> config show Resolver/listen_on/
Error: Resolver/listen_on/[0]/address not found