SORT=sort
fi
+plusvariant=''
+_context=${context%-variant}
+if [ $context != $_context ]
+then
+ plusvariant='..variant'
+fi
+zone=test.dyndns
+zonewithvariant=$zone$plusvariant
+
case $backend in
gmysql)
if [ "${context: -9}" = "-nodnssec" ]
then
mysql --user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" \
"$GMYSQLDB" \
- -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
+ -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='$zonewithvariant' AND(r.type != 'SOA' OR r.type IS NULL) ORDER BY r.name, r.type, r.content, r.ttl, r.prio" > ${testsdir}/${testname}/$step
else
mysql --user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" \
"$GMYSQLDB" \
- -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
+ -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='$zonewithvariant' AND(r.type != 'SOA' OR r.type IS NULL) ORDER BY r.name, r.type, r.content, r.ttl, r.prio" > ${testsdir}/${testname}/$step
fi
;;
*)
# Maybe we should add a pdnsutil backend-cmd to retrieve these results in
# same format as the mysql query...
$PDNSUTIL --config-dir=. --config-name=$backend \
- list-zone test.dyndns | grep -vwF SOA | \
+ list-zone $zonewithvariant | grep -vwF SOA | \
$SORT > ${testsdir}/${testname}/$step
;;
esac
#!/usr/bin/env bash
+plusvariant=''
+_context=${context%-variant}
+if [ $context != $_context ]
+then
+ plusvariant='..variant'
+fi
+
for zone in test.dyndns sub.test.dyndns
do
+ zonewithvariant=${zone}${plusvariant}
$PDNSUTIL --config-dir=. --config-name=$backend \
- replace-rrset ${zone} @ SOA "ns1.test.dyndns ahu.example.dyndns 2012060701 28800 7200 604800 86400" \
+ replace-rrset ${zonewithvariant} @ SOA "ns1.test.dyndns ahu.example.dyndns 2012060701 28800 7200 604800 86400" \
> /dev/null
done
#!/usr/bin/env bash
+plusvariant=''
+_context=${context%-variant}
+if [ $context != $_context ]
+then
+ plusvariant='..variant'
+fi
+
+zone=test.dyndns
+zonewithvariant=${zone}${plusvariant}
+
NOW=$(date +%s)
# lower SOA so that the test makes sense
$PDNSUTIL --config-dir=. --config-name=$backend \
- replace-rrset test.dyndns @ SOA "ns1.test.dyndns ahu.example.dyndns 10 28800 7200 604800 86400" \
+ replace-rrset ${zonewithvariant} @ SOA "ns1.${zone} ahu.example.dyndns 10 28800 7200 604800 86400" \
> /dev/null
-$PDNSUTIL --config-dir=. --config-name=$backend list-zone test.dyndns | grep SOA
+$PDNSUTIL --config-dir=. --config-name=$backend list-zone ${zonewithvariant} | grep SOA
-$PDNSUTIL --config-dir=. --config-name=$backend set-meta test.dyndns SOA-EDIT INCEPTION-EPOCH
+$PDNSUTIL --config-dir=. --config-name=$backend set-meta ${zonewithvariant} SOA-EDIT INCEPTION-EPOCH
-$PDNSUTIL --config-dir=. --config-name=$backend increase-serial test.dyndns > /dev/null
+$PDNSUTIL --config-dir=. --config-name=$backend increase-serial ${zonewithvariant} > /dev/null
-NEWSERIAL=$($PDNSUTIL --config-dir=. --config-name=$backend list-zone test.dyndns | grep SOA | awk '{print $7}')
+NEWSERIAL=$($PDNSUTIL --config-dir=. --config-name=$backend list-zone ${zonewithvariant} | grep SOA | awk '{print $7}')
NOWPLUSTEN=$((NOW + 10))
fi
# remove meta
-$PDNSUTIL --config-dir=. --config-name=$backend set-meta test.dyndns SOA-EDIT
+$PDNSUTIL --config-dir=. --config-name=$backend set-meta ${zonewithvariant} SOA-EDIT
# restore old SOA
$PDNSUTIL --config-dir=. --config-name=$backend \
- replace-rrset test.dyndns @ SOA "ns1.test.dyndns ahu.example.dyndns 2012060701 28800 7200 604800 86400" \
+ replace-rrset ${zonewithvariant} @ SOA "ns1.${zone} ahu.example.dyndns 2012060701 28800 7200 604800 86400" \
> /dev/null
#!/bin/sh
+plusvariant=''
+_context=${context%-variant}
+if [ $context != $_context ]
+then
+ plusvariant='..variant'
+fi
+
+zone=test.dyndns
+zonewithvariant=${zone}${plusvariant}
+
mysqldiff
-$PDNSUTIL --config-dir=. --config-name=$backend increase-serial test.dyndns
+$PDNSUTIL --config-dir=. --config-name=$backend increase-serial ${zonewithvariant}
-mysqldiff 1 "Check that test.dyndns. still has a valid ordername"
+mysqldiff 1 "Check that ${zonewithvariant}. still has a valid ordername"
# restore old SOA
$PDNSUTIL --config-dir=. --config-name=$backend \
- replace-rrset test.dyndns @ SOA "ns1.test.dyndns ahu.example.dyndns 2012060701 28800 7200 604800 86400" \
+ replace-rrset ${zonewithvariant} @ SOA "ns1.${zone} ahu.example.dyndns 2012060701 28800 7200 604800 86400" \
> /dev/null