From ee10b894bf6703072e9654590a00abc3240e6fe7 Mon Sep 17 00:00:00 2001 From: Mark Burnett Date: Mon, 27 Aug 2018 13:26:23 -0500 Subject: [PATCH] Enable gate shell linting This enables linting the various supporting shell scripts for the gate during the unit test job. Change-Id: I95dc098a602b2ae6807165d3d08c1cb57ba0c702 --- tools/g2/lib/kube.sh | 12 ++++++------ .../playbooks/{unit-py35.yaml => make-tests.yaml} | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) rename tools/zuul/playbooks/{unit-py35.yaml => make-tests.yaml} (89%) diff --git a/tools/g2/lib/kube.sh b/tools/g2/lib/kube.sh index 578bfef2..568d386e 100644 --- a/tools/g2/lib/kube.sh +++ b/tools/g2/lib/kube.sh @@ -50,19 +50,19 @@ kubectl_wait_for_node_ready() { NODE_NAME=${2} SEC=${3:-300} - log Waiting $SEC seconds for $NODE_NAME to be ready. + log Waiting "${SEC}" seconds for "${NODE_NAME}" to be ready. NODE_READY_JSONPATH='{.status.conditions[?(@.type=="Ready")].status}' - end=$(($(date +%s) + $SEC)) + end=$(($(date +%s) + SEC)) while true; do - if (kubectl_cmd "${VIA}" --request-timeout 10s get nodes $NODE_NAME -o jsonpath="${NODE_READY_JSONPATH}" | grep True) ; then - log Node $NODE_NAME is ready. + if (kubectl_cmd "${VIA}" --request-timeout 10s get nodes "${NODE_NAME}" -o jsonpath="${NODE_READY_JSONPATH}" | grep True) ; then + log Node "${NODE_NAME}" is ready. break else now=$(date +%s) - if [ $now -gt $end ]; then - log Node $NODE_NAME was not ready before timeout. + if [ "${now}" -gt "${end}" ]; then + log Node "${NODE_NAME}" was not ready before timeout. fail fi echo -n . diff --git a/tools/zuul/playbooks/unit-py35.yaml b/tools/zuul/playbooks/make-tests.yaml similarity index 89% rename from tools/zuul/playbooks/unit-py35.yaml rename to tools/zuul/playbooks/make-tests.yaml index f0c531f3..4b74e4c6 100644 --- a/tools/zuul/playbooks/unit-py35.yaml +++ b/tools/zuul/playbooks/make-tests.yaml @@ -12,9 +12,9 @@ - hosts: primary tasks: - - name: Execute the make target for unit testing + - name: Execute the make target for basic testing make: chdir: "{{ zuul.project.src_dir }}" - target: tests-unit + target: tests register: result failed_when: result.failed