summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2011-07-12 09:11:00 +0200
committerAdam Young <ayoung@redhat.com>2011-07-12 14:20:16 -0400
commite6c68e999358a323500aac9680c4aa8ca76a18cc (patch)
tree79109dc950a86090cbf827af51c75af5a78bd4f8 /tests
parent86230333a85489f64205dcda485aa7876fe4c906 (diff)
downloadfreeipa-e6c68e999358a323500aac9680c4aa8ca76a18cc.tar.gz
freeipa-e6c68e999358a323500aac9680c4aa8ca76a18cc.tar.xz
freeipa-e6c68e999358a323500aac9680c4aa8ca76a18cc.zip
Add DNS record modification command
The DNS record plugin does not support modification of a record. One can only add A type addresses to a DNS record or remove the current ones. To actually change a DNS record value it has to be removed and then added with a desired value. This patch adds a new DNS plugin command "dnsrecord-mod" which enables user to: - modify a DNS record value (note than DNS record can hold multiple values and those will be overwritten) - remove a DNS record when an empty value is passed New tests for this new command have been added to the CLI test suite. https://fedorahosted.org/freeipa/ticket/1137
Diffstat (limited to 'tests')
-rw-r--r--tests/test_xmlrpc/test_dns_plugin.py48
1 files changed, 46 insertions, 2 deletions
diff --git a/tests/test_xmlrpc/test_dns_plugin.py b/tests/test_xmlrpc/test_dns_plugin.py
index b994a2383..4a149db2e 100644
--- a/tests/test_xmlrpc/test_dns_plugin.py
+++ b/tests/test_xmlrpc/test_dns_plugin.py
@@ -364,7 +364,7 @@ class test_dns(Declarative):
dict(
- desc='Add A record to %r in zone %r' % (dnszone1, dnsres1),
+ desc='Add A record to %r in zone %r' % (dnsres1, dnszone1),
command=('dnsrecord_add', [dnszone1, dnsres1], {'arecord': u'10.10.0.1'}),
expected={
'value': dnsres1,
@@ -380,7 +380,7 @@ class test_dns(Declarative):
dict(
- desc='Remove A record from %r in zone %r' % (dnszone1, dnsres1),
+ desc='Remove A record from %r in zone %r' % (dnsres1, dnszone1),
command=('dnsrecord_del', [dnszone1, dnsres1], {'arecord': u'127.0.0.1'}),
expected={
'value': dnsres1,
@@ -394,6 +394,50 @@ class test_dns(Declarative):
dict(
+ desc='Add AAAA record to %r in zone %r using dnsrecord_mod' % (dnsres1, dnszone1),
+ command=('dnsrecord_mod', [dnszone1, dnsres1], {'aaaarecord': u'::1'}),
+ expected={
+ 'value': dnsres1,
+ 'summary': None,
+ 'result': {
+ 'idnsname': [dnsres1],
+ 'arecord': [u'10.10.0.1'],
+ 'aaaarecord': [u'::1'],
+ },
+ },
+ ),
+
+
+ dict(
+ desc='Modify AAAA record in %r in zone %r' % (dnsres1, dnszone1),
+ command=('dnsrecord_mod', [dnszone1, dnsres1], {'aaaarecord': u'ff02::1'}),
+ expected={
+ 'value': dnsres1,
+ 'summary': None,
+ 'result': {
+ 'idnsname': [dnsres1],
+ 'arecord': [u'10.10.0.1'],
+ 'aaaarecord': [u'ff02::1'],
+ },
+ },
+ ),
+
+
+ dict(
+ desc='Remove AAAA record from %r in zone %r using dnsrecord_mod' % (dnsres1, dnszone1),
+ command=('dnsrecord_mod', [dnszone1, dnsres1], {'aaaarecord': u''}),
+ expected={
+ 'value': dnsres1,
+ 'summary': None,
+ 'result': {
+ 'idnsname': [dnsres1],
+ 'arecord': [u'10.10.0.1'],
+ },
+ },
+ ),
+
+
+ dict(
desc='Delete record %r in zone %r' % (dnsres1, dnszone1),
command=('dnsrecord_del', [dnszone1, dnsres1], {'del_all': True }),
expected={