diff --git a/scenarios/networking/l2_dense.yaml b/scenarios/networking/l2_dense.yaml index 1d541b1..de9ae39 100644 --- a/scenarios/networking/l2_dense.yaml +++ b/scenarios/networking/l2_dense.yaml @@ -5,7 +5,7 @@ description: deployment: template: l2.hot - vm_accommodation: [pair, double_room, density: 8, compute_nodes: 2] + vm_accommodation: [pair, single_room, density: 4, compute_nodes: 2] execution: size: 'quadratic_progression' diff --git a/shaker/engine/deploy.py b/shaker/engine/deploy.py index cd7f62d..39f9838 100644 --- a/shaker/engine/deploy.py +++ b/shaker/engine/deploy.py @@ -30,7 +30,8 @@ def generate_agents(compute_nodes, vm_accommodation, unique): density = 1 for s in vm_accommodation: if isinstance(s, dict): - density = s.get('density', 1) + if s.get('density'): + density = s.get('density') if s.get('compute_nodes'): compute_nodes = compute_nodes[:s.get('compute_nodes')] diff --git a/tests/test_deploy.py b/tests/test_deploy.py index 8ba62c0..68af1ff 100644 --- a/tests/test_deploy.py +++ b/tests/test_deploy.py @@ -176,6 +176,14 @@ class TestDeploy(testtools.TestCase): unique) self.assertEqual(expected, actual) + def test_generate_agents_pair_single_room_density_compute_nodes(self): + unique = 'UU1D' + actual = deploy.generate_agents(['uno', 'duo', 'tre'], + ['pair', 'single_room', + {'density': 4}, {'compute_nodes': 2}], + unique) + self.assertEqual(8, len(actual)) + def test_filter_agents_all_deployed(self): agents = { 'UU1D_agent_0': {