Introduce bashate

This commit introduces bashate[0] which is a code style checker for bash
scripts. We already have some bash scripts in Tempest repo. So, it might
be good to check the style automatically.

Some scripts under the tools directory are also fixed due to the bashate
violation.

Change-Id: I07820f10387552f93a9d8891b58a8c7fcdb83046
diff --git a/tox.ini b/tox.ini
index 8a7a509..21182d8 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
 
@@ -303,6 +303,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.