Jelte Jansen [Tue, 8 May 2012 09:53:24 +0000 (11:53 +0200)]
[1207] Remove InMemoryClient-specific code from auth_srv
Made the getZoneCount() method from inmemory client a general datasource client
call (which throws NotImplemented by default), as this does seem useful in other
cases as well.
Now the work starts to pay off; removed the temporary pointer variable (getInMemoryClientP() still returns a pointer but now directly retrieved from the container), and any direct reference to isc::datasrc::InMemoryClient is removed from au
th_srv (but not from tests as of yet)
JINMEI Tatuya [Mon, 7 May 2012 17:08:55 +0000 (10:08 -0700)]
[master] cleanup: removed an obsolete comment added in development.
It was temporarily introduced at 1fc79b93 for #1028, but it should have been
cleaned up even before commiting the change.
should be trivial and harmless, so I'm directly commiting the cleanup.
Jelte Jansen [Mon, 7 May 2012 13:19:19 +0000 (15:19 +0200)]
[1208] use the container to set in-mem client
Instead of the direct shared_ptr.
Changes needed:
Moved loading of zones in config into the memory_datasrc implementation; at this moment the general API has no method for this (and it may not be necessary; datasources should handle their own config anyway).
This does have one drawback; through the dynamic loading mechanism we currently lose exception type information. So for now specific exceptions such as MasterLoadError end up as 'general' DataSourceErrors. Tests have been updated to reflect this.
Also, I made config handler slightly more lenient; it has hardcoded defaults and will now accept config parts without "class" or "zones"; using .spec -derived values is impractical here with the current config API, but in this case it shouldn't *really* matter; as IN is hardcoded in several places anyway atm.
In case the find didn't give us an exact node, we need to correct the
search at the beginning. The code is slightly dense, but should be well
commented. Also, the tests are fixed slightly and one more added.
The empty chain may mean we did not call find previously. But it also
can mean we just run out of nodes or that we did not find the correct
node. We also handle empty tree specially.
Jelte Jansen [Mon, 7 May 2012 10:25:28 +0000 (12:25 +0200)]
[1207] store and use raw inmem client pointer
(temporarily)
In order to add datasource factory, but keep current code working, store both the shared ptr (for reference counting) and the raw pointer it encapsulates. The latter is then used to call query::process().
Slight change was done in the test, as the test can't find the "hidden"
nodes using find. Also, we need to clear the node chain manually between
reusing it.
Jelte Jansen [Thu, 3 May 2012 13:06:13 +0000 (15:06 +0200)]
[1889] use cwd as data_path in cfgmgr if config_file is given
Depending on whether config_file is specified, use either the builtin default or os.getcwd() for the data path (so that you can use relative config file names. If an absolute config file is given, data path is ignored).
Also added an info log message specifying which file cfgmgr ends up using.
Jeremy C. Reed [Thu, 19 Apr 2012 16:13:42 +0000 (11:13 -0500)]
[master] make sure auth server is running before queried
This fixes lettuce failure:
Scenario: Delegation query for unsigned child zone # features/queries.feature:106
Given I have bind10 running with configuration example.org.inmem.config # features/terrain/bind10_control.py:107
+ And wait for bind10 stderr message AUTH_SERVER_STARTED # features/terrain/steps.py:34
A dnssec query for www.sub.example.org type AAAA should have rcode NOERROR # features/terrain/querying.py:204
Traceback (most recent call last):
File "/usr/pkg/lib/python2.6/site-packages/lettuce/core.py", line 117, in __call__
ret = self.function(self.step, *args, **kw)
File "/home/reed/work/isc/bind10/git/bind10-CLEAN/tests/lettuce/features/terrain/querying.py", line 240, in query
"Expected: " + rcode + ", got " + query_result.rcode
AssertionError: Expected: NOERROR, got NO_ANSWER
This was discussed on jabber. (Maybe the cmdctl check is not needed,
but shouldn't hurt either.)
[1843] half-related cleanup; return copies of spec parts
so that if they have nested default values, which may be set to 'local', and modified later, the original isn't changed. (technically it should be enough to do the copy when setting, but it's safer to copy them entirely for now)
[1891] enabled some DatabaseClientTest for add/del NSEC3s for SQLite3, too.
They were originally planned to be enabled with the completion of this branch,
but I forgot to enable them before review. As expected, they just passed
for SQLite3, too.
[1891] added bindXXX methods to StatementProcessor as sqlite_bind_xxx wrapper.
As suggested in review.
This will make the caller code simpler. It's also safer in that the caller
doesn't have to manipulate the statement separetely (in the previous way
StatementProcessor and the caller could use different statements).
Also made naming more consistent: in the very initial version the class was
called "Executer" and then renamed to Processor. Some variables of this class
were still named "exec", etc, but it's more consistent if they are named
like "proc".