summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit/network
diff options
context:
space:
mode:
authorPierre Hanselmann <pierre.hanselmann@gmail.com>2017-10-31 15:35:10 +0100
committerJens Harbott <j.harbott@x-ion.de>2018-04-23 08:37:27 +0000
commitb8754e15e7adc9a04587f67c83febaf49b64f18c (patch)
treedab7a03949dbfa5601639e677dbd580a23a3eb1a /openstackclient/tests/unit/network
parentb59de7b8494ddbde3570780214378cdb2208c482 (diff)
downloadpython-openstackclient-b8754e15e7adc9a04587f67c83febaf49b64f18c.tar.gz
Add dns-domain support to Network object
Add "dns-domain" parameter to Network class. Also check backend extensions and send an error message in case of an argument (like dns-domain) is sent and the extension is missing (dns-integration in this case). Change-Id: I7303658c27d9b9f2d8381ccea0b29e96909cab54 Closes-Bug: 1633214 Partial-Bug: 1547736
Diffstat (limited to 'openstackclient/tests/unit/network')
-rw-r--r--openstackclient/tests/unit/network/v2/fakes.py1
-rw-r--r--openstackclient/tests/unit/network/v2/test_network.py12
2 files changed, 13 insertions, 0 deletions
diff --git a/openstackclient/tests/unit/network/v2/fakes.py b/openstackclient/tests/unit/network/v2/fakes.py
index 0e21e2f8..85688b1f 100644
--- a/openstackclient/tests/unit/network/v2/fakes.py
+++ b/openstackclient/tests/unit/network/v2/fakes.py
@@ -335,6 +335,7 @@ class FakeNetwork(object):
'name': 'network-name-' + uuid.uuid4().hex,
'status': 'ACTIVE',
'description': 'network-description-' + uuid.uuid4().hex,
+ 'dns_domain': 'example.org.',
'mtu': '1350',
'tenant_id': 'project-id-' + uuid.uuid4().hex,
'admin_state_up': True,
diff --git a/openstackclient/tests/unit/network/v2/test_network.py b/openstackclient/tests/unit/network/v2/test_network.py
index 9f4a6acc..0f57f0ee 100644
--- a/openstackclient/tests/unit/network/v2/test_network.py
+++ b/openstackclient/tests/unit/network/v2/test_network.py
@@ -60,6 +60,7 @@ class TestCreateNetworkIdentityV3(TestNetwork):
'availability_zone_hints',
'availability_zones',
'description',
+ 'dns_domain',
'id',
'ipv4_address_scope',
'ipv6_address_scope',
@@ -84,6 +85,7 @@ class TestCreateNetworkIdentityV3(TestNetwork):
utils.format_list(_network.availability_zone_hints),
utils.format_list(_network.availability_zones),
_network.description,
+ _network.dns_domain,
_network.id,
_network.ipv4_address_scope_id,
_network.ipv6_address_scope_id,
@@ -162,6 +164,7 @@ class TestCreateNetworkIdentityV3(TestNetwork):
"--qos-policy", self.qos_policy.id,
"--transparent-vlan",
"--enable-port-security",
+ "--dns-domain", "example.org.",
self._network.name,
]
verifylist = [
@@ -181,6 +184,7 @@ class TestCreateNetworkIdentityV3(TestNetwork):
('transparent_vlan', True),
('enable_port_security', True),
('name', self._network.name),
+ ('dns_domain', 'example.org.'),
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
@@ -204,6 +208,7 @@ class TestCreateNetworkIdentityV3(TestNetwork):
'qos_policy_id': self.qos_policy.id,
'vlan_transparent': True,
'port_security_enabled': True,
+ 'dns_domain': 'example.org.',
})
self.assertEqual(self.columns, columns)
self.assertEqual(self.data, data)
@@ -287,6 +292,7 @@ class TestCreateNetworkIdentityV2(TestNetwork):
'availability_zone_hints',
'availability_zones',
'description',
+ 'dns_domain',
'id',
'ipv4_address_scope',
'ipv6_address_scope',
@@ -311,6 +317,7 @@ class TestCreateNetworkIdentityV2(TestNetwork):
utils.format_list(_network.availability_zone_hints),
utils.format_list(_network.availability_zones),
_network.description,
+ _network.dns_domain,
_network.id,
_network.ipv4_address_scope_id,
_network.ipv6_address_scope_id,
@@ -901,6 +908,7 @@ class TestSetNetwork(TestNetwork):
'--name', 'noob',
'--share',
'--description', self._network.description,
+ '--dns-domain', 'example.org.',
'--external',
'--default',
'--provider-network-type', 'vlan',
@@ -922,6 +930,7 @@ class TestSetNetwork(TestNetwork):
('segmentation_id', '400'),
('enable_port_security', True),
('qos_policy', self.qos_policy.name),
+ ('dns_domain', 'example.org.'),
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
@@ -939,6 +948,7 @@ class TestSetNetwork(TestNetwork):
'provider:segmentation_id': '400',
'port_security_enabled': True,
'qos_policy_id': self.qos_policy.id,
+ 'dns_domain': 'example.org.',
}
self.network.update_network.assert_called_once_with(
self._network, **attrs)
@@ -1026,6 +1036,7 @@ class TestShowNetwork(TestNetwork):
'availability_zone_hints',
'availability_zones',
'description',
+ 'dns_domain',
'id',
'ipv4_address_scope',
'ipv6_address_scope',
@@ -1050,6 +1061,7 @@ class TestShowNetwork(TestNetwork):
utils.format_list(_network.availability_zone_hints),
utils.format_list(_network.availability_zones),
_network.description,
+ _network.dns_domain,
_network.id,
_network.ipv4_address_scope_id,
_network.ipv6_address_scope_id,