diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 078b0f4a7..52ef80814 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -39,8 +39,7 @@ source $NETWORKING_ODL_DIR/devstack/entry_points # Restore xtrace $_XTRACE_NETWORKING_ODL -if [[ "$ODL_USING_EXISTING_JAVA" == "True" ]] -then +if [[ "$ODL_USING_EXISTING_JAVA" == "True" ]]; then echo 'Using installed java.' java -version || exit 1 fi diff --git a/devstack/post_test_hook.sh b/devstack/post_test_hook.sh index 607cff767..83b92fcc5 100644 --- a/devstack/post_test_hook.sh +++ b/devstack/post_test_hook.sh @@ -26,8 +26,7 @@ function _odl_show_info { sudo ip route sudo ovsdb-client dump sudo ovs-vsctl show - for br in $(sudo ovs-vsctl list-br) - do + for br in $(sudo ovs-vsctl list-br); do echo "--- flows on $br ---" sudo ovs-ofctl --protocols OpenFlow13 dump-ports $br sudo ovs-ofctl --protocols OpenFlow13 dump-ports-desc $br diff --git a/devstack/setup_java.sh b/devstack/setup_java.sh index 43aae012c..9c5d28231 100644 --- a/devstack/setup_java.sh +++ b/devstack/setup_java.sh @@ -27,7 +27,7 @@ function setup_java { return 0 } -function setup_java_env() { +function setup_java_env { local JAVA_COMMAND="${1:-${JAVA:-java}}" JAVA_LINK="$(which $JAVA_COMMAND)" @@ -131,7 +131,7 @@ else # --- Red Hat ------------------------------------------------------------- function list_java_commands { - alternatives --display java 2>&1 | grep -v '^[[:space:]]' | awk '/[[:space:]]- priority[[:space:]]/{print $1}' + alternatives --display java 2>&1 | grep -v '^[[:space:]]' | awk '/[[:space:]]- priority[[:space:]]/{print $1}' } function install_openjdk { diff --git a/test-requirements.txt b/test-requirements.txt index 4481b1841..87d5dc044 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -16,6 +16,7 @@ testresources>=0.2.4 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD WebTest>=2.0 # MIT testtools>=1.4.0 # MIT +bashate>=0.2 # Apache-2.0 # releasenotes reno!=2.3.1,>=1.8.0 # Apache-2.0 diff --git a/tools/configure_for_func_testing.sh b/tools/configure_for_func_testing.sh index ff1e7012c..adcb3d348 100755 --- a/tools/configure_for_func_testing.sh +++ b/tools/configure_for_func_testing.sh @@ -26,9 +26,9 @@ if [[ "$IS_GATE" != "True" ]] && [[ "$#" -lt 1 ]]; then >&2 echo "Usage: $0 /path/to/devstack [-i] Configure a host to run Networking ODL's functional test suite. --i Install Networking ODL's package dependencies. By default, it is assumed - that devstack has already been used to deploy Networking ODL to the - target host and that package dependencies need not be installed. +-i Install Networking ODL's package dependencies. By default, it is assumed + that devstack has already been used to deploy Networking ODL to the + target host and that package dependencies need not be installed. Warning: This script relies on devstack to perform extensive modification to the underlying host. It is recommended that it be @@ -60,8 +60,8 @@ INSTALL_BASE_DEPENDENCIES=${INSTALL_BASE_DEPENDENCIES:-$IS_GATE} if [ ! -f "$DEVSTACK_PATH/stack.sh" ]; then - >&2 echo "Unable to find devstack at '$DEVSTACK_PATH'. Please verify that the specified path points to a valid devstack repo." - exit 1 + >&2 echo "Unable to find devstack at '$DEVSTACK_PATH'. Please verify that the specified path points to a valid devstack repo." + exit 1 fi diff --git a/tools/ostestr_compat_shim.sh b/tools/ostestr_compat_shim.sh index a483ed1a1..195cbd248 100755 --- a/tools/ostestr_compat_shim.sh +++ b/tools/ostestr_compat_shim.sh @@ -2,7 +2,7 @@ # preserve old behavior of using an arg as a regex when '--' is not present case $@ in - (*--*) ostestr $@;; - ('') ostestr;; - (*) ostestr --regex "$@" + (*--*) ostestr $@;; + ('') ostestr;; + (*) ostestr --regex "$@" esac diff --git a/tox.ini b/tox.ini index 79e6f719e..09b00ba0a 100644 --- a/tox.ini +++ b/tox.ini @@ -59,6 +59,7 @@ commands = doc8 doc/source devstack releasenotes/source rally-jobs neutron-db-manage --subproject networking-odl check_migration {[testenv:genconfig]commands} + {[testenv:bashate]commands} whitelist_externals = mkdir [testenv:i18n] @@ -97,6 +98,17 @@ show-source = True ignore = N530 exclude=./.*,dist,doc,releasenotes,*lib/python*,*egg,build,tools +[testenv:bashate] +commands = bash -c "find {toxinidir} \ + -not \( -type d -name .\* -prune \) \ + -type f \ + -name \*.sh \ +# E005 file does not begin with #! or have a .sh prefix +# E006 check for lines longer than 79 columns +# E042 local declaration hides errors +# E043 Arithmetic compound has inconsistent return semantics + -print0 | xargs -0 bashate -v -iE006 -eE005,E042,E043" + [testenv:genconfig] deps = -r{toxinidir}/requirements.txt commands = diff --git a/vagrant/functional/reproduce.sh b/vagrant/functional/reproduce.sh index 4885e88cc..1ce018c80 100755 --- a/vagrant/functional/reproduce.sh +++ b/vagrant/functional/reproduce.sh @@ -105,8 +105,8 @@ cd workspace/ export WORKSPACE=`pwd` if [[ ! -e /usr/zuul-env ]]; then - virtualenv /usr/zuul-env - /usr/zuul-env/bin/pip install zuul + virtualenv /usr/zuul-env + /usr/zuul-env/bin/pip install zuul fi cat > clonemap.yaml << IEOF diff --git a/vagrant/integration/multinode/setup_compute.sh b/vagrant/integration/multinode/setup_compute.sh index 94f939d1f..9ded9bdb3 100755 --- a/vagrant/integration/multinode/setup_compute.sh +++ b/vagrant/integration/multinode/setup_compute.sh @@ -18,10 +18,10 @@ cd devstack cp /vagrant/compute.conf local.conf shost=`grep -ri 'SERVICE_HOST=' local.conf | cut -f2 -d'='` sed -i -e "1i[[local|localrc]]" \ - -e "s/ERROR_ON_CLONE=.*/ERROR_ON_CLONE=False/" \ - -e "s/$shost/192.168.0.10/" \ - -e "s/HOST_IP=.*/HOST_IP=192.168.0.20/" \ - local.conf + -e "s/ERROR_ON_CLONE=.*/ERROR_ON_CLONE=False/" \ + -e "s/$shost/192.168.0.10/" \ + -e "s/HOST_IP=.*/HOST_IP=192.168.0.20/" \ + local.conf ./stack.sh echo "vagrant ssh control -c 'cd tempest; tempest run'" diff --git a/vagrant/integration/multinode/setup_control.sh b/vagrant/integration/multinode/setup_control.sh index fc3414f13..6aadb78f9 100755 --- a/vagrant/integration/multinode/setup_control.sh +++ b/vagrant/integration/multinode/setup_control.sh @@ -17,9 +17,9 @@ cd devstack cp /vagrant/control.conf local.conf shost=`grep -ri 'SERVICE_HOST=' local.conf | cut -f2 -d'='` sed -i -e "1i[[local|localrc]]" \ - -e "s/ERROR_ON_CLONE=.*/ERROR_ON_CLONE=False/" \ - -e "s/$shost/192.168.0.10/" \ - local.conf + -e "s/ERROR_ON_CLONE=.*/ERROR_ON_CLONE=False/" \ + -e "s/$shost/192.168.0.10/" \ + local.conf ./stack.sh tempest init ~/tempest