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
@@ -38,7 +38,7 @@ import octavia.tests.unit.base as base
|
|
38
38
|
|
39
39
|
|
40
40
|
AMP_AGENT_CONF_PATH = '/etc/octavia/amphora-agent.conf'
|
41
|
-
RANDOM_ERROR =
|
41
|
+
RANDOM_ERROR = 'random error'
|
42
42
|
OK = dict(message='OK')
|
43
43
|
FAKE_INTERFACE = 'eth33'
|
44
44
|
|
@@ -69,29 +69,11 @@ class TestServerTestCase(base.TestCase):
|
|
69
69
|
self.centos_test_server = server.Server()
|
70
70
|
self.centos_app = self.centos_test_server.app.test_client()
|
71
71
|
|
72
|
-
|
73
|
-
|
74
|
-
def test_ubuntu_haproxy_systemd(self, mock_init_system):
|
75
|
-
self._test_haproxy(consts.INIT_SYSTEMD, consts.UBUNTU,
|
76
|
-
mock_init_system)
|
72
|
+
def test_ubuntu_haproxy(self):
|
73
|
+
self._test_haproxy(consts.UBUNTU)
|
77
74
|
|
78
|
-
|
79
|
-
|
80
|
-
def test_centos_haproxy_systemd(self, mock_init_system):
|
81
|
-
self._test_haproxy(consts.INIT_SYSTEMD, consts.CENTOS,
|
82
|
-
mock_init_system)
|
83
|
-
|
84
|
-
@mock.patch('octavia.amphorae.backends.agent.api_server.util.'
|
85
|
-
'get_os_init_system', return_value=consts.INIT_SYSVINIT)
|
86
|
-
def test_ubuntu_haproxy_sysvinit(self, mock_init_system):
|
87
|
-
self._test_haproxy(consts.INIT_SYSVINIT, consts.UBUNTU,
|
88
|
-
mock_init_system)
|
89
|
-
|
90
|
-
@mock.patch('octavia.amphorae.backends.agent.api_server.util.'
|
91
|
-
'get_os_init_system', return_value=consts.INIT_UPSTART)
|
92
|
-
def test_ubuntu_haproxy_upstart(self, mock_init_system):
|
93
|
-
self._test_haproxy(consts.INIT_UPSTART, consts.UBUNTU,
|
94
|
-
mock_init_system)
|
75
|
+
def test_centos_haproxy(self):
|
76
|
+
self._test_haproxy(consts.CENTOS)
|
95
77
|
|
96
78
|
@mock.patch('octavia.amphorae.backends.agent.api_server.'
|
97
79
|
'haproxy_compatibility.get_haproxy_versions')
|
@@ -99,7 +81,7 @@ class TestServerTestCase(base.TestCase):
|
|
99
81
|
@mock.patch('os.makedirs')
|
100
82
|
@mock.patch('os.rename')
|
101
83
|
@mock.patch('subprocess.check_output')
|
102
|
-
def _test_haproxy(self,
|
84
|
+
def _test_haproxy(self, distro,
|
103
85
|
mock_subprocess, mock_rename,
|
104
86
|
mock_makedirs, mock_exists, mock_get_version):
|
105
87
|
|
@@ -137,21 +119,15 @@ class TestServerTestCase(base.TestCase):
|
|
137
119
|
haproxy_ug=consts.HAPROXY_USER_GROUP_CFG,
|
138
120
|
peer=(octavia_utils.
|
139
121
|
base64_sha1_string('amp_123').rstrip('='))).split(),
|
140
|
-
stderr
|
122
|
+
stderr=subprocess.STDOUT, encoding='utf-8')
|
141
123
|
mock_rename.assert_called_with(
|
142
124
|
'/var/lib/octavia/123/haproxy.cfg.new',
|
143
125
|
'/var/lib/octavia/123/haproxy.cfg')
|
144
126
|
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
elif init_system == consts.INIT_SYSVINIT:
|
150
|
-
mock_subprocess.assert_any_call(
|
151
|
-
"insserv /etc/init.d/haproxy-123".split(),
|
152
|
-
stderr=subprocess.STDOUT)
|
153
|
-
else:
|
154
|
-
self.assertIn(init_system, consts.VALID_INIT_SYSTEMS)
|
127
|
+
mock_subprocess.assert_any_call(
|
128
|
+
['systemctl', 'enable', 'haproxy-123.service'],
|
129
|
+
stderr=subprocess.STDOUT,
|
130
|
+
encoding='utf-8')
|
155
131
|
|
156
132
|
# exception writing
|
157
133
|
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open
|
@@ -171,14 +147,7 @@ class TestServerTestCase(base.TestCase):
|
|
171
147
|
|
172
148
|
# check if files get created
|
173
149
|
mock_exists.return_value = False
|
174
|
-
|
175
|
-
init_path = consts.SYSTEMD_DIR + '/haproxy-123.service'
|
176
|
-
elif init_system == consts.INIT_UPSTART:
|
177
|
-
init_path = consts.UPSTART_DIR + '/haproxy-123.conf'
|
178
|
-
elif init_system == consts.INIT_SYSVINIT:
|
179
|
-
init_path = consts.SYSVINIT_DIR + '/haproxy-123'
|
180
|
-
else:
|
181
|
-
self.assertIn(init_system, consts.VALID_INIT_SYSTEMS)
|
150
|
+
init_path = consts.SYSTEMD_DIR + '/haproxy-123.service'
|
182
151
|
|
183
152
|
m = self.useFixture(test_utils.OpenFixture(init_path)).mock_open
|
184
153
|
# happy case upstart file exists
|
@@ -198,12 +167,8 @@ class TestServerTestCase(base.TestCase):
|
|
198
167
|
data='test')
|
199
168
|
|
200
169
|
self.assertEqual(202, rv.status_code)
|
201
|
-
|
202
|
-
|
203
|
-
stat.S_IROTH)
|
204
|
-
else:
|
205
|
-
mode = (stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP |
|
206
|
-
stat.S_IROTH | stat.S_IXOTH)
|
170
|
+
mode = (stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP |
|
171
|
+
stat.S_IROTH)
|
207
172
|
mock_open.assert_called_with(init_path, flags, mode)
|
208
173
|
mock_fdopen.assert_called_with(123, 'w')
|
209
174
|
handle = mock_fdopen()
|
@@ -230,7 +195,7 @@ class TestServerTestCase(base.TestCase):
|
|
230
195
|
data='test')
|
231
196
|
self.assertEqual(400, rv.status_code)
|
232
197
|
self.assertEqual(
|
233
|
-
{'message': 'Invalid request',
|
198
|
+
{'message': 'Invalid request', 'details': 'random error'},
|
234
199
|
jsonutils.loads(rv.data.decode('utf-8')))
|
235
200
|
mode = stat.S_IRUSR | stat.S_IWUSR
|
236
201
|
mock_open.assert_called_with(file_name, flags, mode)
|
@@ -243,28 +208,11 @@ class TestServerTestCase(base.TestCase):
|
|
243
208
|
haproxy_ug=consts.HAPROXY_USER_GROUP_CFG,
|
244
209
|
peer=(octavia_utils.
|
245
210
|
base64_sha1_string('amp_123').rstrip('='))).split(),
|
246
|
-
stderr
|
211
|
+
stderr=subprocess.STDOUT, encoding='utf-8')
|
247
212
|
mock_rename.assert_called_with(
|
248
213
|
'/var/lib/octavia/123/haproxy.cfg.new',
|
249
214
|
'/var/lib/octavia/123/haproxy.cfg.new-failed')
|
250
215
|
|
251
|
-
# unhappy path with bogus init system
|
252
|
-
mock_init_system.return_value = 'bogus'
|
253
|
-
with mock.patch('os.open') as mock_open, mock.patch.object(
|
254
|
-
os, 'fdopen', m) as mock_fdopen, mock.patch(
|
255
|
-
'distro.id') as mock_distro_id:
|
256
|
-
mock_open.return_value = 123
|
257
|
-
mock_distro_id.return_value = distro
|
258
|
-
if distro == consts.UBUNTU:
|
259
|
-
rv = self.ubuntu_app.put('/' + api_server.VERSION +
|
260
|
-
'/loadbalancer/amp_123/123/haproxy',
|
261
|
-
data='test')
|
262
|
-
elif distro == consts.CENTOS:
|
263
|
-
rv = self.ubuntu_app.put('/' + api_server.VERSION +
|
264
|
-
'/loadbalancer/amp_123/123/haproxy',
|
265
|
-
data='test')
|
266
|
-
self.assertEqual(500, rv.status_code)
|
267
|
-
|
268
216
|
def test_ubuntu_start(self):
|
269
217
|
self._test_start(consts.UBUNTU)
|
270
218
|
|
@@ -321,7 +269,9 @@ class TestServerTestCase(base.TestCase):
|
|
321
269
|
' 123 started'},
|
322
270
|
jsonutils.loads(rv.data.decode('utf-8')))
|
323
271
|
mock_subprocess.assert_called_with(
|
324
|
-
['
|
272
|
+
['systemctl', 'start', 'haproxy-123.service'],
|
273
|
+
stderr=subprocess.STDOUT,
|
274
|
+
encoding='utf-8')
|
325
275
|
|
326
276
|
mock_exists.return_value = True
|
327
277
|
mock_subprocess.side_effect = subprocess.CalledProcessError(
|
@@ -336,10 +286,11 @@ class TestServerTestCase(base.TestCase):
|
|
336
286
|
self.assertEqual(
|
337
287
|
{
|
338
288
|
'message': 'Error starting haproxy',
|
339
|
-
'details': RANDOM_ERROR
|
289
|
+
'details': RANDOM_ERROR,
|
340
290
|
}, jsonutils.loads(rv.data.decode('utf-8')))
|
341
291
|
mock_subprocess.assert_called_with(
|
342
|
-
['
|
292
|
+
['systemctl', 'start', 'haproxy-123.service'],
|
293
|
+
stderr=subprocess.STDOUT, encoding='utf-8')
|
343
294
|
|
344
295
|
def test_ubuntu_reload(self):
|
345
296
|
self._test_reload(consts.UBUNTU)
|
@@ -377,7 +328,8 @@ class TestServerTestCase(base.TestCase):
|
|
377
328
|
'details': 'Listener 123 reloaded'},
|
378
329
|
jsonutils.loads(rv.data.decode('utf-8')))
|
379
330
|
mock_subprocess.assert_called_with(
|
380
|
-
['
|
331
|
+
['systemctl', 'reload', 'haproxy-123.service'],
|
332
|
+
stderr=subprocess.STDOUT, encoding='utf-8')
|
381
333
|
|
382
334
|
# Process not running so start
|
383
335
|
mock_exists.return_value = True
|
@@ -395,7 +347,8 @@ class TestServerTestCase(base.TestCase):
|
|
395
347
|
' 123 started'},
|
396
348
|
jsonutils.loads(rv.data.decode('utf-8')))
|
397
349
|
mock_subprocess.assert_called_with(
|
398
|
-
['
|
350
|
+
['systemctl', 'start', 'haproxy-123.service'],
|
351
|
+
stderr=subprocess.STDOUT, encoding='utf-8')
|
399
352
|
|
400
353
|
def test_ubuntu_info(self):
|
401
354
|
self._test_info(consts.UBUNTU)
|
@@ -428,39 +381,13 @@ class TestServerTestCase(base.TestCase):
|
|
428
381
|
|
429
382
|
@mock.patch('octavia.amphorae.backends.agent.api_server.util.'
|
430
383
|
'get_backend_for_lb_object', return_value='HAPROXY')
|
431
|
-
|
432
|
-
|
433
|
-
def test_delete_ubuntu_listener_systemd(self, mock_init_system,
|
434
|
-
mock_get_proto):
|
435
|
-
self._test_delete_listener(consts.INIT_SYSTEMD, consts.UBUNTU,
|
436
|
-
mock_init_system)
|
384
|
+
def test_delete_ubuntu_listener(self, mock_get_proto):
|
385
|
+
self._test_delete_listener(consts.UBUNTU)
|
437
386
|
|
438
387
|
@mock.patch('octavia.amphorae.backends.agent.api_server.util.'
|
439
388
|
'get_backend_for_lb_object', return_value='HAPROXY')
|
440
|
-
|
441
|
-
|
442
|
-
def test_delete_centos_listener_systemd(self, mock_init_system,
|
443
|
-
mock_get_proto):
|
444
|
-
self._test_delete_listener(consts.INIT_SYSTEMD, consts.CENTOS,
|
445
|
-
mock_init_system)
|
446
|
-
|
447
|
-
@mock.patch('octavia.amphorae.backends.agent.api_server.util.'
|
448
|
-
'get_backend_for_lb_object', return_value='HAPROXY')
|
449
|
-
@mock.patch('octavia.amphorae.backends.agent.api_server.util.'
|
450
|
-
'get_os_init_system', return_value=consts.INIT_SYSVINIT)
|
451
|
-
def test_delete_ubuntu_listener_sysvinit(self, mock_init_system,
|
452
|
-
mock_get_proto):
|
453
|
-
self._test_delete_listener(consts.INIT_SYSVINIT, consts.UBUNTU,
|
454
|
-
mock_init_system)
|
455
|
-
|
456
|
-
@mock.patch('octavia.amphorae.backends.agent.api_server.util.'
|
457
|
-
'get_backend_for_lb_object', return_value='HAPROXY')
|
458
|
-
@mock.patch('octavia.amphorae.backends.agent.api_server.util.'
|
459
|
-
'get_os_init_system', return_value=consts.INIT_UPSTART)
|
460
|
-
def test_delete_ubuntu_listener_upstart(self, mock_init_system,
|
461
|
-
mock_get_proto):
|
462
|
-
self._test_delete_listener(consts.INIT_UPSTART, consts.UBUNTU,
|
463
|
-
mock_init_system)
|
389
|
+
def test_delete_centos_listener(self, mock_get_proto):
|
390
|
+
self._test_delete_listener(consts.CENTOS)
|
464
391
|
|
465
392
|
@mock.patch('os.listdir')
|
466
393
|
@mock.patch('os.path.exists')
|
@@ -471,7 +398,7 @@ class TestServerTestCase(base.TestCase):
|
|
471
398
|
'get_haproxy_pid')
|
472
399
|
@mock.patch('shutil.rmtree')
|
473
400
|
@mock.patch('os.remove')
|
474
|
-
def _test_delete_listener(self,
|
401
|
+
def _test_delete_listener(self, distro,
|
475
402
|
mock_remove, mock_rmtree, mock_pid, mock_vrrp,
|
476
403
|
mock_check_output, mock_exists, mock_listdir):
|
477
404
|
self.assertIn(distro, [consts.UBUNTU, consts.CENTOS])
|
@@ -497,21 +424,12 @@ class TestServerTestCase(base.TestCase):
|
|
497
424
|
rv = self.centos_app.delete('/' + api_server.VERSION +
|
498
425
|
'/listeners/123')
|
499
426
|
self.assertEqual(200, rv.status_code)
|
500
|
-
self.assertEqual({
|
427
|
+
self.assertEqual({'message': 'OK'},
|
501
428
|
jsonutils.loads(rv.data.decode('utf-8')))
|
502
429
|
mock_rmtree.assert_called_with('/var/lib/octavia/123')
|
503
430
|
|
504
|
-
|
505
|
-
|
506
|
-
'/haproxy-123.service')
|
507
|
-
elif init_system == consts.INIT_UPSTART:
|
508
|
-
mock_exists.assert_called_with(consts.UPSTART_DIR +
|
509
|
-
'/haproxy-123.conf')
|
510
|
-
elif init_system == consts.INIT_SYSVINIT:
|
511
|
-
mock_exists.assert_called_with(consts.SYSVINIT_DIR +
|
512
|
-
'/haproxy-123')
|
513
|
-
else:
|
514
|
-
self.assertIn(init_system, consts.VALID_INIT_SYSTEMS)
|
431
|
+
mock_exists.assert_called_with(consts.SYSTEMD_DIR +
|
432
|
+
'/haproxy-123.service')
|
515
433
|
|
516
434
|
mock_exists.assert_any_call('/var/lib/octavia/123/123.pid')
|
517
435
|
|
@@ -524,21 +442,12 @@ class TestServerTestCase(base.TestCase):
|
|
524
442
|
rv = self.centos_app.delete('/' + api_server.VERSION +
|
525
443
|
'/listeners/123')
|
526
444
|
self.assertEqual(200, rv.status_code)
|
527
|
-
self.assertEqual({
|
445
|
+
self.assertEqual({'message': 'OK'},
|
528
446
|
jsonutils.loads(rv.data.decode('utf-8')))
|
529
447
|
mock_rmtree.assert_called_with('/var/lib/octavia/123')
|
530
448
|
|
531
|
-
|
532
|
-
|
533
|
-
'/haproxy-123.service')
|
534
|
-
elif init_system == consts.INIT_UPSTART:
|
535
|
-
mock_exists.assert_called_with(consts.UPSTART_DIR +
|
536
|
-
'/haproxy-123.conf')
|
537
|
-
elif init_system == consts.INIT_SYSVINIT:
|
538
|
-
mock_exists.assert_called_with(consts.SYSVINIT_DIR +
|
539
|
-
'/haproxy-123')
|
540
|
-
else:
|
541
|
-
self.assertIn(init_system, consts.VALID_INIT_SYSTEMS)
|
449
|
+
mock_exists.assert_called_with(consts.SYSTEMD_DIR +
|
450
|
+
'/haproxy-123.service')
|
542
451
|
|
543
452
|
mock_exists.assert_any_call('/var/lib/octavia/123/123.pid')
|
544
453
|
|
@@ -551,20 +460,11 @@ class TestServerTestCase(base.TestCase):
|
|
551
460
|
rv = self.centos_app.delete('/' + api_server.VERSION +
|
552
461
|
'/listeners/123')
|
553
462
|
self.assertEqual(200, rv.status_code)
|
554
|
-
self.assertEqual({
|
463
|
+
self.assertEqual({'message': 'OK'},
|
555
464
|
jsonutils.loads(rv.data.decode('utf-8')))
|
556
465
|
|
557
|
-
|
558
|
-
|
559
|
-
'/haproxy-123.service')
|
560
|
-
elif init_system == consts.INIT_UPSTART:
|
561
|
-
mock_remove.assert_called_with(consts.UPSTART_DIR +
|
562
|
-
'/haproxy-123.conf')
|
563
|
-
elif init_system == consts.INIT_SYSVINIT:
|
564
|
-
mock_remove.assert_called_with(consts.SYSVINIT_DIR +
|
565
|
-
'/haproxy-123')
|
566
|
-
else:
|
567
|
-
self.assertIn(init_system, consts.VALID_INIT_SYSTEMS)
|
466
|
+
mock_remove.assert_called_with(consts.SYSTEMD_DIR +
|
467
|
+
'/haproxy-123.service')
|
568
468
|
|
569
469
|
# service is stopped + upstart script + vrrp
|
570
470
|
mock_exists.side_effect = [True, True, False, True, True]
|
@@ -575,20 +475,11 @@ class TestServerTestCase(base.TestCase):
|
|
575
475
|
rv = self.centos_app.delete('/' + api_server.VERSION +
|
576
476
|
'/listeners/123')
|
577
477
|
self.assertEqual(200, rv.status_code)
|
578
|
-
self.assertEqual({
|
478
|
+
self.assertEqual({'message': 'OK'},
|
579
479
|
jsonutils.loads(rv.data.decode('utf-8')))
|
580
480
|
|
581
|
-
|
582
|
-
|
583
|
-
'/haproxy-123.service')
|
584
|
-
elif init_system == consts.INIT_UPSTART:
|
585
|
-
mock_remove.assert_called_with(consts.UPSTART_DIR +
|
586
|
-
'/haproxy-123.conf')
|
587
|
-
elif init_system == consts.INIT_SYSVINIT:
|
588
|
-
mock_remove.assert_called_with(consts.SYSVINIT_DIR +
|
589
|
-
'/haproxy-123')
|
590
|
-
else:
|
591
|
-
self.assertIn(init_system, consts.VALID_INIT_SYSTEMS)
|
481
|
+
mock_remove.assert_called_with(consts.SYSTEMD_DIR +
|
482
|
+
'/haproxy-123.service')
|
592
483
|
|
593
484
|
# service is running + upstart script + no vrrp
|
594
485
|
mock_exists.side_effect = [True, True, True, True, False, True]
|
@@ -600,25 +491,16 @@ class TestServerTestCase(base.TestCase):
|
|
600
491
|
rv = self.centos_app.delete('/' + api_server.VERSION +
|
601
492
|
'/listeners/123')
|
602
493
|
self.assertEqual(200, rv.status_code)
|
603
|
-
self.assertEqual({
|
494
|
+
self.assertEqual({'message': 'OK'},
|
604
495
|
jsonutils.loads(rv.data.decode('utf-8')))
|
605
496
|
mock_pid.assert_called_once_with('123')
|
606
497
|
mock_check_output.assert_any_call(
|
607
|
-
['
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
elif init_system == consts.INIT_UPSTART:
|
614
|
-
mock_remove.assert_any_call(consts.UPSTART_DIR +
|
615
|
-
'/haproxy-123.conf')
|
616
|
-
elif init_system == consts.INIT_SYSVINIT:
|
617
|
-
mock_check_output.assert_any_call(
|
618
|
-
"insserv -r /etc/init.d/haproxy-123".split(),
|
619
|
-
stderr=subprocess.STDOUT)
|
620
|
-
else:
|
621
|
-
self.assertIn(init_system, consts.VALID_INIT_SYSTEMS)
|
498
|
+
['systemctl', 'stop', 'haproxy-123.service'],
|
499
|
+
stderr=subprocess.STDOUT, encoding='utf-8')
|
500
|
+
|
501
|
+
mock_check_output.assert_any_call(
|
502
|
+
['systemctl', 'disable', 'haproxy-123.service'],
|
503
|
+
stderr=subprocess.STDOUT, encoding='utf-8')
|
622
504
|
|
623
505
|
# service is running + upstart script + vrrp
|
624
506
|
mock_exists.side_effect = [True, True, True, True, True, True]
|
@@ -630,25 +512,16 @@ class TestServerTestCase(base.TestCase):
|
|
630
512
|
rv = self.centos_app.delete('/' + api_server.VERSION +
|
631
513
|
'/listeners/123')
|
632
514
|
self.assertEqual(200, rv.status_code)
|
633
|
-
self.assertEqual({
|
515
|
+
self.assertEqual({'message': 'OK'},
|
634
516
|
jsonutils.loads(rv.data.decode('utf-8')))
|
635
517
|
mock_pid.assert_called_with('123')
|
636
518
|
mock_check_output.assert_any_call(
|
637
|
-
['
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
elif init_system == consts.INIT_UPSTART:
|
644
|
-
mock_remove.assert_any_call(consts.UPSTART_DIR +
|
645
|
-
'/haproxy-123.conf')
|
646
|
-
elif init_system == consts.INIT_SYSVINIT:
|
647
|
-
mock_check_output.assert_any_call(
|
648
|
-
"insserv -r /etc/init.d/haproxy-123".split(),
|
649
|
-
stderr=subprocess.STDOUT)
|
650
|
-
else:
|
651
|
-
self.assertIn(init_system, consts.VALID_INIT_SYSTEMS)
|
519
|
+
['systemctl', 'stop', 'haproxy-123.service'],
|
520
|
+
stderr=subprocess.STDOUT, encoding='utf-8')
|
521
|
+
|
522
|
+
mock_check_output.assert_any_call(
|
523
|
+
['systemctl', 'disable', 'haproxy-123.service'],
|
524
|
+
stderr=subprocess.STDOUT, encoding='utf-8')
|
652
525
|
|
653
526
|
# service is running + stopping fails
|
654
527
|
mock_exists.side_effect = [True, True, True, True]
|
@@ -1014,7 +887,7 @@ class TestServerTestCase(base.TestCase):
|
|
1014
887
|
for idx in range(test_int_num)]
|
1015
888
|
mock_isfile.return_value = True
|
1016
889
|
|
1017
|
-
mock_check_output.return_value =
|
890
|
+
mock_check_output.return_value = "1\n2\n3\n"
|
1018
891
|
|
1019
892
|
test_int_num = str(test_int_num)
|
1020
893
|
|
@@ -1068,14 +941,8 @@ class TestServerTestCase(base.TestCase):
|
|
1068
941
|
# One Interface down, Happy Path
|
1069
942
|
mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
|
1070
943
|
|
1071
|
-
|
1072
|
-
|
1073
|
-
flags = os.O_WRONLY | os.O_CREAT | os.O_APPEND
|
1074
|
-
|
1075
|
-
else:
|
1076
|
-
file_name = ('/etc/octavia/interfaces/'
|
1077
|
-
'eth{}.json'.format(test_int_num))
|
1078
|
-
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
|
944
|
+
file_name = f'/etc/octavia/interfaces/eth{test_int_num}.json'
|
945
|
+
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
|
1079
946
|
|
1080
947
|
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open
|
1081
948
|
with mock.patch('os.open') as mock_open, mock.patch.object(
|
@@ -1105,7 +972,7 @@ class TestServerTestCase(base.TestCase):
|
|
1105
972
|
mock_fdopen.assert_any_call(123, 'r+')
|
1106
973
|
|
1107
974
|
expected_dict = {
|
1108
|
-
consts.NAME: "eth{}"
|
975
|
+
consts.NAME: f"eth{test_int_num}",
|
1109
976
|
consts.ADDRESSES: [
|
1110
977
|
{
|
1111
978
|
consts.DHCP: True,
|
@@ -1145,7 +1012,8 @@ class TestServerTestCase(base.TestCase):
|
|
1145
1012
|
|
1146
1013
|
mock_check_output.assert_called_with(
|
1147
1014
|
['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE,
|
1148
|
-
'amphora-interface', 'up', 'eth' + test_int_num],
|
1015
|
+
'amphora-interface', 'up', 'eth' + test_int_num],
|
1016
|
+
stderr=subprocess.STDOUT, encoding='utf-8')
|
1149
1017
|
|
1150
1018
|
# fixed IPs happy path
|
1151
1019
|
port_info = {'mac_address': '123', 'mtu': 1450, 'fixed_ips': [
|
@@ -1153,13 +1021,8 @@ class TestServerTestCase(base.TestCase):
|
|
1153
1021
|
|
1154
1022
|
mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
|
1155
1023
|
|
1156
|
-
|
1157
|
-
|
1158
|
-
flags = os.O_WRONLY | os.O_CREAT | os.O_APPEND
|
1159
|
-
else:
|
1160
|
-
file_name = ('/etc/octavia/interfaces/'
|
1161
|
-
'eth{}.json'.format(test_int_num))
|
1162
|
-
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
|
1024
|
+
file_name = f'/etc/octavia/interfaces/eth{test_int_num}.json'
|
1025
|
+
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
|
1163
1026
|
|
1164
1027
|
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open
|
1165
1028
|
with mock.patch('os.open') as mock_open, mock.patch.object(
|
@@ -1189,7 +1052,7 @@ class TestServerTestCase(base.TestCase):
|
|
1189
1052
|
mock_fdopen.assert_any_call(123, 'r+')
|
1190
1053
|
|
1191
1054
|
expected_dict = {
|
1192
|
-
consts.NAME: "eth{}"
|
1055
|
+
consts.NAME: f"eth{test_int_num}",
|
1193
1056
|
consts.MTU: 1450,
|
1194
1057
|
consts.ADDRESSES: [
|
1195
1058
|
{consts.ADDRESS: '10.0.0.5', consts.PREFIXLEN: 24}
|
@@ -1215,7 +1078,8 @@ class TestServerTestCase(base.TestCase):
|
|
1215
1078
|
|
1216
1079
|
mock_check_output.assert_called_with(
|
1217
1080
|
['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE,
|
1218
|
-
'amphora-interface', 'up', 'eth' + test_int_num],
|
1081
|
+
'amphora-interface', 'up', 'eth' + test_int_num],
|
1082
|
+
stderr=subprocess.STDOUT, encoding='utf-8')
|
1219
1083
|
|
1220
1084
|
# fixed IPs happy path IPv6
|
1221
1085
|
port_info = {'mac_address': '123', 'mtu': 1450, 'fixed_ips': [
|
@@ -1223,13 +1087,8 @@ class TestServerTestCase(base.TestCase):
|
|
1223
1087
|
|
1224
1088
|
mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
|
1225
1089
|
|
1226
|
-
|
1227
|
-
|
1228
|
-
flags = os.O_WRONLY | os.O_CREAT | os.O_APPEND
|
1229
|
-
else:
|
1230
|
-
file_name = ('/etc/octavia/interfaces/'
|
1231
|
-
'eth{}.json'.format(test_int_num))
|
1232
|
-
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
|
1090
|
+
file_name = f'/etc/octavia/interfaces/eth{test_int_num}.json'
|
1091
|
+
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
|
1233
1092
|
|
1234
1093
|
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open
|
1235
1094
|
with mock.patch('os.open') as mock_open, mock.patch.object(
|
@@ -1259,7 +1118,7 @@ class TestServerTestCase(base.TestCase):
|
|
1259
1118
|
mock_fdopen.assert_any_call(123, 'r+')
|
1260
1119
|
|
1261
1120
|
expected_dict = {
|
1262
|
-
consts.NAME: "eth{}"
|
1121
|
+
consts.NAME: f"eth{test_int_num}",
|
1263
1122
|
consts.MTU: 1450,
|
1264
1123
|
consts.ADDRESSES: [
|
1265
1124
|
{consts.ADDRESS: '2001:0db8::2',
|
@@ -1285,7 +1144,8 @@ class TestServerTestCase(base.TestCase):
|
|
1285
1144
|
|
1286
1145
|
mock_check_output.assert_called_with(
|
1287
1146
|
['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE,
|
1288
|
-
'amphora-interface', 'up', 'eth' + test_int_num],
|
1147
|
+
'amphora-interface', 'up', 'eth' + test_int_num],
|
1148
|
+
stderr=subprocess.STDOUT, encoding='utf-8')
|
1289
1149
|
|
1290
1150
|
# fixed IPs, bogus IP
|
1291
1151
|
port_info = {'mac_address': '123', 'fixed_ips': [
|
@@ -1293,8 +1153,7 @@ class TestServerTestCase(base.TestCase):
|
|
1293
1153
|
|
1294
1154
|
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
|
1295
1155
|
mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
|
1296
|
-
file_name =
|
1297
|
-
'eth{}.json'.format(test_int_num))
|
1156
|
+
file_name = f'/etc/octavia/interfaces/eth{test_int_num}.json'
|
1298
1157
|
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open
|
1299
1158
|
with mock.patch('os.open') as mock_open, mock.patch.object(
|
1300
1159
|
os, 'fdopen', m) as mock_fdopen:
|
@@ -1314,9 +1173,10 @@ class TestServerTestCase(base.TestCase):
|
|
1314
1173
|
# same as above but ifup fails
|
1315
1174
|
port_info = {'mac_address': '123', 'fixed_ips': [
|
1316
1175
|
{'ip_address': '10.0.0.5', 'subnet_cidr': '10.0.0.0/24'}]}
|
1317
|
-
mock_check_output.side_effect = [
|
1318
|
-
7, 'test', RANDOM_ERROR),
|
1319
|
-
7, 'test', RANDOM_ERROR)
|
1176
|
+
mock_check_output.side_effect = [
|
1177
|
+
subprocess.CalledProcessError(7, 'test', RANDOM_ERROR),
|
1178
|
+
subprocess.CalledProcessError(7, 'test', RANDOM_ERROR)
|
1179
|
+
]
|
1320
1180
|
|
1321
1181
|
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open
|
1322
1182
|
with mock.patch('os.open'), mock.patch.object(os, 'fdopen', m):
|
@@ -1332,7 +1192,7 @@ class TestServerTestCase(base.TestCase):
|
|
1332
1192
|
data=jsonutils.dumps(port_info))
|
1333
1193
|
self.assertEqual(500, rv.status_code)
|
1334
1194
|
self.assertEqual(
|
1335
|
-
{'details': RANDOM_ERROR
|
1195
|
+
{'details': RANDOM_ERROR,
|
1336
1196
|
'message': 'Error plugging network'},
|
1337
1197
|
jsonutils.loads(rv.data.decode('utf-8')))
|
1338
1198
|
|
@@ -1366,8 +1226,6 @@ class TestServerTestCase(base.TestCase):
|
|
1366
1226
|
|
1367
1227
|
def test_ubuntu_plug_network_host_routes(self):
|
1368
1228
|
self._test_plug_network_host_routes(consts.UBUNTU)
|
1369
|
-
self.conf.config(group="amphora_agent",
|
1370
|
-
agent_server_network_file="/path/to/interfaces_file")
|
1371
1229
|
|
1372
1230
|
def test_centos_plug_network_host_routes(self):
|
1373
1231
|
self._test_plug_network_host_routes(consts.CENTOS)
|
@@ -1477,7 +1335,8 @@ class TestServerTestCase(base.TestCase):
|
|
1477
1335
|
|
1478
1336
|
mock_check_output.assert_called_with(
|
1479
1337
|
['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE,
|
1480
|
-
'amphora-interface', 'up', 'eth3'], stderr
|
1338
|
+
'amphora-interface', 'up', 'eth3'], stderr=subprocess.STDOUT,
|
1339
|
+
encoding='utf-8')
|
1481
1340
|
|
1482
1341
|
def test_ubuntu_plug_VIP4(self):
|
1483
1342
|
self._test_plug_VIP4(consts.UBUNTU)
|
@@ -1620,13 +1479,9 @@ class TestServerTestCase(base.TestCase):
|
|
1620
1479
|
|
1621
1480
|
mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
|
1622
1481
|
|
1623
|
-
|
1624
|
-
|
1625
|
-
|
1626
|
-
else:
|
1627
|
-
file_name = ('/etc/octavia/interfaces/{netns_int}.json'.format(
|
1628
|
-
netns_int=consts.NETNS_PRIMARY_INTERFACE))
|
1629
|
-
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
|
1482
|
+
file_name = ('/etc/octavia/interfaces/{netns_int}.json'.format(
|
1483
|
+
netns_int=consts.NETNS_PRIMARY_INTERFACE))
|
1484
|
+
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
|
1630
1485
|
|
1631
1486
|
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open
|
1632
1487
|
|
@@ -1732,19 +1587,15 @@ class TestServerTestCase(base.TestCase):
|
|
1732
1587
|
mock_check_output.assert_called_with(
|
1733
1588
|
['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE,
|
1734
1589
|
'amphora-interface', 'up',
|
1735
|
-
consts.NETNS_PRIMARY_INTERFACE], stderr
|
1590
|
+
consts.NETNS_PRIMARY_INTERFACE], stderr=subprocess.STDOUT,
|
1591
|
+
encoding='utf-8')
|
1736
1592
|
|
1737
1593
|
# One Interface down, Happy Path IPv4
|
1738
1594
|
mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
|
1739
1595
|
|
1740
|
-
|
1741
|
-
|
1742
|
-
|
1743
|
-
|
1744
|
-
else:
|
1745
|
-
file_name = ('/etc/octavia/interfaces/'
|
1746
|
-
'{}.json'.format(consts.NETNS_PRIMARY_INTERFACE))
|
1747
|
-
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
|
1596
|
+
file_name = ('/etc/octavia/interfaces/{}.json'.format(
|
1597
|
+
consts.NETNS_PRIMARY_INTERFACE))
|
1598
|
+
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
|
1748
1599
|
|
1749
1600
|
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open
|
1750
1601
|
|
@@ -1832,12 +1683,13 @@ class TestServerTestCase(base.TestCase):
|
|
1832
1683
|
mock_check_output.assert_called_with(
|
1833
1684
|
['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE,
|
1834
1685
|
'amphora-interface', 'up',
|
1835
|
-
consts.NETNS_PRIMARY_INTERFACE], stderr
|
1686
|
+
consts.NETNS_PRIMARY_INTERFACE], stderr=subprocess.STDOUT,
|
1687
|
+
encoding='utf-8')
|
1836
1688
|
|
1837
1689
|
mock_check_output.side_effect = [
|
1838
|
-
subprocess.CalledProcessError(
|
1839
|
-
|
1840
|
-
|
1690
|
+
subprocess.CalledProcessError(7, 'test', RANDOM_ERROR),
|
1691
|
+
subprocess.CalledProcessError(7, 'test', RANDOM_ERROR)
|
1692
|
+
]
|
1841
1693
|
|
1842
1694
|
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open
|
1843
1695
|
with mock.patch('os.open'), mock.patch.object(os, 'fdopen', m):
|
@@ -1853,7 +1705,7 @@ class TestServerTestCase(base.TestCase):
|
|
1853
1705
|
data=jsonutils.dumps(subnet_info))
|
1854
1706
|
self.assertEqual(500, rv.status_code)
|
1855
1707
|
self.assertEqual(
|
1856
|
-
{'details': RANDOM_ERROR
|
1708
|
+
{'details': RANDOM_ERROR,
|
1857
1709
|
'message': 'Error plugging VIP'},
|
1858
1710
|
jsonutils.loads(rv.data.decode('utf-8')))
|
1859
1711
|
|
@@ -1983,8 +1835,8 @@ class TestServerTestCase(base.TestCase):
|
|
1983
1835
|
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
|
1984
1836
|
mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
|
1985
1837
|
|
1986
|
-
file_name = ('/etc/octavia/interfaces/
|
1987
|
-
|
1838
|
+
file_name = (f'/etc/octavia/interfaces/'
|
1839
|
+
f'{consts.NETNS_PRIMARY_INTERFACE}.json')
|
1988
1840
|
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open
|
1989
1841
|
|
1990
1842
|
with mock.patch('os.open') as mock_open, mock.patch.object(
|
@@ -2086,16 +1938,21 @@ class TestServerTestCase(base.TestCase):
|
|
2086
1938
|
self, args[0], expected_dict)
|
2087
1939
|
|
2088
1940
|
mock_check_output.assert_called_with(
|
2089
|
-
[
|
1941
|
+
[
|
1942
|
+
'ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE,
|
2090
1943
|
'amphora-interface', 'up', '{netns_int}'.format(
|
2091
|
-
netns_int=consts.NETNS_PRIMARY_INTERFACE
|
1944
|
+
netns_int=consts.NETNS_PRIMARY_INTERFACE
|
1945
|
+
)
|
1946
|
+
],
|
1947
|
+
stderr=subprocess.STDOUT,
|
1948
|
+
encoding='utf-8')
|
2092
1949
|
|
2093
1950
|
# One Interface down, Happy Path IPv6
|
2094
1951
|
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
|
2095
1952
|
mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
|
2096
1953
|
|
2097
|
-
file_name = ('/etc/octavia/interfaces/
|
2098
|
-
|
1954
|
+
file_name = (f'/etc/octavia/interfaces/'
|
1955
|
+
f'{consts.NETNS_PRIMARY_INTERFACE}.json')
|
2099
1956
|
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open
|
2100
1957
|
|
2101
1958
|
with mock.patch('os.open') as mock_open, mock.patch.object(
|
@@ -2181,14 +2038,14 @@ class TestServerTestCase(base.TestCase):
|
|
2181
2038
|
test_utils.assert_interface_files_equal(
|
2182
2039
|
self, args[0], expected_dict)
|
2183
2040
|
|
2184
|
-
mock_check_output.assert_called_with(
|
2185
|
-
|
2186
|
-
|
2187
|
-
|
2041
|
+
mock_check_output.assert_called_with([
|
2042
|
+
'ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE,
|
2043
|
+
'amphora-interface', 'up', consts.NETNS_PRIMARY_INTERFACE
|
2044
|
+
], stderr=subprocess.STDOUT, encoding='utf-8')
|
2188
2045
|
mock_check_output.side_effect = [
|
2189
|
-
subprocess.CalledProcessError(
|
2190
|
-
|
2191
|
-
|
2046
|
+
subprocess.CalledProcessError(7, 'test', RANDOM_ERROR),
|
2047
|
+
subprocess.CalledProcessError(7, 'test', RANDOM_ERROR)
|
2048
|
+
]
|
2192
2049
|
|
2193
2050
|
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open
|
2194
2051
|
with mock.patch('os.open'), mock.patch.object(os, 'fdopen', m):
|
@@ -2204,7 +2061,7 @@ class TestServerTestCase(base.TestCase):
|
|
2204
2061
|
data=jsonutils.dumps(subnet_info))
|
2205
2062
|
self.assertEqual(500, rv.status_code)
|
2206
2063
|
self.assertEqual(
|
2207
|
-
{'details': RANDOM_ERROR
|
2064
|
+
{'details': RANDOM_ERROR,
|
2208
2065
|
'message': 'Error plugging VIP'},
|
2209
2066
|
jsonutils.loads(rv.data.decode('utf-8')))
|
2210
2067
|
|
@@ -2271,8 +2128,8 @@ class TestServerTestCase(base.TestCase):
|
|
2271
2128
|
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
|
2272
2129
|
mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
|
2273
2130
|
|
2274
|
-
file_name = ('/etc/octavia/interfaces/
|
2275
|
-
|
2131
|
+
file_name = (f'/etc/octavia/interfaces/'
|
2132
|
+
f'{consts.NETNS_PRIMARY_INTERFACE}.json')
|
2276
2133
|
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open
|
2277
2134
|
|
2278
2135
|
with mock.patch('os.open') as mock_open, mock.patch.object(
|
@@ -2421,10 +2278,11 @@ class TestServerTestCase(base.TestCase):
|
|
2421
2278
|
test_utils.assert_interface_files_equal(
|
2422
2279
|
self, args[0], expected_dict)
|
2423
2280
|
|
2424
|
-
mock_check_output.assert_called_with(
|
2425
|
-
|
2426
|
-
|
2427
|
-
|
2281
|
+
mock_check_output.assert_called_with([
|
2282
|
+
'ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE,
|
2283
|
+
'amphora-interface', 'up',
|
2284
|
+
consts.NETNS_PRIMARY_INTERFACE
|
2285
|
+
], stderr=subprocess.STDOUT, encoding='utf-8')
|
2428
2286
|
|
2429
2287
|
def test_ubuntu_plug_VIP6_with_additional_VIP(self):
|
2430
2288
|
self._test_plug_VIP6_with_additional_VIP(consts.UBUNTU)
|
@@ -2489,8 +2347,8 @@ class TestServerTestCase(base.TestCase):
|
|
2489
2347
|
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
|
2490
2348
|
mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
|
2491
2349
|
|
2492
|
-
file_name = ('/etc/octavia/interfaces/
|
2493
|
-
|
2350
|
+
file_name = (f'/etc/octavia/interfaces/'
|
2351
|
+
f'{consts.NETNS_PRIMARY_INTERFACE}.json')
|
2494
2352
|
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open
|
2495
2353
|
|
2496
2354
|
with mock.patch('os.open') as mock_open, mock.patch.object(
|
@@ -2638,10 +2496,10 @@ class TestServerTestCase(base.TestCase):
|
|
2638
2496
|
test_utils.assert_interface_files_equal(
|
2639
2497
|
self, args[0], expected_dict)
|
2640
2498
|
|
2641
|
-
mock_check_output.assert_called_with(
|
2642
|
-
|
2643
|
-
|
2644
|
-
|
2499
|
+
mock_check_output.assert_called_with([
|
2500
|
+
'ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE,
|
2501
|
+
'amphora-interface', 'up', consts.NETNS_PRIMARY_INTERFACE
|
2502
|
+
], stderr=subprocess.STDOUT, encoding='utf-8')
|
2645
2503
|
|
2646
2504
|
def test_ubuntu_get_interface(self):
|
2647
2505
|
self._test_get_interface(consts.UBUNTU)
|
@@ -2721,31 +2579,13 @@ class TestServerTestCase(base.TestCase):
|
|
2721
2579
|
content_type='application/json')
|
2722
2580
|
self.assertEqual(400, rv.status_code)
|
2723
2581
|
|
2724
|
-
|
2725
|
-
'get_os_init_system', return_value=consts.INIT_SYSTEMD)
|
2726
|
-
def test_ubuntu_upload_keepalived_config_systemd(self, mock_init_system):
|
2582
|
+
def test_ubuntu_upload_keepalived_config(self):
|
2727
2583
|
with mock.patch('distro.id', return_value='ubuntu'):
|
2728
|
-
self._test_upload_keepalived_config(
|
2729
|
-
consts.INIT_SYSTEMD, consts.UBUNTU, mock_init_system)
|
2584
|
+
self._test_upload_keepalived_config(consts.UBUNTU)
|
2730
2585
|
|
2731
|
-
|
2732
|
-
'get_os_init_system', return_value=consts.INIT_SYSTEMD)
|
2733
|
-
def test_centos_upload_keepalived_config_systemd(self, mock_init_system):
|
2586
|
+
def test_centos_upload_keepalived_config(self):
|
2734
2587
|
with mock.patch('distro.id', return_value='centos'):
|
2735
|
-
self._test_upload_keepalived_config(
|
2736
|
-
consts.INIT_SYSTEMD, consts.CENTOS, mock_init_system)
|
2737
|
-
|
2738
|
-
@mock.patch('octavia.amphorae.backends.agent.api_server.util.'
|
2739
|
-
'get_os_init_system', return_value=consts.INIT_UPSTART)
|
2740
|
-
def test_ubuntu_upload_keepalived_config_upstart(self, mock_init_system):
|
2741
|
-
self._test_upload_keepalived_config(consts.INIT_UPSTART,
|
2742
|
-
consts.UBUNTU, mock_init_system)
|
2743
|
-
|
2744
|
-
@mock.patch('octavia.amphorae.backends.agent.api_server.util.'
|
2745
|
-
'get_os_init_system', return_value=consts.INIT_SYSVINIT)
|
2746
|
-
def test_ubuntu_upload_keepalived_config_sysvinit(self, mock_init_system):
|
2747
|
-
self._test_upload_keepalived_config(consts.INIT_SYSVINIT,
|
2748
|
-
consts.UBUNTU, mock_init_system)
|
2588
|
+
self._test_upload_keepalived_config(consts.CENTOS)
|
2749
2589
|
|
2750
2590
|
@mock.patch('octavia.amphorae.backends.agent.api_server.util.'
|
2751
2591
|
'vrrp_check_script_update')
|
@@ -2754,8 +2594,7 @@ class TestServerTestCase(base.TestCase):
|
|
2754
2594
|
@mock.patch('os.rename')
|
2755
2595
|
@mock.patch('subprocess.check_output')
|
2756
2596
|
@mock.patch('os.remove')
|
2757
|
-
def _test_upload_keepalived_config(self,
|
2758
|
-
mock_init_system, mock_remove,
|
2597
|
+
def _test_upload_keepalived_config(self, distro, mock_remove,
|
2759
2598
|
mock_subprocess, mock_rename,
|
2760
2599
|
mock_makedirs, mock_exists,
|
2761
2600
|
mock_vrrp_check):
|
@@ -2977,8 +2816,8 @@ class TestServerTestCase(base.TestCase):
|
|
2977
2816
|
'haproxy_count': haproxy_count,
|
2978
2817
|
'haproxy_version': '9.9.99-9',
|
2979
2818
|
'hostname': 'test-host',
|
2980
|
-
'ipvsadm_version':
|
2981
|
-
'keepalived_version':
|
2819
|
+
'ipvsadm_version': '2.2.22-2',
|
2820
|
+
'keepalived_version': '1.1.11-1',
|
2982
2821
|
'listeners': [listener_id],
|
2983
2822
|
'load': [load_1min, load_5min, load_15min],
|
2984
2823
|
'memory': {'buffers': Buffers,
|
@@ -3060,7 +2899,7 @@ class TestServerTestCase(base.TestCase):
|
|
3060
2899
|
@mock.patch('octavia.amphorae.backends.utils.nftable_utils.'
|
3061
2900
|
'load_nftables_file')
|
3062
2901
|
@mock.patch('octavia.amphorae.backends.utils.nftable_utils.'
|
3063
|
-
'
|
2902
|
+
'write_nftable_rules_file')
|
3064
2903
|
@mock.patch('octavia.amphorae.backends.agent.api_server.amphora_info.'
|
3065
2904
|
'AmphoraInfo.get_interface')
|
3066
2905
|
def test_set_interface_rules(self, mock_get_int, mock_write_rules,
|