[Why] The produced dailybuild rootfs needs further testing by submit a job.
[How] 1. Configure lkp env by {LKP_SRC}/sbin/install-dependencies.sh
2. Generate global compass-ci yaml. - The path of yaml: - /etc/compass-ci/defaults/sparrow.yaml - The yaml have two necessary fields: - SCHED_HOST - SCHED_PORT - The value of these two fields are consistent with the value in job.yaml of iso2rootfs.
3. Submit the job.yaml of rootfs test job with append follow params: - os - os_arch - os_version - os_mount - testbox
Signed-off-by: Yu Chuan 13186087857@163.com --- jobs/iso2rootfs.yaml | 6 +++++ tests/iso2rootfs | 60 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 65 insertions(+), 1 deletion(-)
diff --git a/jobs/iso2rootfs.yaml b/jobs/iso2rootfs.yaml index f413c9cee1f0..644c64be06b4 100644 --- a/jobs/iso2rootfs.yaml +++ b/jobs/iso2rootfs.yaml @@ -11,3 +11,9 @@ iso2rootfs: rootfs_path: initrd_http_host: initrd_http_port: + test_yaml: + test_os: + test_os_arch: + test_os_version: + test_os_mount: + test_testbox: diff --git a/tests/iso2rootfs b/tests/iso2rootfs index bf1f995e78df..9a40f7b07892 100755 --- a/tests/iso2rootfs +++ b/tests/iso2rootfs @@ -53,6 +53,12 @@ check_yaml_vars() "rootfs_path" "initrd_http_host" "initrd_http_port" + "test_yaml" + "test_os" + "test_os_arch" + "test_os_version" + "test_os_mount" + "test_testbox" )
local yaml_t @@ -404,6 +410,57 @@ test_rootfs() EOF }
+############ submit test job yaml ############ +generate_global_yaml() +{ + local config_yaml="/etc/compass-ci/defaults/sparrow.yaml" + + mkdir -p "$(dirname "${config_yaml}")" + echo "SCHED_HOST: ${SCHED_HOST}" >> "${config_yaml}" + echo "SCHED_PORT: ${SCHED_PORT}" >> "${config_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 +} + +submit_test_job_yaml() +{ + log_info "starting submit ${test_yaml} ..." + + [ -d "${LKP_SRC}" ] || die "no LKP_SRC !!!" + + cd "${LKP_SRC}" && { + chmod +x ./sbin/install-dependencies.sh + ./sbin/install-dependencies.sh + + generate_global_yaml + } + + cd "${LKP_SRC}/jobs" && { + [ -f "${test_yaml}" ] || + die "test yaml(${test_yaml}) exist in {LKP_SRC}/jobs !!!" + + generate_submit_append_str + [ -z "${SUBMIT_APPEND_STR}" ] || SUBMIT_APPEND_STR="-a ${SUBMIT_APPEND_STR}" + + "${LKP_SRC}/sbin/submit" ${SUBMIT_APPEND_STR} "${test_yaml}" + } + + log_info "submit ${test_yaml} finished" +} + ############ post works ############ post_works() { @@ -414,7 +471,7 @@ post_works() local soft_link="${iso_version}-dailybuild" cd "${ROOTFS_LOCAL_PATH}" && rm -f "${soft_link}" && - ln -s "$(basename ${ROOTFS_DES_DIR})" "${soft_link}" + ln -s "$(basename "${ROOTFS_DES_DIR}")" "${soft_link}"
cd / && umount "${ROOTFS_LOCAL_PATH}"
@@ -433,6 +490,7 @@ main() run_qcow2rootfs
test_rootfs + submit_test_job_yaml
post_works }
On Wed, Oct 21, 2020 at 07:05:21PM +0800, Yu Chuan wrote:
[Why] The produced dailybuild rootfs needs further testing by submit a job.
[How]
Configure lkp env by {LKP_SRC}/sbin/install-dependencies.sh
Generate global compass-ci yaml.
- The path of yaml:
- /etc/compass-ci/defaults/sparrow.yaml
- The yaml have two necessary fields:
- SCHED_HOST
- SCHED_PORT
- The value of these two fields are consistent with the value in job.yaml of iso2rootfs.
- Submit the job.yaml of rootfs test job with append follow params:
- os
- os_arch
- os_version
- os_mount
- testbox
Signed-off-by: Yu Chuan 13186087857@163.com
jobs/iso2rootfs.yaml | 6 +++++ tests/iso2rootfs | 60 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 65 insertions(+), 1 deletion(-)
diff --git a/jobs/iso2rootfs.yaml b/jobs/iso2rootfs.yaml index f413c9cee1f0..644c64be06b4 100644 --- a/jobs/iso2rootfs.yaml +++ b/jobs/iso2rootfs.yaml @@ -11,3 +11,9 @@ iso2rootfs: rootfs_path: initrd_http_host: initrd_http_port:
- test_yaml:
- test_os:
- test_os_arch:
- test_os_version:
- test_os_mount:
- test_testbox:
diff --git a/tests/iso2rootfs b/tests/iso2rootfs index bf1f995e78df..9a40f7b07892 100755 --- a/tests/iso2rootfs +++ b/tests/iso2rootfs @@ -53,6 +53,12 @@ check_yaml_vars() "rootfs_path" "initrd_http_host" "initrd_http_port"
"test_yaml"
"test_os"
"test_os_arch"
"test_os_version"
"test_os_mount"
"test_testbox"
)
local yaml_t
@@ -404,6 +410,57 @@ test_rootfs() EOF }
+############ submit test job yaml ############ +generate_global_yaml() +{
- local config_yaml="/etc/compass-ci/defaults/sparrow.yaml"
- mkdir -p "$(dirname "${config_yaml}")"
- echo "SCHED_HOST: ${SCHED_HOST}" >> "${config_yaml}"
- echo "SCHED_PORT: ${SCHED_PORT}" >> "${config_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
+}
+submit_test_job_yaml() +{
- log_info "starting submit ${test_yaml} ..."
- [ -d "${LKP_SRC}" ] || die "no LKP_SRC !!!"
- cd "${LKP_SRC}" && {
chmod +x ./sbin/install-dependencies.sh
./sbin/install-dependencies.sh
generate_global_yaml
- }
- cd "${LKP_SRC}/jobs" && {
[ -f "${test_yaml}" ] ||
die "test yaml\(${test_yaml}\) exist in {LKP_SRC}/jobs !!!"
==> test yaml not exist in ${LKP_SRC}/jobs
Thanks, Ping
generate_submit_append_str
[ -z "${SUBMIT_APPEND_STR}" ] || SUBMIT_APPEND_STR="-a ${SUBMIT_APPEND_STR}"
"${LKP_SRC}/sbin/submit" ${SUBMIT_APPEND_STR} "${test_yaml}"
- }
- log_info "submit ${test_yaml} finished"
+}
############ post works ############ post_works() { @@ -414,7 +471,7 @@ post_works() local soft_link="${iso_version}-dailybuild" cd "${ROOTFS_LOCAL_PATH}" && rm -f "${soft_link}" &&
ln -s "$(basename ${ROOTFS_DES_DIR})" "${soft_link}"
ln -s "$(basename "${ROOTFS_DES_DIR}")" "${soft_link}"
cd / && umount "${ROOTFS_LOCAL_PATH}"
@@ -433,6 +490,7 @@ main() run_qcow2rootfs
test_rootfs
submit_test_job_yaml
post_works
}
2.23.0
+submit_test_job_yaml() +{
- log_info "starting submit ${test_yaml} ..."
- [ -d "${LKP_SRC}" ] || die "no LKP_SRC !!!"
- cd "${LKP_SRC}" && {
chmod +x ./sbin/install-dependencies.sh
./sbin/install-dependencies.sh
generate_global_yaml
- }
- cd "${LKP_SRC}/jobs" && {
[ -f "${test_yaml}" ] ||
die "test yaml\(${test_yaml}\) exist in {LKP_SRC}/jobs !!!"
==> test yaml not exist in ${LKP_SRC}/jobs
Good !
-------- Thanks Yu Chuan
Thanks, Ping
generate_submit_append_str
[ -z "${SUBMIT_APPEND_STR}" ] || SUBMIT_APPEND_STR="-a ${SUBMIT_APPEND_STR}"
"${LKP_SRC}/sbin/submit" ${SUBMIT_APPEND_STR} "${test_yaml}"
- }
- log_info "submit ${test_yaml} finished"
+}
############ post works ############ post_works() { @@ -414,7 +471,7 @@ post_works() local soft_link="${iso_version}-dailybuild" cd "${ROOTFS_LOCAL_PATH}" && rm -f "${soft_link}" &&
ln -s "$(basename ${ROOTFS_DES_DIR})" "${soft_link}"
ln -s "$(basename "${ROOTFS_DES_DIR}")" "${soft_link}"
cd / && umount "${ROOTFS_LOCAL_PATH}"
@@ -433,6 +490,7 @@ main() run_qcow2rootfs
test_rootfs
submit_test_job_yaml
post_works
}
2.23.0
TO ALL.
Better remove unrelated context.
- cd "${LKP_SRC}/jobs" && {
[ -f "${test_yaml}" ] ||
die "test yaml\(${test_yaml}\) exist in {LKP_SRC}/jobs !!!"
==> test yaml not exist in ${LKP_SRC}/jobs
Good point!
"test yaml not exist in" 非常容易 grep
修改之前的output, fixed string AND variable互相交织,碎片化了。 看到出错消息也很难在项目里快速gg到对应代码。
!!! 一般也没必要。
Thanks, Fengguang
On Thu, Oct 22, 2020 at 12:17:46PM +0800, Wu Fengguang wrote:
TO ALL.
Better remove unrelated context.
ok.
- cd "${LKP_SRC}/jobs" && {
[ -f "${test_yaml}" ] ||
die "test yaml\(${test_yaml}\) exist in {LKP_SRC}/jobs !!!"
==> test yaml not exist in ${LKP_SRC}/jobs
Good point!
"test yaml not exist in" 非常容易 grep
修改之前的output, fixed string AND variable互相交织,碎片化了。 看到出错消息也很难在项目里快速gg到对应代码。
ok.
!!! 一般也没必要。
ok.
-------- Thanks Yu Chuan
Thanks, Fengguang
On Thu, Oct 22, 2020 at 02:23:41PM +0800, Yu Chuan wrote:
On Thu, Oct 22, 2020 at 12:17:46PM +0800, Wu Fengguang wrote:
TO ALL.
Better remove unrelated context.
ok.
That's comment for Liping. :)
- cd "${LKP_SRC}/jobs" && {
[ -f "${test_yaml}" ] ||
die "test yaml\(${test_yaml}\) exist in {LKP_SRC}/jobs !!!"
==> test yaml not exist in ${LKP_SRC}/jobs
Good point!
"test yaml not exist in" 非常容易 grep
修改之前的output, fixed string AND variable互相交织,碎片化了。 看到出错消息也很难在项目里快速gg到对应代码。
ok.
FYI 我总结了下:
+- puts/printf字符串应当容易搜索(grep)。特别注意包含足够长的固定内容substring. +例如: + die "test yaml(${test_yaml}) not exist in ${LKP_SRC}/jobs !!!" +==> + die "cannot find test yaml ($test_yaml) in $LKP_SRC/jobs" + ^^^^^^^^^^^^^^^^^^^^^ grep-friendly fixed substring +
Thanks, Fengguang