Merge "Add certificate validation scenario tests"
diff --git a/.gitignore b/.gitignore
index 5685b36..48f6897 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,7 +6,7 @@
 *.sqlite
 *.swp
 .coverage
-.testrepository
+.stestr/
 .tox
 .venv
 .idea
diff --git a/.stestr.conf b/.stestr.conf
new file mode 100644
index 0000000..ecc147c
--- /dev/null
+++ b/.stestr.conf
@@ -0,0 +1,3 @@
+[DEFAULT]
+test_path=./barbican_tempest_plugin/tests
+top_dir=./
diff --git a/.testr.conf b/.testr.conf
deleted file mode 100644
index 6a52f97..0000000
--- a/.testr.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-[DEFAULT]
-test_command=${PYTHON:-python} -m subunit.run discover -s ./barbican_tempest_plugin -t . $LISTOPT $IDOPTION
-
-test_id_option=--load-list $IDFILE
-test_list_option=--list
diff --git a/.zuul.yaml b/.zuul.yaml
index c321caf..d958843 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -4,11 +4,83 @@
       - check-requirements
     check:
       jobs:
-        - barbican-simple-crypto-devstack-tempest
+        - barbican-tempest-plugin-simple-crypto
+        - barbican-tempest-plugin-simple-crypto-ussuri
+        - barbican-tempest-plugin-simple-crypto-train
+        - barbican-tempest-plugin-simple-crypto-stein
+        - barbican-tempest-plugin-simple-crypto-ipv6-only
+        - barbican-tempest-plugin-simple-crypto-castellan-src
+        - barbican-tempest-plugin-simple-crypto-cursive
     gate:
       queue: barbican
       jobs:
-        - barbican-simple-crypto-devstack-tempest
-    experimental:
-      jobs:
-        - barbican-simple-crypto-devstack-tempest-py35
+        - barbican-tempest-plugin-simple-crypto
+
+- job:
+    name: barbican-tempest-plugin-simple-crypto
+    parent: devstack-tempest
+    required-projects: &barbican-tempest-reqs
+      - opendev.org/openstack/barbican
+      - opendev.org/openstack/barbican-tempest-plugin
+      - opendev.org/openstack/python-barbicanclient
+    vars: &barbican-tempest-vars
+      devstack_plugins:
+        barbican: https://opendev.org/openstack/barbican
+      devstack_localrc:
+        NOVA_BACKEND: LVM
+        LVM_VOLUME_CLEAR: none
+      devstack_local_conf:
+        post-config:
+          $NOVA_CONF:
+            glance:
+              verify_glance_signatures: True
+            ephemeral_storage_encryption:
+              key_size: 256
+              cipher: aes-xts-plain64
+              enabled: True
+        test-config:
+          $TEMPEST_CONFIG:
+            auth:
+              tempest_roles: creator
+            image-feature-enabled:
+              # this may be removed soon, as api_v1 is false since tempest>=20
+              api_v1: False
+            ephemeral_storage_encryption:
+              enabled: True
+      tox_envlist: all
+      tempest_test_regex: barbican
+      tempest_plugins:
+        - barbican-tempest-plugin
+
+- job:
+    name: barbican-tempest-plugin-simple-crypto-ussuri
+    parent: barbican-tempest-plugin-simple-crypto
+    override-checkout: stable/ussuri
+
+- job:
+    name: barbican-tempest-plugin-simple-crypto-train
+    parent: barbican-tempest-plugin-simple-crypto
+    override-checkout: stable/train
+
+- job:
+    name: barbican-tempest-plugin-simple-crypto-stein
+    parent: barbican-tempest-plugin-simple-crypto
+    override-checkout: stable/stein
+
+- job:
+    name: barbican-tempest-plugin-simple-crypto-ipv6-only
+    parent: devstack-tempest-ipv6
+    required-projects: *barbican-tempest-reqs
+    vars: *barbican-tempest-vars
+
+- job:
+    name: barbican-tempest-plugin-simple-crypto-castellan-src
+    parent: barbican-tempest-plugin-simple-crypto
+    required-projects:
+      - opendev.org/openstack/castellan
+
+- job:
+    name: barbican-tempest-plugin-simple-crypto-cursive
+    parent: barbican-tempest-plugin-simple-crypto
+    required-projects:
+      - opendev.org/x/cursive
diff --git a/barbican_tempest_plugin/tests/scenario/barbican_manager.py b/barbican_tempest_plugin/tests/scenario/barbican_manager.py
index f6b87fe..69cd2b9 100644
--- a/barbican_tempest_plugin/tests/scenario/barbican_manager.py
+++ b/barbican_tempest_plugin/tests/scenario/barbican_manager.py
@@ -98,12 +98,10 @@
         )
 
         if CONF.compute_feature_enabled.attach_encrypted_volume:
-            if (CONF.volume_feature_enabled.api_v2 or
-               CONF.volume_feature_enabled.api_v3):
-                cls.admin_volume_types_client =\
-                    os_adm.volume_types_v2_client
-                cls.admin_encryption_types_client =\
-                    os_adm.encryption_types_v2_client
+            cls.admin_volume_types_client =\
+                os_adm.volume_types_v2_client
+            cls.admin_encryption_types_client =\
+                os_adm.encryption_types_v2_client
 
     def _get_uuid(self, href):
         return href.split('/')[-1]
diff --git a/barbican_tempest_plugin/tests/scenario/manager.py b/barbican_tempest_plugin/tests/scenario/manager.py
index 8be324a..f91e27b 100644
--- a/barbican_tempest_plugin/tests/scenario/manager.py
+++ b/barbican_tempest_plugin/tests/scenario/manager.py
@@ -75,10 +75,8 @@
         cls.security_group_rules_client = (
             cls.os_primary.security_group_rules_client)
 
-        if (CONF.volume_feature_enabled.api_v2 or
-           CONF.volume_feature_enabled.api_v3):
-            cls.volumes_client = cls.os_primary.volumes_client_latest
-            cls.snapshots_client = cls.os_primary.snapshots_client_latest
+        cls.volumes_client = cls.os_primary.volumes_client_latest
+        cls.snapshots_client = cls.os_primary.snapshots_client_latest
 
     # ## Test functions library
     #
diff --git a/setup.cfg b/setup.cfg
index 15565c1..ec9e3ce 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -6,6 +6,7 @@
 author = OpenStack
 author-email = openstack-dev@lists.openstack.org
 home-page = http://www.openstack.org/
+requires-python = >=3.6
 classifier =
     Environment :: OpenStack
     Intended Audience :: Information Technology
@@ -13,11 +14,9 @@
     License :: OSI Approved :: Apache Software License
     Operating System :: POSIX :: Linux
     Programming Language :: Python
-    Programming Language :: Python :: 2
-    Programming Language :: Python :: 2.7
     Programming Language :: Python :: 3
-    Programming Language :: Python :: 3.3
-    Programming Language :: Python :: 3.5
+    Programming Language :: Python :: 3.6
+    Programming Language :: Python :: 3.7
 
 [files]
 packages =
diff --git a/test-requirements.txt b/test-requirements.txt
index cbd9858..b99db27 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -3,10 +3,14 @@
 # process, which may cause wedges in the gate later.
 
 hacking<0.13,>=0.12.0 # Apache-2.0
+# remove this pyflakes from here once you bump the
+# hacking to 3.2.0 or above. hacking 3.2.0 takes
+# care of pyflakes version compatibilty.
+pyflakes>=2.1.1
 
 python-subunit>=1.0.0 # Apache-2.0/BSD
 oslotest>=3.2.0 # Apache-2.0
-testrepository>=0.0.18 # Apache-2.0/BSD
+stestr>=2.0.0 # Apache-2.0
 testscenarios>=0.4 # Apache-2.0/BSD
 testtools>=2.2.0 # MIT
 
diff --git a/tox.ini b/tox.ini
index faa94df..efc6c97 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,16 +1,18 @@
 [tox]
-minversion = 2.0
-envlist = py35,py27,pypy,pep8
+minversion = 3.1.1
+envlist = py37,pypy,pep8
 skipsdist = True
+ignore_basepython_conflict = True
 
 [testenv]
+basepython = python3
 usedevelop = True
 install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages}
 setenv =
    VIRTUAL_ENV={envdir}
    PYTHONWARNINGS=default::DeprecationWarning
 deps = -r{toxinidir}/test-requirements.txt
-commands = python setup.py testr --slowest --testr-args='{posargs}'
+commands = stestr run --slowest {posargs}
 
 [testenv:pep8]
 commands =