[openstack-dev] [Neutron][LBaaS] Error at context exit for subnet in unit test case

Vijay Venkatachalam Vijay.Venkatachalam at citrix.com
Wed Aug 20 18:49:15 UTC 2014


Hey Brandon,

Thanks for looking into it. Yes I figured this out too and passed the pre-created subnet to loadbalancer method.
Issue here is  slightly different, please have a look at the review 
https://review.openstack.org/#/c/114173/
Inorder to make it work; I have made network, subnet and loadbalancer with delete=False.

The original problem creating snippet code is 

        with self.subnet() as subnet:
            with self.loadbalancer(subnet=subnet, no_delete=True,
                                   provider=LBAAS_PROVIDER_NAME) as testlb:
	print "error after this statement...."

The original problem creating full code is here http://pastebin.com/jWmrpiG1

Thanks,
Vijay V.	

-----Original Message-----
From: Brandon Logan [mailto:brandon.logan at RACKSPACE.COM] 
Sent: 20 August 2014 21:24
To: openstack-dev at lists.openstack.org
Subject: Re: [openstack-dev] [Neutron][LBaaS] Error at context exit for subnet in unit test case

Hey Vijay,
Figured out the issue you are having.  In that particular test you are creating the same subnet twice.  The first time you create it is in the contextlib.nested, the second time is the self.loadbalancer method that will create a subnet if you do not pass it.  So you should pass subnet=subnet in the self.loadbalancer method.

After that there are other minor issues in the driver, mainly accessing the obj passed in as a dictionary and not an object (obj["id"] vs obj.id).

Let me know if you need more information.

Thanks,
Brandon
On Wed, 2014-08-20 at 14:27 +0000, Vijay Venkatachalam wrote:
> I observed the following text as well "One or more ports have an IP allocation from this subnet."
> Looks like loadbalancer context exit at "blah2" is not cleaning up the port that was created. 
> This ultimately resulted in failure of delete subnet at "blah3".
> 
> ----------------------
> with self.subnet() as subnet:
>     blah1
>     with self.loadbalancer() as lb:
>         blah2
>     blah3
> ----------------------
> 
> -----Original Message-----
> From: Vijay Venkatachalam [mailto:Vijay.Venkatachalam at citrix.com]
> Sent: 20 August 2014 19:12
> To: OpenStack Development Mailing List 
> (openstack-dev at lists.openstack.org)
> Subject: [openstack-dev] [Neutron][LBaaS] Error at context exit for 
> subnet in unit test case
> 
> Hi,
> 
> I am writing a unit testcase with context as subnet, code here [1]. 
> When the context exits a delete of subnet is attempted and I am getting a MismatchError . Traceback posted here [2]. 
> 
> What could be going wrong here?
> 
> Testcase is written like the following
> ----------------------
> with self.subnet() as subnet:
>     blah1
>     blah2
>     blah3
> ----------------------
> 
> I am getting a "MismatchError: 409 != 204" error at blah3 when context exits.
> 
> [1] UnitTestCase Snippet - http://pastebin.com/rMtf2dQX [2] Traceback  
> - http://pastebin.com/2sPcZ8Jk
> 
> 
> Thanks,
> Vijay V.
> 
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

_______________________________________________
OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



More information about the OpenStack-dev mailing list