From c4c16bcf497ef77119509f6ab63a3b769e41e9be Mon Sep 17 00:00:00 2001 From: Alex Kavanagh Date: Mon, 3 Sep 2018 11:33:57 +0100 Subject: [PATCH] Fix bug in scenario/manager and cover it with pep8 manager.py had a syntax error which caused the module to be not installable. This wasn't picked up in testing. This fixes the bug and adds pep8 coverage to the nova_lxd_tempest_plugin so that the module always remains installable. Also, this fixes the tempest concurrency at 1. See the related bugs. Closes-bug: #1790956 Related-Bug: #1790943 Change-Id: Ie542b062a9f0997f6363877ff03f0f9bfc8f3d43 --- devstack/tempest-dsvm-lxd-rc | 4 ++++ nova_lxd_tempest_plugin/tests/scenario/manager.py | 4 +--- nova_lxd_tempest_plugin/tests/scenario/test_volume_ops.py | 6 ------ tox.ini | 4 +++- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/devstack/tempest-dsvm-lxd-rc b/devstack/tempest-dsvm-lxd-rc index 5cc4247c..f36a98c3 100644 --- a/devstack/tempest-dsvm-lxd-rc +++ b/devstack/tempest-dsvm-lxd-rc @@ -87,3 +87,7 @@ r="$r|(?:.*ServerShowV263Test.test_show_update_rebuild_list_server.*)" r="$r).*$" export DEVSTACK_GATE_TEMPEST_REGEX="$r" + +# set the concurrency to 1 for devstack-gate +# See: https://bugs.launchpad.net/nova-lxd/+bug/1790943 +export TEMPEST_CONCURRENCY=1 diff --git a/nova_lxd_tempest_plugin/tests/scenario/manager.py b/nova_lxd_tempest_plugin/tests/scenario/manager.py index 67fef94a..20b3944e 100644 --- a/nova_lxd_tempest_plugin/tests/scenario/manager.py +++ b/nova_lxd_tempest_plugin/tests/scenario/manager.py @@ -16,10 +16,8 @@ import subprocess -import netaddr from oslo_log import log from oslo_serialization import jsonutils as json -from oslo_utils import netutils from tempest.common import compute from tempest.common import image as common_image @@ -565,7 +563,7 @@ class ScenarioTest(tempest.test.BaseTestCase): ip=ip_address, timeout=timeout, should_succeed=('reachable' if should_succeed - else 'unreachable')) + else 'unreachable'))) result = test_utils.call_until_true(ping, timeout, 1) LOG.debug("{caller} finishes ping {ip} in {timeout} sec and the " "ping result is {result}" diff --git a/nova_lxd_tempest_plugin/tests/scenario/test_volume_ops.py b/nova_lxd_tempest_plugin/tests/scenario/test_volume_ops.py index a3e64437..cf5e731f 100644 --- a/nova_lxd_tempest_plugin/tests/scenario/test_volume_ops.py +++ b/nova_lxd_tempest_plugin/tests/scenario/test_volume_ops.py @@ -14,18 +14,12 @@ # License for the specific language governing permissions and limitations # under the License. -import time from oslo_log import log as logging -import testtools -from tempest.common import waiters from tempest import config from tempest import exceptions -from tempest.lib.common.utils import data_utils from tempest.lib.common.utils import test_utils -from tempest.lib import decorators -from tempest.lib import exceptions as lib_exc from nova_lxd_tempest_plugin.tests.scenario import manager diff --git a/tox.ini b/tox.ini index 6c9a400e..8bfc113a 100644 --- a/tox.ini +++ b/tox.ini @@ -41,7 +41,9 @@ commands = [testenv:pep8] basepython = python3 deps = {[testenv]deps} -commands = flake8 {toxinidir}/nova +commands = + flake8 {toxinidir}/nova + flake8 {toxinidir}/nova_lxd_tempest_plugin [testenv:venv] basepython = python3