summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-04-23 23:24:26 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2018-04-23 23:24:58 +0200
commit00b78ca96bef67166e0118a0dbdb5152f401a608 (patch)
treea87f914692455855e9d1706dc6f4afcc33d1eec6
parent8813a7d33fc632cdbeaa7cfd126976e6a57c68ea (diff)
Check shell scripts via bashate
It also removes functest/cli/functest-complete.sh. Change-Id: I5d9313be6a155b4adf1b82ce2b111ec06823cd8f Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
-rw-r--r--build.sh31
-rw-r--r--functest/ci/download_images.sh3
-rw-r--r--functest/cli/functest-complete.sh8
-rw-r--r--test-requirements.txt1
-rw-r--r--tox.ini11
5 files changed, 34 insertions, 20 deletions
diff --git a/build.sh b/build.sh
index 563d25248..9f0542b1a 100644
--- a/build.sh
+++ b/build.sh
@@ -14,23 +14,34 @@ docker/parser"}
arm64_dirs=${arm64_dirs-${amd64_dirs}}
build_opts=(--pull=true --no-cache --force-rm=true)
-find . -name Dockerfile -exec sed -i -e "s|opnfv/functest-core|${repo}/functest-core:amd64-latest|g" {} +
+find . -name Dockerfile -exec sed -i \
+ -e "s|opnfv/functest-core|${repo}/functest-core:amd64-latest|g" {} +
for dir in ${amd64_dirs}; do
- (cd "${dir}" && docker build "${build_opts[@]}" -t "${repo}/functest-${dir##**/}:amd64-latest" .)
- docker push "${repo}/functest-${dir##**/}:amd64-latest"
- [ "${dir}" != "docker/core" ] && (docker rmi "${repo}/functest-${dir##**/}:amd64-latest" || true)
+ (cd "${dir}" &&
+ docker build "${build_opts[@]}" \
+ -t "${repo}/functest-${dir##**/}:amd64-latest" .)
+ docker push "${repo}/functest-${dir##**/}:amd64-latest"
+ [ "${dir}" != "docker/core" ] &&
+ (docker rmi "${repo}/functest-${dir##**/}:amd64-latest" || true)
done
-[ ! -z "${amd64_dirs}" ] && (docker rmi "${repo}/functest-core:amd64-latest" alpine:3.7 || true)
+[ ! -z "${amd64_dirs}" ] &&
+ (docker rmi "${repo}/functest-core:amd64-latest" alpine:3.7 || true)
find . -name Dockerfile -exec git checkout {} +
-find . -name Dockerfile -exec sed -i -e "s|alpine:3.7|multiarch/alpine:arm64-v3.7|g" {} +
-find . -name Dockerfile -exec sed -i -e "s|opnfv/functest-core|${repo}/functest-core:arm64-latest|g" {} +
+find . -name Dockerfile -exec sed -i \
+ -e "s|alpine:3.7|multiarch/alpine:arm64-v3.7|g" {} +
+find . -name Dockerfile -exec sed -i \
+ -e "s|opnfv/functest-core|${repo}/functest-core:arm64-latest|g" {} +
for dir in ${arm64_dirs}; do
- (cd "${dir}" && docker build "${build_opts[@]}" -t "${repo}/functest-${dir##**/}:arm64-latest" .)
+ (cd "${dir}" && docker build "${build_opts[@]}" \
+ -t "${repo}/functest-${dir##**/}:arm64-latest" .)
docker push "${repo}/functest-${dir##**/}:arm64-latest"
- [ "${dir}" != "docker/core" ] && (docker rmi "${repo}/functest-${dir##**/}:arm64-latest" || true)
+ [ "${dir}" != "docker/core" ] &&
+ (docker rmi "${repo}/functest-${dir##**/}:arm64-latest" || true)
done
-[ ! -z "${arm64_dirs}" ] && (docker rmi "${repo}/functest-core:arm64-latest" multiarch/alpine:arm64-v3.7 || true)
+[ ! -z "${arm64_dirs}" ] &&
+ (docker rmi "${repo}/functest-core:arm64-latest" \
+ multiarch/alpine:arm64-v3.7 || true)
find . -name Dockerfile -exec git checkout {} +
exit $?
diff --git a/functest/ci/download_images.sh b/functest/ci/download_images.sh
index d0b302d94..c498b9bcc 100644
--- a/functest/ci/download_images.sh
+++ b/functest/ci/download_images.sh
@@ -19,4 +19,5 @@ http://cloud.centos.org/altarch/7/images/aarch64/CentOS-7-aarch64-GenericCloud.q
https://sourceforge.net/projects/ool-opnfv/files/vyos-1.1.7.img
EOF
-xz --decompress --force --keep ${1:-/home/opnfv/functest/images}/CentOS-7-aarch64-GenericCloud.qcow2.xz
+xz --decompress --force --keep \
+ ${1:-/home/opnfv/functest/images}/CentOS-7-aarch64-GenericCloud.qcow2.xz
diff --git a/functest/cli/functest-complete.sh b/functest/cli/functest-complete.sh
deleted file mode 100644
index f01490713..000000000
--- a/functest/cli/functest-complete.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-_functest_completion() {
- COMPREPLY=( $( env COMP_WORDS="${COMP_WORDS[*]}" \
- COMP_CWORD=$COMP_CWORD \
- _FUNCTEST_COMPLETE=complete $1 ) )
- return 0
-}
-
-complete -F _functest_completion -o default functest;
diff --git a/test-requirements.txt b/test-requirements.txt
index 84c5a4435..2f570745e 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -11,3 +11,4 @@ sphinx-opnfv-theme
sphinx-rtd-theme
yamllint
doc8>=0.6.0 # Apache-2.0
+bashate>=0.5.1 # Apache-2.0
diff --git a/tox.ini b/tox.ini
index 9fb5a416c..d77850634 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist = docs,pep8,pylint,yamllint,py35,py27,perm,cover
+envlist = docs,pep8,pylint,yamllint,bashate,py35,py27,perm,cover
[testenv]
usedevelop = True
@@ -103,6 +103,15 @@ dirs =
functest/tests/unit/utils
commands = nosetests {[testenv:py35]dirs}
+[testenv:bashate]
+basepython = python2.7
+files =
+ functest/opnfv_tests/openstack/rally/scenario/support/instance_dd_test.sh
+ functest/opnfv_tests/openstack/vping/ping.sh
+ functest/ci/download_images.sh
+ build.sh
+commands = bashate {[testenv:bashate]files}
+
[testenv:cover]
basepython = python2.7
dirs =