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

Virtual Address object no longer exists in test_create_update_lb_state #890

Closed ssorenso closed 7 years ago

ssorenso commented 7 years ago
Suggested Issue type

Bug Unless multiprocesisng has been enabled

Traceback
bigip = <neutronless.testlib.bigip_client.BigIpClient object at 0x7f9152c55290>
services = [{'healthmonitors': [], 'l7policies': [], 'l7policy_rules': [], 'listeners': [], ...}, {'healthmonitors': [], 'l7polic...: [], 'listeners': [], ...}, {'healthmonitors': [], 'l7policies': [], 'l7policy_rules': [], 'listeners': [], ...}, ...]
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 0x7f9152c5f910>

    def test_create_update_lb_state(bigip, services, icd_config, icontrol_driver):
        """Test creating and updating loadbalancer with differing admin states.

        Create loadbalancer without admin-state-down and eval virtual address
        enabled value.

        Update loadbalancer using admin-state-up and eval virtual address
        enabled value.

        Create loadbalancer using admin-state-down and eval virtual address
        enabled value.

        Update loadbalancer using admin-state-up and eval virtual address
        enabled value.

        Note: this tests loadbalancer admin_state_up and how those values
        are translated to the BIG-IP virtual address. The vip_port data in the
        service object does not affect the virtual address enabled value,
        only the loadbalancer admin_state_up will change the virtual address
        enabled value.

        Also, admin-state-down (no value allowed) is permitted only in create
        commands. admin-state-up (with True/False values) is permitted only update
        commands.

        :param bigip: BIG-IP under test
        :param services: list of service objects
        :param icd_config: agent configuration
        :param icontrol_driver: icontrol driver instance
        """

        service_iter = iter(services)
        service = service_iter.next()
        lb_reader = LoadbalancerReader(service)
        env_prefix = icd_config['environment_prefix']

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

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

        # Create loadbalancer, admin-state-down not specified
        # CLI: lbaas-loadbalancer-create --name lb1 mgmt_v4_subnet
        # LB svc object: "admin_state_up": true
        lb_pending = icontrol_driver._common_service_handler(service)
        assert not lb_pending

        virtual_addr_name = "%s_%s" % (env_prefix, lb_reader.id())
>       assert bigip.resource_exists(ResourceType.virtual_address,
                                     virtual_addr_name)
E       AssertionError: assert False
E        +  where False = <bound method BigIpClient.resource_exists of <neutronless.testlib.bigip_client.BigIpClient object at 0x7f9152c55290>>(<ResourceType.virtual_address: 21>, 'TEST_60ac05e5-e35e-499b-bda0-cb56eadd8e75')
E        +    where <bound method BigIpClient.resource_exists of <neutronless.testlib.bigip_client.BigIpClient object at 0x7f9152c55290>> = <neutronless.testlib.bigip_client.BigIpClient object at 0x7f9152c55290>.resource_exists
E        +    and   <ResourceType.virtual_address: 21> = ResourceType.virtual_address

../neutronless/loadbalancer/test_loadbalancer_admin_state.py:93: AssertionError
Tests Impacted:

OpenStack Release

Mitaka

Agent Version

mitaka - e46a3c98070772ff27da829e91c8f5decb822056

Operating System

Nightly

mattgreene commented 7 years ago

Regression introduced with #882 and fixed with #894.