Framework of install-iso-release.
Signed-off-by: Yu Chuan 13186087857@163.com --- jobs/install-iso-release.yaml | 26 +++++++++++++++++++ tests/install-iso-release | 47 +++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 jobs/install-iso-release.yaml create mode 100755 tests/install-iso-release
diff --git a/jobs/install-iso-release.yaml b/jobs/install-iso-release.yaml new file mode 100644 index 000000000000..fabb2cd50902 --- /dev/null +++ b/jobs/install-iso-release.yaml @@ -0,0 +1,26 @@ +suite: install-iso-release +category: benchmark +install-iso-release: + ################# + # iso info + ################# + iso_os: + iso_arch: + iso_version: + + ################# + # nfs server info, used for store rootfs + ################# + NFS_SERVER_HOST: + NFS_ROOT_DIR: + + ################# + # result rootfs suffix, format: $(date "+%Y%m%d%H%M%S") + ################# + ROOTFS_SUFFIX: + + ################# + # name of volume group which stores the logical volume of rootfs + ################# + VG_NAME: + diff --git a/tests/install-iso-release b/tests/install-iso-release new file mode 100755 index 000000000000..23e8fbff8e4f --- /dev/null +++ b/tests/install-iso-release @@ -0,0 +1,47 @@ +#!/bin/bash +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. + +set -e + +. $LKP_SRC/lib/debug.sh +. $LKP_SRC/lib/log.sh + +check_params() +{ + log_info "start check params" + + local required_vars=( + "iso_os" + "iso_arch" + "iso_version" + + "NFS_SERVER_HOST" + "NFS_ROOT_DIR" + + "ROOTFS_SUFFIX" + "VG_NAME" + ) + + for i in "${required_vars[@]}" + do + [ -n "$(eval echo $$i)" ] || die "cannot get value of var: $i" + done +} + +release_rootfs() +{ + : +} + +main() +{ + check_params + + release_rootfs + + lvchange --permission r /dev/mapper/${VG_NAME}-${iso_os}_${iso_arch}_${iso_version}_${ROOTFS_SUFFIX} || + die "change logical volume permission to readonly failed:/dev/mapper/${VG_NAME}-${iso_os}_${iso_arch}_${iso_version}_${ROOTFS_SUFFIX}" +} + +main
On Fri, Mar 05, 2021 at 04:59:53PM +0800, Yu Chuan wrote:
Framework of install-iso-release.
Signed-off-by: Yu Chuan 13186087857@163.com
jobs/install-iso-release.yaml | 26 +++++++++++++++++++ tests/install-iso-release | 47 +++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 jobs/install-iso-release.yaml create mode 100755 tests/install-iso-release
diff --git a/jobs/install-iso-release.yaml b/jobs/install-iso-release.yaml new file mode 100644 index 000000000000..fabb2cd50902 --- /dev/null +++ b/jobs/install-iso-release.yaml @@ -0,0 +1,26 @@ +suite: install-iso-release +category: benchmark +install-iso-release:
- #################
- # iso info
- #################
- iso_os:
- iso_arch:
- iso_version:
- NFS_SERVER_HOST:
- NFS_ROOT_DIR:
maybe these five fields can be combined, and add a comment: ${NFS_SERVER_HOST}:${NFS_ROOT_DIR}/${iso_os}/${iso_arch}/${iso_version}
- #################
- # result rootfs suffix, format: $(date "+%Y%m%d%H%M%S")
- #################
- ROOTFS_SUFFIX:
- #################
- # name of volume group which stores the logical volume of rootfs
- #################
- VG_NAME:
diff --git a/tests/install-iso-release b/tests/install-iso-release new file mode 100755 index 000000000000..23e8fbff8e4f --- /dev/null +++ b/tests/install-iso-release @@ -0,0 +1,47 @@ +#!/bin/bash +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+set -e
+. $LKP_SRC/lib/debug.sh +. $LKP_SRC/lib/log.sh
+check_params() +{
- log_info "start check params"
- local required_vars=(
"iso_os"
"iso_arch"
"iso_version"
delete this blank line.
"NFS_SERVER_HOST"
"NFS_ROOT_DIR"
"ROOTFS_SUFFIX"
"VG_NAME"
- )
- for i in "${required_vars[@]}"
- do
[ -n "$(eval echo \$$i)" ] || die "cannot get value of var: $i"
- done
+}
+release_rootfs() +{
- :
+}
+main() +{
- check_params
- release_rootfs
The following function name maybe more clearly: sync_rootfs_to_nfsserver
-------- Thanks, Xijian
- lvchange --permission r /dev/mapper/${VG_NAME}-${iso_os}_${iso_arch}_${iso_version}_${ROOTFS_SUFFIX} ||
die "change logical volume permission to readonly failed:/dev/mapper/${VG_NAME}-${iso_os}_${iso_arch}_${iso_version}_${ROOTFS_SUFFIX}"
+}
+main
2.23.0
+++ b/jobs/install-iso-release.yaml @@ -0,0 +1,26 @@ +suite: install-iso-release +category: benchmark +install-iso-release:
- #################
- # iso info
- #################
- iso_os:
- iso_arch:
- iso_version:
- NFS_SERVER_HOST:
- NFS_ROOT_DIR:
maybe these five fields can be combined, and add a comment: ${NFS_SERVER_HOST}:${NFS_ROOT_DIR}/${iso_os}/${iso_arch}/${iso_version}
good
+check_params() +{
- log_info "start check params"
- local required_vars=(
"iso_os"
"iso_arch"
"iso_version"
delete this blank line.
ok
+release_rootfs() +{
- :
+}
+main() +{
- check_params
- release_rootfs
The following function name maybe more clearly: sync_rootfs_to_nfsserver
good
-------- Thanks Yu Chuan
Thanks, Xijian
- lvchange --permission r /dev/mapper/${VG_NAME}-${iso_os}_${iso_arch}_${iso_version}_${ROOTFS_SUFFIX} ||
die "change logical volume permission to readonly failed:/dev/mapper/${VG_NAME}-${iso_os}_${iso_arch}_${iso_version}_${ROOTFS_SUFFIX}"
+}
+main
2.23.0