summaryrefslogtreecommitdiffstats
path: root/apex/tests/test_apex_undercloud.py
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2018-11-05 09:30:32 -0500
committerTim Rozet <trozet@redhat.com>2018-11-13 14:23:47 -0500
commit1817e62a1a79061fbf397b2a8dfda8fdbf0d419b (patch)
treeba5069038d487d04bcd32a226b052c3b6e70f503 /apex/tests/test_apex_undercloud.py
parent1486696939e9b8d42f6f96bc5adb85849f675413 (diff)
Remove downloading undercloud.qcow2
OOO team is removing the undercloud disk image as it is no longer needed for containerized undercloud deployments. Instead, we can just use the overcloud image as the undercloud image. Additionally, OOO team has recommended we use current-tripleo instead of current-tripleo-rdo. current-tripleo-rdo was previously thought to be more stable with more promotion checks, but now it seems that it is older and current-tripleo now has the same stability/checks. This patch also bumps the undercloud RAM from 8GB to 10GB. With the new containerized undercloud there is more RAM consumption during deployment. Change-Id: I9e6bb2260dbe9f8796ee54d20527c0aad96476ec Signed-off-by: Tim Rozet <trozet@redhat.com>
Diffstat (limited to 'apex/tests/test_apex_undercloud.py')
-rw-r--r--apex/tests/test_apex_undercloud.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/apex/tests/test_apex_undercloud.py b/apex/tests/test_apex_undercloud.py
index 2d0dffcb..14586528 100644
--- a/apex/tests/test_apex_undercloud.py
+++ b/apex/tests/test_apex_undercloud.py
@@ -10,6 +10,7 @@
import ipaddress
import libvirt
import os
+import platform
import subprocess
import unittest
@@ -239,13 +240,16 @@ class TestUndercloud(unittest.TestCase):
assert_raises(ApexUndercloudException,
uc.configure, ns, ds, 'playbook', '/tmp/dir')
+ @patch('apex.undercloud.undercloud.virt_utils')
+ @patch('apex.undercloud.undercloud.uc_builder')
@patch('apex.undercloud.undercloud.os.remove')
@patch('apex.undercloud.undercloud.os.path')
@patch('apex.undercloud.undercloud.shutil')
@patch.object(Undercloud, '_get_vm', return_value=None)
@patch.object(Undercloud, 'create')
def test_setup_vols(self, mock_get_vm, mock_create,
- mock_shutil, mock_os_path, mock_os_remove):
+ mock_shutil, mock_os_path, mock_os_remove,
+ mock_uc_builder, mock_virt_utils):
uc = Undercloud('img_path', 'tplt_path', external_network=True)
mock_os_path.isfile.return_value = True
mock_os_path.exists.return_value = True
@@ -255,6 +259,9 @@ class TestUndercloud(unittest.TestCase):
src_img = os.path.join(uc.image_path, img_file)
dest_img = os.path.join(constants.LIBVIRT_VOLUME_PATH, img_file)
mock_shutil.copyfile.assert_called_with(src_img, dest_img)
+ if platform.machine() != 'aarch64':
+ mock_uc_builder.expand_disk.assert_called()
+ mock_virt_utils.virt_customize.assert_called()
@patch('apex.undercloud.undercloud.os.path')
@patch.object(Undercloud, '_get_vm', return_value=None)
@@ -278,12 +285,19 @@ class TestUndercloud(unittest.TestCase):
{'--run-command': 'chmod 600 /root/.ssh/authorized_keys'},
{'--run-command': 'restorecon '
'-R -v /root/.ssh'},
+ {'--run-command': 'id -u stack || useradd -m stack'},
+ {'--run-command': 'mkdir -p /home/stack/.ssh'},
+ {'--run-command': 'chown stack:stack /home/stack/.ssh'},
{'--run-command':
'cp /root/.ssh/authorized_keys /home/stack/.ssh/'},
{'--run-command':
'chown stack:stack /home/stack/.ssh/authorized_keys'},
{'--run-command':
- 'chmod 600 /home/stack/.ssh/authorized_keys'}]
+ 'chmod 600 /home/stack/.ssh/authorized_keys'},
+ {'--run-command':
+ 'echo "stack ALL = (ALL) NOPASSWD: ALL" >> '
+ '/etc/sudoers'},
+ {'--run-command': 'touch /etc/cloud/cloud-init.disabled'}]
mock_vutils.virt_customize.assert_called_with(test_ops, uc.volume)
@patch.object(Undercloud, '_get_vm', return_value=None)