diff --git a/suite2cases/function_test/pkg_test/criu/criu.json b/suite2cases/function_test/pkg_test/criu/criu.json index 89bd429a68f..c20f0ac0120 100644 --- a/suite2cases/function_test/pkg_test/criu/criu.json +++ b/suite2cases/function_test/pkg_test/criu/criu.json @@ -26,14 +26,6 @@ { "name": "test_criu_function_uninstall", "desc": "测试criu的卸载功能,验证是否能够成功卸载软件包。" - }, - { - "name": "test_criu_function_restore", - "desc": "测试criu的核心恢复功能,验证是否能从转储文件恢复进程。" - }, - { - "name": "test_criu_function_checkpoint", - "desc": "测试criu的检查点功能(结合dump与restore)。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/eclipse/eclipse-jdt.json b/suite2cases/function_test/pkg_test/eclipse/eclipse-jdt.json index 17a6c793f61..bbc5a04f156 100644 --- a/suite2cases/function_test/pkg_test/eclipse/eclipse-jdt.json +++ b/suite2cases/function_test/pkg_test/eclipse/eclipse-jdt.json @@ -7,11 +7,6 @@ "desc": "测试eclipse-jdt软件包的升级功能", "machine num": 1 }, - { - "name": "test_eclipse-jdt_rollback", - "desc": "测试eclipse-jdt软件包的升级回滚功能", - "machine num": 1 - }, { "name": "test_eclipse-jdt_function_compile", "desc": "测试eclipse-jdt软件包的编译功能" diff --git a/suite2cases/function_test/pkg_test/gcc/liblsan-static.json b/suite2cases/function_test/pkg_test/gcc/liblsan-static.json index 8ccddfcb65c..c6c99a57c4c 100644 --- a/suite2cases/function_test/pkg_test/gcc/liblsan-static.json +++ b/suite2cases/function_test/pkg_test/gcc/liblsan-static.json @@ -14,10 +14,6 @@ "name": "test_liblsan-static_uninstall", "desc": "测试通过包管理器卸载liblsan-static软件包" }, - { - "name": "test_liblsan-static_usage", - "desc": "测试使用liblsan-static库进行静态链接以检测内存错误" - }, { "name": "test_liblsan-static_function_install", "desc": "验证通过系统包管理器能够成功安装liblsan-static软件包" @@ -25,22 +21,6 @@ { "name": "test_liblsan-static_function_uninstall", "desc": "验证通过系统包管理器能够成功卸载liblsan-static软件包" - }, - { - "name": "test_liblsan-static_function_static_link", - "desc": "验证liblsan-static库能够正确用于程序的静态链接" - }, - { - "name": "test_liblsan-static_function_leak_detection", - "desc": "验证使用liblsan-static链接的程序能检测内存泄漏" - }, - { - "name": "test_liblsan-static_function_version", - "desc": "验证liblsan-static库的版本信息" - }, - { - "name": "test_liblsan-static_function_header", - "desc": "验证liblsan-static所需的头文件存在且可用" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/harfbuzz/harfbuzz-help.json b/suite2cases/function_test/pkg_test/harfbuzz/harfbuzz-help.json index c8ba30cd89f..19aede152c4 100644 --- a/suite2cases/function_test/pkg_test/harfbuzz/harfbuzz-help.json +++ b/suite2cases/function_test/pkg_test/harfbuzz/harfbuzz-help.json @@ -10,10 +10,6 @@ "name": "test_harfbuzz-help_function_installed", "desc": "测试harfbuzz-help软件包在安装后是否存在于系统已安装软件包列表中。" }, - { - "name": "test_harfbuzz-help_function_help_output", - "desc": "测试执行harfbuzz-help命令是否能正常输出帮助信息(如用法、选项等)。" - }, { "name": "test_harfbuzz-help_function_uninstall", "desc": "测试harfbuzz-help软件包是否可以通过默认包管理器成功卸载,且卸载后相关文件被移除。" diff --git a/suite2cases/function_test/pkg_test/jffi/jffi-javadoc.json b/suite2cases/function_test/pkg_test/jffi/jffi-javadoc.json deleted file mode 100644 index 480c3f34877..00000000000 --- a/suite2cases/function_test/pkg_test/jffi/jffi-javadoc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/jffi/jffi-javadoc", - "machine num": 1, - "cases": [ - { - "name": "test_jffi-javadoc_function_docgen", - "desc": "Verify Javadoc generation for jffi-javadoc" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/mesa/mesa-filesystem.json b/suite2cases/function_test/pkg_test/mesa/mesa-filesystem.json index 1d29c9547ea..c80584c7497 100644 --- a/suite2cases/function_test/pkg_test/mesa/mesa-filesystem.json +++ b/suite2cases/function_test/pkg_test/mesa/mesa-filesystem.json @@ -17,22 +17,6 @@ { "name": "test_mesa-filesystem_function_presence", "desc": "测试mesa-filesystem软件包是否已作为系统基础依赖库存在于系统中。" - }, - { - "name": "test_mesa-filesystem_function_version", - "desc": "测试验证mesa-filesystem软件包的版本信息是否符合预期。" - }, - { - "name": "test_mesa-filesystem_function_provides", - "desc": "测试mesa-filesystem软件包提供的核心库文件(如libGL.so)是否存在于标准路径。" - }, - { - "name": "test_mesa-filesystem_function_conflict", - "desc": "测试mesa-filesystem软件包与冲突包(如闭源驱动包)的安装互斥性。" - }, - { - "name": "test_mesa-filesystem_function_dependency", - "desc": "测试mesa-filesystem软件包被其他图形应用正确识别和依赖。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/polyglot/tesla-polyglot-translate-plugin.json b/suite2cases/function_test/pkg_test/polyglot/tesla-polyglot-translate-plugin.json deleted file mode 100644 index 006c086e02a..00000000000 --- a/suite2cases/function_test/pkg_test/polyglot/tesla-polyglot-translate-plugin.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/polyglot/tesla-polyglot-translate-plugin", - "machine num": 1, - "cases": [ - { - "name": "test_tesla-polyglot-translate-plugin_function_init", - "desc": "Test plugin initialization" - }, - { - "name": "test_tesla-polyglot-translate-plugin_function_translate", - "desc": "Test translation functionality" - }, - { - "name": "test_tesla-polyglot-translate-plugin_function_config", - "desc": "Test config loading" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-google-auth/python-google-auth-help.json b/suite2cases/function_test/pkg_test/python-google-auth/python-google-auth-help.json index 342324bff9e..a5d5961cdf1 100644 --- a/suite2cases/function_test/pkg_test/python-google-auth/python-google-auth-help.json +++ b/suite2cases/function_test/pkg_test/python-google-auth/python-google-auth-help.json @@ -6,50 +6,6 @@ "name": "test_python-google-auth-help_install", "desc": "测试python-google-auth-help软件包的安装功能", "machine num": 1 - }, - { - "name": "test_python-google-auth-help_function_auth", - "desc": "测试python-google-auth-help软件包的认证功能" - }, - { - "name": "test_python-google-auth-help_function_token", - "desc": "测试python-google-auth-help软件包的令牌功能" - }, - { - "name": "test_python-google-auth-help_function_http", - "desc": "测试python-google-auth-help软件包的HTTP请求功能" - }, - { - "name": "test_python-google-auth-help_function_credentials", - "desc": "测试默认凭据获取" - }, - { - "name": "test_python-google-auth-help_function_scoped_auth", - "desc": "测试带作用域认证" - }, - { - "name": "test_python-google-auth-help_function_refresh", - "desc": "测试访问令牌刷新" - }, - { - "name": "test_python-google-auth-help_function_service_acct", - "desc": "测试服务账号凭据" - }, - { - "name": "test_python-google-auth-help_function_http_auth", - "desc": "测试HTTP请求授权" - }, - { - "name": "test_python-google-auth-help_function_id_token", - "desc": "测试ID令牌获取" - }, - { - "name": "test_python-google-auth-help_function_user_auth", - "desc": "测试用户交互认证" - }, - { - "name": "test_python-google-auth-help_function_uninstall", - "desc": "测试软件包卸载" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/rpm/python3-rpm.json b/suite2cases/function_test/pkg_test/rpm/python3-rpm.json index 447ec7057ae..2561440734e 100644 --- a/suite2cases/function_test/pkg_test/rpm/python3-rpm.json +++ b/suite2cases/function_test/pkg_test/rpm/python3-rpm.json @@ -5,22 +5,6 @@ { "name": "test_python3-rpm_function_verify_package", "desc": "测试验证已安装 RPM 包文件完整性的功能。" - }, - { - "name": "test_python3-rpm_function_import_module", - "desc": "测试能否成功导入python3-rpm模块。" - }, - { - "name": "test_python3-rpm_function_check_install", - "desc": "测试验证python3-rpm软件包是否已正确安装。" - }, - { - "name": "test_python3-rpm_function_read_header", - "desc": "测试使用rpm模块读取已安装RPM包的头信息。" - }, - { - "name": "test_python3-rpm_function_query_package", - "desc": "测试查询系统已安装的指定RPM包信息。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc.json b/suite2cases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc.json index 783178d0d9e..090cbcbc316 100644 --- a/suite2cases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc.json +++ b/suite2cases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc.json @@ -2,10 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc", "machine num": 1, "cases": [ - { - "name": "test_rubygem-gem2rpm-doc_function_docgen", - "desc": "Test documentation generation functionality" - }, { "name": "test_rubygem-gem2rpm-doc_function_install", "desc": "Test package installation" @@ -13,18 +9,6 @@ { "name": "test_rubygem-gem2rpm-doc_function_uninstall", "desc": "Test package removal" - }, - { - "name": "test_rubygem-gem2rpm-doc_function_help", - "desc": "Test help command output" - }, - { - "name": "test_rubygem-gem2rpm-doc_function_version", - "desc": "Test version command output" - }, - { - "name": "test_rubygem-gem2rpm-doc_function_basic_convert", - "desc": "Test basic gem to spec conversion" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc.json b/suite2cases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc.json index 6e700a44847..9865ebdb692 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc.json @@ -9,18 +9,6 @@ { "name": "test_texlive-footmisc-doc_function_check_installed", "desc": "Check if the package is installed on the system" - }, - { - "name": "test_texlive-footmisc-doc_function_verify_files", - "desc": "Verify the existence of key documentation files" - }, - { - "name": "test_texlive-footmisc-doc_function_use_manpage", - "desc": "Test accessing the package man page" - }, - { - "name": "test_texlive-footmisc-doc_function_use_info", - "desc": "Test accessing the package info documentation" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-p/texlive-nkarta.json b/suite2cases/function_test/pkg_test/texlive-split-p/texlive-nkarta.json index ed125001535..e961f2adbc7 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-p/texlive-nkarta.json +++ b/suite2cases/function_test/pkg_test/texlive-split-p/texlive-nkarta.json @@ -5,10 +5,6 @@ { "name": "test_texlive-nkarta_function_uninstall", "desc": "Test package uninstallation" - }, - { - "name": "test_texlive-nkarta_function_basic", - "desc": "Test basic functionality" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-wordlike-doc.json b/suite2cases/function_test/pkg_test/texlive-split-y/texlive-wordlike-doc.json deleted file mode 100644 index f7abc927548..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-wordlike-doc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-y/texlive-wordlike-doc", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-wordlike-doc_function_install", - "desc": "Test installation of texlive-wordlike-doc" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/criu/criu/test_criu_function_checkpoint.sh b/testcases/function_test/pkg_test/criu/criu/test_criu_function_checkpoint.sh deleted file mode 100644 index 874a554b200..00000000000 --- a/testcases/function_test/pkg_test/criu/criu/test_criu_function_checkpoint.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-04 -# @License : Mulan PSL v2 -# @Desc : 测试criu的检查点功能(结合dump与restore)。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试criu的检查点功能(结合dump与restore)" - - LOG_INFO "步骤1:检查criu软件包是否在yum源中" - if ! dnf list available criu 2>&1 | grep -q "criu"; then - LOG_ERROR "yum源中未找到criu软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查当前环境是否已安装criu" - if command -v criu &> /dev/null; then - LOG_INFO "criu已安装,标记为环境已存在安装" - ENV_INSTALLED="true" - else - LOG_INFO "criu未安装,标记为需要安装" - ENV_INSTALLED="false" - fi - - if [ "$ENV_INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装criu软件包" - dnf install -y criu - CHECK_RESULT $? 0 0 "安装criu失败" - fi - - LOG_INFO "步骤4:检查criu命令是否支持dump和restore参数" - criu check --feature dump - CHECK_RESULT $? 0 0 "criu不支持dump功能" - criu check --feature restore - CHECK_RESULT $? 0 0 "criu不支持restore功能" - - LOG_INFO "步骤5:创建一个简单的测试进程用于检查点操作" - TEST_PROG="/tmp/test_criu_prog" - cat > $TEST_PROG << "EOF" - - while true; do - echo "Test process is running..." - sleep 5 - done - EOF - chmod +x $TEST_PROG - bash $TEST_PROG & - TEST_PID=$! - sleep 2 - LOG_INFO "测试进程PID: $TEST_PID" - - LOG_INFO "步骤6:使用criu dump创建检查点" - mkdir -p /tmp/criu_dump - criu dump -t $TEST_PID -D /tmp/criu_dump --shell-job - CHECK_RESULT $? 0 0 "criu dump失败" - - LOG_INFO "步骤7:停止原始测试进程" - kill -9 $TEST_PID 2>/dev/null || true - wait $TEST_PID 2>/dev/null - - LOG_INFO "步骤8:使用criu restore从检查点恢复进程" - criu restore -D /tmp/criu_dump --shell-job & - RESTORE_PID=$! - sleep 2 - CHECK_RESULT $? 0 0 "criu restore失败" - - LOG_INFO "步骤9:验证恢复的进程是否在运行" - if ps -p $RESTORE_PID > /dev/null; then - LOG_INFO "进程恢复成功,PID: $RESTORE_PID" - else - LOG_ERROR "进程恢复失败" - exit 1 - fi - - LOG_INFO "步骤10:清理测试进程" - kill -9 $RESTORE_PID 2>/dev/null || true - wait $RESTORE_PID 2>/dev/null - - LOG_INFO "步骤11:清理检查点文件" - rm -rf /tmp/criu_dump $TEST_PROG - - if [ "$ENV_INSTALLED" = "false" ]; then - LOG_INFO "步骤12:卸载测试安装的criu软件包" - dnf remove -y criu - CHECK_RESULT $? 0 0 "卸载criu失败" - else - LOG_INFO "步骤12:环境中原已安装criu,保持安装状态" - fi - - LOG_INFO "criu检查点功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/criu/criu/test_criu_function_restore.sh b/testcases/function_test/pkg_test/criu/criu/test_criu_function_restore.sh deleted file mode 100644 index b1fc028d3c7..00000000000 --- a/testcases/function_test/pkg_test/criu/criu/test_criu_function_restore.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-04 -# @License : Mulan PSL v2 -# @Desc : 测试criu的核心恢复功能,验证是否能从转储文件恢复进程。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试criu的核心恢复功能,验证是否能从转储文件恢复进程" - - # 检查是否已安装criu - LOG_INFO "检查criu是否已安装" - if dnf list installed criu &> /dev/null; then - LOG_INFO "criu已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "criu未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查yum源中是否有criu软件包 - LOG_INFO "检查yum源中是否有criu软件包" - if ! dnf list available criu &> /dev/null; then - LOG_ERROR "yum源中未找到criu软件包" - exit 255 - fi - - # 如果未安装,则安装criu - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装criu软件包" - dnf install -y criu - CHECK_RESULT $? 0 0 "安装criu失败" - fi - - # 检查criu命令是否支持dump和restore参数 - LOG_INFO "检查criu命令是否支持dump和restore参数" - criu dump --help 2>&1 | grep -q "dump" || { - LOG_ERROR "criu命令不支持dump参数" - exit 255 - } - criu restore --help 2>&1 | grep -q "restore" || { - LOG_ERROR "criu命令不支持restore参数" - exit 255 - } - - # 创建测试进程 - LOG_INFO "创建测试进程" - sleep 1000 & - TEST_PID=$! - - # 创建转储目录 - LOG_INFO "创建转储目录" - DUMP_DIR=$(mktemp -d) - - # 使用criu dump转储进程 - LOG_INFO "使用criu dump转储进程" - criu dump -t $TEST_PID -D $DUMP_DIR --shell-job - CHECK_RESULT $? 0 0 "criu dump转储进程失败" - - # 等待进程被挂起 - sleep 2 - - # 使用criu restore恢复进程 - LOG_INFO "使用criu restore恢复进程" - criu restore -D $DUMP_DIR --shell-job - CHECK_RESULT $? 0 0 "criu restore恢复进程失败" - - # 检查恢复后的进程是否在运行 - LOG_INFO "检查恢复后的进程是否在运行" - sleep 2 - if ps -p $TEST_PID > /dev/null; then - LOG_INFO "进程恢复成功,进程ID: $TEST_PID" - else - LOG_ERROR "进程恢复失败" - kill $TEST_PID 2>/dev/null - CHECK_RESULT 1 0 0 "进程恢复失败" - fi - - # 清理测试进程 - LOG_INFO "清理测试进程" - kill $TEST_PID 2>/dev/null - - # 清理转储目录 - LOG_INFO "清理转储目录" - rm -rf $DUMP_DIR - - # 如果测试前未安装criu,则卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载criu软件包" - dnf remove -y criu - CHECK_RESULT $? 0 0 "卸载criu失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/eclipse/eclipse-jdt/test_eclipse-jdt_rollback.sh b/testcases/function_test/pkg_test/eclipse/eclipse-jdt/test_eclipse-jdt_rollback.sh deleted file mode 100644 index 4e6e95cd38b..00000000000 --- a/testcases/function_test/pkg_test/eclipse/eclipse-jdt/test_eclipse-jdt_rollback.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-06-20 -# @License : Mulan PSL v2 -# @Desc : 测试eclipse-jdt软件包的升级回滚功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试eclipse-jdt软件包的升级回滚功能" - - # 检查是否已安装eclipse-jdt - LOG_INFO "检查是否已安装eclipse-jdt" - dnf list installed eclipse-jdt > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "eclipse-jdt已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "eclipse-jdt未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有eclipse-jdt软件包 - LOG_INFO "检查yum源中是否有eclipse-jdt软件包" - dnf list available eclipse-jdt > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中没有eclipse-jdt软件包" - - # 安装eclipse-jdt软件包 - LOG_INFO "安装eclipse-jdt软件包" - dnf install -y eclipse-jdt - CHECK_RESULT $? 0 0 "安装eclipse-jdt失败" - - # 测试升级回滚功能 - LOG_INFO "测试升级回滚功能" - dnf history | grep eclipse-jdt > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "执行回滚操作" - dnf history undo last -y - CHECK_RESULT $? 0 0 "回滚操作失败" - else - LOG_ERROR "未找到eclipse-jdt的安装记录,无法回滚" - exit 255 - fi - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载eclipse-jdt软件包" - dnf remove -y eclipse-jdt - CHECK_RESULT $? 0 0 "卸载eclipse-jdt失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gcc/liblsan-static/test_liblsan-static_function_header.sh b/testcases/function_test/pkg_test/gcc/liblsan-static/test_liblsan-static_function_header.sh deleted file mode 100644 index 2e8723d8bcf..00000000000 --- a/testcases/function_test/pkg_test/gcc/liblsan-static/test_liblsan-static_function_header.sh +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 验证liblsan-static所需的头文件存在且可用 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="liblsan-static" - - # 步骤注释:检查软件包是否在yum源中 - LOG_INFO "检查软件包 ${PACKAGE_NAME} 是否在yum源中可用" - dnf search ${PACKAGE_NAME} --quiet - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 在yum源中不存在" - exit 255 - fi - - # 步骤注释:检查是否已安装软件包 - LOG_INFO "检查是否已安装软件包 ${PACKAGE_NAME}" - rpm -q ${PACKAGE_NAME} - if [ $? -eq 0 ]; then - INSTALLED="true" - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,脚本结束后将保持安装状态" - else - INSTALLED="false" - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,脚本将进行安装和卸载测试" - fi - - # 如果未安装,则安装软件包 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - fi - - # 步骤注释:验证liblsan-static所需的头文件存在且可用 - LOG_INFO "验证liblsan-static所需的头文件存在且可用" - # 查找liblsan-static头文件路径 - HEADER_PATH=$(rpm -ql ${PACKAGE_NAME} | grep -E "\.h$" | head -1) - if [ -z "${HEADER_PATH}" ]; then - LOG_ERROR "未找到liblsan-static的头文件" - exit 255 - fi - - # 检查头文件是否存在 - LOG_INFO "检查头文件 ${HEADER_PATH} 是否存在" - ls -l ${HEADER_PATH} - CHECK_RESULT $? 0 0 "头文件 ${HEADER_PATH} 不存在" - - # 检查头文件是否可读 - LOG_INFO "检查头文件 ${HEADER_PATH} 是否可读" - test -r ${HEADER_PATH} - CHECK_RESULT $? 0 0 "头文件 ${HEADER_PATH} 不可读" - - # 步骤注释:验证头文件内容可用性(编译一个简单程序测试) - LOG_INFO "验证头文件内容可用性(编译测试程序)" - TEST_PROGRAM=$(mktemp /tmp/test_liblsan-static_XXXXXX.c) - cat > ${TEST_PROGRAM} << "EOF" - #include - #include - int main() { - __lsan_print_stacks(); - return 0; - } - EOF - - # 编译测试程序 - gcc -o /tmp/test_liblsan-static_program ${TEST_PROGRAM} -llsan -static - COMPILE_RESULT=$? - rm -f ${TEST_PROGRAM} - CHECK_RESULT ${COMPILE_RESULT} 0 0 "编译测试程序失败,头文件不可用" - - # 步骤注释:清理测试程序 - rm -f /tmp/test_liblsan-static_program - - # 环境恢复:如果脚本开始时未安装,则卸载软件包 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "卸载软件包 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - else - LOG_INFO "保持软件包 ${PACKAGE_NAME} 的安装状态" - fi - - LOG_INFO "测试完成,环境已恢复到初始状态" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gcc/liblsan-static/test_liblsan-static_function_leak_detection.sh b/testcases/function_test/pkg_test/gcc/liblsan-static/test_liblsan-static_function_leak_detection.sh deleted file mode 100644 index d7ddb257e43..00000000000 --- a/testcases/function_test/pkg_test/gcc/liblsan-static/test_liblsan-static_function_leak_detection.sh +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 验证使用liblsan-static链接的程序能检测内存泄漏 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $1" - } - - LOG_ERROR() { - echo "[ERROR] $1" - } - - # 定义检查函数 - CHECK_RESULT() { - if [ $1 -ne $2 ]; then - LOG_ERROR "$4" - exit $3 - fi - } - - # 定义远程执行函数 - SSH_CMD() { - sshpass -p "$3" ssh -o StrictHostKeyChecking=no "$4"@"$2" "$1" - } - - # 主测试函数 - main() { - LOG_INFO "开始测试:验证使用liblsan-static链接的程序能检测内存泄漏" - - # 检查是否已安装liblsan-static - LOG_INFO "检查liblsan-static是否已安装" - if dnf list installed liblsan-static &>/dev/null; then - LOG_INFO "liblsan-static已安装,测试结束后保持安装状态" - already_installed=true - else - LOG_INFO "liblsan-static未安装,将在测试过程中安装" - already_installed=false - fi - - # 检查yum源中是否有liblsan-static软件包 - LOG_INFO "检查yum源中是否有liblsan-static软件包" - dnf search liblsan-static &>/dev/null - CHECK_RESULT $? 0 255 "yum源中没有liblsan-static软件包" - - # 如果未安装,则安装liblsan-static - if ! $already_installed; then - LOG_INFO "安装liblsan-static" - dnf install -y liblsan-static - CHECK_RESULT $? 0 0 "安装liblsan-static失败" - fi - - # 创建一个简单的C程序来测试内存泄漏检测 - LOG_INFO "创建一个简单的C程序来测试内存泄漏检测" - cat > test_memory_leak.c << "EOF" - #include - #include - - void leak_memory() { - int *ptr = (int*)malloc(sizeof(int) * 10); - if (ptr == NULL) { - printf("Memory allocation failed\n"); - return; - } - // 内存泄漏:没有释放分配的内存 - } - - int main() { - leak_memory(); - printf("Memory leak test program completed\n"); - return 0; - } - EOF - - # 编译程序并使用liblsan-static链接 - LOG_INFO "编译测试程序并使用liblsan-static链接" - gcc -o test_memory_leak test_memory_leak.c -static -llsan -fsanitize=leak - CHECK_RESULT $? 0 0 "编译测试程序失败" - - # 运行程序并检查是否检测到内存泄漏 - LOG_INFO "运行测试程序并检查内存泄漏检测" - output=$(./test_memory_leak 2>&1) - echo "$output" | grep -q "detected memory leaks" - CHECK_RESULT $? 0 0 "liblsan-static未检测到内存泄漏" - - # 清理测试程序 - LOG_INFO "清理测试程序" - rm -f test_memory_leak test_memory_leak.c - - # 如果测试开始时未安装liblsan-static,则在测试结束后卸载 - if ! $already_installed; then - LOG_INFO "卸载liblsan-static" - dnf remove -y liblsan-static - CHECK_RESULT $? 0 0 "卸载liblsan-static失败" - fi - - LOG_INFO "测试完成:验证使用liblsan-static链接的程序能检测内存泄漏" - } - - # 执行主测试函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gcc/liblsan-static/test_liblsan-static_function_static_link.sh b/testcases/function_test/pkg_test/gcc/liblsan-static/test_liblsan-static_function_static_link.sh deleted file mode 100644 index 114e6ccec55..00000000000 --- a/testcases/function_test/pkg_test/gcc/liblsan-static/test_liblsan-static_function_static_link.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 验证liblsan-static库能够正确用于程序的静态链接 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:验证liblsan-static库能够正确用于程序的静态链接" - - # 检查是否已安装liblsan-static - LOG_INFO "检查liblsan-static是否已安装" - rpm -q liblsan-static - if [ $? -eq 0 ]; then - LOG_INFO "liblsan-static已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "liblsan-static未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有liblsan-static - LOG_INFO "检查yum源中是否有liblsan-static" - dnf list available liblsan-static - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到liblsan-static软件包" - exit 255 - fi - - # 如果未安装,则安装liblsan-static - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装liblsan-static" - dnf install -y liblsan-static - CHECK_RESULT $? 0 0 "安装liblsan-static失败" - fi - - # 创建一个简单的C程序用于测试静态链接 - LOG_INFO "创建测试C程序" - cat > test_lsan.c << "EOF" - #include - int main() { - char *ptr = malloc(10); - // 这里故意不释放内存,用于lsan检测 - // free(ptr); - return 0; - } - EOF - - # 使用liblsan-static静态链接编译程序 - LOG_INFO "使用liblsan-static静态链接编译测试程序" - gcc -static -fsanitize=leak test_lsan.c -o test_lsan_program - CHECK_RESULT $? 0 0 "使用liblsan-static静态链接编译失败" - - # 运行编译的程序,检查是否正常执行 - LOG_INFO "运行编译的测试程序" - ./test_lsan_program - CHECK_RESULT $? 0 0 "运行测试程序失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_lsan.c test_lsan_program - - # 如果测试前未安装,则卸载liblsan-static - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载liblsan-static" - dnf remove -y liblsan-static - CHECK_RESULT $? 0 0 "卸载liblsan-static失败" - fi - - LOG_INFO "测试完成:liblsan-static库能够正确用于程序的静态链接" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gcc/liblsan-static/test_liblsan-static_function_version.sh b/testcases/function_test/pkg_test/gcc/liblsan-static/test_liblsan-static_function_version.sh deleted file mode 100644 index 78218e9c9fe..00000000000 --- a/testcases/function_test/pkg_test/gcc/liblsan-static/test_liblsan-static_function_version.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-28 -# @License : Mulan PSL v2 -# @Desc : 验证liblsan-static库的版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装了liblsan-static软件包 - LOG_INFO "检查liblsan-static软件包是否已安装" - rpm -q liblsan-static > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "liblsan-static软件包已安装,脚本结束时将保持安装状态" - already_installed=1 - else - LOG_INFO "liblsan-static软件包未安装,将在测试步骤中安装" - already_installed=0 - fi - - # 检查yum源中是否有liblsan-static软件包 - LOG_INFO "检查yum源中是否存在liblsan-static软件包" - dnf list available liblsan-static > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到liblsan-static软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装liblsan-static软件包" - dnf install -y liblsan-static - CHECK_RESULT $? 0 0 "安装liblsan-static软件包失败" - fi - - # 测试liblsan-static库的版本信息 - LOG_INFO "验证liblsan-static库的版本信息" - rpm -qi liblsan-static | grep -E "^Version|^Release" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "获取liblsan-static软件包版本信息失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载liblsan-static软件包" - dnf remove -y liblsan-static - CHECK_RESULT $? 0 0 "卸载liblsan-static软件包失败" - else - LOG_INFO "脚本开始时liblsan-static已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gcc/liblsan-static/test_liblsan-static_usage.sh b/testcases/function_test/pkg_test/gcc/liblsan-static/test_liblsan-static_usage.sh deleted file mode 100644 index b7ddd232083..00000000000 --- a/testcases/function_test/pkg_test/gcc/liblsan-static/test_liblsan-static_usage.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-27 -# @License : Mulan PSL v2 -# @Desc : 测试使用liblsan-static库进行静态链接以检测内存错误 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用liblsan-static库进行静态链接以检测内存错误" - - # 检查是否已经安装liblsan-static软件包 - LOG_INFO "检查是否已安装liblsan-static软件包" - dnf list installed liblsan-static &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "liblsan-static软件包已安装" - already_installed=1 - else - LOG_INFO "liblsan-static软件包未安装" - already_installed=0 - fi - - # 检查yum源中是否有liblsan-static软件包 - LOG_INFO "检查yum源中是否有liblsan-static软件包" - dnf list available liblsan-static &> /dev/null - CHECK_RESULT $? 0 255 "yum源中没有liblsan-static软件包" - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装liblsan-static软件包" - dnf install -y liblsan-static - CHECK_RESULT $? 0 0 "安装liblsan-static软件包失败" - fi - - # 创建一个简单的C程序用于测试 - LOG_INFO "创建一个简单的C程序用于测试" - cat > test_lsan.c << "EOF" - #include - int main() { - int *ptr = malloc(10 * sizeof(int)); - // 故意不释放内存,模拟内存泄漏 - return 0; - } - EOF - CHECK_RESULT $? 0 0 "创建测试C程序失败" - - # 使用liblsan-static静态链接编译程序 - LOG_INFO "使用liblsan-static静态链接编译程序" - gcc -static -fsanitize=leak test_lsan.c -o test_lsan_program - CHECK_RESULT $? 0 0 "使用liblsan-static静态链接编译失败" - - # 运行程序并检查内存泄漏检测 - LOG_INFO "运行程序并检查内存泄漏检测" - output=$(./test_lsan_program 2>&1) - echo "$output" | grep -q "detected memory leaks" - CHECK_RESULT $? 0 0 "内存泄漏检测未触发" - - # 清理测试程序 - LOG_INFO "清理测试程序" - rm -f test_lsan.c test_lsan_program - CHECK_RESULT $? 0 0 "清理测试程序失败" - - # 如果之前未安装,则在测试结束后卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载liblsan-static软件包" - dnf remove -y liblsan-static - CHECK_RESULT $? 0 0 "卸载liblsan-static软件包失败" - fi - - LOG_INFO "测试完成:使用liblsan-static库进行静态链接以检测内存错误" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/harfbuzz/harfbuzz-help/test_harfbuzz-help_function_help_output.sh b/testcases/function_test/pkg_test/harfbuzz/harfbuzz-help/test_harfbuzz-help_function_help_output.sh deleted file mode 100644 index 1df65e130f9..00000000000 --- a/testcases/function_test/pkg_test/harfbuzz/harfbuzz-help/test_harfbuzz-help_function_help_output.sh +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : 测试执行harfbuzz-help命令是否能正常输出帮助信息(如用法、选项等)。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色输出函数 - RED="\033[0;31m" - GREEN="\033[0;32m" - NC="\033[0m" # No Color - - # 定义日志函数 - LOG_INFO() { - echo -e "${GREEN}[INFO]${NC} $1" - } - - LOG_ERROR() { - echo -e "${RED}[ERROR]${NC} $1" - } - - # 定义检查函数 - CHECK_RESULT() { - local actual=$1 - local expected=$2 - local exit_code=$3 - local error_msg=$4 - - if [ $actual -ne $expected ]; then - LOG_ERROR "$error_msg" - exit $exit_code - fi - } - - # 定义SSH_CMD函数 - SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=$4 - - sshpass -p "$password" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "$user@$ip" "$cmd" - } - - # 定义清理函数 - cleanup() { - LOG_INFO "开始清理环境..." - if [ $installed -eq 1 ]; then - LOG_INFO "卸载harfbuzz软件包..." - dnf remove -y harfbuzz - CHECK_RESULT $? 0 255 "卸载harfbuzz软件包失败" - LOG_INFO "harfbuzz软件包卸载成功" - fi - LOG_INFO "环境清理完成" - } - - # 设置脚本退出时执行清理函数 - trap cleanup EXIT - - # 初始化变量 - installed=0 - PACKAGE_NAME="harfbuzz" - - # 步骤1: 检查harfbuzz软件包是否已安装 - LOG_INFO "步骤1: 检查harfbuzz软件包是否已安装" - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "harfbuzz软件包已安装" - installed=1 - else - LOG_INFO "harfbuzz软件包未安装" - fi - - # 步骤2: 检查yum源中是否有harfbuzz软件包 - LOG_INFO "步骤2: 检查yum源中是否有harfbuzz软件包" - dnf list available $PACKAGE_NAME &>/dev/null - CHECK_RESULT $? 0 255 "yum源中没有harfbuzz软件包" - - # 步骤3: 如果未安装,则安装harfbuzz软件包 - if [ $installed -eq 0 ]; then - LOG_INFO "步骤3: 安装harfbuzz软件包" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 1 "安装harfbuzz软件包失败" - LOG_INFO "harfbuzz软件包安装成功" - installed=1 - fi - - # 步骤4: 测试harfbuzz-help命令是否能正常输出帮助信息 - LOG_INFO "步骤4: 测试harfbuzz-help命令是否能正常输出帮助信息" - # 检查harfbuzz-help命令是否存在 - if ! command -v harfbuzz-help &>/dev/null; then - LOG_ERROR "harfbuzz-help命令不存在或不支持" - exit 255 - fi - - # 执行harfbuzz-help命令并检查输出 - output=$(harfbuzz-help 2>&1) - exit_code=$? - - # 检查命令是否成功执行 - if [ $exit_code -ne 0 ]; then - LOG_ERROR "harfbuzz-help命令执行失败" - exit $exit_code - fi - - # 检查输出是否包含帮助信息 - if echo "$output" | grep -q -i "usage\|help\|option"; then - LOG_INFO "harfbuzz-help命令输出帮助信息成功" - else - LOG_ERROR "harfbuzz-help命令输出中未找到帮助信息" - exit 1 - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/jffi/jffi-javadoc/test_jffi-javadoc_function_docgen.sh b/testcases/function_test/pkg_test/jffi/jffi-javadoc/test_jffi-javadoc_function_docgen.sh deleted file mode 100644 index 843c7b280c9..00000000000 --- a/testcases/function_test/pkg_test/jffi/jffi-javadoc/test_jffi-javadoc_function_docgen.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-09 -# @License : Mulan PSL v2 -# @Desc : Verify Javadoc generation for jffi-javadoc -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Verify Javadoc generation for jffi-javadoc" - - # 检查是否已安装jffi-javadoc - LOG_INFO "检查是否已安装jffi-javadoc" - dnf list installed jffi-javadoc &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "jffi-javadoc已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "jffi-javadoc未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有jffi-javadoc - LOG_INFO "检查yum源中是否有jffi-javadoc" - dnf list available jffi-javadoc &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到jffi-javadoc" - exit 255 - fi - - # 安装jffi-javadoc(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装jffi-javadoc" - dnf install -y jffi-javadoc &>/dev/null - CHECK_RESULT $? 0 0 "安装jffi-javadoc失败" - fi - - # 验证Javadoc生成功能 - LOG_INFO "验证Javadoc生成功能" - javadoc -d /tmp/jffi-javadoc -sourcepath /usr/share/java jffi &>/dev/null - CHECK_RESULT $? 0 0 "Javadoc生成失败" - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -rf /tmp/jffi-javadoc &>/dev/null - - # 卸载jffi-javadoc(如果测试前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载jffi-javadoc" - dnf remove -y jffi-javadoc &>/dev/null - CHECK_RESULT $? 0 0 "卸载jffi-javadoc失败" - fi - - LOG_INFO "测试完成:Verify Javadoc generation for jffi-javadoc" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mesa/mesa-filesystem/test_mesa-filesystem_function_conflict.sh b/testcases/function_test/pkg_test/mesa/mesa-filesystem/test_mesa-filesystem_function_conflict.sh deleted file mode 100644 index 6c940b28278..00000000000 --- a/testcases/function_test/pkg_test/mesa/mesa-filesystem/test_mesa-filesystem_function_conflict.sh +++ /dev/null @@ -1,190 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试mesa-filesystem软件包与冲突包(如闭源驱动包)的安装互斥性。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试环境初始化 - LOG_INFO "开始测试mesa-filesystem软件包与冲突包的安装互斥性" - - # 定义软件包名称 - MESA_PKG="mesa-filesystem" - CONFLICT_PKGS=("nvidia-driver" "amd-driver" "intel-driver-latest") - CONFLICT_PKG="" - - # 检查软件包是否已安装 - LOG_INFO "检查${MESA_PKG}是否已安装" - rpm -q ${MESA_PKG} &>/dev/null - MESA_INSTALLED=$? - - # 查找冲突包 - LOG_INFO "查找系统中可能存在的冲突包" - for pkg in "${CONFLICT_PKGS[@]}"; do - rpm -q ${pkg} &>/dev/null - if [ $? -eq 0 ]; then - CONFLICT_PKG=${pkg} - LOG_INFO "发现已安装的冲突包: ${CONFLICT_PKG}" - break - fi - done - - # 检查yum源中是否有mesa-filesystem包 - LOG_INFO "检查yum源中是否有${MESA_PKG}软件包" - dnf list available ${MESA_PKG} &>/dev/null - CHECK_RESULT $? 0 0 "yum源中未找到${MESA_PKG}软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到${MESA_PKG}软件包" - exit 255 - fi - - # 测试场景1: 如果已安装mesa-filesystem,尝试安装冲突包 - if [ ${MESA_INSTALLED} -eq 0 ]; then - LOG_INFO "场景1: ${MESA_PKG}已安装,尝试安装冲突包" - - # 查找可用的冲突包进行测试 - AVAILABLE_CONFLICT="" - for pkg in "${CONFLICT_PKGS[@]}"; do - dnf list available ${pkg} &>/dev/null - if [ $? -eq 0 ]; then - AVAILABLE_CONFLICT=${pkg} - LOG_INFO "找到可用的冲突包进行测试: ${AVAILABLE_CONFLICT}" - break - fi - done - - if [ -n "${AVAILABLE_CONFLICT}" ]; then - LOG_INFO "尝试安装冲突包: ${AVAILABLE_CONFLICT}" - dnf install -y ${AVAILABLE_CONFLICT} &>/dev/null - - # 检查是否安装失败(预期应该失败) - if [ $? -ne 0 ]; then - LOG_INFO "冲突包安装失败,符合预期(与${MESA_PKG}冲突)" - CHECK_RESULT $? 1 0 "冲突包应该安装失败" - else - LOG_ERROR "冲突包安装成功,不符合预期" - CHECK_RESULT $? 0 1 "冲突包不应该安装成功" - - # 清理安装的冲突包 - LOG_INFO "清理已安装的冲突包" - dnf remove -y ${AVAILABLE_CONFLICT} &>/dev/null - CHECK_RESULT $? 0 0 "卸载冲突包失败" - fi - else - LOG_INFO "未找到可用的冲突包进行测试" - fi - fi - - # 测试场景2: 如果已安装冲突包,尝试安装mesa-filesystem - if [ -n "${CONFLICT_PKG}" ]; then - LOG_INFO "场景2: ${CONFLICT_PKG}已安装,尝试安装${MESA_PKG}" - - LOG_INFO "尝试安装${MESA_PKG}" - dnf install -y ${MESA_PKG} &>/dev/null - - # 检查是否安装失败(预期应该失败) - if [ $? -ne 0 ]; then - LOG_INFO "${MESA_PKG}安装失败,符合预期(与${CONFLICT_PKG}冲突)" - CHECK_RESULT $? 1 0 "${MESA_PKG}应该安装失败" - else - LOG_ERROR "${MESA_PKG}安装成功,不符合预期" - CHECK_RESULT $? 0 1 "${MESA_PKG}不应该安装成功" - - # 清理安装的mesa-filesystem - LOG_INFO "清理已安装的${MESA_PKG}" - dnf remove -y ${MESA_PKG} &>/dev/null - CHECK_RESULT $? 0 0 "卸载${MESA_PKG}失败" - fi - fi - - # 测试场景3: 如果都未安装,先安装mesa-filesystem再尝试安装冲突包 - if [ ${MESA_INSTALLED} -ne 0 ] && [ -z "${CONFLICT_PKG}" ]; then - LOG_INFO "场景3: 系统未安装相关软件包,测试完整安装流程" - - # 安装mesa-filesystem - LOG_INFO "安装${MESA_PKG}" - dnf install -y ${MESA_PKG} &>/dev/null - CHECK_RESULT $? 0 0 "安装${MESA_PKG}失败" - - # 尝试安装冲突包 - AVAILABLE_CONFLICT="" - for pkg in "${CONFLICT_PKGS[@]}"; do - dnf list available ${pkg} &>/dev/null - if [ $? -eq 0 ]; then - AVAILABLE_CONFLICT=${pkg} - LOG_INFO "找到可用的冲突包: ${AVAILABLE_CONFLICT}" - break - fi - done - - if [ -n "${AVAILABLE_CONFLICT}" ]; then - LOG_INFO "尝试安装冲突包: ${AVAILABLE_CONFLICT}" - dnf install -y ${AVAILABLE_CONFLICT} &>/dev/null - - # 检查是否安装失败(预期应该失败) - if [ $? -ne 0 ]; then - LOG_INFO "冲突包安装失败,符合预期(与${MESA_PKG}冲突)" - CHECK_RESULT $? 1 0 "冲突包应该安装失败" - else - LOG_ERROR "冲突包安装成功,不符合预期" - CHECK_RESULT $? 0 1 "冲突包不应该安装成功" - - # 清理安装的冲突包 - LOG_INFO "清理已安装的冲突包" - dnf remove -y ${AVAILABLE_CONFLICT} &>/dev/null - CHECK_RESULT $? 0 0 "卸载冲突包失败" - fi - else - LOG_INFO "未找到可用的冲突包进行测试" - fi - - # 清理环境:卸载mesa-filesystem - LOG_INFO "清理测试环境:卸载${MESA_PKG}" - dnf remove -y ${MESA_PKG} &>/dev/null - CHECK_RESULT $? 0 0 "卸载${MESA_PKG}失败" - fi - - # 环境恢复 - LOG_INFO "恢复测试环境" - - # 如果测试前已安装mesa-filesystem,确保测试后仍然安装 - if [ ${MESA_INSTALLED} -eq 0 ]; then - LOG_INFO "检查${MESA_PKG}是否仍然安装" - rpm -q ${MESA_PKG} &>/dev/null - if [ $? -ne 0 ]; then - LOG_INFO "重新安装${MESA_PKG}以恢复环境" - dnf install -y ${MESA_PKG} &>/dev/null - CHECK_RESULT $? 0 0 "恢复${MESA_PKG}安装失败" - fi - fi - - # 如果测试前已安装冲突包,确保测试后仍然安装 - if [ -n "${CONFLICT_PKG}" ]; then - LOG_INFO "检查${CONFLICT_PKG}是否仍然安装" - rpm -q ${CONFLICT_PKG} &>/dev/null - if [ $? -ne 0 ]; then - LOG_INFO "重新安装${CONFLICT_PKG}以恢复环境" - dnf install -y ${CONFLICT_PKG} &>/dev/null - CHECK_RESULT $? 0 0 "恢复${CONFLICT_PKG}安装失败" - fi - fi - - LOG_INFO "测试完成:mesa-filesystem软件包与冲突包的安装互斥性验证成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mesa/mesa-filesystem/test_mesa-filesystem_function_dependency.sh b/testcases/function_test/pkg_test/mesa/mesa-filesystem/test_mesa-filesystem_function_dependency.sh deleted file mode 100644 index 1af198a6be3..00000000000 --- a/testcases/function_test/pkg_test/mesa/mesa-filesystem/test_mesa-filesystem_function_dependency.sh +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试mesa-filesystem软件包被其他图形应用正确识别和依赖。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 初始化环境变量 - LOG_FILE="/var/log/test_mesa-filesystem.log" - PACKAGE_NAME="mesa-filesystem" - DEPENDENCY_APP="glxinfo" - - # 检查软件包是否在yum源中 - check_package_in_repo() { - LOG_INFO "检查yum源中是否存在软件包: $PACKAGE_NAME" - dnf list available $PACKAGE_NAME &>/dev/null - CHECK_RESULT $? 0 0 "软件包 $PACKAGE_NAME 不在yum源中" - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - } - - # 检查命令参数是否支持 - check_command_param() { - LOG_INFO "检查命令参数是否支持" - if [ $# -lt 1 ]; then - LOG_ERROR "命令参数不存在或不支持" - exit 255 - fi - } - - # 检查环境是否已安装软件包 - check_installed() { - LOG_INFO "检查环境是否已安装软件包: $PACKAGE_NAME" - rpm -q $PACKAGE_NAME &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - INSTALLED=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - INSTALLED=0 - fi - } - - # 安装软件包 - install_package() { - LOG_INFO "安装软件包: $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - } - - # 卸载软件包 - uninstall_package() { - LOG_INFO "卸载软件包: $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - } - - # 测试图形应用正确识别和依赖 - test_dependency() { - LOG_INFO "测试图形应用正确识别和依赖" - # 检查依赖应用是否可执行 - which $DEPENDENCY_APP &>/dev/null - CHECK_RESULT $? 0 0 "图形应用 $DEPENDENCY_APP 未安装或不可执行" - - # 执行图形应用命令 - LOG_INFO "执行图形应用命令: $DEPENDENCY_APP" - $DEPENDENCY_APP &>/dev/null - CHECK_RESULT $? 0 0 "图形应用 $DEPENDENCY_APP 执行失败" - - # 检查mesa-filesystem提供的库文件是否存在 - LOG_INFO "检查mesa-filesystem提供的库文件" - ldconfig -p | grep -i mesa &>/dev/null - CHECK_RESULT $? 0 0 "mesa-filesystem库文件未正确安装" - } - - # 主测试流程 - main() { - LOG_INFO "开始测试mesa-filesystem软件包被其他图形应用正确识别和依赖" - - # 步骤1: 检查软件包是否在yum源中 - check_package_in_repo - - # 步骤2: 检查环境是否已安装 - check_installed - - # 步骤3: 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - install_package - NEED_CLEANUP=1 - else - NEED_CLEANUP=0 - fi - - # 步骤4: 测试图形应用正确识别和依赖 - test_dependency - - # 步骤5: 环境恢复 - if [ $NEED_CLEANUP -eq 1 ]; then - uninstall_package - fi - - LOG_INFO "测试完成" - } - - # 执行主测试流程 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mesa/mesa-filesystem/test_mesa-filesystem_function_provides.sh b/testcases/function_test/pkg_test/mesa/mesa-filesystem/test_mesa-filesystem_function_provides.sh deleted file mode 100644 index a25edbd196d..00000000000 --- a/testcases/function_test/pkg_test/mesa/mesa-filesystem/test_mesa-filesystem_function_provides.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试mesa-filesystem软件包提供的核心库文件(如libGL.so)是否存在于标准路径。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="mesa-filesystem" - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在${PACKAGE_NAME}软件包..." - dnf list available ${PACKAGE_NAME} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在${PACKAGE_NAME}软件包" - exit 255 - fi - - # 判断是否已安装该软件包 - LOG_INFO "检查${PACKAGE_NAME}软件包是否已安装..." - rpm -q ${PACKAGE_NAME} &>/dev/null - if [ $? -eq 0 ]; then - INSTALLED=true - LOG_INFO "${PACKAGE_NAME}软件包已安装,测试完成后将保持安装状态" - else - INSTALLED=false - LOG_INFO "${PACKAGE_NAME}软件包未安装,将在测试完成后卸载" - fi - - # 如果未安装,则安装软件包 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "安装${PACKAGE_NAME}软件包..." - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}软件包失败" - fi - - # 测试mesa-filesystem软件包提供的核心库文件是否存在于标准路径 - LOG_INFO "测试mesa-filesystem软件包提供的核心库文件是否存在于标准路径..." - - # 检查libGL.so库文件是否存在 - LIB_FILE="/usr/lib64/libGL.so" - LOG_INFO "检查库文件${LIB_FILE}是否存在..." - if [ -f "${LIB_FILE}" ]; then - LOG_INFO "库文件${LIB_FILE}存在" - CHECK_RESULT 0 0 0 "库文件${LIB_FILE}不存在" - else - LOG_ERROR "库文件${LIB_FILE}不存在" - CHECK_RESULT 1 0 0 "库文件${LIB_FILE}不存在" - fi - - # 检查其他可能的核心库文件 - ADDITIONAL_LIBS=( - "/usr/lib64/libGL.so.1" - "/usr/lib64/libGLESv2.so" - "/usr/lib64/libGLESv2.so.2" - "/usr/lib64/libEGL.so" - "/usr/lib64/libEGL.so.1" - ) - - LOG_INFO "检查其他核心库文件..." - for lib in "${ADDITIONAL_LIBS[@]}"; do - if [ -f "${lib}" ]; then - LOG_INFO "库文件${lib}存在" - else - LOG_INFO "库文件${lib}不存在(某些库文件可能不是必须的)" - fi - done - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "卸载${PACKAGE_NAME}软件包..." - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}软件包失败" - LOG_INFO "环境已恢复到测试前的状态" - else - LOG_INFO "保持${PACKAGE_NAME}软件包的安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mesa/mesa-filesystem/test_mesa-filesystem_function_version.sh b/testcases/function_test/pkg_test/mesa/mesa-filesystem/test_mesa-filesystem_function_version.sh deleted file mode 100644 index 9756d8edd92..00000000000 --- a/testcases/function_test/pkg_test/mesa/mesa-filesystem/test_mesa-filesystem_function_version.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-23 -# @License : Mulan PSL v2 -# @Desc : 测试验证mesa-filesystem软件包的版本信息是否符合预期。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本开始 - - # 步骤1:检查yum源中是否存在mesa-filesystem软件包 - LOG_INFO "步骤1:检查yum源中是否存在mesa-filesystem软件包" - if ! dnf list available mesa-filesystem &>/dev/null; then - LOG_ERROR "yum源中未找到mesa-filesystem软件包" - exit 255 - fi - - # 步骤2:检查当前环境是否已安装mesa-filesystem - LOG_INFO "步骤2:检查当前环境是否已安装mesa-filesystem" - if rpm -q mesa-filesystem &>/dev/null; then - LOG_INFO "mesa-filesystem已安装,标记为保持安装状态" - KEEP_INSTALLED=1 - else - LOG_INFO "mesa-filesystem未安装,标记为需要清理" - KEEP_INSTALLED=0 - fi - - # 步骤3:如果未安装,则安装mesa-filesystem软件包 - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装mesa-filesystem软件包" - dnf install -y mesa-filesystem - CHECK_RESULT $? 0 0 "安装mesa-filesystem软件包失败" - fi - - # 步骤4:验证mesa-filesystem软件包的版本信息 - LOG_INFO "步骤4:验证mesa-filesystem软件包的版本信息" - MESA_VERSION=$(rpm -q --queryformat "%{VERSION}" mesa-filesystem) - CHECK_RESULT $? 0 0 "获取mesa-filesystem版本信息失败" - - # 步骤5:检查版本信息是否符合预期(这里假设预期版本为某个特定值,例如21.3.5) - # 注意:实际测试中应根据具体需求调整预期版本 - EXPECTED_VERSION="21.3.5" - LOG_INFO "步骤5:检查版本信息是否符合预期(预期版本:$EXPECTED_VERSION)" - if [ "$MESA_VERSION" = "$EXPECTED_VERSION" ]; then - LOG_INFO "版本信息符合预期:$MESA_VERSION" - else - LOG_ERROR "版本信息不符合预期,实际版本:$MESA_VERSION,预期版本:$EXPECTED_VERSION" - exit 1 - fi - - # 步骤6:清理环境(如果之前未安装,则卸载软件包) - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "步骤6:清理环境,卸载mesa-filesystem软件包" - dnf remove -y mesa-filesystem - CHECK_RESULT $? 0 0 "卸载mesa-filesystem软件包失败" - else - LOG_INFO "步骤6:保持mesa-filesystem软件包安装状态,无需清理" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/polyglot/tesla-polyglot-translate-plugin/test_tesla-polyglot-translate-plugin_function_init.sh b/testcases/function_test/pkg_test/polyglot/tesla-polyglot-translate-plugin/test_tesla-polyglot-translate-plugin_function_init.sh deleted file mode 100644 index b47c658d58b..00000000000 --- a/testcases/function_test/pkg_test/polyglot/tesla-polyglot-translate-plugin/test_tesla-polyglot-translate-plugin_function_init.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-09 -# @License : Mulan PSL v2 -# @Desc : Test plugin initialization -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试插件初始化功能" - - # 检查是否已安装软件包 - LOG_INFO "检查软件包是否已安装" - dnf list installed tesla-polyglot-translate-plugin &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有tesla-polyglot-translate-plugin软件包" - dnf list available tesla-polyglot-translate-plugin &>/dev/null - CHECK_RESULT $? 0 255 "yum源中未找到tesla-polyglot-translate-plugin软件包" - - # 安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装tesla-polyglot-translate-plugin软件包" - dnf install -y tesla-polyglot-translate-plugin &>/dev/null - CHECK_RESULT $? 0 0 "安装tesla-polyglot-translate-plugin软件包失败" - fi - - # 测试插件初始化命令参数支持情况 - LOG_INFO "测试插件初始化命令参数支持情况" - tesla-polyglot-translate-plugin --init &>/dev/null - CHECK_RESULT $? 0 255 "插件初始化命令参数不支持或不存在" - - # 执行插件初始化命令并检查结果 - LOG_INFO "执行插件初始化命令" - tesla-polyglot-translate-plugin init &>/dev/null - CHECK_RESULT $? 0 1 "插件初始化失败" - - # 清理环境:如果之前未安装则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载tesla-polyglot-translate-plugin软件包" - dnf remove -y tesla-polyglot-translate-plugin &>/dev/null - CHECK_RESULT $? 0 0 "卸载tesla-polyglot-translate-plugin软件包失败" - fi - - LOG_INFO "测试插件初始化功能完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_auth.sh b/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_auth.sh deleted file mode 100644 index 4ebc89eaddc..00000000000 --- a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_auth.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-02 -# @License : Mulan PSL v2 -# @Desc : 测试python-google-auth-help软件包的认证功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试python-google-auth-help软件包的认证功能 - - LOG_INFO "开始测试python-google-auth-help软件包的认证功能" - - # 检查yum源中是否存在python-google-auth-help软件包 - LOG_INFO "检查yum源中是否存在python-google-auth-help软件包" - dnf list available python-google-auth-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在python-google-auth-help软件包" - exit 255 - fi - - # 检查是否已安装python-google-auth-help - LOG_INFO "检查是否已安装python-google-auth-help" - rpm -q python-google-auth-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python-google-auth-help已安装,测试结束后保持安装状态" - installed=true - else - LOG_INFO "python-google-auth-help未安装,将在测试结束后卸载" - installed=false - fi - - # 安装python-google-auth-help(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "安装python-google-auth-help" - dnf install -y python-google-auth-help - CHECK_RESULT $? 0 0 "安装python-google-auth-help失败" - fi - - # 测试认证功能 - LOG_INFO "测试python-google-auth-help的认证功能" - python3 -c "from google.auth import help; help.auth()" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "python-google-auth-help认证功能测试失败" - - # 卸载python-google-auth-help(如果之前未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载python-google-auth-help" - dnf remove -y python-google-auth-help - CHECK_RESULT $? 0 0 "卸载python-google-auth-help失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_credentials.sh b/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_credentials.sh deleted file mode 100644 index 9fc6379cdcc..00000000000 --- a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_credentials.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-24 -# @License : Mulan PSL v2 -# @Desc : 测试默认凭据获取 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试默认凭据获取" - - # 检查是否已安装python3-google-auth-help-function-credentials - LOG_INFO "检查python3-google-auth-help-function-credentials是否已安装" - rpm -q python3-google-auth-help-function-credentials &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "python3-google-auth-help-function-credentials已安装,测试后将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-google-auth-help-function-credentials未安装,将进行安装测试" - INSTALLED=false - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在python3-google-auth-help-function-credentials" - dnf list available python3-google-auth-help-function-credentials &>/dev/null - CHECK_RESULT $? 0 0 "yum源中未找到python3-google-auth-help-function-credentials软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-google-auth-help-function-credentials软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装python3-google-auth-help-function-credentials" - dnf install -y python3-google-auth-help-function-credentials - CHECK_RESULT $? 0 0 "安装python3-google-auth-help-function-credentials失败" - fi - - # 测试默认凭据获取功能 - LOG_INFO "测试默认凭据获取功能" - python3 -c "from google.auth import default; credentials, project = default(); print("默认凭据获取成功")" &>/dev/null - CHECK_RESULT $? 0 0 "默认凭据获取失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-google-auth-help-function-credentials" - dnf remove -y python3-google-auth-help-function-credentials - CHECK_RESULT $? 0 0 "卸载python3-google-auth-help-function-credentials失败" - fi - - LOG_INFO "测试完成:测试默认凭据获取" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_http.sh b/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_http.sh deleted file mode 100644 index a165b182979..00000000000 --- a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_http.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-02 -# @License : Mulan PSL v2 -# @Desc : 测试python-google-auth-help软件包的HTTP请求功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查python-google-auth-help软件包是否已安装 - LOG_INFO "检查python-google-auth-help软件包是否已安装" - if dnf list installed python-google-auth-help &>/dev/null; then - LOG_INFO "python-google-auth-help软件包已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "python-google-auth-help软件包未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python-google-auth-help软件包 - LOG_INFO "检查yum源中是否有python-google-auth-help软件包" - if ! dnf list available python-google-auth-help &>/dev/null; then - LOG_ERROR "yum源中未找到python-google-auth-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python-google-auth-help软件包" - dnf install -y python-google-auth-help - CHECK_RESULT $? 0 0 "安装python-google-auth-help软件包失败" - fi - - # 测试HTTP请求功能 - LOG_INFO "测试python-google-auth-help软件包的HTTP请求功能" - python3 -c " - import google.auth.transport.requests - import google.auth.exceptions - try: - request = google.auth.transport.requests.Request() - response = request.urlopen("http://example.com") - print("HTTP请求成功") - except google.auth.exceptions.TransportError as e: - print(f"HTTP请求失败: {e}") - " > /tmp/http_test_result.txt - - CHECK_RESULT $? 0 0 "执行HTTP请求测试失败" - - # 检查HTTP请求结果 - LOG_INFO "检查HTTP请求结果" - grep -q "HTTP请求成功" /tmp/http_test_result.txt - CHECK_RESULT $? 0 0 "HTTP请求未返回预期结果" - - # 清理临时文件 - rm -f /tmp/http_test_result.txt - - # 如果测试前未安装,则卸载软件包以恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python-google-auth-help软件包以恢复环境" - dnf remove -y python-google-auth-help - CHECK_RESULT $? 0 0 "卸载python-google-auth-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_http_auth.sh b/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_http_auth.sh deleted file mode 100644 index feda25296c4..00000000000 --- a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_http_auth.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-24 -# @License : Mulan PSL v2 -# @Desc : 测试HTTP请求授权 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:判断是否已安装python3-google-auth - LOG_INFO "检查python3-google-auth是否已安装" - rpm -q python3-google-auth > /dev/null 2>&1 - is_installed=$? - - # 定义软件包名称 - PACKAGE_NAME="python3-google-auth" - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在软件包:$PACKAGE_NAME" - dnf list available $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到软件包:$PACKAGE_NAME" - exit 255 - fi - - # 如果未安装,则进行安装 - if [ $is_installed -ne 0 ]; then - LOG_INFO "安装软件包:$PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装$PACKAGE_NAME失败" - fi - - # 测试HTTP请求授权功能 - LOG_INFO "测试HTTP请求授权功能" - python3 -c " - import google.auth.transport.requests - import google.oauth2.id_token - - # 模拟HTTP请求授权 - try: - request = google.auth.transport.requests.Request() - # 这里仅测试导入和基本对象创建,实际授权需要有效凭证 - LOG_INFO("google.auth模块导入成功,基本对象创建正常") - except Exception as e: - LOG_ERROR(f"HTTP请求授权测试失败: {e}") - raise - " - CHECK_RESULT $? 0 0 "HTTP请求授权测试失败" - - # 环境恢复:如果之前未安装,则卸载软件包 - if [ $is_installed -ne 0 ]; then - LOG_INFO "卸载软件包:$PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载$PACKAGE_NAME失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_id_token.sh b/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_id_token.sh deleted file mode 100644 index 1d65408dbfd..00000000000 --- a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_id_token.sh +++ /dev/null @@ -1,148 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-24 -# @License : Mulan PSL v2 -# @Desc : 测试ID令牌获取 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试ID令牌获取 - - # 检查是否已安装python3-google-auth - LOG_INFO "检查是否已安装python3-google-auth" - rpm -q python3-google-auth >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到python3-google-auth已安装,测试后保持安装状态" - already_installed=1 - else - LOG_INFO "检测到python3-google-auth未安装,将在测试后卸载" - already_installed=0 - fi - - # 检查yum源中是否有python3-google-auth包 - LOG_INFO "检查yum源中是否有python3-google-auth包" - dnf list available python3-google-auth >/dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到python3-google-auth包" - - # 安装python3-google-auth - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装python3-google-auth" - dnf install -y python3-google-auth - CHECK_RESULT $? 0 0 "安装python3-google-auth失败" - fi - - # 检查google-auth库是否可用 - LOG_INFO "检查google-auth库是否可用" - python3 -c "import google.auth; print("google.auth导入成功")" 2>&1 - CHECK_RESULT $? 0 0 "google.auth库导入失败" - - # 测试获取ID令牌的帮助函数 - LOG_INFO "测试获取ID令牌的帮助函数" - python3 -c " - import google.auth - from google.auth.transport import requests - try: - # 尝试导入ID令牌相关模块 - from google.auth import id_token - from google.auth.transport.requests import Request - print("ID令牌模块导入成功") - - # 测试获取默认凭据 - credentials, project = google.auth.default() - print(f"默认凭据获取成功,项目ID: {project}") - - # 测试ID令牌获取函数(模拟场景) - # 注意:实际获取ID令牌需要有效的服务账号凭据 - print("ID令牌获取功能测试通过") - except Exception as e: - print(f"ID令牌测试失败: {e}") - exit(1) - " 2>&1 - CHECK_RESULT $? 0 0 "ID令牌获取功能测试失败" - - # 测试ID令牌获取命令参数 - LOG_INFO "测试ID令牌获取命令参数" - python3 -c " - import argparse - import sys - - # 模拟命令行参数解析 - parser = argparse.ArgumentParser(description="测试ID令牌获取") - parser.add_argument("--audience", help="目标受众") - parser.add_argument("--credentials", help="凭据文件路径") - - # 测试有效参数 - test_args = ["--audience", "https://example.com"] - try: - args = parser.parse_args(test_args) - print(f"参数解析成功: audience={args.audience}") - except SystemExit: - print("参数解析失败") - sys.exit(1) - " 2>&1 - CHECK_RESULT $? 0 0 "ID令牌命令参数测试失败" - - # 测试无效参数处理 - LOG_INFO "测试无效参数处理" - python3 -c " - import argparse - import sys - - parser = argparse.ArgumentParser(description="测试ID令牌获取") - parser.add_argument("--audience", help="目标受众") - - # 测试无效参数 - test_args = ["--invalid-param", "value"] - try: - args = parser.parse_args(test_args) - print("无效参数未正确处理") - sys.exit(1) - except SystemExit as e: - if e.code == 2: # argparse在遇到无效参数时退出码为2 - print("无效参数正确处理") - sys.exit(0) - else: - print(f"意外退出码: {e.code}") - sys.exit(1) - " 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "无效参数处理测试失败" - exit 255 - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "清理测试环境,卸载python3-google-auth" - dnf remove -y python3-google-auth - CHECK_RESULT $? 0 0 "卸载python3-google-auth失败" - - # 验证卸载是否成功 - rpm -q python3-google-auth >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "python3-google-auth卸载失败" - exit 1 - else - LOG_INFO "python3-google-auth已成功卸载" - fi - else - LOG_INFO "保持python3-google-auth安装状态" - fi - - LOG_INFO "ID令牌获取功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_refresh.sh b/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_refresh.sh deleted file mode 100644 index 98d731b5474..00000000000 --- a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_refresh.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-24 -# @License : Mulan PSL v2 -# @Desc : 测试访问令牌刷新 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:访问令牌刷新" - - # 检查yum源中是否存在python3-google-auth包 - LOG_INFO "检查yum源中是否存在python3-google-auth软件包" - dnf list available python3-google-auth 2>/dev/null | grep -q python3-google-auth - CHECK_RESULT $? 0 0 "yum源中未找到python3-google-auth软件包" - - # 检查当前环境是否已安装python3-google-auth - LOG_INFO "检查当前环境是否已安装python3-google-auth" - rpm -q python3-google-auth > /dev/null 2>&1 - installed=$? - - if [ $installed -ne 0 ]; then - LOG_INFO "环境未安装python3-google-auth,开始安装" - dnf install -y python3-google-auth - CHECK_RESULT $? 0 0 "安装python3-google-auth失败" - need_cleanup=1 - else - LOG_INFO "环境已安装python3-google-auth" - need_cleanup=0 - fi - - # 测试访问令牌刷新功能 - LOG_INFO "测试访问令牌刷新功能" - python3 -c " - from google.auth.transport.requests import Request - from google.oauth2.credentials import Credentials - import json - - # 创建模拟的凭据数据 - token_data = { - "token": "dummy_token", - "refresh_token": "dummy_refresh_token", - "token_uri": "https://oauth2.googleapis.com/token", - "client_id": "dummy_client_id", - "client_secret": "dummy_client_secret", - "scopes": ["https://www.googleapis.com/auth/cloud-platform"] - } - - # 创建凭据对象 - creds = Credentials.from_authorized_user_info(token_data) - - # 测试刷新方法 - try: - # 尝试刷新令牌(由于是模拟数据,预期会失败) - creds.refresh(Request()) - print("令牌刷新测试完成") - except Exception as e: - print(f"令牌刷新测试完成(预期失败):{type(e).__name__}") - " - CHECK_RESULT $? 0 0 "访问令牌刷新测试执行失败" - - # 清理环境 - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "清理测试环境,卸载python3-google-auth" - dnf remove -y python3-google-auth - CHECK_RESULT $? 0 0 "卸载python3-google-auth失败" - fi - - LOG_INFO "测试完成:访问令牌刷新" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_scoped_auth.sh b/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_scoped_auth.sh deleted file mode 100644 index 34312ff7f9d..00000000000 --- a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_scoped_auth.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-24 -# @License : Mulan PSL v2 -# @Desc : 测试带作用域认证 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:测试带作用域认证" - - # 定义软件包名称 - PACKAGE_NAME="python3-google-auth" - - # 检查软件包是否已在系统中安装 - LOG_INFO "检查软件包是否已安装" - if dnf list installed "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "软件包已安装,脚本结束后将保持安装状态" - ALREADY_INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试步骤中安装" - ALREADY_INSTALLED=false - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在软件包:$PACKAGE_NAME" - if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "yum源中不存在软件包:$PACKAGE_NAME" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "安装软件包:$PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试带作用域认证的命令 - LOG_INFO "测试带作用域认证的命令" - # 假设测试命令为google-auth-test,参数为--scope - TEST_COMMAND="google-auth-test" - SCOPE_PARAM="--scope" - LOG_INFO "执行命令:$TEST_COMMAND $SCOPE_PARAM" - - # 检查命令是否存在 - if ! command -v "$TEST_COMMAND" &>/dev/null; then - LOG_ERROR "命令 $TEST_COMMAND 不存在" - exit 255 - fi - - # 检查参数是否支持 - if ! "$TEST_COMMAND" --help 2>&1 | grep -q "$SCOPE_PARAM"; then - LOG_ERROR "命令 $TEST_COMMAND 不支持参数 $SCOPE_PARAM" - exit 255 - fi - - # 执行命令 - "$TEST_COMMAND" "$SCOPE_PARAM" - CHECK_RESULT $? 0 0 "带作用域认证命令执行失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "卸载软件包:$PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试结束:测试带作用域认证完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_service_acct.sh b/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_service_acct.sh deleted file mode 100644 index 6b23075fd4a..00000000000 --- a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_service_acct.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-24 -# @License : Mulan PSL v2 -# @Desc : 测试服务账号凭据 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:测试服务账号凭据 - - # 定义软件包名称 - PACKAGE_NAME="python3-google-auth-help-function-service-acct" - - # 步骤1:检查软件包是否已在YUM源中 - LOG_INFO "步骤1:检查软件包是否在YUM源中" - dnf list available "$PACKAGE_NAME" &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在YUM源中" - exit 255 - fi - - # 步骤2:检查当前环境是否已安装软件包 - LOG_INFO "步骤2:检查当前环境是否已安装软件包" - INSTALLED=false - if rpm -q "$PACKAGE_NAME" &> /dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - INSTALLED=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4:验证软件包安装成功 - LOG_INFO "步骤4:验证软件包安装成功" - rpm -q "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "验证软件包安装失败" - - # 步骤5:测试服务账号凭据功能 - LOG_INFO "步骤5:测试服务账号凭据功能" - # 假设测试命令为 "google-auth-help-function-service-acct --test" - # 如果命令不存在或不支持参数,则退出 - if ! command -v google-auth-help-function-service-acct &> /dev/null; then - LOG_ERROR "命令 google-auth-help-function-service-acct 不存在" - exit 255 - fi - - # 测试命令执行 - google-auth-help-function-service-acct --test - CHECK_RESULT $? 0 0 "测试服务账号凭据功能失败" - - # 步骤6:测试命令参数验证 - LOG_INFO "步骤6:测试命令参数验证" - # 测试不支持参数的情况 - google-auth-help-function-service-acct --invalid-param 2>&1 | grep -q "unrecognized option" - CHECK_RESULT $? 0 0 "命令参数验证失败,应检测到无效参数" - - # 步骤7:清理环境 - LOG_INFO "步骤7:清理环境" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_token.sh b/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_token.sh deleted file mode 100644 index de056ca3136..00000000000 --- a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_token.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-02 -# @License : Mulan PSL v2 -# @Desc : 测试python-google-auth-help软件包的令牌功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 步骤1: 检查是否已安装python-google-auth-help软件包 - LOG_INFO "检查是否已安装python-google-auth-help软件包" - if dnf list installed python-google-auth-help &>/dev/null; then - LOG_INFO "python-google-auth-help已安装,脚本结束后将保持安装状态" - installed=true - else - LOG_INFO "python-google-auth-help未安装,将在脚本结束后卸载" - installed=false - fi - - # 步骤2: 检查yum源中是否有python-google-auth-help软件包 - LOG_INFO "检查yum源中是否有python-google-auth-help软件包" - if ! dnf list available python-google-auth-help &>/dev/null; then - LOG_ERROR "yum源中未找到python-google-auth-help软件包" - exit 255 - fi - - # 步骤3: 安装python-google-auth-help软件包(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "开始安装python-google-auth-help软件包" - dnf install -y python-google-auth-help - CHECK_RESULT $? 0 0 "安装python-google-auth-help失败" - fi - - # 步骤4: 测试令牌功能 - LOG_INFO "测试python-google-auth-help的令牌功能" - python3 -c "from google.auth import help; help.token()" &>/dev/null - CHECK_RESULT $? 0 0 "令牌功能测试失败" - - # 步骤5: 清理环境(如果最初未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载python-google-auth-help软件包" - dnf remove -y python-google-auth-help - CHECK_RESULT $? 0 0 "卸载python-google-auth-help失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_uninstall.sh b/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_uninstall.sh deleted file mode 100644 index 4d35fb81ce0..00000000000 --- a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_uninstall.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-24 -# @License : Mulan PSL v2 -# @Desc : 测试软件包卸载 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试python-google-auth-help_function的卸载功能 - - LOG_INFO "1. 检查测试环境是否已安装python-google-auth-help_function" - dnf list installed python-google-auth-help_function >/dev/null 2>&1 - is_installed=$? - - LOG_INFO "2. 检查yum源中是否有python-google-auth-help_function软件包" - dnf list available python-google-auth-help_function >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有找到python-google-auth-help_function软件包" - exit 255 - fi - - # 记录初始状态,用于脚本结束时的环境恢复 - initial_installed=$is_installed - - if [ $is_installed -eq 0 ]; then - LOG_INFO "3. 环境已安装python-google-auth-help_function,跳过安装步骤" - test_package_name="python-google-auth-help_function" - else - LOG_INFO "3. 环境未安装python-google-auth-help_function,开始安装" - dnf install -y python-google-auth-help_function - CHECK_RESULT $? 0 0 "安装python-google-auth-help_function失败" - test_package_name="python-google-auth-help_function" - fi - - LOG_INFO "4. 验证python-google-auth-help_function已正确安装" - dnf list installed python-google-auth-help_function >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "python-google-auth-help_function未正确安装" - - LOG_INFO "5. 执行软件包卸载测试" - LOG_INFO "5.1 尝试卸载python-google-auth-help_function" - dnf remove -y python-google-auth-help_function - CHECK_RESULT $? 0 0 "卸载python-google-auth-help_function失败" - - LOG_INFO "5.2 验证python-google-auth-help_function已被卸载" - dnf list installed python-google-auth-help_function >/dev/null 2>&1 - CHECK_RESULT $? 1 0 "python-google-auth-help_function卸载后仍存在" - - LOG_INFO "6. 环境恢复:根据初始状态决定是否重新安装" - if [ $initial_installed -eq 0 ]; then - LOG_INFO "6.1 初始环境已安装,重新安装python-google-auth-help_function" - dnf install -y python-google-auth-help_function - CHECK_RESULT $? 0 0 "重新安装python-google-auth-help_function失败" - - LOG_INFO "6.2 验证重新安装成功" - dnf list installed python-google-auth-help_function >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "重新安装后python-google-auth-help_function不存在" - else - LOG_INFO "6.1 初始环境未安装,保持卸载状态,无需恢复" - fi - - LOG_INFO "7. 测试完成:python-google-auth-help_function卸载功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_user_auth.sh b/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_user_auth.sh deleted file mode 100644 index af1f252c559..00000000000 --- a/testcases/function_test/pkg_test/python-google-auth/python-google-auth-help/test_python-google-auth-help_function_user_auth.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-24 -# @License : Mulan PSL v2 -# @Desc : 测试用户交互认证 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称和命令 - PACKAGE_NAME="python3-google-auth" - COMMAND="google-auth" - PARAM="--help" - - # 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在软件包:$PACKAGE_NAME" - dnf list available $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 检查环境是否已安装软件包 - LOG_INFO "检查环境是否已安装软件包:$PACKAGE_NAME" - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,脚本结束将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将进行安装" - INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装软件包:$PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 检查命令是否存在 - LOG_INFO "检查命令是否存在:$COMMAND" - which $COMMAND > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $COMMAND 不存在" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载软件包:$PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - fi - exit 255 - fi - - # 检查参数是否支持 - LOG_INFO "检查命令 $COMMAND 是否支持参数 $PARAM" - $COMMAND $PARAM > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "命令 $COMMAND 不支持参数 $PARAM" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载软件包:$PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - fi - exit 255 - fi - - # 执行测试命令 - LOG_INFO "执行测试命令:$COMMAND $PARAM" - $COMMAND $PARAM - CHECK_RESULT $? 0 0 "执行命令 $COMMAND $PARAM 失败" - - # 清理环境 - LOG_INFO "清理测试环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载软件包:$PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试用户交互认证完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_check_install.sh b/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_check_install.sh deleted file mode 100644 index 059ae8a1169..00000000000 --- a/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_check_install.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : 测试验证python3-rpm软件包是否已正确安装。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试验证python3-rpm软件包是否已正确安装。" - - # 检查yum源中是否存在python3-rpm软件包 - LOG_INFO "检查yum源中是否存在python3-rpm软件包。" - dnf list available python3-rpm > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-rpm软件包。" - exit 255 - fi - - # 检查是否已安装python3-rpm - LOG_INFO "检查当前环境是否已安装python3-rpm软件包。" - rpm -q python3-rpm > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-rpm软件包已安装,标记为已安装状态。" - INSTALLED=true - else - LOG_INFO "python3-rpm软件包未安装,标记为未安装状态。" - INSTALLED=false - fi - - # 如果未安装,则安装python3-rpm - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python3-rpm软件包。" - dnf install -y python3-rpm - CHECK_RESULT $? 0 0 "安装python3-rpm软件包失败。" - fi - - # 验证python3-rpm软件包是否正确安装 - LOG_INFO "验证python3-rpm软件包是否正确安装。" - rpm -q python3-rpm > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "python3-rpm软件包未正确安装。" - - # 测试python3-rpm的基本功能 - LOG_INFO "测试python3-rpm的基本功能,检查是否支持--version参数。" - python3 -c "import rpm; print(rpm.__version__)" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "python3-rpm模块无法正常导入。" - - # 如果测试前未安装,则在测试后卸载python3-rpm - if [ "$INSTALLED" = false ]; then - LOG_INFO "测试完成,开始卸载python3-rpm软件包。" - dnf remove -y python3-rpm - CHECK_RESULT $? 0 0 "卸载python3-rpm软件包失败。" - LOG_INFO "已卸载python3-rpm软件包,环境已恢复。" - else - LOG_INFO "测试完成,保持python3-rpm软件包安装状态。" - fi - - LOG_INFO "测试验证python3-rpm软件包是否已正确安装完成。" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_import_module.sh b/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_import_module.sh deleted file mode 100644 index d4513b24a1e..00000000000 --- a/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_import_module.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : 测试能否成功导入python3-rpm模块。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:测试能否成功导入python3-rpm模块 - - LOG_INFO "步骤1:检查python3-rpm软件包是否在yum源中" - dnf list available python3-rpm 2>/dev/null | grep -q python3-rpm - if [ $? -ne 0 ]; then - LOG_ERROR "python3-rpm软件包不在yum源中" - exit 255 - fi - LOG_INFO "python3-rpm软件包在yum源中" - - LOG_INFO "步骤2:检查当前是否已安装python3-rpm" - rpm -q python3-rpm >/dev/null 2>&1 - is_installed=$? - - if [ $is_installed -eq 0 ]; then - LOG_INFO "python3-rpm已安装,测试后将保持安装状态" - need_uninstall=0 - else - LOG_INFO "python3-rpm未安装,将进行安装测试" - need_uninstall=1 - - LOG_INFO "步骤3:安装python3-rpm软件包" - dnf install -y python3-rpm - CHECK_RESULT $? 0 0 "安装python3-rpm失败" - LOG_INFO "python3-rpm安装成功" - fi - - LOG_INFO "步骤4:测试导入python3-rpm模块" - python3 -c "import rpm" - CHECK_RESULT $? 0 0 "导入python3-rpm模块失败" - LOG_INFO "成功导入python3-rpm模块" - - LOG_INFO "步骤5:验证模块基本功能" - python3 -c " - import rpm - ts = rpm.TransactionSet() - print("RPM事务集创建成功") - " - CHECK_RESULT $? 0 0 "python3-rpm模块功能测试失败" - LOG_INFO "python3-rpm模块功能正常" - - LOG_INFO "步骤6:清理测试环境" - if [ $need_uninstall -eq 1 ]; then - LOG_INFO "卸载测试安装的python3-rpm软件包" - dnf remove -y python3-rpm - CHECK_RESULT $? 0 0 "卸载python3-rpm失败" - LOG_INFO "python3-rpm卸载成功,环境已恢复" - else - LOG_INFO "保持python3-rpm安装状态" - fi - - LOG_INFO "测试完成:python3-rpm模块导入和基本功能测试成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_query_package.sh b/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_query_package.sh deleted file mode 100644 index 16fe26f0dbc..00000000000 --- a/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_query_package.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : 测试查询系统已安装的指定RPM包信息。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试查询系统已安装的指定RPM包信息" - LOG_INFO "步骤1:检查是否已安装python3-rpm包" - rpm -q python3-rpm > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-rpm已安装,记录安装状态" - INSTALLED=1 - else - LOG_INFO "python3-rpm未安装,记录未安装状态" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查yum源中是否存在python3-rpm包" - dnf list available python3-rpm > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在python3-rpm包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装python3-rpm包" - dnf install -y python3-rpm - CHECK_RESULT $? 0 0 "安装python3-rpm包失败" - fi - - LOG_INFO "步骤4:测试查询python3-rpm包信息" - rpm -qi python3-rpm > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "查询python3-rpm包信息失败" - - LOG_INFO "步骤5:测试使用query参数查询包信息" - rpm -q python3-rpm --queryformat="%{NAME}\n" | grep -q "^python3-rpm$" - CHECK_RESULT $? 0 0 "使用query参数查询包信息失败" - - LOG_INFO "步骤6:测试不支持的参数" - rpm -qi python3-rpm --invalid-param > /dev/null 2>&1 - if [ $? -ne 255 ] && [ $? -ne 1 ]; then - LOG_ERROR "不支持的参数未正确处理" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤7:清理环境,卸载python3-rpm包" - dnf remove -y python3-rpm - CHECK_RESULT $? 0 0 "卸载python3-rpm包失败" - else - LOG_INFO "步骤7:保持环境,不卸载python3-rpm包" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_read_header.sh b/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_read_header.sh deleted file mode 100644 index 7523e28978a..00000000000 --- a/testcases/function_test/pkg_test/rpm/python3-rpm/test_python3-rpm_function_read_header.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : 测试使用rpm模块读取已安装RPM包的头信息。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装python3-rpm包 - LOG_INFO "检查是否已经安装python3-rpm包" - rpm -q python3-rpm > /dev/null 2>&1 - if [ $? -eq 0 ]; then - already_installed=true - LOG_INFO "python3-rpm已经安装" - else - already_installed=false - LOG_INFO "python3-rpm未安装" - fi - - # 检查yum源中是否有python3-rpm包 - LOG_INFO "检查yum源中是否有python3-rpm包" - dnf list available python3-rpm > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有python3-rpm包" - exit 255 - fi - - # 如果未安装,则安装python3-rpm包 - if [ "$already_installed" = false ]; then - LOG_INFO "开始安装python3-rpm包" - dnf install -y python3-rpm - CHECK_RESULT $? 0 0 "安装python3-rpm包失败" - fi - - # 测试使用rpm模块读取已安装RPM包的头信息 - LOG_INFO "测试使用rpm模块读取已安装RPM包的头信息" - python3 -c " - import rpm - ts = rpm.TransactionSet() - mi = ts.dbMatch() - for h in mi: - print("Package: %s-%s-%s" % (h["name"], h["version"], h["release"])) - break - " - CHECK_RESULT $? 0 0 "使用rpm模块读取RPM包头信息失败" - - # 清理环境:如果脚本开始时未安装,则卸载python3-rpm包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载python3-rpm包" - dnf remove -y python3-rpm - CHECK_RESULT $? 0 0 "卸载python3-rpm包失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_basic_convert.sh b/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_basic_convert.sh deleted file mode 100644 index bf75aaf3f14..00000000000 --- a/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_basic_convert.sh +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Test basic gem to spec conversion -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test basic gem to spec conversion" - - # 定义软件包名称 - PACKAGE_NAME="rubygem-gem2rpm-doc" - - # 检查软件包是否已在系统中安装 - LOG_INFO "步骤1:检查软件包是否已安装" - if rpm -q $PACKAGE_NAME &> /dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试过程中安装" - INSTALLED_BEFORE_TEST=false - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "步骤2:检查yum源中是否存在软件包 $PACKAGE_NAME" - if ! dnf list available $PACKAGE_NAME &> /dev/null; then - LOG_ERROR "yum源中不存在软件包 $PACKAGE_NAME" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 检查 gem2rpm 命令是否存在 - LOG_INFO "步骤4:检查 gem2rpm 命令是否存在" - if ! command -v gem2rpm &> /dev/null; then - LOG_ERROR "gem2rpm 命令不存在" - exit 255 - fi - - # 测试基本 gem 到 spec 转换功能 - LOG_INFO "步骤5:测试基本 gem 到 spec 转换功能" - # 创建一个临时的 gem 文件用于测试 - TEST_GEM_NAME="test_gem" - TEST_GEM_FILE="$TEST_GEM_NAME.gem" - TEST_SPEC_FILE="$TEST_GEM_NAME.spec" - - # 模拟一个简单的 gem 文件(这里使用一个虚拟的 gem 文件进行测试) - echo "This is a test gem file" > $TEST_GEM_FILE - CHECK_RESULT $? 0 0 "创建测试 gem 文件失败" - - # 使用 gem2rpm 将 gem 文件转换为 spec 文件 - LOG_INFO "步骤6:使用 gem2rpm 将 gem 文件转换为 spec 文件" - gem2rpm $TEST_GEM_FILE > $TEST_SPEC_FILE 2>&1 - CHECK_RESULT $? 0 0 "gem2rpm 转换失败" - - # 检查生成的 spec 文件是否包含必要的内容 - LOG_INFO "步骤7:检查生成的 spec 文件是否包含必要的内容" - if grep -q "Name:" $TEST_SPEC_FILE && grep -q "Version:" $TEST_SPEC_FILE; then - LOG_INFO "生成的 spec 文件包含必要的 Name 和 Version 字段" - else - LOG_ERROR "生成的 spec 文件缺少必要的字段" - CHECK_RESULT 1 0 0 "spec 文件内容检查失败" - fi - - # 清理临时文件 - LOG_INFO "步骤8:清理临时文件" - rm -f $TEST_GEM_FILE $TEST_SPEC_FILE - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤9:卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "步骤9:保持软件包 $PACKAGE_NAME 安装状态" - fi - - LOG_INFO "测试完成:Test basic gem to spec conversion" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_docgen.sh b/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_docgen.sh deleted file mode 100644 index 3629ae496f0..00000000000 --- a/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_docgen.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-10 -# @License : Mulan PSL v2 -# @Desc : Test documentation generation functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装rubygem-gem2rpm-doc软件包 - LOG_INFO "检查是否已经安装rubygem-gem2rpm-doc软件包" - if dnf list installed rubygem-gem2rpm-doc &>/dev/null; then - LOG_INFO "rubygem-gem2rpm-doc已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "rubygem-gem2rpm-doc未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有rubygem-gem2rpm-doc软件包 - LOG_INFO "检查yum源中是否有rubygem-gem2rpm-doc软件包" - if ! dnf list available rubygem-gem2rpm-doc &>/dev/null; then - LOG_ERROR "yum源中未找到rubygem-gem2rpm-doc软件包" - exit 255 - fi - - # 安装rubygem-gem2rpm-doc软件包(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "开始安装rubygem-gem2rpm-doc软件包" - dnf install -y rubygem-gem2rpm-doc - CHECK_RESULT $? 0 0 "安装rubygem-gem2rpm-doc软件包失败" - fi - - # 测试文档生成功能 - LOG_INFO "测试文档生成功能" - gem2rpm --help | grep -q "\-\-doc" - CHECK_RESULT $? 0 0 "--doc参数不支持" - - LOG_INFO "执行文档生成命令" - gem2rpm --doc - CHECK_RESULT $? 0 0 "文档生成失败" - - # 清理环境(如果之前未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载rubygem-gem2rpm-doc软件包" - dnf remove -y rubygem-gem2rpm-doc - CHECK_RESULT $? 0 0 "卸载rubygem-gem2rpm-doc软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_help.sh b/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_help.sh deleted file mode 100644 index 92273a4ad33..00000000000 --- a/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_help.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Test help command output -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试: Test help command output" - - # 检查软件包是否在yum源中 - LOG_INFO "检查rubygem-gem2rpm-doc软件包是否在yum源中" - if ! dnf list available rubygem-gem2rpm-doc &>/dev/null; then - LOG_ERROR "rubygem-gem2rpm-doc软件包不在yum源中" - exit 255 - fi - - # 检查是否已安装软件包 - LOG_INFO "检查rubygem-gem2rpm-doc是否已安装" - if rpm -q rubygem-gem2rpm-doc &>/dev/null; then - already_installed=true - LOG_INFO "rubygem-gem2rpm-doc已安装,测试结束后将保持安装状态" - else - already_installed=false - LOG_INFO "rubygem-gem2rpm-doc未安装,将进行安装测试" - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装rubygem-gem2rpm-doc软件包" - dnf install -y rubygem-gem2rpm-doc - CHECK_RESULT $? 0 0 "安装rubygem-gem2rpm-doc失败" - fi - - # 测试帮助命令输出 - LOG_INFO "测试gem2rpm-doc帮助命令" - output=$(gem2rpm-doc --help 2>&1) - exit_code=$? - - # 检查命令是否执行成功 - if [ $exit_code -eq 0 ]; then - LOG_INFO "gem2rpm-doc帮助命令执行成功" - # 检查输出是否包含帮助信息 - if echo "$output" | grep -q "Usage:"; then - LOG_INFO "帮助命令输出包含预期内容" - CHECK_RESULT 0 0 0 "帮助命令输出不符合预期" - else - LOG_ERROR "帮助命令输出不包含预期内容" - CHECK_RESULT 1 0 0 "帮助命令输出不符合预期" - fi - elif [ $exit_code -eq 255 ]; then - LOG_ERROR "gem2rpm-doc命令参数不存在或不支持" - exit 255 - else - LOG_ERROR "gem2rpm-doc命令执行失败,退出码: $exit_code" - exit $exit_code - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载rubygem-gem2rpm-doc软件包" - dnf remove -y rubygem-gem2rpm-doc - CHECK_RESULT $? 0 0 "卸载rubygem-gem2rpm-doc失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "保持rubygem-gem2rpm-doc安装状态" - fi - - LOG_INFO "测试完成: Test help command output" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_version.sh b/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_version.sh deleted file mode 100644 index 7de6a4fee4b..00000000000 --- a/testcases/function_test/pkg_test/rubygem-gem2rpm/rubygem-gem2rpm-doc/test_rubygem-gem2rpm-doc_function_version.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Test version command output -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境初始化检查 - LOG_INFO "检查是否已安装rubygem-gem2rpm-doc软件包" - rpm -q rubygem-gem2rpm-doc >/dev/null 2>&1 - initial_install_status=$? - - # 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在rubygem-gem2rpm-doc软件包" - dnf list available rubygem-gem2rpm-doc >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到rubygem-gem2rpm-doc软件包" - exit 255 - fi - - # 如果未安装则进行安装 - if [ $initial_install_status -ne 0 ]; then - LOG_INFO "安装rubygem-gem2rpm-doc软件包" - dnf install -y rubygem-gem2rpm-doc - CHECK_RESULT $? 0 0 "安装rubygem-gem2rpm-doc软件包失败" - fi - - # 检查version参数支持情况 - LOG_INFO "检查gem2rpm命令是否支持version参数" - gem2rpm --help | grep -q "\-\-version" - if [ $? -ne 0 ]; then - LOG_ERROR "gem2rpm命令不支持version参数" - exit 255 - fi - - # 测试version命令输出 - LOG_INFO "执行gem2rpm --version命令测试" - version_output=$(gem2rpm --version 2>&1) - CHECK_RESULT $? 0 0 "执行gem2rpm --version命令失败" - - # 检查版本输出是否符合预期 - LOG_INFO "检查版本输出是否包含有效信息" - if [ -z "$version_output" ]; then - LOG_ERROR "版本输出为空" - exit 1 - fi - - LOG_INFO "版本输出内容: $version_output" - - # 环境清理 - if [ $initial_install_status -ne 0 ]; then - LOG_INFO "清理环境:卸载rubygem-gem2rpm-doc软件包" - dnf remove -y rubygem-gem2rpm-doc - CHECK_RESULT $? 0 0 "卸载rubygem-gem2rpm-doc软件包失败" - else - LOG_INFO "保持rubygem-gem2rpm-doc软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc/test_texlive-footmisc-doc_function_use_info.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc/test_texlive-footmisc-doc_function_use_info.sh deleted file mode 100644 index f94a832bc59..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc/test_texlive-footmisc-doc_function_use_info.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : Test accessing the package info documentation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:Test accessing the package info documentation - - LOG_INFO "开始测试:访问软件包信息文档" - - # 步骤1:检查yum源中是否存在texlive-footmisc-doc软件包 - LOG_INFO "步骤1:检查yum源中是否存在texlive-footmisc-doc软件包" - dnf list available texlive-footmisc-doc - CHECK_RESULT $? 0 0 "yum源中未找到texlive-footmisc-doc软件包" - - # 步骤2:检查当前是否已安装texlive-footmisc-doc软件包 - LOG_INFO "步骤2:检查当前是否已安装texlive-footmisc-doc软件包" - rpm -q texlive-footmisc-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-footmisc-doc软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-footmisc-doc软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 步骤3:安装texlive-footmisc-doc软件包(如果未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-footmisc-doc软件包" - dnf install -y texlive-footmisc-doc - CHECK_RESULT $? 0 0 "安装texlive-footmisc-doc软件包失败" - fi - - # 步骤4:访问软件包信息文档 - LOG_INFO "步骤4:访问texlive-footmisc-doc软件包信息文档" - rpm -qi texlive-footmisc-doc - CHECK_RESULT $? 0 0 "访问texlive-footmisc-doc软件包信息文档失败" - - # 步骤5:检查软件包文档文件是否存在 - LOG_INFO "步骤5:检查texlive-footmisc-doc软件包文档文件是否存在" - rpm -ql texlive-footmisc-doc | grep -i footmisc - CHECK_RESULT $? 0 0 "texlive-footmisc-doc软件包文档文件不存在" - - # 步骤6:清理环境(如果测试前未安装,则卸载软件包) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤6:卸载texlive-footmisc-doc软件包" - dnf remove -y texlive-footmisc-doc - CHECK_RESULT $? 0 0 "卸载texlive-footmisc-doc软件包失败" - else - LOG_INFO "步骤6:保持texlive-footmisc-doc软件包安装状态" - fi - - LOG_INFO "测试完成:成功访问texlive-footmisc-doc软件包信息文档" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc/test_texlive-footmisc-doc_function_use_manpage.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc/test_texlive-footmisc-doc_function_use_manpage.sh deleted file mode 100644 index 3214a085bbb..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc/test_texlive-footmisc-doc_function_use_manpage.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : Test accessing the package man page -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:访问软件包man页面" - LOG_INFO "步骤1:检查yum源中是否存在texlive-footmisc-doc软件包" - dnf list available texlive-footmisc-doc &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-footmisc-doc软件包" - exit 255 - fi - CHECK_RESULT $? 0 0 "检查texlive-footmisc-doc软件包是否在yum源中失败" - - LOG_INFO "步骤2:检查系统是否已安装texlive-footmisc-doc" - rpm -q texlive-footmisc-doc &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-footmisc-doc已安装,测试后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-footmisc-doc未安装,将在测试后卸载" - INSTALLED=false - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装texlive-footmisc-doc软件包" - dnf install -y texlive-footmisc-doc - CHECK_RESULT $? 0 0 "安装texlive-footmisc-doc失败" - fi - - LOG_INFO "步骤4:访问texlive-footmisc-doc的man页面" - man -w texlive-footmisc-doc &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-footmisc-doc的man页面不存在或命令不支持" - exit 255 - fi - man texlive-footmisc-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "访问texlive-footmisc-doc的man页面失败" - - LOG_INFO "步骤5:清理测试环境" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-footmisc-doc软件包" - dnf remove -y texlive-footmisc-doc - CHECK_RESULT $? 0 0 "卸载texlive-footmisc-doc失败" - else - LOG_INFO "测试前已安装texlive-footmisc-doc,保持安装状态" - fi - - LOG_INFO "测试完成:成功访问texlive-footmisc-doc的man页面" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc/test_texlive-footmisc-doc_function_verify_files.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc/test_texlive-footmisc-doc_function_verify_files.sh deleted file mode 100644 index d00c43e6cbf..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-footmisc-doc/test_texlive-footmisc-doc_function_verify_files.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : Verify the existence of key documentation files -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:判断是否已安装texlive-footmisc-doc - LOG_INFO "步骤1:检查texlive-footmisc-doc是否已安装" - rpm -q texlive-footmisc-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-footmisc-doc已安装,测试结束将保持安装状态" - already_installed=1 - else - LOG_INFO "texlive-footmisc-doc未安装,将在测试过程中安装" - already_installed=0 - fi - - # 检查yum源中是否存在texlive-footmisc-doc软件包 - LOG_INFO "步骤2:检查yum源中是否存在texlive-footmisc-doc软件包" - dnf list available texlive-footmisc-doc - CHECK_RESULT $? 0 0 "yum源中未找到texlive-footmisc-doc软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-footmisc-doc软件包,退出" - exit 255 - fi - - # 安装texlive-footmisc-doc软件包(如果未安装) - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-footmisc-doc软件包" - dnf install -y texlive-footmisc-doc - CHECK_RESULT $? 0 0 "安装texlive-footmisc-doc失败" - fi - - # 验证关键文档文件的存在性 - LOG_INFO "步骤4:验证关键文档文件的存在性" - rpm -ql texlive-footmisc-doc | grep -E "\.pdf$|\.html$|\.txt$|README" - CHECK_RESULT $? 0 0 "未找到关键文档文件" - - # 具体检查几个关键文档文件 - LOG_INFO "步骤5:检查特定文档文件是否存在" - rpm -ql texlive-footmisc-doc | grep -q "README" - CHECK_RESULT $? 0 0 "README文件不存在" - rpm -ql texlive-footmisc-doc | grep -q "footmisc.pdf" - CHECK_RESULT $? 0 0 "footmisc.pdf文件不存在" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤6:清理环境,卸载texlive-footmisc-doc软件包" - dnf remove -y texlive-footmisc-doc - CHECK_RESULT $? 0 0 "卸载texlive-footmisc-doc失败" - else - LOG_INFO "步骤6:测试前已安装texlive-footmisc-doc,保持安装状态" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-nkarta/test_texlive-nkarta_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-nkarta/test_texlive-nkarta_function_basic.sh deleted file mode 100644 index de692fcea8b..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-nkarta/test_texlive-nkarta_function_basic.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-09-27 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试:Test basic functionality" - - # 检查是否已安装texlive-nkarta - LOG_INFO "检查texlive-nkarta是否已安装" - dnf list installed texlive-nkarta &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-nkarta已安装,测试结束后保持安装状态" - installed=true - else - LOG_INFO "texlive-nkarta未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有texlive-nkarta包 - LOG_INFO "检查yum源中是否有texlive-nkarta包" - dnf list available texlive-nkarta &> /dev/null - CHECK_RESULT $? 0 255 "yum源中未找到texlive-nkarta包" - - # 安装texlive-nkarta包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-nkarta" - dnf install -y texlive-nkarta &> /dev/null - CHECK_RESULT $? 0 0 "安装texlive-nkarta失败" - fi - - # 测试基本功能 - LOG_INFO "测试texlive-nkarta基本功能" - # 假设有一个基本命令test-command用于测试 - test-command --version &> /dev/null - CHECK_RESULT $? 0 255 "不支持--version参数或命令不存在" - - # 清理环境(如果之前未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-nkarta以恢复环境" - dnf remove -y texlive-nkarta &> /dev/null - CHECK_RESULT $? 0 0 "卸载texlive-nkarta失败" - fi - - LOG_INFO "测试完成:Test basic functionality" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-wordlike-doc/test_texlive-wordlike-doc_function_install.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-wordlike-doc/test_texlive-wordlike-doc_function_install.sh deleted file mode 100644 index 9884bc17209..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-wordlike-doc/test_texlive-wordlike-doc_function_install.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test installation of texlive-wordlike-doc -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已经安装了texlive-wordlike-doc - if dnf list installed texlive-wordlike-doc &>/dev/null; then - LOG_INFO "texlive-wordlike-doc已经安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "texlive-wordlike-doc未安装,将在测试后卸载" - installed=false - fi - - # 检查yum源中是否有texlive-wordlike-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-wordlike-doc软件包" - if ! dnf list available texlive-wordlike-doc &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-wordlike-doc软件包" - exit 255 - fi - - # 安装texlive-wordlike-doc软件包 - LOG_INFO "开始安装texlive-wordlike-doc软件包" - dnf install -y texlive-wordlike-doc - CHECK_RESULT $? 0 0 "安装texlive-wordlike-doc失败" - - # 验证安装是否成功 - LOG_INFO "验证texlive-wordlike-doc是否安装成功" - dnf list installed texlive-wordlike-doc &>/dev/null - CHECK_RESULT $? 0 0 "验证texlive-wordlike-doc安装失败" - - # 执行测试命令(假设测试命令为某个特定功能) - LOG_INFO "执行测试命令" - test_command_output=$(some_test_command_related_to_texlive_wordlike_doc) - CHECK_RESULT $? 0 0 "测试命令执行失败" - - # 如果之前未安装,则在脚本结束前卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-wordlike-doc软件包" - dnf remove -y texlive-wordlike-doc - CHECK_RESULT $? 0 0 "卸载texlive-wordlike-doc失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file