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-24 14:17:00 +0200
commit4ca522bdb4918bf97c0e2ad9b1c8c281c0133ffd (patch)
treef818bb7ea127171a4a9e37d626e5403405080b62
parentc65906e74c02805308ff99c99bc207ac424437e6 (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> (cherry picked from commit 00b78ca96bef67166e0118a0dbdb5152f401a608)
-rw-r--r--build.sh29
-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, 33 insertions, 19 deletions
diff --git a/build.sh b/build.sh
index b4c387c00..0302ad3c3 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:fraser|${repo}/functest-core:amd64-fraser|g" {} +
+find . -name Dockerfile -exec sed -i \
+ -e "s|opnfv/functest-core:fraser|${repo}/functest-core:amd64-fraser|g" {} +
for dir in ${amd64_dirs}; do
- (cd "${dir}" && docker build "${build_opts[@]}" -t "${repo}/functest-${dir##**/}:amd64-fraser" .)
+ (cd "${dir}" &&
+ docker build "${build_opts[@]}" \
+ -t "${repo}/functest-${dir##**/}:amd64-fraser" .)
docker push "${repo}/functest-${dir##**/}:amd64-fraser"
- [ "${dir}" != "docker/core" ] && (docker rmi "${repo}/functest-${dir##**/}:amd64-fraser" || true)
+ [ "${dir}" != "docker/core" ] &&
+ (docker rmi "${repo}/functest-${dir##**/}:amd64-fraser" || true)
done
-[ ! -z "${amd64_dirs}" ] && (docker rmi "${repo}/functest-core:amd64-fraser" alpine:3.7 || true)
+[ ! -z "${amd64_dirs}" ] &&
+ (docker rmi "${repo}/functest-core:amd64-fraser" 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:fraser|${repo}/functest-core:arm64-fraser|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:fraser|${repo}/functest-core:arm64-fraser|g" {} +
for dir in ${arm64_dirs}; do
- (cd "${dir}" && docker build "${build_opts[@]}" -t "${repo}/functest-${dir##**/}:arm64-fraser" .)
+ (cd "${dir}" && docker build "${build_opts[@]}" \
+ -t "${repo}/functest-${dir##**/}:arm64-fraser" .)
docker push "${repo}/functest-${dir##**/}:arm64-fraser"
- [ "${dir}" != "docker/core" ] && (docker rmi "${repo}/functest-${dir##**/}:arm64-fraser" || true)
+ [ "${dir}" != "docker/core" ] &&
+ (docker rmi "${repo}/functest-${dir##**/}:arm64-fraser" || true)
done
-[ ! -z "${arm64_dirs}" ] && (docker rmi "${repo}/functest-core:arm64-fraser" multiarch/alpine:arm64-v3.7 || true)
+[ ! -z "${arm64_dirs}" ] &&
+ (docker rmi "${repo}/functest-core:arm64-fraser" \
+ 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 82d1222c7..729ea47d6 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -11,3 +11,4 @@ sphinx-opnfv-theme
sphinx-rtd-theme
yamllint
doc8 # Apache-2.0
+bashate>=0.5.1 # Apache-2.0
diff --git a/tox.ini b/tox.ini
index aa3087ae2..8c04eb3b8 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 =