tox: enable bashate

Change-Id: I441ff386515a6f3616ee8b0f09bf073126ffa79d
This commit is contained in:
Isaku Yamahata
2017-06-07 18:16:48 -07:00
committed by Isaku Yamahata
parent 4084376091
commit 5c12b9da0f
10 changed files with 34 additions and 23 deletions

View File

@@ -39,8 +39,7 @@ source $NETWORKING_ODL_DIR/devstack/entry_points
# Restore xtrace # Restore xtrace
$_XTRACE_NETWORKING_ODL $_XTRACE_NETWORKING_ODL
if [[ "$ODL_USING_EXISTING_JAVA" == "True" ]] if [[ "$ODL_USING_EXISTING_JAVA" == "True" ]]; then
then
echo 'Using installed java.' echo 'Using installed java.'
java -version || exit 1 java -version || exit 1
fi fi

View File

@@ -26,8 +26,7 @@ function _odl_show_info {
sudo ip route sudo ip route
sudo ovsdb-client dump sudo ovsdb-client dump
sudo ovs-vsctl show sudo ovs-vsctl show
for br in $(sudo ovs-vsctl list-br) for br in $(sudo ovs-vsctl list-br); do
do
echo "--- flows on $br ---" echo "--- flows on $br ---"
sudo ovs-ofctl --protocols OpenFlow13 dump-ports $br sudo ovs-ofctl --protocols OpenFlow13 dump-ports $br
sudo ovs-ofctl --protocols OpenFlow13 dump-ports-desc $br sudo ovs-ofctl --protocols OpenFlow13 dump-ports-desc $br

View File

@@ -27,7 +27,7 @@ function setup_java {
return 0 return 0
} }
function setup_java_env() { function setup_java_env {
local JAVA_COMMAND="${1:-${JAVA:-java}}" local JAVA_COMMAND="${1:-${JAVA:-java}}"
JAVA_LINK="$(which $JAVA_COMMAND)" JAVA_LINK="$(which $JAVA_COMMAND)"
@@ -131,7 +131,7 @@ else
# --- Red Hat ------------------------------------------------------------- # --- Red Hat -------------------------------------------------------------
function list_java_commands { 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 { function install_openjdk {

View File

@@ -16,6 +16,7 @@ testresources>=0.2.4 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD
WebTest>=2.0 # MIT WebTest>=2.0 # MIT
testtools>=1.4.0 # MIT testtools>=1.4.0 # MIT
bashate>=0.2 # Apache-2.0
# releasenotes # releasenotes
reno!=2.3.1,>=1.8.0 # Apache-2.0 reno!=2.3.1,>=1.8.0 # Apache-2.0

View File

@@ -26,9 +26,9 @@ if [[ "$IS_GATE" != "True" ]] && [[ "$#" -lt 1 ]]; then
>&2 echo "Usage: $0 /path/to/devstack [-i] >&2 echo "Usage: $0 /path/to/devstack [-i]
Configure a host to run Networking ODL's functional test suite. Configure a host to run Networking ODL's functional test suite.
-i Install Networking ODL's package dependencies. By default, it is assumed -i Install Networking ODL's package dependencies. By default, it is assumed
that devstack has already been used to deploy Networking ODL to the that devstack has already been used to deploy Networking ODL to the
target host and that package dependencies need not be installed. target host and that package dependencies need not be installed.
Warning: This script relies on devstack to perform extensive Warning: This script relies on devstack to perform extensive
modification to the underlying host. It is recommended that it be 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 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." >&2 echo "Unable to find devstack at '$DEVSTACK_PATH'. Please verify that the specified path points to a valid devstack repo."
exit 1 exit 1
fi fi

View File

@@ -2,7 +2,7 @@
# preserve old behavior of using an arg as a regex when '--' is not present # preserve old behavior of using an arg as a regex when '--' is not present
case $@ in case $@ in
(*--*) ostestr $@;; (*--*) ostestr $@;;
('') ostestr;; ('') ostestr;;
(*) ostestr --regex "$@" (*) ostestr --regex "$@"
esac esac

12
tox.ini
View File

@@ -59,6 +59,7 @@ commands =
doc8 doc/source devstack releasenotes/source rally-jobs doc8 doc/source devstack releasenotes/source rally-jobs
neutron-db-manage --subproject networking-odl check_migration neutron-db-manage --subproject networking-odl check_migration
{[testenv:genconfig]commands} {[testenv:genconfig]commands}
{[testenv:bashate]commands}
whitelist_externals = mkdir whitelist_externals = mkdir
[testenv:i18n] [testenv:i18n]
@@ -97,6 +98,17 @@ show-source = True
ignore = N530 ignore = N530
exclude=./.*,dist,doc,releasenotes,*lib/python*,*egg,build,tools 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] [testenv:genconfig]
deps = -r{toxinidir}/requirements.txt deps = -r{toxinidir}/requirements.txt
commands = commands =

View File

@@ -105,8 +105,8 @@ cd workspace/
export WORKSPACE=`pwd` export WORKSPACE=`pwd`
if [[ ! -e /usr/zuul-env ]]; then if [[ ! -e /usr/zuul-env ]]; then
virtualenv /usr/zuul-env virtualenv /usr/zuul-env
/usr/zuul-env/bin/pip install zuul /usr/zuul-env/bin/pip install zuul
fi fi
cat > clonemap.yaml << IEOF cat > clonemap.yaml << IEOF

View File

@@ -18,10 +18,10 @@ cd devstack
cp /vagrant/compute.conf local.conf cp /vagrant/compute.conf local.conf
shost=`grep -ri 'SERVICE_HOST=' local.conf | cut -f2 -d'='` shost=`grep -ri 'SERVICE_HOST=' local.conf | cut -f2 -d'='`
sed -i -e "1i[[local|localrc]]" \ sed -i -e "1i[[local|localrc]]" \
-e "s/ERROR_ON_CLONE=.*/ERROR_ON_CLONE=False/" \ -e "s/ERROR_ON_CLONE=.*/ERROR_ON_CLONE=False/" \
-e "s/$shost/192.168.0.10/" \ -e "s/$shost/192.168.0.10/" \
-e "s/HOST_IP=.*/HOST_IP=192.168.0.20/" \ -e "s/HOST_IP=.*/HOST_IP=192.168.0.20/" \
local.conf local.conf
./stack.sh ./stack.sh
echo "vagrant ssh control -c 'cd tempest; tempest run'" echo "vagrant ssh control -c 'cd tempest; tempest run'"

View File

@@ -17,9 +17,9 @@ cd devstack
cp /vagrant/control.conf local.conf cp /vagrant/control.conf local.conf
shost=`grep -ri 'SERVICE_HOST=' local.conf | cut -f2 -d'='` shost=`grep -ri 'SERVICE_HOST=' local.conf | cut -f2 -d'='`
sed -i -e "1i[[local|localrc]]" \ sed -i -e "1i[[local|localrc]]" \
-e "s/ERROR_ON_CLONE=.*/ERROR_ON_CLONE=False/" \ -e "s/ERROR_ON_CLONE=.*/ERROR_ON_CLONE=False/" \
-e "s/$shost/192.168.0.10/" \ -e "s/$shost/192.168.0.10/" \
local.conf local.conf
./stack.sh ./stack.sh
tempest init ~/tempest tempest init ~/tempest