From e5da48f48ac95fcac60b285039ad9ab58d05262b Mon Sep 17 00:00:00 2001 From: Kees Monshouwer Date: Tue, 3 Sep 2013 17:09:13 +0200 Subject: [PATCH] speedup tests --- .travis.yml | 39 +++++--------- regression-tests/start-test-stop | 87 ++++++++++++++++++++++---------- 2 files changed, 73 insertions(+), 53 deletions(-) diff --git a/.travis.yml b/.travis.yml index dc4e4e69b..93d1bc114 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,33 +18,20 @@ script: - make - cd ../../regression-tests - touch verify-dnssec-zone/skip + - ./start-test-stop 5300 bind-both + - ./start-test-stop 5300 bind-dnssec-both + - ./start-test-stop 5300 bind-dnssec-nsec3-both + - ./start-test-stop 5300 bind-dnssec-nsec3-optout-both + - ./start-test-stop 5300 bind-dnssec-nsec3-narrow + - ./start-test-stop 5300 gmysql-nodnssec-both + - ./start-test-stop 5300 gmysql-both + - ./start-test-stop 5300 gmysql-nsec3-both + - ./start-test-stop 5300 gmysql-nsec3-optout-both - ./start-test-stop 5300 gmysql-nsec3-narrow - - ./start-test-stop 5300 bind - - ./start-test-stop 5300 bind-presigned - - ./start-test-stop 5300 bind-dnssec - - ./start-test-stop 5300 bind-dnssec-presigned - - ./start-test-stop 5300 bind-dnssec-nsec3 - - ./start-test-stop 5300 bind-dnssec-nsec3-presigned - - ./start-test-stop 5300 bind-dnssec-nsec3-optout - - ./start-test-stop 5300 bind-dnssec-nsec3-optout-presigned - - ./start-test-stop 5300 gmysql-nodnssec - - ./start-test-stop 5300 gmysql-nodnssec-presigned - - ./start-test-stop 5300 gmysql - - ./start-test-stop 5300 gmysql-presigned - - ./start-test-stop 5300 gmysql-nsec3 - - ./start-test-stop 5300 gmysql-nsec3-presigned - - ./start-test-stop 5300 gmysql-nsec3-optout - - ./start-test-stop 5300 gmysql-nsec3-optout-presigned - - ./start-test-stop 5300 gmysql-nsec3-narrow - - ./start-test-stop 5300 gsqlite3-nodnssec - - ./start-test-stop 5300 gsqlite3-nodnssec-presigned - - ./start-test-stop 5300 gsqlite3 - - ./start-test-stop 5300 gsqlite3-presigned - - ./start-test-stop 5300 gsqlite3-nsec3 - - ./start-test-stop 5300 gsqlite3-nsec3-presigned - - ./start-test-stop 5300 gsqlite3-nsec3-optout - - ./start-test-stop 5300 gsqlite3-nsec3-optout-presigned - - ./start-test-stop 5300 gsqlite3-nsec3-narrow + - ./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-nsec3-optout-both - ./start-test-stop 5300 mydns - ./start-test-stop 5300 tinydns - ./start-test-stop 5300 remotebackend-pipe diff --git a/regression-tests/start-test-stop b/regression-tests/start-test-stop index 1ab42f3dc..75e776805 100755 --- a/regression-tests/start-test-stop +++ b/regression-tests/start-test-stop @@ -175,7 +175,7 @@ bindwait () loopcount=0 while [ $loopcount -lt 20 ]; do - sleep 10 + sleep 5 done=$( (../pdns/pdns_control --config-name=$configname --socket-dir=. --no-config bind-domain-status || true) | grep -c 'parsed into memory' || true ) if [ $done = $domcount ]; then return @@ -300,6 +300,7 @@ rm -f pdns*.pid rm -f *_tests presigned=no +both=no if [ "${context: -10}" = "-presigned" ] then @@ -308,6 +309,13 @@ then context=${context%-presigned} fi +if [ "${context: -5}" = "-both" ] +then + both=yes + port=$((port-100)) + context=${context%-both} +fi + optout=0 if [ "${context: -13}" = "-nsec3-optout" ] @@ -861,16 +869,9 @@ esac check_process -export port -export context -export extracontexts -export skipreasons -export testsdir -export optout - -if [ $presigned = yes ] -then - skipreasons="$skipreasons presigned nodyndns" +startslave () +{ + skipreasons="$skipreasons presigned nodyndns" if [ ${context:0:6} = gmysql ] || [ ${context:0:7} = ext-nsd ] || [ ${context:0:8} = ext-bind ] then context=${context}-presigned @@ -920,7 +921,7 @@ then loopcount=0 while [ $loopcount -lt 20 ] do - sleep 10 + sleep 5 todo=$(mysql --user="$GMYSQL2USER" --password="$GMYSQL2PASSWD" --host="$GMYSQl2HOST" \ "$GMYSQL2DB" -ss -e 'SELECT COUNT(id) FROM domains WHERE last_check IS NULL') if [ $todo = 0 ] @@ -965,7 +966,7 @@ then loopcount=0 while [ $loopcount -lt 20 ] do - sleep 10 + sleep 5 todo=$(sqlite3 pdns.sqlite31 'SELECT COUNT(id) FROM domains WHERE last_check IS NULL') if [ $todo -eq 0 ] then @@ -1013,27 +1014,59 @@ then echo 'waiting for zones to be loaded' bindwait bind-slave fi -fi +} + +dotests () { + nameserver=127.0.0.1 ./runtests $spectest + ./toxml + ./totar + + if [ -s "./failed_tests" ] + then + for t in `cat failed_tests` + do + echo -e "\n\n$t" + cat $t/diff + done + eval "$1=1" + fi +} ## TODO: give pdns a few seconds to startup or fail, then check if it did not fail ## TODO: give sdig a timeout -nameserver=127.0.0.1 ./runtests $spectest -./toxml -./totar + +RETVAL=0 + +export port +export context +export extracontexts +export skipreasons +export testsdir +export optout + + +if [ $presigned = no ] || [ $both = yes ] +then + dotests $RETVAL +fi + +if [ $presigned = yes ] || [ $both = yes ] +then + startslave + + export port + export context + export skipreasons + + dotests $RETVAL +fi + if [ "$wait" = "wait" ] then echo tests done! push enter to terminate instance read l fi + kill $(cat pdns*.pid) rm pdns*.pid || true - -if [ -s "./failed_tests" ] -then - for t in `cat failed_tests` - do - echo -e "\n\n$t" - cat $t/diff - done - exit 1 -fi +exit $RETVAL -- 2.40.0