On Thu, Nov 19, 2020 at 08:47:17AM +0800, Yu Chuan wrote:
[Why] Result rootfs of dailybuild requires multiple test jobs.
[How]
- jobs/iso2rootfs.yaml.
Before: test_yaml, test_os_mount, test_testbox After: test1_yaml,test1_os_mount, test1_testbox test2_yaml,test2_os_mount, test2_testbox ...
- tests/iso2rootfs.
- Use for-loop to traverse if $testX_yaml exists.
- [ -n "${test1_yaml}" ] || return 0.
Signed-off-by: Yu Chuan 13186087857@163.com
jobs/iso2rootfs.yaml | 8 ++++--- tests/iso2rootfs | 54 ++++++++++++++++++++++++++++++-------------- 2 files changed, 42 insertions(+), 20 deletions(-)
diff --git a/jobs/iso2rootfs.yaml b/jobs/iso2rootfs.yaml index fc3fc1d2e3ba..3c69a9d98430 100644 --- a/jobs/iso2rootfs.yaml +++ b/jobs/iso2rootfs.yaml @@ -17,6 +17,8 @@ iso2rootfs: config_rootfs:
# submit test yaml related fields
- test_yaml:
- test_os_mount:
- test_testbox:
- ## you can add as many test jobs as you like.
- ## but follow three fields is requied for every test job.
- test1_yaml:
- test1_os_mount:
- test1_testbox:
diff --git a/tests/iso2rootfs b/tests/iso2rootfs index e9ed955441b3..a38685118b7f 100755 --- a/tests/iso2rootfs +++ b/tests/iso2rootfs @@ -56,7 +56,7 @@ check_yaml_vars()
for yaml_t in "${yaml_vars[@]}" do
[ -n "$(eval echo "\$${yaml_t}")" ] || die "cannot fine value of var: ${yaml_t}."
done[ -n "$(eval echo "\$${yaml_t}")" ] || die "cannot find value of var: ${yaml_t}."
}
@@ -447,17 +447,35 @@ generate_submit_append_str() echo "os=${iso_os} os_arch=${iso_arch} os_version=${iso_version} os_mount=$1 testbox=$2" }
-submit_test_job_yaml() +submit_one_yaml() {
[ -n ${test_yaml} ] || return 0
log_info "starting submit ${test_yaml} ..."
[ -d "${LKP_SRC}" ] || die "cannot find value of var: LKP_SRC."
- cd "${LKP_SRC}/jobs"
- [ -f "${test_yaml}" ] ||
die "cannot find test yaml in LKP_SRC/jobs.
test yaml: ${test_yaml}."
^----- after change line, need append "" ? ^------ keep below format: [ -f "${test_yaml}" ] || die "cannot find test yaml in LKP_SRC/jobs.
Thanks, Liushaofei
- local test_os_mount="$(eval echo "$${test_num}_os_mount")"
- local test_testbox="$(eval echo "$${test_num}_testbox")"
- [ -n "${test_os_mount}" ] || die "cannot find value of var: ${test_num}_os_mount."
- [ -n "${test_testbox}" ] || die "cannot find value of var: ${test_num}_testbox."
- [ -n "${test_os_mount}" ] || die "cannot fine value of var: test_os_mount."
- [ -n "${test_testbox}" ] || die "cannot fine value of var: test_testbox."
"${LKP_SRC}/sbin/submit" \
$(generate_submit_append_str "${test_os_mount}" "${test_testbox}") \
"${test_yaml}"
log_info "submit ${test_yaml} finished"
+}
+submit_yamls() +{
- [ -n "$test1_yaml" ] || return 0
- log_info "starting submit test yamls ..."
- [ -d "${LKP_SRC}" ] || die "cannot find value of var: LKP_SRC." cd "${LKP_SRC}" && { chmod +x ./sbin/install-dependencies.sh ./sbin/install-dependencies.sh
@@ -465,17 +483,19 @@ submit_test_job_yaml() generate_global_yaml }
- cd "${LKP_SRC}/jobs" && {
[ -f "${test_yaml}" ] ||
die "cannot find test yaml in LKP_SRC/jobs.
test yaml: ${test_yaml}."
- local test_yaml_index=1
- local test_num="test${test_yaml_index}"
- local test_yaml="$(eval echo "$${test_num}_yaml")"
"${LKP_SRC}/sbin/submit" \
$(generate_submit_append_str "${test_os_mount}" "${test_testbox}") \
"${test_yaml}"
- }
- while [ -n "${test_yaml}" ]
- do
submit_one_yaml
test_yaml_index=$((${test_yaml_index} +1))
test_num="test${test_yaml_index}"
test_yaml="$(eval echo "\$${test_num}_yaml")"
- done
- log_info "submit ${test_yaml} finished"
- log_info "submit test yamls finished"
}
############ post works ############ @@ -511,7 +531,7 @@ main() config_rootfs
test_rootfs
- submit_test_job_yaml
submit_yamls
post_works
}
2.23.0