aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLi Zhijian <zhijianx.li@intel.com>2019-07-23 20:56:37 +0800
committerLi Zhijian <zhijianx.li@intel.com>2019-07-23 21:11:36 +0800
commita398dd0d8f84901453f8b986b7c61612d25c0081 (patch)
treedb0f3decd19b64cde9c4b0969f5ae1d3392c1d29
parentf267eee33c460ebd4baba9db393cddbcf9286427 (diff)
downloadlkp-tests-a398dd0d8f84901453f8b986b7c61612d25c0081.tar.gz
job2sh: only accept atomic jobfile
Previously, it doesn't complain when we input a non-atomic jobfile ( lkp compile non-atomic.yaml >output.script) But actually, the output.script usually doesn't work, because this script pass all parameters to tests/$script at one time while tests/$script usually only accepts a group of them. below is part of the output script run_job() { echo $$ > $TMP/run-job.pid . $LKP_SRC/lib/http.sh . $LKP_SRC/lib/job.sh . $LKP_SRC/lib/env.sh export_top_env run_test array_size='10000000 50000000' omp='true false' $LKP_SRC/tests/wrapper stream <<<<==== all parameters at one time } Fixes #38 Signed-off-by: Li Zhijian <zhijianx.li@intel.com>
-rwxr-xr-xlib/job.rb4
-rwxr-xr-xsbin/job2sh6
2 files changed, 10 insertions, 0 deletions
diff --git a/lib/job.rb b/lib/job.rb
index 3df973c5..73dfe2ec 100755
--- a/lib/job.rb
+++ b/lib/job.rb
@@ -813,6 +813,10 @@ class Job
def to_hash
@job
end
+
+ def atomic_job?
+ @job['arch']
+ end
end
class JobEval < Job
diff --git a/sbin/job2sh b/sbin/job2sh
index 9ada3cfa..4fb57453 100755
--- a/sbin/job2sh
+++ b/sbin/job2sh
@@ -38,6 +38,12 @@ begin
job = Job2sh.new
job.load(ARGV[0])
job.expand_params
+
+ unless job.atomic_job?
+ log_error "Looks #{ARGV[0]} isn't a atomic jobfile, only atomic jobfile is supported"
+ log_error "Please run 'lkp split-job #{ARGV[0]}' first"
+ exit 1
+ end
rescue Job::ParamError => e
log_error "Abandon job: #{e.message}"
exit 1