F5Networks / f5-openstack-agent

The F5 Agent for OpenStack Neutron allows you to deploy BIG-IP services in an OpenStack environment.
http://clouddocs.f5.com/products/openstack/agent/latest
Apache License 2.0
14 stars 38 forks source link

test_create_delete_basic_lb_nodisconnected fails in driver tests due to assert call_record.get failing #887

Closed ssorenso closed 6 years ago

ssorenso commented 7 years ago
Suggested issue type

Bug

We're expected to get something off of the BIG-IP and expecting it to be in an 'ONLINE' status, and so the functionality has changed.

Disclaimer: if the scenario is that the timing has changed because there is a separate worker taking on the load to determine if it's online or not, then multithreading/processing has changed this functionality in an expected way; thus, this would become a test bug.

Traceback
bigip = <neutronless.testlib.bigip_client.BigIpClient object at 0x7f9152a78750>
services = [{'healthmonitors': [], 'listeners': [], 'loadbalancer': {'admin_state_up': True, 'description': '', 'gre_vteps': [], ...up': True, 'description': '', 'gre_vteps': [], 'id': '50c5d54a-5a9e-4a80-9e74-8400a461a077', ...}, 'members': [], ...}]
icd_config = {'AGENT': '<oslo_config.cfg.GroupAttr object at 0x3b137d0>', 'OVS': '<oslo_config.cfg.GroupAttr object at 0x3ae9410>', 'advertise_mtu': False, 'advertised_tunnel_types': ['vxlan'], ...}
icontrol_driver = <f5_openstack_agent.lbaasv2.drivers.bigip.icontrol_driver.iControlDriver object at 0x7f9152b8d8d0>

    def test_create_delete_basic_lb_nodisconnected(
            bigip, services, icd_config, icontrol_driver):
        service_iter = iter(services)
        service = service_iter.next()
        lb_reader = LoadbalancerReader(service)
        env_prefix = icd_config['environment_prefix']
        fake_rpc = icontrol_driver.plugin_rpc
        hostname = bigip.get_device_name()
        icd_config['f5_network_segment_physical_network'] = None

        folder = '%s_%s' % (env_prefix, lb_reader.tenant_id())

        # Make sure we are starting clean.
        assert not bigip.folder_exists(folder)

        # Create the loadbalancer
        lb_pending = icontrol_driver._common_service_handler(service)
        assert not lb_pending

        # Assert that update loadbalancer status was called once
        assert fake_rpc.get_call_count('update_loadbalancer_status') == 1
        call_record = fake_rpc.get_calls('update_loadbalancer_status')[0]
>       assert call_record.get("operating_status", None) == 'ONLINE'
E       AssertionError: assert 'OFFLINE' == 'ONLINE'
E         - OFFLINE
E         ?  ^^
E         + ONLINE
E         ?  ^

../neutronless/loadbalancer/test_loadbalancer.py:171: AssertionError
Tests impacted

Agent Version

mitaka - e46a3c98070772ff27da829e91c8f5decb822056

Operating System

Nightly

ssorenso commented 7 years ago
bigip = <neutronless.testlib.bigip_client.BigIpClient object at 0x7f9152a54210>
services = [{'healthmonitors': [], 'listeners': [], 'loadbalancer': {'admin_state_up': True, 'description': '', 'gre_vteps': [], ...up': True, 'description': '', 'gre_vteps': [], 'id': '50c5d54a-5a9e-4a80-9e74-8400a461a077', ...}, 'members': [], ...}]
icd_config = {'AGENT': '<oslo_config.cfg.GroupAttr object at 0x3b137d0>', 'OVS': '<oslo_config.cfg.GroupAttr object at 0x3ae9410>', 'advertise_mtu': False, 'advertised_tunnel_types': ['vxlan'], ...}
icontrol_driver = <f5_openstack_agent.lbaasv2.drivers.bigip.icontrol_driver.iControlDriver object at 0x7f9152c4e050>

    def test_create_delete_lb_multisnat(bigip, services, icd_config, icontrol_driver):

        service_iter = iter(services)
        service = service_iter.next()
        lb_reader = LoadbalancerReader(service)
        env_prefix = icd_config['environment_prefix']
        fake_rpc = icontrol_driver.plugin_rpc
        icd_config['f5_snat_addresses_per_subnet'] = 5
        folder = '%s_%s' % (env_prefix, lb_reader.tenant_id())
        hostname = bigip.get_device_name()

        # Make sure we are starting clean.
        assert not bigip.folder_exists(folder)

        # Create the loadbalancer
        icontrol_driver._common_service_handler(service)

        # Assert that update loadbalancer status was called once
        assert fake_rpc.get_call_count('update_loadbalancer_status') == 1
        call_record = fake_rpc.get_calls('update_loadbalancer_status')[0]
>       assert call_record.get("operating_status", None) == 'ONLINE'
E       AssertionError: assert 'OFFLINE' == 'ONLINE'
E         - OFFLINE
E         ?  ^^
E         + ONLINE
E         ?  ^

../neutronless/loadbalancer/test_loadbalancer_snat.py:151: AssertionError
ssorenso commented 7 years ago
bigip = <neutronless.testlib.bigip_client.BigIpClient object at 0x7f91529d7690>
services = [{'healthmonitors': [], 'listeners': [], 'loadbalancer': {'admin_state_up': True, 'description': '', 'gre_vteps': [], ...up': True, 'description': '', 'gre_vteps': [], 'id': '50c5d54a-5a9e-4a80-9e74-8400a461a077', ...}, 'members': [], ...}]
icd_config = {'AGENT': '<oslo_config.cfg.GroupAttr object at 0x3b137d0>', 'OVS': '<oslo_config.cfg.GroupAttr object at 0x3ae9410>', 'advertise_mtu': False, 'advertised_tunnel_types': ['vxlan'], ...}
icontrol_driver = <f5_openstack_agent.lbaasv2.drivers.bigip.icontrol_driver.iControlDriver object at 0x7f9152c69350>

    def test_create_delete_lb_autosnat(bigip, services, icd_config, icontrol_driver):

        service_iter = iter(services)
        service = service_iter.next()
        lb_reader = LoadbalancerReader(service)
        env_prefix = icd_config['environment_prefix']
        fake_rpc = icontrol_driver.plugin_rpc
        hostname = bigip.get_device_name()

        # Change the configuration so that Auto SNAT is used.
        icd_config['f5_snat_addresses_per_subnet'] = 0

        folder = '%s_%s' % (env_prefix, lb_reader.tenant_id())

        # Make sure we are starting clean.
        assert not bigip.folder_exists(folder)

        # Create the loadbalancer
        icontrol_driver._common_service_handler(service)

        # Assert that update loadbalancer status was called once
        assert fake_rpc.get_call_count('update_loadbalancer_status') == 1
        call_record = fake_rpc.get_calls('update_loadbalancer_status')[0]
>       assert call_record.get("operating_status", None) == 'ONLINE'
E       AssertionError: assert 'OFFLINE' == 'ONLINE'
E         - OFFLINE
E         ?  ^^
E         + ONLINE
E         ?  ^

../neutronless/loadbalancer/test_loadbalancer_snat.py:66: AssertionError
richbrowne commented 6 years ago

Fixed by trtl