Framework of install-iso-sync-rootfs.
Signed-off-by: Yu Chuan 13186087857@163.com --- jobs/install-iso-sync-rootfs.yaml | 22 +++++++++++++++ tests/install-iso-sync-rootfs | 46 +++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 jobs/install-iso-sync-rootfs.yaml create mode 100755 tests/install-iso-sync-rootfs
diff --git a/jobs/install-iso-sync-rootfs.yaml b/jobs/install-iso-sync-rootfs.yaml new file mode 100644 index 000000000000..0235b10c718b --- /dev/null +++ b/jobs/install-iso-sync-rootfs.yaml @@ -0,0 +1,22 @@ +suite: install-iso-sync-rootfs +category: benchmark +install-iso-sync-rootfs: + ################# + # nfs target path: ${NFS_SERVER_HOST}:${NFS_ROOT_DIR}/${iso_os}/${iso_arch}/${iso_version} + ################# + iso_os: + iso_arch: + iso_version: + 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-sync-rootfs b/tests/install-iso-sync-rootfs new file mode 100755 index 000000000000..e5de4d72240e --- /dev/null +++ b/tests/install-iso-sync-rootfs @@ -0,0 +1,46 @@ +#!/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 +} + +sync_rootfs_to_nfs_server() +{ + : +} + +main() +{ + check_params + + sync_rootfs_to_nfs_server + + 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