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

assert_esd_applied for test_esd in neutronless tests #880

Closed ssorenso closed 6 years ago

ssorenso commented 7 years ago
Suggested Label:

Bug

This is based upon the fact that we're expecting that the configuration is going to trigger our special ESD case, and this proves that it did not during the normal runtime scenario where the ESD should trigger for.

Traceback:
bigip = <neutronless.testlib.bigip_client.BigIpClient object at 0x7f05d1145ed0>
services = [{'healthmonitors': [], 'l7policies': [], 'l7policy_rules': [], 'listeners': [], ...}, {'healthmonitors': [], 'l7polic...it': -1, 'default_pool_id': 'e70cedf7-6305-4f3c-91aa-6a14ae58136c', 'default_tls_container_id': None, ...}], ...}, ...]
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 0x7f05d0f47f10>
esd = {'esd_demo_1': {'lbaas_cssl_profile': 'clientssl', 'lbaas_ctcp': 'tcp-mobile-optimized', 'lbaas_fallback_persist': 'so...ys_APM_ExchangeSupport_helper']}, 'esd_demo_3': {'lbaas_ctcp': 'tcp-wan-optimized', 'lbaas_stcp': 'tcp-lan-optimized'}}

    def test_esd(bigip, services, icd_config, icontrol_driver, esd):
        env_prefix = icd_config['environment_prefix']
        service_iter = iter(services)
        validator = ResourceValidator(bigip, env_prefix)

        # create loadbalancer
        service = service_iter.next()
        lb_reader = LoadbalancerReader(service)
        folder = '{0}_{1}'.format(env_prefix, lb_reader.tenant_id())
        icontrol_driver._common_service_handler(service)
        assert bigip.folder_exists(folder)

        # create listener
        service = service_iter.next()
        listener = service['listeners'][0]
        icontrol_driver._common_service_handler(service)
        validator.assert_virtual_valid(listener, folder)

        # create pool
        service = service_iter.next()
        pool = service['pools'][0]
        icontrol_driver._common_service_handler(service)
        validator.assert_pool_valid(pool, folder)

        # apply ESD
        service = service_iter.next()
        icontrol_driver._common_service_handler(service)
>       validator.assert_esd_applied(esd['esd_demo_1'], listener, folder)

../neutronless/esd/test_esd.py:132:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <neutronless.testlib.resource_validator.ResourceValidator object at 0x7f05d1145f50>
esd = {'lbaas_cssl_profile': 'clientssl', 'lbaas_ctcp': 'tcp-mobile-optimized', 'lbaas_fallback_persist': 'source_addr', 'lbaas_irule': ['_sys_https_redirect'], ...}
listener = {'admin_state_up': True, 'connection_limit': -1, 'default_pool_id': None, 'default_tls_container_id': None, ...}
folder = 'TEST_ba91c2d0dee44bea8f235bed14519a8c'

    def assert_esd_applied(self, esd, listener, folder):
        # check that vs exists
        listener_name = '{0}_{1}'.format(self.prefix, listener['id'])
        assert self.bigip.resource_exists(
            ResourceType.virtual, listener_name, partition=folder)
        vs = self.bigip.get_resource(
            ResourceType.virtual, listener_name, partition=folder)

        profiles = vs.profiles_s.get_collection()
        policies = vs.policies_s.get_collection()

        if 'lbaas_ctcp' in esd:
>           assert self.is_in_collection(profiles, esd['lbaas_ctcp'])
E           AssertionError

../neutronless/testlib/resource_validator.py:135: AssertionError
Impacted Tests:

OpenStack Release

mitaka

Agent Version

mitaka - b096048814d641ff27ddc0be0babf70a6a6d230d

Operating System

Nightly

Deployment

Neutronless test (BIG-IP only talking to Agent)

ssorenso commented 7 years ago

This may be related to #881

ssorenso commented 7 years ago

Updated sum:

richbrowne commented 6 years ago

These are fixed by: ffe2b124bb51f10b0eb10d774720d9985507b66b