Introduce a ifmap dependency manager

This patch is a part of the SNAT
and will be leveraged by the service
instance class that is going to be introduced
in a next patch.

Change-Id: I22c61f9b1de5778285327664572a88f597470060
Authored-by: Pedro Marques <roque@juniper.net>
Co-Authored-By: Sylvain Afchain <sylvain.afchain@enovance.com>
Fix issues in XmppConnection cleanup on XmppServer side.

https://review.opencontrail.org/#/c/601/

Couple of issues in XmppConnection cleanup have been identified when
trying to stabilize bgp_stress_test and bgp_xmpp_deferq_test:

o LifetimeManager is not used correctly - actor is enqueued to the
manager directly from the ManagedDelete method instead of invoking
the LifetimeActor Delete method. Given the right sequence of events
this causes problems when the connection is deleted from both above
(due to test TearDown) and below (the mock agent bringing down the
session)

o XmppConnections that are rejected during dequeue (because there's
already a connection from same IP) are not tracked properly.  This
causes problems such as deletion of a different incarnation of the
connection (i.e. same IP but not the same data structure).

Both the above result in assertions in the LifetimeActor destructor.

Following fixes have been implemented:

- Modify ManagedDelete to call Delete on the LifetimeActor. Do this
for both XmppClientConnection and XmppServerConnection.
- Introduce RetryDelete method to put the LifetimeActor back on the
LifetimeManager queue so that deletion is attempted again. Use this
rather than calling ManagedDelete when a lightweight dependent gets
cleaned up.
- Maintain an XmppConnectionSet to keep track of deleted connections
in the XmppServer.  If a connection is rejected in DequeueConnection
because there's a pre-existing connection to the same end point, it
it added to the XmppConnectionSet. A connection that's accepted is
inserted into the XmppConnectionMap. It is migrated from the map to
the set when the LifetimeManager invokes Shutdown. A connection is
erased from the set when it's destroyed.
- Change the XmppConnectionMap in XmppServer from boost::ptr_map to
a std::map since former doesn't allow entries to be removed without
destroying them.
- Remove is_deleted_ from XmppConnection and use the LifetimeActor
deleted state instead.
- Modify XmppConnection::Shutdown to be an alias for ManagedDelete.
- Tweak xmpp_server_sm_test to pass cleanly with new cleanup code.
- Make bgp_stress_test use XmppStateMachineTest for shorter timers.

Incidental changes:

- Rename McastTreeManager's MayResumeDelete to RetryDelete.
- Rename DBTable::MayResumeDelete to RetryDelete for consistency.
- Remove assertion in UpdatePeerRefCount as there's a problem with
it. The underlying problem will be debugged and fixed separately.

Change-Id: I1e51772a5532d23f34b7fba6d62058ba501adbe2
bug #1340668 - analytics_systest uses virtual_machine.sandesh defined in vnsw/agent. Change in this file recently has broken analytics_systest. analytics_systest should not rely on sandesh files defined in other modules. Added sandesh files used for analytics_systest in opserver/test/sandesh

Change-Id: I9c4c816ac158f53807e2c5683af8386e332608bd
Merge "Fix issues in XmppConnection cleanup on XmppServer side."
Send VM interface UUID as part of VM UVE

Change-Id: I0659753c5a5ecf17db97a028b473b50a6ba7e8c5
Merge "bug #1340668 - analytics_systest uses virtual_machine.sandesh defined in vnsw/agent. Change in this file recently has broken analytics_systest. analytics_systest should not rely on sandesh files defined in other modules. Added sandesh files used for analytics_systest in opserver/test/sandesh"
aligning requirements, sanity fix

Change-Id: Ic04262b46c43314ac1470175b109761382abc9bd
Fix race condition in BgpPeer close procedure.

The BgpPeer destructor sometimes asserts because all paths added
by the peer have not been deleted i.e. the refcount_ in BgpPeer
is non-zero.

Root cause is that the BgpPeer could get closed before it's been
registered to all VPN tables. Since the peer is not registered to
the VPN tables, routes from the peer that were added to the VPN
tables do not get deleted during the close procedure.  Note that
BGP processes updates and adds routes into appropriate tables w/o
wating for table registration to be complete.

Fix is to keep track of whether VPN tables have been registered.
If VPN tables have not been registered when the peer needs to be
closed, kick off the registration and defer the close procedure.
The close will eventually resume when registration for all tables
is complete.

The changes to BgpPeerTest and bgp_peer_close_test are needed as
the bgp_peer_close_test registers to membership manager directly
without actually establishing the BgpPeer.

Change-Id: I58300e36d048902709343860066eb2ffdc4dca73
default device_owner attribute on port-create should be null instead of TODO-device-owner

Change-Id: Ib08d8adae20a86f9c7d877c2a1105023760a54c3
Merge "default device_owner attribute on port-create should be null instead of TODO-device-owner"
Defer delete of peer till its reference is removed from RTGroupManager

Change-Id: I0bcfb3be20a3b01ae895badd46285fee4ee6affa
Merge "Fix race condition in BgpPeer close procedure."
Correctly raise the NoIdError exception

Change-Id: I11861d9f877778dd6144e91d183f47582a52e03a
IP allocation starts from reverse

After api server is restarted, the IP allocated
to a port starts from the reverse direction.

Change-Id: Ic16894e89aafb0d4fced2e03201e3875d7f1510a
Closes-bug: #1336722
Bug fixes for 2930 ,2855

Change-Id: I68abf200d0701b619539a692981ada4b367f2dab
Add missing requirements.txt in MANIFEST.in

This change Ic04262b46c43314ac1470175b109761382abc9bd
introduced a dependency to the requirements.txt which
is not present in the MANIFEST.in file

Change-Id: I900031c690748a7baec60aae8e1d8b08c46fe358
When api-server starts up, on connecting to rabbitmq, delete old-q which might have accumulated already handled updates (in resync step).
On temporary disconnnect + re-establish queue will remain and any updates that happened in the window will be processed.

Change-Id: Ic398486f5fba8a3b397223184d2fc14ba79c57ef
sanity fix

Change-Id: I1264290cb3b228d5febb59a8da7363814bec3f2c
Merge "Introduce a ifmap dependency manager"
Adding UT for Stats prefix-suffix query
Adding StatWalker code for generic parsing of StatOracle structures
Address review comments

minor fix for stats prefix-suffix test
Change-Id: Ib1a821502d4858da1d5508823abd8f1a4e19c03d