summaryrefslogtreecommitdiffstats
path: root/apex/tests
diff options
context:
space:
mode:
authorRicardo Noriega <rnoriega@redhat.com>2018-07-27 11:29:41 +0200
committerRicardo Noriega <rnoriega@redhat.com>2018-08-02 16:10:53 +0200
commitc4b66d46770847e9090a06c4c2ec3e8266606282 (patch)
tree704dc9f02450146a4cbb1646c2e8c4168f38dfcb /apex/tests
parent31c91eafaf4ede17b057b9ae16df3821fe8c0aca (diff)
Enable BGPVPN for master deployments
- Injection of Quagga tarball via overcloud builder. - Extraction and installation of all related packages. - It uses SDNVPN artifact repository to download Quagga tarball, so there is only one source to test. - Modifies bgpvpn scenario files to use OS master branch, ODL master branch and containers. JIRA: APEX-627 Change-Id: Icdbc2853d9531048e23fd6d5e444bd68208d18fc Signed-off-by: Ricardo Noriega <rnoriega@redhat.com>
Diffstat (limited to 'apex/tests')
-rw-r--r--apex/tests/test_apex_overcloud_deploy.py48
1 files changed, 40 insertions, 8 deletions
diff --git a/apex/tests/test_apex_overcloud_deploy.py b/apex/tests/test_apex_overcloud_deploy.py
index 17911d5..41f2e01 100644
--- a/apex/tests/test_apex_overcloud_deploy.py
+++ b/apex/tests/test_apex_overcloud_deploy.py
@@ -29,7 +29,7 @@ from apex.overcloud.deploy import prep_sriov_env
from apex.overcloud.deploy import external_network_cmds
from apex.overcloud.deploy import create_congress_cmds
from apex.overcloud.deploy import SDN_FILE_MAP
-from apex.overcloud.deploy import get_docker_sdn_file
+from apex.overcloud.deploy import get_docker_sdn_files
from nose.tools import (
assert_regexp_matches,
@@ -133,6 +133,7 @@ class TestOvercloudDeploy(unittest.TestCase):
'tacker': False,
'containers': True,
'barometer': False,
+ 'vpn': False,
'ceph': True,
'sdn_controller': 'opendaylight',
'sriov': False,
@@ -219,6 +220,7 @@ class TestOvercloudDeploy(unittest.TestCase):
ds_opts = {'dataplane': 'fdio',
'sdn_controller': 'opendaylight',
'odl_version': 'master',
+ 'vpn': False,
'sriov': False}
ds = {'deploy_options': MagicMock(),
'global_params': MagicMock()}
@@ -236,6 +238,7 @@ class TestOvercloudDeploy(unittest.TestCase):
def test_prep_image_sdn_false(self, mock_os_path, mock_shutil,
mock_virt_utils):
ds_opts = {'dataplane': 'fdio',
+ 'vpn': False,
'sdn_controller': False}
ds = {'deploy_options': MagicMock(),
'global_params': MagicMock()}
@@ -254,6 +257,7 @@ class TestOvercloudDeploy(unittest.TestCase):
mock_virt_utils, mock_inject_odl):
ds_opts = {'dataplane': 'ovs',
'sdn_controller': 'opendaylight',
+ 'vpn': False,
'odl_version': con.DEFAULT_ODL_VERSION,
'odl_vpp_netvirt': True}
ds = {'deploy_options': MagicMock(),
@@ -323,6 +327,7 @@ class TestOvercloudDeploy(unittest.TestCase):
def test_prep_image_sdn_ovn(self, mock_os_path, mock_shutil,
mock_virt_utils):
ds_opts = {'dataplane': 'ovs',
+ 'vpn': False,
'sdn_controller': 'ovn'}
ds = {'deploy_options': MagicMock(),
'global_params': MagicMock()}
@@ -332,6 +337,32 @@ class TestOvercloudDeploy(unittest.TestCase):
prep_image(ds, ns, 'undercloud.qcow2', '/tmp', root_pw='test')
mock_virt_utils.virt_customize.assert_called()
+ @patch('apex.builders.overcloud_builder.inject_quagga')
+ @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_vpn(self, mock_os_path, mock_shutil,
+ mock_virt_utils, mock_inject_odl,
+ mock_inject_quagga):
+ ds_opts = {'dataplane': 'ovs',
+ 'sdn_controller': 'opendaylight',
+ 'vpn': 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_quagga.assert_called()
+
@patch('apex.overcloud.deploy.os.path.isfile')
def test_prep_image_no_image(self, mock_isfile):
mock_isfile.return_value = False
@@ -767,19 +798,20 @@ class TestOvercloudDeploy(unittest.TestCase):
mock_parsers.return_value.__getitem__.side_effect = KeyError()
assert_raises(KeyError, create_congress_cmds, 'overcloud_file')
- def test_get_docker_sdn_file(self):
+ def test_get_docker_sdn_files(self):
ds_opts = {'ha_enabled': True,
'congress': True,
'tacker': True,
'containers': False,
'barometer': True,
'ceph': False,
+ 'vpn': True,
'sdn_controller': 'opendaylight',
'os_version': 'queens'
}
- output = get_docker_sdn_file(ds_opts)
- self.assertEqual(output,
- ('/usr/share/openstack-tripleo-heat-templates'
- '/environments/services/neutron-opendaylight'
- '.yaml')
- )
+ output = get_docker_sdn_files(ds_opts)
+ compare = ['/usr/share/openstack-tripleo-heat-templates/'
+ 'environments/services/neutron-opendaylight.yaml',
+ '/usr/share/openstack-tripleo-heat-templates/environments'
+ '/services/neutron-bgpvpn-opendaylight.yaml']
+ self.assertEqual(output, compare)