Merge "SSH over IPv4 when using a storage network"
diff --git a/manila_tempest_tests/common/remote_client.py b/manila_tempest_tests/common/remote_client.py
index 45f85d8..9970b0b 100644
--- a/manila_tempest_tests/common/remote_client.py
+++ b/manila_tempest_tests/common/remote_client.py
@@ -10,15 +10,14 @@
# License for the specific language governing permissions and limitations
# under the License.
-import six
import sys
from oslo_log import log
-
+import six
from tempest import config
from tempest.lib.common import ssh
from tempest.lib.common.utils import test_utils
-import tempest.lib.exceptions
+from tempest.lib import exceptions
CONF = config.CONF
@@ -30,7 +29,7 @@
def wrapper(self, *args, **kwargs):
try:
return function(self, *args, **kwargs)
- except tempest.lib.exceptions.SSHTimeout:
+ except exceptions.SSHTimeout:
try:
original_exception = sys.exc_info()
caller = test_utils.find_test_caller() or "not found"
diff --git a/manila_tempest_tests/services/share/json/shares_client.py b/manila_tempest_tests/services/share/json/shares_client.py
index 150c1e0..87d7e47 100644
--- a/manila_tempest_tests/services/share/json/shares_client.py
+++ b/manila_tempest_tests/services/share/json/shares_client.py
@@ -18,7 +18,6 @@
import six
from six.moves.urllib import parse as urlparse
-
from tempest import config
from tempest.lib.common import rest_client
from tempest.lib.common.utils import data_utils
@@ -26,6 +25,7 @@
from manila_tempest_tests import share_exceptions
+
CONF = config.CONF
diff --git a/manila_tempest_tests/services/share/v2/json/shares_client.py b/manila_tempest_tests/services/share/v2/json/shares_client.py
index 5e2f8df..c72aad8 100644
--- a/manila_tempest_tests/services/share/v2/json/shares_client.py
+++ b/manila_tempest_tests/services/share/v2/json/shares_client.py
@@ -15,9 +15,9 @@
import json
import re
-import six
import time
+import six
from six.moves.urllib import parse
from tempest import config
from tempest.lib.common.utils import data_utils
diff --git a/manila_tempest_tests/tests/api/admin/test_admin_actions.py b/manila_tempest_tests/tests/api/admin/test_admin_actions.py
index c6e21d7..686ae14 100644
--- a/manila_tempest_tests/tests/api/admin/test_admin_actions.py
+++ b/manila_tempest_tests/tests/api/admin/test_admin_actions.py
@@ -14,11 +14,11 @@
# under the License.
import ddt
+from tempest import config
import testtools
+from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
-from tempest import config
-from testtools import testcase as tc
CONF = config.CONF
diff --git a/manila_tempest_tests/tests/api/admin/test_quotas_negative.py b/manila_tempest_tests/tests/api/admin/test_quotas_negative.py
index e039045..b928d2b 100644
--- a/manila_tempest_tests/tests/api/admin/test_quotas_negative.py
+++ b/manila_tempest_tests/tests/api/admin/test_quotas_negative.py
@@ -14,13 +14,14 @@
# under the License.
import ddt
-import manila_tempest_tests.tests.api.test_replication_negative as rep_neg_test
from tempest import config
from tempest.lib import exceptions as lib_exc
import testtools
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
+from manila_tempest_tests.tests.api import test_replication_negative as \
+ rep_neg_test
from manila_tempest_tests import utils
CONF = config.CONF
diff --git a/manila_tempest_tests/tests/api/admin/test_share_group_types.py b/manila_tempest_tests/tests/api/admin/test_share_group_types.py
index d05c079..d6dcc72 100644
--- a/manila_tempest_tests/tests/api/admin/test_share_group_types.py
+++ b/manila_tempest_tests/tests/api/admin/test_share_group_types.py
@@ -13,8 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
-import ddt
import itertools
+
+import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
from testtools import testcase as tc
@@ -23,6 +24,7 @@
from manila_tempest_tests.tests.api import base
from manila_tempest_tests import utils
+
CONF = config.CONF
LATEST_MICROVERSION = CONF.share.max_api_microversion
diff --git a/manila_tempest_tests/tests/api/admin/test_share_manage.py b/manila_tempest_tests/tests/api/admin/test_share_manage.py
index f5fd840..a234adf 100644
--- a/manila_tempest_tests/tests/api/admin/test_share_manage.py
+++ b/manila_tempest_tests/tests/api/admin/test_share_manage.py
@@ -16,13 +16,13 @@
import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
-
from testtools import testcase as tc
from manila_tempest_tests.common import constants
from manila_tempest_tests.tests.api import base
from manila_tempest_tests import utils
+
CONF = config.CONF
diff --git a/manila_tempest_tests/tests/api/admin/test_snapshot_manage.py b/manila_tempest_tests/tests/api/admin/test_snapshot_manage.py
index 5c57aa9..85fa059 100644
--- a/manila_tempest_tests/tests/api/admin/test_snapshot_manage.py
+++ b/manila_tempest_tests/tests/api/admin/test_snapshot_manage.py
@@ -17,13 +17,13 @@
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import exceptions as lib_exc
-
from testtools import testcase as tc
from manila_tempest_tests.common import constants
from manila_tempest_tests.tests.api import base
from manila_tempest_tests import utils
+
CONF = config.CONF
diff --git a/manila_tempest_tests/tests/api/base.py b/manila_tempest_tests/tests/api/base.py
index 8b01cef..717228c 100755
--- a/manila_tempest_tests/tests/api/base.py
+++ b/manila_tempest_tests/tests/api/base.py
@@ -19,7 +19,6 @@
from oslo_log import log
import six
-
from tempest import config
from tempest.lib.common import cred_client
from tempest.lib.common.utils import data_utils
@@ -31,6 +30,7 @@
from manila_tempest_tests import share_exceptions
from manila_tempest_tests import utils
+
CONF = config.CONF
LOG = log.getLogger(__name__)
diff --git a/manila_tempest_tests/tests/api/test_quotas.py b/manila_tempest_tests/tests/api/test_quotas.py
index 97780ad..f3e1280 100644
--- a/manila_tempest_tests/tests/api/test_quotas.py
+++ b/manila_tempest_tests/tests/api/test_quotas.py
@@ -13,13 +13,15 @@
# License for the specific language governing permissions and limitations
# under the License.
-import ddt
import itertools
-from manila_tempest_tests import utils
+
+import ddt
from tempest import config
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
+from manila_tempest_tests import utils
+
CONF = config.CONF
PRE_SHARE_REPLICAS_MICROVERSION = "2.52"
diff --git a/manila_tempest_tests/tests/api/test_revert_to_snapshot.py b/manila_tempest_tests/tests/api/test_revert_to_snapshot.py
index ea9e5dd..d4e7fa5 100644
--- a/manila_tempest_tests/tests/api/test_revert_to_snapshot.py
+++ b/manila_tempest_tests/tests/api/test_revert_to_snapshot.py
@@ -14,7 +14,6 @@
# under the License.
import ddt
-
from tempest import config
from tempest.lib.common.utils import data_utils
from testtools import testcase as tc
@@ -24,6 +23,7 @@
from manila_tempest_tests.tests.api import base
from manila_tempest_tests import utils
+
CONF = config.CONF
diff --git a/manila_tempest_tests/tests/api/test_revert_to_snapshot_negative.py b/manila_tempest_tests/tests/api/test_revert_to_snapshot_negative.py
index 34b0530..1b2f49d 100644
--- a/manila_tempest_tests/tests/api/test_revert_to_snapshot_negative.py
+++ b/manila_tempest_tests/tests/api/test_revert_to_snapshot_negative.py
@@ -14,7 +14,6 @@
# under the License.
import ddt
-
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import exceptions
@@ -24,6 +23,7 @@
from manila_tempest_tests.tests.api import base
from manila_tempest_tests import utils
+
CONF = config.CONF
diff --git a/manila_tempest_tests/tests/api/test_rules.py b/manila_tempest_tests/tests/api/test_rules.py
index 337eca8..dd7ccc9 100644
--- a/manila_tempest_tests/tests/api/test_rules.py
+++ b/manila_tempest_tests/tests/api/test_rules.py
@@ -13,9 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
+import itertools
import ddt
-import itertools
from tempest import config
from tempest.lib import exceptions as lib_exc
import testtools
@@ -24,6 +24,7 @@
from manila_tempest_tests.tests.api import base
from manila_tempest_tests import utils
+
CONF = config.CONF
LATEST_MICROVERSION = CONF.share.max_api_microversion
diff --git a/manila_tempest_tests/tests/api/test_share_groups_negative.py b/manila_tempest_tests/tests/api/test_share_groups_negative.py
index a0a6b4b..9a2d18c 100644
--- a/manila_tempest_tests/tests/api/test_share_groups_negative.py
+++ b/manila_tempest_tests/tests/api/test_share_groups_negative.py
@@ -16,13 +16,13 @@
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import exceptions as lib_exc
-
from testtools import testcase as tc
from manila_tempest_tests.common import constants
from manila_tempest_tests.tests.api import base
from manila_tempest_tests import utils
+
CONF = config.CONF
diff --git a/manila_tempest_tests/tests/api/test_share_network_subnets_negative.py b/manila_tempest_tests/tests/api/test_share_network_subnets_negative.py
index 4836e74..cfc3f5c 100644
--- a/manila_tempest_tests/tests/api/test_share_network_subnets_negative.py
+++ b/manila_tempest_tests/tests/api/test_share_network_subnets_negative.py
@@ -14,7 +14,6 @@
# under the License.
import ddt
-
from tempest import config
from tempest.lib import exceptions as lib_exc
import testtools
@@ -24,6 +23,7 @@
from manila_tempest_tests.tests.api import base
from manila_tempest_tests import utils
+
CONF = config.CONF
diff --git a/manila_tempest_tests/tests/api/test_share_types_negative.py b/manila_tempest_tests/tests/api/test_share_types_negative.py
index 7ba6f86..7cdfbbf 100644
--- a/manila_tempest_tests/tests/api/test_share_types_negative.py
+++ b/manila_tempest_tests/tests/api/test_share_types_negative.py
@@ -13,8 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
-import ddt
import random
+
+import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import exceptions as lib_exc
@@ -22,6 +23,7 @@
from manila_tempest_tests.tests.api import base
+
CONF = config.CONF
LATEST_MICROVERSION = CONF.share.max_api_microversion
diff --git a/manila_tempest_tests/tests/api/test_shares.py b/manila_tempest_tests/tests/api/test_shares.py
index 49af8e2..fce8247 100644
--- a/manila_tempest_tests/tests/api/test_shares.py
+++ b/manila_tempest_tests/tests/api/test_shares.py
@@ -110,6 +110,16 @@
detailed_elements.add('progress')
self.assertTrue(detailed_elements.issubset(share.keys()), msg)
+ # This check will ensure that when a share creation request is handled,
+ # if the driver has the "driver handles share servers" option enabled,
+ # that a share server will be created, otherwise, not.
+ share_get = self.admin_shares_v2_client.get_share(share['id'])
+ share_server = share_get['share_server_id']
+ if CONF.share.multitenancy_enabled:
+ self.assertNotEmpty(share_server)
+ else:
+ self.assertEmpty(share_server)
+
# Delete share
self.shares_v2_client.delete_share(share['id'])
self.shares_v2_client.wait_for_resource_deletion(share_id=share['id'])
diff --git a/manila_tempest_tests/tests/api/test_snapshot_rules.py b/manila_tempest_tests/tests/api/test_snapshot_rules.py
index 0323916..309996c 100644
--- a/manila_tempest_tests/tests/api/test_snapshot_rules.py
+++ b/manila_tempest_tests/tests/api/test_snapshot_rules.py
@@ -13,15 +13,15 @@
# License for the specific language governing permissions and limitations
# under the License.
-import six
-
import ddt
+import six
from tempest import config
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
from manila_tempest_tests import utils
+
CONF = config.CONF
diff --git a/manila_tempest_tests/tests/scenario/manager.py b/manila_tempest_tests/tests/scenario/manager.py
index c83dfe6..1fa03f4 100644
--- a/manila_tempest_tests/tests/scenario/manager.py
+++ b/manila_tempest_tests/tests/scenario/manager.py
@@ -21,7 +21,6 @@
from oslo_utils import netutils
from oslo_utils import uuidutils
import six
-
from tempest.common import compute
from tempest.common import image as common_image
from tempest.common.utils.linux import remote_client
@@ -32,14 +31,14 @@
from tempest.lib.common.utils import data_utils
from tempest.lib.common.utils import test_utils
from tempest.lib import exceptions as lib_exc
-import tempest.test
+from tempest import test
CONF = config.CONF
LOG = log.getLogger(__name__)
-class ScenarioTest(tempest.test.BaseTestCase):
+class ScenarioTest(test.BaseTestCase):
"""Base class for scenario tests. Uses tempest own clients. """
credentials = ['primary']
diff --git a/manila_tempest_tests/tests/scenario/manager_share.py b/manila_tempest_tests/tests/scenario/manager_share.py
index bb7da5c..43eeac3 100644
--- a/manila_tempest_tests/tests/scenario/manager_share.py
+++ b/manila_tempest_tests/tests/scenario/manager_share.py
@@ -13,9 +13,15 @@
# License for the specific language governing permissions and limitations
# under the License.
+from tempfile import mkstemp
+
from oslo_log import log
import six
from six.moves.urllib.request import urlopen
+from tempest.common import waiters
+from tempest import config
+from tempest.lib.common.utils import data_utils
+from tempest.lib import exceptions
from manila_tempest_tests.common import constants
from manila_tempest_tests.common import remote_client
@@ -23,12 +29,6 @@
from manila_tempest_tests.tests.scenario import manager
from manila_tempest_tests import utils
-from tempest.common import waiters
-from tempest import config
-from tempest.lib.common.utils import data_utils
-from tempest.lib import exceptions
-
-from tempfile import mkstemp
CONF = config.CONF
LOG = log.getLogger(__name__)
diff --git a/manila_tempest_tests/tests/scenario/test_share_basic_ops.py b/manila_tempest_tests/tests/scenario/test_share_basic_ops.py
index ef73919..3cdc3ae 100644
--- a/manila_tempest_tests/tests/scenario/test_share_basic_ops.py
+++ b/manila_tempest_tests/tests/scenario/test_share_basic_ops.py
@@ -14,7 +14,6 @@
# under the License.
import ddt
-
from oslo_log import log as logging
from tempest import config
from tempest.lib import exceptions
@@ -26,6 +25,7 @@
from manila_tempest_tests.tests.scenario import manager_share as manager
from manila_tempest_tests import utils
+
CONF = config.CONF
LOG = logging.getLogger(__name__)
diff --git a/manila_tempest_tests/tests/scenario/test_share_extend.py b/manila_tempest_tests/tests/scenario/test_share_extend.py
index e0a1e4a..823e3c9 100644
--- a/manila_tempest_tests/tests/scenario/test_share_extend.py
+++ b/manila_tempest_tests/tests/scenario/test_share_extend.py
@@ -11,10 +11,9 @@
# under the License.
import ddt
-import six
-
from oslo_log import log as logging
from oslo_utils import units
+import six
from tempest import config
from tempest.lib import exceptions
from testtools import testcase as tc
@@ -23,6 +22,7 @@
from manila_tempest_tests.tests.api import base
from manila_tempest_tests.tests.scenario import manager_share as manager
+
CONF = config.CONF
LOG = logging.getLogger(__name__)
diff --git a/manila_tempest_tests/tests/scenario/test_share_manage_unmanage.py b/manila_tempest_tests/tests/scenario/test_share_manage_unmanage.py
index d58378c..1005740 100644
--- a/manila_tempest_tests/tests/scenario/test_share_manage_unmanage.py
+++ b/manila_tempest_tests/tests/scenario/test_share_manage_unmanage.py
@@ -11,7 +11,6 @@
# under the License.
import ddt
-
from oslo_log import log as logging
from tempest import config
from tempest.lib import exceptions
@@ -22,6 +21,7 @@
from manila_tempest_tests.tests.scenario import manager_share as manager
from manila_tempest_tests import utils
+
CONF = config.CONF
LOG = logging.getLogger(__name__)
diff --git a/manila_tempest_tests/tests/scenario/test_share_shrink.py b/manila_tempest_tests/tests/scenario/test_share_shrink.py
index 785c6ce..1d0e028 100644
--- a/manila_tempest_tests/tests/scenario/test_share_shrink.py
+++ b/manila_tempest_tests/tests/scenario/test_share_shrink.py
@@ -10,10 +10,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-import six
import time
from oslo_log import log as logging
+import six
from tempest import config
from tempest.lib import exceptions
import testtools
@@ -23,6 +23,7 @@
from manila_tempest_tests.tests.api import base
from manila_tempest_tests.tests.scenario import manager_share as manager
+
CONF = config.CONF
LOG = logging.getLogger(__name__)
diff --git a/manila_tempest_tests/utils.py b/manila_tempest_tests/utils.py
index e842a33..f30c0fc 100644
--- a/manila_tempest_tests/utils.py
+++ b/manila_tempest_tests/utils.py
@@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from netaddr import ip
import random
import re
+from netaddr import ip
import six
from tempest import config
import testtools
diff --git a/test-requirements.txt b/test-requirements.txt
index f230fa9..cf025c3 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -13,3 +13,4 @@
openstackdocstheme>=1.31.2 # Apache-2.0
# releasenotes
reno>=2.5.0 # Apache-2.0
+flake8-import-order
diff --git a/tox.ini b/tox.ini
index a185fab..43a9037 100644
--- a/tox.ini
+++ b/tox.ini
@@ -43,3 +43,5 @@
ignore = E123,E125,W503,W504
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
+import-order-style = pep8
+application-import-names = manila_tempest_tests
diff --git a/zuul.d/manila-tempest-jobs.yaml b/zuul.d/manila-tempest-jobs.yaml
index 7c4c5e3..f5c0f06 100644
--- a/zuul.d/manila-tempest-jobs.yaml
+++ b/zuul.d/manila-tempest-jobs.yaml
@@ -290,7 +290,7 @@
vars:
devstack_plugins:
devstack-plugin-ceph: https://opendev.org/openstack/devstack-plugin-ceph
- tempest_test_regex: manila_tempest_tests
+ tempest_test_regex: manila_tempest_tests.tests.scenario
# Those tests fail when using kernel client, because right now CephFS quotas
# is not supported. So for now those tests should be blacklisted.
# TODO(lkuchlan) un-blacklist those test when https://review.opendev.org/#/c/676722 will land.
@@ -304,8 +304,11 @@
MANILA_OPTGROUP_cephfsnative_driver_handles_share_servers: false
MANILA_OPTGROUP_cephfsnative_cephfs_conf_path: /etc/ceph/ceph.conf
MANILA_OPTGROUP_cephfsnative_cephfs_auth_id: manila
- MANILA_SERVICE_IMAGE_URL: https://tarballs.opendev.org/openstack/manila-image-elements/images/manila-service-image-cephfs-master.qcow2
- MANILA_SERVICE_IMAGE_NAME: manila-service-image-cephfs-master
+ # NOTE(gouthamr): The following need to use the latest images, however, there's a bug
+ # with cephfs on Ubuntu 20.04 LTS: https://tracker.ceph.com/issues/47236
+ # the latest image is built as https://tarballs.opendev.org/openstack/manila-image-elements/images/manila-service-image-cephfs-master.qcow2
+ MANILA_SERVICE_IMAGE_URL: https://tarballs.opendev.org/openstack/manila-image-elements/images/manila-service-image-cephfs-1.3.0-58-g2859569.qcow2
+ MANILA_SERVICE_IMAGE_NAME: manila-service-image-cephfs-1.3.0-58-g2859569
devstack_local_conf:
test-config:
$TEMPEST_CONFIG: