octavia 15.0.0__py3-none-any.whl → 16.0.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.
- octavia/amphorae/backends/agent/api_server/keepalivedlvs.py +9 -0
- octavia/amphorae/backends/agent/api_server/loadbalancer.py +6 -6
- octavia/amphorae/backends/agent/api_server/plug.py +1 -1
- octavia/amphorae/backends/agent/api_server/util.py +35 -2
- octavia/amphorae/backends/health_daemon/status_message.py +1 -2
- octavia/amphorae/drivers/haproxy/rest_api_driver.py +12 -7
- octavia/api/drivers/amphora_driver/flavor_schema.py +5 -0
- octavia/api/drivers/noop_driver/driver.py +2 -1
- octavia/api/drivers/utils.py +12 -0
- octavia/api/root_controller.py +8 -2
- octavia/api/v2/controllers/base.py +8 -4
- octavia/api/v2/controllers/listener.py +12 -2
- octavia/api/v2/controllers/load_balancer.py +33 -1
- octavia/api/v2/controllers/member.py +58 -4
- octavia/api/v2/types/load_balancer.py +7 -1
- octavia/api/v2/types/member.py +3 -0
- octavia/common/base_taskflow.py +19 -10
- octavia/common/clients.py +8 -2
- octavia/common/config.py +17 -2
- octavia/common/constants.py +6 -0
- octavia/common/data_models.py +32 -2
- octavia/common/exceptions.py +5 -0
- octavia/common/utils.py +4 -1
- octavia/common/validate.py +16 -0
- octavia/compute/drivers/noop_driver/driver.py +30 -1
- octavia/controller/healthmanager/health_manager.py +7 -0
- octavia/controller/worker/v2/flows/amphora_flows.py +3 -5
- octavia/controller/worker/v2/flows/listener_flows.py +2 -1
- octavia/controller/worker/v2/flows/load_balancer_flows.py +38 -0
- octavia/controller/worker/v2/taskflow_jobboard_driver.py +34 -6
- octavia/controller/worker/v2/tasks/compute_tasks.py +9 -5
- octavia/controller/worker/v2/tasks/database_tasks.py +26 -6
- octavia/controller/worker/v2/tasks/network_tasks.py +118 -70
- octavia/db/base_models.py +29 -5
- octavia/db/migration/alembic_migrations/versions/3097e55493ae_add_sg_id_to_vip_table.py +39 -0
- octavia/db/migration/alembic_migrations/versions/8db7a6443785_add_member_vnic_type.py +36 -0
- octavia/db/migration/alembic_migrations/versions/fabf4983846b_add_member_port_table.py +40 -0
- octavia/db/models.py +43 -1
- octavia/db/repositories.py +88 -9
- octavia/network/base.py +29 -12
- octavia/network/data_models.py +2 -1
- octavia/network/drivers/neutron/allowed_address_pairs.py +55 -46
- octavia/network/drivers/neutron/base.py +28 -16
- octavia/network/drivers/neutron/utils.py +2 -2
- octavia/network/drivers/noop_driver/driver.py +150 -29
- octavia/policies/__init__.py +4 -0
- octavia/policies/advanced_rbac.py +95 -0
- octavia/policies/base.py +5 -101
- octavia/policies/keystone_default_roles.py +81 -0
- octavia/policies/loadbalancer.py +13 -0
- octavia/tests/common/constants.py +2 -1
- octavia/tests/common/sample_data_models.py +27 -14
- octavia/tests/functional/amphorae/backend/agent/api_server/test_server.py +5 -4
- octavia/tests/functional/api/drivers/driver_agent/test_driver_agent.py +2 -1
- octavia/tests/functional/api/v2/test_health_monitor.py +1 -1
- octavia/tests/functional/api/v2/test_l7policy.py +1 -1
- octavia/tests/functional/api/v2/test_listener.py +1 -1
- octavia/tests/functional/api/v2/test_load_balancer.py +150 -4
- octavia/tests/functional/api/v2/test_member.py +50 -0
- octavia/tests/functional/api/v2/test_pool.py +1 -1
- octavia/tests/functional/api/v2/test_quotas.py +5 -8
- octavia/tests/functional/db/base.py +6 -6
- octavia/tests/functional/db/test_models.py +124 -1
- octavia/tests/functional/db/test_repositories.py +237 -19
- octavia/tests/unit/amphorae/backends/agent/api_server/test_util.py +89 -1
- octavia/tests/unit/amphorae/drivers/haproxy/test_rest_api_driver_1_0.py +10 -7
- octavia/tests/unit/api/drivers/test_utils.py +6 -1
- octavia/tests/unit/certificates/generator/test_local.py +1 -1
- octavia/tests/unit/common/test_base_taskflow.py +4 -3
- octavia/tests/unit/compute/drivers/noop_driver/test_driver.py +28 -2
- octavia/tests/unit/controller/worker/v2/flows/test_load_balancer_flows.py +27 -1
- octavia/tests/unit/controller/worker/v2/tasks/test_database_tasks.py +28 -6
- octavia/tests/unit/controller/worker/v2/tasks/test_network_tasks.py +100 -79
- octavia/tests/unit/controller/worker/v2/test_taskflow_jobboard_driver.py +8 -0
- octavia/tests/unit/network/drivers/neutron/test_allowed_address_pairs.py +62 -45
- octavia/tests/unit/network/drivers/neutron/test_base.py +7 -7
- octavia/tests/unit/network/drivers/noop_driver/test_driver.py +55 -42
- {octavia-15.0.0.data → octavia-16.0.0.data}/data/share/octavia/diskimage-create/tox.ini +0 -1
- {octavia-15.0.0.dist-info → octavia-16.0.0.dist-info}/AUTHORS +3 -0
- octavia-16.0.0.dist-info/METADATA +156 -0
- {octavia-15.0.0.dist-info → octavia-16.0.0.dist-info}/RECORD +95 -90
- {octavia-15.0.0.dist-info → octavia-16.0.0.dist-info}/WHEEL +1 -1
- {octavia-15.0.0.dist-info → octavia-16.0.0.dist-info}/entry_points.txt +1 -1
- octavia-16.0.0.dist-info/pbr.json +1 -0
- octavia-15.0.0.dist-info/METADATA +0 -156
- octavia-15.0.0.dist-info/pbr.json +0 -1
- {octavia-15.0.0.data → octavia-16.0.0.data}/data/share/octavia/LICENSE +0 -0
- {octavia-15.0.0.data → octavia-16.0.0.data}/data/share/octavia/README.rst +0 -0
- {octavia-15.0.0.data → octavia-16.0.0.data}/data/share/octavia/diskimage-create/README.rst +0 -0
- {octavia-15.0.0.data → octavia-16.0.0.data}/data/share/octavia/diskimage-create/diskimage-create.sh +0 -0
- {octavia-15.0.0.data → octavia-16.0.0.data}/data/share/octavia/diskimage-create/image-tests.sh +0 -0
- {octavia-15.0.0.data → octavia-16.0.0.data}/data/share/octavia/diskimage-create/requirements.txt +0 -0
- {octavia-15.0.0.data → octavia-16.0.0.data}/data/share/octavia/diskimage-create/test-requirements.txt +0 -0
- {octavia-15.0.0.data → octavia-16.0.0.data}/data/share/octavia/diskimage-create/version.txt +0 -0
- {octavia-15.0.0.data → octavia-16.0.0.data}/scripts/octavia-wsgi +0 -0
- {octavia-15.0.0.dist-info → octavia-16.0.0.dist-info}/LICENSE +0 -0
- {octavia-15.0.0.dist-info → octavia-16.0.0.dist-info}/top_level.txt +0 -0
@@ -326,6 +326,9 @@ class TestAllowedAddressPairsDriver(base.TestCase):
|
|
326
326
|
lb_mock.id = LB_ID
|
327
327
|
vip_mock = mock.MagicMock()
|
328
328
|
vip_mock.port_id = VIP_PORT_ID
|
329
|
+
vip_sg = mock.MagicMock()
|
330
|
+
vip_sg.id = uuidutils.generate_uuid()
|
331
|
+
vip_mock.sg_ids = [vip_sg.id]
|
329
332
|
security_group_dict = {'id': SG_ID}
|
330
333
|
mock_get_sg_name.return_value = TEST_SG_NAME
|
331
334
|
|
@@ -358,7 +361,7 @@ class TestAllowedAddressPairsDriver(base.TestCase):
|
|
358
361
|
test_driver._update_security_group_rules.assert_called_once_with(
|
359
362
|
lb_mock, SG_ID)
|
360
363
|
test_driver._add_vip_security_group_to_port.assert_called_once_with(
|
361
|
-
LB_ID, VIP_PORT_ID, SG_ID)
|
364
|
+
LB_ID, VIP_PORT_ID, SG_ID, vip_sg_ids=[vip_sg.id])
|
362
365
|
|
363
366
|
# Test by security group name
|
364
367
|
test_driver._add_vip_security_group_to_port.reset_mock()
|
@@ -374,7 +377,60 @@ class TestAllowedAddressPairsDriver(base.TestCase):
|
|
374
377
|
test_driver._update_security_group_rules.assert_called_once_with(
|
375
378
|
lb_mock, SG_ID)
|
376
379
|
test_driver._add_vip_security_group_to_port.assert_called_once_with(
|
377
|
-
LB_ID, VIP_PORT_ID, SG_ID)
|
380
|
+
LB_ID, VIP_PORT_ID, SG_ID, vip_sg_ids=[vip_sg.id])
|
381
|
+
|
382
|
+
def test_update_aap_port_sg(self):
|
383
|
+
LB_ID = uuidutils.generate_uuid()
|
384
|
+
SG_ID = uuidutils.generate_uuid()
|
385
|
+
VIP_PORT_ID = uuidutils.generate_uuid()
|
386
|
+
VRRP_PORT_ID = uuidutils.generate_uuid()
|
387
|
+
lb_mock = mock.MagicMock()
|
388
|
+
lb_mock.id = LB_ID
|
389
|
+
amp_mock = mock.MagicMock()
|
390
|
+
amp_mock.vrrp_port_id = VRRP_PORT_ID
|
391
|
+
vip_mock = mock.MagicMock()
|
392
|
+
vip_mock.port_id = VIP_PORT_ID
|
393
|
+
vip_sg = mock.MagicMock()
|
394
|
+
vip_sg.id = uuidutils.generate_uuid()
|
395
|
+
vip_mock.sg_ids = [vip_sg.id]
|
396
|
+
security_group_dict = {'id': SG_ID}
|
397
|
+
|
398
|
+
test_driver = allowed_address_pairs.AllowedAddressPairsDriver()
|
399
|
+
|
400
|
+
test_driver._add_vip_security_group_to_port = mock.MagicMock()
|
401
|
+
test_driver._create_security_group = mock.MagicMock()
|
402
|
+
test_driver._get_lb_security_group = mock.MagicMock()
|
403
|
+
test_driver._update_security_group_rules = mock.MagicMock()
|
404
|
+
test_driver._get_lb_security_group.side_effect = [security_group_dict,
|
405
|
+
None]
|
406
|
+
|
407
|
+
# Test security groups disabled
|
408
|
+
test_driver.sec_grp_enabled = False
|
409
|
+
|
410
|
+
test_driver.update_aap_port_sg(lb_mock, amp_mock, vip_mock)
|
411
|
+
|
412
|
+
test_driver._add_vip_security_group_to_port.assert_not_called()
|
413
|
+
test_driver._get_lb_security_group.assert_not_called()
|
414
|
+
test_driver._update_security_group_rules.assert_not_called()
|
415
|
+
|
416
|
+
# Normal path
|
417
|
+
test_driver.sec_grp_enabled = True
|
418
|
+
|
419
|
+
test_driver.update_aap_port_sg(lb_mock, amp_mock, vip_mock)
|
420
|
+
|
421
|
+
test_driver._update_security_group_rules.assert_not_called()
|
422
|
+
test_driver._add_vip_security_group_to_port.assert_called_once_with(
|
423
|
+
LB_ID, VRRP_PORT_ID, SG_ID, vip_sg_ids=[vip_sg.id])
|
424
|
+
|
425
|
+
# No LB SG
|
426
|
+
test_driver._add_vip_security_group_to_port.reset_mock()
|
427
|
+
test_driver._get_lb_security_group.reset_mock()
|
428
|
+
test_driver._update_security_group_rules.reset_mock()
|
429
|
+
|
430
|
+
test_driver.update_aap_port_sg(lb_mock, amp_mock, vip_mock)
|
431
|
+
|
432
|
+
test_driver._update_security_group_rules.assert_not_called()
|
433
|
+
test_driver._add_vip_security_group_to_port.assert_not_called()
|
378
434
|
|
379
435
|
def test_plug_aap_port(self):
|
380
436
|
lb = dmh.generate_load_balancer_tree()
|
@@ -940,47 +996,6 @@ class TestAllowedAddressPairsDriver(base.TestCase):
|
|
940
996
|
mock_unplug_network.assert_called_once_with(
|
941
997
|
lb.amphorae[0].compute_id, subnet.network_id)
|
942
998
|
|
943
|
-
def test_plug_network_when_compute_instance_cant_be_found(self):
|
944
|
-
net_id = t_constants.MOCK_NOVA_INTERFACE.net_id
|
945
|
-
network_attach = self.driver.compute.attach_network_or_port
|
946
|
-
network_attach.side_effect = exceptions.NotFound(
|
947
|
-
resource='Instance not found', id=1)
|
948
|
-
self.assertRaises(network_base.AmphoraNotFound,
|
949
|
-
self.driver.plug_network,
|
950
|
-
t_constants.MOCK_COMPUTE_ID, net_id)
|
951
|
-
|
952
|
-
def test_plug_network_when_network_cant_be_found(self):
|
953
|
-
net_id = t_constants.MOCK_NOVA_INTERFACE.net_id
|
954
|
-
network_attach = self.driver.compute.attach_network_or_port
|
955
|
-
network_attach.side_effect = nova_exceptions.NotFound(
|
956
|
-
404, message='Network not found')
|
957
|
-
self.assertRaises(network_base.NetworkException,
|
958
|
-
self.driver.plug_network,
|
959
|
-
t_constants.MOCK_COMPUTE_ID, net_id)
|
960
|
-
|
961
|
-
def test_plug_network_when_interface_attach_fails(self):
|
962
|
-
net_id = t_constants.MOCK_NOVA_INTERFACE.net_id
|
963
|
-
network_attach = self.driver.compute.attach_network_or_port
|
964
|
-
network_attach.side_effect = TypeError
|
965
|
-
self.assertRaises(network_base.PlugNetworkException,
|
966
|
-
self.driver.plug_network,
|
967
|
-
t_constants.MOCK_COMPUTE_ID, net_id)
|
968
|
-
|
969
|
-
def test_plug_network(self):
|
970
|
-
net_id = t_constants.MOCK_NOVA_INTERFACE.net_id
|
971
|
-
network_attach = self.driver.compute.attach_network_or_port
|
972
|
-
network_attach.return_value = t_constants.MOCK_NOVA_INTERFACE
|
973
|
-
oct_interface = self.driver.plug_network(
|
974
|
-
t_constants.MOCK_COMPUTE_ID, net_id)
|
975
|
-
exp_ips = [fixed_ip.get('ip_address')
|
976
|
-
for fixed_ip in t_constants.MOCK_NOVA_INTERFACE.fixed_ips]
|
977
|
-
actual_ips = [fixed_ip.ip_address
|
978
|
-
for fixed_ip in oct_interface.fixed_ips]
|
979
|
-
self.assertEqual(exp_ips, actual_ips)
|
980
|
-
self.assertEqual(t_constants.MOCK_COMPUTE_ID,
|
981
|
-
oct_interface.compute_id)
|
982
|
-
self.assertEqual(net_id, oct_interface.network_id)
|
983
|
-
|
984
999
|
def test_unplug_network_when_compute_port_cant_be_found(self):
|
985
1000
|
net_id = t_constants.MOCK_NOVA_INTERFACE.net_id
|
986
1001
|
list_ports = self.driver.network_proxy.ports
|
@@ -1071,7 +1086,8 @@ class TestAllowedAddressPairsDriver(base.TestCase):
|
|
1071
1086
|
fake_rules = [
|
1072
1087
|
{'id': 'rule-80', 'port_range_max': 80, 'protocol': 'tcp',
|
1073
1088
|
'remote_ip_prefix': '10.0.101.0/24'},
|
1074
|
-
{'id': 'rule-22', 'port_range_max': 22, 'protocol': 'tcp'}
|
1089
|
+
{'id': 'rule-22', 'port_range_max': 22, 'protocol': 'tcp'},
|
1090
|
+
{'id': 'rule-None', 'port_range_max': 22},
|
1075
1091
|
]
|
1076
1092
|
list_rules = self.driver.network_proxy.security_group_rules
|
1077
1093
|
list_rules.return_value = fake_rules
|
@@ -1557,7 +1573,8 @@ class TestAllowedAddressPairsDriver(base.TestCase):
|
|
1557
1573
|
'fixed_ips': [{'ip_address': IP_ADDRESS1,
|
1558
1574
|
'subnet_id': SUBNET1_ID}],
|
1559
1575
|
'security_groups': [],
|
1560
|
-
'qos_policy_id': QOS_POLICY_ID
|
1576
|
+
'qos_policy_id': QOS_POLICY_ID,
|
1577
|
+
'binding_vnic_type': constants.VNIC_TYPE_NORMAL})
|
1561
1578
|
|
1562
1579
|
reference_port_dict = {'admin_state_up': ADMIN_STATE_UP,
|
1563
1580
|
'device_id': t_constants.MOCK_DEVICE_ID,
|
@@ -85,28 +85,28 @@ class TestBaseNeutronNetworkDriver(base.TestCase):
|
|
85
85
|
self.driver.network_proxy.update_port.assert_has_calls([
|
86
86
|
mock.call(t_constants.MOCK_PORT_ID, **expected_aap_dict)])
|
87
87
|
|
88
|
-
def
|
89
|
-
self.driver.
|
90
|
-
t_constants.MOCK_SECURITY_GROUP_ID, t_constants.MOCK_PORT_ID)
|
88
|
+
def test__update_security_groups(self):
|
89
|
+
self.driver._update_security_groups(
|
90
|
+
[t_constants.MOCK_SECURITY_GROUP_ID], t_constants.MOCK_PORT_ID)
|
91
91
|
expected_sg_dict = {
|
92
92
|
'security_groups': [
|
93
93
|
t_constants.MOCK_SECURITY_GROUP_ID]}
|
94
94
|
self.driver.network_proxy.update_port.assert_has_calls([
|
95
95
|
mock.call(t_constants.MOCK_PORT_ID, **expected_sg_dict)])
|
96
96
|
|
97
|
-
def
|
97
|
+
def test__update_security_groups_with_port_not_found(self):
|
98
98
|
self.driver.network_proxy.update_port.side_effect = (
|
99
99
|
os_exceptions.ResourceNotFound)
|
100
100
|
self.assertRaises(
|
101
101
|
network_base.PortNotFound,
|
102
|
-
self.driver.
|
102
|
+
self.driver._update_security_groups,
|
103
103
|
t_constants.MOCK_SECURITY_GROUP_ID, t_constants.MOCK_PORT_ID)
|
104
104
|
|
105
|
-
def
|
105
|
+
def test__update_security_groups_with_other_exception(self):
|
106
106
|
self.driver.network_proxy.update_port.side_effect = IOError
|
107
107
|
self.assertRaises(
|
108
108
|
network_base.NetworkException,
|
109
|
-
self.driver.
|
109
|
+
self.driver._update_security_groups,
|
110
110
|
t_constants.MOCK_SECURITY_GROUP_ID, t_constants.MOCK_PORT_ID)
|
111
111
|
|
112
112
|
def test__get_ports_by_security_group(self):
|
@@ -15,6 +15,7 @@ from unittest import mock
|
|
15
15
|
|
16
16
|
from oslo_utils import uuidutils
|
17
17
|
|
18
|
+
from octavia.common import constants
|
18
19
|
from octavia.db import models
|
19
20
|
from octavia.network import data_models as network_models
|
20
21
|
from octavia.network.drivers.noop_driver import driver
|
@@ -32,7 +33,16 @@ class TestNoopNetworkDriver(base.TestCase):
|
|
32
33
|
|
33
34
|
def setUp(self):
|
34
35
|
super().setUp()
|
35
|
-
self.
|
36
|
+
self.mock_engine = mock.MagicMock()
|
37
|
+
with mock.patch('octavia.network.drivers.noop_driver.driver.'
|
38
|
+
'create_engine') as mock_create_engine:
|
39
|
+
mock_create_engine.return_value = self.mock_engine
|
40
|
+
with mock.patch('octavia.network.drivers.noop_driver.'
|
41
|
+
'driver.event'):
|
42
|
+
self.driver = driver.NoopNetworkDriver()
|
43
|
+
mock_create_engine.assert_called_once_with(
|
44
|
+
'sqlite:////tmp/octavia-network-noop.db')
|
45
|
+
|
36
46
|
self.port = mock.MagicMock()
|
37
47
|
self.port_id = 88
|
38
48
|
self.port_name = 'port1'
|
@@ -40,12 +50,12 @@ class TestNoopNetworkDriver(base.TestCase):
|
|
40
50
|
self.network_id = self.FAKE_UUID_3
|
41
51
|
self.network_name = 'net1'
|
42
52
|
self.device_id = self.FAKE_UUID_4
|
43
|
-
self.ip_address = "
|
53
|
+
self.ip_address = "192.0.2.2"
|
44
54
|
self.load_balancer = models.LoadBalancer()
|
45
55
|
self.load_balancer.id = self.FAKE_UUID_2
|
46
56
|
|
47
57
|
self.vip = models.Vip()
|
48
|
-
self.vip.ip_address = "
|
58
|
+
self.vip.ip_address = "192.0.2.1"
|
49
59
|
self.vip.subnet_id = uuidutils.generate_uuid()
|
50
60
|
self.vip.port_id = uuidutils.generate_uuid()
|
51
61
|
self.amphora_id = self.FAKE_UUID_1
|
@@ -61,15 +71,15 @@ class TestNoopNetworkDriver(base.TestCase):
|
|
61
71
|
self.amphora1.compute_id = self.compute_id
|
62
72
|
self.amphora1.vrrp_port_id = uuidutils.generate_uuid()
|
63
73
|
self.amphora1.ha_port_id = uuidutils.generate_uuid()
|
64
|
-
self.amphora1.vrrp_ip = '
|
65
|
-
self.amphora1.ha_ip = '
|
74
|
+
self.amphora1.vrrp_ip = '192.0.2.10'
|
75
|
+
self.amphora1.ha_ip = '192.0.2.11'
|
66
76
|
self.amphora2 = models.Amphora()
|
67
77
|
self.amphora2.id = uuidutils.generate_uuid()
|
68
78
|
self.amphora2.compute_id = self.compute2_id
|
69
79
|
self.amphora2.vrrp_port_id = uuidutils.generate_uuid()
|
70
80
|
self.amphora2.ha_port_id = uuidutils.generate_uuid()
|
71
|
-
self.amphora2.vrrp_ip = '
|
72
|
-
self.amphora2.ha_ip = '
|
81
|
+
self.amphora2.vrrp_ip = '192.0.2.20'
|
82
|
+
self.amphora2.ha_ip = '192.0.2.21'
|
73
83
|
self.load_balancer.amphorae = [self.amphora1, self.amphora2]
|
74
84
|
self.load_balancer.vip = self.vip
|
75
85
|
self.subnet = mock.MagicMock()
|
@@ -95,6 +105,14 @@ class TestNoopNetworkDriver(base.TestCase):
|
|
95
105
|
self.driver.driver.networkconfigconfig[(
|
96
106
|
self.load_balancer.id, self.vip.ip_address)])
|
97
107
|
|
108
|
+
def test_update_aap_port_sg(self):
|
109
|
+
self.driver.update_aap_port_sg(self.load_balancer, self.amphora1,
|
110
|
+
self.vip)
|
111
|
+
self.assertEqual((self.load_balancer, self.vip, self.amphora1,
|
112
|
+
'update_aap_port_sg'),
|
113
|
+
self.driver.driver.networkconfigconfig[(
|
114
|
+
self.amphora1.id, self.vip.ip_address)])
|
115
|
+
|
98
116
|
def test_unplug_vip(self):
|
99
117
|
self.driver.unplug_vip(self.load_balancer, self.vip)
|
100
118
|
self.assertEqual((self.load_balancer, self.vip,
|
@@ -102,12 +120,6 @@ class TestNoopNetworkDriver(base.TestCase):
|
|
102
120
|
self.driver.driver.networkconfigconfig[(
|
103
121
|
self.load_balancer.id, self.vip.ip_address)])
|
104
122
|
|
105
|
-
def test_plug_network(self):
|
106
|
-
self.driver.plug_network(self.compute_id, self.network_id)
|
107
|
-
self.assertEqual((self.compute_id, self.network_id, 'plug_network'),
|
108
|
-
self.driver.driver.networkconfigconfig[(
|
109
|
-
self.compute_id, self.network_id)])
|
110
|
-
|
111
123
|
def test_unplug_network(self):
|
112
124
|
self.driver.unplug_network(self.compute_id, self.network_id)
|
113
125
|
self.assertEqual((self.compute_id, self.network_id, 'unplug_network'),
|
@@ -115,39 +127,40 @@ class TestNoopNetworkDriver(base.TestCase):
|
|
115
127
|
self.compute_id, self.network_id)])
|
116
128
|
|
117
129
|
def test_get_plugged_networks(self):
|
118
|
-
|
130
|
+
interface_db_mock = mock.MagicMock()
|
131
|
+
interface_db_mock.port_id = self.port_id
|
132
|
+
interface_db_mock.network_id = self.network_id
|
133
|
+
interface_db_mock.compute_id = self.compute_id
|
134
|
+
interface_db_mock.vnic_type = constants.VNIC_TYPE_NORMAL
|
135
|
+
|
136
|
+
fixed_ips_db_mock = mock.MagicMock()
|
137
|
+
fixed_ips_db_mock.port_id = self.port_id
|
138
|
+
fixed_ips_db_mock.subnet_id = self.subnet_id
|
139
|
+
fixed_ips_db_mock.ip_address = self.ip_address
|
140
|
+
|
141
|
+
# mock out the sqlite db calls
|
142
|
+
connect_mock = mock.MagicMock()
|
143
|
+
connection_mock = mock.MagicMock()
|
144
|
+
self.mock_engine.connect.return_value = connect_mock
|
145
|
+
connect_mock.__enter__.return_value = connection_mock
|
146
|
+
|
147
|
+
connection_mock.execute.side_effect = [[interface_db_mock],
|
148
|
+
[fixed_ips_db_mock]]
|
149
|
+
|
150
|
+
result = self.driver.get_plugged_networks(self.compute_id)
|
151
|
+
|
119
152
|
self.assertEqual((self.compute_id, 'get_plugged_networks'),
|
120
153
|
self.driver.driver.networkconfigconfig[(
|
121
154
|
self.compute_id)])
|
122
155
|
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
id=mock.ANY,
|
132
|
-
compute_id=amphora.compute_id,
|
133
|
-
network_id=self.network_id,
|
134
|
-
fixed_ips=[],
|
135
|
-
port_id=mock.ANY
|
136
|
-
))
|
137
|
-
networks = self.driver.get_plugged_networks(amphora.compute_id)
|
138
|
-
self.assertEqual(
|
139
|
-
networks,
|
140
|
-
[network_models.Interface(
|
141
|
-
id=mock.ANY,
|
142
|
-
compute_id=amphora.compute_id,
|
143
|
-
network_id=self.network_id,
|
144
|
-
fixed_ips=[],
|
145
|
-
port_id=mock.ANY
|
146
|
-
)])
|
147
|
-
self.driver.unplug_network(amphora.compute_id,
|
148
|
-
self.network_id)
|
149
|
-
networks = self.driver.get_plugged_networks(amphora.compute_id)
|
150
|
-
self.assertEqual([], networks)
|
156
|
+
expected_fixed_ips = [network_models.FixedIP(
|
157
|
+
subnet_id=self.subnet_id, ip_address=self.ip_address)]
|
158
|
+
expected_interfaces = [network_models.Interface(
|
159
|
+
compute_id=self.compute_id, network_id=self.network_id,
|
160
|
+
port_id=self.port_id, fixed_ips=expected_fixed_ips,
|
161
|
+
vnic_type=constants.VNIC_TYPE_NORMAL)]
|
162
|
+
|
163
|
+
self.assertEqual(expected_interfaces, result)
|
151
164
|
|
152
165
|
def test_update_vip(self):
|
153
166
|
self.driver.update_vip(self.load_balancer)
|
@@ -102,6 +102,7 @@ Hongbin Lu <hongbin.lu@huawei.com>
|
|
102
102
|
Ian Wienand <iwienand@redhat.com>
|
103
103
|
Ihar Hrachyshka <ihrachys@redhat.com>
|
104
104
|
Ildar Iskhakov <iiskhako@cisco.com>
|
105
|
+
Ilia Kerbs <ikerbs@protonmail.com>
|
105
106
|
Itzik Brown <itzikb@redhat.com>
|
106
107
|
Jacky Hu <hudayou@hotmail.com>
|
107
108
|
James Arendt <james.arendt@hp.com>
|
@@ -192,6 +193,7 @@ Sean McGinnis <sean.mcginnis@gmail.com>
|
|
192
193
|
Selvakumar S <selvakumar.s2@hp.com>
|
193
194
|
Sergey Belous <sbelous@mirantis.com>
|
194
195
|
Sergey Kraynev <sergejyit@gmail.com>
|
196
|
+
Seunghun Lee <seunghun@stackhpc.com>
|
195
197
|
ShangXiao <shangxiaobj@inspur.com>
|
196
198
|
Shashank Kumar Shankar <shashank.kumar.shankar@intel.com>
|
197
199
|
Sherif Abdelwahab <sherif.abdelwahab@hp.com>
|
@@ -213,6 +215,7 @@ Thobias Salazar Trevisan <thobiast@gmail.com>
|
|
213
215
|
Thomas Bechtold <tbechtold@suse.com>
|
214
216
|
Thomas Goirand <zigo@debian.org>
|
215
217
|
Tin Lam <tl3438@att.com>
|
218
|
+
Tobias Urdin <tobias.urdin@binero.com>
|
216
219
|
Tobias Urdin <tobias.urdin@binero.se>
|
217
220
|
Tom Weininger <tweining@redhat.com>
|
218
221
|
Tony Breeds <tony@bakeyournoodle.com>
|
@@ -0,0 +1,156 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: octavia
|
3
|
+
Version: 16.0.0
|
4
|
+
Summary: OpenStack Octavia Scalable Load Balancer as a Service
|
5
|
+
Home-page: https://docs.openstack.org/octavia/latest/
|
6
|
+
Author: OpenStack
|
7
|
+
Author-email: openstack-discuss@lists.openstack.org
|
8
|
+
Classifier: Development Status :: 5 - Production/Stable
|
9
|
+
Classifier: Environment :: OpenStack
|
10
|
+
Classifier: Intended Audience :: Developers
|
11
|
+
Classifier: Intended Audience :: Information Technology
|
12
|
+
Classifier: Intended Audience :: System Administrators
|
13
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
14
|
+
Classifier: Operating System :: POSIX :: Linux
|
15
|
+
Classifier: Programming Language :: Python
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
20
|
+
Requires-Python: >=3.9
|
21
|
+
License-File: LICENSE
|
22
|
+
License-File: AUTHORS
|
23
|
+
Requires-Dist: alembic >=0.9.6
|
24
|
+
Requires-Dist: cotyledon >=1.3.0
|
25
|
+
Requires-Dist: pecan >=1.3.2
|
26
|
+
Requires-Dist: pbr >=3.1.1
|
27
|
+
Requires-Dist: SQLAlchemy >=1.2.19
|
28
|
+
Requires-Dist: SQLAlchemy-Utils >=0.30.11
|
29
|
+
Requires-Dist: futurist >=1.2.0
|
30
|
+
Requires-Dist: requests >=2.23.0
|
31
|
+
Requires-Dist: rfc3986 >=1.2.0
|
32
|
+
Requires-Dist: keystoneauth1 >=3.4.0
|
33
|
+
Requires-Dist: keystonemiddleware >=9.5.0
|
34
|
+
Requires-Dist: WebOb >=1.8.2
|
35
|
+
Requires-Dist: stevedore >=1.20.0
|
36
|
+
Requires-Dist: openstacksdk >=0.103.0
|
37
|
+
Requires-Dist: oslo.config >=6.8.0
|
38
|
+
Requires-Dist: oslo.context >=2.22.0
|
39
|
+
Requires-Dist: oslo.db[mysql] >=8.4.0
|
40
|
+
Requires-Dist: oslo.i18n >=3.20.0
|
41
|
+
Requires-Dist: oslo.log >=4.3.0
|
42
|
+
Requires-Dist: oslo.messaging >=14.1.0
|
43
|
+
Requires-Dist: oslo.middleware >=4.0.1
|
44
|
+
Requires-Dist: oslo.policy >=3.7.0
|
45
|
+
Requires-Dist: oslo.reports >=1.18.0
|
46
|
+
Requires-Dist: oslo.serialization >=2.28.1
|
47
|
+
Requires-Dist: oslo.upgradecheck >=1.3.0
|
48
|
+
Requires-Dist: oslo.utils >=4.7.0
|
49
|
+
Requires-Dist: psutil >=5.7.1
|
50
|
+
Requires-Dist: pyasn1 !=0.2.3,>=0.1.8
|
51
|
+
Requires-Dist: pyasn1-modules >=0.0.6
|
52
|
+
Requires-Dist: python-barbicanclient >=4.5.2
|
53
|
+
Requires-Dist: python-glanceclient >=2.8.0
|
54
|
+
Requires-Dist: python-novaclient >=9.1.0
|
55
|
+
Requires-Dist: python-cinderclient >=3.3.0
|
56
|
+
Requires-Dist: WSME >=0.8.0
|
57
|
+
Requires-Dist: Jinja2 >=2.10
|
58
|
+
Requires-Dist: taskflow >=5.9.0
|
59
|
+
Requires-Dist: castellan >=0.16.0
|
60
|
+
Requires-Dist: tenacity >=5.0.4
|
61
|
+
Requires-Dist: distro >=1.2.0
|
62
|
+
Requires-Dist: jsonschema >=3.2.0
|
63
|
+
Requires-Dist: octavia-lib >=3.8.0
|
64
|
+
Requires-Dist: setproctitle >=1.1.10
|
65
|
+
Requires-Dist: python-dateutil >=2.7.0
|
66
|
+
Requires-Dist: Flask !=0.11,>=0.10
|
67
|
+
Requires-Dist: cryptography >=42.0.0
|
68
|
+
Requires-Dist: gunicorn >=19.9.0
|
69
|
+
Requires-Dist: Werkzeug >=0.14.1
|
70
|
+
Requires-Dist: pyroute2 >=0.5.14 ; (sys_platform!='win32')
|
71
|
+
Provides-Extra: etcd
|
72
|
+
Requires-Dist: etcd3gw >=2.4.1 ; extra == 'etcd'
|
73
|
+
Provides-Extra: redis
|
74
|
+
Requires-Dist: redis >=3.4.0 ; extra == 'redis'
|
75
|
+
Provides-Extra: test
|
76
|
+
Requires-Dist: hacking <6.2.0,>=6.1.0 ; extra == 'test'
|
77
|
+
Requires-Dist: requests-mock >=1.2.0 ; extra == 'test'
|
78
|
+
Requires-Dist: coverage !=4.4,>=4.0 ; extra == 'test'
|
79
|
+
Requires-Dist: fixtures >=3.0.0 ; extra == 'test'
|
80
|
+
Requires-Dist: flake8-import-order <0.19.0,>=0.18.0 ; extra == 'test'
|
81
|
+
Requires-Dist: python-subunit >=1.0.0 ; extra == 'test'
|
82
|
+
Requires-Dist: oslotest >=3.2.0 ; extra == 'test'
|
83
|
+
Requires-Dist: pylint >=2.5.3 ; extra == 'test'
|
84
|
+
Requires-Dist: testrepository >=0.0.18 ; extra == 'test'
|
85
|
+
Requires-Dist: testtools >=2.2.0 ; extra == 'test'
|
86
|
+
Requires-Dist: testresources >=2.0.0 ; extra == 'test'
|
87
|
+
Requires-Dist: testscenarios >=0.4 ; extra == 'test'
|
88
|
+
Requires-Dist: doc8 >=0.6.0 ; extra == 'test'
|
89
|
+
Requires-Dist: bandit !=1.6.0,>=1.1.0 ; extra == 'test'
|
90
|
+
Requires-Dist: tempest >=23.0.0 ; extra == 'test'
|
91
|
+
Requires-Dist: sphinx !=2.1.0,>=2.0.0 ; extra == 'test'
|
92
|
+
Requires-Dist: bashate >=0.5.1 ; extra == 'test'
|
93
|
+
Requires-Dist: WebTest >=2.0.26 ; extra == 'test'
|
94
|
+
Provides-Extra: zookeeper
|
95
|
+
Requires-Dist: kazoo >=2.6.0 ; extra == 'zookeeper'
|
96
|
+
Requires-Dist: zake >=0.1.6 ; extra == 'zookeeper'
|
97
|
+
|
98
|
+
========================
|
99
|
+
Team and repository tags
|
100
|
+
========================
|
101
|
+
|
102
|
+
.. image:: https://governance.openstack.org/tc/badges/octavia.svg
|
103
|
+
:target: https://governance.openstack.org/tc/reference/tags/index.html
|
104
|
+
|
105
|
+
.. Change things from this point on
|
106
|
+
|
107
|
+
=======
|
108
|
+
Octavia
|
109
|
+
=======
|
110
|
+
|
111
|
+
.. image:: https://img.shields.io/pypi/v/octavia.svg
|
112
|
+
:target: https://pypi.org/project/octavia/
|
113
|
+
:alt: Latest Version
|
114
|
+
|
115
|
+
Octavia is an operator-grade open source scalable load balancer for use in
|
116
|
+
large OpenStack deployments.
|
117
|
+
|
118
|
+
Octavia provides the load balancing API for OpenStack. It supports multiple
|
119
|
+
"provider drivers" that implement load balancing, including the "amphora"
|
120
|
+
reference driver included with Octavia.
|
121
|
+
|
122
|
+
Octavia is distributed under the terms of the Apache License, Version 2.0.
|
123
|
+
The full terms and conditions of this license are detailed in the LICENSE
|
124
|
+
file.
|
125
|
+
|
126
|
+
Project resources
|
127
|
+
~~~~~~~~~~~~~~~~~
|
128
|
+
|
129
|
+
Developer documentation for the Octavia project is available at
|
130
|
+
https://docs.openstack.org/octavia/latest/
|
131
|
+
|
132
|
+
Release notes for the Octavia project are available at
|
133
|
+
https://docs.openstack.org/releasenotes/octavia/
|
134
|
+
|
135
|
+
The project source code repository is located at
|
136
|
+
https://opendev.org/openstack/octavia
|
137
|
+
|
138
|
+
Project status, bugs, and requests for feature enhancements are tracked on
|
139
|
+
https://launchpad.net/octavia
|
140
|
+
|
141
|
+
For more information on project direction and guiding principles for
|
142
|
+
contributors, please see the CONSTITUTION.rst file in this directory, or
|
143
|
+
specifications in the specs/ sub-directory.
|
144
|
+
|
145
|
+
The project roadmap is available at
|
146
|
+
https://wiki.openstack.org/wiki/Octavia/Roadmap
|
147
|
+
|
148
|
+
External Resources
|
149
|
+
~~~~~~~~~~~~~~~~~~
|
150
|
+
|
151
|
+
* Octavia Wiki: https://wiki.openstack.org/wiki/Octavia
|
152
|
+
|
153
|
+
* For help on usage and hacking of Octavia, please send an email to
|
154
|
+
OpenStack-dev Mailing List <mailto:openstack-discuss@lists.openstack.org>
|
155
|
+
with **[Octavia]** tag.
|
156
|
+
|