Permalink
Browse files

dynamic modules regression tests

  • Loading branch information...
1 parent b91f75d commit 74caf870eb8fef3de9c7885be375d1434d3d68f3 @mind04 mind04 committed with mind04 Sep 29, 2014
Showing with 56 additions and 30 deletions.
  1. +1 −1 .travis.yml
  2. +1 −1 modules/remotebackend/test-remotebackend-http.cc
  3. +1 −1 modules/remotebackend/test-remotebackend-json.cc
  4. +1 −1 modules/remotebackend/test-remotebackend-pipe.cc
  5. +1 −1 modules/remotebackend/test-remotebackend-post.cc
  6. +1 −1 modules/remotebackend/test-remotebackend-unix.cc
  7. +1 −1 modules/remotebackend/test-remotebackend-zeromq.cc
  8. +5 −5 pdns/ueberbackend.cc
  9. +1 −1 regression-tests.api/runtests.py
  10. +1 −1 regression-tests.nobackend/edns-packet-cache/command
  11. +1 −0 regression-tests.recursor/config.sh
  12. +2 −0 regression-tests/backends/bind-master
  13. +2 −1 regression-tests/backends/bind-slave
  14. +2 −1 regression-tests/backends/geoip-master
  15. +1 −0 regression-tests/backends/gmysql-master
  16. +1 −0 regression-tests/backends/gmysql-slave
  17. +1 −0 regression-tests/backends/goracle-master
  18. +1 −0 regression-tests/backends/goracle-slave
  19. +1 −0 regression-tests/backends/gpgsql-master
  20. +2 −1 regression-tests/backends/gpgsql-slave
  21. +1 −0 regression-tests/backends/gsqlite3-master
  22. +1 −0 regression-tests/backends/gsqlite3-slave
  23. +1 −1 regression-tests/backends/lmdb-master
  24. +6 −9 regression-tests/backends/mydns-master
  25. +1 −1 regression-tests/backends/opendbx-master
  26. +1 −0 regression-tests/backends/oracle-master
  27. +1 −0 regression-tests/backends/oracle-slave
  28. +2 −1 regression-tests/backends/remote-master
  29. +1 −1 regression-tests/backends/tinydns-master
  30. +1 −0 regression-tests/modules/libbindbackend.so
  31. +1 −0 regression-tests/modules/libgeoipbackend.so
  32. +1 −0 regression-tests/modules/libgmysqlbackend.so
  33. +1 −0 regression-tests/modules/libgoraclebackend.so
  34. +1 −0 regression-tests/modules/libgpgsqlbackend.so
  35. +1 −0 regression-tests/modules/libgsqlite3backend.so
  36. +1 −0 regression-tests/modules/libldapbackend.so
  37. +1 −0 regression-tests/modules/liblmdbbackend.so
  38. +1 −0 regression-tests/modules/libmydnsbackend.so
  39. +1 −0 regression-tests/modules/libopendbxbackend.so
  40. +1 −0 regression-tests/modules/liboraclebackend.so
  41. +1 −0 regression-tests/modules/libremotebackend.so
  42. +1 −0 regression-tests/modules/libtinydnsbackend.so
View
@@ -32,7 +32,7 @@ before_script:
- p11-kit -l # ensure it's ok
script:
- ./bootstrap
- - ./configure --with-modules='bind geoip gmysql gpgsql gsqlite3 mydns tinydns remote random opendbx ldap lmdb' --enable-unit-tests --enable-tools --enable-remotebackend-zeromq --enable-experimental-pkcs11
+ - ./configure --with-dynmodules='bind geoip gmysql gpgsql gsqlite3 mydns tinydns remote random opendbx ldap lmdb' --with-modules='' --enable-unit-tests --enable-tools --enable-remotebackend-zeromq --enable-experimental-pkcs11
- make -k dist
- make -k -j 4
- make -k install DESTDIR=/tmp/pdns-install-dir
@@ -43,7 +43,7 @@ struct RemotebackendSetup {
be = 0;
try {
// setup minimum arguments
- ::arg().set("module-dir")="";
+ ::arg().set("module-dir")="./.libs";
new RemoteLoader();
BackendMakers().launch("remote");
// then get us a instance of it
@@ -43,7 +43,7 @@ struct RemotebackendSetup {
be = 0;
try {
// setup minimum arguments
- ::arg().set("module-dir")="";
+ ::arg().set("module-dir")="./.libs";
new RemoteLoader();
BackendMakers().launch("remote");
// then get us a instance of it
@@ -43,7 +43,7 @@ struct RemotebackendSetup {
be = 0;
try {
// setup minimum arguments
- ::arg().set("module-dir")="";
+ ::arg().set("module-dir")="./.libs";
new RemoteLoader();
BackendMakers().launch("remote");
// then get us a instance of it
@@ -43,7 +43,7 @@ struct RemotebackendSetup {
be = 0;
try {
// setup minimum arguments
- ::arg().set("module-dir")="";
+ ::arg().set("module-dir")="./.libs";
new RemoteLoader();
BackendMakers().launch("remote");
// then get us a instance of it
@@ -43,7 +43,7 @@ struct RemotebackendSetup {
be = 0;
try {
// setup minimum arguments
- ::arg().set("module-dir")="";
+ ::arg().set("module-dir")="./.libs";
new RemoteLoader();
BackendMakers().launch("remote");
// then get us a instance of it
@@ -45,7 +45,7 @@ struct RemotebackendSetup {
be = 0;
try {
// setup minimum arguments
- ::arg().set("module-dir")="";
+ ::arg().set("module-dir")="./.libs";
new RemoteLoader();
BackendMakers().launch("remote");
// then get us a instance of it
View
@@ -70,15 +70,15 @@ int UeberBackend::s_s=-1; // ?
//! Loads a module and reports it to all UeberBackend threads
bool UeberBackend::loadmodule(const string &name)
{
+ L<<Logger::Warning <<"Loading '"<<name<<"'" << endl;
+
void *dlib=dlopen(name.c_str(), RTLD_NOW);
-
+
if(dlib == NULL) {
- L<<Logger::Error<<"Unable to load module '"<<name<<"': "<<dlerror() << endl;
- if(name.find("gsqlite3")!=string::npos)
- L<<Logger::Warning <<"Trying to load gsqlite3backend? Make sure pdns_server was compiled with sqlite3!" <<endl;
+ L<<Logger::Error <<"Unable to load module '"<<name<<"': "<<dlerror() << endl;
return false;
}
-
+
return true;
}
@@ -78,7 +78,7 @@ def ensure_empty_dir(name):
tf.seek(0, os.SEEK_SET) # rewind
subprocess.check_call(["sqlite3", SQLITE_DB], stdin=tf)
- pdnscmd = ("../pdns/pdns_server --daemon=no --local-port=5300 --socket-dir=./ --no-shuffle --launch=gsqlite3 --gsqlite3-dnssec --send-root-referral --experimental-dnsupdate=yes --cache-ttl=0 --no-config --gsqlite3-dnssec=on --gsqlite3-database="+SQLITE_DB+" --experimental-json-interface=yes --webserver=yes --webserver-port="+WEBPORT+" --webserver-address=127.0.0.1 --webserver-password="+WEBPASSWORD).split()
+ pdnscmd = ("../pdns/pdns_server --daemon=no --local-port=5300 --socket-dir=./ --module-dir=../regression-tests/modules --no-shuffle --launch=gsqlite3 --gsqlite3-dnssec --send-root-referral --experimental-dnsupdate=yes --cache-ttl=0 --no-config --gsqlite3-dnssec=on --gsqlite3-database="+SQLITE_DB+" --experimental-json-interface=yes --webserver=yes --webserver-port="+WEBPORT+" --webserver-address=127.0.0.1 --webserver-password="+WEBPASSWORD).split()
else:
conf_dir = 'rec-conf.d'
@@ -26,7 +26,7 @@ rm -f pdns*.pid
../pdns/pdns_server --daemon=no --local-port=$port --socket-dir=./ \
--no-shuffle --launch=bind --bind-config=edns-packet-cache/named.conf \
- --send-root-referral --cache-ttl=60 --no-config &
+ --send-root-referral --cache-ttl=60 --no-config --module-dir=../regression-tests/modules &
bindwait
# prime cache without EDNS
@@ -331,6 +331,7 @@ EOF
for dir in $PREFIX.*
do
cat > $dir/pdns.conf <<EOF
+module-dir=../../../regression-tests/modules
launch=bind
daemon=no
local-address=$dir
@@ -1,6 +1,7 @@
case $context in
bind)
cat > pdns-bind.conf << __EOF__
+module-dir=./modules
launch=bind
bind-config=./named.conf
bind-ignore-broken-records=yes
@@ -18,6 +19,7 @@ __EOF__
bind-dnssec | bind-dnssec-nsec3 | bind-hybrid-nsec3 | bind-dnssec-nsec3-optout | bind-dnssec-nsec3-narrow)
rm -f dnssec.sqlite3
cat > pdns-bind.conf << __EOF__
+module-dir=./modules
launch=bind
bind-config=./named.conf
bind-ignore-broken-records=yes
@@ -30,6 +30,7 @@
--no-shuffle --launch=bind --bind-config=./named-slave.conf --slave \
--send-root-referral --retrieval-threads=1 --config-name=bind-slave \
--experimental-dnsupdate=yes \
- --cache-ttl=$cachettl --no-config --experimental-dname-processing --bind-dnssec-db=./dnssec-slave.sqlite3 &
+ --cache-ttl=$cachettl --no-config --experimental-dname-processing --bind-dnssec-db=./dnssec-slave.sqlite3 \
+ --module-dir=./modules &
echo 'waiting for zones to be loaded'
bindwait bind-slave
@@ -53,6 +53,7 @@ EOF
# generate pdns.conf for pdnssec
cat > pdns-geoip.conf <<EOF
+module-dir=./modules
launch=geoip
geoip-zones-file=$testsdir/geo.yaml
EOF
@@ -68,7 +69,7 @@ EOF
--no-shuffle --launch=geoip \
--cache-ttl=$cachettl --experimental-dname-processing --no-config \
--send-root-referral --distributor-threads=1 \
- --geoip-zones-file=$testsdir/geo.yaml \
+ --geoip-zones-file=$testsdir/geo.yaml --module-dir=./modules \
$geoipkeydir &
;;
@@ -17,6 +17,7 @@ case $context in
"$GMYSQLDB"
cat > pdns-gmysql.conf << __EOF__
+module-dir=./modules
launch=gmysql
gmysql-dbname=$GMYSQLDB
gmysql-user=$GMYSQLUSER
@@ -12,6 +12,7 @@
"$GMYSQL2DB" < ../modules/gmysqlbackend/schema.mysql.sql
cat > pdns-gmysql2.conf << __EOF__
+module-dir=./modules
launch=gmysql
gmysql-dbname=$GMYSQL2DB
gmysql-user=$GMYSQL2USER
@@ -10,6 +10,7 @@ case $context in
tosql goracle | sqlplus -S $GORACLEUSER/$GORACLEPASSWD@xe >> goracle.log
cat > pdns-goracle.conf << __EOF__
+module-dir=./modules
launch=goracle
goracle-home=$ORACLE_HOME
goracle-sid=$ORACLE_SID
@@ -6,6 +6,7 @@
echo "START ../modules/goraclebackend/schema.goracle.sql;" | sqlplus -S $GORACLE2USER/$GORACLE2PASSWD@xe >> goracle2.log
cat > pdns-goracle2.conf << __EOF__
+module-dir=./modules
launch=goracle
goracle-home=$ORACLE_HOME
goracle-sid=$ORACLE_SID
@@ -12,6 +12,7 @@ case $context in
tosql gpgsql | psql --user="$GPGSQLUSER" "$GPGSQLDB" 2>&1 | uniq -c
cat > pdns-gpgsql.conf << __EOF__
+module-dir=./modules
launch=gpgsql
gpgsql-dbname=$GPGSQLDB
gpgsql-user=$GPGSQLUSER
@@ -6,7 +6,8 @@
createdb --user="$GPGSQL2USER" "$GPGSQL2DB" || echo ignoring mysqladmin drop failure
psql --user="$GPGSQL2USER" "$GPGSQL2DB" < ../modules/gpgsqlbackend/schema.pgsql.sql
- cat > pdns-gpgsql2.conf << __EOF__
+ cat > pdns-gpgsql2.conf << __EOF__
+module-dir=./modules
launch=gpgsql
gpgsql-dbname=$GPGSQL2DB
gpgsql-user=$GPGSQL2USER
@@ -8,6 +8,7 @@ case $context in
echo ANALYZE\; | sqlite3 pdns.sqlite3
cat > pdns-gsqlite3.conf << __EOF__
+module-dir=./modules
launch=gsqlite3
gsqlite3-database=pdns.sqlite3
__EOF__
@@ -3,6 +3,7 @@
sqlite3 pdns.sqlite32 < ../modules/gsqlite3backend/schema.sqlite3.sql
cat > pdns-gsqlite32.conf << __EOF__
+module-dir=./modules
launch=gsqlite3
gsqlite3-database=pdns.sqlite32
gsqlite3-pragma-synchronous=0
@@ -77,7 +77,7 @@ case $context in
--no-shuffle --launch=lmdb \
--send-root-referral \
--cache-ttl=$cachettl --experimental-dname-processing --no-config \
- --lmdb-datapath=./ --lmdb-experimental-dnssec &
+ --lmdb-datapath=./ --lmdb-experimental-dnssec --module-dir=./modules &
skipreasons="noent nodyndns nometa lmdb"
@@ -15,21 +15,18 @@ case $context in
"$MYDNSDB"
cat > pdns-mydns.conf << __EOF__
+module-dir=./modules
launch=mydns
mydns-dbname=$MYDNSDB
mydns-user=$MYDNSUSER
mydns-host=$MYDNSHOST
mydns-password=$MYDNSPASSWD
__EOF__
- $RUNWRAPPER $PDNS --daemon=no --local-port=$port --socket-dir=./ \
- --no-shuffle --launch=mydns \
- --master --send-root-referral \
- --cache-ttl=0 --experimental-dname-processing --no-config \
- --mydns-rr-active=no --mydns-soa-active=no --mydns-use-minimal-ttl=no \
- --mydns-dbname="$MYDNSDB" \
- --mydns-user="$MYDNSUSER" \
- --mydns-host="$MYDNSHOST" \
- --mydns-password="$MYDNSPASSWD" &
+ $RUNWRAPPER $PDNS --daemon=no --local-port=$port --socket-dir=./ \
+ --config-dir=. --config-name=mydns \
+ --no-shuffle --master --send-root-referral \
+ --cache-ttl=0 --experimental-dname-processing \
+ --mydns-rr-active=no --mydns-soa-active=no --mydns-use-minimal-ttl=no &
skipreasons="nodnssec noent nodyndns nometa noaxfr"
;;
@@ -12,7 +12,7 @@ case $context in
--send-root-referral \
--cache-ttl=$cachettl --experimental-dname-processing --no-config \
--opendbx-backend=sqlite3 --opendbx-host-read=./ --opendbx-host-write=./ \
- --opendbx-database=pdns-opendbx.sqlite3 &
+ --opendbx-database=pdns-opendbx.sqlite3 --module-dir=./modules &
skipreasons="nodnssec noent nodyndns nometa"
;;
@@ -9,6 +9,7 @@ case $context in
../pdns/zone2sql --oracle | grep " 'SOA', " | sqlplus -S $ORACLEUSER/$ORACLEPASSWD@xe >> oracle.log
cat > pdns-oracle.conf << __EOF__
+module-dir=./modules
launch=oracle
oracle-home=$ORACLE_HOME
oracle-sid=$ORACLE_SID
@@ -6,6 +6,7 @@
echo "START ../modules/oraclebackend/schema.oracle.sql;" | sqlplus -S $ORACLE2USER/$ORACLE2PASSWD@xe >> oracle2.log
cat > pdns-oracle2.conf << __EOF__
+module-dir=./modules
launch=oracle
oracle-home=$ORACLE_HOME
oracle-sid=$ORACLE_SID
@@ -80,6 +80,7 @@ case $context in
# generate pdns.conf for pdnssec
cat > pdns-remote.conf <<EOF
+module-dir=./modules
launch=remote
remote-connection-string=$connstr,timeout=10000
EOF
@@ -109,7 +110,7 @@ EOF
--cache-ttl=$cachettl --experimental-dname-processing --no-config \
--send-root-referral --distributor-threads=1 \
--experimental-dnsupdate=yes \
- --remote-connection-string="$connstr" $remote_add_param &
+ --remote-connection-string="$connstr" $remote_add_param --module-dir=./modules &
;;
*)
@@ -5,7 +5,7 @@ case $context in
--cache-ttl=$cachettl --experimental-dname-processing --no-config \
--send-root-referral \
--experimental-dnsupdate=yes \
- --tinydns-dbfile=../modules/tinydnsbackend/data.cdb &
+ --tinydns-dbfile=../modules/tinydnsbackend/data.cdb --module-dir=./modules &
skipreasons="nodnssec noent nodyndns nometa noaxfr"
;;

0 comments on commit 74caf87

Please sign in to comment.