From 0874feafce88b76fcb403ade7fe446b572c94252 Mon Sep 17 00:00:00 2001 From: cc <18856836718@163.com> Date: Tue, 19 Mar 2024 17:23:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20lkp-tests=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E7=BB=93=E6=9E=9C=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- component/DevkitDistribute/install.sh | 2 +- component/LkpTests/check_install_result.sh | 4 ++-- component/LkpTests/install.sh | 16 ++++++++-------- .../LkpTests/lkp_help/compatibility-test/run | 2 +- component/OpenEulerMirrorISO/install.sh | 9 +++++++-- ...\207\345\257\274\346\211\213\345\206\214.md" | 6 +----- ...\207\345\257\274\346\211\213\345\206\214.md" | 9 ++------- ...207\345\257\274\346\211\213\345\206\214.pdf" | Bin .../compatibility_test_help.sh | 2 +- .../src/handler/install_package.py | 7 ++++--- tools/install_dependency/src/utils.py | 8 ++++++++ 12 files changed, 37 insertions(+), 32 deletions(-) rename "document/lkp-test\345\256\211\350\243\205\351\203\250\347\275\262/devkit\346\265\213\350\257\225\345\271\263\345\217\260\345\256\211\350\243\205\351\203\250\347\275\262\344\273\245\345\217\212\344\270\216jenkins\351\233\206\346\210\220\351\203\250\347\275\262\346\214\207\345\257\274\346\211\213\345\206\214.md" => "document/lkp-test\345\256\211\350\243\205\351\203\250\347\275\262/devkit\346\265\213\350\257\225\345\271\263\345\217\260\345\256\211\350\243\205\351\203\250\347\275\262\344\270\216jenkins\351\233\206\346\210\220\351\203\250\347\275\262\346\214\207\345\257\274\346\211\213\345\206\214.md" (99%) rename "document/lkp-test\345\256\211\350\243\205\351\203\250\347\275\262/devkit\346\265\213\350\257\225\345\271\263\345\217\260\345\256\211\350\243\205\351\203\250\347\275\262\344\273\245\345\217\212\344\270\216jenkins\351\233\206\346\210\220\351\203\250\347\275\262\346\214\207\345\257\274\346\211\213\345\206\214.pdf" => "document/lkp-test\345\256\211\350\243\205\351\203\250\347\275\262/devkit\346\265\213\350\257\225\345\271\263\345\217\260\345\256\211\350\243\205\351\203\250\347\275\262\344\270\216jenkins\351\233\206\346\210\220\351\203\250\347\275\262\346\214\207\345\257\274\346\211\213\345\206\214.pdf" (100%) diff --git a/README.md b/README.md index 52cfac1..448bfdb 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ Pipeline solution to support building, deploying and automating any software pro 3. [Jenkins流水线配置迁移、亲和门禁](https://gitee.com/openeuler/devkit-pipeline/blob/master/document/Jenkins安装部署/Jenkins流水线配置迁移、亲和门禁.md) 4. [安装部署Gitlab](https://gitee.com/openeuler/devkit-pipeline/blob/master/document/gitlab安装部署/gitlab安装部署.md) 5. [Gitlab流水线配置迁移、亲和门禁](https://gitee.com/openeuler/devkit-pipeline/blob/master/document/gitlab安装部署/Gitlab流水线配置迁移、亲和门禁.md) -6. [手动安装lkp-test](https://gitee.com/openeuler/devkit-pipeline/blob/master/document/lkp-test安装部署/lkp-tests安装部署.md) - +6. [devkit测试平台安装部署与jenkins集成部署指导手册](https://gitee.com/openeuler/devkit-pipeline/blob/master/document/lkp-test安装部署/devkit测试平台安装部署与jenkins集成部署指导手册.md) +7. [devkit测试平台安装部署与gitlab集成部署指导手册](https://gitee.com/openeuler/devkit-pipeline/blob/master/document/lkp-test安装部署/devkit测试平台安装部署与gitlab集成部署指导手册.md) #### 参与贡献 1. Fork 本仓库 diff --git a/component/DevkitDistribute/install.sh b/component/DevkitDistribute/install.sh index 0080c06..d4f0567 100644 --- a/component/DevkitDistribute/install.sh +++ b/component/DevkitDistribute/install.sh @@ -6,7 +6,7 @@ set -e function main (){ devkit_distribute_tar=$1 echo "Decompress devkit_distribute.tar.gz to ${HOME}/.local/lkp-tests/programs" - tar -zvxf "${devkit_distribute_tar}" -C /"${HOME}"/.local/lkp-tests/programs + tar -zxf "${devkit_distribute_tar}" -C "${HOME}"/.local/lkp-tests/programs chmod 755 "${HOME}"/.local/lkp-tests/programs/devkit_distribute/bin/start.sh ln -s "${HOME}"/.local/lkp-tests/programs/devkit_distribute/bin/start.sh "${HOME}"/.local/lkp-tests/tests/devkit_distribute echo "Decompress devkit_distribute.tar.gz to ${HOME}/.local finished." diff --git a/component/LkpTests/check_install_result.sh b/component/LkpTests/check_install_result.sh index fe2b163..cb5765d 100644 --- a/component/LkpTests/check_install_result.sh +++ b/component/LkpTests/check_install_result.sh @@ -1,8 +1,8 @@ #!/bin/bash lkp_path=$(which lkp) -if [[ "$?" == *"/bin/lkp"* ]]; then +if [[ "${lkp_path}" == *"/bin/lkp"* ]]; then echo "true" else - echo "flase" + echo "false" fi \ No newline at end of file diff --git a/component/LkpTests/install.sh b/component/LkpTests/install.sh index f6cb82e..bcd3ae1 100644 --- a/component/LkpTests/install.sh +++ b/component/LkpTests/install.sh @@ -20,14 +20,14 @@ function main() { for each in "${gems_name[@]}"; do gem install --local ${each} done - mkdir -p ${HOME}/.local/ - tar -zvxf ${lkp_tar} -C ${HOME}/.local/ - cd ${HOME}/.local/lkp-tests/ - chmod +x ${HOME}/.local/lkp-tests/bin/lkp + mkdir -p "${HOME}"/.local/ + tar -zxf ${lkp_tar} -C "${HOME}"/.local/ + cd "${HOME}"/.local/lkp-tests/ + chmod +x "${HOME}"/.local/lkp-tests/bin/lkp make - chmod 777 ${HOME}/.local/lkp-tests/programs/compatibility-test/run - ln -s ${HOME}/.local/lkp-tests/programs/compatibility-test/run ${HOME}/.local/lkp-tests/tests/compatibility-test + chmod 777 "${HOME}"/.local/lkp-tests/programs/compatibility-test/run + ln -s "${HOME}"/.local/lkp-tests/programs/compatibility-test/run "${HOME}"/.local/lkp-tests/tests/compatibility-test cat > /etc/profile.d/lkp.sh <<'EOF' LKP_PATH=${HOME}/.local/lkp-tests/ @@ -37,8 +37,8 @@ export LKP_PATH LKP_SRC PATH EOF source /etc/profile - cd ${HOME}/.local/lkp-tests/programs/compatibility-test/ - lkp split ${HOME}/.local/lkp-tests/programs/compatibility-test/jobs/compatibility-test.yaml + cd "${HOME}"/.local/lkp-tests/programs/compatibility-test/ + lkp split "${HOME}"/.local/lkp-tests/programs/compatibility-test/jobs/compatibility-test.yaml } main "$@" \ No newline at end of file diff --git a/component/LkpTests/lkp_help/compatibility-test/run b/component/LkpTests/lkp_help/compatibility-test/run index dcdc4d2..2b49a46 100644 --- a/component/LkpTests/lkp_help/compatibility-test/run +++ b/component/LkpTests/lkp_help/compatibility-test/run @@ -1,5 +1,5 @@ #!/bin/bash - +set -e ct_sh_path=${HOME}/.local/compatibility_testing/Chinese/compatibility_testing.sh cloud_jar=${HOME}/.local/compatibility_testing/cloudTest.jar diff --git a/component/OpenEulerMirrorISO/install.sh b/component/OpenEulerMirrorISO/install.sh index 3240bf7..4d9189c 100644 --- a/component/OpenEulerMirrorISO/install.sh +++ b/component/OpenEulerMirrorISO/install.sh @@ -5,11 +5,16 @@ function configure_local_mirror() { mkdir -p /devkitmirror mount ${iso_file_path} /devkitmirror -o loop if [[ -d /etc/yum.repos.d/yum.repos.backup ]]; then - mv -rf /etc/yum.repos.d/yum.repos.backup /etc/yum.repos.backup + mv -f /etc/yum.repos.d/yum.repos.backup /etc/yum.repos.backup else mkdir -p /etc/yum.repos.backup fi - mv -f /etc/yum.repos.d/* /etc/yum.repos.backup + + ls /etc/yum.repos.d/* + if [[ "$?" == "0" ]]; then + mv -f /etc/yum.repos.d/* /etc/yum.repos.backup + fi + mv -f /etc/yum.repos.backup /etc/yum.repos.d/ cat > /etc/yum.repos.d/local.repo <<'EOF' [local] diff --git "a/document/lkp-test\345\256\211\350\243\205\351\203\250\347\275\262/devkit\346\265\213\350\257\225\345\271\263\345\217\260\345\256\211\350\243\205\351\203\250\347\275\262\344\270\216gitlab\351\233\206\346\210\220\351\203\250\347\275\262\346\214\207\345\257\274\346\211\213\345\206\214.md" "b/document/lkp-test\345\256\211\350\243\205\351\203\250\347\275\262/devkit\346\265\213\350\257\225\345\271\263\345\217\260\345\256\211\350\243\205\351\203\250\347\275\262\344\270\216gitlab\351\233\206\346\210\220\351\203\250\347\275\262\346\214\207\345\257\274\346\211\213\345\206\214.md" index c5c8999..b0d2e3a 100644 --- "a/document/lkp-test\345\256\211\350\243\205\351\203\250\347\275\262/devkit\346\265\213\350\257\225\345\271\263\345\217\260\345\256\211\350\243\205\351\203\250\347\275\262\344\270\216gitlab\351\233\206\346\210\220\351\203\250\347\275\262\346\214\207\345\257\274\346\211\213\345\206\214.md" +++ "b/document/lkp-test\345\256\211\350\243\205\351\203\250\347\275\262/devkit\346\265\213\350\257\225\345\271\263\345\217\260\345\256\211\350\243\205\351\203\250\347\275\262\344\270\216gitlab\351\233\206\346\210\220\351\203\250\347\275\262\346\214\207\345\257\274\346\211\213\345\206\214.md" @@ -2,10 +2,6 @@ - - -[TOC] - ------ 测试平台使用的是lkp test 工具,以下均已lkp test描述测试平台 ## 一、lkp test 添加测试用例介绍 @@ -310,7 +306,7 @@ cd ${HOME}/.local/compatibility_testing/Chinese/ #jar_pid=$! #curl --location --request GET 'http://127.0.0.1:10037/api/v1/report?savePath=/'${HOME}'/.local/compatibility_testing/Chinese/log.json&file=/'${HOME}'/.local/compatibility_testing/Chinese/log.tar.gz' #kill -9 $jar_pid -cp -rf ${HOME}/.local/compatibility_testing/template.html.bak /${HOME}/.local/compatibility_testing/template.html +cp -rf ${HOME}/.local/compatibility_testing/template.html.bak ${HOME}/.local/compatibility_testing/template.html cd ${HOME}/.local/compatibility_testing/ python3 ${HOME}/.local/compatibility_testing/json2html.py diff --git "a/document/lkp-test\345\256\211\350\243\205\351\203\250\347\275\262/devkit\346\265\213\350\257\225\345\271\263\345\217\260\345\256\211\350\243\205\351\203\250\347\275\262\344\273\245\345\217\212\344\270\216jenkins\351\233\206\346\210\220\351\203\250\347\275\262\346\214\207\345\257\274\346\211\213\345\206\214.md" "b/document/lkp-test\345\256\211\350\243\205\351\203\250\347\275\262/devkit\346\265\213\350\257\225\345\271\263\345\217\260\345\256\211\350\243\205\351\203\250\347\275\262\344\270\216jenkins\351\233\206\346\210\220\351\203\250\347\275\262\346\214\207\345\257\274\346\211\213\345\206\214.md" similarity index 99% rename from "document/lkp-test\345\256\211\350\243\205\351\203\250\347\275\262/devkit\346\265\213\350\257\225\345\271\263\345\217\260\345\256\211\350\243\205\351\203\250\347\275\262\344\273\245\345\217\212\344\270\216jenkins\351\233\206\346\210\220\351\203\250\347\275\262\346\214\207\345\257\274\346\211\213\345\206\214.md" rename to "document/lkp-test\345\256\211\350\243\205\351\203\250\347\275\262/devkit\346\265\213\350\257\225\345\271\263\345\217\260\345\256\211\350\243\205\351\203\250\347\275\262\344\270\216jenkins\351\233\206\346\210\220\351\203\250\347\275\262\346\214\207\345\257\274\346\211\213\345\206\214.md" index 7b9cc96..6c36f4c 100644 --- "a/document/lkp-test\345\256\211\350\243\205\351\203\250\347\275\262/devkit\346\265\213\350\257\225\345\271\263\345\217\260\345\256\211\350\243\205\351\203\250\347\275\262\344\273\245\345\217\212\344\270\216jenkins\351\233\206\346\210\220\351\203\250\347\275\262\346\214\207\345\257\274\346\211\213\345\206\214.md" +++ "b/document/lkp-test\345\256\211\350\243\205\351\203\250\347\275\262/devkit\346\265\213\350\257\225\345\271\263\345\217\260\345\256\211\350\243\205\351\203\250\347\275\262\344\270\216jenkins\351\233\206\346\210\220\351\203\250\347\275\262\346\214\207\345\257\274\346\211\213\345\206\214.md" @@ -2,10 +2,6 @@ - - -[TOC] - ------ 测试平台使用的是lkp test 工具,以下均已lkp test描述测试平台 ## 一、lkp test 添加测试用例介绍 @@ -310,7 +306,7 @@ cd ${HOME}/.local/compatibility_testing/Chinese/ #jar_pid=$! #curl --location --request GET 'http://127.0.0.1:10037/api/v1/report?savePath=/'${HOME}'/.local/compatibility_testing/Chinese/log.json&file=/'${HOME}'/.local/compatibility_testing/Chinese/log.tar.gz' #kill -9 $jar_pid -cp -rf ${HOME}/.local/compatibility_testing/template.html.bak /${HOME}/.local/compatibility_testing/template.html +cp -rf ${HOME}/.local/compatibility_testing/template.html.bak ${HOME}/.local/compatibility_testing/template.html cd ${HOME}/.local/compatibility_testing/ python3 ${HOME}/.local/compatibility_testing/json2html.py @@ -381,7 +377,7 @@ stage('lkp test') { ### 6. lkp test报告内容(以云测工具(compatibility-test)为示例) ![源码迁移报告](./images/lkp-test报告内容.png) - + ---- ## 二、FAQ @@ -503,4 +499,3 @@ binary_file= ``` - diff --git "a/document/lkp-test\345\256\211\350\243\205\351\203\250\347\275\262/devkit\346\265\213\350\257\225\345\271\263\345\217\260\345\256\211\350\243\205\351\203\250\347\275\262\344\273\245\345\217\212\344\270\216jenkins\351\233\206\346\210\220\351\203\250\347\275\262\346\214\207\345\257\274\346\211\213\345\206\214.pdf" "b/document/lkp-test\345\256\211\350\243\205\351\203\250\347\275\262/devkit\346\265\213\350\257\225\345\271\263\345\217\260\345\256\211\350\243\205\351\203\250\347\275\262\344\270\216jenkins\351\233\206\346\210\220\351\203\250\347\275\262\346\214\207\345\257\274\346\211\213\345\206\214.pdf" similarity index 100% rename from "document/lkp-test\345\256\211\350\243\205\351\203\250\347\275\262/devkit\346\265\213\350\257\225\345\271\263\345\217\260\345\256\211\350\243\205\351\203\250\347\275\262\344\273\245\345\217\212\344\270\216jenkins\351\233\206\346\210\220\351\203\250\347\275\262\346\214\207\345\257\274\346\211\213\345\206\214.pdf" rename to "document/lkp-test\345\256\211\350\243\205\351\203\250\347\275\262/devkit\346\265\213\350\257\225\345\271\263\345\217\260\345\256\211\350\243\205\351\203\250\347\275\262\344\270\216jenkins\351\233\206\346\210\220\351\203\250\347\275\262\346\214\207\345\257\274\346\211\213\345\206\214.pdf" diff --git a/tools/download_dependency/compatibility_test_help/compatibility_test_help.sh b/tools/download_dependency/compatibility_test_help/compatibility_test_help.sh index 5e74c85..c69995f 100644 --- a/tools/download_dependency/compatibility_test_help/compatibility_test_help.sh +++ b/tools/download_dependency/compatibility_test_help/compatibility_test_help.sh @@ -7,7 +7,7 @@ function main() { save_path=$1 upload_path=$2 cd ${save_path} - tar -zvxf ${save_path}/compatibility_testing.tar.gz + tar -zxf ${save_path}/compatibility_testing.tar.gz rm -rf ${save_path}/compatibility_testing/Chinese/compatibility_testing.sh mv ${save_path}/compatibility_testing.sh ${save_path}/compatibility_testing/Chinese/compatibility_testing.sh mv ${save_path}/json2html.py ${save_path}/compatibility_testing/ diff --git a/tools/install_dependency/src/handler/install_package.py b/tools/install_dependency/src/handler/install_package.py index e0629a0..172224d 100644 --- a/tools/install_dependency/src/handler/install_package.py +++ b/tools/install_dependency/src/handler/install_package.py @@ -4,6 +4,7 @@ import multiprocessing import constant from handler.handler_and_node import Handler from machine.klass_dict import KLASS_DICT +from utils import available_role LOGGER = logging.getLogger("install_dependency") @@ -30,7 +31,7 @@ class InstallPackage(Handler): ip_set = set() jobs = [] - for role in ({constant.EXECUTOR, constant.DEVKIT} & set(data.keys())): + for role in available_role([constant.EXECUTOR, constant.DEVKIT], data): machine_dict = data[role + constant.MACHINE] LOGGER.debug(f"{role} machine list to deploy iso: {list(machine_dict.keys())}") for machine_ip in machine_dict: @@ -57,7 +58,7 @@ class InstallPackage(Handler): ip_set = set() jobs = [] - for role in (set(KLASS_DICT.keys()) & set(data.keys())): + for role in available_role(KLASS_DICT, data): machine_dict = data[role + constant.MACHINE] LOGGER.debug(f"{role} machine list: {list(machine_dict.keys())}") for machine_ip in machine_dict: @@ -88,7 +89,7 @@ class InstallPackage(Handler): ip_set = set() jobs = [] - for role in ({constant.EXECUTOR, constant.DEVKIT} & set(data.keys())): + for role in available_role([constant.EXECUTOR, constant.DEVKIT], data): machine_dict = data[role + constant.MACHINE] LOGGER.debug(f"{role} machine list to un-deploy iso: {list(machine_dict.keys())}") for machine_ip in machine_dict: diff --git a/tools/install_dependency/src/utils.py b/tools/install_dependency/src/utils.py index 848aa9e..71278dc 100644 --- a/tools/install_dependency/src/utils.py +++ b/tools/install_dependency/src/utils.py @@ -22,3 +22,11 @@ def base_path(path): else: base_dir = os.path.dirname(__file__) return os.path.join(base_dir, path) + + +def available_role(role_list, data): + list_after_verification = [] + for role in role_list: + if role in data: + list_after_verification.append(role) + return list_after_verification -- Gitee