summaryrefslogtreecommitdiffstats
path: root/apex/tests/test_apex_overcloud_deploy.py
diff options
context:
space:
mode:
Diffstat (limited to 'apex/tests/test_apex_overcloud_deploy.py')
-rw-r--r--apex/tests/test_apex_overcloud_deploy.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/apex/tests/test_apex_overcloud_deploy.py b/apex/tests/test_apex_overcloud_deploy.py
index 1ba5dd9..71ef80b 100644
--- a/apex/tests/test_apex_overcloud_deploy.py
+++ b/apex/tests/test_apex_overcloud_deploy.py
@@ -242,6 +242,7 @@ class TestOvercloudDeploy(unittest.TestCase):
ds_opts = {'dataplane': 'ovs',
'sdn_controller': 'opendaylight',
'vpn': False,
+ 'sfc': False,
'odl_version': con.DEFAULT_ODL_VERSION,
'odl_vpp_netvirt': True}
ds = {'deploy_options': MagicMock(),
@@ -340,6 +341,7 @@ class TestOvercloudDeploy(unittest.TestCase):
mock_virt_utils):
ds_opts = {'dataplane': 'ovs',
'vpn': False,
+ 'sfc': False,
'sdn_controller': 'ovn'}
ds = {'deploy_options': MagicMock(),
'global_params': MagicMock()}
@@ -361,6 +363,7 @@ class TestOvercloudDeploy(unittest.TestCase):
ds_opts = {'dataplane': 'ovs',
'sdn_controller': 'opendaylight',
'vpn': True,
+ 'sfc': False,
'odl_version': con.DEFAULT_ODL_VERSION,
'odl_vpp_netvirt': True}
ds = {'deploy_options': MagicMock(),
@@ -375,6 +378,33 @@ class TestOvercloudDeploy(unittest.TestCase):
mock_inject_odl.assert_called()
mock_inject_quagga.assert_called()
+ @patch('apex.builders.overcloud_builder.inject_ovs_nsh')
+ @patch('apex.builders.overcloud_builder.inject_opendaylight')
+ @patch('apex.overcloud.deploy.virt_utils')
+ @patch('apex.overcloud.deploy.shutil')
+ @patch('apex.overcloud.deploy.os.path')
+ @patch('builtins.open', mock_open())
+ def test_prep_image_sdn_odl_sfc(self, mock_os_path, mock_shutil,
+ mock_virt_utils, mock_inject_odl,
+ mock_inject_ovs_nsh):
+ ds_opts = {'dataplane': 'ovs',
+ 'sdn_controller': 'opendaylight',
+ 'vpn': False,
+ 'sfc': True,
+ 'odl_version': con.DEFAULT_ODL_VERSION,
+ 'odl_vpp_netvirt': True}
+ ds = {'deploy_options': MagicMock(),
+ 'global_params': MagicMock()}
+ ds['deploy_options'].__getitem__.side_effect = \
+ lambda i: ds_opts.get(i, MagicMock())
+ ds['deploy_options'].__contains__.side_effect = \
+ lambda i: True if i in ds_opts else MagicMock()
+ ns = MagicMock()
+ prep_image(ds, ns, 'undercloud.qcow2', '/tmp', root_pw='test')
+ mock_virt_utils.virt_customize.assert_called()
+ mock_inject_odl.assert_called()
+ mock_inject_ovs_nsh.assert_called()
+
@patch('apex.overcloud.deploy.os.path.isfile')
def test_prep_image_no_image(self, mock_isfile):
mock_isfile.return_value = False