octavia 14.0.0__py3-none-any.whl → 15.0.0.0rc1__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/agent_jinja_cfg.py +1 -4
- octavia/amphorae/backends/agent/api_server/amphora_info.py +5 -5
- octavia/amphorae/backends/agent/api_server/keepalived.py +26 -53
- octavia/amphorae/backends/agent/api_server/keepalivedlvs.py +44 -83
- octavia/amphorae/backends/agent/api_server/loadbalancer.py +94 -112
- octavia/amphorae/backends/agent/api_server/lvs_listener_base.py +1 -1
- octavia/amphorae/backends/agent/api_server/osutils.py +11 -8
- octavia/amphorae/backends/agent/api_server/plug.py +12 -13
- octavia/amphorae/backends/agent/api_server/server.py +4 -3
- octavia/amphorae/backends/agent/api_server/templates/keepalived_lvs_check_script.sh.j2 +0 -4
- octavia/amphorae/backends/agent/api_server/util.py +23 -68
- octavia/amphorae/backends/agent/templates/amphora_agent_conf.template +0 -3
- octavia/amphorae/backends/health_daemon/health_daemon.py +6 -7
- octavia/amphorae/backends/health_daemon/health_sender.py +2 -2
- octavia/amphorae/backends/utils/haproxy_query.py +3 -6
- octavia/amphorae/backends/utils/interface.py +11 -50
- octavia/amphorae/backends/utils/interface_file.py +29 -16
- octavia/amphorae/backends/utils/ip_advertisement.py +1 -1
- octavia/amphorae/backends/utils/keepalivedlvs_query.py +7 -8
- octavia/amphorae/backends/utils/network_namespace.py +3 -3
- octavia/amphorae/backends/utils/nftable_utils.py +33 -11
- octavia/amphorae/drivers/driver_base.py +2 -2
- octavia/amphorae/drivers/haproxy/rest_api_driver.py +26 -38
- octavia/amphorae/drivers/health/heartbeat_udp.py +1 -1
- octavia/amphorae/drivers/keepalived/jinja/jinja_cfg.py +1 -2
- octavia/amphorae/drivers/keepalived/jinja/templates/keepalived_base.template +0 -1
- octavia/amphorae/drivers/noop_driver/driver.py +1 -1
- octavia/api/app.py +1 -2
- octavia/api/common/pagination.py +16 -22
- octavia/api/common/types.py +1 -1
- octavia/api/drivers/amphora_driver/v2/driver.py +6 -6
- octavia/api/drivers/driver_agent/driver_listener.py +3 -3
- octavia/api/drivers/driver_agent/driver_updater.py +1 -1
- octavia/api/drivers/noop_driver/driver.py +1 -1
- octavia/api/root_controller.py +2 -2
- octavia/api/v2/controllers/base.py +2 -4
- octavia/api/v2/controllers/health_monitor.py +5 -3
- octavia/api/v2/controllers/listener.py +2 -2
- octavia/api/v2/controllers/load_balancer.py +7 -0
- octavia/api/v2/controllers/member.py +12 -2
- octavia/api/v2/types/amphora.py +1 -1
- octavia/api/v2/types/availability_zone_profile.py +1 -2
- octavia/api/v2/types/availability_zones.py +1 -2
- octavia/api/v2/types/flavor_profile.py +1 -1
- octavia/api/v2/types/flavors.py +1 -1
- octavia/api/v2/types/health_monitor.py +1 -1
- octavia/api/v2/types/l7policy.py +1 -1
- octavia/api/v2/types/l7rule.py +1 -1
- octavia/api/v2/types/listener.py +3 -3
- octavia/api/v2/types/load_balancer.py +3 -3
- octavia/api/v2/types/member.py +2 -2
- octavia/api/v2/types/pool.py +2 -2
- octavia/api/v2/types/quotas.py +2 -2
- octavia/certificates/common/barbican.py +1 -1
- octavia/certificates/common/cert.py +1 -1
- octavia/certificates/generator/cert_gen.py +1 -1
- octavia/certificates/generator/local.py +5 -5
- octavia/certificates/manager/cert_mgr.py +1 -1
- octavia/certificates/manager/local.py +20 -20
- octavia/cmd/agent.py +3 -3
- octavia/cmd/driver_agent.py +2 -3
- octavia/cmd/health_checker.py +4 -4
- octavia/cmd/interface.py +4 -4
- octavia/cmd/prometheus_proxy.py +11 -13
- octavia/common/base_taskflow.py +3 -3
- octavia/common/clients.py +4 -4
- octavia/common/config.py +18 -24
- octavia/common/constants.py +28 -35
- octavia/common/data_models.py +2 -2
- octavia/common/jinja/haproxy/combined_listeners/jinja_cfg.py +5 -5
- octavia/common/jinja/logging/logging_jinja_cfg.py +1 -1
- octavia/common/jinja/lvs/jinja_cfg.py +1 -1
- octavia/common/jinja/user_data_jinja_cfg.py +1 -1
- octavia/common/keystone.py +1 -1
- octavia/common/policy.py +2 -3
- octavia/common/stats.py +1 -1
- octavia/common/tls_utils/cert_parser.py +2 -1
- octavia/common/utils.py +3 -3
- octavia/common/validate.py +9 -13
- octavia/compute/compute_base.py +1 -1
- octavia/compute/drivers/noop_driver/driver.py +1 -1
- octavia/compute/drivers/nova_driver.py +1 -1
- octavia/controller/healthmanager/health_manager.py +1 -1
- octavia/controller/housekeeping/house_keeping.py +2 -2
- octavia/controller/queue/v2/consumer.py +1 -2
- octavia/controller/queue/v2/endpoints.py +1 -1
- octavia/controller/worker/amphora_rate_limit.py +6 -6
- octavia/controller/worker/task_utils.py +1 -1
- octavia/controller/worker/v2/controller_worker.py +3 -3
- octavia/controller/worker/v2/flows/amphora_flows.py +15 -4
- octavia/controller/worker/v2/flows/flow_utils.py +6 -5
- octavia/controller/worker/v2/flows/health_monitor_flows.py +1 -1
- octavia/controller/worker/v2/flows/l7policy_flows.py +1 -1
- octavia/controller/worker/v2/flows/l7rule_flows.py +1 -1
- octavia/controller/worker/v2/flows/listener_flows.py +18 -6
- octavia/controller/worker/v2/flows/load_balancer_flows.py +1 -1
- octavia/controller/worker/v2/flows/member_flows.py +12 -19
- octavia/controller/worker/v2/flows/pool_flows.py +1 -1
- octavia/controller/worker/v2/taskflow_jobboard_driver.py +17 -3
- octavia/controller/worker/v2/tasks/compute_tasks.py +1 -3
- octavia/controller/worker/v2/tasks/network_tasks.py +3 -4
- octavia/db/base_models.py +21 -9
- octavia/db/migration/alembic_migrations/versions/034756a182a2_amphora_add_image_id.py +2 -2
- octavia/db/migration/alembic_migrations/versions/034b2dc2f3e0_modernize_l7policy_fields.py +31 -31
- octavia/db/migration/alembic_migrations/versions/0f242cf02c74_add_provider_column.py +2 -2
- octavia/db/migration/alembic_migrations/versions/10d38216ad34_add_timestamps_to_amphora.py +4 -4
- octavia/db/migration/alembic_migrations/versions/11e4bb2bb8ef_fix_ipv6_vip.py +1 -1
- octavia/db/migration/alembic_migrations/versions/13500e2e978d_update_url_and_name_size.py +6 -6
- octavia/db/migration/alembic_migrations/versions/14892634e228_update_vip.py +5 -5
- octavia/db/migration/alembic_migrations/versions/186509101b9b_add_server_group_id_to_loadbalancer.py +2 -2
- octavia/db/migration/alembic_migrations/versions/1afc932f1ca2_l7rule_support_client_cert.py +3 -3
- octavia/db/migration/alembic_migrations/versions/1e4c1d83044c_keepalived_configuration_datamodel.py +26 -26
- octavia/db/migration/alembic_migrations/versions/2351ea316465_adding_terminate_https_tls_ref_support.py +4 -4
- octavia/db/migration/alembic_migrations/versions/256852d5ff7c_add_lb_network_ip_to_amphora.py +2 -2
- octavia/db/migration/alembic_migrations/versions/27e54d00c3cd_add_monitor_address_and_port_to_member.py +4 -4
- octavia/db/migration/alembic_migrations/versions/298eac0640a7_add_amphora_vrrp_port_id_and_ha_port_id.py +4 -4
- octavia/db/migration/alembic_migrations/versions/29ff921a6eb_shared_pools.py +3 -3
- octavia/db/migration/alembic_migrations/versions/2ad093f6353f_add_listener_client_ca_tls_certificate_.py +2 -2
- octavia/db/migration/alembic_migrations/versions/31f7653ded67_allow_multiple_vips_per_loadbalancer.py +10 -10
- octavia/db/migration/alembic_migrations/versions/32e5c35b26a8_add_l7policy_and_l7rule_quota.py +4 -4
- octavia/db/migration/alembic_migrations/versions/357d17a6d5ac_update_lb_and_amphora_data_model_for_.py +20 -20
- octavia/db/migration/alembic_migrations/versions/35dee79d5865_initial_create.py +185 -185
- octavia/db/migration/alembic_migrations/versions/36b94648fef8_add_timestamp.py +2 -2
- octavia/db/migration/alembic_migrations/versions/392fb85b4419_add_primary_key_to_spares_pool.py +1 -1
- octavia/db/migration/alembic_migrations/versions/3a1e1cdb7b27_rename_amphora_host_id.py +1 -1
- octavia/db/migration/alembic_migrations/versions/3b199c848b96_create_no_monitor_operational_status.py +1 -1
- octavia/db/migration/alembic_migrations/versions/3e5b37a0bdb9_add_vrrp_ip_and_ha_ip_to_amphora.py +4 -4
- octavia/db/migration/alembic_migrations/versions/3f8ff3be828e_create_quotas_table.py +12 -12
- octavia/db/migration/alembic_migrations/versions/43287cd10fef_make_pool_lb_algorithm_larger.py +6 -6
- octavia/db/migration/alembic_migrations/versions/443fe6676637_add_network_id_to_vip.py +2 -2
- octavia/db/migration/alembic_migrations/versions/44a2414dd683_adding_name_column_to_member_and_health_.py +1 -1
- octavia/db/migration/alembic_migrations/versions/458c9ee2a011_l7_policies_and_rules.py +57 -57
- octavia/db/migration/alembic_migrations/versions/46d914b2a5e5_seed_the_spares_pool_table.py +2 -2
- octavia/db/migration/alembic_migrations/versions/48660b6643f0_add_new_states_for_amphora.py +3 -3
- octavia/db/migration/alembic_migrations/versions/4aeb9e23ad43_add_draining_operating_status.py +1 -1
- octavia/db/migration/alembic_migrations/versions/4c094013699a_update_load_balancer_amphora.py +9 -9
- octavia/db/migration/alembic_migrations/versions/4f65b4f91c39_amphora_add_flavor_id.py +2 -2
- octavia/db/migration/alembic_migrations/versions/4faaa983e7a9_update_member_address_column.py +1 -1
- octavia/db/migration/alembic_migrations/versions/4fe8240425b4_update_vip_add_subnet_id.py +2 -2
- octavia/db/migration/alembic_migrations/versions/52377704420e_add_timestamps_to_healthmonitor.py +9 -9
- octavia/db/migration/alembic_migrations/versions/5309960964f8_add_proxy_protocol_for_pool.py +3 -3
- octavia/db/migration/alembic_migrations/versions/543f5d8e4e56_add_a_column_busy_in_table_amphora_health.py +2 -2
- octavia/db/migration/alembic_migrations/versions/55874a4ceed6_add_l7policy_action_redirect_prefix.py +5 -5
- octavia/db/migration/alembic_migrations/versions/5a3ee5472c31_add_cert_expiration__infor_in_amphora_table.py +4 -4
- octavia/db/migration/alembic_migrations/versions/62816c232310_fix_migration_for_mysql_5_7.py +1 -1
- octavia/db/migration/alembic_migrations/versions/6742ca1b27c2_add_l7policy_redirect_http_code.py +2 -2
- octavia/db/migration/alembic_migrations/versions/6ac558d7fc21_add_prometheus_listener_protocol.py +3 -3
- octavia/db/migration/alembic_migrations/versions/6ffc710674ef_spares_pool_table.py +2 -2
- octavia/db/migration/alembic_migrations/versions/7432f1d4ea83_add_http_host_head_inject_for_http_health_check.py +4 -4
- octavia/db/migration/alembic_migrations/versions/74aae261694c_extend_pool_for_backend_ca_and_crl.py +4 -4
- octavia/db/migration/alembic_migrations/versions/76aacf2e176c_extend_support_udp_protocol.py +3 -3
- octavia/db/migration/alembic_migrations/versions/80dba23a159f_tags_support.py +3 -3
- octavia/db/migration/alembic_migrations/versions/82b9402e71fd_update_vip_address_size.py +1 -1
- octavia/db/migration/alembic_migrations/versions/8ac4ed24df3a_add_availability_zone_to_lb.py +4 -4
- octavia/db/migration/alembic_migrations/versions/8b47b2546312_sctp_support.py +2 -2
- octavia/db/migration/alembic_migrations/versions/8c0851bdf6c3_change_tls_container_id_length_in_sni_.py +1 -1
- octavia/db/migration/alembic_migrations/versions/92fe9857279_create_healthmanager_table.py +3 -3
- octavia/db/migration/alembic_migrations/versions/9b5473976d6d_add_provisioning_status_to_objects.py +10 -10
- octavia/db/migration/alembic_migrations/versions/a1f689aecc1d_extend_pool_for_support_backend_reencryption.py +2 -2
- octavia/db/migration/alembic_migrations/versions/a7f187cd221f_add_tls_boolean_type_for_reencryption.py +2 -2
- octavia/db/migration/alembic_migrations/versions/b9c703669314_add_flavor_and_flavor_profile_table.py +18 -18
- octavia/db/migration/alembic_migrations/versions/ba35e0fb88e1_add_backup_field_to_member.py +2 -2
- octavia/db/migration/alembic_migrations/versions/bf171d0d91c3_amphora_add_cached_zone.py +2 -2
- octavia/db/migration/alembic_migrations/versions/c761c8a71579_add_availability_zone_table.py +15 -15
- octavia/db/migration/alembic_migrations/versions/d85ca7258d21_modernize_l7rule.py +13 -13
- octavia/db/migration/alembic_migrations/versions/da371b422669_allowed_cidr_for_listeners.py +7 -7
- octavia/db/migration/alembic_migrations/versions/dcf88e59aae4_add_lb_algorithm_source_ip_port.py +3 -3
- octavia/db/migration/alembic_migrations/versions/e37941b010db_add_lb_flavor_constraint.py +11 -11
- octavia/db/migration/alembic_migrations/versions/e6672bda93bf_add_ping_and_tlshello_monitor_types.py +3 -3
- octavia/db/migration/alembic_migrations/versions/e6ee84f0abf3_add_proxy_v2_pool_protocol.py +3 -3
- octavia/db/migration/alembic_migrations/versions/ebbcc72b4e5e_add_octavia_owned_vip_column_to_vip_.py +2 -2
- octavia/db/migration/alembic_migrations/versions/f21ae3f21adc_add_client_auth_option.py +6 -6
- octavia/db/migration/alembic_migrations/versions/fc5582da7d8a_create_amphora_build_rate_limit_tables.py +11 -11
- octavia/db/migration/alembic_migrations/versions/ffad172e98c1_add_certificate_revoke_list_option.py +2 -2
- octavia/db/models.py +1 -1
- octavia/db/repositories.py +3 -3
- octavia/distributor/drivers/driver_base.py +1 -1
- octavia/distributor/drivers/noop_driver/driver.py +1 -1
- octavia/hacking/checks.py +4 -4
- octavia/image/drivers/noop_driver/driver.py +1 -1
- octavia/image/image_base.py +1 -1
- octavia/network/base.py +1 -1
- octavia/network/drivers/neutron/allowed_address_pairs.py +11 -9
- octavia/network/drivers/neutron/base.py +3 -3
- octavia/network/drivers/noop_driver/driver.py +1 -1
- octavia/policies/amphora.py +6 -12
- octavia/policies/availability_zone.py +5 -10
- octavia/policies/availability_zone_profile.py +5 -15
- octavia/policies/base.py +1 -20
- octavia/policies/flavor.py +5 -10
- octavia/policies/flavor_profile.py +5 -10
- octavia/policies/healthmonitor.py +6 -12
- octavia/policies/l7policy.py +6 -12
- octavia/policies/l7rule.py +5 -10
- octavia/policies/listener.py +7 -14
- octavia/policies/loadbalancer.py +9 -18
- octavia/policies/member.py +5 -10
- octavia/policies/pool.py +6 -12
- octavia/policies/provider.py +1 -2
- octavia/policies/provider_availability_zone.py +1 -3
- octavia/policies/provider_flavor.py +1 -2
- octavia/policies/quota.py +6 -12
- octavia/statistics/stats_base.py +1 -1
- octavia/tests/common/constants.py +1 -1
- octavia/tests/common/data_model_helpers.py +10 -10
- octavia/tests/common/sample_data_models.py +1 -1
- octavia/tests/common/sample_haproxy_prometheus +17 -17
- octavia/tests/common/sample_octavia_prometheus +6 -6
- octavia/tests/common/utils.py +2 -2
- octavia/tests/functional/amphorae/backend/agent/api_server/test_keepalivedlvs.py +36 -62
- octavia/tests/functional/amphorae/backend/agent/api_server/test_server.py +135 -296
- octavia/tests/functional/api/drivers/driver_agent/test_driver_agent.py +10 -11
- octavia/tests/functional/api/v2/base.py +2 -3
- octavia/tests/functional/api/v2/test_amphora.py +6 -6
- octavia/tests/functional/api/v2/test_availability_zone_profiles.py +13 -14
- octavia/tests/functional/api/v2/test_availability_zones.py +19 -19
- octavia/tests/functional/api/v2/test_flavor_profiles.py +19 -20
- octavia/tests/functional/api/v2/test_flavors.py +25 -25
- octavia/tests/functional/api/v2/test_health_monitor.py +35 -18
- octavia/tests/functional/api/v2/test_l7policy.py +11 -11
- octavia/tests/functional/api/v2/test_l7rule.py +19 -20
- octavia/tests/functional/api/v2/test_listener.py +26 -28
- octavia/tests/functional/api/v2/test_load_balancer.py +17 -17
- octavia/tests/functional/api/v2/test_member.py +53 -21
- octavia/tests/functional/api/v2/test_pool.py +11 -11
- octavia/tests/functional/api/v2/test_provider.py +7 -7
- octavia/tests/functional/api/v2/test_quotas.py +9 -9
- octavia/tests/functional/db/test_models.py +1 -1
- octavia/tests/functional/db/test_repositories.py +2 -2
- octavia/tests/unit/amphorae/backends/agent/api_server/test_amphora_info.py +60 -61
- octavia/tests/unit/amphorae/backends/agent/api_server/test_keepalived.py +3 -3
- octavia/tests/unit/amphorae/backends/agent/api_server/test_keepalivedlvs.py +1 -19
- octavia/tests/unit/amphorae/backends/agent/api_server/test_loadbalancer.py +94 -34
- octavia/tests/unit/amphorae/backends/agent/api_server/test_osutils.py +19 -21
- octavia/tests/unit/amphorae/backends/agent/api_server/test_plug.py +9 -11
- octavia/tests/unit/amphorae/backends/agent/api_server/test_util.py +11 -25
- octavia/tests/unit/amphorae/backends/agent/test_agent_jinja_cfg.py +0 -13
- octavia/tests/unit/amphorae/backends/health_daemon/test_health_daemon.py +10 -10
- octavia/tests/unit/amphorae/backends/utils/test_haproxy_query.py +1 -1
- octavia/tests/unit/amphorae/backends/utils/test_interface.py +33 -94
- octavia/tests/unit/amphorae/backends/utils/test_interface_file.py +32 -32
- octavia/tests/unit/amphorae/backends/utils/test_network_namespace.py +4 -6
- octavia/tests/unit/amphorae/backends/utils/test_nftable_utils.py +28 -22
- octavia/tests/unit/amphorae/drivers/haproxy/test_rest_api_driver_1_0.py +77 -118
- octavia/tests/unit/amphorae/drivers/health/test_heartbeat_udp.py +8 -8
- octavia/tests/unit/amphorae/drivers/keepalived/jinja/test_jinja_cfg.py +0 -4
- octavia/tests/unit/api/common/test_pagination.py +84 -14
- octavia/tests/unit/api/v2/types/test_availability_zone_profile.py +1 -1
- octavia/tests/unit/api/v2/types/test_availability_zones.py +1 -1
- octavia/tests/unit/api/v2/types/test_flavor_profile.py +1 -1
- octavia/tests/unit/api/v2/types/test_flavors.py +1 -1
- octavia/tests/unit/api/v2/types/test_health_monitor.py +1 -1
- octavia/tests/unit/api/v2/types/test_listener.py +1 -1
- octavia/tests/unit/api/v2/types/test_load_balancer.py +1 -1
- octavia/tests/unit/api/v2/types/test_pool.py +1 -1
- octavia/tests/unit/base.py +1 -0
- octavia/tests/unit/certificates/generator/local_csr.py +1 -1
- octavia/tests/unit/certificates/generator/test_local.py +5 -5
- octavia/tests/unit/certificates/manager/test_barbican.py +2 -3
- octavia/tests/unit/certificates/manager/test_barbican_legacy.py +1 -1
- octavia/tests/unit/certificates/manager/test_local.py +13 -14
- octavia/tests/unit/cmd/test_health_checker.py +1 -1
- octavia/tests/unit/cmd/test_prometheus_proxy.py +8 -1
- octavia/tests/unit/common/jinja/haproxy/combined_listeners/test_jinja_cfg.py +171 -216
- octavia/tests/unit/common/jinja/logging/test_logging_jinja_cfg.py +1 -1
- octavia/tests/unit/common/sample_configs/sample_configs_combined.py +1 -2
- octavia/tests/unit/common/test_base_taskflow.py +1 -1
- octavia/tests/unit/common/test_decorators.py +2 -2
- octavia/tests/unit/common/test_policy.py +3 -6
- octavia/tests/unit/common/tls_utils/test_cert_parser.py +4 -1
- octavia/tests/unit/controller/worker/v2/flows/test_listener_flows.py +10 -15
- octavia/tests/unit/controller/worker/v2/flows/test_load_balancer_flows.py +4 -6
- octavia/tests/unit/controller/worker/v2/tasks/test_network_tasks.py +6 -2
- octavia/tests/unit/controller/worker/v2/tasks/test_retry_tasks.py +1 -1
- octavia/tests/unit/controller/worker/v2/test_controller_worker.py +56 -1
- octavia/tests/unit/controller/worker/v2/test_taskflow_jobboard_driver.py +348 -0
- octavia/tests/unit/hacking/test_checks.py +3 -3
- octavia/tests/unit/image/drivers/noop_driver/test_driver.py +1 -1
- octavia/tests/unit/image/drivers/test_glance_driver.py +1 -1
- octavia/tests/unit/network/drivers/neutron/test_base.py +1 -1
- octavia/tests/unit/statistics/drivers/test_update_db.py +1 -1
- octavia/tests/unit/statistics/test_stats_base.py +1 -1
- octavia/volume/drivers/noop_driver/driver.py +1 -1
- octavia/volume/volume_base.py +1 -1
- {octavia-14.0.0.dist-info → octavia-15.0.0.0rc1.dist-info}/AUTHORS +6 -0
- {octavia-14.0.0.dist-info → octavia-15.0.0.0rc1.dist-info}/METADATA +3 -5
- {octavia-14.0.0.dist-info → octavia-15.0.0.0rc1.dist-info}/RECORD +302 -305
- octavia-15.0.0.0rc1.dist-info/pbr.json +1 -0
- octavia/amphorae/backends/agent/api_server/templates/keepalived.sysvinit.j2 +0 -87
- octavia/amphorae/backends/agent/api_server/templates/keepalived.upstart.j2 +0 -29
- octavia/amphorae/backends/agent/api_server/templates/sysvinit.conf.j2 +0 -232
- octavia/amphorae/backends/agent/api_server/templates/upstart.conf.j2 +0 -71
- octavia-14.0.0.dist-info/pbr.json +0 -1
- {octavia-14.0.0.data → octavia-15.0.0.0rc1.data}/data/share/octavia/LICENSE +0 -0
- {octavia-14.0.0.data → octavia-15.0.0.0rc1.data}/data/share/octavia/README.rst +0 -0
- {octavia-14.0.0.data → octavia-15.0.0.0rc1.data}/data/share/octavia/diskimage-create/README.rst +0 -0
- {octavia-14.0.0.data → octavia-15.0.0.0rc1.data}/data/share/octavia/diskimage-create/diskimage-create.sh +0 -0
- {octavia-14.0.0.data → octavia-15.0.0.0rc1.data}/data/share/octavia/diskimage-create/image-tests.sh +0 -0
- {octavia-14.0.0.data → octavia-15.0.0.0rc1.data}/data/share/octavia/diskimage-create/requirements.txt +0 -0
- {octavia-14.0.0.data → octavia-15.0.0.0rc1.data}/data/share/octavia/diskimage-create/test-requirements.txt +0 -0
- {octavia-14.0.0.data → octavia-15.0.0.0rc1.data}/data/share/octavia/diskimage-create/tox.ini +0 -0
- {octavia-14.0.0.data → octavia-15.0.0.0rc1.data}/data/share/octavia/diskimage-create/version.txt +0 -0
- {octavia-14.0.0.data → octavia-15.0.0.0rc1.data}/scripts/octavia-wsgi +0 -0
- {octavia-14.0.0.dist-info → octavia-15.0.0.0rc1.dist-info}/LICENSE +0 -0
- {octavia-14.0.0.dist-info → octavia-15.0.0.0rc1.dist-info}/WHEEL +0 -0
- {octavia-14.0.0.dist-info → octavia-15.0.0.0rc1.dist-info}/entry_points.txt +0 -0
- {octavia-14.0.0.dist-info → octavia-15.0.0.0rc1.dist-info}/top_level.txt +0 -0
@@ -56,6 +56,8 @@ class ListenerTestCase(base.TestCase):
|
|
56
56
|
consts.OFFLINE,
|
57
57
|
self.test_loadbalancer._check_haproxy_status(LISTENER_ID1))
|
58
58
|
|
59
|
+
@mock.patch('time.sleep')
|
60
|
+
@mock.patch('octavia.amphorae.backends.agent.api_server.loadbalancer.LOG')
|
59
61
|
@mock.patch('octavia.amphorae.backends.agent.api_server.loadbalancer.'
|
60
62
|
'Loadbalancer._check_haproxy_status')
|
61
63
|
@mock.patch('octavia.amphorae.backends.agent.api_server.util.'
|
@@ -67,7 +69,7 @@ class ListenerTestCase(base.TestCase):
|
|
67
69
|
@mock.patch('octavia.amphorae.backends.utils.haproxy_query.HAProxyQuery')
|
68
70
|
def test_start_stop_lb(self, mock_haproxy_query, mock_check_output,
|
69
71
|
mock_lb_exists, mock_path_exists, mock_vrrp_update,
|
70
|
-
mock_check_status):
|
72
|
+
mock_check_status, mock_LOG, mock_time_sleep):
|
71
73
|
listener_id = uuidutils.generate_uuid()
|
72
74
|
|
73
75
|
conf = self.useFixture(oslo_fixture.Config(cfg.CONF))
|
@@ -76,21 +78,21 @@ class ListenerTestCase(base.TestCase):
|
|
76
78
|
mock_check_status.side_effect = ['bogus', consts.OFFLINE]
|
77
79
|
|
78
80
|
# Happy path - No VRRP
|
79
|
-
|
80
|
-
|
81
|
-
ref_command_split.append(consts.AMP_ACTION_START)
|
81
|
+
cmd = "systemctl {action} haproxy-{listener_id}.service".format(
|
82
|
+
action=consts.AMP_ACTION_START, listener_id=listener_id)
|
82
83
|
|
83
84
|
result = self.test_loadbalancer.start_stop_lb(
|
84
85
|
listener_id, consts.AMP_ACTION_START)
|
85
86
|
|
86
|
-
mock_check_output.assert_called_once_with(
|
87
|
-
stderr=subprocess.STDOUT
|
87
|
+
mock_check_output.assert_called_once_with(cmd.split(),
|
88
|
+
stderr=subprocess.STDOUT,
|
89
|
+
encoding='utf-8')
|
88
90
|
mock_lb_exists.assert_called_once_with(listener_id)
|
89
91
|
mock_vrrp_update.assert_not_called()
|
90
92
|
self.assertEqual(202, result.status_code)
|
91
93
|
self.assertEqual('OK', result.json['message'])
|
92
94
|
ref_details = ('Configuration file is valid\n'
|
93
|
-
'haproxy daemon for {
|
95
|
+
'haproxy daemon for {} started'.format(listener_id))
|
94
96
|
self.assertEqual(ref_details, result.json['details'])
|
95
97
|
|
96
98
|
# Happy path - VRRP - RELOAD
|
@@ -101,22 +103,21 @@ class ListenerTestCase(base.TestCase):
|
|
101
103
|
mock_vrrp_update.reset_mock()
|
102
104
|
mock_check_output.reset_mock()
|
103
105
|
|
104
|
-
|
105
|
-
|
106
|
-
ref_command_split.append(consts.AMP_ACTION_RELOAD)
|
106
|
+
cmd = "systemctl {action} haproxy-{listener_id}.service".format(
|
107
|
+
action=consts.AMP_ACTION_RELOAD, listener_id=listener_id)
|
107
108
|
|
108
109
|
result = self.test_loadbalancer.start_stop_lb(
|
109
110
|
listener_id, consts.AMP_ACTION_RELOAD)
|
110
111
|
|
111
|
-
mock_check_output.assert_called_once_with(
|
112
|
-
stderr=subprocess.STDOUT
|
112
|
+
mock_check_output.assert_called_once_with(cmd.split(),
|
113
|
+
stderr=subprocess.STDOUT,
|
114
|
+
encoding='utf-8')
|
113
115
|
mock_lb_exists.assert_called_once_with(listener_id)
|
114
116
|
mock_vrrp_update.assert_called_once_with(listener_id,
|
115
117
|
consts.AMP_ACTION_RELOAD)
|
116
118
|
self.assertEqual(202, result.status_code)
|
117
119
|
self.assertEqual('OK', result.json['message'])
|
118
|
-
ref_details =
|
119
|
-
consts.AMP_ACTION_RELOAD))
|
120
|
+
ref_details = f'Listener {listener_id} {consts.AMP_ACTION_RELOAD}ed'
|
120
121
|
self.assertEqual(ref_details, result.json['details'])
|
121
122
|
|
122
123
|
# Happy path - VRRP - RELOAD - OFFLINE
|
@@ -124,22 +125,22 @@ class ListenerTestCase(base.TestCase):
|
|
124
125
|
mock_vrrp_update.reset_mock()
|
125
126
|
mock_check_output.reset_mock()
|
126
127
|
|
127
|
-
|
128
|
-
|
129
|
-
ref_command_split.append(consts.AMP_ACTION_START)
|
128
|
+
cmd = "systemctl {action} haproxy-{listener_id}.service".format(
|
129
|
+
action=consts.AMP_ACTION_START, listener_id=listener_id)
|
130
130
|
|
131
131
|
result = self.test_loadbalancer.start_stop_lb(
|
132
132
|
listener_id, consts.AMP_ACTION_RELOAD)
|
133
133
|
|
134
|
-
mock_check_output.assert_called_once_with(
|
135
|
-
stderr=subprocess.STDOUT
|
134
|
+
mock_check_output.assert_called_once_with(cmd.split(),
|
135
|
+
stderr=subprocess.STDOUT,
|
136
|
+
encoding='utf-8')
|
136
137
|
mock_lb_exists.assert_called_once_with(listener_id)
|
137
138
|
mock_vrrp_update.assert_called_once_with(listener_id,
|
138
139
|
consts.AMP_ACTION_RELOAD)
|
139
140
|
self.assertEqual(202, result.status_code)
|
140
141
|
self.assertEqual('OK', result.json['message'])
|
141
142
|
ref_details = ('Configuration file is valid\n'
|
142
|
-
'haproxy daemon for {
|
143
|
+
'haproxy daemon for {} started'.format(listener_id))
|
143
144
|
self.assertEqual(ref_details, result.json['details'])
|
144
145
|
|
145
146
|
# Unhappy path - Not already running
|
@@ -150,22 +151,22 @@ class ListenerTestCase(base.TestCase):
|
|
150
151
|
mock_vrrp_update.reset_mock()
|
151
152
|
mock_check_output.reset_mock()
|
152
153
|
|
153
|
-
|
154
|
-
|
155
|
-
ref_command_split.append(consts.AMP_ACTION_START)
|
154
|
+
cmd = "systemctl {action} haproxy-{listener_id}.service".format(
|
155
|
+
action=consts.AMP_ACTION_START, listener_id=listener_id)
|
156
156
|
|
157
157
|
mock_check_output.side_effect = subprocess.CalledProcessError(
|
158
|
-
output=
|
158
|
+
output='bogus', returncode=-2, cmd='sit')
|
159
159
|
|
160
160
|
result = self.test_loadbalancer.start_stop_lb(
|
161
161
|
listener_id, consts.AMP_ACTION_START)
|
162
162
|
|
163
|
-
mock_check_output.assert_called_once_with(
|
164
|
-
stderr=subprocess.STDOUT
|
163
|
+
mock_check_output.assert_called_once_with(cmd.split(),
|
164
|
+
stderr=subprocess.STDOUT,
|
165
|
+
encoding='utf-8')
|
165
166
|
mock_lb_exists.assert_called_once_with(listener_id)
|
166
167
|
mock_vrrp_update.assert_not_called()
|
167
168
|
self.assertEqual(500, result.status_code)
|
168
|
-
self.assertEqual('Error {}ing haproxy'
|
169
|
+
self.assertEqual(f'Error {consts.AMP_ACTION_START}ing haproxy',
|
169
170
|
result.json['message'])
|
170
171
|
self.assertEqual('bogus', result.json['details'])
|
171
172
|
|
@@ -174,24 +175,24 @@ class ListenerTestCase(base.TestCase):
|
|
174
175
|
mock_vrrp_update.reset_mock()
|
175
176
|
mock_check_output.reset_mock()
|
176
177
|
|
177
|
-
|
178
|
-
|
179
|
-
ref_command_split.append(consts.AMP_ACTION_START)
|
178
|
+
cmd = "systemctl {action} haproxy-{listener_id}.service".format(
|
179
|
+
action=consts.AMP_ACTION_START, listener_id=listener_id)
|
180
180
|
|
181
181
|
mock_check_output.side_effect = subprocess.CalledProcessError(
|
182
|
-
output=
|
182
|
+
output='Job is already running', returncode=-2, cmd='sit')
|
183
183
|
|
184
184
|
result = self.test_loadbalancer.start_stop_lb(
|
185
185
|
listener_id, consts.AMP_ACTION_START)
|
186
186
|
|
187
|
-
mock_check_output.assert_called_once_with(
|
188
|
-
stderr=subprocess.STDOUT
|
187
|
+
mock_check_output.assert_called_once_with(cmd.split(),
|
188
|
+
stderr=subprocess.STDOUT,
|
189
|
+
encoding='utf-8')
|
189
190
|
mock_lb_exists.assert_called_once_with(listener_id)
|
190
191
|
mock_vrrp_update.assert_not_called()
|
191
192
|
self.assertEqual(202, result.status_code)
|
192
193
|
self.assertEqual('OK', result.json['message'])
|
193
194
|
ref_details = ('Configuration file is valid\n'
|
194
|
-
'haproxy daemon for {
|
195
|
+
'haproxy daemon for {} started'.format(listener_id))
|
195
196
|
self.assertEqual(ref_details, result.json['details'])
|
196
197
|
|
197
198
|
# Invalid action
|
@@ -208,6 +209,65 @@ class ListenerTestCase(base.TestCase):
|
|
208
209
|
mock_vrrp_update.assert_not_called()
|
209
210
|
mock_check_output.assert_not_called()
|
210
211
|
|
212
|
+
# haproxy error on reload
|
213
|
+
mock_check_output.reset_mock()
|
214
|
+
mock_lb_exists.reset_mock()
|
215
|
+
mock_path_exists.reset_mock()
|
216
|
+
mock_vrrp_update.reset_mock()
|
217
|
+
mock_check_status.reset_mock()
|
218
|
+
mock_LOG.reset_mock()
|
219
|
+
|
220
|
+
mock_check_output.side_effect = [
|
221
|
+
subprocess.CalledProcessError(
|
222
|
+
output='haproxy.service is not active, cannot reload.',
|
223
|
+
returncode=-2, cmd='service'),
|
224
|
+
None]
|
225
|
+
mock_check_status.return_value = 'ACTIVE'
|
226
|
+
mock_check_status.side_effect = None
|
227
|
+
|
228
|
+
mock_query = mock.Mock()
|
229
|
+
mock_haproxy_query.return_value = mock_query
|
230
|
+
mock_query.show_info.side_effect = [Exception("error"),
|
231
|
+
{'Uptime_sec': 5}]
|
232
|
+
|
233
|
+
result = self.test_loadbalancer.start_stop_lb(listener_id, 'reload')
|
234
|
+
self.assertEqual(202, result.status_code)
|
235
|
+
|
236
|
+
LOG_last_call = mock_LOG.mock_calls[-1]
|
237
|
+
self.assertIn('An error occured with haproxy', LOG_last_call[1][0])
|
238
|
+
|
239
|
+
# haproxy error on reload - retry limit
|
240
|
+
print("--")
|
241
|
+
mock_check_output.reset_mock()
|
242
|
+
mock_lb_exists.reset_mock()
|
243
|
+
mock_path_exists.reset_mock()
|
244
|
+
mock_vrrp_update.reset_mock()
|
245
|
+
mock_check_status.reset_mock()
|
246
|
+
mock_LOG.reset_mock()
|
247
|
+
|
248
|
+
mock_check_output.side_effect = [
|
249
|
+
subprocess.CalledProcessError(
|
250
|
+
output='haproxy.service is not active, cannot reload.',
|
251
|
+
returncode=-2, cmd='service'),
|
252
|
+
subprocess.CalledProcessError(
|
253
|
+
output='haproxy.service is not active, cannot reload.',
|
254
|
+
returncode=-2, cmd='service'),
|
255
|
+
subprocess.CalledProcessError(
|
256
|
+
output='haproxy.service is not active, cannot reload.',
|
257
|
+
returncode=-2, cmd='service')]
|
258
|
+
mock_check_status.return_value = 'ACTIVE'
|
259
|
+
mock_check_status.side_effect = None
|
260
|
+
|
261
|
+
mock_query = mock.Mock()
|
262
|
+
mock_haproxy_query.return_value = mock_query
|
263
|
+
mock_query.show_info.side_effect = Exception("error")
|
264
|
+
|
265
|
+
result = self.test_loadbalancer.start_stop_lb(listener_id, 'reload')
|
266
|
+
self.assertEqual(500, result.status_code)
|
267
|
+
self.assertEqual('Error reloading haproxy', result.json['message'])
|
268
|
+
self.assertEqual('haproxy.service is not active, cannot reload.',
|
269
|
+
result.json['details'])
|
270
|
+
|
211
271
|
@mock.patch('octavia.amphorae.backends.agent.api_server.util.'
|
212
272
|
'config_path')
|
213
273
|
@mock.patch('octavia.amphorae.backends.agent.api_server.util.'
|
@@ -67,10 +67,8 @@ class TestOSUtils(base.TestCase):
|
|
67
67
|
|
68
68
|
def test_cmd_get_version_of_installed_package(self):
|
69
69
|
package_name = 'foo'
|
70
|
-
ubuntu_cmd = "dpkg-query -W -f=${{Version}} {
|
71
|
-
|
72
|
-
rh_cmd = "rpm -q --queryformat %{{VERSION}} {name}".format(
|
73
|
-
name=package_name)
|
70
|
+
ubuntu_cmd = f"dpkg-query -W -f=${{Version}} {package_name}"
|
71
|
+
rh_cmd = f"rpm -q --queryformat %{{VERSION}} {package_name}"
|
74
72
|
|
75
73
|
returned_ubuntu_cmd = (
|
76
74
|
self.ubuntu_os_util.cmd_get_version_of_installed_package(
|
@@ -113,19 +111,19 @@ class TestOSUtils(base.TestCase):
|
|
113
111
|
@mock.patch('octavia.amphorae.backends.utils.interface_file.'
|
114
112
|
'VIPInterfaceFile')
|
115
113
|
def test_write_vip_interface_file(self, mock_vip_interface_file):
|
116
|
-
netns_interface =
|
117
|
-
FIXED_IP =
|
118
|
-
SUBNET_CIDR =
|
119
|
-
GATEWAY =
|
120
|
-
DEST1 =
|
121
|
-
DEST2 =
|
122
|
-
NEXTHOP =
|
114
|
+
netns_interface = 'eth1234'
|
115
|
+
FIXED_IP = '192.0.2.2'
|
116
|
+
SUBNET_CIDR = '192.0.2.0/24'
|
117
|
+
GATEWAY = '192.51.100.1'
|
118
|
+
DEST1 = '198.51.100.0/24'
|
119
|
+
DEST2 = '203.0.113.0/24'
|
120
|
+
NEXTHOP = '192.0.2.1'
|
123
121
|
MTU = 1450
|
124
|
-
FIXED_IP_IPV6 =
|
122
|
+
FIXED_IP_IPV6 = '2001:0db8:0000:0000:0000:0000:0000:000a'
|
125
123
|
# Subnet prefix is purposefully not 32, because that coincidentally
|
126
124
|
# matches the result of any arbitrary IPv4->prefixlen conversion
|
127
|
-
SUBNET_CIDR_IPV6 =
|
128
|
-
GATEWAY_IPV6 =
|
125
|
+
SUBNET_CIDR_IPV6 = '2001:db8::/70'
|
126
|
+
GATEWAY_IPV6 = '2001:0db8:0000:0000:0000:0000:0000:0001'
|
129
127
|
|
130
128
|
ip = ipaddress.ip_address(FIXED_IP)
|
131
129
|
network = ipaddress.ip_network(SUBNET_CIDR)
|
@@ -200,15 +198,15 @@ class TestOSUtils(base.TestCase):
|
|
200
198
|
@mock.patch('octavia.amphorae.backends.utils.interface_file.'
|
201
199
|
'PortInterfaceFile')
|
202
200
|
def test_write_port_interface_file(self, mock_port_interface_file):
|
203
|
-
FIXED_IP =
|
204
|
-
NEXTHOP =
|
205
|
-
DEST =
|
201
|
+
FIXED_IP = '192.0.2.2'
|
202
|
+
NEXTHOP = '192.0.2.1'
|
203
|
+
DEST = '198.51.100.0/24'
|
206
204
|
host_routes = [
|
207
205
|
{'nexthop': NEXTHOP, 'destination': ipaddress.ip_network(DEST)}
|
208
206
|
]
|
209
|
-
FIXED_IP_IPV6 =
|
210
|
-
NEXTHOP_IPV6 =
|
211
|
-
DEST_IPV6 =
|
207
|
+
FIXED_IP_IPV6 = '2001:db8::2'
|
208
|
+
NEXTHOP_IPV6 = '2001:db8::1'
|
209
|
+
DEST_IPV6 = '2001:db8:51:100::/64'
|
212
210
|
host_routes_ipv6 = [
|
213
211
|
{'nexthop': NEXTHOP_IPV6,
|
214
212
|
'destination': ipaddress.ip_network(DEST_IPV6)}
|
@@ -229,5 +227,5 @@ class TestOSUtils(base.TestCase):
|
|
229
227
|
mock_port_interface_file.assert_called_once_with(
|
230
228
|
name=netns_interface,
|
231
229
|
fixed_ips=fixed_ips,
|
232
|
-
mtu=MTU)
|
230
|
+
mtu=MTU, is_sriov=False)
|
233
231
|
mock_port_interface_file.return_value.write.assert_called_once()
|
@@ -111,8 +111,7 @@ class TestPlug(base.TestCase):
|
|
111
111
|
)
|
112
112
|
mock_webob.Response.assert_any_call(json={
|
113
113
|
'message': 'OK',
|
114
|
-
'details': 'VIPs plugged on interface
|
115
|
-
vips=FAKE_IP_IPV4, interface='eth1')
|
114
|
+
'details': f'VIPs plugged on interface eth1: {FAKE_IP_IPV4}'
|
116
115
|
}, status=202)
|
117
116
|
|
118
117
|
@mock.patch('octavia.amphorae.backends.agent.api_server.plug.Plug.'
|
@@ -140,8 +139,8 @@ class TestPlug(base.TestCase):
|
|
140
139
|
)
|
141
140
|
mock_webob.Response.assert_any_call(json={
|
142
141
|
'message': 'OK',
|
143
|
-
'details': 'VIPs plugged on interface
|
144
|
-
|
142
|
+
'details': f'VIPs plugged on interface eth1: '
|
143
|
+
f'{FAKE_IP_IPV6_EXPANDED}'
|
145
144
|
}, status=202)
|
146
145
|
|
147
146
|
@mock.patch('octavia.amphorae.backends.agent.api_server.plug.Plug.'
|
@@ -285,7 +284,7 @@ class TestPlug(base.TestCase):
|
|
285
284
|
self.test_plug.plug_network(FAKE_MAC_ADDRESS, fixed_ips, 1400)
|
286
285
|
|
287
286
|
mock_write_port_interface.assert_called_once_with(
|
288
|
-
interface='eth2', fixed_ips=fixed_ips, mtu=mtu)
|
287
|
+
interface='eth2', fixed_ips=fixed_ips, mtu=mtu, is_sriov=False)
|
289
288
|
mock_if_up.assert_called_once_with('eth2', 'network')
|
290
289
|
mock_send_member_adv.assert_called_once_with(fixed_ips)
|
291
290
|
|
@@ -332,14 +331,14 @@ class TestPlug(base.TestCase):
|
|
332
331
|
self.test_plug.plug_network(FAKE_MAC_ADDRESS, fixed_ips, 1400)
|
333
332
|
|
334
333
|
mock_write_port_interface.assert_called_once_with(
|
335
|
-
interface=FAKE_INTERFACE, fixed_ips=fixed_ips, mtu=mtu
|
334
|
+
interface=FAKE_INTERFACE, fixed_ips=fixed_ips, mtu=mtu,
|
335
|
+
is_sriov=False)
|
336
336
|
mock_if_up.assert_called_once_with(FAKE_INTERFACE, 'network')
|
337
337
|
mock_send_member_adv.assert_called_once_with(fixed_ips)
|
338
338
|
|
339
339
|
mock_webob.Response.assert_any_call(
|
340
340
|
json={'message': 'OK',
|
341
|
-
'details': 'Updated existing interface {}'
|
342
|
-
FAKE_INTERFACE)},
|
341
|
+
'details': f'Updated existing interface {FAKE_INTERFACE}'},
|
343
342
|
status=202)
|
344
343
|
|
345
344
|
@mock.patch.object(plug, "webob")
|
@@ -401,15 +400,14 @@ class TestPlug(base.TestCase):
|
|
401
400
|
'gateway': vip_net_info['gateway'],
|
402
401
|
'host_routes': [],
|
403
402
|
},
|
404
|
-
fixed_ips=fixed_ips, mtu=mtu)
|
403
|
+
fixed_ips=fixed_ips, mtu=mtu, is_sriov=False)
|
405
404
|
|
406
405
|
mock_if_up.assert_called_once_with(FAKE_INTERFACE, 'vip')
|
407
406
|
mock_send_member_adv.assert_called_once_with(fixed_ips)
|
408
407
|
|
409
408
|
mock_webob.Response.assert_any_call(
|
410
409
|
json={'message': 'OK',
|
411
|
-
'details': 'Updated existing interface {}'
|
412
|
-
FAKE_INTERFACE)},
|
410
|
+
'details': f'Updated existing interface {FAKE_INTERFACE}'},
|
413
411
|
status=202)
|
414
412
|
|
415
413
|
@mock.patch('pyroute2.NetNS', create=True)
|
@@ -51,31 +51,11 @@ class TestUtil(base.TestCase):
|
|
51
51
|
self.assertEqual(fake_path, result)
|
52
52
|
|
53
53
|
def test_keepalived_lvs_init_path(self):
|
54
|
-
# Test systemd
|
55
54
|
ref_path = (consts.SYSTEMD_DIR + '/' +
|
56
|
-
consts.
|
57
|
-
result = util.keepalived_lvs_init_path(
|
58
|
-
self.listener_id)
|
55
|
+
consts.KEEPALIVEDLVS_SYSTEMD % self.listener_id)
|
56
|
+
result = util.keepalived_lvs_init_path(self.listener_id)
|
59
57
|
self.assertEqual(ref_path, result)
|
60
58
|
|
61
|
-
# Test upstart
|
62
|
-
ref_path = (consts.UPSTART_DIR + '/' +
|
63
|
-
consts.KEEPALIVED_UPSTART_PREFIX % str(self.listener_id))
|
64
|
-
result = util.keepalived_lvs_init_path(consts.INIT_UPSTART,
|
65
|
-
self.listener_id)
|
66
|
-
self.assertEqual(ref_path, result)
|
67
|
-
|
68
|
-
# Test sysvinit
|
69
|
-
ref_path = (consts.SYSVINIT_DIR + '/' +
|
70
|
-
consts.KEEPALIVED_SYSVINIT_PREFIX % str(self.listener_id))
|
71
|
-
result = util.keepalived_lvs_init_path(consts.INIT_SYSVINIT,
|
72
|
-
self.listener_id)
|
73
|
-
self.assertEqual(ref_path, result)
|
74
|
-
|
75
|
-
# Test bad init system
|
76
|
-
self.assertRaises(util.UnknownInitError, util.keepalived_lvs_init_path,
|
77
|
-
'bogus_init', self.listener_id)
|
78
|
-
|
79
59
|
def test_keepalived_lvs_pids_path(self):
|
80
60
|
fake_path = '/fake/path'
|
81
61
|
self.CONF.config(group="haproxy_amphora", base_path=fake_path)
|
@@ -162,11 +142,17 @@ class TestUtil(base.TestCase):
|
|
162
142
|
|
163
143
|
util.run_systemctl_command('test', 'world')
|
164
144
|
mock_check_output.assert_called_once_with(
|
165
|
-
['systemctl', 'test', 'world'], stderr=subprocess.STDOUT
|
145
|
+
['systemctl', 'test', 'world'], stderr=subprocess.STDOUT,
|
146
|
+
encoding='utf-8')
|
166
147
|
|
167
148
|
mock_check_output.side_effect = subprocess.CalledProcessError(1,
|
168
149
|
'boom')
|
169
|
-
|
150
|
+
self.assertRaises(subprocess.CalledProcessError,
|
151
|
+
util.run_systemctl_command, 'test', 'world')
|
152
|
+
|
153
|
+
mock_check_output.side_effect = subprocess.CalledProcessError(1,
|
154
|
+
'boom')
|
155
|
+
util.run_systemctl_command('test', 'world', False)
|
170
156
|
|
171
157
|
@mock.patch('octavia.amphorae.backends.agent.api_server.util.config_path')
|
172
158
|
@mock.patch('octavia.amphorae.backends.agent.api_server.util.'
|
@@ -275,7 +261,7 @@ class TestUtil(base.TestCase):
|
|
275
261
|
pass
|
276
262
|
|
277
263
|
# Bad listener mode
|
278
|
-
fake_cfg = 'stats socket foo\nfrontend {}\nmode\n'
|
264
|
+
fake_cfg = f'stats socket foo\nfrontend {LISTENER_ID1}\nmode\n'
|
279
265
|
self.useFixture(test_utils.OpenFixture(path, fake_cfg))
|
280
266
|
self.assertRaises(util.ParsingError, util.parse_haproxy_file,
|
281
267
|
LISTENER_ID1)
|
@@ -39,14 +39,11 @@ class AgentJinjaTestCase(base.TestCase):
|
|
39
39
|
amphora_udp_driver='keepalived_lvs'),
|
40
40
|
self.conf.config(group="haproxy_amphora",
|
41
41
|
base_cert_dir='/var/lib/octavia/certs')
|
42
|
-
self.conf.config(group="haproxy_amphora", use_upstart='True')
|
43
42
|
self.conf.config(group="haproxy_amphora", base_path='/var/lib/octavia')
|
44
43
|
self.conf.config(group="haproxy_amphora", bind_host='0.0.0.0')
|
45
44
|
self.conf.config(group="haproxy_amphora", bind_port=9443)
|
46
45
|
self.conf.config(group="haproxy_amphora",
|
47
46
|
haproxy_cmd='/usr/sbin/haproxy')
|
48
|
-
self.conf.config(group="haproxy_amphora", respawn_count=2)
|
49
|
-
self.conf.config(group="haproxy_amphora", respawn_interval=2)
|
50
47
|
self.conf.config(group="health_manager",
|
51
48
|
controller_ip_port_list=['192.0.2.10:5555'])
|
52
49
|
self.conf.config(group="health_manager", heartbeat_interval=10)
|
@@ -68,9 +65,6 @@ class AgentJinjaTestCase(base.TestCase):
|
|
68
65
|
'bind_host = 0.0.0.0\n'
|
69
66
|
'bind_port = 9443\n'
|
70
67
|
'haproxy_cmd = /usr/sbin/haproxy\n'
|
71
|
-
'respawn_count = 2\n'
|
72
|
-
'respawn_interval = 2\n'
|
73
|
-
'use_upstart = True\n'
|
74
68
|
'user_log_facility = 0\n'
|
75
69
|
'administrative_log_facility = 1\n\n'
|
76
70
|
'[health_manager]\n'
|
@@ -96,7 +90,6 @@ class AgentJinjaTestCase(base.TestCase):
|
|
96
90
|
|
97
91
|
def test_build_agent_config_with_interfaces_file(self):
|
98
92
|
ajc = agent_jinja_cfg.AgentJinjaTemplater()
|
99
|
-
self.conf.config(group="haproxy_amphora", use_upstart='False')
|
100
93
|
self.conf.config(group="amphora_agent",
|
101
94
|
administrative_log_facility=1)
|
102
95
|
self.conf.config(group="amphora_agent", user_log_facility=0)
|
@@ -110,9 +103,6 @@ class AgentJinjaTestCase(base.TestCase):
|
|
110
103
|
'bind_host = 0.0.0.0\n'
|
111
104
|
'bind_port = 9443\n'
|
112
105
|
'haproxy_cmd = /usr/sbin/haproxy\n'
|
113
|
-
'respawn_count = 2\n'
|
114
|
-
'respawn_interval = 2\n'
|
115
|
-
'use_upstart = False\n'
|
116
106
|
'user_log_facility = 0\n'
|
117
107
|
'administrative_log_facility = 1\n\n'
|
118
108
|
'[health_manager]\n'
|
@@ -154,9 +144,6 @@ class AgentJinjaTestCase(base.TestCase):
|
|
154
144
|
'bind_host = 0.0.0.0\n'
|
155
145
|
'bind_port = 9443\n'
|
156
146
|
'haproxy_cmd = /usr/sbin/haproxy\n'
|
157
|
-
'respawn_count = 2\n'
|
158
|
-
'respawn_interval = 2\n'
|
159
|
-
'use_upstart = True\n'
|
160
147
|
'user_log_facility = 0\n'
|
161
148
|
'administrative_log_facility = 1\n\n'
|
162
149
|
'[health_manager]\n'
|
@@ -12,6 +12,7 @@
|
|
12
12
|
# License for the specific language governing permissions and limitations
|
13
13
|
# under the License.
|
14
14
|
#
|
15
|
+
import json
|
15
16
|
import os
|
16
17
|
import queue
|
17
18
|
from unittest import mock
|
@@ -19,7 +20,6 @@ from unittest import mock
|
|
19
20
|
from oslo_config import cfg
|
20
21
|
from oslo_config import fixture as oslo_fixture
|
21
22
|
from oslo_utils import uuidutils
|
22
|
-
import simplejson
|
23
23
|
|
24
24
|
from octavia.amphorae.backends.health_daemon import health_daemon
|
25
25
|
from octavia.common import constants
|
@@ -337,7 +337,7 @@ class TestHealthDaemon(base.TestCase):
|
|
337
337
|
mock_get_stats, mock_is_running):
|
338
338
|
health_daemon.COUNTERS = None
|
339
339
|
health_daemon.COUNTERS_FILE = None
|
340
|
-
lb1_stats_socket = '/var/lib/octavia/{
|
340
|
+
lb1_stats_socket = f'/var/lib/octavia/{LB_ID1}/haproxy.sock'
|
341
341
|
mock_list_files.return_value = {LB_ID1: lb1_stats_socket}
|
342
342
|
|
343
343
|
mock_is_running.return_value = True
|
@@ -345,7 +345,7 @@ class TestHealthDaemon(base.TestCase):
|
|
345
345
|
|
346
346
|
with mock.patch('os.open'), mock.patch.object(
|
347
347
|
os, 'fdopen', self.mock_open) as mock_fdopen:
|
348
|
-
mock_fdopen().read.return_value =
|
348
|
+
mock_fdopen().read.return_value = json.dumps({
|
349
349
|
LISTENER_ID1: {'bin': 1, 'bout': 2},
|
350
350
|
})
|
351
351
|
msg = health_daemon.build_stats_message()
|
@@ -353,7 +353,7 @@ class TestHealthDaemon(base.TestCase):
|
|
353
353
|
self.assertEqual(SAMPLE_STATS_MSG, msg)
|
354
354
|
|
355
355
|
mock_get_stats.assert_any_call(lb1_stats_socket)
|
356
|
-
mock_fdopen().write.assert_called_once_with(
|
356
|
+
mock_fdopen().write.assert_called_once_with(json.dumps({
|
357
357
|
LISTENER_ID1: {
|
358
358
|
'bin': int(FRONTEND_STATS['bin']),
|
359
359
|
'bout': int(FRONTEND_STATS['bout']),
|
@@ -374,7 +374,7 @@ class TestHealthDaemon(base.TestCase):
|
|
374
374
|
mock_is_running):
|
375
375
|
health_daemon.COUNTERS = None
|
376
376
|
health_daemon.COUNTERS_FILE = None
|
377
|
-
lb1_stats_socket = '/var/lib/octavia/{
|
377
|
+
lb1_stats_socket = f'/var/lib/octavia/{LB_ID1}/haproxy.sock'
|
378
378
|
mock_list_files.return_value = {LB_ID1: lb1_stats_socket}
|
379
379
|
|
380
380
|
mock_is_running.return_value = False
|
@@ -450,14 +450,14 @@ class TestHealthDaemon(base.TestCase):
|
|
450
450
|
|
451
451
|
with mock.patch('os.open'), mock.patch.object(
|
452
452
|
os, 'fdopen', self.mock_open) as mock_fdopen:
|
453
|
-
mock_fdopen().read.return_value =
|
453
|
+
mock_fdopen().read.return_value = json.dumps({
|
454
454
|
udp_listener_id1: {
|
455
455
|
'bin': 1, 'bout': 2, "ereq": 0, "stot": 0}
|
456
456
|
})
|
457
457
|
msg = health_daemon.build_stats_message()
|
458
458
|
|
459
459
|
self.assertEqual(expected, msg)
|
460
|
-
mock_fdopen().write.assert_called_once_with(
|
460
|
+
mock_fdopen().write.assert_called_once_with(json.dumps({
|
461
461
|
udp_listener_id1: {'bin': 5, 'bout': 10, 'ereq': 0, 'stot': 5},
|
462
462
|
udp_listener_id3: {'bin': 0, 'bout': 0, 'ereq': 0, 'stot': 0},
|
463
463
|
}))
|
@@ -472,7 +472,7 @@ class TestHealthDaemon(base.TestCase):
|
|
472
472
|
mock_get_stats, mock_is_running):
|
473
473
|
health_daemon.COUNTERS = None
|
474
474
|
health_daemon.COUNTERS_FILE = None
|
475
|
-
lb1_stats_socket = '/var/lib/octavia/{
|
475
|
+
lb1_stats_socket = f'/var/lib/octavia/{LB_ID1}/haproxy.sock'
|
476
476
|
mock_list_files.return_value = {LB_ID1: lb1_stats_socket}
|
477
477
|
|
478
478
|
mock_is_running.return_value = True
|
@@ -480,7 +480,7 @@ class TestHealthDaemon(base.TestCase):
|
|
480
480
|
|
481
481
|
with mock.patch('os.open'), mock.patch.object(
|
482
482
|
os, 'fdopen', self.mock_open) as mock_fdopen:
|
483
|
-
mock_fdopen().read.return_value =
|
483
|
+
mock_fdopen().read.return_value = json.dumps({
|
484
484
|
LISTENER_ID1: {'bin': 15, 'bout': 20},
|
485
485
|
})
|
486
486
|
msg = health_daemon.build_stats_message()
|
@@ -488,7 +488,7 @@ class TestHealthDaemon(base.TestCase):
|
|
488
488
|
self.assertEqual(SAMPLE_MSG_HAPROXY_RESTART, msg)
|
489
489
|
|
490
490
|
mock_get_stats.assert_any_call(lb1_stats_socket)
|
491
|
-
mock_fdopen().write.assert_called_once_with(
|
491
|
+
mock_fdopen().write.assert_called_once_with(json.dumps({
|
492
492
|
LISTENER_ID1: {
|
493
493
|
'bin': int(FRONTEND_STATS['bin']),
|
494
494
|
'bout': int(FRONTEND_STATS['bout']),
|