This is a follow on to change I8cf5483982085da57ee470fa2753b0d0aebc12b3.
In the case of a race to deallocate an instance which was previously
associated with a fixed IP that is now currently associated with a new
instance (with different VIFs and therefore different MAC addresses), we
check the mac address in release_fixed_ip to see if it's on the VIF that
is related to the instance that is associated to the fixed IP being
released.
If the currently associated instance on the fixed IP does not match the
instance associated with the old VIF (from the mac address passed in),
ignore the release request so we don't diassociate the fixed IP from the
new instance that is allocating network with that fixed IP.
Also fixes the method so that it doesn't attempt to update the fixed IP
in the database if it's not leased.
There were no existing unit tests for released_fixed_ip so a whole set
of new tests is added to cover the various conditions in the method.
Co-Authored-By: Dan Smith <dms@danplanet.com>
Closes-Bug: #1249065
Change-Id: I84fa2f0926f719bff33ac43b39e161a4eb412f44