[Fuego] [PATCH 11/30] add-jobs: support reboot, rebuild, pre and postcleanup flags
Daniel Sangorrin
daniel.sangorrin at toshiba.co.jp
Mon Jun 4 07:17:45 UTC 2018
Signed-off-by: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
---
engine/scripts/ftc | 35 +++++++++++++++++++++++++++++++++--
1 file changed, 33 insertions(+), 2 deletions(-)
diff --git a/engine/scripts/ftc b/engine/scripts/ftc
index c92a1a8..f50795c 100755
--- a/engine/scripts/ftc
+++ b/engine/scripts/ftc
@@ -25,7 +25,6 @@
# - add do_run_request - to run a job request from the server
# if no arguments, run the next available request on the server
# - finish do_run_test
-# - support flags: Reboot, Rebuild
# - get log results into file (switch to subprocess?)
# - make Jenkins recognize ftc test result
# - finish do_set
@@ -1442,7 +1441,6 @@ def do_add_jobs(conf, options):
else:
error_out("No board name supplied.")
- rebuild = ''
if '--rebuild' in options:
try:
rebuild = options[options.index('--rebuild') + 1]
@@ -1472,6 +1470,39 @@ def do_add_jobs(conf, options):
else:
error_out('No testplan (-p) or test (-t) supplied.')
+ if '--reboot' in options:
+ try:
+ reboot = options[options.index('--reboot') + 1]
+ except IndexError:
+ error_out('Reboot option not provided after --reboot')
+ if reboot not in ['true', 'false']:
+ error_out("Invalid reboot option '%s'" % reboot)
+ options.remove(reboot)
+ options.remove('--reboot')
+ test_dict["reboot"] = reboot
+
+ if '--precleanup' in options:
+ try:
+ precleanup = options[options.index('--precleanup') + 1]
+ except IndexError:
+ error_out('Precleanup option not provided after --precleanup')
+ if precleanup not in ['true', 'false']:
+ error_out("Invalid precleanup option '%s'" % precleanup)
+ options.remove(precleanup)
+ options.remove('--precleanup')
+ test_dict["precleanup"] = precleanup
+
+ if '--postcleanup' in options:
+ try:
+ postcleanup = options[options.index('--postcleanup') + 1]
+ except IndexError:
+ error_out('Postcleanup option not provided after --postcleanup')
+ if postcleanup not in ['true', 'false']:
+ error_out("Invalid postcleanup option '%s'" % postcleanup)
+ options.remove(postcleanup)
+ options.remove('--postcleanup')
+ test_dict["postcleanup"] = postcleanup
+
if '-s' in options:
try:
spec = options[options.index('-s') + 1]
--
2.7.4
More information about the Fuego
mailing list