From 4212a327ee4e1f42ed221ac0db32b01cd7b03f05 Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Fri, 28 Jul 2017 04:47:48 -0700 Subject: [PATCH] Fixes flake8 and unittest errors Change-Id: I4398a098da08ed8e086edac86fe8d68a06cf8eda --- oswin_tempest_plugin/config.py | 1 + oswin_tempest_plugin/tests/scenario/test_cluster.py | 2 +- oswin_tempest_plugin/tests/scenario/test_disks.py | 2 +- oswin_tempest_plugin/tests/scenario/test_vnuma.py | 2 +- oswin_tempest_plugin/tests/test_base.py | 3 ++- requirements.txt | 4 ++++ tox.ini | 6 +++++- 7 files changed, 15 insertions(+), 5 deletions(-) diff --git a/oswin_tempest_plugin/config.py b/oswin_tempest_plugin/config.py index e43e776..8870636 100644 --- a/oswin_tempest_plugin/config.py +++ b/oswin_tempest_plugin/config.py @@ -24,6 +24,7 @@ hyperv_group = cfg.OptGroup(name='hyperv', HyperVGroup = [ cfg.IntOpt('hypervisor_version', + default=0, help="Compute nodes' hypervisor version, used to determine " "which tests to run. It must have following value: " "major_version * 1000 + minor_version" diff --git a/oswin_tempest_plugin/tests/scenario/test_cluster.py b/oswin_tempest_plugin/tests/scenario/test_cluster.py index 1d6e3aa..0a68963 100644 --- a/oswin_tempest_plugin/tests/scenario/test_cluster.py +++ b/oswin_tempest_plugin/tests/scenario/test_cluster.py @@ -21,9 +21,9 @@ from tempest.lib import exceptions as lib_exc from oswin_tempest_plugin.clients import wsman from oswin_tempest_plugin import config from oswin_tempest_plugin import exceptions -from oswin_tempest_plugin.tests import test_base from oswin_tempest_plugin.tests._mixins import migrate from oswin_tempest_plugin.tests._mixins import resize +from oswin_tempest_plugin.tests import test_base CONF = config.CONF LOG = logging.getLogger(__name__) diff --git a/oswin_tempest_plugin/tests/scenario/test_disks.py b/oswin_tempest_plugin/tests/scenario/test_disks.py index 9a06a3e..c27728a 100644 --- a/oswin_tempest_plugin/tests/scenario/test_disks.py +++ b/oswin_tempest_plugin/tests/scenario/test_disks.py @@ -14,9 +14,9 @@ # under the License. from oswin_tempest_plugin import config -from oswin_tempest_plugin.tests import test_base from oswin_tempest_plugin.tests._mixins import migrate from oswin_tempest_plugin.tests._mixins import resize +from oswin_tempest_plugin.tests import test_base CONF = config.CONF diff --git a/oswin_tempest_plugin/tests/scenario/test_vnuma.py b/oswin_tempest_plugin/tests/scenario/test_vnuma.py index 3fa1977..2b95294 100644 --- a/oswin_tempest_plugin/tests/scenario/test_vnuma.py +++ b/oswin_tempest_plugin/tests/scenario/test_vnuma.py @@ -13,10 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oswin_tempest_plugin.tests import test_base from oswin_tempest_plugin.tests._mixins import migrate from oswin_tempest_plugin.tests._mixins import optional_feature from oswin_tempest_plugin.tests._mixins import resize +from oswin_tempest_plugin.tests import test_base class HyperVvNumaTestCase(test_base.TestBase, diff --git a/oswin_tempest_plugin/tests/test_base.py b/oswin_tempest_plugin/tests/test_base.py index 994fb28..c99dd9e 100644 --- a/oswin_tempest_plugin/tests/test_base.py +++ b/oswin_tempest_plugin/tests/test_base.py @@ -21,6 +21,7 @@ from tempest.common.utils.linux import remote_client from tempest.common import waiters from tempest.lib.common.utils import data_utils from tempest.lib.common.utils import test_utils +from tempest.lib import exceptions import tempest.test from oswin_tempest_plugin import config @@ -219,7 +220,7 @@ class TestBase(tempest.test.BaseTestCase): for ruleset in rulesets: for r_direction in ['ingress', 'egress']: ruleset['direction'] = r_direction - sg_rule = self._create_security_group_rule( + self._create_security_group_rule( secgroup, **ruleset) def _create_security_group_rule(self, secgroup, **kwargs): diff --git a/requirements.txt b/requirements.txt index 450deb6..8e24361 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,8 @@ # process, which may cause wedges in the gate later. pbr>=2.0 # Apache-2.0 + +oslo.config>=4.0.0,!=4.3.0,!=4.4.0 # Apache-2.0 +oslo.log>=3.22.0 # Apache-2.0 +tempest>=16.1.0 # Apache-2.0 pywinrm>=0.2.2 # MIT diff --git a/tox.ini b/tox.ini index 338770f..bd1d8b0 100644 --- a/tox.ini +++ b/tox.ini @@ -8,8 +8,12 @@ usedevelop = True install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} setenv = VIRTUAL_ENV={envdir} + BRANCH_NAME=master + CLIENT_NAME=oswin-tempest-plugin PYTHONWARNINGS=default::DeprecationWarning -deps = -r{toxinidir}/test-requirements.txt +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + commands = python setup.py test --slowest --testr-args='{posargs}' [testenv:pep8]