python-openstackclient 8.0.0__py3-none-any.whl → 8.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openstackclient/compute/client.py +5 -0
- openstackclient/compute/v2/console.py +7 -0
- openstackclient/compute/v2/console_connection.py +48 -0
- openstackclient/compute/v2/keypair.py +10 -3
- openstackclient/compute/v2/server.py +75 -10
- openstackclient/compute/v2/server_event.py +1 -1
- openstackclient/identity/common.py +79 -0
- openstackclient/identity/v3/application_credential.py +2 -2
- openstackclient/identity/v3/domain.py +62 -43
- openstackclient/identity/v3/group.py +113 -68
- openstackclient/identity/v3/project.py +17 -0
- openstackclient/identity/v3/user.py +38 -5
- openstackclient/image/client.py +5 -0
- openstackclient/image/v2/image.py +11 -11
- openstackclient/network/client.py +0 -6
- openstackclient/network/v2/floating_ip.py +58 -29
- openstackclient/network/v2/network_qos_rule.py +3 -11
- openstackclient/network/v2/router.py +1 -1
- openstackclient/network/v2/security_group.py +5 -4
- openstackclient/network/v2/security_group_rule.py +1 -1
- openstackclient/shell.py +1 -1
- openstackclient/tests/functional/base.py +5 -1
- openstackclient/tests/functional/compute/v2/test_keypair.py +41 -5
- openstackclient/tests/unit/compute/v2/fakes.py +81 -305
- openstackclient/tests/unit/compute/v2/test_console.py +18 -1
- openstackclient/tests/unit/compute/v2/test_console_connection.py +72 -0
- openstackclient/tests/unit/compute/v2/test_flavor.py +1 -1
- openstackclient/tests/unit/compute/v2/test_keypair.py +12 -5
- openstackclient/tests/unit/compute/v2/test_server.py +169 -46
- openstackclient/tests/unit/compute/v2/test_server_backup.py +32 -71
- openstackclient/tests/unit/compute/v2/test_server_event.py +2 -2
- openstackclient/tests/unit/compute/v2/test_server_image.py +33 -72
- openstackclient/tests/unit/compute/v2/test_server_migration.py +4 -4
- openstackclient/tests/unit/identity/v3/test_application_credential.py +47 -25
- openstackclient/tests/unit/identity/v3/test_domain.py +115 -105
- openstackclient/tests/unit/identity/v3/test_group.py +353 -202
- openstackclient/tests/unit/identity/v3/test_project.py +16 -0
- openstackclient/tests/unit/identity/v3/test_user.py +86 -6
- openstackclient/tests/unit/image/v1/test_image.py +8 -9
- openstackclient/tests/unit/image/v2/test_image.py +49 -49
- openstackclient/tests/unit/network/v2/fakes.py +405 -485
- openstackclient/tests/unit/network/v2/test_floating_ip_network.py +13 -19
- openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py +2 -2
- openstackclient/tests/unit/network/v2/test_ndp_proxy.py +1 -3
- openstackclient/tests/unit/network/v2/test_network.py +4 -4
- openstackclient/tests/unit/network/v2/test_network_agent.py +15 -29
- openstackclient/tests/unit/network/v2/test_network_qos_policy.py +16 -19
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +79 -152
- openstackclient/tests/unit/network/v2/test_network_qos_rule_type.py +4 -6
- openstackclient/tests/unit/network/v2/test_network_rbac.py +2 -2
- openstackclient/tests/unit/network/v2/test_port.py +17 -17
- openstackclient/tests/unit/network/v2/test_router.py +73 -57
- openstackclient/tests/unit/network/v2/test_security_group_network.py +25 -27
- openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +1 -3
- openstackclient/tests/unit/network/v2/test_security_group_rule_network.py +33 -39
- openstackclient/tests/unit/volume/v2/fakes.py +1 -2
- openstackclient/tests/unit/volume/v2/test_service.py +57 -91
- openstackclient/tests/unit/volume/v2/test_volume.py +108 -105
- openstackclient/tests/unit/volume/v2/test_volume_backup.py +141 -148
- openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +293 -283
- openstackclient/tests/unit/volume/v3/test_block_storage_log_level.py +61 -71
- openstackclient/tests/unit/volume/v3/test_service.py +221 -141
- openstackclient/tests/unit/volume/v3/test_volume.py +130 -119
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +1 -1
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +198 -203
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +682 -47
- openstackclient/volume/v2/service.py +41 -38
- openstackclient/volume/v2/volume.py +63 -37
- openstackclient/volume/v2/volume_backup.py +9 -3
- openstackclient/volume/v2/volume_snapshot.py +121 -84
- openstackclient/volume/v3/block_storage_log_level.py +22 -28
- openstackclient/volume/v3/service.py +105 -14
- openstackclient/volume/v3/volume.py +200 -39
- openstackclient/volume/v3/volume_backup.py +24 -19
- openstackclient/volume/v3/volume_snapshot.py +485 -10
- {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/AUTHORS +8 -0
- python_openstackclient-8.1.0.dist-info/METADATA +264 -0
- {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/RECORD +83 -81
- {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/entry_points.txt +7 -6
- python_openstackclient-8.1.0.dist-info/pbr.json +1 -0
- python_openstackclient-8.0.0.dist-info/METADATA +0 -166
- python_openstackclient-8.0.0.dist-info/pbr.json +0 -1
- {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/LICENSE +0 -0
- {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/WHEEL +0 -0
- {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/top_level.txt +0 -0
|
@@ -320,7 +320,7 @@ class TestCreatePort(TestPort):
|
|
|
320
320
|
self.assertCountEqual(self.data, data)
|
|
321
321
|
|
|
322
322
|
def test_create_with_security_group(self):
|
|
323
|
-
secgroup = network_fakes.
|
|
323
|
+
secgroup = network_fakes.create_one_security_group()
|
|
324
324
|
self.network_client.find_security_group = mock.Mock(
|
|
325
325
|
return_value=secgroup
|
|
326
326
|
)
|
|
@@ -391,8 +391,8 @@ class TestCreatePort(TestPort):
|
|
|
391
391
|
self.assertCountEqual(self.data, data)
|
|
392
392
|
|
|
393
393
|
def test_create_with_security_groups(self):
|
|
394
|
-
sg_1 = network_fakes.
|
|
395
|
-
sg_2 = network_fakes.
|
|
394
|
+
sg_1 = network_fakes.create_one_security_group()
|
|
395
|
+
sg_2 = network_fakes.create_one_security_group()
|
|
396
396
|
self.network_client.find_security_group = mock.Mock(
|
|
397
397
|
side_effect=[sg_1, sg_2]
|
|
398
398
|
)
|
|
@@ -582,7 +582,7 @@ class TestCreatePort(TestPort):
|
|
|
582
582
|
self.assertCountEqual(self.data, data)
|
|
583
583
|
|
|
584
584
|
def test_create_port_with_qos(self):
|
|
585
|
-
qos_policy = network_fakes.
|
|
585
|
+
qos_policy = network_fakes.create_one_qos_policy()
|
|
586
586
|
self.network_client.find_qos_policy = mock.Mock(
|
|
587
587
|
return_value=qos_policy
|
|
588
588
|
)
|
|
@@ -1325,7 +1325,7 @@ class TestListPort(compute_fakes.FakeClientMixin, TestPort):
|
|
|
1325
1325
|
super().setUp()
|
|
1326
1326
|
|
|
1327
1327
|
self.network_client.ports = mock.Mock(return_value=self._ports)
|
|
1328
|
-
fake_router = network_fakes.
|
|
1328
|
+
fake_router = network_fakes.create_one_router(
|
|
1329
1329
|
{
|
|
1330
1330
|
'id': 'fake-router-id',
|
|
1331
1331
|
}
|
|
@@ -1377,7 +1377,7 @@ class TestListPort(compute_fakes.FakeClientMixin, TestPort):
|
|
|
1377
1377
|
self.assertCountEqual(self.data, list(data))
|
|
1378
1378
|
|
|
1379
1379
|
def test_port_list_with_server_option(self):
|
|
1380
|
-
fake_server = compute_fakes.
|
|
1380
|
+
fake_server = compute_fakes.create_one_server()
|
|
1381
1381
|
self.compute_client.find_server.return_value = fake_server
|
|
1382
1382
|
|
|
1383
1383
|
arglist = [
|
|
@@ -2096,7 +2096,7 @@ class TestSetPort(TestPort):
|
|
|
2096
2096
|
self.assertIsNone(result)
|
|
2097
2097
|
|
|
2098
2098
|
def test_set_port_security_group(self):
|
|
2099
|
-
sg = network_fakes.
|
|
2099
|
+
sg = network_fakes.create_one_security_group()
|
|
2100
2100
|
self.network_client.find_security_group = mock.Mock(return_value=sg)
|
|
2101
2101
|
arglist = [
|
|
2102
2102
|
'--security-group',
|
|
@@ -2119,9 +2119,9 @@ class TestSetPort(TestPort):
|
|
|
2119
2119
|
self.assertIsNone(result)
|
|
2120
2120
|
|
|
2121
2121
|
def test_set_port_security_group_append(self):
|
|
2122
|
-
sg_1 = network_fakes.
|
|
2123
|
-
sg_2 = network_fakes.
|
|
2124
|
-
sg_3 = network_fakes.
|
|
2122
|
+
sg_1 = network_fakes.create_one_security_group()
|
|
2123
|
+
sg_2 = network_fakes.create_one_security_group()
|
|
2124
|
+
sg_3 = network_fakes.create_one_security_group()
|
|
2125
2125
|
self.network_client.find_security_group = mock.Mock(
|
|
2126
2126
|
side_effect=[sg_2, sg_3]
|
|
2127
2127
|
)
|
|
@@ -2172,8 +2172,8 @@ class TestSetPort(TestPort):
|
|
|
2172
2172
|
self.assertIsNone(result)
|
|
2173
2173
|
|
|
2174
2174
|
def test_set_port_security_group_replace(self):
|
|
2175
|
-
sg1 = network_fakes.
|
|
2176
|
-
sg2 = network_fakes.
|
|
2175
|
+
sg1 = network_fakes.create_one_security_group()
|
|
2176
|
+
sg2 = network_fakes.create_one_security_group()
|
|
2177
2177
|
_testport = network_fakes.create_one_port(
|
|
2178
2178
|
{'security_group_ids': [sg1.id]}
|
|
2179
2179
|
)
|
|
@@ -2371,7 +2371,7 @@ class TestSetPort(TestPort):
|
|
|
2371
2371
|
)
|
|
2372
2372
|
|
|
2373
2373
|
def test_set_port_with_qos(self):
|
|
2374
|
-
qos_policy = network_fakes.
|
|
2374
|
+
qos_policy = network_fakes.create_one_qos_policy()
|
|
2375
2375
|
self.network_client.find_qos_policy = mock.Mock(
|
|
2376
2376
|
return_value=qos_policy
|
|
2377
2377
|
)
|
|
@@ -2821,8 +2821,8 @@ class TestUnsetPort(TestPort):
|
|
|
2821
2821
|
)
|
|
2822
2822
|
|
|
2823
2823
|
def test_unset_security_group(self):
|
|
2824
|
-
_fake_sg1 = network_fakes.
|
|
2825
|
-
_fake_sg2 = network_fakes.
|
|
2824
|
+
_fake_sg1 = network_fakes.create_one_security_group()
|
|
2825
|
+
_fake_sg2 = network_fakes.create_one_security_group()
|
|
2826
2826
|
_fake_port = network_fakes.create_one_port(
|
|
2827
2827
|
{'security_group_ids': [_fake_sg1.id, _fake_sg2.id]}
|
|
2828
2828
|
)
|
|
@@ -2849,8 +2849,8 @@ class TestUnsetPort(TestPort):
|
|
|
2849
2849
|
self.assertIsNone(result)
|
|
2850
2850
|
|
|
2851
2851
|
def test_unset_port_security_group_not_existent(self):
|
|
2852
|
-
_fake_sg1 = network_fakes.
|
|
2853
|
-
_fake_sg2 = network_fakes.
|
|
2852
|
+
_fake_sg1 = network_fakes.create_one_security_group()
|
|
2853
|
+
_fake_sg2 = network_fakes.create_one_security_group()
|
|
2854
2854
|
_fake_port = network_fakes.create_one_port(
|
|
2855
2855
|
{'security_group_ids': [_fake_sg1.id]}
|
|
2856
2856
|
)
|
|
@@ -34,9 +34,7 @@ class TestAddPortToRouter(TestRouter):
|
|
|
34
34
|
'''Add port to Router'''
|
|
35
35
|
|
|
36
36
|
_port = network_fakes.create_one_port()
|
|
37
|
-
_router = network_fakes.
|
|
38
|
-
attrs={'port': _port.id}
|
|
39
|
-
)
|
|
37
|
+
_router = network_fakes.create_one_router(attrs={'port': _port.id})
|
|
40
38
|
|
|
41
39
|
def setUp(self):
|
|
42
40
|
super().setUp()
|
|
@@ -84,9 +82,7 @@ class TestAddSubnetToRouter(TestRouter):
|
|
|
84
82
|
'''Add subnet to Router'''
|
|
85
83
|
|
|
86
84
|
_subnet = network_fakes.FakeSubnet.create_one_subnet()
|
|
87
|
-
_router = network_fakes.
|
|
88
|
-
attrs={'subnet': _subnet.id}
|
|
89
|
-
)
|
|
85
|
+
_router = network_fakes.create_one_router(attrs={'subnet': _subnet.id})
|
|
90
86
|
|
|
91
87
|
def setUp(self):
|
|
92
88
|
super().setUp()
|
|
@@ -129,38 +125,48 @@ class TestAddSubnetToRouter(TestRouter):
|
|
|
129
125
|
|
|
130
126
|
class TestCreateRouter(TestRouter):
|
|
131
127
|
# The new router created.
|
|
132
|
-
new_router = network_fakes.
|
|
128
|
+
new_router = network_fakes.create_one_router()
|
|
133
129
|
_extensions = {'fake': network_fakes.create_one_extension()}
|
|
134
130
|
|
|
135
131
|
columns = (
|
|
136
132
|
'admin_state_up',
|
|
137
133
|
'availability_zone_hints',
|
|
138
134
|
'availability_zones',
|
|
135
|
+
'created_at',
|
|
139
136
|
'description',
|
|
140
137
|
'distributed',
|
|
138
|
+
'enable_ndp_proxy',
|
|
141
139
|
'external_gateway_info',
|
|
140
|
+
'flavor_id',
|
|
142
141
|
'ha',
|
|
143
142
|
'id',
|
|
144
143
|
'name',
|
|
145
144
|
'project_id',
|
|
145
|
+
'revision_number',
|
|
146
146
|
'routes',
|
|
147
147
|
'status',
|
|
148
148
|
'tags',
|
|
149
|
+
'updated_at',
|
|
149
150
|
)
|
|
150
151
|
data = (
|
|
151
|
-
router.AdminStateColumn(new_router.
|
|
152
|
+
router.AdminStateColumn(new_router.is_admin_state_up),
|
|
152
153
|
format_columns.ListColumn(new_router.availability_zone_hints),
|
|
153
154
|
format_columns.ListColumn(new_router.availability_zones),
|
|
155
|
+
new_router.created_at,
|
|
154
156
|
new_router.description,
|
|
155
|
-
new_router.
|
|
157
|
+
new_router.is_distributed,
|
|
158
|
+
new_router.enable_ndp_proxy,
|
|
156
159
|
router.RouterInfoColumn(new_router.external_gateway_info),
|
|
157
|
-
new_router.
|
|
160
|
+
new_router.flavor_id,
|
|
161
|
+
new_router.is_ha,
|
|
158
162
|
new_router.id,
|
|
159
163
|
new_router.name,
|
|
160
164
|
new_router.project_id,
|
|
165
|
+
new_router.revision_number,
|
|
161
166
|
router.RoutesColumn(new_router.routes),
|
|
162
167
|
new_router.status,
|
|
163
168
|
format_columns.ListColumn(new_router.tags),
|
|
169
|
+
new_router.updated_at,
|
|
164
170
|
)
|
|
165
171
|
|
|
166
172
|
def setUp(self):
|
|
@@ -555,9 +561,7 @@ class TestCreateRouter(TestRouter):
|
|
|
555
561
|
def test_create_with_qos_policy(self):
|
|
556
562
|
_network = network_fakes.create_one_network()
|
|
557
563
|
self.network_client.find_network = mock.Mock(return_value=_network)
|
|
558
|
-
_qos_policy = (
|
|
559
|
-
network_fakes.FakeNetworkQosPolicy.create_one_qos_policy()
|
|
560
|
-
)
|
|
564
|
+
_qos_policy = network_fakes.create_one_qos_policy()
|
|
561
565
|
self.network_client.find_qos_policy = mock.Mock(
|
|
562
566
|
return_value=_qos_policy
|
|
563
567
|
)
|
|
@@ -590,9 +594,7 @@ class TestCreateRouter(TestRouter):
|
|
|
590
594
|
self.assertCountEqual(self.data, data)
|
|
591
595
|
|
|
592
596
|
def test_create_with_qos_policy_no_external_gateway(self):
|
|
593
|
-
_qos_policy = (
|
|
594
|
-
network_fakes.FakeNetworkQosPolicy.create_one_qos_policy()
|
|
595
|
-
)
|
|
597
|
+
_qos_policy = network_fakes.create_one_qos_policy()
|
|
596
598
|
self.network_client.find_qos_policy = mock.Mock(
|
|
597
599
|
return_value=_qos_policy
|
|
598
600
|
)
|
|
@@ -618,14 +620,14 @@ class TestCreateRouter(TestRouter):
|
|
|
618
620
|
|
|
619
621
|
class TestDeleteRouter(TestRouter):
|
|
620
622
|
# The routers to delete.
|
|
621
|
-
_routers = network_fakes.
|
|
623
|
+
_routers = network_fakes.create_routers(count=2)
|
|
622
624
|
|
|
623
625
|
def setUp(self):
|
|
624
626
|
super().setUp()
|
|
625
627
|
|
|
626
628
|
self.network_client.delete_router = mock.Mock(return_value=None)
|
|
627
629
|
|
|
628
|
-
self.network_client.find_router = network_fakes.
|
|
630
|
+
self.network_client.find_router = network_fakes.get_routers(
|
|
629
631
|
self._routers
|
|
630
632
|
)
|
|
631
633
|
|
|
@@ -700,7 +702,7 @@ class TestDeleteRouter(TestRouter):
|
|
|
700
702
|
|
|
701
703
|
class TestListRouter(TestRouter):
|
|
702
704
|
# The routers going to be listed up.
|
|
703
|
-
routers = network_fakes.
|
|
705
|
+
routers = network_fakes.create_routers(count=3)
|
|
704
706
|
extensions = network_fakes.create_one_extension()
|
|
705
707
|
|
|
706
708
|
columns = (
|
|
@@ -731,10 +733,10 @@ class TestListRouter(TestRouter):
|
|
|
731
733
|
r.id,
|
|
732
734
|
r.name,
|
|
733
735
|
r.status,
|
|
734
|
-
router.AdminStateColumn(r.
|
|
736
|
+
router.AdminStateColumn(r.is_admin_state_up),
|
|
735
737
|
r.project_id,
|
|
736
|
-
r.
|
|
737
|
-
r.
|
|
738
|
+
r.is_distributed,
|
|
739
|
+
r.is_ha,
|
|
738
740
|
)
|
|
739
741
|
)
|
|
740
742
|
|
|
@@ -817,7 +819,7 @@ class TestListRouter(TestRouter):
|
|
|
817
819
|
self.assertCountEqual(self.data, list(data))
|
|
818
820
|
|
|
819
821
|
def test_router_list_no_ha_no_distributed(self):
|
|
820
|
-
_routers = network_fakes.
|
|
822
|
+
_routers = network_fakes.create_routers(
|
|
821
823
|
{'ha': None, 'distributed': None}, count=3
|
|
822
824
|
)
|
|
823
825
|
|
|
@@ -1037,9 +1039,7 @@ class TestRemovePortFromRouter(TestRouter):
|
|
|
1037
1039
|
'''Remove port from a Router'''
|
|
1038
1040
|
|
|
1039
1041
|
_port = network_fakes.create_one_port()
|
|
1040
|
-
_router = network_fakes.
|
|
1041
|
-
attrs={'port': _port.id}
|
|
1042
|
-
)
|
|
1042
|
+
_router = network_fakes.create_one_router(attrs={'port': _port.id})
|
|
1043
1043
|
|
|
1044
1044
|
def setUp(self):
|
|
1045
1045
|
super().setUp()
|
|
@@ -1084,9 +1084,7 @@ class TestRemoveSubnetFromRouter(TestRouter):
|
|
|
1084
1084
|
'''Remove subnet from Router'''
|
|
1085
1085
|
|
|
1086
1086
|
_subnet = network_fakes.FakeSubnet.create_one_subnet()
|
|
1087
|
-
_router = network_fakes.
|
|
1088
|
-
attrs={'subnet': _subnet.id}
|
|
1089
|
-
)
|
|
1087
|
+
_router = network_fakes.create_one_router(attrs={'subnet': _subnet.id})
|
|
1090
1088
|
|
|
1091
1089
|
def setUp(self):
|
|
1092
1090
|
super().setUp()
|
|
@@ -1127,7 +1125,7 @@ class TestRemoveSubnetFromRouter(TestRouter):
|
|
|
1127
1125
|
|
|
1128
1126
|
|
|
1129
1127
|
class TestAddExtraRoutesToRouter(TestRouter):
|
|
1130
|
-
_router = network_fakes.
|
|
1128
|
+
_router = network_fakes.create_one_router()
|
|
1131
1129
|
|
|
1132
1130
|
def setUp(self):
|
|
1133
1131
|
super().setUp()
|
|
@@ -1216,7 +1214,7 @@ class TestAddExtraRoutesToRouter(TestRouter):
|
|
|
1216
1214
|
|
|
1217
1215
|
|
|
1218
1216
|
class TestRemoveExtraRoutesFromRouter(TestRouter):
|
|
1219
|
-
_router = network_fakes.
|
|
1217
|
+
_router = network_fakes.create_one_router()
|
|
1220
1218
|
|
|
1221
1219
|
def setUp(self):
|
|
1222
1220
|
super().setUp()
|
|
@@ -1311,7 +1309,7 @@ class TestSetRouter(TestRouter):
|
|
|
1311
1309
|
_subnet = network_fakes.FakeSubnet.create_one_subnet(
|
|
1312
1310
|
attrs={'network_id': _network.id}
|
|
1313
1311
|
)
|
|
1314
|
-
_router = network_fakes.
|
|
1312
|
+
_router = network_fakes.create_one_router(
|
|
1315
1313
|
attrs={'routes': [_default_route], 'tags': ['green', 'red']}
|
|
1316
1314
|
)
|
|
1317
1315
|
_extensions = {'fake': network_fakes.create_one_extension()}
|
|
@@ -1458,7 +1456,7 @@ class TestSetRouter(TestRouter):
|
|
|
1458
1456
|
self.assertIsNone(result)
|
|
1459
1457
|
|
|
1460
1458
|
def test_set_route_overwrite_route(self):
|
|
1461
|
-
_testrouter = network_fakes.
|
|
1459
|
+
_testrouter = network_fakes.create_one_router(
|
|
1462
1460
|
{'routes': [{"destination": "10.0.0.2", "nexthop": "1.1.1.1"}]}
|
|
1463
1461
|
)
|
|
1464
1462
|
self.network_client.find_router = mock.Mock(return_value=_testrouter)
|
|
@@ -1668,7 +1666,7 @@ class TestSetRouter(TestRouter):
|
|
|
1668
1666
|
self._test_set_tags(with_tags=False)
|
|
1669
1667
|
|
|
1670
1668
|
def test_set_gateway_ip_qos(self):
|
|
1671
|
-
qos_policy = network_fakes.
|
|
1669
|
+
qos_policy = network_fakes.create_one_qos_policy()
|
|
1672
1670
|
self.network_client.find_qos_policy = mock.Mock(
|
|
1673
1671
|
return_value=qos_policy
|
|
1674
1672
|
)
|
|
@@ -1725,7 +1723,7 @@ class TestSetRouter(TestRouter):
|
|
|
1725
1723
|
self.assertIsNone(result)
|
|
1726
1724
|
|
|
1727
1725
|
def test_set_unset_gateway_ip_qos(self):
|
|
1728
|
-
qos_policy = network_fakes.
|
|
1726
|
+
qos_policy = network_fakes.create_one_qos_policy()
|
|
1729
1727
|
self.network_client.find_qos_policy = mock.Mock(
|
|
1730
1728
|
return_value=qos_policy
|
|
1731
1729
|
)
|
|
@@ -1753,11 +1751,11 @@ class TestSetRouter(TestRouter):
|
|
|
1753
1751
|
)
|
|
1754
1752
|
|
|
1755
1753
|
def test_set_gateway_ip_qos_no_gateway(self):
|
|
1756
|
-
qos_policy = network_fakes.
|
|
1754
|
+
qos_policy = network_fakes.create_one_qos_policy()
|
|
1757
1755
|
self.network_client.find_qos_policy = mock.Mock(
|
|
1758
1756
|
return_value=qos_policy
|
|
1759
1757
|
)
|
|
1760
|
-
router = network_fakes.
|
|
1758
|
+
router = network_fakes.create_one_router()
|
|
1761
1759
|
self.network_client.find_router = mock.Mock(return_value=router)
|
|
1762
1760
|
arglist = [
|
|
1763
1761
|
"--qos-policy",
|
|
@@ -1775,11 +1773,11 @@ class TestSetRouter(TestRouter):
|
|
|
1775
1773
|
)
|
|
1776
1774
|
|
|
1777
1775
|
def test_unset_gateway_ip_qos_no_gateway(self):
|
|
1778
|
-
qos_policy = network_fakes.
|
|
1776
|
+
qos_policy = network_fakes.create_one_qos_policy()
|
|
1779
1777
|
self.network_client.find_qos_policy = mock.Mock(
|
|
1780
1778
|
return_value=qos_policy
|
|
1781
1779
|
)
|
|
1782
|
-
router = network_fakes.
|
|
1780
|
+
router = network_fakes.create_one_router()
|
|
1783
1781
|
self.network_client.find_router = mock.Mock(return_value=router)
|
|
1784
1782
|
arglist = [
|
|
1785
1783
|
"--no-qos-policy",
|
|
@@ -1797,7 +1795,7 @@ class TestSetRouter(TestRouter):
|
|
|
1797
1795
|
|
|
1798
1796
|
class TestShowRouter(TestRouter):
|
|
1799
1797
|
# The router to set.
|
|
1800
|
-
_router = network_fakes.
|
|
1798
|
+
_router = network_fakes.create_one_router()
|
|
1801
1799
|
_port = network_fakes.create_one_port(
|
|
1802
1800
|
{'device_owner': 'network:router_interface', 'device_id': _router.id}
|
|
1803
1801
|
)
|
|
@@ -1817,33 +1815,43 @@ class TestShowRouter(TestRouter):
|
|
|
1817
1815
|
'admin_state_up',
|
|
1818
1816
|
'availability_zone_hints',
|
|
1819
1817
|
'availability_zones',
|
|
1818
|
+
'created_at',
|
|
1820
1819
|
'description',
|
|
1821
1820
|
'distributed',
|
|
1821
|
+
'enable_ndp_proxy',
|
|
1822
1822
|
'external_gateway_info',
|
|
1823
|
+
'flavor_id',
|
|
1823
1824
|
'ha',
|
|
1824
1825
|
'id',
|
|
1825
1826
|
'interfaces_info',
|
|
1826
1827
|
'name',
|
|
1827
1828
|
'project_id',
|
|
1829
|
+
'revision_number',
|
|
1828
1830
|
'routes',
|
|
1829
1831
|
'status',
|
|
1830
1832
|
'tags',
|
|
1833
|
+
'updated_at',
|
|
1831
1834
|
)
|
|
1832
1835
|
data = (
|
|
1833
|
-
router.AdminStateColumn(_router.
|
|
1836
|
+
router.AdminStateColumn(_router.is_admin_state_up),
|
|
1834
1837
|
format_columns.ListColumn(_router.availability_zone_hints),
|
|
1835
1838
|
format_columns.ListColumn(_router.availability_zones),
|
|
1839
|
+
_router.created_at,
|
|
1836
1840
|
_router.description,
|
|
1837
|
-
_router.
|
|
1841
|
+
_router.is_distributed,
|
|
1842
|
+
_router.enable_ndp_proxy,
|
|
1838
1843
|
router.RouterInfoColumn(_router.external_gateway_info),
|
|
1839
|
-
_router.
|
|
1844
|
+
_router.flavor_id,
|
|
1845
|
+
_router.is_ha,
|
|
1840
1846
|
_router.id,
|
|
1841
1847
|
router.RouterInfoColumn(_router.interfaces_info),
|
|
1842
1848
|
_router.name,
|
|
1843
1849
|
_router.project_id,
|
|
1850
|
+
_router.revision_number,
|
|
1844
1851
|
router.RoutesColumn(_router.routes),
|
|
1845
1852
|
_router.status,
|
|
1846
1853
|
format_columns.ListColumn(_router.tags),
|
|
1854
|
+
_router.updated_at,
|
|
1847
1855
|
)
|
|
1848
1856
|
|
|
1849
1857
|
def setUp(self):
|
|
@@ -1888,7 +1896,7 @@ class TestShowRouter(TestRouter):
|
|
|
1888
1896
|
self.assertCountEqual(self.data, data)
|
|
1889
1897
|
|
|
1890
1898
|
def test_show_no_ha_no_distributed(self):
|
|
1891
|
-
_router = network_fakes.
|
|
1899
|
+
_router = network_fakes.create_one_router(
|
|
1892
1900
|
{'ha': None, 'distributed': None}
|
|
1893
1901
|
)
|
|
1894
1902
|
|
|
@@ -1909,7 +1917,7 @@ class TestShowRouter(TestRouter):
|
|
|
1909
1917
|
self.assertNotIn("is_ha", columns)
|
|
1910
1918
|
|
|
1911
1919
|
def test_show_no_extra_route_extension(self):
|
|
1912
|
-
_router = network_fakes.
|
|
1920
|
+
_router = network_fakes.create_one_router({'routes': None})
|
|
1913
1921
|
|
|
1914
1922
|
arglist = [
|
|
1915
1923
|
_router.name,
|
|
@@ -1932,10 +1940,8 @@ class TestUnsetRouter(TestRouter):
|
|
|
1932
1940
|
def setUp(self):
|
|
1933
1941
|
super().setUp()
|
|
1934
1942
|
self.fake_network = network_fakes.create_one_network()
|
|
1935
|
-
self.fake_qos_policy = (
|
|
1936
|
-
|
|
1937
|
-
)
|
|
1938
|
-
self._testrouter = network_fakes.FakeRouter.create_one_router(
|
|
1943
|
+
self.fake_qos_policy = network_fakes.create_one_qos_policy()
|
|
1944
|
+
self._testrouter = network_fakes.create_one_router(
|
|
1939
1945
|
{
|
|
1940
1946
|
'routes': [
|
|
1941
1947
|
{
|
|
@@ -2102,11 +2108,11 @@ class TestUnsetRouter(TestRouter):
|
|
|
2102
2108
|
self.assertIsNone(result)
|
|
2103
2109
|
|
|
2104
2110
|
def test_unset_gateway_ip_qos_no_network(self):
|
|
2105
|
-
qos_policy = network_fakes.
|
|
2111
|
+
qos_policy = network_fakes.create_one_qos_policy()
|
|
2106
2112
|
self.network_client.find_qos_policy = mock.Mock(
|
|
2107
2113
|
return_value=qos_policy
|
|
2108
2114
|
)
|
|
2109
|
-
router = network_fakes.
|
|
2115
|
+
router = network_fakes.create_one_router()
|
|
2110
2116
|
self.network_client.find_router = mock.Mock(return_value=router)
|
|
2111
2117
|
arglist = [
|
|
2112
2118
|
"--qos-policy",
|
|
@@ -2122,11 +2128,11 @@ class TestUnsetRouter(TestRouter):
|
|
|
2122
2128
|
)
|
|
2123
2129
|
|
|
2124
2130
|
def test_unset_gateway_ip_qos_no_qos(self):
|
|
2125
|
-
qos_policy = network_fakes.
|
|
2131
|
+
qos_policy = network_fakes.create_one_qos_policy()
|
|
2126
2132
|
self.network_client.find_qos_policy = mock.Mock(
|
|
2127
2133
|
return_value=qos_policy
|
|
2128
2134
|
)
|
|
2129
|
-
router = network_fakes.
|
|
2135
|
+
router = network_fakes.create_one_router(
|
|
2130
2136
|
{"external_gateway_info": {"network_id": "fake-id"}}
|
|
2131
2137
|
)
|
|
2132
2138
|
self.network_client.find_router = mock.Mock(return_value=router)
|
|
@@ -2151,7 +2157,7 @@ class TestGatewayOps(TestRouter):
|
|
|
2151
2157
|
self._network = network_fakes.create_one_network()
|
|
2152
2158
|
self._networks.append(self._network)
|
|
2153
2159
|
|
|
2154
|
-
self._router = network_fakes.
|
|
2160
|
+
self._router = network_fakes.create_one_router(
|
|
2155
2161
|
{
|
|
2156
2162
|
'external_gateway_info': {
|
|
2157
2163
|
'network_id': self._network.id,
|
|
@@ -2195,16 +2201,21 @@ class TestCreateMultipleGateways(TestGatewayOps):
|
|
|
2195
2201
|
'admin_state_up',
|
|
2196
2202
|
'availability_zone_hints',
|
|
2197
2203
|
'availability_zones',
|
|
2204
|
+
'created_at',
|
|
2198
2205
|
'description',
|
|
2199
2206
|
'distributed',
|
|
2207
|
+
'enable_ndp_proxy',
|
|
2200
2208
|
'external_gateway_info',
|
|
2209
|
+
'flavor_id',
|
|
2201
2210
|
'ha',
|
|
2202
2211
|
'id',
|
|
2203
2212
|
'name',
|
|
2204
2213
|
'project_id',
|
|
2214
|
+
'revision_number',
|
|
2205
2215
|
'routes',
|
|
2206
2216
|
'status',
|
|
2207
2217
|
'tags',
|
|
2218
|
+
'updated_at',
|
|
2208
2219
|
)
|
|
2209
2220
|
|
|
2210
2221
|
def setUp(self):
|
|
@@ -2221,19 +2232,24 @@ class TestCreateMultipleGateways(TestGatewayOps):
|
|
|
2221
2232
|
)
|
|
2222
2233
|
|
|
2223
2234
|
self._data = (
|
|
2224
|
-
router.AdminStateColumn(self._router.
|
|
2235
|
+
router.AdminStateColumn(self._router.is_admin_state_up),
|
|
2225
2236
|
format_columns.ListColumn(self._router.availability_zone_hints),
|
|
2226
2237
|
format_columns.ListColumn(self._router.availability_zones),
|
|
2238
|
+
self._router.created_at,
|
|
2227
2239
|
self._router.description,
|
|
2228
|
-
self._router.
|
|
2240
|
+
self._router.is_distributed,
|
|
2241
|
+
self._router.enable_ndp_proxy,
|
|
2229
2242
|
router.RouterInfoColumn(self._router.external_gateway_info),
|
|
2230
|
-
self._router.
|
|
2243
|
+
self._router.flavor_id,
|
|
2244
|
+
self._router.is_ha,
|
|
2231
2245
|
self._router.id,
|
|
2232
2246
|
self._router.name,
|
|
2233
2247
|
self._router.project_id,
|
|
2248
|
+
self._router.revision_number,
|
|
2234
2249
|
router.RoutesColumn(self._router.routes),
|
|
2235
2250
|
self._router.status,
|
|
2236
2251
|
format_columns.ListColumn(self._router.tags),
|
|
2252
|
+
self._router.updated_at,
|
|
2237
2253
|
)
|
|
2238
2254
|
self.cmd = router.CreateRouter(self.app, None)
|
|
2239
2255
|
|
|
@@ -36,28 +36,32 @@ class TestCreateSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
|
36
36
|
project = identity_fakes.FakeProject.create_one_project()
|
|
37
37
|
domain = identity_fakes.FakeDomain.create_one_domain()
|
|
38
38
|
# The security group to be created.
|
|
39
|
-
_security_group = (
|
|
40
|
-
network_fakes.FakeSecurityGroup.create_one_security_group()
|
|
41
|
-
)
|
|
39
|
+
_security_group = network_fakes.create_one_security_group()
|
|
42
40
|
|
|
43
41
|
columns = (
|
|
42
|
+
'created_at',
|
|
44
43
|
'description',
|
|
45
44
|
'id',
|
|
46
45
|
'name',
|
|
47
46
|
'project_id',
|
|
47
|
+
'revision_number',
|
|
48
48
|
'rules',
|
|
49
49
|
'stateful',
|
|
50
50
|
'tags',
|
|
51
|
+
'updated_at',
|
|
51
52
|
)
|
|
52
53
|
|
|
53
54
|
data = (
|
|
55
|
+
_security_group.created_at,
|
|
54
56
|
_security_group.description,
|
|
55
57
|
_security_group.id,
|
|
56
58
|
_security_group.name,
|
|
57
59
|
_security_group.project_id,
|
|
60
|
+
_security_group.revision_number,
|
|
58
61
|
security_group.NetworkSecurityGroupRulesColumn([]),
|
|
59
62
|
_security_group.stateful,
|
|
60
63
|
_security_group.tags,
|
|
64
|
+
_security_group.updated_at,
|
|
61
65
|
)
|
|
62
66
|
|
|
63
67
|
def setUp(self):
|
|
@@ -163,7 +167,7 @@ class TestCreateSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
|
163
167
|
else:
|
|
164
168
|
self.assertFalse(self.network_client.set_tags.called)
|
|
165
169
|
self.assertEqual(self.columns, columns)
|
|
166
|
-
self.
|
|
170
|
+
self.assertEqual(self.data, data)
|
|
167
171
|
|
|
168
172
|
def test_create_with_tags(self):
|
|
169
173
|
self._test_create_with_tag(add_tags=True)
|
|
@@ -174,7 +178,7 @@ class TestCreateSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
|
174
178
|
|
|
175
179
|
class TestDeleteSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
176
180
|
# The security groups to be deleted.
|
|
177
|
-
_security_groups = network_fakes.
|
|
181
|
+
_security_groups = network_fakes.create_security_groups()
|
|
178
182
|
|
|
179
183
|
def setUp(self):
|
|
180
184
|
super().setUp()
|
|
@@ -184,9 +188,7 @@ class TestDeleteSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
|
184
188
|
)
|
|
185
189
|
|
|
186
190
|
self.network_client.find_security_group = (
|
|
187
|
-
network_fakes.
|
|
188
|
-
self._security_groups
|
|
189
|
-
)
|
|
191
|
+
network_fakes.get_security_groups(self._security_groups)
|
|
190
192
|
)
|
|
191
193
|
|
|
192
194
|
# Get the command object to test
|
|
@@ -264,9 +266,7 @@ class TestDeleteSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
|
264
266
|
|
|
265
267
|
class TestListSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
266
268
|
# The security group to be listed.
|
|
267
|
-
_security_groups = network_fakes.
|
|
268
|
-
count=3
|
|
269
|
-
)
|
|
269
|
+
_security_groups = network_fakes.create_security_groups(count=3)
|
|
270
270
|
|
|
271
271
|
columns = (
|
|
272
272
|
'ID',
|
|
@@ -412,10 +412,8 @@ class TestListSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
|
412
412
|
|
|
413
413
|
class TestSetSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
414
414
|
# The security group to be set.
|
|
415
|
-
_security_group = (
|
|
416
|
-
|
|
417
|
-
attrs={'tags': ['green', 'red']}
|
|
418
|
-
)
|
|
415
|
+
_security_group = network_fakes.create_one_security_group(
|
|
416
|
+
attrs={'tags': ['green', 'red']}
|
|
419
417
|
)
|
|
420
418
|
|
|
421
419
|
def setUp(self):
|
|
@@ -515,37 +513,39 @@ class TestSetSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
|
515
513
|
|
|
516
514
|
class TestShowSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
517
515
|
# The security group rule to be shown with the group.
|
|
518
|
-
_security_group_rule = (
|
|
519
|
-
network_fakes.FakeSecurityGroupRule.create_one_security_group_rule()
|
|
520
|
-
)
|
|
516
|
+
_security_group_rule = network_fakes.create_one_security_group_rule()
|
|
521
517
|
|
|
522
518
|
# The security group to be shown.
|
|
523
|
-
_security_group = (
|
|
524
|
-
|
|
525
|
-
attrs={'security_group_rules': [_security_group_rule._info]}
|
|
526
|
-
)
|
|
519
|
+
_security_group = network_fakes.create_one_security_group(
|
|
520
|
+
attrs={'security_group_rules': [dict(_security_group_rule)]}
|
|
527
521
|
)
|
|
528
522
|
|
|
529
523
|
columns = (
|
|
524
|
+
'created_at',
|
|
530
525
|
'description',
|
|
531
526
|
'id',
|
|
532
527
|
'name',
|
|
533
528
|
'project_id',
|
|
529
|
+
'revision_number',
|
|
534
530
|
'rules',
|
|
535
531
|
'stateful',
|
|
536
532
|
'tags',
|
|
533
|
+
'updated_at',
|
|
537
534
|
)
|
|
538
535
|
|
|
539
536
|
data = (
|
|
537
|
+
_security_group.created_at,
|
|
540
538
|
_security_group.description,
|
|
541
539
|
_security_group.id,
|
|
542
540
|
_security_group.name,
|
|
543
541
|
_security_group.project_id,
|
|
542
|
+
_security_group.revision_number,
|
|
544
543
|
security_group.NetworkSecurityGroupRulesColumn(
|
|
545
|
-
[_security_group_rule
|
|
544
|
+
[dict(_security_group_rule)]
|
|
546
545
|
),
|
|
547
546
|
_security_group.stateful,
|
|
548
547
|
_security_group.tags,
|
|
548
|
+
_security_group.updated_at,
|
|
549
549
|
)
|
|
550
550
|
|
|
551
551
|
def setUp(self):
|
|
@@ -583,10 +583,8 @@ class TestShowSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
|
583
583
|
|
|
584
584
|
class TestUnsetSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
585
585
|
# The security group to be unset.
|
|
586
|
-
_security_group = (
|
|
587
|
-
|
|
588
|
-
attrs={'tags': ['green', 'red']}
|
|
589
|
-
)
|
|
586
|
+
_security_group = network_fakes.create_one_security_group(
|
|
587
|
+
attrs={'tags': ['green', 'red']}
|
|
590
588
|
)
|
|
591
589
|
|
|
592
590
|
def setUp(self):
|