From: Aki Tuomi Date: Tue, 27 Jun 2017 04:42:32 +0000 (+0300) Subject: Remove Lua Policy Engine tests X-Git-Tag: rec-4.1.0-alpha1~23^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2bcf4db51a1f2993dd50738ba7d3f22fe355b895;p=thirdparty%2Fpdns.git Remove Lua Policy Engine tests --- diff --git a/regression-tests.nobackend/lua-policy/command b/regression-tests.nobackend/lua-policy/command deleted file mode 100755 index 595de06154..0000000000 --- a/regression-tests.nobackend/lua-policy/command +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash -set -e -if [ "${PDNS_DEBUG}" = "YES" ]; then - set -x -fi - -bindwait () -{ - configname=$1 - domcount=1 - loopcount=0 - while [ $loopcount -lt 20 ]; do - sleep 1 - done=$( ($PDNSCONTROL --config-name=$configname --socket-dir=. --no-config bind-domain-status || true) | grep -c 'parsed into memory' || true ) - if [ $done = $domcount ] - then - return - fi - let loopcount=loopcount+1 - done - if [ $done != $domcount ]; then - echo "Domain parsing failed" >> failed_tests - fi -} - -port=5501 -rm -f pdns*.pid - -$PDNS --daemon=no --local-port=$port --socket-dir=./ \ - --no-shuffle --launch=bind --bind-config=lua-policy/named.conf \ - --experimental-lua-policy-script=lua-policy/policy.lua \ - --cache-ttl=60 --no-config --module-dir=../regression-tests/modules & -bindwait - -# plain SOA query -$SDIG 127.0.0.1 5501 minimal.com SOA | LC_ALL=C sort -# expect DROP, so timeout -timeout 3 $SDIG 127.0.0.1 5501 drop.minimal.com SOA || ret=$? -echo timeout/sdig return value: $ret -# expect TRUNCATE -$SDIG 127.0.0.1 5501 truncate.minimal.com SOA - -kill $(cat pdns*.pid) -rm pdns*.pid diff --git a/regression-tests.nobackend/lua-policy/description b/regression-tests.nobackend/lua-policy/description deleted file mode 100644 index 89252d985d..0000000000 --- a/regression-tests.nobackend/lua-policy/description +++ /dev/null @@ -1 +0,0 @@ -Test the Lua policy engine. \ No newline at end of file diff --git a/regression-tests.nobackend/lua-policy/expected_result b/regression-tests.nobackend/lua-policy/expected_result deleted file mode 100644 index 99a1de65ed..0000000000 --- a/regression-tests.nobackend/lua-policy/expected_result +++ /dev/null @@ -1,9 +0,0 @@ -policy.lua loaded -0 minimal.com. IN SOA 120 ns1.example.com. ahu.example.com. 2000081501 28800 7200 604800 86400 -Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0 -Reply to question for qname='minimal.com.', qtype=SOA -dropping! -timeout/sdig return value: 124 -truncating! -Reply to question for qname='truncate.minimal.com.', qtype=SOA -Rcode: 0 (No Error), RD: 0, QR: 1, TC: 1, AA: 1, opcode: 0 diff --git a/regression-tests.nobackend/lua-policy/named.conf b/regression-tests.nobackend/lua-policy/named.conf deleted file mode 100644 index e94fe49cf8..0000000000 --- a/regression-tests.nobackend/lua-policy/named.conf +++ /dev/null @@ -1,14 +0,0 @@ -options { - directory "../regression-tests/zones/"; - recursion no; - listen-on port 5300 { - 127.0.0.1; - }; - version "Meow!Meow!"; - minimal-responses yes; -}; - -zone "minimal.com"{ - type master; - file "./minimal.com"; -}; diff --git a/regression-tests.nobackend/lua-policy/policy.lua b/regression-tests.nobackend/lua-policy/policy.lua deleted file mode 100644 index c9a8a1d14b..0000000000 --- a/regression-tests.nobackend/lua-policy/policy.lua +++ /dev/null @@ -1,10 +0,0 @@ -print("policy.lua loaded") -io.flush() -function police (req, resp, isTcp) - qname, qtype = req:getQuestion() - - if qname == 'drop.minimal.com.' then print 'dropping!' io.flush() return pdns.DROP end - if qname == 'truncate.minimal.com.' then print 'truncating!' io.flush() return pdns.TRUNCATE end - - return pdns.PASS -end