From: Kees Monshouwer Date: Sat, 8 Mar 2014 00:42:24 +0000 (+0100) Subject: database schema change gsqlite3 backend X-Git-Tag: rec-3.6.0-rc1~75^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fe8e6b44ebdf4b09167f019af5a3773da14d9b6f;p=thirdparty%2Fpdns.git database schema change gsqlite3 backend --- diff --git a/.travis.yml b/.travis.yml index bef809d3b7..d5122d30e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,9 +69,9 @@ script: # - travis_retry ./start-test-stop 5300 remotebackend-http-dnssec # - travis_retry ./start-test-stop 5300 remotebackend-zeromq # - travis_retry ./start-test-stop 5300 remotebackend-zeromq-dnssec -# - ./start-test-stop 5300 gsqlite3-nodnssec-both -# - ./start-test-stop 5300 gsqlite3-both -# - ./start-test-stop 5300 gsqlite3-nsec3-both + - ./start-test-stop 5300 gsqlite3-nodnssec-both + - ./start-test-stop 5300 gsqlite3-both + - ./start-test-stop 5300 gsqlite3-nsec3-both # - ./start-test-stop 5300 mydns # - ./start-test-stop 5300 tinydns # - ./start-test-stop 5300 opendbx-sqlite3 diff --git a/modules/gsqlite3backend/Makefile.am b/modules/gsqlite3backend/Makefile.am index bd4d93960f..49acbc3a5e 100644 --- a/modules/gsqlite3backend/Makefile.am +++ b/modules/gsqlite3backend/Makefile.am @@ -2,7 +2,7 @@ AM_CPPFLAGS=@THREADFLAGS@ $(BOOST_CPPFLAGS) lib_LTLIBRARIES = libgsqlite3backend.la EXTRA_DIST=OBJECTFILES OBJECTLIBS \ - dnssec.schema.sqlite3.sql no-dnssec.schema.sqlite3.sql + schema.sqlite3.sql nodnssec-3.x_to_3.4_schema.sqlite3.sql libgsqlite3backend_la_SOURCES=gsqlite3backend.cc gsqlite3backend.hh diff --git a/modules/gsqlite3backend/dnssec.schema.sqlite3.sql b/modules/gsqlite3backend/dnssec.schema.sqlite3.sql deleted file mode 100644 index 69afe63d00..0000000000 --- a/modules/gsqlite3backend/dnssec.schema.sqlite3.sql +++ /dev/null @@ -1,31 +0,0 @@ -alter table records add ordername VARCHAR(255); -alter table records add auth bool; -create index orderindex on records(ordername); - -create table domainmetadata ( - id INTEGER PRIMARY KEY, - domain_id INT NOT NULL, - kind VARCHAR(16) COLLATE NOCASE, - content TEXT -); - -create index domainmetaidindex on domainmetadata(domain_id); - -create table cryptokeys ( - id INTEGER PRIMARY KEY, - domain_id INT NOT NULL, - flags INT NOT NULL, - active BOOL, - content TEXT -); - -create index domainidindex on cryptokeys(domain_id); - -create table tsigkeys ( - id INTEGER PRIMARY KEY, - name VARCHAR(255) COLLATE NOCASE, - algorithm VARCHAR(50) COLLATE NOCASE, - secret VARCHAR(255) -); - -create unique index namealgoindex on tsigkeys(name, algorithm); diff --git a/modules/gsqlite3backend/gsqlite3backend.cc b/modules/gsqlite3backend/gsqlite3backend.cc index 1569d94f5b..5a783dcfdb 100644 --- a/modules/gsqlite3backend/gsqlite3backend.cc +++ b/modules/gsqlite3backend/gsqlite3backend.cc @@ -58,68 +58,52 @@ public: declare( suffix, "database", "Filename of the SQLite3 database", "powerdns.sqlite" ); declare( suffix, "pragma-synchronous", "Set this to 0 for blazing speed", "" ); - string record_query = "SELECT content,ttl,prio,type,domain_id,disabled,name FROM records WHERE"; - string record_auth_query = "SELECT content,ttl,prio,type,domain_id,disabled,name,auth FROM records WHERE"; + declare(suffix, "dnssec", "Enable DNSSEC processing","no"); + + string record_query = "SELECT content,ttl,prio,type,domain_id,disabled,name,auth FROM records WHERE"; declare(suffix, "basic-query", "Basic query", record_query+" disabled=0 and type='%s' and name='%s'"); declare(suffix, "id-query", "Basic with ID query", record_query+" disabled=0 and type='%s' and name='%s' and domain_id=%d"); declare(suffix, "wildcard-query", "Wildcard query", record_query+" disabled=0 and type='%s' and name like '%s'"); - declare(suffix, "wildcard-id-query", "Wildcard with ID query", record_query+" disabled=0 and type='%s' and name like '%s' and domain_id=%d"); + declare(suffix, "wildcard-id-query", "Wildcard with ID query", record_query+" disabled=0 and type='%s' and name like '%s' and domain_id='%d'"); declare(suffix, "any-query", "Any query", record_query+" disabled=0 and name='%s'"); declare(suffix, "any-id-query", "Any with ID query", record_query+" disabled=0 and name='%s' and domain_id=%d"); declare(suffix, "wildcard-any-query", "Wildcard ANY query", record_query+" disabled=0 and name like '%s'"); - declare(suffix, "wildcard-any-id-query", "Wildcard ANY with ID query", record_query+" disabled=0 and name like '%s' and domain_id=%d"); + declare(suffix, "wildcard-any-id-query", "Wildcard ANY with ID query", record_query+" disabled=0 and name like '%s' and domain_id='%d'"); - declare(suffix, "list-query", "AXFR query", record_query+" (disabled=0 OR %d) and domain_id=%d"); + declare(suffix, "list-query", "AXFR query", record_query+" (disabled=0 OR %d) and domain_id='%d' order by name, type"); declare(suffix, "list-subzone-query", "Subzone listing", record_query+" disabled=0 and (name='%s' OR name like '%s') and domain_id=%d"); - declare(suffix,"remove-empty-non-terminals-from-zone-query", "remove all empty non-terminals from zone", "delete from records where domain_id='%d' and type is null"); - declare(suffix,"insert-empty-non-terminal-query", "insert empty non-terminal in zone", "insert into records (domain_id,name,type,disabled) values ('%d','%s',null,0)"); - declare(suffix,"delete-empty-non-terminal-query", "delete empty non-terminal from zone", "delete from records where domain_id='%d' and name='%s' and type is null"); + declare(suffix, "remove-empty-non-terminals-from-zone-query", "remove all empty non-terminals from zone", "delete from records where domain_id='%d' and type is null"); + declare(suffix, "insert-empty-non-terminal-query", "insert empty non-terminal in zone", "insert into records (domain_id,name,type,disabled,auth) values ('%d','%s',null,0,'1')"); + declare(suffix, "delete-empty-non-terminal-query", "delete empty non-terminal from zone", "delete from records where domain_id='%d' and name='%s' and type is null"); - // and now with auth - declare(suffix, "basic-query-auth", "Basic query", record_auth_query+" disabled=0 and type='%s' and name='%s'"); - declare(suffix, "id-query-auth", "Basic with ID query", record_auth_query+" disabled=0 and type='%s' and name='%s' and domain_id=%d"); - declare(suffix, "wildcard-query-auth", "Wildcard query", record_auth_query+" disabled=0 and type='%s' and name like '%s'"); - declare(suffix, "wildcard-id-query-auth", "Wildcard with ID query", record_auth_query+" disabled=0 and type='%s' and name like '%s' and domain_id='%d'"); + declare( suffix, "master-zone-query", "Data", "select master from domains where name='%s' and type='SLAVE'"); - declare(suffix, "any-query-auth", "Any query", record_auth_query+" disabled=0 and name='%s'"); - declare(suffix, "any-id-query-auth", "Any with ID query", record_auth_query+" disabled=0 and name='%s' and domain_id=%d"); - declare(suffix, "wildcard-any-query-auth", "Wildcard ANY query", record_auth_query+" disabled=0 and name like '%s'"); - declare(suffix, "wildcard-any-id-query-auth", "Wildcard ANY with ID query", record_auth_query+" disabled=0 and name like '%s' and domain_id='%d'"); + declare( suffix, "info-zone-query", "","select id,name,master,last_check,notified_serial,type from domains where name='%s'"); - declare(suffix, "list-query-auth", "AXFR query", record_auth_query+" (disabled=0 OR %d) and domain_id='%d' order by name, type"); - declare(suffix, "list-subzone-query-auth", "Subzone listing", record_auth_query+" disabled=0 and (name='%s' OR name like '%s') and domain_id=%d"); + declare( suffix, "info-all-slaves-query", "","select id,name,master,last_check,type from domains where type='SLAVE'"); + declare( suffix, "supermaster-query", "", "select account from supermasters where ip='%s' and nameserver='%s'"); + declare( suffix, "supermaster-name-to-ips", "", "select ip from supermasters where nameserver='%s'"); + + declare( suffix, "insert-zone-query", "", "insert into domains (type,name) values('NATIVE','%s')"); + declare( suffix, "insert-slave-query", "", "insert into domains (type,name,master,account) values('SLAVE','%s','%s','%s')"); + + declare(suffix, "insert-record-query", "", "insert into records (content,ttl,prio,type,domain_id,disabled,name,auth) values ('%s',%d,%d,'%s',%d,%d,'%s',%d)"); + declare(suffix, "insert-record-order-query", "", "insert into records (content,ttl,prio,type,domain_id,disabled,name,ordername,auth) values ('%s',%d,%d,'%s',%d,%d,'%s','%s','%d')"); + declare(suffix, "insert-ent-query", "insert empty non-terminal in zone", "insert into records (type,domain_id,disabled,name,auth) values (null,'%d',0,'%s','%d')"); + declare(suffix, "insert-ent-order-query", "insert empty non-terminal in zone", "insert into records (type,domain_id,disabled,name,ordername,auth) values (null,'%d',0,'%s','%s','%d')"); - declare(suffix, "insert-empty-non-terminal-query-auth", "insert empty non-terminal in zone", "insert into records (domain_id,name,type,disabled,auth) values ('%d','%s',null,0,'1')"); - declare(suffix, "get-order-first-query", "DNSSEC Ordering Query, first", "select ordername, name from records where disabled=0 and domain_id=%d and ordername is not null order by 1 asc limit 1"); declare(suffix, "get-order-before-query", "DNSSEC Ordering Query, before", "select ordername, name from records where disabled=0 and ordername <= '%s' and domain_id=%d and ordername is not null order by 1 desc limit 1"); declare(suffix, "get-order-after-query", "DNSSEC Ordering Query, after", "select min(ordername) from records where disabled=0 and ordername > '%s' and domain_id=%d and ordername is not null"); declare(suffix, "get-order-last-query", "DNSSEC Ordering Query, last", "select ordername, name from records where disabled=0 and ordername != '' and domain_id=%d and ordername is not null order by 1 desc limit 1"); declare(suffix, "set-order-and-auth-query", "DNSSEC set ordering query", "update records set ordername='%s',auth=%d where name='%s' and domain_id='%d' and disabled=0"); + declare(suffix, "set-auth-on-ds-record-query", "DNSSEC set auth on a DS record", "update records set auth=1 where domain_id='%d' and name='%s' and type='DS' and disabled=0"); declare(suffix, "nullify-ordername-and-update-auth-query", "DNSSEC nullify ordername and update auth query", "update records set ordername=NULL,auth=%d where domain_id='%d' and name='%s' and disabled=0"); declare(suffix, "nullify-ordername-and-auth-query", "DNSSEC nullify ordername and auth query", "update records set ordername=NULL,auth=0 where name='%s' and type='%s' and domain_id='%d' and disabled=0"); - declare(suffix, "set-auth-on-ds-record-query", "DNSSEC set auth on a DS record", "update records set auth=1 where domain_id='%d' and name='%s' and type='DS' and disabled=0"); - - declare( suffix, "master-zone-query", "Data", "select master from domains where name='%s' and type='SLAVE'"); - - declare( suffix, "info-zone-query", "","select id,name,master,last_check,notified_serial,type from domains where name='%s'"); - - declare( suffix, "info-all-slaves-query", "","select id,name,master,last_check,type from domains where type='SLAVE'"); - declare( suffix, "supermaster-query", "", "select account from supermasters where ip='%s' and nameserver='%s'"); - declare( suffix, "supermaster-name-to-ips", "", "select ip from supermasters where nameserver='%s'"); - declare( suffix, "insert-zone-query", "", "insert into domains (type,name) values('NATIVE','%s')"); - declare( suffix, "insert-slave-query", "", "insert into domains (type,name,master,account) values('SLAVE','%s','%s','%s')"); - - declare(suffix, "insert-record-query", "", "insert into records (content,ttl,prio,type,domain_id,disabled,name) values ('%s',%d,%d,'%s',%d,%d,'%s')"); - declare(suffix, "insert-record-query-auth", "", "insert into records (content,ttl,prio,type,domain_id,disabled,name,auth) values ('%s',%d,%d,'%s',%d,%d,'%s',%d)"); - declare(suffix, "insert-record-order-query-auth", "", "insert into records (content,ttl,prio,type,domain_id,disabled,name,ordername,auth) values ('%s',%d,%d,'%s',%d,%d,'%s','%s',%d)"); - declare(suffix, "insert-ent-query", "insert empty non-terminal in zone", "insert into records (type,domain_id,disabled,name) values (null,'%d',0,'%s')"); - declare(suffix, "insert-ent-query-auth", "insert empty non-terminal in zone", "insert into records (type,domain_id,disabled,name,auth) values (null,'%d',0,'%s','%d')"); - declare(suffix, "insert-ent-order-query-auth", "insert empty non-terminal in zone", "insert into records (type,domain_id,disabled,name,ordername,auth) values (null,'%d',0,'%s','%s','%d')"); declare( suffix, "update-master-query", "", "update domains set master='%s' where name='%s'"); declare( suffix, "update-kind-query", "", "update domains set type='%s' where name='%s'"); @@ -131,7 +115,6 @@ public: declare( suffix, "delete-zone-query", "", "delete from records where domain_id=%d"); declare( suffix, "delete-rrset-query", "", "delete from records where domain_id = %d and name='%s' and type='%s'"); declare( suffix, "delete-names-query", "", "delete from records where domain_id = %d and name='%s'"); - declare(suffix, "dnssec", "Assume DNSSEC Schema is in place","no"); declare(suffix,"add-domain-key-query","", "insert into cryptokeys (domain_id, flags, active, content) select id, %d, %d, '%s' from domains where name='%s'"); declare(suffix,"list-domain-keys-query","", "select cryptokeys.id, flags, active, content from domains, cryptokeys where cryptokeys.domain_id=domains.id and name='%s'"); @@ -156,7 +139,7 @@ public: declare(suffix, "delete-comment-rrset-query", "", "DELETE FROM comments WHERE domain_id=%d AND name='%s' AND type='%s'"); declare(suffix, "delete-comments-query", "", "DELETE FROM comments WHERE domain_id=%d"); } - + //! Constructs a new gSQLite3Backend object. DNSBackend *make( const string & suffix = "" ) { diff --git a/modules/gsqlite3backend/no-dnssec.schema.sqlite3.sql b/modules/gsqlite3backend/no-dnssec.schema.sqlite3.sql deleted file mode 100644 index fced5c7aa0..0000000000 --- a/modules/gsqlite3backend/no-dnssec.schema.sqlite3.sql +++ /dev/null @@ -1,48 +0,0 @@ -create table domains ( - id INTEGER PRIMARY KEY, - name VARCHAR(255) NOT NULL COLLATE NOCASE, - master VARCHAR(128) DEFAULT NULL, - last_check INTEGER DEFAULT NULL, - type VARCHAR(6) NOT NULL, - notified_serial INTEGER DEFAULT NULL, - account VARCHAR(40) DEFAULT NULL -); - -CREATE UNIQUE INDEX name_index ON domains(name); - -CREATE TABLE records ( - id INTEGER PRIMARY KEY, - domain_id INTEGER DEFAULT NULL, - name VARCHAR(255) DEFAULT NULL, - type VARCHAR(10) DEFAULT NULL, - content VARCHAR(65535) DEFAULT NULL, - ttl INTEGER DEFAULT NULL, - prio INTEGER DEFAULT NULL, - change_date INTEGER DEFAULT NULL, - disabled BOOLEAN DEFAULT 0 -); - -CREATE INDEX rec_name_index ON records(name); -CREATE INDEX nametype_index ON records(name,type); -CREATE INDEX domain_id ON records(domain_id); - -create table supermasters ( - ip VARCHAR(64) NOT NULL, - nameserver VARCHAR(255) NOT NULL COLLATE NOCASE, - account VARCHAR(40) DEFAULT NULL -); - -CREATE UNIQUE INDEX ip_nameserver_pk ON supermasters(ip, nameserver); - -CREATE TABLE comments ( - id INTEGER PRIMARY KEY, - domain_id INTEGER NOT NULL, - name VARCHAR(255) NOT NULL, - type VARCHAR(10) NOT NULL, - modified_at INT NOT NULL, - account VARCHAR(40) DEFAULT NULL, - comment VARCHAR(65535) NOT NULL -); -CREATE INDEX comments_domain_id_index ON comments (domain_id); -CREATE INDEX comments_nametype_index ON comments (name, type); -CREATE INDEX comments_order_idx ON comments (domain_id, modified_at); diff --git a/modules/gsqlite3backend/nodnssec-3.x_to_3.4_schema.sqlite3.sql b/modules/gsqlite3backend/nodnssec-3.x_to_3.4_schema.sqlite3.sql new file mode 100644 index 0000000000..3c09dfe8b6 --- /dev/null +++ b/modules/gsqlite3backend/nodnssec-3.x_to_3.4_schema.sqlite3.sql @@ -0,0 +1,55 @@ +ALTER TABLE records ADD disabled BOOL DEFAULT 0; +ALTER TABLE records ADD ordername VARCHAR(255); +ALTER TABLE records ADD auth BOOL DEFAULT 1; + +CREATE INDEX orderindex ON records(ordername); + + + +CREATE TABLE domainmetadata ( + id INTEGER PRIMARY KEY, + domain_id INT NOT NULL, + kind VARCHAR(16) COLLATE NOCASE, + content TEXT +); + +CREATE INDEX domainmetaidindex on domainmetadata(domain_id); + + + +CREATE TABLE cryptokeys ( + id INTEGER PRIMARY KEY, + domain_id INT NOT NULL, + flags INT NOT NULL, + active BOOL, + content TEXT +); + +CREATE INDEX domainidindex ON cryptokeys(domain_id); + + + +CREATE TABLE tsigkeys ( + id INTEGER PRIMARY KEY, + name VARCHAR(255) COLLATE NOCASE, + algorithm VARCHAR(50) COLLATE NOCASE, + secret VARCHAR(255) +); + +CREATE UNIQUE INDEX namealgoindex ON tsigkeys(name, algorithm); + + + +CREATE TABLE comments ( + id INTEGER PRIMARY KEY, + domain_id INTEGER NOT NULL, + name VARCHAR(255) NOT NULL, + type VARCHAR(10) NOT NULL, + modified_at INT NOT NULL, + account VARCHAR(40) DEFAULT NULL, + comment VARCHAR(65535) NOT NULL +); + +CREATE INDEX comments_domain_id_index ON comments (domain_id); +CREATE INDEX comments_nametype_index ON comments (name, type); +CREATE INDEX comments_order_idx ON comments (domain_id, modified_at); diff --git a/modules/gsqlite3backend/schema.sqlite3.sql b/modules/gsqlite3backend/schema.sqlite3.sql new file mode 100644 index 0000000000..8164199bc8 --- /dev/null +++ b/modules/gsqlite3backend/schema.sqlite3.sql @@ -0,0 +1,92 @@ +CREATE TABLE domains ( + id INTEGER PRIMARY KEY, + name VARCHAR(255) NOT NULL COLLATE NOCASE, + master VARCHAR(128) DEFAULT NULL, + last_check INTEGER DEFAULT NULL, + type VARCHAR(6) NOT NULL, + notified_serial INTEGER DEFAULT NULL, + account VARCHAR(40) DEFAULT NULL +); + +CREATE UNIQUE INDEX name_index ON domains(name); + + + +CREATE TABLE records ( + id INTEGER PRIMARY KEY, + domain_id INTEGER DEFAULT NULL, + name VARCHAR(255) DEFAULT NULL, + type VARCHAR(10) DEFAULT NULL, + content VARCHAR(65535) DEFAULT NULL, + ttl INTEGER DEFAULT NULL, + prio INTEGER DEFAULT NULL, + change_date INTEGER DEFAULT NULL, + disabled BOOLEAN DEFAULT 0, + ordername VARCHAR(255), + auth BOOL DEFAULT 1 +); + +CREATE INDEX rec_name_index ON records(name); +CREATE INDEX nametype_index ON records(name,type); +CREATE INDEX domain_id ON records(domain_id); +CREATE INDEX orderindex ON records(ordername); + + + +CREATE TABLE supermasters ( + ip VARCHAR(64) NOT NULL, + nameserver VARCHAR(255) NOT NULL COLLATE NOCASE, + account VARCHAR(40) DEFAULT NULL +); + +CREATE UNIQUE INDEX ip_nameserver_pk ON supermasters(ip, nameserver); + + + +CREATE TABLE comments ( + id INTEGER PRIMARY KEY, + domain_id INTEGER NOT NULL, + name VARCHAR(255) NOT NULL, + type VARCHAR(10) NOT NULL, + modified_at INT NOT NULL, + account VARCHAR(40) DEFAULT NULL, + comment VARCHAR(65535) NOT NULL +); + +CREATE INDEX comments_domain_id_index ON comments (domain_id); +CREATE INDEX comments_nametype_index ON comments (name, type); +CREATE INDEX comments_order_idx ON comments (domain_id, modified_at); + + + +CREATE TABLE domainmetadata ( + id INTEGER PRIMARY KEY, + domain_id INT NOT NULL, + kind VARCHAR(16) COLLATE NOCASE, + content TEXT +); + +CREATE INDEX domainmetaidindex ON domainmetadata(domain_id); + + + +CREATE TABLE cryptokeys ( + id INTEGER PRIMARY KEY, + domain_id INT NOT NULL, + flags INT NOT NULL, + active BOOL, + content TEXT +); + +CREATE INDEX domainidindex ON cryptokeys(domain_id); + + + +CREATE TABLE tsigkeys ( + id INTEGER PRIMARY KEY, + name VARCHAR(255) COLLATE NOCASE, + algorithm VARCHAR(50) COLLATE NOCASE, + secret VARCHAR(255) +); + +CREATE UNIQUE INDEX namealgoindex ON tsigkeys(name, algorithm); diff --git a/regression-tests/backends/gsqlite3-master b/regression-tests/backends/gsqlite3-master index 034a64a815..f98ab6d47d 100644 --- a/regression-tests/backends/gsqlite3-master +++ b/regression-tests/backends/gsqlite3-master @@ -1,7 +1,7 @@ case $context in gsqlite3-nodnssec) rm -f pdns.sqlite3 - sqlite3 pdns.sqlite3 < ../modules/gsqlite3backend/no-dnssec.schema.sqlite3.sql + sqlite3 pdns.sqlite3 < ../modules/gsqlite3backend/schema.sqlite3.sql tosql gsqlite | sqlite3 pdns.sqlite3 echo ANALYZE\; | sqlite3 pdns.sqlite3 @@ -14,6 +14,9 @@ __EOF__ ../pdns/pdnssec --config-dir=. --config-name=gsqlite3 rectify-zone $zone 2>&1 done + ../pdns/pdnssec --config-dir=. --config-name=gsqlite3 import-tsig-key test $ALGORITHM $KEY + ../pdns/pdnssec --config-dir=. --config-name=gsqlite3 activate-tsig-key tsig.com test master + $RUNWRAPPER $PDNS --daemon=no --local-port=$port --socket-dir=./ \ --no-shuffle --launch=gsqlite3 \ --send-root-referral \ @@ -25,8 +28,7 @@ __EOF__ gsqlite3 | gsqlite3-nsec3 | gsqlite3-nsec3-optout) rm -f pdns.sqlite3 - sqlite3 pdns.sqlite3 < ../modules/gsqlite3backend/no-dnssec.schema.sqlite3.sql - sqlite3 pdns.sqlite3 < ../modules/gsqlite3backend/dnssec.schema.sqlite3.sql + sqlite3 pdns.sqlite3 < ../modules/gsqlite3backend/schema.sqlite3.sql tosql gsqlite | sqlite3 pdns.sqlite3 echo ANALYZE\; | sqlite3 pdns.sqlite3 diff --git a/regression-tests/backends/gsqlite3-slave b/regression-tests/backends/gsqlite3-slave index 4d8312770f..162ef33c8a 100644 --- a/regression-tests/backends/gsqlite3-slave +++ b/regression-tests/backends/gsqlite3-slave @@ -1,24 +1,19 @@ context=${context}-presigned-gsqlite3 rm -f pdns.sqlite31 - sqlite3 pdns.sqlite31 < ../modules/gsqlite3backend/no-dnssec.schema.sqlite3.sql - sqlite3 pdns.sqlite31 < ../modules/gsqlite3backend/dnssec.schema.sqlite3.sql + sqlite3 pdns.sqlite31 < ../modules/gsqlite3backend/schema.sqlite3.sql for zone in $(grep 'zone ' named.conf | cut -f2 -d\" | tac) do sqlite3 pdns.sqlite31 "INSERT INTO domains (name, type, master) VALUES('$zone','SLAVE','127.0.0.1:$port');" done + sqlite3 pdns.sqlite31 "INSERT INTO tsigkeys (name,algorithm,secret) VALUES('test','$ALGORITHM', '$KEY')" + sqlite3 pdns.sqlite31 "INSERT INTO domainmetadata (domain_id, kind, content) SELECT id, 'AXFR-MASTER-TSIG', 'test' FROM domains WHERE name = 'tsig.com'" set +e - echo $skipreasons | grep -q nodnssec + echo $skipreasons | grep -q nolua if [ $? -ne 0 ] then - sqlite3 pdns.sqlite31 "INSERT INTO tsigkeys (name,algorithm,secret) VALUES('test','$ALGORITHM', '$KEY')" - sqlite3 pdns.sqlite31 "INSERT INTO domainmetadata (domain_id, kind, content) SELECT id, 'AXFR-MASTER-TSIG', 'test' FROM domains WHERE name = 'tsig.com'" - echo $skipreasons | grep -q nolua - if [ $? -ne 0 ] - then - sqlite3 pdns.sqlite31 "INSERT INTO domainmetadata (domain_id,kind,content) SELECT id,'AXFR-SOURCE','127.0.0.2' FROM domains WHERE name = 'stest.com'" - fi + sqlite3 pdns.sqlite31 "INSERT INTO domainmetadata (domain_id,kind,content) SELECT id,'AXFR-SOURCE','127.0.0.2' FROM domains WHERE name = 'stest.com'" fi set -e @@ -29,7 +24,7 @@ --fancy-records --send-root-referral \ --cache-ttl=0 --query-cache-ttl=0 --no-config --slave --retrieval-threads=4 \ --gsqlite3-database=pdns.sqlite31 --gsqlite3-pragma-synchronous=0 \ - --config-name=gsqlite32 |& egrep -v "update records set ordername|insert into records" & + --config-name=gsqlite32 & echo 'waiting for zones to be slaved' set +e loopcount=0