Delete routes before unsubscribing from an instance
Production code agent does this and control-node expects this as well, from
any subscribed agent (mock or otherwise). Otherwise routes can remain undeleted
in the control-node's table (until the session flaps), or routes are explicitly
deleted.
But some tests still need routes not to be deleted during unsubscribe. Add an
argument to support this functionality to Unsubscribe() API of the mock agent
and use it in tests as necessary.
Also add security-group id to advertised routes. One can set --nsgids to a
desired number. route-id % nsgids is used as the actual sgid advertised. By
increasing nsgids, one can get different sgids across a given set of routes.
Mock-agent code also does not run eor timers (but uses BgpXmppChannel object)
Add necessary protection while cancelling the timer
Reviewed: https:/ /review. opencontrail. org/23825 github. org/Juniper/ contrail- controller/ commit/ 6b17e4f39b2719f e2803f8db1ac514 aa4fe00b82
Committed: http://
Submitter: Zuul
Branch: master
commit 6b17e4f39b2719f e2803f8db1ac514 aa4fe00b82
Author: Ananth Suryanarayana <email address hidden>
Date: Thu Sep 1 12:25:20 2016 -0700
Delete routes before unsubscribing from an instance
Production code agent does this and control-node expects this as well, from
any subscribed agent (mock or otherwise). Otherwise routes can remain undeleted
in the control-node's table (until the session flaps), or routes are explicitly
deleted.
But some tests still need routes not to be deleted during unsubscribe. Add an
argument to support this functionality to Unsubscribe() API of the mock agent
and use it in tests as necessary.
Also add security-group id to advertised routes. One can set --nsgids to a
desired number. route-id % nsgids is used as the actual sgid advertised. By
increasing nsgids, one can get different sgids across a given set of routes.
Mock-agent code also does not run eor timers (but uses BgpXmppChannel object)
Add necessary protection while cancelling the timer
Change-Id: Ic4f7ed2f064515 1a7521130c09bb3 78418bc605a
Partial-Bug: #1464016