]> git.ipfire.org Git - thirdparty/pdns.git/blame - regression-tests/mysqldiff
dnsdist doc typo fix
[thirdparty/pdns.git] / regression-tests / mysqldiff
CommitLineData
cf4d037d 1#!/usr/bin/env bash
ff83f2ff
KM
2
3[ -z "$GMYSQLDB" ] && GMYSQLDB=pdnstest
4[ -z "$GMYSQLUSER" ] && GMYSQLUSER=root
5[ -z "$GMYSQLHOST" ] && GMYSQLHOST=localhost
6[ -z "$GMYSQLPASSWD" ] && GMYSQLPASSWD=''
7
8step="step.$1"
9[ -z "$1" ] && step="start"
10comment=$2
11[ -z "$comment" ] && comment="No comment"
12diffto="step.$3"
13[ -z "$3" ] && diffto="start"
14
15if [ "${context: -9}" = "-nodnssec" ]
16then
17 mysql --user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" \
18 "$GMYSQLDB" \
ef2f25c0 19 -e "SELECT r.name, r.type, r.prio, r.content, r.ttl FROM domains d JOIN records r ON d.id=r.domain_id WHERE d.name='test.dyndns' AND(r.type != 'SOA' OR r.type IS NULL) ORDER BY r.name, r.type, r.content, r.ttl, r.prio" > ${testsdir}/${testname}/$step
ff83f2ff
KM
20else
21 mysql --user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" \
22 "$GMYSQLDB" \
ef2f25c0 23 -e "SELECT r.name, r.type, r.prio, r.content, r.ttl, CONCAT('''', CONCAT(r.ordername, '''')), r.auth FROM domains d JOIN records r ON d.id=r.domain_id WHERE d.name='test.dyndns' AND(r.type != 'SOA' OR r.type IS NULL) ORDER BY r.name, r.type, r.content, r.ttl, r.prio" > ${testsdir}/${testname}/$step
ff83f2ff
KM
24fi
25
da25a468
PD
26if type gsort >/dev/null 2>/dev/null
27then
28 SORT=gsort
29else
30 SORT=sort
31fi
32
ff83f2ff
KM
33if [ ! "$step" == "start" ]
34then
35 echo -e "$comment\n--- Start: diff $diffto $step ---"
da25a468 36 diff ${testsdir}/${testname}/$diffto ${testsdir}/${testname}/$step | sed '/^[0-9a-z,/-]*$/d' | $SORT -V
ff83f2ff
KM
37 if [ ${PIPESTATUS[0]} -eq 0 ]
38 then
835f98d3 39 echo "no difference"
ff83f2ff
KM
40 fi
41 echo -e "--- End: diff $diffto $step ---\n"
42fi