~samiam/MaraDNS

3ab7e275ccd04c2382b3b6684cbc3eefac30c6b1 — Sam Trenholme a month ago 9a0a8af
coLunacyDNS sqa: Coverage is now at 100%  1.0.008 release.
5 files changed, 34 insertions(+), 11 deletions(-)

M deadwood-github/tools/coLunacyDNS/RELEASES
M deadwood-github/tools/coLunacyDNS/coLunacyDNS.c
M deadwood-github/tools/coLunacyDNS/sqa/sqa_gCovNoOpenDNS/do.test
A deadwood-github/tools/coLunacyDNS/sqa/sqa_gCovNoOpenDNS/output.success1
R deadwood-github/tools/coLunacyDNS/sqa/sqa_gCovNoOpenDNS/{output.success => output.success2}
M deadwood-github/tools/coLunacyDNS/RELEASES => deadwood-github/tools/coLunacyDNS/RELEASES +1 -0
@@ 7,3 7,4 @@ Here are the releases of coLunacyDNS.c and their RG32 sums:
1.0.005 b97cccb56f67897686c1bf323c8d1885485147b08851bae86a2a270944678671 
1.0.006 4854382645e3c2fab75f47918ac81f5741d23779b07d93f82a3281183e4f6e0c 
1.0.007 99b0f337c00a7cd98bbdd0b0da07b0176d24ec89a9868e6c797a42beac5a6495 
1.0.008 307c992fe414df47b74779d8aa26c0e7893918145c5cbdd18980dfa9a956cec5 

M deadwood-github/tools/coLunacyDNS/coLunacyDNS.c => deadwood-github/tools/coLunacyDNS/coLunacyDNS.c +2 -2
@@ 2083,7 2083,7 @@ int main(int argc, char **argv) {
	SipHashSetKey(rand32(),rand32());

        if(argc != 2 || *argv[1] == '-') {
                printf("coLunacyDNS version 1.0.00X starting\n\n");
                printf("coLunacyDNS version 1.0.008 starting\n\n");
        }
        set_time(); // Run this frequently to update timestamp
        // Get bindIp and returnIp from Lua script


@@ 2391,7 2391,7 @@ int main(int argc, char **argv) {
                        svc_install_service();
                }
        } else {
                printf("coLunacyDNS version 1.0.00X\n\n");
                printf("coLunacyDNS version 1.0.008\n\n");
                printf(
                    "coLunacyDNS is a DNS server that is a Windows service\n\n"
                    "To install this service:\n\n\tcoLunacyDNS --install\n\n"

M deadwood-github/tools/coLunacyDNS/sqa/sqa_gCovNoOpenDNS/do.test => deadwood-github/tools/coLunacyDNS/sqa/sqa_gCovNoOpenDNS/do.test +19 -9
@@ 39,6 39,11 @@ function processQuery(Q) -- Called for every DNS query received
     gCovNoOpenDNS = 0
     t = coDNS.solve({name=Q.coQuery, type="A", upstreamIp4=u})
     t = coDNS.solve({name=Q.coQuery, type="A", upstreamIp4=u})
   elseif string.sub(Q.coQuery,1,1) == "d" then
     coDNS.log("We should get here")
     foo["bar"] = baz
     t.error = true
     coDNS.log("We should not get here")
   end
   -- Return a "server fail" if we did not get an answer
   if(t.error or t.status ~= 1) then return {co1Type = "serverFail"} end


@@ 47,15 52,16 @@ function processQuery(Q) -- Called for every DNS query received
end
EOF

${PROG} -d test.lua &
${PROG} -d test.lua |egrep '[A-Za-z0-9]' | grep -v version > output.test1 &
${PROG} -d upstream.lua &
sleep 1

rm -f output.test
touch output.test
askmara -t 2 Aa.example.com. 127.7.7.47 >> output.test
askmara -t 2 Ab.example.com. 127.7.7.47 >> output.test
askmara -t 2 Ac.example.com. 127.7.7.47 >> output.test
rm -f output.test2
touch output.test2
askmara -t 2 Aa.example.com. 127.7.7.47 >> output.test2
askmara -t 2 Ab.example.com. 127.7.7.47 >> output.test2
askmara -t 2 Ac.example.com. 127.7.7.47 >> output.test2
askmara -t 2 Ad.example.com. 127.7.7.47 >> output.test2

LIST=$( ps auxw | awk "$PROCGET" | grep "$PROG" | awk '{print $1}' )
for process in $LIST ; do


@@ 63,8 69,12 @@ for process in $LIST ; do
done
sleep 1

if ! cmp output.success output.test > /dev/null 2>&1 ; then
        echo gCovNoOpenDNS test failed
if ! cmp output.success1 output.test1 > /dev/null 2>&1 ; then
        echo gCovNoOpenDNS test failed: Server side
        exit 255
fi
if ! cmp output.success2 output.test2 > /dev/null 2>&1 ; then
        echo gCovNoOpenDNS test failed: Server side
        exit 255
fi



@@ 72,4 82,4 @@ echo gCovNoOpenDNS test Success
# Clean up
rm test.lua
rm upstream.lua
rm output.test
rm output.test1 output.test2

A deadwood-github/tools/coLunacyDNS/sqa/sqa_gCovNoOpenDNS/output.success1 => deadwood-github/tools/coLunacyDNS/sqa/sqa_gCovNoOpenDNS/output.success1 +10 -0
@@ 0,0 1,10 @@
Running coLunacyDNS
read1 error1
bindIp = "127.7.7.46" 
read1 error3
read1 error1
read1 error1
read1 error1
We should get here
Error calling function processQuery
test.lua:30: attempt to index global 'foo' (a nil value)

R deadwood-github/tools/coLunacyDNS/sqa/sqa_gCovNoOpenDNS/output.success => deadwood-github/tools/coLunacyDNS/sqa/sqa_gCovNoOpenDNS/output.success2 +2 -0
@@ 13,3 13,5 @@
c.example.com. +0 a 10.1.1.1
# NS replies:
# AR replies:
# Querying the server with the IP 127.7.7.47
# Hard Error: Timeout