[PATCH lkp-tests 4/6] iso2rootfs: delete the useless fields

[Why] The 'os', 'os_arch', 'os_version' fields to be use by test job are the same as the 'iso_os', 'iso_arch', 'iso_version' of the destination iso this time. So delete the 'test_os', 'test_os_arch', 'test_os_version'. Signed-off-by: Yu Chuan <13186087857@163.com> --- jobs/iso2rootfs.yaml | 3 --- tests/iso2rootfs | 33 +++++++-------------------------- 2 files changed, 7 insertions(+), 29 deletions(-) diff --git a/jobs/iso2rootfs.yaml b/jobs/iso2rootfs.yaml index c81d548b49ea..fc3fc1d2e3ba 100644 --- a/jobs/iso2rootfs.yaml +++ b/jobs/iso2rootfs.yaml @@ -18,8 +18,5 @@ iso2rootfs: # submit test yaml related fields test_yaml: - test_os: - test_os_arch: - test_os_version: test_os_mount: test_testbox: diff --git a/tests/iso2rootfs b/tests/iso2rootfs index 34c8e84d9d74..e9ed955441b3 100755 --- a/tests/iso2rootfs +++ b/tests/iso2rootfs @@ -443,17 +443,8 @@ generate_global_yaml() generate_submit_append_str() { - local wait_add_vars=( - "os" - "os_arch" - "os_version" - "os_mount" - "testbox" - ) - for vt in "${wait_add_vars[@]}" - do - SUBMIT_APPEND_STR="${SUBMIT_APPEND_STR} ${vt}=$(eval echo "\$test_${vt}")" - done + [ "$#" -eq 2 ] || die "cannot get enough submit params." + echo "os=${iso_os} os_arch=${iso_arch} os_version=${iso_version} os_mount=$1 testbox=$2" } submit_test_job_yaml() @@ -464,18 +455,8 @@ submit_test_job_yaml() [ -d "${LKP_SRC}" ] || die "cannot find value of var: LKP_SRC." - local test_yaml_vars=( - "test_os" - "test_os_arch" - "test_os_version" - "test_os_mount" - "test_testbox" - ) - - for yaml_t in "${test_yaml_vars[@]}" - do - [ -n "$(eval echo "\$${yaml_t}")" ] || die "cannot fine value of var: ${yaml_t}." - done + [ -n "${test_os_mount}" ] || die "cannot fine value of var: test_os_mount." + [ -n "${test_testbox}" ] || die "cannot fine value of var: test_testbox." cd "${LKP_SRC}" && { chmod +x ./sbin/install-dependencies.sh @@ -489,9 +470,9 @@ submit_test_job_yaml() die "cannot find test yaml in LKP_SRC/jobs. test yaml: ${test_yaml}." - generate_submit_append_str - - "${LKP_SRC}/sbin/submit" ${SUBMIT_APPEND_STR} "${test_yaml}" + "${LKP_SRC}/sbin/submit" \ + $(generate_submit_append_str "${test_os_mount}" "${test_testbox}") \ + "${test_yaml}" } log_info "submit ${test_yaml} finished" -- 2.23.0

On Thu, Nov 19, 2020 at 08:47:16AM +0800, Yu Chuan wrote:
[Why] The 'os', 'os_arch', 'os_version' fields to be use by test job are the same as the 'iso_os', 'iso_arch', 'iso_version' of the destination iso this time.
So delete the 'test_os', 'test_os_arch', 'test_os_version'.
Signed-off-by: Yu Chuan <13186087857@163.com> --- jobs/iso2rootfs.yaml | 3 --- tests/iso2rootfs | 33 +++++++-------------------------- 2 files changed, 7 insertions(+), 29 deletions(-)
diff --git a/jobs/iso2rootfs.yaml b/jobs/iso2rootfs.yaml index c81d548b49ea..fc3fc1d2e3ba 100644 --- a/jobs/iso2rootfs.yaml +++ b/jobs/iso2rootfs.yaml @@ -18,8 +18,5 @@ iso2rootfs:
# submit test yaml related fields test_yaml: - test_os: - test_os_arch: - test_os_version: test_os_mount: test_testbox: diff --git a/tests/iso2rootfs b/tests/iso2rootfs index 34c8e84d9d74..e9ed955441b3 100755 --- a/tests/iso2rootfs +++ b/tests/iso2rootfs @@ -443,17 +443,8 @@ generate_global_yaml()
generate_submit_append_str() { - local wait_add_vars=( - "os" - "os_arch" - "os_version" - "os_mount" - "testbox" - ) - for vt in "${wait_add_vars[@]}" - do - SUBMIT_APPEND_STR="${SUBMIT_APPEND_STR} ${vt}=$(eval echo "\$test_${vt}")" - done + [ "$#" -eq 2 ] || die "cannot get enough submit params."
The output cannot cover the scene of when parameter number > 2. So can use "Please give 2 parameters" or so. Thanks, Xijian

On Thu, Nov 19, 2020 at 10:47:23AM +0800, Xu Xijian wrote:
On Thu, Nov 19, 2020 at 08:47:16AM +0800, Yu Chuan wrote:
[Why] The 'os', 'os_arch', 'os_version' fields to be use by test job are the same as the 'iso_os', 'iso_arch', 'iso_version' of the destination iso this time.
So delete the 'test_os', 'test_os_arch', 'test_os_version'.
Signed-off-by: Yu Chuan <13186087857@163.com> --- jobs/iso2rootfs.yaml | 3 --- tests/iso2rootfs | 33 +++++++-------------------------- 2 files changed, 7 insertions(+), 29 deletions(-)
diff --git a/jobs/iso2rootfs.yaml b/jobs/iso2rootfs.yaml index c81d548b49ea..fc3fc1d2e3ba 100644 --- a/jobs/iso2rootfs.yaml +++ b/jobs/iso2rootfs.yaml @@ -18,8 +18,5 @@ iso2rootfs:
# submit test yaml related fields test_yaml: - test_os: - test_os_arch: - test_os_version: test_os_mount: test_testbox: diff --git a/tests/iso2rootfs b/tests/iso2rootfs index 34c8e84d9d74..e9ed955441b3 100755 --- a/tests/iso2rootfs +++ b/tests/iso2rootfs @@ -443,17 +443,8 @@ generate_global_yaml()
generate_submit_append_str() { - local wait_add_vars=( - "os" - "os_arch" - "os_version" - "os_mount" - "testbox" - ) - for vt in "${wait_add_vars[@]}" - do - SUBMIT_APPEND_STR="${SUBMIT_APPEND_STR} ${vt}=$(eval echo "\$test_${vt}")" - done + [ "$#" -eq 2 ] || die "cannot get enough submit params."
The output cannot cover the scene of when parameter number > 2. So can use "Please give 2 parameters" or so.
Good, i'll modify as follow: generate_submit_append_str: please give 2 parameters. -------- Thanks Yu Chuan
Thanks, Xijian
participants (2)
-
Xu Xijian
-
Yu Chuan