Fix building quantumapi network model with network list

Bug 1171636 occurs when _build_network_info_model() receives a list
of networks that does not fully map all of an instance's ports.
It crashes in _ensure_requested_network_ordering() when the list of
all ports is sorted by the subset of networks provided.

This change simplifies the early part of that function to only
consider ports within the networks provided, and to always sort those
ports in network order. This allows us to remove some error path
code from the loop below that iterates over the ports (which contained
a fatal typo, by the way) which is now dead code.

The affected code is really untested at the moment, due to the
structure of the method, making it hard to add a unit test to cover
this fix. In order to make the change clear from the existing code,
this fix is provided here first, and the following patch restructures
the method and add tests for this change and the rest of the surrounding
code.

Fixes bug 1171636

Change-Id: Idf519a88415844451b18959b38cc48ce92c090d1
Make _build_network_info_model testable

This restructures the quantumapi _build_network_info_model()
method to be testable and adds tests for each of the smaller
components. It also provides verification for bug 1171636 by
ensuring that ports returned from the client that are not in the
set of networks passed don't cause the failure detailed in that
bug.

Change-Id: I82f20f68122fc38e72c31e52283529614252c174
Checks if volume can be attached

This patches makes a boot fail fast if one of the volumes cannot
be attached at boot time. Currently the request is accepted but
spawning fails in addition to leaving the volume state as
available which is an inconsistent state

Change-Id: I35b2034f8aa9574fcb8a34b58ead9f5e9ef27664
fixes: bug 1166770
Move db.fixed_ip_* tests from DbApiTestCase to FixedIpTestCase

During bp db-api-tests we will create for each model
ModelNameTestCase that contains tests for all methods that works
with this model..

So we shouldn't have DbApiTestCase at all. This patch will move
from DbApiTestCase methods that tests fixed_ip_* methods to already
existing FixedIpTestCase and a little bit improve it.

blueprint db-api-tests

Change-Id: I914c448d26c2b04a9fc3aa9614b7adf6f35b54d0
Merge "Fix building quantumapi network model with network list"
Merge "Make _build_network_info_model testable"
Merge "Move db.fixed_ip_* tests from DbApiTestCase to FixedIpTestCase"
Merge "Checks if volume can be attached"