Merge "Fix compute scope test bug"
This commit is contained in:
@@ -14,7 +14,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
fake_scope_1 = [{'compute': [{'availability_zones': [{'name': 'AZ1'}]},
|
fake_scope_1 = [{'compute': [{'availability_zones': [{'name': 'AZ1'},
|
||||||
|
{'name': 'AZ3'}]},
|
||||||
{'exclude': [
|
{'exclude': [
|
||||||
{'instances': [
|
{'instances': [
|
||||||
{'uuid': 'INSTANCE_6'}]},
|
{'uuid': 'INSTANCE_6'}]},
|
||||||
|
@@ -40,10 +40,13 @@ class TestComputeScope(base.TestCase):
|
|||||||
mock_zone_list.return_value = [
|
mock_zone_list.return_value = [
|
||||||
mock.Mock(zone='AZ{0}'.format(i),
|
mock.Mock(zone='AZ{0}'.format(i),
|
||||||
host={'Node_{0}'.format(i): {}})
|
host={'Node_{0}'.format(i): {}})
|
||||||
for i in range(2)]
|
for i in range(4)]
|
||||||
model = compute.ComputeScope(audit_scope, mock.Mock(),
|
model = compute.ComputeScope(audit_scope, mock.Mock(),
|
||||||
osc=mock.Mock()).get_scoped_model(cluster)
|
osc=mock.Mock()).get_scoped_model(cluster)
|
||||||
expected_edges = [('INSTANCE_2', 'Node_1')]
|
|
||||||
|
# NOTE(adisky):INSTANCE_6 is not excluded from model it will be tagged
|
||||||
|
# as 'exclude' TRUE, blueprint compute-cdm-include-all-instances
|
||||||
|
expected_edges = [('INSTANCE_2', 'Node_1'), (u'INSTANCE_6', u'Node_3')]
|
||||||
self.assertEqual(sorted(expected_edges), sorted(model.edges()))
|
self.assertEqual(sorted(expected_edges), sorted(model.edges()))
|
||||||
|
|
||||||
@mock.patch.object(nova_helper.NovaHelper, 'get_service_list')
|
@mock.patch.object(nova_helper.NovaHelper, 'get_service_list')
|
||||||
|
Reference in New Issue
Block a user