This is an automated email from the git hooks/post-receive script.
bernie.ogden pushed a commit to branch bernie/jenkmarking-multinode in repository toolchain/abe.
commit 7f1a2aa4351463cd9481a7d76d0cb2aacdedc054 Author: Bernard Ogden bernie.ogden@linaro.org Date: Fri Jul 24 17:52:11 2015 +0200
Add post-run command
The most likely use is to reboot conventional targets, or to halt LAVA targets.
Change-Id: Ic7172f8abdbc855aba0555df7b3f87baca104216 --- scripts/Benchmark.job | 4 ++-- scripts/benchmark.sh | 6 ++++-- scripts/runbenchmark.sh | 12 +++++++++++- 3 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/scripts/Benchmark.job b/scripts/Benchmark.job index e584f75..c3d53dd 100755 --- a/scripts/Benchmark.job +++ b/scripts/Benchmark.job @@ -56,5 +56,5 @@ echo cd "${maindir}" echo "${ABE_DIR}"/configure --with-fileserver=148.251.136.42 --with-remote-snapsho [...] "${ABE_DIR}"/configure --with-fileserver=148.251.136.42 --with-remote-snapsho [...]
-echo "${ABE_DIR}"/scripts/benchmark.sh ${run_flags:+-a "${run_flags//"/\"}"} [...] - "${ABE_DIR}"/scripts/benchmark.sh ${run_flags:+-a "${run_flags//"/\"}"} [...] +echo "${ABE_DIR}"/scripts/benchmark.sh ${post_target_cmd:+-e "${post_target_cmd}\ [...] + "${ABE_DIR}"/scripts/benchmark.sh ${post_target_cmd:+-e "${post_target_cmd}" [...] diff --git a/scripts/benchmark.sh b/scripts/benchmark.sh index 6b10b70..bcc49f4 100755 --- a/scripts/benchmark.sh +++ b/scripts/benchmark.sh @@ -88,7 +88,8 @@ keep= #'-p' (polite) - clean up and release target even if there [...] #'' (default) - clean up and release target unless there is an error #'-k' (keep) - unconditionally keep target-side data and target target= -while getopts g:f:a:i:b:kpchs flag; do +post_target_cmd= +while getopts g:f:a:i:b:e:kpchs flag; do case "${flag}" in g) tag="${OPTARG}";; a) run_benchargs="${OPTARG}";; @@ -116,6 +117,7 @@ while getopts g:f:a:i:b:kpchs flag; do echo 'Unconditional release (-p) set: data will be scrubbed and target rele [...] ;; f) compiler_flags="${OPTARG}";; + e) post_target_cmd="${OPTARG}";; h) usage exit 0 @@ -190,7 +192,7 @@ if ! tar cjf "${cmpbuild}" -C "${builddir}/.." "`basename ${bui [...] exit 1 fi for device in "${devices[@]}"; do - "${topdir}"/scripts/runbenchmark.sh -g "${tag:-${device}-${benchmark}}" -b "${be [...] + "${topdir}"/scripts/runbenchmark.sh ${post_target_cmd:+-e "${post_target_cmd}"} [...] runpids[$!]='' done
diff --git a/scripts/runbenchmark.sh b/scripts/runbenchmark.sh index 99b9d50..a67379c 100755 --- a/scripts/runbenchmark.sh +++ b/scripts/runbenchmark.sh @@ -18,7 +18,8 @@ keep= cautious='' build_dir= run_benchargs= -while getopts g:b:d:t:a:kpc flag; do +post_target_cmd= +while getopts g:b:d:t:e:a:kpc flag; do case "${flag}" in g) tag="${OPTARG}";; k) keep='-k';; @@ -28,6 +29,7 @@ while getopts g:b:d:t:a:kpc flag; do d) device="${OPTARG}";; t) buildtar="${OPTARG}";; a) run_benchargs="${OPTARG}";; + e) post_target_cmd="${OPTARG}";; *) echo "Bad arg" 1>&2 exit 1 @@ -97,6 +99,14 @@ clean_benchmark() echo "Target post-boot initialisation did not happen, thus nothing to clean up." fi
+ if test ${error} -eq 0; then + echo "Sending post-target command '${post_target_cmd}' - will not check error code" + if test x"${post_target_cmd}" != x; then + (. ${topdir}/lib/common.sh; remote_exec "${ip}" "${post_target_cmd}" ${ssh_opts}) + fi + #We don't check the error code because this might well include a shutdown + fi + exit "${error}" }