return NULL;
}
+ assert(conf->io.flags & CONF_IO_FACTIVE);
+ bool include = conf->io.flags & CONF_IO_FDIFF_ZONES;
+
+ // Insert possibly added zones by conf-set include.
+ if (include) {
+ for (conf_iter_t it = conf_iter(conf, C_ZONE); it.code == KNOT_EOK;
+ conf_iter_next(conf, &it)) {
+ conf_val_t id = conf_iter_id(conf, &it);
+ const knot_dname_t *name = conf_dname(&id);
+ zone_t *zone = knot_zonedb_find(db_new, name);
+ if (zone == NULL) { // Create an included zone.
+ zone = get_zone(conf, name, server, NULL);
+ if (zone == NULL) {
+ continue;
+ }
+ knot_zonedb_insert(db_new, zone);
+ }
+ }
+ }
+
if (conf->io.zones != NULL) {
trie_it_t *trie_it = trie_it_begin(conf->io.zones);
for (; !trie_it_finished(trie_it); trie_it_next(trie_it)) {
t.start()
+knot.use_confdb = True
+knot.gen_confile()
+knot.ctl("conf-import %s" % knot.confile, availability=False)
+knot.stop()
+knot.start()
+
ctl.connect(os.path.join(knot.dir, "knot.sock"))
ctl.send_block(cmd="conf-begin")
ctl.send_block(cmd="conf-set", section="include", data=added_file)
resp = ctl.receive_block()
-# Cannot commit as it reloads the server without this include!
-ctl.send_block(cmd="conf-get", section="zone")
+ctl.send_block(cmd="conf-commit")
+resp = ctl.receive_block()
+
+ctl.send_block(cmd="conf-read", section="zone")
resp = ctl.receive_block()
isset(ZONE1 in resp['zone'], ZONE1)
isset(ZONE3 in resp['zone'], ZONE3)
isset(ZONE4 in resp['zone'], ZONE4)
-ctl.send_block(cmd="conf-commit")
-resp = ctl.receive_block()
-
ctl.send_block(cmd="conf-read", section="server")
resp = ctl.receive_block()
isset('tcp-max-clients' in resp['server'], "server section item not set")
isset('5' in resp['server']['tcp-max-clients'], "server section item value not set")
+ctl.send_block(cmd="zone-status")
+resp = ctl.receive_block()
+
+isset(ZONE1 in resp, ZONE1)
+isset(ZONE2 in resp, ZONE2)
+isset(ZONE3 in resp, ZONE3)
+isset(ZONE4 in resp, ZONE4)
+
ctl.send(libknot.control.KnotCtlType.END)
ctl.close()
self.start_params = None
self.ctl_params = None
self.ctl_params_append = None # The last parameter wins.
+ self.use_confdb = False
self.data_dir = None
s.item_str("quic", "debug")
s.end()
- self.start_params = ["-c", self.confile]
- self.ctl_params = ["-c", self.confile, "-t", "15"]
+ if self.use_confdb:
+ conf_params = ["-C", os.path.join(self.dir, "confdb")]
+ else:
+ conf_params = ["-c", self.confile]
+ self.start_params = conf_params
+ self.ctl_params = conf_params + ["-t", "15"]
if self.ctl_params_append != None:
self.ctl_params += self.ctl_params_append