[Fuego] [PATCH 22/30] run-test: run the command with and without debug
Daniel Sangorrin
daniel.sangorrin at toshiba.co.jp
Mon Jun 4 07:17:56 UTC 2018
Signed-off-by: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
---
engine/scripts/ftc | 34 +++++++++-------------------------
1 file changed, 9 insertions(+), 25 deletions(-)
diff --git a/engine/scripts/ftc b/engine/scripts/ftc
index 28ccb68..21955a2 100755
--- a/engine/scripts/ftc
+++ b/engine/scripts/ftc
@@ -3153,7 +3153,7 @@ def get_test_arg(cmd, conf, options):
return (test_name, options)
def do_run_test(conf, options):
- global log, tail_fd
+ global log, tail_fd, debug
board, options = get_board_arg("Run-test", conf, options)
board_name = board.name
@@ -3369,29 +3369,6 @@ def do_run_test(conf, options):
build_data.timestamp = timestamp
os.environ["BUILD_TIMESTAMP"] = build_data.timestamp
- # cd to buildzone directory
- saved_cur_dir = os.getcwd()
- os.chdir(build_data.workspace)
-
- print("Running remotely on '%(board_name)s' in workspace %(workspace)s" % build_data)
-
- # FIXTHIS - do_run_test - get timeout from testplan
- # FIXTHIS - do_run_test - handle timeout myself in ftc_exec_command
- command = "timeout --signal=9 30m /bin/bash $FUEGO_CORE/engine/scripts/main.sh"
- pvar("command")
-
- # write command to temp file, and execute that with
- # '/bin/sh -xe /tmp/hudson123456.sh'
- try:
- tempfilename = make_temp_file(command)
- except:
- os.chdir(saved_cur_dir)
- error_out("Could not make temp file")
-
- pvar("tempfilename")
-
- # stream output to log file while test is running
-
# create log file
console_log_filename = "consolelog.txt"
log_filename = run_dir + os.sep + console_log_filename
@@ -3405,7 +3382,14 @@ def do_run_test(conf, options):
flag = fcntl.fcntl(tail_fd, fcntl.F_GETFL)
fcntl.fcntl(tail_fd, fcntl.F_SETFL, flag | os.O_NONBLOCK)
- command = "/bin/bash -xe %s" % (tempfilename)
+ # execute the test
+ print("Running remotely on '%(board_name)s' in workspace %(workspace)s" % build_data)
+ saved_cur_dir = os.getcwd()
+ os.chdir(build_data.workspace)
+ if debug is 1:
+ command = '/bin/bash -xe ' + conf.FUEGO_CORE + '/engine/scripts/main.sh'
+ else:
+ command = '/bin/bash -e ' + conf.FUEGO_CORE + '/engine/scripts/main.sh'
rcode = ftc_exec_command(command, timeout)
log.flush()
--
2.7.4
More information about the Fuego
mailing list