Allow job can use the debug rootfs dir by specifying 'os_version' as '{os_version}-debug'.
Signed-off-by: Yu Chuan 13186087857@163.com --- tests/iso2rootfs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/tests/iso2rootfs b/tests/iso2rootfs index 5184041abf2b..7ab4a08b0d60 100755 --- a/tests/iso2rootfs +++ b/tests/iso2rootfs @@ -72,13 +72,14 @@ get_daily_iso_checksum()
mount_rootfs() { + DEBUG_ROOTFS_DIR="debug-versions/dailybuild" case ${rootfs_protocol} in "nfs") - ROOTFS_SERVER_PATH="${rootfs_server}:${rootfs_path}/${iso_os}/${iso_arch}/debug-versions/dailybuild" + ROOTFS_SERVER_PATH="${rootfs_server}:${rootfs_path}/${iso_os}/${iso_arch}" install_pkgs "nfs-utils" ;; "cifs") - ROOTFS_SERVER_PATH="//${rootfs_server}/${rootfs_path}/${iso_os}/${iso_arch}/debug-versions/dailybuild" + ROOTFS_SERVER_PATH="//${rootfs_server}/${rootfs_path}/${iso_os}/${iso_arch}" ROOTFS_MOUNT_PARAM="guest,vers=1.0,noacl,nouser_xattr" install_pkgs "cifs-utils" ;; @@ -102,7 +103,7 @@ get_cache_iso_checksum() { mount_rootfs
- CHECKSUM_FILE_CACHE="${ROOTFS_LOCAL_PATH}/${iso_version}-newest.sha256sum" + CHECKSUM_FILE_CACHE="${ROOTFS_LOCAL_PATH}/${DEBUG_ROOTFS_DIR}/${iso_version}-newest.sha256sum" [ ! -f "${CHECKSUM_FILE_CACHE}" ] || SHA256SUM_CACHE=$(awk '{print $1}' "$CHECKSUM_FILE_CACHE") } @@ -254,7 +255,7 @@ download_compass_ci()
config_rootfs_dir() { - ROOTFS_DES_DIR=${ROOTFS_LOCAL_PATH}/${iso_version}-$(date "+%Y%m%d%H%M%S") + ROOTFS_DES_DIR=${ROOTFS_LOCAL_PATH}/${DEBUG_ROOTFS_DIR}/${iso_version}-$(date "+%Y%m%d%H%M%S") [ -d "${ROOTFS_DES_DIR}" ] && ROOTFS_DES_DIR="${ROOTFS_DES_DIR}-${HOSTNAME##*--}" mkdir -p "$ROOTFS_DES_DIR" @@ -309,10 +310,10 @@ test_rootfs() local root_path case ${rootfs_protocol} in "nfs") - root_path="${ROOTFS_SERVER_PATH}/$(basename "${ROOTFS_DES_DIR}")" + root_path="${ROOTFS_SERVER_PATH}/${DEBUG_ROOTFS_DIR}/$(basename "${ROOTFS_DES_DIR}")" ;; "cifs") - root_path="cifs:${ROOTFS_SERVER_PATH}/$(basename "${ROOTFS_DES_DIR}"),${ROOTFS_MOUNT_PARAM}" + root_path="cifs:${ROOTFS_SERVER_PATH}/${DEBUG_ROOTFS_DIR}/$(basename "${ROOTFS_DES_DIR}"),${ROOTFS_MOUNT_PARAM}" ;; *) die "rootfs_protocol is none, exit !!!" @@ -362,7 +363,12 @@ post_works()
mv "${CHECKSUM_FILE_CACHE}.tmp" "${CHECKSUM_FILE_CACHE}"
- umount "${ROOTFS_LOCAL_PATH}" + cd "${ROOTFS_LOCAL_PATH}" && + rm -f "${iso_version}-debug" && + ln -s "${DEBUG_ROOTFS_DIR}/$(basename ${ROOTFS_DES_DIR})" \ + "${iso_version}-debug" + + cd / && umount "${ROOTFS_LOCAL_PATH}"
log_info "iso2rootfs finished" }