summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2018-12-07 16:09:50 -0500
committerTim Rozet <trozet@redhat.com>2018-12-07 17:13:11 -0500
commitf357aac22a1df2f10cca635c522e2397b2840f62 (patch)
treee8fd8136c6a59be20ad936e74d0a8bc3489c9226
parent19f668ebd5f8d313f1604dc45675a665a111ed7f (diff)
Upgrade OVS in undercloud
The OVS in the frozen undercloud disk image for Gambia is no longer working (perhaps due to kernel upgrade or package changes during deployment). This patch builds OVS the same way as is done for the SFC scenario in the undercloud disk image. JIRA: APEX-655 Change-Id: I6fa3e009a25806e299c7be88d6d3ee8db4c2648b Signed-off-by: Tim Rozet <trozet@redhat.com>
-rw-r--r--apex/deploy.py11
-rw-r--r--apex/tests/test_apex_deploy.py10
2 files changed, 15 insertions, 6 deletions
diff --git a/apex/deploy.py b/apex/deploy.py
index bc35e91f..64374a9a 100644
--- a/apex/deploy.py
+++ b/apex/deploy.py
@@ -394,6 +394,14 @@ def main():
# prep undercloud with required packages
uc_builder.add_upstream_packages(uc_image)
uc_builder.inject_calipso_installer(APEX_TEMP_DIR, uc_image)
+ # upgrade OVS in undercloud
+ shutil.copyfile(os.path.join(args.deploy_dir, 'build_ovs_nsh.sh'),
+ os.path.join(APEX_TEMP_DIR, 'build_ovs_nsh.sh'))
+ virt_utils.virt_customize(
+ [{constants.VIRT_RUN_CMD: 'yum -y upgrade kernel'}],
+ uc_image
+ )
+ oc_builder.inject_ovs_nsh(uc_image, APEX_TEMP_DIR)
# add patches from upstream to undercloud and overcloud
logging.info('Adding patches to undercloud')
patches = deployment.determine_patches()
@@ -435,9 +443,6 @@ def main():
else:
net_data = False
- shutil.copyfile(os.path.join(args.deploy_dir, 'build_ovs_nsh.sh'),
- os.path.join(APEX_TEMP_DIR, 'build_ovs_nsh.sh'))
-
# TODO(trozet): Either fix opnfv env or default to use upstream env
if args.env_file == 'opnfv-environment.yaml':
# Override the env_file if it is defaulted to opnfv
diff --git a/apex/tests/test_apex_deploy.py b/apex/tests/test_apex_deploy.py
index be52c276..8cb5576c 100644
--- a/apex/tests/test_apex_deploy.py
+++ b/apex/tests/test_apex_deploy.py
@@ -118,6 +118,7 @@ class TestDeploy(unittest.TestCase):
args.snapshot = False
assert_raises(ApexDeployException, validate_deploy_args, args)
+ @patch('apex.deploy.oc_builder')
@patch('apex.deploy.ApexDeployment')
@patch('apex.deploy.uc_builder')
@patch('apex.deploy.network_data.create_network_data')
@@ -146,7 +147,7 @@ class TestDeploy(unittest.TestCase):
mock_utils, mock_parsers, mock_oc_cfg,
mock_virt_utils, mock_inv, mock_build_vms, mock_uc_lib,
mock_oc_deploy, mock_shutil, mock_network_data,
- mock_uc_builder, mock_deployment):
+ mock_uc_builder, mock_deployment, mock_oc_builder):
net_sets_dict = {'networks': MagicMock(),
'dns_servers': 'test'}
ds_opts_dict = {'global_params': MagicMock(),
@@ -197,6 +198,7 @@ class TestDeploy(unittest.TestCase):
main()
mock_snap_deployment.assert_called()
+ @patch('apex.deploy.oc_builder')
@patch('apex.deploy.ApexDeployment')
@patch('apex.deploy.uc_builder')
@patch('apex.deploy.network_data.create_network_data')
@@ -225,7 +227,7 @@ class TestDeploy(unittest.TestCase):
mock_utils, mock_parsers, mock_oc_cfg,
mock_virt_utils, mock_inv, mock_build_vms, mock_uc_lib,
mock_oc_deploy, mock_shutil, mock_network_data,
- mock_uc_builder, mock_deployment):
+ mock_uc_builder, mock_deployment, mock_oc_builder):
# didn't work yet line 412
# net_sets_dict = {'networks': {'admin': {'cidr': MagicMock()}},
# 'dns_servers': 'test'}
@@ -329,6 +331,7 @@ class TestDeploy(unittest.TestCase):
# TODO(trozet) add assertions here with arguments for functions in
# deploy main
+ @patch('apex.deploy.oc_builder')
@patch('apex.deploy.ApexDeployment')
@patch('apex.deploy.uc_builder')
@patch('apex.deploy.network_data.create_network_data')
@@ -358,7 +361,8 @@ class TestDeploy(unittest.TestCase):
mock_utils, mock_parsers, mock_oc_cfg,
mock_virt_utils, mock_inv, mock_build_vms, mock_uc_lib,
mock_oc_deploy, mock_git, mock_shutil,
- mock_network_data, mock_uc_builder, mock_deployment):
+ mock_network_data, mock_uc_builder, mock_deployment,
+ mock_oc_builder):
net_sets_dict = {'networks': MagicMock(),
'dns_servers': 'test'}
ds_opts_dict = {'global_params': MagicMock(),