示例#1
0
 def test_setup_vols(self, mock_get_vm, mock_create, mock_shutil,
                     mock_os_path, mock_os_remove):
     uc = Undercloud('img_path', 'tplt_path', external_network=True)
     mock_os_path.isfile.return_value = True
     mock_os_path.exists.return_value = True
     uc.setup_volumes()
     for img_file in ('overcloud-full.vmlinuz', 'overcloud-full.initrd',
                      'undercloud.qcow2'):
         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)
示例#2
0
 def test_setup_vols(self, mock_get_vm, mock_create,
                     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
     uc.setup_volumes()
     for img_file in ('overcloud-full.vmlinuz', 'overcloud-full.initrd',
                      'undercloud.qcow2'):
         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()