test: respect 'CI_DEBUG' set by functest 65/14765/1
authorRyota MIBU <r-mibu@cq.jp.nec.com>
Fri, 27 May 2016 06:54:28 +0000 (15:54 +0900)
committerRyota MIBU <r-mibu@cq.jp.nec.com>
Fri, 27 May 2016 07:04:16 +0000 (16:04 +0900)
In current bash script for doctor test, '-x' option is enabled and all
executing commands will be printed in the console.

Functest has a configuration to enable/disable this '-x' option. It is
environment variable 'CI_DEBUG'.

This patch makes doctor test script to set '-x' option according to
'CI_DEBUG'. If it's not set, '-x' option will be enabled as it was
enabled before this change.

JIRA: FUNCTEST-212

Change-Id: I9fa5036aad7a0f5c88378337d946439a6ee6108c
Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com>
tests/run.sh

index 00dcabc..241d689 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash -ex
+#!/bin/bash -e
 ##############################################################################
 # Copyright (c) 2016 NEC Corporation and others.
 #
@@ -8,6 +8,8 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+[[ "${CI_DEBUG:-true}" == "true" ]] && set -x
+
 IMAGE_URL=https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img
 IMAGE_NAME=cirros
 IMAGE_FILE="${IMAGE_NAME}.img"