From: Aki Tuomi Date: Thu, 23 Jan 2014 14:04:11 +0000 (+0200) Subject: Generalized feed_ds better X-Git-Tag: rec-3.6.0-rc1~228^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2539abbdfc903b760900e090ff826306187140cf;p=pdns Generalized feed_ds better --- diff --git a/regression-tests/backends/remote-master b/regression-tests/backends/remote-master index ad3346c98..e81e87ea6 100644 --- a/regression-tests/backends/remote-master +++ b/regression-tests/backends/remote-master @@ -104,7 +104,7 @@ EOF ../pdns/pdnssec --config-dir=. --config-name=remote secure-zone example.com ../pdns/pdnssec --config-dir=. --config-name=remote secure-zone up.example.com - ./feed_ds.pl up.example.com example.com "../pdns/pdnssec --config-dir=. --config-name=remote" $testsdir/remote.sqlite3 + ./gsql_feed_ds.pl up.example.com example.com "../pdns/pdnssec --config-dir=. --config-name=remote" "sqlite3 $testsdir/remote.sqlite3" if [ "$remotesec" = "nsec3" ] then diff --git a/regression-tests/feed_ds.pl b/regression-tests/gsql_feed_ds.pl similarity index 56% rename from regression-tests/feed_ds.pl rename to regression-tests/gsql_feed_ds.pl index 1a0de560a..3e2d4691a 100755 --- a/regression-tests/feed_ds.pl +++ b/regression-tests/gsql_feed_ds.pl @@ -4,12 +4,14 @@ use strict; use warnings; use 5.005; -# usage: feed_ds.pl domain parent pdnssec sqdb +# usage: feed_ds.pl domain parent pdnssec sqlcmd my $domain = shift; my $parent = shift; my $pdnssec = shift; -my $sqdb = shift; +my $sqlcmd = shift; + +die "Usage: $0 domain parent pdnssec sqlcmd" unless($domain and $parent and $pdnssec and $sqlcmd); open IN, "-|", "$pdnssec show-zone $domain 2>&1"; @@ -17,7 +19,7 @@ my $recs = []; while() { chomp; - if (/DS = (.*) IN DS (.*);/) { + if (/DS = (.*) IN DS (.*) ;/) { # we have data push @$recs, [ $1, $2 ] @@ -26,7 +28,7 @@ while() { for my $rec (@$recs) { my ($name,$value) = @$rec; - my $sql = qq(INSERT INTO records (domain_id, name, type, content, ttl, auth) SELECT id, "$name", "DS", "$value", 120, 1 FROM domains WHERE name = "$parent"); + my $sql = qq(INSERT INTO records (domain_id, name, type, content, ttl, auth) SELECT id, '$name', 'DS', '$value', 120, 1 FROM domains WHERE name = '$parent'); # then feed data - qx(sqlite3 $sqdb '$sql') + qx($sqlcmd "$sql") }