Project restructure
Project restructure to make the project work as a StackForge project. By: - Update .testr.conf and tox.ini for python-jobs - Rename project top level dir - Put unittest script to the folder that should be - Updtae doc/ and README.rst - Update setup.cfg Change-Id: Ia00ac57630385e5dcca3020d67115b46894bd0a9
This commit is contained in:
parent
588d68108a
commit
50b6816f88
|
@ -2,6 +2,8 @@
|
|||
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
|
||||
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
|
||||
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
|
||||
${PYTHON:-python} -m subunit.run discover -t ./ . $LISTOPT $IDOPTION
|
||||
${PYTHON:-python} -m subunit.run discover \
|
||||
-t ./nova/tests/unit/virt/zvm/ ./nova/tests/unit/virt/zvm \
|
||||
$LISTOPT $IDOPTION
|
||||
test_id_option=--load-list $IDFILE
|
||||
test_list_option=--list
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
This project implements Nova virtulization driver for z/VM, which
|
||||
This project implements Nova virtulization driver for z/VM, which
|
||||
enables OpenStack manage z/VM hypervisor and virtual machines
|
||||
running in the z/VM system.
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ html_theme = 'default'
|
|||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
html_theme_options = {'incubating': True}
|
||||
#html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
#html_theme_path = []
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Welcome to nova-zvm-virt-driver's documentation!
|
||||
================================================
|
||||
|
||||
This project implements Nova virtulization driver for z/VM, which
|
||||
This project implements Nova virtulization driver for z/VM, which
|
||||
enables OpenStack manage z/VM hypervisor and virtual machines
|
||||
running in the z/VM system.
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright 2013 IBM Corp.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
|
@ -23,6 +21,10 @@ import socket
|
|||
|
||||
import mock
|
||||
import mox
|
||||
from oslo_concurrency import processutils
|
||||
from oslo_config import cfg
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
from nova import context
|
||||
from nova import db
|
||||
from nova import exception as nova_exception
|
||||
|
@ -33,17 +35,14 @@ from nova.openstack.common import fileutils
|
|||
from nova import test
|
||||
from nova.tests.unit import fake_instance
|
||||
from nova.virt import fake
|
||||
from oslo_config import cfg
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
from nova_zvm.virt.zvm import configdrive
|
||||
from nova_zvm.virt.zvm import driver
|
||||
from nova_zvm.virt.zvm import exception
|
||||
from nova_zvm.virt.zvm import imageop
|
||||
from nova_zvm.virt.zvm import instance
|
||||
from nova_zvm.virt.zvm import networkop
|
||||
from nova_zvm.virt.zvm import utils as zvmutils
|
||||
from nova_zvm.virt.zvm import volumeop
|
||||
from nova.virt.zvm import configdrive
|
||||
from nova.virt.zvm import driver
|
||||
from nova.virt.zvm import exception
|
||||
from nova.virt.zvm import imageop
|
||||
from nova.virt.zvm import instance
|
||||
from nova.virt.zvm import networkop
|
||||
from nova.virt.zvm import utils as zvmutils
|
||||
from nova.virt.zvm import volumeop
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
@ -257,11 +256,11 @@ class ZVMDriverTestCases(ZVMTestCase):
|
|||
self.mox.UnsetStubs()
|
||||
|
||||
def test_init_driver(self):
|
||||
self.assertTrue(isinstance(self.driver._xcat_url, zvmutils.XCATUrl))
|
||||
self.assertTrue(isinstance(self.driver._zvm_images, imageop.ZVMImages))
|
||||
self.assertTrue(isinstance(self.driver._pathutils, zvmutils.PathUtils))
|
||||
self.assertTrue(isinstance(self.driver._networkop,
|
||||
networkop.NetworkOperator))
|
||||
self.assertIsInstance(self.driver._xcat_url, zvmutils.XCATUrl)
|
||||
self.assertIsInstance(self.driver._zvm_images, imageop.ZVMImages)
|
||||
self.assertIsInstance(self.driver._pathutils, zvmutils.PathUtils)
|
||||
self.assertIsInstance(self.driver._networkop,
|
||||
networkop.NetworkOperator)
|
||||
|
||||
def test_update_host_info(self):
|
||||
self._set_fake_xcat_responses([self._fake_host_rinv_info(),
|
||||
|
@ -3225,3 +3224,27 @@ class ZVMImageOPTestCases(ZVMTestCase):
|
|||
self.assertRaises(exception.ZVMImageError,
|
||||
self.imageop.get_image_file_name, '/fake')
|
||||
self.mox.VerifyAll()
|
||||
|
||||
@mock.patch('nova.utils.execute')
|
||||
def test_get_root_disk_units(self, mk_exec):
|
||||
mk_exec.return_value = (''.join(['CKD', '1' * 160]), None)
|
||||
self.assertEqual(111111111111,
|
||||
self.imageop.get_root_disk_units('/fake'))
|
||||
|
||||
@mock.patch('nova.utils.execute')
|
||||
def test_get_root_disk_units_cmd_err(self, mk_exec):
|
||||
mk_exec.side_effect = processutils.ProcessExecutionError
|
||||
self.assertRaises(exception.ZVMImageError,
|
||||
self.imageop.get_root_disk_units, '/fake')
|
||||
|
||||
@mock.patch('nova.utils.execute')
|
||||
def test_get_root_disk_units_value_err(self, mk_exec):
|
||||
mk_exec.return_value = (''.join(['CKD', 's' * 160]), None)
|
||||
self.assertRaises(exception.ZVMImageError,
|
||||
self.imageop.get_root_disk_units, '/fake')
|
||||
|
||||
@mock.patch('nova.utils.execute')
|
||||
def test_get_root_disk_units_invalid_type(self, mk_exec):
|
||||
mk_exec.return_value = ('1' * 160, None)
|
||||
self.assertRaises(exception.ZVMImageError,
|
||||
self.imageop.get_root_disk_units, '/fake')
|
|
@ -1,5 +1,3 @@
|
|||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright 2013 IBM Corp.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
|
@ -25,7 +23,7 @@ xCat REST API. Thus OpenStack can operate to z/VM system indirectly.
|
|||
"""
|
||||
|
||||
|
||||
from nova_zvm.virt.zvm import driver
|
||||
from nova.virt.zvm import driver
|
||||
|
||||
|
||||
ZVMDriver = driver.ZVMDriver
|
|
@ -1,5 +1,3 @@
|
|||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright 2013 IBM Corp.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
|
@ -17,10 +15,11 @@
|
|||
import os
|
||||
import tarfile
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from nova import exception
|
||||
from nova import utils
|
||||
from nova.virt import configdrive
|
||||
from oslo_config import cfg
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
|
@ -1,5 +1,3 @@
|
|||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright 2013 IBM Corp.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
@ -1,5 +1,3 @@
|
|||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright 2013 IBM Corp.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
|
@ -20,6 +18,13 @@ import os
|
|||
import time
|
||||
import uuid
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import excutils
|
||||
from oslo_utils import timeutils
|
||||
from oslo_utils import units
|
||||
|
||||
from nova.api.metadata import base as instance_metadata
|
||||
from nova.compute import power_state
|
||||
from nova.compute import task_states
|
||||
|
@ -31,22 +36,15 @@ from nova.openstack.common import loopingcall
|
|||
from nova import utils
|
||||
from nova.virt import configdrive
|
||||
from nova.virt import driver
|
||||
from nova.virt.zvm import configdrive as zvmconfigdrive
|
||||
from nova.virt.zvm import const
|
||||
from nova.virt.zvm import exception
|
||||
from nova.virt.zvm import imageop
|
||||
from nova.virt.zvm import instance as zvminstance
|
||||
from nova.virt.zvm import networkop
|
||||
from nova.virt.zvm import utils as zvmutils
|
||||
from nova.virt.zvm import volumeop
|
||||
from nova import volume
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import excutils
|
||||
from oslo_utils import timeutils
|
||||
from oslo_utils import units
|
||||
|
||||
from nova_zvm.virt.zvm import configdrive as zvmconfigdrive
|
||||
from nova_zvm.virt.zvm import const
|
||||
from nova_zvm.virt.zvm import exception
|
||||
from nova_zvm.virt.zvm import imageop
|
||||
from nova_zvm.virt.zvm import instance as zvminstance
|
||||
from nova_zvm.virt.zvm import networkop
|
||||
from nova_zvm.virt.zvm import utils as zvmutils
|
||||
from nova_zvm.virt.zvm import volumeop
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
|
@ -1,5 +1,3 @@
|
|||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright 2013 IBM Corp.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
@ -1,5 +1,3 @@
|
|||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright 2013 IBM Corp.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
|
@ -22,19 +20,19 @@ import shutil
|
|||
import tarfile
|
||||
import xml.dom.minidom as Dom
|
||||
|
||||
from nova import exception as nova_exception
|
||||
from nova.i18n import _
|
||||
from nova.image import glance
|
||||
from nova import utils
|
||||
from nova.virt import images
|
||||
from oslo_concurrency import processutils
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
|
||||
from nova_zvm.virt.zvm import const
|
||||
from nova_zvm.virt.zvm import exception
|
||||
from nova_zvm.virt.zvm import utils as zvmutils
|
||||
from nova import exception as nova_exception
|
||||
from nova.i18n import _
|
||||
from nova.image import glance
|
||||
from nova import utils
|
||||
from nova.virt import images
|
||||
from nova.virt.zvm import const
|
||||
from nova.virt.zvm import exception
|
||||
from nova.virt.zvm import utils as zvmutils
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
CONF = cfg.CONF
|
||||
|
@ -770,7 +768,7 @@ class ZVMImages(object):
|
|||
"""use 'hexdump' to get the root_disk_units."""
|
||||
cmd = "hexdump -n 48 -C %s" % image_file_path
|
||||
try:
|
||||
(output, _) = utils.execute(cmd, shell=True)
|
||||
(output, _toss) = utils.execute(cmd, shell=True)
|
||||
except processutils.ProcessExecutionError:
|
||||
msg = (_("Get image property failed,"
|
||||
" please check whether the image file exists!"))
|
|
@ -1,5 +1,3 @@
|
|||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright 2013 IBM Corp.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
|
@ -18,18 +16,18 @@
|
|||
import binascii
|
||||
import datetime
|
||||
|
||||
from nova.compute import power_state
|
||||
from nova import exception as nova_exception
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import loopingcall
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import timeutils
|
||||
|
||||
from nova_zvm.virt.zvm import const
|
||||
from nova_zvm.virt.zvm import exception
|
||||
from nova_zvm.virt.zvm import utils as zvmutils
|
||||
from nova_zvm.virt.zvm import volumeop
|
||||
from nova.compute import power_state
|
||||
from nova import exception as nova_exception
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import loopingcall
|
||||
from nova.virt.zvm import const
|
||||
from nova.virt.zvm import exception
|
||||
from nova.virt.zvm import utils as zvmutils
|
||||
from nova.virt.zvm import volumeop
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
CONF = cfg.CONF
|
|
@ -1,5 +1,3 @@
|
|||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright 2013 IBM Corp.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
|
@ -15,12 +13,12 @@
|
|||
# under the License.
|
||||
|
||||
|
||||
from nova.i18n import _
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from nova_zvm.virt.zvm import exception
|
||||
from nova_zvm.virt.zvm import utils as zvmutils
|
||||
from nova.i18n import _
|
||||
from nova.virt.zvm import exception
|
||||
from nova.virt.zvm import utils as zvmutils
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
|
@ -1,5 +1,3 @@
|
|||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright 2013 IBM Corp.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
|
@ -22,19 +20,19 @@ import shutil
|
|||
import socket
|
||||
import time
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import excutils
|
||||
|
||||
from nova import block_device
|
||||
from nova.compute import power_state
|
||||
from nova import exception as nova_exception
|
||||
from nova.i18n import _
|
||||
from nova.i18n import _LE
|
||||
from nova.virt import driver
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import excutils
|
||||
|
||||
from nova_zvm.virt.zvm import const
|
||||
from nova_zvm.virt.zvm import exception
|
||||
from nova.virt.zvm import const
|
||||
from nova.virt.zvm import exception
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
|
@ -16,18 +16,18 @@ import contextlib
|
|||
import re
|
||||
import time
|
||||
|
||||
import nova.context
|
||||
from nova.i18n import _
|
||||
from nova.objects import block_device as block_device_obj
|
||||
from nova.objects import instance as instance_obj
|
||||
from nova import volume
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
from nova_zvm.virt.zvm import const
|
||||
from nova_zvm.virt.zvm import exception
|
||||
from nova_zvm.virt.zvm import utils as zvmutils
|
||||
import nova.context
|
||||
from nova.i18n import _
|
||||
from nova.objects import block_device as block_device_obj
|
||||
from nova.objects import instance as instance_obj
|
||||
from nova.virt.zvm import const
|
||||
from nova.virt.zvm import exception
|
||||
from nova.virt.zvm import utils as zvmutils
|
||||
from nova import volume
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
|
@ -16,8 +16,7 @@ classifier =
|
|||
Programming Language :: Python :: 2.7
|
||||
|
||||
[files]
|
||||
packages =
|
||||
nova_zvm
|
||||
packages = nova.virt.zvm
|
||||
|
||||
[build_sphinx]
|
||||
source-dir = doc/source
|
||||
|
|
7
tox.ini
7
tox.ini
|
@ -1,6 +1,6 @@
|
|||
[tox]
|
||||
minversion = 1.6
|
||||
envlist = py27,pep8
|
||||
envlist = pep8,py27
|
||||
skipsdist = True
|
||||
|
||||
[testenv]
|
||||
|
@ -14,9 +14,12 @@ deps = -r{toxinidir}/requirements.txt
|
|||
commands = python setup.py testr --slowest --testr-args='{posargs}'
|
||||
|
||||
[testenv:pep8]
|
||||
deps = -r{toxinidir}/test-requirements.txt
|
||||
commands = flake8
|
||||
|
||||
[testenv:py27]
|
||||
commands = /bin/cp -r {toxinidir}/nova/virt/zvm/ {toxinidir}/.tox/py27/src/nova/nova/virt/
|
||||
python setup.py testr --slowest --testr-args='{posargs}'
|
||||
|
||||
[testenv:venv]
|
||||
commands = {posargs}
|
||||
|
||||
|
|
Loading…
Reference in New Issue