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
$_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

View File

@@ -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

View File

@@ -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 {

View File

@@ -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

View File

@@ -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

View File

@@ -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

12
tox.ini
View File

@@ -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 =

View File

@@ -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

View File

@@ -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'"

View File

@@ -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