Merge "Fix remaining api-ref references"
diff --git a/.zuul.yaml b/.zuul.yaml
index 90a8fb8..4ca14ad 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -16,16 +16,6 @@
       devstack_services:
         tempest: true
       devstack_local_conf:
-        post-config:
-          # TODO(slaweq): remove this hardcoded options when
-          # https://bugs.launchpad.net/devstack/+bug/1837980
-          # will be fixed and Devstack will support configuration
-          # of cache in Nova
-          $NOVA_CONF:
-            cache:
-              memcache_servers: "localhost:11211"
-              backend: "dogpile.cache.memcached"
-              enabled: "True"
         test-config:
           $TEMPEST_CONFIG:
             compute:
@@ -449,12 +439,6 @@
     override-checkout: stable/queens
 
 - job:
-    name: tempest-full-pike
-    parent: tempest-full
-    nodeset: openstack-single-node-xenial
-    override-checkout: stable/pike
-
-- job:
     name: tempest-tox-plugin-sanity-check
     parent: tox
     description: |
@@ -725,8 +709,6 @@
             irrelevant-files: *tempest-irrelevant-files
         - tempest-full-queens-py3:
             irrelevant-files: *tempest-irrelevant-files
-        - tempest-full-pike:
-            irrelevant-files: *tempest-irrelevant-files
         - tempest-multinode-full:
             irrelevant-files: *tempest-irrelevant-files
         - tempest-multinode-full-py3:
@@ -783,6 +765,7 @@
         - tempest-full-test-account-no-admin-py3:
             voting: false
             irrelevant-files: *tempest-irrelevant-files
+        - openstack-tox-bashate
     gate:
       jobs:
         - tempest-slow-py3:
@@ -825,7 +808,6 @@
         - tempest-full-rocky-py3
         - tempest-full-queens
         - tempest-full-queens-py3
-        - tempest-full-pike
     periodic:
       jobs:
         - tempest-all
diff --git a/releasenotes/notes/12/12.1.0-add_subunit_describe_calls-5498a37e6cd66c4b.yaml b/releasenotes/notes/12/12.1.0-add_subunit_describe_calls-5498a37e6cd66c4b.yaml
index 092014e..8787e0c 100644
--- a/releasenotes/notes/12/12.1.0-add_subunit_describe_calls-5498a37e6cd66c4b.yaml
+++ b/releasenotes/notes/12/12.1.0-add_subunit_describe_calls-5498a37e6cd66c4b.yaml
@@ -4,5 +4,5 @@
     Adds subunit-describe-calls. A parser for subunit streams to determine what
     REST API calls are made inside of a test and in what order they are called.
 
-      * Input can be piped in or a file can be specified
-      * Output is shortened for stdout, the output file has more information
+    * Input can be piped in or a file can be specified
+    * Output is shortened for stdout, the output file has more information
diff --git a/releasenotes/notes/12/12.1.0-identity-clients-as-library-e663c6132fcac6c2.yaml b/releasenotes/notes/12/12.1.0-identity-clients-as-library-e663c6132fcac6c2.yaml
index f9173a0..b857db8 100644
--- a/releasenotes/notes/12/12.1.0-identity-clients-as-library-e663c6132fcac6c2.yaml
+++ b/releasenotes/notes/12/12.1.0-identity-clients-as-library-e663c6132fcac6c2.yaml
@@ -6,8 +6,8 @@
     so the other projects can use these modules as stable libraries without
     any maintenance changes.
 
-      * endpoints_client(v2)
-      * roles_client(v2)
-      * services_client(v2)
-      * tenants_client(v2)
-      * users_client(v2)
+    * endpoints_client(v2)
+    * roles_client(v2)
+    * services_client(v2)
+    * tenants_client(v2)
+    * users_client(v2)
diff --git a/releasenotes/notes/12/12.1.0-image-clients-as-library-86d17caa26ce3961.yaml b/releasenotes/notes/12/12.1.0-image-clients-as-library-86d17caa26ce3961.yaml
index 1fa4ddd..492aac8 100644
--- a/releasenotes/notes/12/12.1.0-image-clients-as-library-86d17caa26ce3961.yaml
+++ b/releasenotes/notes/12/12.1.0-image-clients-as-library-86d17caa26ce3961.yaml
@@ -6,10 +6,10 @@
     so the other projects can use these modules as stable libraries
     without any maintenance changes.
 
-      * image_members_client(v1)
-      * images_client(v1)
-      * image_members_client(v2)
-      * images_client(v2)
-      * namespaces_client(v2)
-      * resource_types_client(v2)
-      * schemas_client(v2)
+    * image_members_client(v1)
+    * images_client(v1)
+    * image_members_client(v2)
+    * images_client(v2)
+    * namespaces_client(v2)
+    * resource_types_client(v2)
+    * schemas_client(v2)
diff --git a/releasenotes/notes/12/12.2.0-add-new-identity-clients-3c3afd674a395bde.yaml b/releasenotes/notes/12/12.2.0-add-new-identity-clients-3c3afd674a395bde.yaml
index 3ec8b56..6e08743 100644
--- a/releasenotes/notes/12/12.2.0-add-new-identity-clients-3c3afd674a395bde.yaml
+++ b/releasenotes/notes/12/12.2.0-add-new-identity-clients-3c3afd674a395bde.yaml
@@ -6,8 +6,8 @@
     so the other projects can use these modules as stable libraries without
     any maintenance changes.
 
-     * endpoints_client(v3)
-     * policies_client (v3)
-     * regions_client(v3)
-     * services_client(v3)
-     * projects_client(v3)
+    * endpoints_client(v3)
+    * policies_client (v3)
+    * regions_client(v3)
+    * services_client(v3)
+    * projects_client(v3)
diff --git a/releasenotes/notes/12/12.2.0-volume-clients-as-library-9a3444dd63c134b3.yaml b/releasenotes/notes/12/12.2.0-volume-clients-as-library-9a3444dd63c134b3.yaml
index cf504ad..32cd182 100644
--- a/releasenotes/notes/12/12.2.0-volume-clients-as-library-9a3444dd63c134b3.yaml
+++ b/releasenotes/notes/12/12.2.0-volume-clients-as-library-9a3444dd63c134b3.yaml
@@ -6,13 +6,13 @@
     so the other projects can use these modules as stable libraries
     without any maintenance changes.
 
-      * availability_zone_client(v1)
-      * availability_zone_client(v2)
-      * extensions_client(v1)
-      * extensions_client(v2)
-      * hosts_client(v1)
-      * hosts_client(v2)
-      * quotas_client(v1)
-      * quotas_client(v2)
-      * services_client(v1)
-      * services_client(v2)
+    * availability_zone_client(v1)
+    * availability_zone_client(v2)
+    * extensions_client(v1)
+    * extensions_client(v2)
+    * hosts_client(v1)
+    * hosts_client(v2)
+    * quotas_client(v1)
+    * quotas_client(v2)
+    * services_client(v1)
+    * services_client(v2)
diff --git a/releasenotes/notes/13/13.0.0-add-new-identity-clients-as-library-5f7ndha733nwdsn9.yaml b/releasenotes/notes/13/13.0.0-add-new-identity-clients-as-library-5f7ndha733nwdsn9.yaml
index 9e828f6..a0de2c3 100644
--- a/releasenotes/notes/13/13.0.0-add-new-identity-clients-as-library-5f7ndha733nwdsn9.yaml
+++ b/releasenotes/notes/13/13.0.0-add-new-identity-clients-as-library-5f7ndha733nwdsn9.yaml
@@ -5,11 +5,11 @@
     Add new service clients to the library interface so the other projects can use these modules as stable libraries without
     any maintenance changes.
 
-      * identity_client(v2)
-      * groups_client(v3)
-      * trusts_client(v3)
-      * users_client(v3)
-      * identity_client(v3)
-      * roles_client(v3)
-      * inherited_roles_client(v3)
-      * credentials_client(v3)
+    * identity_client(v2)
+    * groups_client(v3)
+    * trusts_client(v3)
+    * users_client(v3)
+    * identity_client(v3)
+    * roles_client(v3)
+    * inherited_roles_client(v3)
+    * credentials_client(v3)
diff --git a/releasenotes/notes/14/14.0.0-add-image-clients-af94564fb34ddca6.yaml b/releasenotes/notes/14/14.0.0-add-image-clients-af94564fb34ddca6.yaml
index 7e40fd4..6346156 100644
--- a/releasenotes/notes/14/14.0.0-add-image-clients-af94564fb34ddca6.yaml
+++ b/releasenotes/notes/14/14.0.0-add-image-clients-af94564fb34ddca6.yaml
@@ -5,5 +5,5 @@
     http://developer.openstack.org/api-ref/image/v2/metadefs-index.html,
     there are some apis are not included, add them.
 
-      * namespace_properties_client(v2)
+    * namespace_properties_client(v2)
 
diff --git a/releasenotes/notes/15/15.0.0-add-image-clients-tests-49dbc0a0a4281a77.yaml b/releasenotes/notes/15/15.0.0-add-image-clients-tests-49dbc0a0a4281a77.yaml
index eaab1f0..a4e5791 100644
--- a/releasenotes/notes/15/15.0.0-add-image-clients-tests-49dbc0a0a4281a77.yaml
+++ b/releasenotes/notes/15/15.0.0-add-image-clients-tests-49dbc0a0a4281a77.yaml
@@ -5,6 +5,6 @@
     http://developer.openstack.org/api-ref/image/v2/metadefs-index.html,
     there are some apis are not included, add them.
 
-      * namespace_objects_client(v2)
-      * namespace_tags_client(v2)
+    * namespace_objects_client(v2)
+    * namespace_tags_client(v2)
 
diff --git a/releasenotes/notes/add-domain-param-in-cliclient-a270fcf35c8f09e6.yaml b/releasenotes/notes/add-domain-param-in-cliclient-a270fcf35c8f09e6.yaml
index 87a6af9..85e5f5f 100644
--- a/releasenotes/notes/add-domain-param-in-cliclient-a270fcf35c8f09e6.yaml
+++ b/releasenotes/notes/add-domain-param-in-cliclient-a270fcf35c8f09e6.yaml
@@ -3,10 +3,10 @@
   - |
     Allow to specify new domain parameters:
 
-    * `user_domain_name`
-    * `user_domain_id`
-    * `project_domain_name`
-    * `project_domain_id`
+    * ``user_domain_name``
+    * ``user_domain_id``
+    * ``project_domain_name``
+    * ``project_domain_id``
 
     for CLIClient class, whose values will be substituted to
     ``--os-user-domain-name``, ``--os-user-domain-id``,
diff --git a/releasenotes/notes/intermediate-train-release-0146c624cff9a57f.yaml b/releasenotes/notes/intermediate-train-release-0146c624cff9a57f.yaml
index 6977e12..7940846 100644
--- a/releasenotes/notes/intermediate-train-release-0146c624cff9a57f.yaml
+++ b/releasenotes/notes/intermediate-train-release-0146c624cff9a57f.yaml
@@ -1,12 +1,12 @@
 ---
-prelude: >
+prelude: |
     This is an intermediate release during the Train development cycle to
     mark the end of support for Pike in Tempest.
     After this release, Tempest will support below OpenStack Releases:
 
-      * Stein
-      * Rocky
-      * Queens
+    * Stein
+    * Rocky
+    * Queens
 
     Current development of Tempest is for OpenStack Train development
     cycle.
diff --git a/releasenotes/notes/make-object-storage-client-as-stable-interface-d1b07c7e8f17bef6.yaml b/releasenotes/notes/make-object-storage-client-as-stable-interface-d1b07c7e8f17bef6.yaml
index 2bba952..37eeec5 100644
--- a/releasenotes/notes/make-object-storage-client-as-stable-interface-d1b07c7e8f17bef6.yaml
+++ b/releasenotes/notes/make-object-storage-client-as-stable-interface-d1b07c7e8f17bef6.yaml
@@ -6,6 +6,6 @@
     other projects can use these modules as stable libraries
     without any maintenance changes.
 
-      * account_client
-      * container_client
-      * object_client
+    * account_client
+    * container_client
+    * object_client
diff --git a/releasenotes/notes/migrate-object-storage-as-stable-interface-42014c7b43ecb254.yaml b/releasenotes/notes/migrate-object-storage-as-stable-interface-42014c7b43ecb254.yaml
index 72b8e26..00829b9 100644
--- a/releasenotes/notes/migrate-object-storage-as-stable-interface-42014c7b43ecb254.yaml
+++ b/releasenotes/notes/migrate-object-storage-as-stable-interface-42014c7b43ecb254.yaml
@@ -6,5 +6,5 @@
     other projects can use these modules as stable libraries
     without any maintenance changes.
 
-      * bulk_middleware_client
-      * capabilities_client
+    * bulk_middleware_client
+    * capabilities_client
diff --git a/releasenotes/notes/tempest-rocky-release-0fc3312053923380.yaml b/releasenotes/notes/tempest-rocky-release-0fc3312053923380.yaml
index e9c77a6..8406be6 100644
--- a/releasenotes/notes/tempest-rocky-release-0fc3312053923380.yaml
+++ b/releasenotes/notes/tempest-rocky-release-0fc3312053923380.yaml
@@ -1,12 +1,12 @@
 ---
-prelude: >
+prelude: |
     This release is to tag the Tempest for OpenStack Rocky release.
     After this release, Tempest will support below OpenStack Releases:
 
-      * Rocky
-      * Queens
-      * Pike
-      * Ocata
+    * Rocky
+    * Queens
+    * Pike
+    * Ocata
 
     Current development of Tempest is for OpenStack Stein development
     cycle. Every Tempest commit is also tested against master during
diff --git a/releasenotes/notes/tempest-stein-release-18bad34136a2e6ef.yaml b/releasenotes/notes/tempest-stein-release-18bad34136a2e6ef.yaml
index 212cf7d..c3537fc 100644
--- a/releasenotes/notes/tempest-stein-release-18bad34136a2e6ef.yaml
+++ b/releasenotes/notes/tempest-stein-release-18bad34136a2e6ef.yaml
@@ -1,14 +1,14 @@
 ---
-prelude: >
+prelude: |
     This release is to tag the Tempest for OpenStack Stein release.
     This release marks the start of Stein release support in Tempest and
     the end of support for Ocata in Tempest.
     After this release, Tempest will support below OpenStack Releases:
 
-      * Stein
-      * Rocky
-      * Queens
-      * Pike
+    * Stein
+    * Rocky
+    * Queens
+    * Pike
 
     Current development of Tempest is for OpenStack Train development
     cycle. Every Tempest commit is also tested against master during
diff --git a/tempest/scenario/test_stamp_pattern.py b/tempest/scenario/test_stamp_pattern.py
index 2782119..af79ea0 100644
--- a/tempest/scenario/test_stamp_pattern.py
+++ b/tempest/scenario/test_stamp_pattern.py
@@ -70,7 +70,6 @@
             raise lib_exc.TimeoutException
 
     @decorators.attr(type='slow')
-    @decorators.skip_because(bug="1664793")
     @decorators.idempotent_id('10fd234a-515c-41e5-b092-8323060598c5')
     @testtools.skipUnless(CONF.compute_feature_enabled.snapshot,
                           'Snapshotting is not available.')
@@ -91,6 +90,11 @@
         # create and add floating IP to server1
         ip_for_server = self.get_server_ip(server)
 
+        # Make sure the machine ssh-able before attaching the volume
+        self.get_remote_client(ip_for_server,
+                               private_key=keypair['private_key'],
+                               server=server)
+
         self.nova_volume_attach(server, volume)
         self._wait_for_volume_available_on_the_system(ip_for_server,
                                                       keypair['private_key'])
@@ -119,6 +123,13 @@
         # create and add floating IP to server_from_snapshot
         ip_for_snapshot = self.get_server_ip(server_from_snapshot)
 
+        # Make sure the machine ssh-able before attaching the volume
+        # Just a live machine is responding
+        # for device attache/detach as expected
+        self.get_remote_client(ip_for_snapshot,
+                               private_key=keypair['private_key'],
+                               server=server_from_snapshot)
+
         # attach volume2 to instance2
         self.nova_volume_attach(server_from_snapshot, volume_from_snapshot)
         self._wait_for_volume_available_on_the_system(ip_for_snapshot,
diff --git a/tools/format.sh b/tools/format.sh
index dec8f1c..ef5cc92 100755
--- a/tools/format.sh
+++ b/tools/format.sh
@@ -15,7 +15,8 @@
 
 # isort is not compatible with the default flake8 (H306), maybe flake8-isort
 # isort -rc -sl -fss ../tempest ../setup.py
-$AUTOPEP8 --exit-code --max-line-length=79 --experimental --in-place -r ../tempest ../setup.py
+$AUTOPEP8 --exit-code --max-line-length=79 --experimental --in-place \
+          -r ../tempest ../setup.py
 ERROR=$?
 
 if [[ $ERROR -eq 0 ]]; then
diff --git a/tools/generate-tempest-plugins-list.sh b/tools/generate-tempest-plugins-list.sh
index 6e473b7..b6a7c77 100755
--- a/tools/generate-tempest-plugins-list.sh
+++ b/tools/generate-tempest-plugins-list.sh
@@ -61,7 +61,7 @@
     printf " ===\n"
 }
 
-function print_plugin_table() {
+function print_plugin_table {
     title_underline ${name_col_len}
     printf "%-3s %-${name_col_len}s %s\n" "SR" "Plugin Name" "URL"
     title_underline ${name_col_len}
diff --git a/tools/tempest-plugin-sanity.sh b/tools/tempest-plugin-sanity.sh
index b652369..a087a4c 100644
--- a/tools/tempest-plugin-sanity.sh
+++ b/tools/tempest-plugin-sanity.sh
@@ -47,7 +47,7 @@
 BLACKLIST="$(python tools/generate-tempest-plugins-list.py blacklist)"
 
 # Function to clone project using zuul-cloner or from git
-function clone_project() {
+function clone_project {
     if [ -e /usr/zuul-env/bin/zuul-cloner ]; then
         /usr/zuul-env/bin/zuul-cloner --cache-dir /opt/git \
         https://opendev.org \
@@ -61,7 +61,7 @@
 }
 
 # function to create virtualenv to perform sanity operation
-function prepare_workspace() {
+function prepare_workspace {
     SANITY_DIR=$(pwd)
     virtualenv -p python3 --clear "$SANITY_DIR"/.venv
     export TVENV="$SANITY_DIR/tools/with_venv.sh"
@@ -72,7 +72,7 @@
 }
 
 # Function to install project
-function install_project() {
+function install_project {
     "$TVENV" pip install "$SANITY_DIR"/"$1"
     # Check for test-requirements.txt file in a project then install it.
     if [ -e "$SANITY_DIR"/"$1"/test-requirements.txt ]; then
@@ -81,7 +81,7 @@
 }
 
 # Function to perform sanity checking on Tempest plugin
-function tempest_sanity() {
+function tempest_sanity {
     "$TVENV" tempest init "$SANITY_DIR"/tempest_sanity && \
     cd "$SANITY_DIR"/tempest_sanity && \
     "$TVENV" tempest list-plugins && \
@@ -100,7 +100,7 @@
 }
 
 # Function to run sanity check on each project
-function plugin_sanity_check() {
+function plugin_sanity_check {
     prepare_workspace && \
     clone_project "$1" && \
     install_project "$1" && \
diff --git a/tox.ini b/tox.ini
index 53d7355..b6ea143 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
 [tox]
-envlist = pep8,py36,py37,py27,pip-check-reqs
+envlist = pep8,py36,py37,py27,bashate,pip-check-reqs
 minversion = 2.3.1
 skipsdist = True
 
@@ -315,6 +315,20 @@
          -b html releasenotes/source releasenotes/build/html
 whitelist_externals = rm
 
+[testenv:bashate]
+basepython = python3
+# if you want to test out some changes you have made to bashate
+# against tempest, just set BASHATE_INSTALL_PATH=/path/... to your
+# modified bashate tree
+deps =
+   {env:BASHATE_INSTALL_PATH:bashate}
+whitelist_externals = bash
+commands = bash -c "find {toxinidir}/tools    \
+         -not \( -type d -name .?\* -prune \) \
+         -type f                              \
+         -name \*.sh                          \
+         -print0 | xargs -0 bashate -v"
+
 [testenv:pip-check-reqs]
 # Do not install test-requirements as that will pollute the virtualenv for
 # determining missing packages.