]>
Commit | Line | Data |
---|---|---|
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 | ||
8 | step="step.$1" | |
9 | [ -z "$1" ] && step="start" | |
10 | comment=$2 | |
11 | [ -z "$comment" ] && comment="No comment" | |
12 | diffto="step.$3" | |
13 | [ -z "$3" ] && diffto="start" | |
14 | ||
15 | if [ "${context: -9}" = "-nodnssec" ] | |
16 | then | |
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 |
20 | else |
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 |
24 | fi |
25 | ||
da25a468 PD |
26 | if type gsort >/dev/null 2>/dev/null |
27 | then | |
28 | SORT=gsort | |
29 | else | |
30 | SORT=sort | |
31 | fi | |
32 | ||
ff83f2ff KM |
33 | if [ ! "$step" == "start" ] |
34 | then | |
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" | |
42 | fi |