summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Spacek <pspacek@redhat.com>2014-01-30 13:04:29 +0100
committerPetr Viktorin <pviktori@redhat.com>2014-01-30 13:37:38 +0100
commit558be8e102af5aa1fe208b26de17670138f85341 (patch)
tree1820acab4e353b1cee1c52def2d83ff1bf116cd2
parent3aa9a8b9be8c30ce3da2d8e13813eac816d6f141 (diff)
downloadfreeipa-558be8e102af5aa1fe208b26de17670138f85341.zip
freeipa-558be8e102af5aa1fe208b26de17670138f85341.tar.gz
freeipa-558be8e102af5aa1fe208b26de17670138f85341.tar.xz
Rename variables in test xmlrpc/dns_plugin
https://fedorahosted.org/freeipa/ticket/4139
-rw-r--r--ipatests/test_xmlrpc/test_dns_plugin.py965
1 files changed, 486 insertions, 479 deletions
diff --git a/ipatests/test_xmlrpc/test_dns_plugin.py b/ipatests/test_xmlrpc/test_dns_plugin.py
index 475cc85..14f8e66 100644
--- a/ipatests/test_xmlrpc/test_dns_plugin.py
+++ b/ipatests/test_xmlrpc/test_dns_plugin.py
@@ -26,48 +26,55 @@ from ipapython.dn import DN
from ipatests.test_xmlrpc import objectclasses
from xmlrpc_test import Declarative, fuzzy_digits, fuzzy_uuid
-dnszone1 = u'dnszone.test'
-dnszone1_ip = u'172.16.29.111'
-dnszone1_dn = DN(('idnsname',dnszone1), api.env.container_dns, api.env.basedn)
-dnszone1_mname = u'ns1.%s.' % dnszone1
-dnszone1_mname_dn = DN(('idnsname','ns1'), dnszone1_dn)
-dnszone1_rname = u'root.%s.' % dnszone1
-dnszone1_permission = u'Manage DNS zone %s' % dnszone1
-dnszone1_permission_dn = DN(('cn',dnszone1_permission),
+zone1 = u'dnszone.test'
+zone1_ip = u'172.16.29.111'
+zone1_dn = DN(('idnsname',zone1), api.env.container_dns, api.env.basedn)
+zone1_ns = u'ns1.%s.' % zone1
+zone1_ns_dn = DN(('idnsname','ns1'), zone1_dn)
+zone1_rname = u'root.%s.' % zone1
+zone1_permission = u'Manage DNS zone %s' % zone1
+zone1_permission_dn = DN(('cn',zone1_permission),
api.env.container_permission,api.env.basedn)
-dnszone1_txtrec_dn = DN(('idnsname', '_kerberos'), dnszone1_dn)
-dnszone2 = u'dnszone2.test'
-dnszone2_dn = DN(('idnsname', dnszone2), api.env.container_dns, api.env.basedn)
-dnszone2_mname = u'ns1.%s.' % dnszone2
-dnszone2_rname = u'root.%s.' % dnszone2
-revdnszone1 = u'31.16.172.in-addr.arpa.'
-revdnszone1_ip = u'172.16.31.0'
-revdnszone1_ipprefix = u'172.16.31.'
-revdnszone1_dn = DN(('idnsname', revdnszone1), api.env.container_dns, api.env.basedn)
-revdnszone2 = u'30.15.172.in-addr.arpa.'
-revdnszone2_ip = u'172.15.30.0/24'
-revdnszone2_dn = DN(('idnsname',revdnszone2), api.env.container_dns, api.env.basedn)
-
-dnsres1 = u'testdnsres'
-dnsres1_dn = DN(('idnsname',dnsres1), dnszone1_dn)
-dnsres1_renamed = u'testdnsres-renamed'
-dnsrev1 = u'80'
-dnsrev1_ip = revdnszone1_ipprefix + dnsrev1
-dnsrev1_dn = DN(('idnsname',dnsrev1), revdnszone1_dn)
-dnsrev2 = u'81'
-dnsrev2_ip = revdnszone1_ipprefix + dnsrev2
-dnsrev2_dn = DN(('idnsname',dnsrev2), revdnszone1_dn)
-
-dnsresarec1 = u'172.16.29.111'
-dnsresarec2 = u'172.31.254.222'
-dnsresarec3 = u'172.16.250.123'
-dnsrescname = u'testcnamerec'
-dnsrescname_dn = DN(('idnsname',dnsrescname), dnszone1_dn)
-dnsresdname = u'testdns-dname'
-dnsresdname_dn = DN(('idnsname',dnsresdname), dnszone1_dn)
-
-dnsfwd_ip = u'172.16.31.80'
-allowtransfer_tofwd = u'%s;' % dnsfwd_ip
+zone1_txtrec_dn = DN(('idnsname', '_kerberos'), zone1_dn)
+
+zone2 = u'zone2.test'
+zone2_dn = DN(('idnsname', zone2), api.env.container_dns, api.env.basedn)
+zone2_ns = u'ns1.%s.' % zone2
+zone2_rname = u'root.%s.' % zone2
+
+revzone1 = u'31.16.172.in-addr.arpa.'
+revzone1_ip = u'172.16.31.0'
+revzone1_ipprefix = u'172.16.31.'
+revzone1_dn = DN(('idnsname', revzone1), api.env.container_dns, api.env.basedn)
+
+revzone2 = u'30.15.172.in-addr.arpa.'
+revzone2_ip = u'172.15.30.0/24'
+revzone2_dn = DN(('idnsname',revzone2), api.env.container_dns, api.env.basedn)
+
+name1 = u'testdnsres'
+name1_dn = DN(('idnsname',name1), zone1_dn)
+name1_renamed = u'testdnsres-renamed'
+
+revname1 = u'80'
+revname1_ip = revzone1_ipprefix + revname1
+revname1_dn = DN(('idnsname',revname1), revzone1_dn)
+
+revname2 = u'81'
+revname2_ip = revzone1_ipprefix + revname2
+revname2_dn = DN(('idnsname',revname2), revzone1_dn)
+
+cname = u'testcnamerec'
+cname_dn = DN(('idnsname',cname), zone1_dn)
+
+dname = u'testdns-dname'
+dname_dn = DN(('idnsname',dname), zone1_dn)
+
+arec1 = u'172.16.29.111'
+arec2 = u'172.31.254.222'
+arec3 = u'172.16.250.123'
+
+fwd_ip = u'172.16.31.80'
+allowtransfer_tofwd = u'%s;' % fwd_ip
allowquery_restricted_in = u'!192.0.2/24;any;'
allowquery_restricted_out = u'!192.0.2.0/24;any;'
@@ -81,50 +88,50 @@ class test_dns(Declarative):
if not api.Backend.rpcclient.isconnected():
api.Backend.rpcclient.connect(fallback=False)
try:
- api.Command['dnszone_add'](dnszone1,
- idnssoamname = dnszone1_mname,
- idnssoarname = dnszone1_rname,
+ api.Command['dnszone_add'](zone1,
+ idnssoamname = zone1_ns,
+ idnssoarname = zone1_rname,
force = True,
)
- api.Command['dnszone_del'](dnszone1)
+ api.Command['dnszone_del'](zone1)
except errors.NotFound:
raise nose.SkipTest('DNS is not configured')
except errors.DuplicateEntry:
pass
cleanup_commands = [
- ('dnszone_del', [dnszone1, dnszone2, revdnszone1, revdnszone2],
+ ('dnszone_del', [zone1, zone2, revzone1, revzone2],
{'continue': True}),
('dnsconfig_mod', [], {'idnsforwarders' : None,
'idnsforwardpolicy' : None,
'idnsallowsyncptr' : None,
}),
- ('permission_del', [dnszone1_permission], {'force': True}),
+ ('permission_del', [zone1_permission], {'force': True}),
]
tests = [
dict(
- desc='Try to retrieve non-existent zone %r' % dnszone1,
- command=('dnszone_show', [dnszone1], {}),
+ desc='Try to retrieve non-existent zone %r' % zone1,
+ command=('dnszone_show', [zone1], {}),
expected=errors.NotFound(
- reason=u'%s: DNS zone not found' % dnszone1),
+ reason=u'%s: DNS zone not found' % zone1),
),
dict(
- desc='Try to update non-existent zone %r' % dnszone1,
- command=('dnszone_mod', [dnszone1], {'idnssoaminimum': 3500}),
+ desc='Try to update non-existent zone %r' % zone1,
+ command=('dnszone_mod', [zone1], {'idnssoaminimum': 3500}),
expected=errors.NotFound(
- reason=u'%s: DNS zone not found' % dnszone1),
+ reason=u'%s: DNS zone not found' % zone1),
),
dict(
- desc='Try to delete non-existent zone %r' % dnszone1,
- command=('dnszone_del', [dnszone1], {}),
+ desc='Try to delete non-existent zone %r' % zone1,
+ command=('dnszone_del', [zone1], {}),
expected=errors.NotFound(
- reason=u'%s: DNS zone not found' % dnszone1),
+ reason=u'%s: DNS zone not found' % zone1),
),
@@ -132,9 +139,9 @@ class test_dns(Declarative):
desc='Try to create zone with invalid name',
command=(
'dnszone_add', [u'invalid zone'], {
- 'idnssoamname': dnszone1_mname,
- 'idnssoarname': dnszone1_rname,
- 'ip_address' : dnszone1_ip,
+ 'idnssoamname': zone1_ns,
+ 'idnssoarname': zone1_rname,
+ 'ip_address' : zone1_ip,
}
),
expected=errors.ValidationError(name='name',
@@ -144,24 +151,24 @@ class test_dns(Declarative):
dict(
- desc='Create zone %r' % dnszone1,
+ desc='Create zone %r' % zone1,
command=(
- 'dnszone_add', [dnszone1], {
- 'idnssoamname': dnszone1_mname,
- 'idnssoarname': dnszone1_rname,
- 'ip_address' : dnszone1_ip,
+ 'dnszone_add', [zone1], {
+ 'idnssoamname': zone1_ns,
+ 'idnssoarname': zone1_rname,
+ 'ip_address' : zone1_ip,
}
),
expected={
- 'value': dnszone1,
+ 'value': zone1,
'summary': None,
'result': {
- 'dn': dnszone1_dn,
- 'idnsname': [dnszone1],
+ 'dn': zone1_dn,
+ 'idnsname': [zone1],
'idnszoneactive': [u'TRUE'],
- 'idnssoamname': [dnszone1_mname],
- 'nsrecord': [dnszone1_mname],
- 'idnssoarname': [dnszone1_rname],
+ 'idnssoamname': [zone1_ns],
+ 'nsrecord': [zone1_ns],
+ 'idnssoarname': [zone1_rname],
'idnssoaserial': [fuzzy_digits],
'idnssoarefresh': [fuzzy_digits],
'idnssoaretry': [fuzzy_digits],
@@ -181,48 +188,48 @@ class test_dns(Declarative):
dict(
- desc='Try to create duplicate zone %r' % dnszone1,
+ desc='Try to create duplicate zone %r' % zone1,
command=(
- 'dnszone_add', [dnszone1], {
- 'idnssoamname': dnszone1_mname,
- 'idnssoarname': dnszone1_rname,
- 'ip_address' : dnszone1_ip,
+ 'dnszone_add', [zone1], {
+ 'idnssoamname': zone1_ns,
+ 'idnssoarname': zone1_rname,
+ 'ip_address' : zone1_ip,
}
),
expected=errors.DuplicateEntry(
- message=u'DNS zone with name "%s" already exists' % dnszone1),
+ message=u'DNS zone with name "%s" already exists' % zone1),
),
dict(
desc='Try to create a zone with nonexistent NS entry',
command=(
- 'dnszone_add', [dnszone2], {
- 'idnssoamname': dnszone2_mname,
- 'idnssoarname': dnszone2_rname,
+ 'dnszone_add', [zone2], {
+ 'idnssoamname': zone2_ns,
+ 'idnssoarname': zone2_rname,
}
),
- expected=errors.NotFound(reason='Nameserver \'%s\' does not have a corresponding A/AAAA record' % (dnszone2_mname)),
+ expected=errors.NotFound(reason='Nameserver \'%s\' does not have a corresponding A/AAAA record' % (zone2_ns)),
),
dict(
desc='Create a zone with nonexistent NS entry with --force',
command=(
- 'dnszone_add', [dnszone2], {
- 'idnssoamname': dnszone2_mname,
- 'idnssoarname': dnszone2_rname,
+ 'dnszone_add', [zone2], {
+ 'idnssoamname': zone2_ns,
+ 'idnssoarname': zone2_rname,
'force' : True,
}
),
expected={
- 'value': dnszone2,
+ 'value': zone2,
'summary': None,
'result': {
- 'dn': dnszone2_dn,
- 'idnsname': [dnszone2],
+ 'dn': zone2_dn,
+ 'idnsname': [zone2],
'idnszoneactive': [u'TRUE'],
- 'idnssoamname': [dnszone2_mname],
- 'nsrecord': [dnszone2_mname],
- 'idnssoarname': [dnszone2_rname],
+ 'idnssoamname': [zone2_ns],
+ 'nsrecord': [zone2_ns],
+ 'idnssoarname': [zone2_rname],
'idnssoaserial': [fuzzy_digits],
'idnssoarefresh': [fuzzy_digits],
'idnssoaretry': [fuzzy_digits],
@@ -242,18 +249,18 @@ class test_dns(Declarative):
dict(
- desc='Retrieve zone %r' % dnszone1,
- command=('dnszone_show', [dnszone1], {}),
+ desc='Retrieve zone %r' % zone1,
+ command=('dnszone_show', [zone1], {}),
expected={
- 'value': dnszone1,
+ 'value': zone1,
'summary': None,
'result': {
- 'dn': dnszone1_dn,
- 'idnsname': [dnszone1],
+ 'dn': zone1_dn,
+ 'idnsname': [zone1],
'idnszoneactive': [u'TRUE'],
- 'nsrecord': [dnszone1_mname],
- 'idnssoamname': [dnszone1_mname],
- 'idnssoarname': [dnszone1_rname],
+ 'nsrecord': [zone1_ns],
+ 'idnssoamname': [zone1_ns],
+ 'idnssoarname': [zone1_rname],
'idnssoaserial': [fuzzy_digits],
'idnssoarefresh': [fuzzy_digits],
'idnssoaretry': [fuzzy_digits],
@@ -267,17 +274,17 @@ class test_dns(Declarative):
dict(
- desc='Update zone %r' % dnszone1,
- command=('dnszone_mod', [dnszone1], {'idnssoarefresh': 5478}),
+ desc='Update zone %r' % zone1,
+ command=('dnszone_mod', [zone1], {'idnssoarefresh': 5478}),
expected={
- 'value': dnszone1,
+ 'value': zone1,
'summary': None,
'result': {
- 'idnsname': [dnszone1],
+ 'idnsname': [zone1],
'idnszoneactive': [u'TRUE'],
- 'nsrecord': [dnszone1_mname],
- 'idnssoamname': [dnszone1_mname],
- 'idnssoarname': [dnszone1_rname],
+ 'nsrecord': [zone1_ns],
+ 'idnssoamname': [zone1_ns],
+ 'idnssoarname': [zone1_rname],
'idnssoaserial': [fuzzy_digits],
'idnssoarefresh': [u'5478'],
'idnssoaretry': [fuzzy_digits],
@@ -291,11 +298,11 @@ class test_dns(Declarative):
dict(
- desc='Try to create reverse zone %r with NS record in it' % revdnszone1,
+ desc='Try to create reverse zone %r with NS record in it' % revzone1,
command=(
- 'dnszone_add', [revdnszone1], {
+ 'dnszone_add', [revzone1], {
'idnssoamname': u'ns',
- 'idnssoarname': dnszone1_rname,
+ 'idnssoarname': zone1_rname,
}
),
expected=errors.ValidationError(name='name-server',
@@ -304,23 +311,23 @@ class test_dns(Declarative):
dict(
- desc='Create reverse zone %r' % revdnszone1,
+ desc='Create reverse zone %r' % revzone1,
command=(
- 'dnszone_add', [revdnszone1], {
- 'idnssoamname': dnszone1_mname,
- 'idnssoarname': dnszone1_rname,
+ 'dnszone_add', [revzone1], {
+ 'idnssoamname': zone1_ns,
+ 'idnssoarname': zone1_rname,
}
),
expected={
- 'value': revdnszone1,
+ 'value': revzone1,
'summary': None,
'result': {
- 'dn': revdnszone1_dn,
- 'idnsname': [revdnszone1],
+ 'dn': revzone1_dn,
+ 'idnsname': [revzone1],
'idnszoneactive': [u'TRUE'],
- 'idnssoamname': [dnszone1_mname],
- 'nsrecord': [dnszone1_mname],
- 'idnssoarname': [dnszone1_rname],
+ 'idnssoamname': [zone1_ns],
+ 'nsrecord': [zone1_ns],
+ 'idnssoarname': [zone1_rname],
'idnssoaserial': [fuzzy_digits],
'idnssoarefresh': [fuzzy_digits],
'idnssoaretry': [fuzzy_digits],
@@ -328,7 +335,7 @@ class test_dns(Declarative):
'idnssoaminimum': [fuzzy_digits],
'idnsallowdynupdate': [u'FALSE'],
'idnsupdatepolicy': [u'grant %(realm)s krb5-subdomain %(zone)s PTR;'
- % dict(realm=api.env.realm, zone=revdnszone1)],
+ % dict(realm=api.env.realm, zone=revzone1)],
'idnsallowtransfer': [u'none;'],
'idnsallowquery': [u'any;'],
'objectclass': objectclasses.dnszone,
@@ -338,19 +345,19 @@ class test_dns(Declarative):
dict(
- desc='Search for zones with name server %r' % (dnszone1_mname),
- command=('dnszone_find', [], {'idnssoamname': dnszone1_mname}),
+ desc='Search for zones with name server %r' % (zone1_ns),
+ command=('dnszone_find', [], {'idnssoamname': zone1_ns}),
expected={
'summary': None,
'count': 2,
'truncated': False,
'result': [{
- 'dn': revdnszone1_dn,
- 'idnsname': [revdnszone1],
+ 'dn': revzone1_dn,
+ 'idnsname': [revzone1],
'idnszoneactive': [u'TRUE'],
- 'nsrecord': [dnszone1_mname],
- 'idnssoamname': [dnszone1_mname],
- 'idnssoarname': [dnszone1_rname],
+ 'nsrecord': [zone1_ns],
+ 'idnssoamname': [zone1_ns],
+ 'idnssoarname': [zone1_rname],
'idnssoaserial': [fuzzy_digits],
'idnssoarefresh': [fuzzy_digits],
'idnssoaretry': [fuzzy_digits],
@@ -360,12 +367,12 @@ class test_dns(Declarative):
'idnsallowquery': [u'any;'],
},
{
- 'dn': dnszone1_dn,
- 'idnsname': [dnszone1],
+ 'dn': zone1_dn,
+ 'idnsname': [zone1],
'idnszoneactive': [u'TRUE'],
- 'nsrecord': [dnszone1_mname],
- 'idnssoamname': [dnszone1_mname],
- 'idnssoarname': [dnszone1_rname],
+ 'nsrecord': [zone1_ns],
+ 'idnssoamname': [zone1_ns],
+ 'idnssoarname': [zone1_rname],
'idnssoaserial': [fuzzy_digits],
'idnssoarefresh': [u'5478'],
'idnssoaretry': [fuzzy_digits],
@@ -379,19 +386,19 @@ class test_dns(Declarative):
dict(
- desc='Search for zones with name server %r with --forward-only' % dnszone1_mname,
- command=('dnszone_find', [], {'idnssoamname': dnszone1_mname, 'forward_only' : True}),
+ desc='Search for zones with name server %r with --forward-only' % zone1_ns,
+ command=('dnszone_find', [], {'idnssoamname': zone1_ns, 'forward_only' : True}),
expected={
'summary': None,
'count': 1,
'truncated': False,
'result': [{
- 'dn': dnszone1_dn,
- 'idnsname': [dnszone1],
+ 'dn': zone1_dn,
+ 'idnsname': [zone1],
'idnszoneactive': [u'TRUE'],
- 'nsrecord': [dnszone1_mname],
- 'idnssoamname': [dnszone1_mname],
- 'idnssoarname': [dnszone1_rname],
+ 'nsrecord': [zone1_ns],
+ 'idnssoamname': [zone1_ns],
+ 'idnssoarname': [zone1_rname],
'idnssoaserial': [fuzzy_digits],
'idnssoarefresh': [u'5478'],
'idnssoaretry': [fuzzy_digits],
@@ -405,40 +412,40 @@ class test_dns(Declarative):
dict(
- desc='Delete reverse zone %r' % revdnszone1,
- command=('dnszone_del', [revdnszone1], {}),
+ desc='Delete reverse zone %r' % revzone1,
+ command=('dnszone_del', [revzone1], {}),
expected={
- 'value': revdnszone1,
- 'summary': u'Deleted DNS zone "%s"' % revdnszone1,
+ 'value': revzone1,
+ 'summary': u'Deleted DNS zone "%s"' % revzone1,
'result': {'failed': u''},
},
),
dict(
- desc='Disable zone %r' % dnszone1,
- command=('dnszone_disable', [dnszone1], {}),
+ desc='Disable zone %r' % zone1,
+ command=('dnszone_disable', [zone1], {}),
expected={
- 'value': dnszone1,
- 'summary': u'Disabled DNS zone "%s"' % dnszone1,
+ 'value': zone1,
+ 'summary': u'Disabled DNS zone "%s"' % zone1,
'result': True,
},
),
dict(
- desc='Check if zone %r is really disabled' % dnszone1,
- command=('dnszone_show', [dnszone1], {}),
+ desc='Check if zone %r is really disabled' % zone1,
+ command=('dnszone_show', [zone1], {}),
expected={
- 'value': dnszone1,
+ 'value': zone1,
'summary': None,
'result': {
- 'dn': dnszone1_dn,
- 'idnsname': [dnszone1],
+ 'dn': zone1_dn,
+ 'idnsname': [zone1],
'idnszoneactive': [u'FALSE'],
- 'nsrecord': [dnszone1_mname],
- 'idnssoamname': [dnszone1_mname],
- 'idnssoarname': [dnszone1_rname],
+ 'nsrecord': [zone1_ns],
+ 'idnssoamname': [zone1_ns],
+ 'idnssoarname': [zone1_rname],
'idnssoaserial': [fuzzy_digits],
'idnssoarefresh': [fuzzy_digits],
'idnssoaretry': [fuzzy_digits],
@@ -452,29 +459,29 @@ class test_dns(Declarative):
dict(
- desc='Enable zone %r' % dnszone1,
- command=('dnszone_enable', [dnszone1], {}),
+ desc='Enable zone %r' % zone1,
+ command=('dnszone_enable', [zone1], {}),
expected={
- 'value': dnszone1,
- 'summary': u'Enabled DNS zone "%s"' % dnszone1,
+ 'value': zone1,
+ 'summary': u'Enabled DNS zone "%s"' % zone1,
'result': True,
},
),
dict(
- desc='Check if zone %r is really enabled' % dnszone1,
- command=('dnszone_show', [dnszone1], {}),
+ desc='Check if zone %r is really enabled' % zone1,
+ command=('dnszone_show', [zone1], {}),
expected={
- 'value': dnszone1,
+ 'value': zone1,
'summary': None,
'result': {
- 'dn': dnszone1_dn,
- 'idnsname': [dnszone1],
+ 'dn': zone1_dn,
+ 'idnsname': [zone1],
'idnszoneactive': [u'TRUE'],
- 'nsrecord': [dnszone1_mname],
- 'idnssoamname': [dnszone1_mname],
- 'idnssoarname': [dnszone1_rname],
+ 'nsrecord': [zone1_ns],
+ 'idnssoamname': [zone1_ns],
+ 'idnssoarname': [zone1_rname],
'idnssoaserial': [fuzzy_digits],
'idnssoarefresh': [fuzzy_digits],
'idnssoaretry': [fuzzy_digits],
@@ -488,32 +495,32 @@ class test_dns(Declarative):
dict(
- desc='Try to retrieve non-existent record %r in zone %r' % (dnsres1, dnszone1),
- command=('dnsrecord_show', [dnszone1, dnsres1], {}),
+ desc='Try to retrieve non-existent record %r in zone %r' % (name1, zone1),
+ command=('dnsrecord_show', [zone1, name1], {}),
expected=errors.NotFound(
- reason=u'%s: DNS resource record not found' % dnsres1),
+ reason=u'%s: DNS resource record not found' % name1),
),
dict(
- desc='Try to delete non-existent record %r in zone %r' % (dnsres1, dnszone1),
- command=('dnsrecord_del', [dnszone1, dnsres1], {'del_all' : True}),
+ desc='Try to delete non-existent record %r in zone %r' % (name1, zone1),
+ command=('dnsrecord_del', [zone1, name1], {'del_all' : True}),
expected=errors.NotFound(
- reason=u'%s: DNS resource record not found' % dnsres1),
+ reason=u'%s: DNS resource record not found' % name1),
),
dict(
- desc='Try to delete root zone record \'@\' in %r' % (dnszone1),
- command=('dnsrecord_del', [dnszone1, u'@'], {'del_all' : True}),
+ desc='Try to delete root zone record \'@\' in %r' % (zone1),
+ command=('dnsrecord_del', [zone1, u'@'], {'del_all' : True}),
expected=errors.ValidationError(name='del_all',
error=u"Zone record '@' cannot be deleted"),
),
dict(
- desc='Try to create record with invalid name in zone %r' % dnszone1,
- command=('dnsrecord_add', [dnszone1, u'invalid record'], {'arecord': dnsresarec2}),
+ desc='Try to create record with invalid name in zone %r' % zone1,
+ command=('dnsrecord_add', [zone1, u'invalid record'], {'arecord': arec2}),
expected=errors.ValidationError(name='name',
error=u'only letters, numbers, _, and - are allowed. ' +
u'DNS label may not start or end with -'),
@@ -521,48 +528,48 @@ class test_dns(Declarative):
dict(
- desc='Create record %r in zone %r' % (dnszone1, dnsres1),
- command=('dnsrecord_add', [dnszone1, dnsres1], {'arecord': dnsresarec2}),
+ desc='Create record %r in zone %r' % (zone1, name1),
+ command=('dnsrecord_add', [zone1, name1], {'arecord': arec2}),
expected={
- 'value': dnsres1,
+ 'value': name1,
'summary': None,
'result': {
- 'dn': dnsres1_dn,
- 'idnsname': [dnsres1],
+ 'dn': name1_dn,
+ 'idnsname': [name1],
'objectclass': objectclasses.dnsrecord,
- 'arecord': [dnsresarec2],
+ 'arecord': [arec2],
},
},
),
dict(
- desc='Search for all records in zone %r' % dnszone1,
- command=('dnsrecord_find', [dnszone1], {}),
+ desc='Search for all records in zone %r' % zone1,
+ command=('dnsrecord_find', [zone1], {}),
expected={
'summary': None,
'count': 4,
'truncated': False,
'result': [
{
- 'dn': dnszone1_dn,
- 'nsrecord': (dnszone1_mname,),
+ 'dn': zone1_dn,
+ 'nsrecord': (zone1_ns,),
'idnsname': [u'@'],
},
{
- 'dn': dnszone1_txtrec_dn,
+ 'dn': zone1_txtrec_dn,
'txtrecord': [api.env.realm],
'idnsname': [u'_kerberos'],
},
{
- 'dn': dnszone1_mname_dn,
+ 'dn': zone1_ns_dn,
'idnsname': [u'ns1'],
- 'arecord': [dnszone1_ip],
+ 'arecord': [zone1_ip],
},
{
- 'dn': dnsres1_dn,
- 'idnsname': [dnsres1],
- 'arecord': [dnsresarec2],
+ 'dn': name1_dn,
+ 'idnsname': [name1],
+ 'arecord': [arec2],
},
],
},
@@ -570,15 +577,15 @@ class test_dns(Declarative):
dict(
- desc='Add A record to %r in zone %r' % (dnsres1, dnszone1),
- command=('dnsrecord_add', [dnszone1, dnsres1], {'arecord': dnsresarec3}),
+ desc='Add A record to %r in zone %r' % (name1, zone1),
+ command=('dnsrecord_add', [zone1, name1], {'arecord': arec3}),
expected={
- 'value': dnsres1,
+ 'value': name1,
'summary': None,
'result': {
- 'dn': dnsres1_dn,
- 'idnsname': [dnsres1],
- 'arecord': [dnsresarec2, dnsresarec3],
+ 'dn': name1_dn,
+ 'idnsname': [name1],
+ 'arecord': [arec2, arec3],
'objectclass': objectclasses.dnsrecord,
},
},
@@ -586,28 +593,28 @@ class test_dns(Declarative):
dict(
- desc='Remove A record from %r in zone %r' % (dnsres1, dnszone1),
- command=('dnsrecord_del', [dnszone1, dnsres1], {'arecord': dnsresarec2}),
+ desc='Remove A record from %r in zone %r' % (name1, zone1),
+ command=('dnsrecord_del', [zone1, name1], {'arecord': arec2}),
expected={
- 'value': dnsres1,
+ 'value': name1,
'summary': None,
'result': {
- 'idnsname': [dnsres1],
- 'arecord': [dnsresarec3],
+ 'idnsname': [name1],
+ 'arecord': [arec3],
},
},
),
dict(
- desc='Add AAAA record to %r in zone %r using dnsrecord_mod' % (dnsres1, dnszone1),
- command=('dnsrecord_mod', [dnszone1, dnsres1], {'aaaarecord': u'::1'}),
+ desc='Add AAAA record to %r in zone %r using dnsrecord_mod' % (name1, zone1),
+ command=('dnsrecord_mod', [zone1, name1], {'aaaarecord': u'::1'}),
expected={
- 'value': dnsres1,
+ 'value': name1,
'summary': None,
'result': {
- 'idnsname': [dnsres1],
- 'arecord': [dnsresarec3],
+ 'idnsname': [name1],
+ 'arecord': [arec3],
'aaaarecord': [u'::1'],
},
},
@@ -615,9 +622,9 @@ class test_dns(Declarative):
dict(
- desc='Try to modify nonexistent record in zone %r' % dnszone1,
+ desc='Try to modify nonexistent record in zone %r' % zone1,
command=('dnsrecord_mod',
- [dnszone1, u'ghostname'],
+ [zone1, u'ghostname'],
{'aaaarecord': u'f001:baad::1'}),
expected=errors.NotFound(
reason=u'ghostname: DNS resource record not found'),
@@ -625,14 +632,14 @@ class test_dns(Declarative):
dict(
- desc='Modify AAAA record in %r in zone %r' % (dnsres1, dnszone1),
- command=('dnsrecord_mod', [dnszone1, dnsres1], {'aaaarecord': u'ff02::1'}),
+ desc='Modify AAAA record in %r in zone %r' % (name1, zone1),
+ command=('dnsrecord_mod', [zone1, name1], {'aaaarecord': u'ff02::1'}),
expected={
- 'value': dnsres1,
+ 'value': name1,
'summary': None,
'result': {
- 'idnsname': [dnsres1],
- 'arecord': [dnsresarec3],
+ 'idnsname': [name1],
+ 'arecord': [arec3],
'aaaarecord': [u'ff02::1'],
},
},
@@ -640,53 +647,53 @@ class test_dns(Declarative):
dict(
- desc='Remove AAAA record from %r in zone %r using dnsrecord_mod' % (dnsres1, dnszone1),
- command=('dnsrecord_mod', [dnszone1, dnsres1], {'aaaarecord': u''}),
+ desc='Remove AAAA record from %r in zone %r using dnsrecord_mod' % (name1, zone1),
+ command=('dnsrecord_mod', [zone1, name1], {'aaaarecord': u''}),
expected={
- 'value': dnsres1,
+ 'value': name1,
'summary': None,
'result': {
- 'idnsname': [dnsres1],
- 'arecord': [dnsresarec3],
+ 'idnsname': [name1],
+ 'arecord': [arec3],
},
},
),
dict(
- desc='Try to add invalid MX record to zone %r using dnsrecord_add' % (dnszone1),
- command=('dnsrecord_add', [dnszone1, u'@'], {'mxrecord': dnszone1_mname }),
+ desc='Try to add invalid MX record to zone %r using dnsrecord_add' % (zone1),
+ command=('dnsrecord_add', [zone1, u'@'], {'mxrecord': zone1_ns }),
expected=errors.ValidationError(name='mx_rec',
error=u'format must be specified as "PREFERENCE EXCHANGER" ' +
u' (see RFC 1035 for details)'),
),
dict(
- desc='Add MX record to zone %r using dnsrecord_add' % (dnszone1),
- command=('dnsrecord_add', [dnszone1, u'@'], {'mxrecord': u"0 %s" % dnszone1_mname }),
+ desc='Add MX record to zone %r using dnsrecord_add' % (zone1),
+ command=('dnsrecord_add', [zone1, u'@'], {'mxrecord': u"0 %s" % zone1_ns }),
expected={
'value': u'@',
'summary': None,
'result': {
'objectclass': objectclasses.dnszone,
- 'dn': dnszone1_dn,
+ 'dn': zone1_dn,
'idnsname': [u'@'],
- 'mxrecord': [u"0 %s" % dnszone1_mname],
- 'nsrecord': [dnszone1_mname],
+ 'mxrecord': [u"0 %s" % zone1_ns],
+ 'nsrecord': [zone1_ns],
},
},
),
dict(
- desc='Try to add invalid SRV record to zone %r using dnsrecord_add' % (dnszone1),
- command=('dnsrecord_add', [dnszone1, u'_foo._tcp'], {'srvrecord': dnszone1_mname}),
+ desc='Try to add invalid SRV record to zone %r using dnsrecord_add' % (zone1),
+ command=('dnsrecord_add', [zone1, u'_foo._tcp'], {'srvrecord': zone1_ns}),
expected=errors.ValidationError(name='srv_rec',
error=u'format must be specified as "PRIORITY WEIGHT PORT TARGET" ' +
u' (see RFC 2782 for details)'),
),
dict(
- desc='Try to add invalid SRV record via parts to zone %r using dnsrecord_add' % (dnszone1),
- command=('dnsrecord_add', [dnszone1, u'_foo._tcp'], {'srv_part_priority': 0,
+ desc='Try to add invalid SRV record via parts to zone %r using dnsrecord_add' % (zone1),
+ command=('dnsrecord_add', [zone1, u'_foo._tcp'], {'srv_part_priority': 0,
'srv_part_weight' : 0,
'srv_part_port' : 123,
'srv_part_target' : u'foo bar'}),
@@ -696,224 +703,224 @@ class test_dns(Declarative):
),
dict(
- desc='Try to add SRV record to zone %r both via parts and a raw value' % (dnszone1),
- command=('dnsrecord_add', [dnszone1, u'_foo._tcp'], {'srv_part_priority': 0,
+ desc='Try to add SRV record to zone %r both via parts and a raw value' % (zone1),
+ command=('dnsrecord_add', [zone1, u'_foo._tcp'], {'srv_part_priority': 0,
'srv_part_weight' : 0,
'srv_part_port' : 123,
'srv_part_target' : u'foo.bar.',
'srvrecord': [u"1 100 1234 %s" \
- % dnszone1_mname]}),
+ % zone1_ns]}),
expected=errors.ValidationError(name='srv_target',
error=u'Raw value of a DNS record was already set by ' +
u'"srv_rec" option'),
),
dict(
- desc='Add SRV record to zone %r using dnsrecord_add' % (dnszone1),
- command=('dnsrecord_add', [dnszone1, u'_foo._tcp'], {'srvrecord': u"0 100 1234 %s" % dnszone1_mname}),
+ desc='Add SRV record to zone %r using dnsrecord_add' % (zone1),
+ command=('dnsrecord_add', [zone1, u'_foo._tcp'], {'srvrecord': u"0 100 1234 %s" % zone1_ns}),
expected={
'value': u'_foo._tcp',
'summary': None,
'result': {
'objectclass': objectclasses.dnsrecord,
- 'dn': DN(('idnsname', u'_foo._tcp'), dnszone1_dn),
+ 'dn': DN(('idnsname', u'_foo._tcp'), zone1_dn),
'idnsname': [u'_foo._tcp'],
- 'srvrecord': [u"0 100 1234 %s" % dnszone1_mname],
+ 'srvrecord': [u"0 100 1234 %s" % zone1_ns],
},
},
),
dict(
- desc='Try to modify SRV record in zone %r without specifying modified value' % (dnszone1),
- command=('dnsrecord_mod', [dnszone1, u'_foo._tcp'], {'srv_part_priority': 1,}),
+ desc='Try to modify SRV record in zone %r without specifying modified value' % (zone1),
+ command=('dnsrecord_mod', [zone1, u'_foo._tcp'], {'srv_part_priority': 1,}),
expected=errors.RequirementError(name='srvrecord'),
),
dict(
- desc='Try to modify SRV record in zone %r with non-existent modified value' % (dnszone1),
- command=('dnsrecord_mod', [dnszone1, u'_foo._tcp'], {'srv_part_priority': 1,
+ desc='Try to modify SRV record in zone %r with non-existent modified value' % (zone1),
+ command=('dnsrecord_mod', [zone1, u'_foo._tcp'], {'srv_part_priority': 1,
'srvrecord' : [u"0 100 1234 does.not.exist."] }),
expected=errors.AttrValueNotFound(attr='SRV record',
value=u'0 100 1234 does.not.exist.'),
),
dict(
- desc='Try to modify SRV record in zone %r with invalid part value' % (dnszone1),
- command=('dnsrecord_mod', [dnszone1, u'_foo._tcp'], {'srv_part_priority': 100000,
- 'srvrecord' : [u"0 100 1234 %s" % dnszone1_mname] }),
+ desc='Try to modify SRV record in zone %r with invalid part value' % (zone1),
+ command=('dnsrecord_mod', [zone1, u'_foo._tcp'], {'srv_part_priority': 100000,
+ 'srvrecord' : [u"0 100 1234 %s" % zone1_ns] }),
expected=errors.ValidationError(name='srv_priority', error=u'can be at most 65535'),
),
dict(
- desc='Modify SRV record in zone %r using parts' % (dnszone1),
- command=('dnsrecord_mod', [dnszone1, u'_foo._tcp'], {'srv_part_priority': 1,
- 'srvrecord' : [u"0 100 1234 %s" % dnszone1_mname] }),
+ desc='Modify SRV record in zone %r using parts' % (zone1),
+ command=('dnsrecord_mod', [zone1, u'_foo._tcp'], {'srv_part_priority': 1,
+ 'srvrecord' : [u"0 100 1234 %s" % zone1_ns] }),
expected={
'value': u'_foo._tcp',
'summary': None,
'result': {
'idnsname': [u'_foo._tcp'],
- 'srvrecord': [u"1 100 1234 %s" % dnszone1_mname],
+ 'srvrecord': [u"1 100 1234 %s" % zone1_ns],
},
},
),
dict(
- desc='Try to add invalid LOC record to zone %r using dnsrecord_add' % (dnszone1),
- command=('dnsrecord_add', [dnszone1, u'@'], {'locrecord': u"91 11 42.4 N 16 36 29.6 E 227.64" }),
+ desc='Try to add invalid LOC record to zone %r using dnsrecord_add' % (zone1),
+ command=('dnsrecord_add', [zone1, u'@'], {'locrecord': u"91 11 42.4 N 16 36 29.6 E 227.64" }),
expected=errors.ValidationError(name='lat_deg',
error=u'can be at most 90'),
),
dict(
- desc='Add LOC record to zone %r using dnsrecord_add' % (dnszone1),
- command=('dnsrecord_add', [dnszone1, u'@'], {'locrecord': u"49 11 42.4 N 16 36 29.6 E 227.64" }),
+ desc='Add LOC record to zone %r using dnsrecord_add' % (zone1),
+ command=('dnsrecord_add', [zone1, u'@'], {'locrecord': u"49 11 42.4 N 16 36 29.6 E 227.64" }),
expected={
'value': u'@',
'summary': None,
'result': {
'objectclass': objectclasses.dnszone,
- 'dn': dnszone1_dn,
+ 'dn': zone1_dn,
'idnsname': [u'@'],
- 'mxrecord': [u"0 %s" % dnszone1_mname],
- 'nsrecord': [dnszone1_mname],
+ 'mxrecord': [u"0 %s" % zone1_ns],
+ 'nsrecord': [zone1_ns],
'locrecord': [u"49 11 42.400 N 16 36 29.600 E 227.64"],
},
},
),
dict(
- desc='Try to add CNAME record to %r using dnsrecord_add' % (dnsres1),
- command=('dnsrecord_add', [dnszone1, dnsres1], {'cnamerecord': u'foo-1.example.com.'}),
+ desc='Try to add CNAME record to %r using dnsrecord_add' % (name1),
+ command=('dnsrecord_add', [zone1, name1], {'cnamerecord': u'foo-1.example.com.'}),
expected=errors.ValidationError(name='cnamerecord',
error=u'CNAME record is not allowed to coexist with any other '
u'record (RFC 1034, section 3.6.2)'),
),
dict(
- desc='Try to add invalid CNAME record %r using dnsrecord_add' % (dnsrescname),
- command=('dnsrecord_add', [dnszone1, dnsrescname], {'cnamerecord': u'-.example.com'}),
+ desc='Try to add invalid CNAME record %r using dnsrecord_add' % (cname),
+ command=('dnsrecord_add', [zone1, cname], {'cnamerecord': u'-.example.com'}),
expected=errors.ValidationError(name='hostname',
error=u'invalid domain-name: only letters, numbers, _, and - ' +
u'are allowed. DNS label may not start or end with -'),
),
dict(
- desc='Try to add multiple CNAME record %r using dnsrecord_add' % (dnsrescname),
- command=('dnsrecord_add', [dnszone1, dnsrescname], {'cnamerecord':
+ desc='Try to add multiple CNAME record %r using dnsrecord_add' % (cname),
+ command=('dnsrecord_add', [zone1, cname], {'cnamerecord':
[u'1.example.com.', u'2.example.com.']}),
expected=errors.ValidationError(name='cnamerecord',
error=u'only one CNAME record is allowed per name (RFC 2136, section 1.1.5)'),
),
dict(
- desc='Add CNAME record to %r using dnsrecord_add' % (dnsrescname),
- command=('dnsrecord_add', [dnszone1, dnsrescname], {'cnamerecord': u'foo-1.example.com.'}),
+ desc='Add CNAME record to %r using dnsrecord_add' % (cname),
+ command=('dnsrecord_add', [zone1, cname], {'cnamerecord': u'foo-1.example.com.'}),
expected={
- 'value': dnsrescname,
+ 'value': cname,
'summary': None,
'result': {
'objectclass': objectclasses.dnsrecord,
- 'dn': dnsrescname_dn,
- 'idnsname': [dnsrescname],
+ 'dn': cname_dn,
+ 'idnsname': [cname],
'cnamerecord': [u'foo-1.example.com.'],
},
},
),
dict(
- desc='Try to add other record to CNAME record %r using dnsrecord_add' % (dnsrescname),
- command=('dnsrecord_add', [dnszone1, dnsrescname], {'arecord': dnsresarec1}),
+ desc='Try to add other record to CNAME record %r using dnsrecord_add' % (cname),
+ command=('dnsrecord_add', [zone1, cname], {'arecord': arec1}),
expected=errors.ValidationError(name='cnamerecord',
error=u'CNAME record is not allowed to coexist with any other '
u'record (RFC 1034, section 3.6.2)'),
),
dict(
- desc='Try to add other record to CNAME record %r using dnsrecord_mod' % (dnsrescname),
- command=('dnsrecord_mod', [dnszone1, dnsrescname], {'arecord': dnsresarec1}),
+ desc='Try to add other record to CNAME record %r using dnsrecord_mod' % (cname),
+ command=('dnsrecord_mod', [zone1, cname], {'arecord': arec1}),
expected=errors.ValidationError(name='cnamerecord',
error=u'CNAME record is not allowed to coexist with any other '
u'record (RFC 1034, section 3.6.2)'),
),
dict(
- desc='Add A record and delete CNAME record in %r with dnsrecord_mod' % (dnsrescname),
- command=('dnsrecord_mod', [dnszone1, dnsrescname], {'arecord': dnsresarec1,
+ desc='Add A record and delete CNAME record in %r with dnsrecord_mod' % (cname),
+ command=('dnsrecord_mod', [zone1, cname], {'arecord': arec1,
'cnamerecord': None}),
expected={
- 'value': dnsrescname,
+ 'value': cname,
'summary': None,
'result': {
- 'idnsname': [dnsrescname],
- 'arecord': [dnsresarec1],
+ 'idnsname': [cname],
+ 'arecord': [arec1],
},
},
),
dict(
- desc='Try to add multiple DNAME records to %r using dnsrecord_add' % (dnsresdname),
- command=('dnsrecord_add', [dnszone1, dnsres1], {'dnamerecord':
+ desc='Try to add multiple DNAME records to %r using dnsrecord_add' % (dname),
+ command=('dnsrecord_add', [zone1, name1], {'dnamerecord':
[u'foo-1.example.com.', u'foo-2.example.com.']}),
expected=errors.ValidationError(name='dnamerecord',
error=u'only one DNAME record is allowed per name (RFC 6672, section 2.4)'),
),
dict(
- desc='Try to add invalid DNAME record %r using dnsrecord_add' % (dnsresdname),
- command=('dnsrecord_add', [dnszone1, dnsresdname], {'dnamerecord': u'-.example.com.'}),
+ desc='Try to add invalid DNAME record %r using dnsrecord_add' % (dname),
+ command=('dnsrecord_add', [zone1, dname], {'dnamerecord': u'-.example.com.'}),
expected=errors.ValidationError(name='target',
error=u'invalid domain-name: only letters, numbers, _, and - ' +
u'are allowed. DNS label may not start or end with -'),
),
dict(
- desc='Add DNAME record to %r using dnsrecord_add' % (dnsresdname),
- command=('dnsrecord_add', [dnszone1, dnsresdname],
- {'dnamerecord': u'd.example.com.', 'arecord': dnsresarec1}),
+ desc='Add DNAME record to %r using dnsrecord_add' % (dname),
+ command=('dnsrecord_add', [zone1, dname],
+ {'dnamerecord': u'd.example.com.', 'arecord': arec1}),
expected={
- 'value': dnsresdname,
+ 'value': dname,
'summary': None,
'result': {
'objectclass': objectclasses.dnsrecord,
- 'dn': dnsresdname_dn,
- 'idnsname': [dnsresdname],
+ 'dn': dname_dn,
+ 'idnsname': [dname],
'dnamerecord': [u'd.example.com.'],
- 'arecord': [dnsresarec1],
+ 'arecord': [arec1],
},
},
),
dict(
- desc='Try to add CNAME record to %r using dnsrecord_add' % (dnsresdname),
- command=('dnsrecord_add', [dnszone1, dnsresdname], {'cnamerecord': u'foo-1.example.com.'}),
+ desc='Try to add CNAME record to %r using dnsrecord_add' % (dname),
+ command=('dnsrecord_add', [zone1, dname], {'cnamerecord': u'foo-1.example.com.'}),
expected=errors.ValidationError(name='cnamerecord',
error=u'CNAME record is not allowed to coexist with any other '
u'record (RFC 1034, section 3.6.2)'),
),
dict(
- desc='Try to add NS record to %r using dnsrecord_add' % (dnsresdname),
- command=('dnsrecord_add', [dnszone1, dnsresdname],
- {'nsrecord': u'%s.%s.' % (dnsres1, dnszone1)}),
+ desc='Try to add NS record to %r using dnsrecord_add' % (dname),
+ command=('dnsrecord_add', [zone1, dname],
+ {'nsrecord': u'%s.%s.' % (name1, zone1)}),
expected=errors.ValidationError(name='dnamerecord',
error=u'DNAME record is not allowed to coexist with an NS '
u'record except when located in a zone root record (RFC 6672, section 2.3)'),
),
dict(
- desc='Add NS+DNAME record to %r zone record using dnsrecord_add' % (dnszone2),
- command=('dnsrecord_add', [dnszone2, u'@'],
+ desc='Add NS+DNAME record to %r zone record using dnsrecord_add' % (zone2),
+ command=('dnsrecord_add', [zone2, u'@'],
{'dnamerecord': u'd.example.com.',
- 'nsrecord': dnszone1_mname}),
+ 'nsrecord': zone1_ns}),
expected = {
'value': u'@',
'summary': None,
'result': {
'objectclass': objectclasses.dnszone,
'dnamerecord': [u'd.example.com.'],
- 'dn': dnszone2_dn,
- 'nsrecord': [dnszone2_mname, dnszone1_mname],
+ 'dn': zone2_dn,
+ 'nsrecord': [zone2_ns, zone1_ns],
'idnsname': [u'@']
}
},
@@ -921,50 +928,50 @@ class test_dns(Declarative):
dict(
- desc='Delete zone %r' % dnszone2,
- command=('dnszone_del', [dnszone2], {}),
+ desc='Delete zone %r' % zone2,
+ command=('dnszone_del', [zone2], {}),
expected={
- 'value': dnszone2,
- 'summary': u'Deleted DNS zone "%s"' % dnszone2,
+ 'value': zone2,
+ 'summary': u'Deleted DNS zone "%s"' % zone2,
'result': {'failed': u''},
},
),
dict(
- desc='Try to add invalid KX record %r using dnsrecord_add' % (dnsres1),
- command=('dnsrecord_add', [dnszone1, dnsres1], {'kxrecord': u'foo-1.example.com' }),
+ desc='Try to add invalid KX record %r using dnsrecord_add' % (name1),
+ command=('dnsrecord_add', [zone1, name1], {'kxrecord': u'foo-1.example.com' }),
expected=errors.ValidationError(name='kx_rec',
error=u'format must be specified as "PREFERENCE EXCHANGER" ' +
u' (see RFC 2230 for details)'),
),
dict(
- desc='Add KX record to %r using dnsrecord_add' % (dnsres1),
- command=('dnsrecord_add', [dnszone1, dnsres1], {'kxrecord': u'1 foo-1' }),
+ desc='Add KX record to %r using dnsrecord_add' % (name1),
+ command=('dnsrecord_add', [zone1, name1], {'kxrecord': u'1 foo-1' }),
expected={
- 'value': dnsres1,
+ 'value': name1,
'summary': None,
'result': {
'objectclass': objectclasses.dnsrecord,
- 'dn': dnsres1_dn,
- 'idnsname': [dnsres1],
- 'arecord': [dnsresarec3],
+ 'dn': name1_dn,
+ 'idnsname': [name1],
+ 'arecord': [arec3],
'kxrecord': [u'1 foo-1'],
},
},
),
dict(
- desc='Add TXT record to %r using dnsrecord_add' % (dnsres1),
- command=('dnsrecord_add', [dnszone1, dnsres1], {'txtrecord': u'foo bar' }),
+ desc='Add TXT record to %r using dnsrecord_add' % (name1),
+ command=('dnsrecord_add', [zone1, name1], {'txtrecord': u'foo bar' }),
expected={
- 'value': dnsres1,
+ 'value': name1,
'summary': None,
'result': {
'objectclass': objectclasses.dnsrecord,
- 'dn': dnsres1_dn,
- 'idnsname': [dnsres1],
- 'arecord': [dnsresarec3],
+ 'dn': name1_dn,
+ 'idnsname': [name1],
+ 'arecord': [arec3],
'kxrecord': [u'1 foo-1'],
'txtrecord': [u'foo bar'],
},
@@ -972,76 +979,76 @@ class test_dns(Declarative):
),
dict(
- desc='Add NSEC record to %r using dnsrecord_add' % (dnsres1),
- command=('dnsrecord_add', [dnszone1, dnsres1], {
- 'nsec_part_next': dnszone1,
+ desc='Add NSEC record to %r using dnsrecord_add' % (name1),
+ command=('dnsrecord_add', [zone1, name1], {
+ 'nsec_part_next': zone1,
'nsec_part_types' : [u'TXT', u'A']}),
expected={
- 'value': dnsres1,
+ 'value': name1,
'summary': None,
'result': {
'objectclass': objectclasses.dnsrecord,
- 'dn': dnsres1_dn,
- 'idnsname': [dnsres1],
- 'arecord': [dnsresarec3],
+ 'dn': name1_dn,
+ 'idnsname': [name1],
+ 'arecord': [arec3],
'kxrecord': [u'1 foo-1'],
'txtrecord': [u'foo bar'],
- 'nsecrecord': [dnszone1 + u' TXT A'],
+ 'nsecrecord': [zone1 + u' TXT A'],
},
},
),
dict(
- desc='Try to add unresolvable absolute NS record to %r using dnsrecord_add' % (dnsres1),
- command=('dnsrecord_add', [dnszone1, dnsres1], {'nsrecord': u'does.not.exist.'}),
+ desc='Try to add unresolvable absolute NS record to %r using dnsrecord_add' % (name1),
+ command=('dnsrecord_add', [zone1, name1], {'nsrecord': u'does.not.exist.'}),
expected=errors.NotFound(reason=u"Nameserver 'does.not.exist.' does not have a corresponding A/AAAA record"),
),
dict(
- desc='Try to add unresolvable relative NS record to %r using dnsrecord_add' % (dnsres1),
- command=('dnsrecord_add', [dnszone1, dnsres1], {'nsrecord': u'does.not.exist'}),
- expected=errors.NotFound(reason=u"Nameserver 'does.not.exist.%s.' does not have a corresponding A/AAAA record" % dnszone1),
+ desc='Try to add unresolvable relative NS record to %r using dnsrecord_add' % (name1),
+ command=('dnsrecord_add', [zone1, name1], {'nsrecord': u'does.not.exist'}),
+ expected=errors.NotFound(reason=u"Nameserver 'does.not.exist.%s.' does not have a corresponding A/AAAA record" % zone1),
),
dict(
- desc='Add unresolvable NS record with --force to %r using dnsrecord_add' % (dnsres1),
- command=('dnsrecord_add', [dnszone1, dnsres1], {'nsrecord': u'does.not.exist.',
+ desc='Add unresolvable NS record with --force to %r using dnsrecord_add' % (name1),
+ command=('dnsrecord_add', [zone1, name1], {'nsrecord': u'does.not.exist.',
'force' : True}),
expected={
- 'value': dnsres1,
+ 'value': name1,
'summary': None,
'result': {
'objectclass': objectclasses.dnsrecord,
- 'dn': dnsres1_dn,
- 'idnsname': [dnsres1],
- 'arecord': [dnsresarec3],
+ 'dn': name1_dn,
+ 'idnsname': [name1],
+ 'arecord': [arec3],
'kxrecord': [u'1 foo-1'],
'txtrecord': [u'foo bar'],
- 'nsecrecord': [dnszone1 + u' TXT A'],
+ 'nsecrecord': [zone1 + u' TXT A'],
'nsrecord': [u'does.not.exist.'],
},
},
),
dict(
- desc='Try to to rename DNS zone %r root record' % (dnszone1),
- command=('dnsrecord_mod', [dnszone1, u'@'], {'rename': dnsres1_renamed,}),
+ desc='Try to to rename DNS zone %r root record' % (zone1),
+ command=('dnsrecord_mod', [zone1, u'@'], {'rename': name1_renamed,}),
expected=errors.ValidationError(name='rename',
error=u'DNS zone root record cannot be renamed')
),
dict(
- desc='Rename DNS record %r to %r' % (dnsres1, dnsres1_renamed),
- command=('dnsrecord_mod', [dnszone1, dnsres1], {'rename': dnsres1_renamed,}),
+ desc='Rename DNS record %r to %r' % (name1, name1_renamed),
+ command=('dnsrecord_mod', [zone1, name1], {'rename': name1_renamed,}),
expected={
- 'value': dnsres1,
+ 'value': name1,
'summary': None,
'result': {
- 'idnsname': [dnsres1_renamed],
- 'arecord': [dnsresarec3],
+ 'idnsname': [name1_renamed],
+ 'arecord': [arec3],
'kxrecord': [u'1 foo-1'],
'txtrecord': [u'foo bar'],
- 'nsecrecord': [dnszone1 + u' TXT A'],
+ 'nsecrecord': [zone1 + u' TXT A'],
'nsrecord': [u'does.not.exist.'],
},
},
@@ -1049,11 +1056,11 @@ class test_dns(Declarative):
dict(
- desc='Delete record %r in zone %r' % (dnsres1_renamed, dnszone1),
- command=('dnsrecord_del', [dnszone1, dnsres1_renamed], {'del_all': True }),
+ desc='Delete record %r in zone %r' % (name1_renamed, zone1),
+ command=('dnsrecord_del', [zone1, name1_renamed], {'del_all': True }),
expected={
- 'value': dnsres1_renamed,
- 'summary': u'Deleted record "%s"' % dnsres1_renamed,
+ 'value': name1_renamed,
+ 'summary': u'Deleted record "%s"' % name1_renamed,
'result': {'failed': u''},
},
),
@@ -1064,8 +1071,8 @@ class test_dns(Declarative):
command=(
'dnszone_add', [], {
'name_from_ip': u'foo',
- 'idnssoamname': dnszone1_mname,
- 'idnssoarname': dnszone1_rname,
+ 'idnssoamname': zone1_ns,
+ 'idnssoarname': zone1_rname,
}
),
expected=errors.ValidationError(name='name_from_ip',
@@ -1073,24 +1080,24 @@ class test_dns(Declarative):
),
dict(
- desc='Create reverse zone from IP/netmask %r using name_from_ip option' % revdnszone1_ip,
+ desc='Create reverse zone from IP/netmask %r using name_from_ip option' % revzone1_ip,
command=(
'dnszone_add', [], {
- 'name_from_ip': revdnszone1_ip,
- 'idnssoamname': dnszone1_mname,
- 'idnssoarname': dnszone1_rname,
+ 'name_from_ip': revzone1_ip,
+ 'idnssoamname': zone1_ns,
+ 'idnssoarname': zone1_rname,
}
),
expected={
- 'value': revdnszone1,
+ 'value': revzone1,
'summary': None,
'result': {
- 'dn': revdnszone1_dn,
- 'idnsname': [revdnszone1],
+ 'dn': revzone1_dn,
+ 'idnsname': [revzone1],
'idnszoneactive': [u'TRUE'],
- 'idnssoamname': [dnszone1_mname],
- 'nsrecord': [dnszone1_mname],
- 'idnssoarname': [dnszone1_rname],
+ 'idnssoamname': [zone1_ns],
+ 'nsrecord': [zone1_ns],
+ 'idnssoarname': [zone1_rname],
'idnssoaserial': [fuzzy_digits],
'idnssoarefresh': [fuzzy_digits],
'idnssoaretry': [fuzzy_digits],
@@ -1098,7 +1105,7 @@ class test_dns(Declarative):
'idnssoaminimum': [fuzzy_digits],
'idnsallowdynupdate': [u'FALSE'],
'idnsupdatepolicy': [u'grant %(realm)s krb5-subdomain %(zone)s PTR;'
- % dict(realm=api.env.realm, zone=revdnszone1)],
+ % dict(realm=api.env.realm, zone=revzone1)],
'idnsallowtransfer': [u'none;'],
'idnsallowquery': [u'any;'],
'objectclass': objectclasses.dnszone,
@@ -1108,24 +1115,24 @@ class test_dns(Declarative):
dict(
- desc='Create reverse zone from IP %r using name_from_ip option' % revdnszone2_ip,
+ desc='Create reverse zone from IP %r using name_from_ip option' % revzone2_ip,
command=(
'dnszone_add', [], {
- 'name_from_ip': revdnszone2_ip,
- 'idnssoamname': dnszone1_mname,
- 'idnssoarname': dnszone1_rname,
+ 'name_from_ip': revzone2_ip,
+ 'idnssoamname': zone1_ns,
+ 'idnssoarname': zone1_rname,
}
),
expected={
- 'value': revdnszone2,
+ 'value': revzone2,
'summary': None,
'result': {
- 'dn': revdnszone2_dn,
- 'idnsname': [revdnszone2],
+ 'dn': revzone2_dn,
+ 'idnsname': [revzone2],
'idnszoneactive': [u'TRUE'],
- 'idnssoamname': [dnszone1_mname],
- 'nsrecord': [dnszone1_mname],
- 'idnssoarname': [dnszone1_rname],
+ 'idnssoamname': [zone1_ns],
+ 'nsrecord': [zone1_ns],
+ 'idnssoarname': [zone1_rname],
'idnssoaserial': [fuzzy_digits],
'idnssoarefresh': [fuzzy_digits],
'idnssoaretry': [fuzzy_digits],
@@ -1133,7 +1140,7 @@ class test_dns(Declarative):
'idnssoaminimum': [fuzzy_digits],
'idnsallowdynupdate': [u'FALSE'],
'idnsupdatepolicy': [u'grant %(realm)s krb5-subdomain %(zone)s PTR;'
- % dict(realm=api.env.realm, zone=revdnszone2)],
+ % dict(realm=api.env.realm, zone=revzone2)],
'idnsallowtransfer': [u'none;'],
'idnsallowquery': [u'any;'],
'objectclass': objectclasses.dnszone,
@@ -1143,23 +1150,23 @@ class test_dns(Declarative):
dict(
- desc='Try to add invalid PTR %r to %r using dnsrecord_add' % (dnsrev1, revdnszone1),
- command=('dnsrecord_add', [revdnszone1, dnsrev1], {'ptrrecord': u'-.example.com' }),
+ desc='Try to add invalid PTR %r to %r using dnsrecord_add' % (revname1, revzone1),
+ command=('dnsrecord_add', [revzone1, revname1], {'ptrrecord': u'-.example.com' }),
expected=errors.ValidationError(name='hostname',
error=u'invalid domain-name: only letters, numbers, and - ' +
u'are allowed. DNS label may not start or end with -'),
),
dict(
- desc='Add PTR record %r to %r using dnsrecord_add' % (dnsrev1, revdnszone1),
- command=('dnsrecord_add', [revdnszone1, dnsrev1], {'ptrrecord': u'foo-1.example.com' }),
+ desc='Add PTR record %r to %r using dnsrecord_add' % (revname1, revzone1),
+ command=('dnsrecord_add', [revzone1, revname1], {'ptrrecord': u'foo-1.example.com' }),
expected={
- 'value': dnsrev1,
+ 'value': revname1,
'summary': None,
'result': {
'objectclass': objectclasses.dnsrecord,
- 'dn': dnsrev1_dn,
- 'idnsname': [dnsrev1],
+ 'dn': revname1_dn,
+ 'idnsname': [revname1],
'ptrrecord': [u'foo-1.example.com.'],
},
},
@@ -1167,15 +1174,15 @@ class test_dns(Declarative):
dict(
desc='Show record %r in zone %r with --structured and --all options'\
- % (dnsrev1, revdnszone1),
- command=('dnsrecord_show', [revdnszone1, dnsrev1],
+ % (revname1, revzone1),
+ command=('dnsrecord_show', [revzone1, revname1],
{'structured': True, 'all': True}),
expected={
- 'value': dnsrev1,
+ 'value': revname1,
'summary': None,
'result': {
- 'dn': dnsrev1_dn,
- 'idnsname': [dnsrev1],
+ 'dn': revname1_dn,
+ 'idnsname': [revname1],
'objectclass': objectclasses.dnsrecord,
'dnsrecords': [
{
@@ -1190,38 +1197,38 @@ class test_dns(Declarative):
dict(
desc='Update global DNS settings',
- command=('dnsconfig_mod', [], {'idnsforwarders' : [dnsfwd_ip],}),
+ command=('dnsconfig_mod', [], {'idnsforwarders' : [fwd_ip],}),
expected={
'value': u'',
'summary': None,
'result': {
- 'idnsforwarders': [dnsfwd_ip],
+ 'idnsforwarders': [fwd_ip],
},
},
),
dict(
- desc='Try to add invalid allow-query to zone %r' % dnszone1,
- command=('dnszone_mod', [dnszone1], {'idnsallowquery': u'foo'}),
+ desc='Try to add invalid allow-query to zone %r' % zone1,
+ command=('dnszone_mod', [zone1], {'idnsallowquery': u'foo'}),
expected=errors.ValidationError(name='allow_query',
error=u"failed to detect a valid IP address from 'foo'"),
),
dict(
- desc='Add allow-query ACL to zone %r' % dnszone1,
- command=('dnszone_mod', [dnszone1], {'idnsallowquery': allowquery_restricted_in}),
+ desc='Add allow-query ACL to zone %r' % zone1,
+ command=('dnszone_mod', [zone1], {'idnsallowquery': allowquery_restricted_in}),
expected={
- 'value': dnszone1,
+ 'value': zone1,
'summary': None,
'result': {
- 'idnsname': [dnszone1],
+ 'idnsname': [zone1],
'idnszoneactive': [u'TRUE'],
- 'nsrecord': [dnszone1_mname],
+ 'nsrecord': [zone1_ns],
'mxrecord': [u'0 ns1.dnszone.test.'],
'locrecord': [u"49 11 42.400 N 16 36 29.600 E 227.64"],
- 'idnssoamname': [dnszone1_mname],
- 'idnssoarname': [dnszone1_rname],
+ 'idnssoamname': [zone1_ns],
+ 'idnssoarname': [zone1_rname],
'idnssoaserial': [fuzzy_digits],
'idnssoarefresh': [u'5478'],
'idnssoaretry': [fuzzy_digits],
@@ -1235,26 +1242,26 @@ class test_dns(Declarative):
dict(
- desc='Try to add invalid allow-transfer to zone %r' % dnszone1,
- command=('dnszone_mod', [dnszone1], {'idnsallowtransfer': u'10.'}),
+ desc='Try to add invalid allow-transfer to zone %r' % zone1,
+ command=('dnszone_mod', [zone1], {'idnsallowtransfer': u'10.'}),
expected=errors.ValidationError(name='allow_transfer',
error=u"failed to detect a valid IP address from '10.'"),
),
dict(
- desc='Add allow-transer ACL to zone %r' % dnszone1,
- command=('dnszone_mod', [dnszone1], {'idnsallowtransfer': dnsfwd_ip}),
+ desc='Add allow-transer ACL to zone %r' % zone1,
+ command=('dnszone_mod', [zone1], {'idnsallowtransfer': fwd_ip}),
expected={
- 'value': dnszone1,
+ 'value': zone1,
'summary': None,
'result': {
- 'idnsname': [dnszone1],
+ 'idnsname': [zone1],
'idnszoneactive': [u'TRUE'],
- 'nsrecord': [dnszone1_mname],
+ 'nsrecord': [zone1_ns],
'mxrecord': [u'0 ns1.dnszone.test.'],
'locrecord': [u"49 11 42.400 N 16 36 29.600 E 227.64"],
- 'idnssoamname': [dnszone1_mname],
- 'idnssoarname': [dnszone1_rname],
+ 'idnssoamname': [zone1_ns],
+ 'idnssoarname': [zone1_rname],
'idnssoaserial': [fuzzy_digits],
'idnssoarefresh': [u'5478'],
'idnssoaretry': [fuzzy_digits],
@@ -1268,19 +1275,19 @@ class test_dns(Declarative):
dict(
- desc='Set SOA serial of zone %r to high number' % dnszone1,
- command=('dnszone_mod', [dnszone1], {'idnssoaserial': 4294967295L}),
+ desc='Set SOA serial of zone %r to high number' % zone1,
+ command=('dnszone_mod', [zone1], {'idnssoaserial': 4294967295L}),
expected={
- 'value': dnszone1,
+ 'value': zone1,
'summary': None,
'result': {
- 'idnsname': [dnszone1],
+ 'idnsname': [zone1],
'idnszoneactive': [u'TRUE'],
- 'nsrecord': [dnszone1_mname],
+ 'nsrecord': [zone1_ns],
'mxrecord': [u'0 ns1.dnszone.test.'],
'locrecord': [u"49 11 42.400 N 16 36 29.600 E 227.64"],
- 'idnssoamname': [dnszone1_mname],
- 'idnssoarname': [dnszone1_rname],
+ 'idnssoamname': [zone1_ns],
+ 'idnssoarname': [zone1_rname],
'idnssoaserial': [u'4294967295'],
'idnssoarefresh': [u'5478'],
'idnssoaretry': [fuzzy_digits],
@@ -1294,42 +1301,42 @@ class test_dns(Declarative):
dict(
- desc='Try to create duplicate PTR record for %r with --a-create-reverse' % dnsres1,
- command=('dnsrecord_add', [dnszone1, dnsres1], {'arecord': dnsrev1_ip,
+ desc='Try to create duplicate PTR record for %r with --a-create-reverse' % name1,
+ command=('dnsrecord_add', [zone1, name1], {'arecord': revname1_ip,
'a_extra_create_reverse' : True}),
expected=errors.DuplicateEntry(message=u'Reverse record for IP '
'address %s already exists in reverse zone '
- '%s.' % (dnsrev1_ip, revdnszone1)),
+ '%s.' % (revname1_ip, revzone1)),
),
dict(
- desc='Create A record %r in zone %r with --a-create-reverse' % (dnsres1, dnszone1),
- command=('dnsrecord_add', [dnszone1, dnsres1], {'arecord': dnsrev2_ip,
+ desc='Create A record %r in zone %r with --a-create-reverse' % (name1, zone1),
+ command=('dnsrecord_add', [zone1, name1], {'arecord': revname2_ip,
'a_extra_create_reverse' : True}),
expected={
- 'value': dnsres1,
+ 'value': name1,
'summary': None,
'result': {
- 'dn': dnsres1_dn,
- 'idnsname': [dnsres1],
+ 'dn': name1_dn,
+ 'idnsname': [name1],
'objectclass': objectclasses.dnsrecord,
- 'arecord': [dnsrev2_ip],
+ 'arecord': [revname2_ip],
},
},
),
dict(
- desc='Check reverse record for %r created via --a-create-reverse' % dnsres1,
- command=('dnsrecord_show', [revdnszone1, dnsrev2], {}),
+ desc='Check reverse record for %r created via --a-create-reverse' % name1,
+ command=('dnsrecord_show', [revzone1, revname2], {}),
expected={
- 'value': dnsrev2,
+ 'value': revname2,
'summary': None,
'result': {
- 'dn': dnsrev2_dn,
- 'idnsname': [dnsrev2],
- 'ptrrecord': [dnsres1 + '.' + dnszone1 + '.'],
+ 'dn': revname2_dn,
+ 'idnsname': [revname2],
+ 'ptrrecord': [name1 + '.' + zone1 + '.'],
},
},
),
@@ -1343,38 +1350,38 @@ class test_dns(Declarative):
dict(
- desc='Add per-zone permission for zone %r' % dnszone1,
+ desc='Add per-zone permission for zone %r' % zone1,
command=(
- 'dnszone_add_permission', [dnszone1], {}
+ 'dnszone_add_permission', [zone1], {}
),
expected=dict(
result=True,
- value=dnszone1_permission,
- summary=u'Added system permission "%s"' % dnszone1_permission,
+ value=zone1_permission,
+ summary=u'Added system permission "%s"' % zone1_permission,
),
),
dict(
- desc='Try to add duplicate per-zone permission for zone %r' % dnszone1,
+ desc='Try to add duplicate per-zone permission for zone %r' % zone1,
command=(
- 'dnszone_add_permission', [dnszone1], {}
+ 'dnszone_add_permission', [zone1], {}
),
expected=errors.DuplicateEntry(message=u'permission with name '
- '"%s" already exists' % dnszone1_permission)
+ '"%s" already exists' % zone1_permission)
),
dict(
- desc='Make sure the permission was created %r' % dnszone1,
+ desc='Make sure the permission was created %r' % zone1,
command=(
- 'permission_show', [dnszone1_permission], {}
+ 'permission_show', [zone1_permission], {}
),
expected=dict(
- value=dnszone1_permission,
+ value=zone1_permission,
summary=None,
result={
- 'dn': dnszone1_permission_dn,
- 'cn': [dnszone1_permission],
+ 'dn': zone1_permission_dn,
+ 'cn': [zone1_permission],
'objectclass': objectclasses.system_permission,
'ipapermissiontype': [u'SYSTEM'],
},
@@ -1382,16 +1389,16 @@ class test_dns(Declarative):
),
dict(
- desc='Retrieve the permission %r with --all --raw' % dnszone1,
+ desc='Retrieve the permission %r with --all --raw' % zone1,
command=(
- 'permission_show', [dnszone1_permission], {}
+ 'permission_show', [zone1_permission], {}
),
expected=dict(
- value=dnszone1_permission,
+ value=zone1_permission,
summary=None,
result={
- 'dn': dnszone1_permission_dn,
- 'cn': [dnszone1_permission],
+ 'dn': zone1_permission_dn,
+ 'cn': [zone1_permission],
'objectclass': objectclasses.system_permission,
'ipapermissiontype': [u'SYSTEM'],
},
@@ -1405,46 +1412,46 @@ class test_dns(Declarative):
),
dict(
- desc='Remove per-zone permission for zone %r' % dnszone1,
+ desc='Remove per-zone permission for zone %r' % zone1,
command=(
- 'dnszone_remove_permission', [dnszone1], {}
+ 'dnszone_remove_permission', [zone1], {}
),
expected=dict(
result=True,
- value=dnszone1_permission,
- summary=u'Removed system permission "%s"' % dnszone1_permission,
+ value=zone1_permission,
+ summary=u'Removed system permission "%s"' % zone1_permission,
),
),
dict(
- desc='Make sure the permission for zone %r was deleted' % dnszone1,
+ desc='Make sure the permission for zone %r was deleted' % zone1,
command=(
- 'permission_show', [dnszone1_permission], {}
+ 'permission_show', [zone1_permission], {}
),
expected=errors.NotFound(reason=u'%s: permission not found'
- % dnszone1_permission)
+ % zone1_permission)
),
dict(
- desc='Delete zone %r' % dnszone1,
- command=('dnszone_del', [dnszone1], {}),
+ desc='Delete zone %r' % zone1,
+ command=('dnszone_del', [zone1], {}),
expected={
- 'value': dnszone1,
- 'summary': u'Deleted DNS zone "%s"' % dnszone1,
+ 'value': zone1,
+ 'summary': u'Deleted DNS zone "%s"' % zone1,
'result': {'failed': u''},
},
),
dict(
- desc='Try to create zone %r nameserver not in it' % dnszone1,
+ desc='Try to create zone %r nameserver not in it' % zone1,
command=(
- 'dnszone_add', [dnszone1], {
+ 'dnszone_add', [zone1], {
'idnssoamname': u'not.in.this.zone.',
- 'idnssoarname': dnszone1_rname,
- 'ip_address' : dnszone1_ip,
+ 'idnssoarname': zone1_rname,
+ 'ip_address' : zone1_ip,
}
),
expected=errors.ValidationError(name='ip_address',
@@ -1454,24 +1461,24 @@ class test_dns(Declarative):
dict(
- desc='Create zone %r with relative nameserver' % dnszone1,
+ desc='Create zone %r with relative nameserver' % zone1,
command=(
- 'dnszone_add', [dnszone1], {
+ 'dnszone_add', [zone1], {
'idnssoamname': u'ns',
- 'idnssoarname': dnszone1_rname,
- 'ip_address' : dnszone1_ip,
+ 'idnssoarname': zone1_rname,
+ 'ip_address' : zone1_ip,
}
),
expected={
- 'value': dnszone1,
+ 'value': zone1,
'summary': None,
'result': {
- 'dn': dnszone1_dn,
- 'idnsname': [dnszone1],
+ 'dn': zone1_dn,
+ 'idnsname': [zone1],
'idnszoneactive': [u'TRUE'],
'idnssoamname': [u'ns'],
'nsrecord': [u'ns'],
- 'idnssoarname': [dnszone1_rname],
+ 'idnssoarname': [zone1_rname],
'idnssoaserial': [fuzzy_digits],
'idnssoarefresh': [fuzzy_digits],
'idnssoaretry': [fuzzy_digits],
@@ -1491,35 +1498,35 @@ class test_dns(Declarative):
dict(
- desc='Delete zone %r' % dnszone1,
- command=('dnszone_del', [dnszone1], {}),
+ desc='Delete zone %r' % zone1,
+ command=('dnszone_del', [zone1], {}),
expected={
- 'value': dnszone1,
- 'summary': u'Deleted DNS zone "%s"' % dnszone1,
+ 'value': zone1,
+ 'summary': u'Deleted DNS zone "%s"' % zone1,
'result': {'failed': u''},
},
),
dict(
- desc='Create zone %r with nameserver in the zone itself' % dnszone1,
+ desc='Create zone %r with nameserver in the zone itself' % zone1,
command=(
- 'dnszone_add', [dnszone1], {
- 'idnssoamname': dnszone1 + u'.',
- 'idnssoarname': dnszone1_rname,
- 'ip_address' : dnszone1_ip,
+ 'dnszone_add', [zone1], {
+ 'idnssoamname': zone1 + u'.',
+ 'idnssoarname': zone1_rname,
+ 'ip_address' : zone1_ip,
}
),
expected={
- 'value': dnszone1,
+ 'value': zone1,
'summary': None,
'result': {
- 'dn': dnszone1_dn,
- 'idnsname': [dnszone1],
+ 'dn': zone1_dn,
+ 'idnsname': [zone1],
'idnszoneactive': [u'TRUE'],
- 'idnssoamname': [dnszone1 + u'.'],
- 'nsrecord': [dnszone1 + u'.'],
- 'idnssoarname': [dnszone1_rname],
+ 'idnssoamname': [zone1 + u'.'],
+ 'nsrecord': [zone1 + u'.'],
+ 'idnssoarname': [zone1_rname],
'idnssoaserial': [fuzzy_digits],
'idnssoarefresh': [fuzzy_digits],
'idnssoaretry': [fuzzy_digits],