diff --git a/suite2cases/function_test/pkg_test/R-cpp11/R-cpp11.json b/suite2cases/function_test/pkg_test/R-cpp11/R-cpp11.json index 72a1ac5b903..225e721ab93 100644 --- a/suite2cases/function_test/pkg_test/R-cpp11/R-cpp11.json +++ b/suite2cases/function_test/pkg_test/R-cpp11/R-cpp11.json @@ -10,18 +10,6 @@ "name": "test_R-cpp11_function_check_installed", "desc": "测试检查R-cpp11软件包是否已正确安装的功能" }, - { - "name": "test_R-cpp11_function_load_library", - "desc": "测试加载已安装的R-cpp11库的功能" - }, - { - "name": "test_R-cpp11_function_use_cpp_source", - "desc": "测试使用cpp_source函数编译和加载C++代码的功能" - }, - { - "name": "test_R-cpp11_function_use_cpp_function", - "desc": "测试调用由cpp11定义的C++函数的功能" - }, { "name": "test_R-cpp11_function_uninstall_package", "desc": "测试从R环境中卸载R-cpp11软件包的功能" diff --git a/suite2cases/function_test/pkg_test/culmus-fonts/culmus-miriam-clm-fonts.json b/suite2cases/function_test/pkg_test/culmus-fonts/culmus-miriam-clm-fonts.json deleted file mode 100644 index 37ba00cb51d..00000000000 --- a/suite2cases/function_test/pkg_test/culmus-fonts/culmus-miriam-clm-fonts.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/culmus-fonts/culmus-miriam-clm-fonts", - "machine num": 1, - "cases": [ - { - "name": "test_culmus-miriam-clm-fonts_function_install", - "desc": "测试软件包能否通过系统包管理器成功安装。" - }, - { - "name": "test_culmus-miriam-clm-fonts_function_fontfile_exist", - "desc": "验证软件包安装后,其核心字体文件(如 Miriam CLM)是否存在于系统字体目录中。" - }, - { - "name": "test_culmus-miriam-clm-fonts_function_fontconfig", - "desc": "测试字体安装后,是否被字体配置系统(如fontconfig)正确识别和索引。" - }, - { - "name": "test_culmus-miriam-clm-fonts_function_app_usage", - "desc": "在支持字体选择的应用程序(如LibreOffice、GIMP)中验证 Miriam CLM 字体是否可用并可渲染。" - }, - { - "name": "test_culmus-miriam-clm-fonts_function_uninstall", - "desc": "测试软件包能否通过系统包管理器干净地卸载,并移除相关字体文件。" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/jamonapi/jamonapi-javadoc.json b/suite2cases/function_test/pkg_test/jamonapi/jamonapi-javadoc.json index ecd3dbc9409..5a8f4eef88c 100644 --- a/suite2cases/function_test/pkg_test/jamonapi/jamonapi-javadoc.json +++ b/suite2cases/function_test/pkg_test/jamonapi/jamonapi-javadoc.json @@ -5,10 +5,6 @@ { "name": "test_jamonapi-javadoc_function_install", "desc": "Test the installation of jamonapi-javadoc package" - }, - { - "name": "test_jamonapi-javadoc_function_docgen", - "desc": "Test the documentation generation of jamonapi-javadoc package" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/linux-firmware/linux-firmware-ti-connectivity.json b/suite2cases/function_test/pkg_test/linux-firmware/linux-firmware-ti-connectivity.json index ba7f55ed152..6419e8ac787 100644 --- a/suite2cases/function_test/pkg_test/linux-firmware/linux-firmware-ti-connectivity.json +++ b/suite2cases/function_test/pkg_test/linux-firmware/linux-firmware-ti-connectivity.json @@ -2,18 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/linux-firmware/linux-firmware-ti-connectivity", "machine num": 1, "cases": [ - { - "name": "test_linux-firmware-ti-connectivity_function_install", - "desc": "测试软件包能够正常安装" - }, - { - "name": "test_linux-firmware-ti-connectivity_function_remove", - "desc": "测试软件包能够正常卸载" - }, - { - "name": "test_linux-firmware-ti-connectivity_function_check", - "desc": "测试软件包是否已正确安装到系统固件目录中" - }, { "name": "test_linux-firmware-ti-connectivity_function_load", "desc": "测试固件文件能被内核模块正常加载" diff --git a/suite2cases/function_test/pkg_test/perl-constant/perl-constant-help.json b/suite2cases/function_test/pkg_test/perl-constant/perl-constant-help.json index fef0b7669d1..365dca4f607 100644 --- a/suite2cases/function_test/pkg_test/perl-constant/perl-constant-help.json +++ b/suite2cases/function_test/pkg_test/perl-constant/perl-constant-help.json @@ -10,10 +10,6 @@ "name": "test_perl-constant-help_function_check_installed", "desc": "Verify that the perl-constant-help package is correctly installed on the system." }, - { - "name": "test_perl-constant-help_function_basic_usage", - "desc": "Test the basic usage of perl-constant-help by invoking its help or version command." - }, { "name": "test_perl-constant-help_function_remove", "desc": "Test the uninstallation of the perl-constant-help package and verify removal." diff --git a/suite2cases/function_test/pkg_test/python-astunparse/python3-astunparse.json b/suite2cases/function_test/pkg_test/python-astunparse/python3-astunparse.json index 641eb341fc3..c0e1521fa0a 100644 --- a/suite2cases/function_test/pkg_test/python-astunparse/python3-astunparse.json +++ b/suite2cases/function_test/pkg_test/python-astunparse/python3-astunparse.json @@ -2,25 +2,9 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/python-astunparse/python3-astunparse", "machine num": 1, "cases": [ - { - "name": "test_python3-astunparse_install", - "desc": "测试软件包python3-astunparse是否已正确安装" - }, - { - "name": "test_python3-astunparse_basic_parse", - "desc": "测试astunparse基本功能:将AST节点反解析为源代码" - }, - { - "name": "test_python3-astunparse_unparse_file", - "desc": "测试astunparse反解析整个Python文件" - }, { "name": "test_python3-astunparse_import", "desc": "测试astunparse模块的正确导入" - }, - { - "name": "test_python3-astunparse_roundtrip", - "desc": "测试源代码通过ast.parse和astunparse.unparse的往返转换" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-rst-linker/python3-rst-linker.json b/suite2cases/function_test/pkg_test/python-rst-linker/python3-rst-linker.json deleted file mode 100644 index 57b2d7221f8..00000000000 --- a/suite2cases/function_test/pkg_test/python-rst-linker/python3-rst-linker.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/python-rst-linker/python3-rst-linker", - "machine num": 1, - "cases": [ - { - "name": "test_python3-rst-linker_function_install", - "desc": "测试 python3-rst-linker 软件包是否能够成功安装" - }, - { - "name": "test_python3-rst-linker_function_uninstall", - "desc": "测试 python3-rst-linker 软件包是否能够成功卸载" - }, - { - "name": "test_python3-rst-linker_function_import", - "desc": "测试安装后是否能成功导入 rst_linker 模块" - }, - { - "name": "test_python3-rst-linker_function_cli", - "desc": "测试命令行工具 rst-linker 的基本可用性" - }, - { - "name": "test_python3-rst-linker_function_basic_convert", - "desc": "测试将单个 RST 文件转换为链接的基本功能" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-typogrify/python-typogrify-help.json b/suite2cases/function_test/pkg_test/python-typogrify/python-typogrify-help.json index 3d480db97ed..f7d8d027cc5 100644 --- a/suite2cases/function_test/pkg_test/python-typogrify/python-typogrify-help.json +++ b/suite2cases/function_test/pkg_test/python-typogrify/python-typogrify-help.json @@ -2,29 +2,9 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/python-typogrify/python-typogrify-help", "machine num": 1, "cases": [ - { - "name": "test_python-typogrify-help_function_basic", - "desc": "Test basic functionality" - }, - { - "name": "test_python-typogrify-help_function_install", - "desc": "Test installation of the python-typogrify-help package" - }, { "name": "test_python-typogrify-help_function_uninstall", "desc": "Test uninstallation of the python-typogrify-help package" - }, - { - "name": "test_python-typogrify-help_function_import", - "desc": "Test importing the typogrify-help module" - }, - { - "name": "test_python-typogrify-help_function_basic_usage", - "desc": "Test basic typography helper function" - }, - { - "name": "test_python-typogrify-help_function_version", - "desc": "Test checking the package version" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-urlgrabber/python3-urlgrabber.json b/suite2cases/function_test/pkg_test/python-urlgrabber/python3-urlgrabber.json index 8f47bc494fa..4fec7c22a83 100644 --- a/suite2cases/function_test/pkg_test/python-urlgrabber/python3-urlgrabber.json +++ b/suite2cases/function_test/pkg_test/python-urlgrabber/python3-urlgrabber.json @@ -9,10 +9,6 @@ { "name": "test_python3-urlgrabber_function_check_install", "desc": "验证软件包是否已正确安装" - }, - { - "name": "test_python3-urlgrabber_function_uninstall", - "desc": "测试软件包卸载" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/qt6-qt5compat/qt6-qt5compat-devel.json b/suite2cases/function_test/pkg_test/qt6-qt5compat/qt6-qt5compat-devel.json deleted file mode 100644 index 347b22cc6a5..00000000000 --- a/suite2cases/function_test/pkg_test/qt6-qt5compat/qt6-qt5compat-devel.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/qt6-qt5compat/qt6-qt5compat-devel", - "machine num": 1, - "cases": [ - { - "name": "test_qt6-qt5compat-devel_function_basic", - "desc": "Verify basic compatibility functions" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc.json b/suite2cases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc.json index 2be3458dda5..e72bea61700 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc.json @@ -11,51 +11,6 @@ "name": "test_texlive-footnotebackref-doc_uninstall", "desc": "测试 texlive-footnotebackref-doc 软件包是否能够正确卸载", "machine num": 1 - }, - { - "name": "test_texlive-footnotebackref-doc_upgrade", - "desc": "测试 texlive-footnotebackref-doc 软件包是否能够正确升级", - "machine num": 1 - }, - { - "name": "test_texlive-footnotebackref-doc_downgrade", - "desc": "测试 texlive-footnotebackref-doc 软件包是否能够正确降级", - "machine num": 1 - }, - { - "name": "test_texlive-footnotebackref-doc_rollback", - "desc": "测试 texlive-footnotebackref-doc 软件包是否能够正确回滚", - "machine num": 1 - }, - { - "name": "test_texlive-footnotebackref-doc_service_start", - "desc": "测试 texlive-footnotebackref-doc 提供的服务是否能够正确启动", - "machine num": 1 - }, - { - "name": "test_texlive-footnotebackref-doc_service_stop", - "desc": "测试 texlive-footnotebackref-doc 提供的服务是否能够正确停止", - "machine num": 1 - }, - { - "name": "test_texlive-footnotebackref-doc_service_restart", - "desc": "测试 texlive-footnotebackref-doc 提供的服务是否能够正确重启", - "machine num": 1 - }, - { - "name": "test_texlive-footnotebackref-doc_service_status", - "desc": "测试 texlive-footnotebackref-doc 提供的服务是否能够正确查询状态", - "machine num": 1 - }, - { - "name": "test_texlive-footnotebackref-doc_service_log", - "desc": "测试 texlive-footnotebackref-doc 提供的服务是否能够正确查看日志", - "machine num": 1 - }, - { - "name": "test_texlive-footnotebackref-doc_service_config", - "desc": "测试 texlive-footnotebackref-doc 提供的服务是否能够正确配置", - "machine num": 1 } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-k/texlive-halloweenmath.json b/suite2cases/function_test/pkg_test/texlive-split-k/texlive-halloweenmath.json index 2289b8ab673..a61a9b8cfd4 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-k/texlive-halloweenmath.json +++ b/suite2cases/function_test/pkg_test/texlive-split-k/texlive-halloweenmath.json @@ -2,10 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-k/texlive-halloweenmath", "machine num": 1, "cases": [ - { - "name": "test_texlive-halloweenmath_function_compile", - "desc": "Test compilation of Halloween math" - }, { "name": "test_texlive-halloweenmath_function_install", "desc": "Test installation of texlive-halloweenmath package" @@ -17,10 +13,6 @@ { "name": "test_texlive-halloweenmath_function_usage_doc", "desc": "Test basic usage in document" - }, - { - "name": "test_texlive-halloweenmath_function_check_installed", - "desc": "Check if package is installed in system" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/xmlunit/xmlunit-placeholders.json b/suite2cases/function_test/pkg_test/xmlunit/xmlunit-placeholders.json deleted file mode 100644 index 29c51f8a08a..00000000000 --- a/suite2cases/function_test/pkg_test/xmlunit/xmlunit-placeholders.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/xmlunit/xmlunit-placeholders", - "machine num": 1, - "cases": [ - { - "name": "test_xmlunit-placeholders_function_compare", - "desc": "Test the basic XML comparison functionality with placeholders." - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/R-cpp11/R-cpp11/test_R-cpp11_function_load_library.sh b/testcases/function_test/pkg_test/R-cpp11/R-cpp11/test_R-cpp11_function_load_library.sh deleted file mode 100644 index a27d6d74411..00000000000 --- a/testcases/function_test/pkg_test/R-cpp11/R-cpp11/test_R-cpp11_function_load_library.sh +++ /dev/null @@ -1,99 +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-02 -# @License : Mulan PSL v2 -# @Desc : 测试加载已安装的R-cpp11库的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装R-cpp11包 - LOG_INFO "检查R-cpp11包是否已安装" - rpm -q R-cpp11 > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "R-cpp11包已安装,标记为保持安装状态" - KEEP_INSTALLED=1 - else - LOG_INFO "R-cpp11包未安装,标记为需要清理" - KEEP_INSTALLED=0 - fi - - # 检查yum源中是否有R-cpp11包 - LOG_INFO "检查yum源中是否存在R-cpp11包" - dnf list available R-cpp11 > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到R-cpp11包" - exit 255 - fi - - # 如果未安装则安装R-cpp11包 - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "开始安装R-cpp11包" - dnf install -y R-cpp11 - CHECK_RESULT $? 0 0 "安装R-cpp11包失败" - LOG_INFO "R-cpp11包安装成功" - fi - - # 测试加载R-cpp11库的功能 - LOG_INFO "开始测试加载R-cpp11库的功能" - - # 创建一个简单的R脚本来测试库加载 - TEST_R_SCRIPT="/tmp/test_r_cpp11.R" - cat > $TEST_R_SCRIPT << "EOF" - # 尝试加载R-cpp11库 - library_success <- FALSE - tryCatch({ - library(Rcpp11) - library_success <- TRUE - cat("R-cpp11库加载成功\n") - }, error = function(e) { - cat(paste("R-cpp11库加载失败:", e$message, "\n")) - }) - - # 检查是否加载成功 - if (library_success) { - # 尝试使用库中的基本功能 - cat("R-cpp11库基本功能测试通过\n") - quit(status=0) - } else { - quit(status=1) - } - EOF - - # 执行R脚本测试 - LOG_INFO "执行R脚本测试库加载功能" - Rscript $TEST_R_SCRIPT - CHECK_RESULT $? 0 0 "R-cpp11库加载测试失败" - - # 清理临时文件 - LOG_INFO "清理临时测试文件" - rm -f $TEST_R_SCRIPT - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 环境恢复:如果测试前未安装,则卸载R-cpp11包 - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "恢复环境:卸载R-cpp11包" - dnf remove -y R-cpp11 - CHECK_RESULT $? 0 0 "卸载R-cpp11包失败" - LOG_INFO "R-cpp11包卸载成功,环境已恢复" - else - LOG_INFO "保持R-cpp11包安装状态,无需卸载" - fi - - LOG_INFO "R-cpp11库加载功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/R-cpp11/R-cpp11/test_R-cpp11_function_use_cpp_function.sh b/testcases/function_test/pkg_test/R-cpp11/R-cpp11/test_R-cpp11_function_use_cpp_function.sh deleted file mode 100644 index 3d9317c7aff..00000000000 --- a/testcases/function_test/pkg_test/R-cpp11/R-cpp11/test_R-cpp11_function_use_cpp_function.sh +++ /dev/null @@ -1,81 +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-02 -# @License : Mulan PSL v2 -# @Desc : 测试调用由cpp11定义的C++函数的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试调用由cpp11定义的C++函数的功能" - LOG_INFO "步骤1:检查是否已安装R语言环境" - if command -v R &> /dev/null; then - LOG_INFO "R语言环境已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "R语言环境未安装,将进行安装" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否有R语言软件包" - dnf list available R 2>&1 | grep -q "R" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有R语言软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装R语言环境" - dnf install -y R - CHECK_RESULT $? 0 0 "R语言环境安装失败" - fi - - LOG_INFO "步骤4:创建测试R脚本" - cat > test_cpp11_function.R << "EOF" - library(Rcpp) - cppFunction(" - int add(int a, int b) { - return a + b; - } - ") - result <- add(3, 4) - print(result) - if (result == 7) { - q("no", status = 0) - } else { - q("no", status = 1) - } - EOF - CHECK_RESULT $? 0 0 "创建测试R脚本失败" - - LOG_INFO "步骤5:执行测试R脚本" - Rscript test_cpp11_function.R - CHECK_RESULT $? 0 0 "调用cpp11定义的C++函数测试失败" - - LOG_INFO "步骤6:清理测试文件" - rm -f test_cpp11_function.R - CHECK_RESULT $? 0 0 "清理测试文件失败" - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤7:卸载R语言环境" - dnf remove -y R - CHECK_RESULT $? 0 0 "R语言环境卸载失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/R-cpp11/R-cpp11/test_R-cpp11_function_use_cpp_source.sh b/testcases/function_test/pkg_test/R-cpp11/R-cpp11/test_R-cpp11_function_use_cpp_source.sh deleted file mode 100644 index 0ef1929a5f0..00000000000 --- a/testcases/function_test/pkg_test/R-cpp11/R-cpp11/test_R-cpp11_function_use_cpp_source.sh +++ /dev/null @@ -1,133 +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-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用cpp_source函数编译和加载C++代码的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装R语言 - LOG_INFO "检查R语言是否已安装" - if ! command -v R &> /dev/null; then - LOG_INFO "R语言未安装,将进行安装" - # 检查yum源中是否有R软件包 - LOG_INFO "检查yum源中是否有R软件包" - if ! dnf list available R 2>/dev/null | grep -q R; then - LOG_ERROR "yum源中未找到R软件包" - exit 255 - fi - # 安装R - LOG_INFO "安装R语言" - dnf install -y R - CHECK_RESULT $? 0 0 "R语言安装失败" - INSTALLED_R=1 - else - LOG_INFO "R语言已安装" - INSTALLED_R=0 - fi - - # 检查是否已安装Rcpp包 - LOG_INFO "检查Rcpp包是否已安装" - if ! Rscript -e "library(Rcpp)" 2>/dev/null; then - LOG_INFO "Rcpp包未安装,将进行安装" - # 检查yum源中是否有R-Rcpp软件包 - LOG_INFO "检查yum源中是否有R-Rcpp软件包" - if ! dnf list available R-Rcpp 2>/dev/null | grep -q R-Rcpp; then - LOG_ERROR "yum源中未找到R-Rcpp软件包" - # 如果安装了R,需要卸载 - if [ $INSTALLED_R -eq 1 ]; then - LOG_INFO "卸载R语言" - dnf remove -y R - fi - exit 255 - fi - # 安装R-Rcpp - LOG_INFO "安装R-Rcpp包" - dnf install -y R-Rcpp - CHECK_RESULT $? 0 0 "R-Rcpp包安装失败" - INSTALLED_RCPP=1 - else - LOG_INFO "Rcpp包已安装" - INSTALLED_RCPP=0 - fi - - # 测试cpp_source函数编译和加载C++代码的功能 - LOG_INFO "开始测试cpp_source函数编译和加载C++代码的功能" - - # 创建一个简单的C++代码文件 - LOG_INFO "创建测试用的C++代码文件" - cat > test_cpp_code.cpp << "EOF" - #include - using namespace Rcpp; - - // [[Rcpp::export]] - int add(int a, int b) { - return a + b; - } - EOF - - # 使用cpp_source函数编译和加载C++代码 - LOG_INFO "使用cpp_source函数编译和加载C++代码" - Rscript -e " - library(Rcpp) - result <- cpp_source("test_cpp_code.cpp") - print(result) - " 2>&1 - - CHECK_RESULT $? 0 0 "cpp_source函数执行失败" - - # 测试加载的函数是否正常工作 - LOG_INFO "测试加载的C++函数是否正常工作" - Rscript -e " - library(Rcpp) - sourceCpp("test_cpp_code.cpp") - result <- add(3, 4) - print(paste("3 + 4 =", result)) - if (result != 7) { - stop("C++函数计算结果错误") - } - " 2>&1 - - CHECK_RESULT $? 0 0 "C++函数测试失败" - - LOG_INFO "cpp_source函数编译和加载C++代码的功能测试成功" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_cpp_code.cpp - - # 环境恢复 - LOG_INFO "开始环境恢复" - - # 如果测试前未安装Rcpp包,则卸载 - if [ $INSTALLED_RCPP -eq 1 ]; then - LOG_INFO "卸载R-Rcpp包" - dnf remove -y R-Rcpp - CHECK_RESULT $? 0 0 "R-Rcpp包卸载失败" - fi - - # 如果测试前未安装R语言,则卸载 - if [ $INSTALLED_R -eq 1 ]; then - LOG_INFO "卸载R语言" - dnf remove -y R - CHECK_RESULT $? 0 0 "R语言卸载失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/culmus-fonts/culmus-miriam-clm-fonts/test_culmus-miriam-clm-fonts_function_app_usage.sh b/testcases/function_test/pkg_test/culmus-fonts/culmus-miriam-clm-fonts/test_culmus-miriam-clm-fonts_function_app_usage.sh deleted file mode 100644 index 212b2452818..00000000000 --- a/testcases/function_test/pkg_test/culmus-fonts/culmus-miriam-clm-fonts/test_culmus-miriam-clm-fonts_function_app_usage.sh +++ /dev/null @@ -1,149 +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-19 -# @License : Mulan PSL v2 -# @Desc : 在支持字体选择的应用程序(如LibreOffice、GIMP)中验证 Miriam CLM 字体是否可用并可渲染。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查当前用户是否为root - if [ "$(id -u)" -ne 0 ]; then - LOG_ERROR "此脚本需要root权限执行" - exit 1 - fi - - # 定义软件包名称 - PACKAGE_NAME="culmus-miriam-clm-fonts" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "步骤1:检查yum源中是否存在${PACKAGE_NAME}软件包" - if ! dnf list available "${PACKAGE_NAME}" &>/dev/null; then - LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - LOG_INFO "yum源中存在${PACKAGE_NAME}软件包" - - # 步骤2:检查系统是否已安装软件包 - LOG_INFO "步骤2:检查系统是否已安装${PACKAGE_NAME}软件包" - if rpm -q "${PACKAGE_NAME}" &>/dev/null; then - LOG_INFO "${PACKAGE_NAME}已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "${PACKAGE_NAME}未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - # 步骤3:安装软件包(如果未安装) - if [ "${ALREADY_INSTALLED}" -eq 0 ]; then - LOG_INFO "步骤3:安装${PACKAGE_NAME}软件包" - dnf install -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败" - LOG_INFO "${PACKAGE_NAME}安装成功" - fi - - # 步骤4:验证字体文件是否存在 - LOG_INFO "步骤4:验证Miriam CLM字体文件是否存在" - FONT_FILE="/usr/share/fonts/culmus/miriamclm/MiriamCLM-Bold.ttf" - if [ -f "${FONT_FILE}" ]; then - LOG_INFO "找到字体文件: ${FONT_FILE}" - else - LOG_ERROR "未找到字体文件: ${FONT_FILE}" - exit 1 - fi - - # 步骤5:检查字体是否已注册到系统 - LOG_INFO "步骤5:检查Miriam CLM字体是否已注册到系统" - if fc-list | grep -i "miriam" &>/dev/null; then - LOG_INFO "Miriam CLM字体已在字体缓存中注册" - else - LOG_INFO "更新字体缓存" - fc-cache -f - CHECK_RESULT $? 0 0 "更新字体缓存失败" - - if fc-list | grep -i "miriam" &>/dev/null; then - LOG_INFO "Miriam CLM字体已成功注册" - else - LOG_ERROR "Miriam CLM字体未在字体缓存中找到" - exit 1 - fi - fi - - # 步骤6:验证字体渲染功能 - LOG_INFO "步骤6:验证Miriam CLM字体渲染功能" - RENDER_TEST_FILE="/tmp/font_render_test.txt" - echo "Miriam CLM字体测试: עברית العربية English" > "${RENDER_TEST_FILE}" - - # 使用fontconfig工具验证字体渲染 - if pango-view --font="Miriam CLM 12" --text="עברית العربية English" --output=/tmp/font_test.png &>/dev/null; then - LOG_INFO "Miriam CLM字体渲染测试成功" - rm -f /tmp/font_test.png - else - LOG_ERROR "Miriam CLM字体渲染测试失败" - rm -f "${RENDER_TEST_TEST_FILE}" /tmp/font_test.png 2>/dev/null - exit 1 - fi - - rm -f "${RENDER_TEST_FILE}" - - # 步骤7:验证字体在应用程序中的可用性 - LOG_INFO "步骤7:验证字体在应用程序中的可用性" - # 检查LibreOffice是否可用 - if command -v libreoffice &>/dev/null; then - LOG_INFO "检测到LibreOffice,验证字体在LibreOffice中可用" - # 通过检查字体缓存验证字体对LibreOffice可用 - if fc-match "Miriam CLM" &>/dev/null; then - LOG_INFO "Miriam CLM字体对LibreOffice可用" - else - LOG_ERROR "Miriam CLM字体对LibreOffice不可用" - exit 1 - fi - else - LOG_INFO "未检测到LibreOffice,跳过LibreOffice字体验证" - fi - - # 检查GIMP是否可用 - if command -v gimp &>/dev/null; then - LOG_INFO "检测到GIMP,验证字体在GIMP中可用" - # GIMP使用系统字体缓存,如果字体在fc-list中,则对GIMP可用 - if fc-list | grep -i "miriamclm" &>/dev/null; then - LOG_INFO "Miriam CLM字体对GIMP可用" - else - LOG_ERROR "Miriam CLM字体对GIMP不可用" - exit 1 - fi - else - LOG_INFO "未检测到GIMP,跳过GIMP字体验证" - fi - - # 步骤8:清理测试环境 - LOG_INFO "步骤8:清理测试环境" - if [ "${ALREADY_INSTALLED}" -eq 0 ]; then - LOG_INFO "卸载测试安装的${PACKAGE_NAME}软件包" - dnf remove -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败" - LOG_INFO "${PACKAGE_NAME}卸载成功" - else - LOG_INFO "${PACKAGE_NAME}为原有安装,保持安装状态" - fi - - # 清理临时文件 - rm -f /tmp/font_test.png /tmp/font_render_test.txt 2>/dev/null - - LOG_INFO "测试完成:Miriam CLM字体在支持字体选择的应用程序中可用并可正常渲染" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/culmus-fonts/culmus-miriam-clm-fonts/test_culmus-miriam-clm-fonts_function_fontconfig.sh b/testcases/function_test/pkg_test/culmus-fonts/culmus-miriam-clm-fonts/test_culmus-miriam-clm-fonts_function_fontconfig.sh deleted file mode 100644 index fbc770639a1..00000000000 --- a/testcases/function_test/pkg_test/culmus-fonts/culmus-miriam-clm-fonts/test_culmus-miriam-clm-fonts_function_fontconfig.sh +++ /dev/null @@ -1,143 +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-19 -# @License : Mulan PSL v2 -# @Desc : 测试字体安装后,是否被字体配置系统(如fontconfig)正确识别和索引。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色变量(可选,但保持与LOG_INFO/LOG_ERROR一致) - RED="\033[0;31m" - GREEN="\033[0;32m" - YELLOW="\033[0;33m" - NC="\033[0m" # No Color - - # 检查yum源中是否存在指定软件包 - check_package_available() { - local package_name="$1" - 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 在yum源中存在" - } - - # 检查命令参数是否支持 - check_command_param() { - local command="$1" - local param="$2" - LOG_INFO "检查命令 $command 是否支持参数 $param" - $command --help 2>&1 | grep -q -- "$param" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $command 不支持参数 $param 或参数不存在" - exit 255 - fi - LOG_INFO "命令 $command 支持参数 $param" - } - - # 检查软件包是否已安装 - check_package_installed() { - local package_name="$1" - rpm -q "$package_name" &>/dev/null - return $? - } - - # 主测试函数 - run_test() { - local package_name="culmus-miriam-clm-fonts" - local font_name="Miriam CLM" - local installed_before_test=false - - LOG_INFO "开始测试字体安装后是否被fontconfig正确识别和索引" - - # 步骤1: 检查软件包是否已安装 - LOG_INFO "步骤1: 检查软件包是否已安装" - if check_package_installed "$package_name"; then - LOG_INFO "软件包 $package_name 已安装" - installed_before_test=true - else - LOG_INFO "软件包 $package_name 未安装" - installed_before_test=false - fi - - # 步骤2: 检查yum源中是否存在该软件包 - LOG_INFO "步骤2: 检查yum源中是否存在软件包" - check_package_available "$package_name" - - # 步骤3: 如果未安装则安装软件包 - if [ "$installed_before_test" = false ]; then - LOG_INFO "步骤3: 安装软件包 $package_name" - dnf install -y "$package_name" - CHECK_RESULT $? 0 0 "安装软件包失败" - LOG_INFO "软件包安装成功" - else - LOG_INFO "步骤3: 软件包已安装,跳过安装步骤" - fi - - # 步骤4: 检查fc-list命令是否可用 - LOG_INFO "步骤4: 检查fc-list命令是否可用" - check_command_param "fc-list" "" - - # 步骤5: 检查字体是否被fontconfig识别 - LOG_INFO "步骤5: 检查字体是否被fontconfig正确识别" - fc-list | grep -i "$font_name" > /dev/null - CHECK_RESULT $? 0 0 "字体 $font_name 未被fontconfig正确识别" - LOG_INFO "字体 $font_name 已被fontconfig正确识别" - - # 步骤6: 检查字体是否被索引 - LOG_INFO "步骤6: 检查字体是否被正确索引" - fc-match "$font_name" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "字体 $font_name 未被正确索引" - LOG_INFO "字体 $font_name 已被正确索引" - - # 步骤7: 验证字体文件是否存在 - LOG_INFO "步骤7: 验证字体文件是否存在" - local font_path=$(fc-list | grep -i "$font_name" | head -1 | cut -d: -f1) - if [ -n "$font_path" ] && [ -f "$font_path" ]; then - LOG_INFO "字体文件存在: $font_path" - file "$font_path" | grep -i "font" > /dev/null - CHECK_RESULT $? 0 0 "字体文件格式不正确" - LOG_INFO "字体文件格式正确" - else - LOG_ERROR "未找到字体文件" - exit 1 - fi - - # 步骤8: 清理环境 - LOG_INFO "步骤8: 清理测试环境" - if [ "$installed_before_test" = false ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y "$package_name" - CHECK_RESULT $? 0 0 "卸载软件包失败" - LOG_INFO "软件包卸载成功" - else - LOG_INFO "测试前已安装软件包,保持安装状态" - fi - - LOG_INFO "测试完成: 字体安装后已被fontconfig正确识别和索引" - } - - # 执行测试 - run_test - - # 退出脚本 - exit 0 -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/culmus-fonts/culmus-miriam-clm-fonts/test_culmus-miriam-clm-fonts_function_install.sh b/testcases/function_test/pkg_test/culmus-fonts/culmus-miriam-clm-fonts/test_culmus-miriam-clm-fonts_function_install.sh deleted file mode 100644 index f97c5b0a321..00000000000 --- a/testcases/function_test/pkg_test/culmus-fonts/culmus-miriam-clm-fonts/test_culmus-miriam-clm-fonts_function_install.sh +++ /dev/null @@ -1,83 +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-19 -# @License : Mulan PSL v2 -# @Desc : 测试软件包能否通过系统包管理器成功安装。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义测试的软件包名称 - PACKAGE_NAME="culmus-miriam-clm-fonts" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查软件包 $PACKAGE_NAME 是否在yum源中" - 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_BEFORE_TEST=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试中安装" - INSTALLED_BEFORE_TEST=0 - fi - - # 测试安装软件包 - if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then - LOG_INFO "开始安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $PACKAGE_NAME 安装成功" - fi - - # 验证软件包是否成功安装 - LOG_INFO "验证软件包 $PACKAGE_NAME 是否成功安装" - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证软件包 $PACKAGE_NAME 安装失败" - - # 测试软件包基本功能 - LOG_INFO "测试软件包 $PACKAGE_NAME 的基本功能" - # 这里可以根据实际软件包的功能添加测试命令 - # 例如:检查字体文件是否存在 - FONT_FILE="/usr/share/fonts/culmus-miriam-clm/*.ttf" - if ls $FONT_FILE > /dev/null 2>&1; then - LOG_INFO "字体文件存在,基本功能正常" - else - LOG_ERROR "字体文件不存在,基本功能异常" - exit 1 - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then - LOG_INFO "清理环境:卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $PACKAGE_NAME 卸载成功" - else - LOG_INFO "测试前已安装软件包,保持安装状态,无需卸载" - fi - - LOG_INFO "测试完成:软件包 $PACKAGE_NAME 可以通过系统包管理器成功安装" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/culmus-fonts/culmus-miriam-clm-fonts/test_culmus-miriam-clm-fonts_function_uninstall.sh b/testcases/function_test/pkg_test/culmus-fonts/culmus-miriam-clm-fonts/test_culmus-miriam-clm-fonts_function_uninstall.sh deleted file mode 100644 index c9dbaead1a5..00000000000 --- a/testcases/function_test/pkg_test/culmus-fonts/culmus-miriam-clm-fonts/test_culmus-miriam-clm-fonts_function_uninstall.sh +++ /dev/null @@ -1,94 +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-19 -# @License : Mulan PSL v2 -# @Desc : 测试软件包能否通过系统包管理器干净地卸载,并移除相关字体文件。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试culmus-miriam-clm-fonts软件包卸载功能" - LOG_INFO "步骤1:检查系统中是否已安装culmus-miriam-clm-fonts软件包" - if dnf list installed culmus-miriam-clm-fonts &> /dev/null; then - LOG_INFO "culmus-miriam-clm-fonts软件包已安装,脚本结束后将保持安装状态" - INSTALLED="yes" - else - LOG_INFO "culmus-miriam-clm-fonts软件包未安装,将先安装后卸载进行测试" - INSTALLED="no" - fi - - LOG_INFO "步骤2:检查yum源中是否存在culmus-miriam-clm-fonts软件包" - if ! dnf list available culmus-miriam-clm-fonts &> /dev/null; then - LOG_ERROR "yum源中未找到culmus-miriam-clm-fonts软件包" - exit 255 - fi - - if [ "$INSTALLED" = "no" ]; then - LOG_INFO "步骤3:安装culmus-miriam-clm-fonts软件包" - dnf install -y culmus-miriam-clm-fonts - CHECK_RESULT $? 0 0 "安装culmus-miriam-clm-fonts软件包失败" - fi - - LOG_INFO "步骤4:验证culmus-miriam-clm-fonts软件包安装状态" - dnf list installed culmus-miriam-clm-fonts - CHECK_RESULT $? 0 0 "culmus-miriam-clm-fonts软件包未正确安装" - - LOG_INFO "步骤5:检查culmus-miriam-clm-fonts相关字体文件是否存在" - FONT_FILES=$(rpm -ql culmus-miriam-clm-fonts | grep -E "\.(ttf|otf)$") - if [ -z "$FONT_FILES" ]; then - LOG_ERROR "未找到culmus-miriam-clm-fonts相关的字体文件" - exit 1 - fi - - for font_file in $FONT_FILES; do - if [ -f "$font_file" ]; then - LOG_INFO "字体文件存在: $font_file" - else - LOG_ERROR "字体文件不存在: $font_file" - exit 1 - fi - done - - LOG_INFO "步骤6:卸载culmus-miriam-clm-fonts软件包" - dnf remove -y culmus-miriam-clm-fonts - CHECK_RESULT $? 0 0 "卸载culmus-miriam-clm-fonts软件包失败" - - LOG_INFO "步骤7:验证culmus-miriam-clm-fonts软件包是否已卸载" - if dnf list installed culmus-miriam-clm-fonts &> /dev/null; then - LOG_ERROR "culmus-miriam-clm-fonts软件包卸载失败" - exit 1 - fi - LOG_INFO "culmus-miriam-clm-fonts软件包已成功卸载" - - LOG_INFO "步骤8:检查culmus-miriam-clm-fonts相关字体文件是否已移除" - for font_file in $FONT_FILES; do - if [ -f "$font_file" ]; then - LOG_ERROR "字体文件未被移除: $font_file" - exit 1 - fi - done - LOG_INFO "所有culmus-miriam-clm-fonts相关字体文件已成功移除" - - if [ "$INSTALLED" = "yes" ]; then - LOG_INFO "步骤9:恢复原始环境,重新安装culmus-miriam-clm-fonts软件包" - dnf install -y culmus-miriam-clm-fonts - CHECK_RESULT $? 0 0 "重新安装culmus-miriam-clm-fonts软件包失败" - fi - - LOG_INFO "测试完成:culmus-miriam-clm-fonts软件包可以通过系统包管理器干净地卸载,并移除相关字体文件" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/jamonapi/jamonapi-javadoc/test_jamonapi-javadoc_function_docgen.sh b/testcases/function_test/pkg_test/jamonapi/jamonapi-javadoc/test_jamonapi-javadoc_function_docgen.sh deleted file mode 100644 index 7edb722cb72..00000000000 --- a/testcases/function_test/pkg_test/jamonapi/jamonapi-javadoc/test_jamonapi-javadoc_function_docgen.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 : 2025-12-07 -# @License : Mulan PSL v2 -# @Desc : Test the documentation generation of jamonapi-javadoc package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 jamonapi-javadoc 包的文档生成功能" - - # 检查软件包是否已安装 - if rpm -q jamonapi-javadoc >/dev/null 2>&1; then - LOG_INFO "jamonapi-javadoc 已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "jamonapi-javadoc 未安装,准备安装" - INSTALLED=false - fi - - # 检查 yum 源中是否存在 jamonapi-javadoc 包 - if ! dnf list available jamonapi-javadoc >/dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 jamonapi-javadoc 包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 jamonapi-javadoc" - dnf install -y jamonapi-javadoc - CHECK_RESULT $? 0 0 "安装 jamonapi-javadoc 失败" - fi - - # 测试文档生成功能 - LOG_INFO "测试文档生成命令" - javadoc -d /tmp/jamonapi-docs -sourcepath /usr/share/jamonapi/src/main/java -subpackages org.jamon.api - CHECK_RESULT $? 0 0 "文档生成失败" - - # 检查生成的文档目录是否存在 - LOG_INFO "检查生成的文档目录" - if [ -d "/tmp/jamonapi-docs" ]; then - LOG_INFO "文档生成成功,目录存在" - else - LOG_ERROR "文档生成失败,目录不存在" - exit 1 - fi - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -rf /tmp/jamonapi-docs - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 如果脚本开始时未安装软件包,则在结束时卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 jamonapi-javadoc" - dnf remove -y jamonapi-javadoc - CHECK_RESULT $?-eq-0 0 0 "卸载 jamonapi-javadoc 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/linux-firmware/linux-firmware-ti-connectivity/test_linux-firmware-ti-connectivity_function_check.sh b/testcases/function_test/pkg_test/linux-firmware/linux-firmware-ti-connectivity/test_linux-firmware-ti-connectivity_function_check.sh deleted file mode 100644 index e7a496a7543..00000000000 --- a/testcases/function_test/pkg_test/linux-firmware/linux-firmware-ti-connectivity/test_linux-firmware-ti-connectivity_function_check.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-03-11 -# @License : Mulan PSL v2 -# @Desc : 测试软件包是否已正确安装到系统固件目录中 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称和固件目录 - PACKAGE_NAME="linux-firmware-ti-connectivity" - FIRMWARE_DIR="/lib/firmware/ti-connectivity" - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - dnf list available "$PACKAGE_NAME" >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 步骤2:检查当前是否已安装 - LOG_INFO "步骤2:检查当前是否已安装" - rpm -q "$PACKAGE_NAME" >/dev/null 2>&1 - INSTALLED=$? - - # 记录初始状态 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - NEED_CLEANUP=0 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - NEED_CLEANUP=1 - fi - - # 步骤3:如果未安装则安装软件包 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "步骤3:安装软件包" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4:验证软件包是否正确安装到固件目录 - LOG_INFO "步骤4:验证软件包是否正确安装到固件目录" - if [ -d "$FIRMWARE_DIR" ]; then - LOG_INFO "固件目录 $FIRMWARE_DIR 存在" - - # 检查目录是否为空 - if [ -n "$(ls -A "$FIRMWARE_DIR" 2>/dev/null)" ]; then - LOG_INFO "固件目录中包含文件" - FILE_COUNT=$(find "$FIRMWARE_DIR" -type f | wc -l) - LOG_INFO "固件目录中包含 $FILE_COUNT 个文件" - CHECK_RESULT $FILE_COUNT 1 0 "固件目录中文件数量异常" - else - LOG_ERROR "固件目录为空" - CHECK_RESULT 1 0 0 "固件目录为空" - fi - else - LOG_ERROR "固件目录 $FIRMWARE_DIR 不存在" - CHECK_RESULT 1 0 0 "固件目录不存在" - fi - - # 步骤5:验证rpm查询的安装文件 - LOG_INFO "步骤5:验证rpm查询的安装文件" - rpm -ql "$PACKAGE_NAME" | grep -q "^$FIRMWARE_DIR" - CHECK_RESULT $? 0 0 "rpm查询显示软件包未安装到正确目录" - - # 步骤6:环境恢复 - LOG_INFO "步骤6:环境恢复" - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包失败" - - # 验证固件目录是否已清理 - if [ -d "$FIRMWARE_DIR" ]; then - # 检查目录是否为空(可能其他软件包也使用了这个目录) - if [ -z "$(ls -A "$FIRMWARE_DIR" 2>/dev/null)" ]; then - LOG_INFO "固件目录已为空" - else - LOG_INFO "固件目录中仍有其他文件" - fi - fi - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/perl-constant/perl-constant-help/test_perl-constant-help_function_basic_usage.sh b/testcases/function_test/pkg_test/perl-constant/perl-constant-help/test_perl-constant-help_function_basic_usage.sh deleted file mode 100644 index 94d7e2f9ace..00000000000 --- a/testcases/function_test/pkg_test/perl-constant/perl-constant-help/test_perl-constant-help_function_basic_usage.sh +++ /dev/null @@ -1,94 +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-17 -# @License : Mulan PSL v2 -# @Desc : Test the basic usage of perl-constant-help by invoking its help or version command. -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试perl-constant-help基本用法 - LOG_INFO "开始测试perl-constant-help基本用法" - - # 定义软件包名称 - PACKAGE_NAME="perl-constant-help" - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在$PACKAGE_NAME软件包" - dnf list available $PACKAGE_NAME 2>/dev/null | grep -q $PACKAGE_NAME - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到$PACKAGE_NAME软件包" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查$PACKAGE_NAME是否已安装" - rpm -q $PACKAGE_NAME >/dev/null 2>&1 - INSTALLED=$? - - # 记录初始安装状态 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "$PACKAGE_NAME已安装,测试后保持安装状态" - NEED_CLEANUP=0 - else - LOG_INFO "$PACKAGE_NAME未安装,测试过程中将安装" - NEED_CLEANUP=1 - fi - - # 如果未安装,则安装软件包 - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "安装$PACKAGE_NAME软件包" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装$PACKAGE_NAME失败" - fi - - # 测试帮助命令 - LOG_INFO "测试perl-constant-help的帮助命令" - perl-constant-help --help >/dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "perl-constant-help不支持--help参数" - exit 255 - fi - CHECK_RESULT $? 0 0 "执行perl-constant-help --help失败" - - # 测试版本命令 - LOG_INFO "测试perl-constant-help的版本命令" - perl-constant-help --version >/dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "perl-constant-help不支持--version参数" - exit 255 - fi - CHECK_RESULT $? 0 0 "执行perl-constant-help --version失败" - - # 测试不带参数的用法 - LOG_INFO "测试perl-constant-help不带参数的用法" - perl-constant-help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行perl-constant-help失败" - - # 清理环境 - LOG_INFO "清理测试环境" - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "卸载$PACKAGE_NAME软件包" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载$PACKAGE_NAME失败" - else - LOG_INFO "保持$PACKAGE_NAME安装状态" - fi - - LOG_INFO "perl-constant-help基本用法测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-astunparse/python3-astunparse/test_python3-astunparse_basic_parse.sh b/testcases/function_test/pkg_test/python-astunparse/python3-astunparse/test_python3-astunparse_basic_parse.sh deleted file mode 100644 index f4380adeb63..00000000000 --- a/testcases/function_test/pkg_test/python-astunparse/python3-astunparse/test_python3-astunparse_basic_parse.sh +++ /dev/null @@ -1,147 +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-16 -# @License : Mulan PSL v2 -# @Desc : 测试astunparse基本功能:将AST节点反解析为源代码 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试astunparse基本功能:将AST节点反解析为源代码 - LOG_INFO "开始测试astunparse基本功能:将AST节点反解析为源代码" - - # 检查yum源中是否有python3-astunparse软件包 - LOG_INFO "检查yum源中是否有python3-astunparse软件包" - dnf list available python3-astunparse > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有python3-astunparse软件包" - exit 255 - fi - - # 检查是否已安装python3-astunparse - LOG_INFO "检查是否已安装python3-astunparse" - rpm -q python3-astunparse > /dev/null 2>&1 - installed=$? - - # 如果未安装,则安装软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "安装python3-astunparse软件包" - dnf install -y python3-astunparse - CHECK_RESULT $? 0 0 "安装python3-astunparse失败" - fi - - # 检查astunparse命令参数是否支持 - LOG_INFO "检查astunparse命令参数是否支持" - python3 -m astunparse --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "astunparse命令参数不支持" - exit 255 - fi - - # 创建测试Python代码 - LOG_INFO "创建测试Python代码文件" - cat > test_code.py << "EOF" - def hello_world(): - print("Hello, World!") - return 42 - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用astunparse将Python代码解析为AST并反解析 - LOG_INFO "使用astunparse解析Python代码" - python3 -c " - import ast - import astunparse - with open("test_code.py", "r") as f: - code = f.read() - tree = ast.parse(code) - unparsed = astunparse.unparse(tree) - print("原始代码:") - print(code) - print("反解析后代码:") - print(unparsed) - print("代码是否一致:", code == unparsed) - " > astunparse_output.txt 2>&1 - CHECK_RESULT $? 0 0 "astunparse解析失败" - - # 检查反解析结果 - LOG_INFO "检查反解析结果" - grep -q "代码是否一致: True" astunparse_output.txt - CHECK_RESULT $? 0 0 "astunparse反解析结果不一致" - - # 测试更复杂的AST节点反解析 - LOG_INFO "测试复杂AST节点反解析" - python3 -c " - import ast - import astunparse - - # 创建AST节点 - func_def = ast.FunctionDef( - name="calculate", - args=ast.arguments( - args=[ast.arg(arg="x", annotation=None)], - vararg=None, - kwonlyargs=[], - kw_defaults=[], - kwarg=None, - defaults=[] - ), - body=[ - ast.Return(value=ast.BinOp( - left=ast.Name(id="x", ctx=ast.Load()), - op=ast.Mult(), - right=ast.Constant(value=2) - )) - ], - decorator_list=[], - returns=None - ) - - # 将AST反解析为源代码 - unparsed = astunparse.unparse(func_def) - print("生成的函数定义:") - print(unparsed) - - # 验证语法 - try: - compile(unparsed, "", "exec") - print("语法验证: 通过") - except SyntaxError as e: - print(f"语法验证: 失败 - {e}") - " > complex_ast_test.txt 2>&1 - CHECK_RESULT $? 0 0 "复杂AST节点反解析失败" - - # 检查复杂AST测试结果 - LOG_INFO "检查复杂AST测试结果" - grep -q "语法验证: 通过" complex_ast_test.txt - CHECK_RESULT $? 0 0 "复杂AST节点语法验证失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_code.py astunparse_output.txt complex_ast_test.txt - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "卸载python3-astunparse软件包" - dnf remove -y python3-astunparse - CHECK_RESULT $? 0 0 "卸载python3-astunparse失败" - fi - - LOG_INFO "astunparse基本功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-astunparse/python3-astunparse/test_python3-astunparse_install.sh b/testcases/function_test/pkg_test/python-astunparse/python3-astunparse/test_python3-astunparse_install.sh deleted file mode 100644 index 8b206879264..00000000000 --- a/testcases/function_test/pkg_test/python-astunparse/python3-astunparse/test_python3-astunparse_install.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-16 -# @License : Mulan PSL v2 -# @Desc : 测试软件包python3-astunparse是否已正确安装 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试软件包python3-astunparse是否已正确安装" - LOG_INFO "检查当前环境是否已安装python3-astunparse软件包" - rpm -q python3-astunparse > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装python3-astunparse软件包,测试后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "环境未安装python3-astunparse软件包,测试过程中将进行安装,测试结束后卸载" - INSTALLED=0 - fi - - LOG_INFO "检查yum源中是否存在python3-astunparse软件包" - dnf list available python3-astunparse > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到python3-astunparse软件包" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装python3-astunparse软件包" - dnf install -y python3-astunparse > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装python3-astunparse软件包失败" - LOG_INFO "python3-astunparse软件包安装成功" - fi - - LOG_INFO "验证python3-astunparse软件包基本功能" - python3 -m astunparse --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "python3-astunparse软件包基本功能验证失败" - - LOG_INFO "测试python3-astunparse软件包简单使用" - cat > /tmp/test_ast.py << "EOF" - import ast - import astunparse - code = "print("Hello, World!")" - tree = ast.parse(code) - print(astunparse.unparse(tree)) - EOF - python3 /tmp/test_ast.py > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "python3-astunparse软件包简单使用测试失败" - rm -f /tmp/test_ast.py - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "测试完成,开始清理环境,卸载python3-astunparse软件包" - dnf remove -y python3-astunparse > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载python3-astunparse软件包失败" - LOG_INFO "环境清理完成,python3-astunparse软件包已卸载" - else - LOG_INFO "测试完成,保持python3-astunparse软件包安装状态" - fi - - LOG_INFO "测试软件包python3-astunparse是否已正确安装测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-astunparse/python3-astunparse/test_python3-astunparse_roundtrip.sh b/testcases/function_test/pkg_test/python-astunparse/python3-astunparse/test_python3-astunparse_roundtrip.sh deleted file mode 100644 index acc3926f4cd..00000000000 --- a/testcases/function_test/pkg_test/python-astunparse/python3-astunparse/test_python3-astunparse_roundtrip.sh +++ /dev/null @@ -1,160 +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-16 -# @License : Mulan PSL v2 -# @Desc : 测试源代码通过ast.parse和astunparse.unparse的往返转换 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装python3-astunparse包 - LOG_INFO "检查python3-astunparse是否已安装" - rpm -q python3-astunparse > /dev/null 2>&1 - if [ $? -eq 0 ]; then - already_installed=1 - LOG_INFO "python3-astunparse已安装,测试完成后将保持安装状态" - else - already_installed=0 - LOG_INFO "python3-astunparse未安装,将在测试过程中安装" - fi - - # 检查yum源中是否有python3-astunparse包 - LOG_INFO "检查yum源中是否存在python3-astunparse包" - dnf list available python3-astunparse > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-astunparse包" - exit 255 - fi - - # 如果未安装,则安装python3-astunparse - if [ $already_installed -eq 0 ]; then - LOG_INFO "开始安装python3-astunparse" - dnf install -y python3-astunparse > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装python3-astunparse失败" - LOG_INFO "python3-astunparse安装成功" - fi - - # 检查python3命令是否可用 - LOG_INFO "检查python3命令是否可用" - command -v python3 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "python3命令不存在" - - # 检查python3是否支持ast和astunparse模块 - LOG_INFO "检查python3是否支持ast和astunparse模块" - python3 -c "import ast; import astunparse" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "python3不支持ast或astunparse模块" - - # 创建测试用的Python源代码 - LOG_INFO "创建测试用的Python源代码" - test_code=$(cat << "EOF" - def hello_world(): - print("Hello, World!") - for i in range(5): - print(f"Number: {i}") - - # 这是一个注释 - return True - - class TestClass: - def __init__(self, name): - self.name = name - - def greet(self): - print(f"Hello, {self.name}") - - if __name__ == "__main__": - hello_world() - obj = TestClass("Test") - obj.greet() - EOF - ) - - # 将测试代码写入临时文件 - test_file=$(mktemp /tmp/test_code_XXXXXX.py) - echo "$test_code" > "$test_file" - LOG_INFO "测试代码已写入临时文件: $test_file" - - # 测试ast.parse和astunparse.unparse的往返转换 - LOG_INFO "开始测试ast.parse和astunparse.unparse的往返转换" - roundtrip_script=$(cat << "EOF" - import ast - import astunparse - import sys - - # 读取原始代码 - with open(sys.argv[1], "r") as f: - original_code = f.read() - - # 使用ast.parse解析代码 - try: - parsed_ast = ast.parse(original_code) - except Exception as e: - print(f"ast.parse失败: {e}") - sys.exit(1) - - # 使用astunparse.unparse将AST转换回源代码 - try: - regenerated_code = astunparse.unparse(parsed_ast) - except Exception as e: - print(f"astunparse.unparse失败: {e}") - sys.exit(1) - - # 比较原始代码和重新生成的代码 - # 注意:由于格式差异,我们只比较AST结构是否等价 - try: - original_ast = ast.parse(original_code) - regenerated_ast = ast.parse(regenerated_code) - - # 使用ast.dump比较AST结构 - if ast.dump(original_ast, annotate_fields=False) == ast.dump(regenerated_ast, annotate_fields=False): - print("往返转换测试成功:AST结构等价") - sys.exit(0) - else: - print("往返转换测试失败:AST结构不等价") - sys.exit(1) - except Exception as e: - print(f"比较AST结构时出错: {e}") - sys.exit(1) - EOF - ) - - # 将测试脚本写入临时文件 - roundtrip_test=$(mktemp /tmp/roundtrip_test_XXXXXX.py) - echo "$roundtrip_script" > "$roundtrip_test" - - # 执行往返转换测试 - python3 "$roundtrip_test" "$test_file" - CHECK_RESULT $? 0 0 "ast.parse和astunparse.unparse往返转换测试失败" - LOG_INFO "ast.parse和astunparse.unparse往返转换测试成功" - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f "$test_file" "$roundtrip_test" - - # 如果测试开始时未安装python3-astunparse,则在测试结束后卸载 - if [ $already_installed -eq 0 ]; then - LOG_INFO "测试完成,卸载python3-astunparse" - dnf remove -y python3-astunparse > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载python3-astunparse失败" - LOG_INFO "python3-astunparse卸载成功,环境已恢复" - else - LOG_INFO "测试完成,保持python3-astunparse安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-astunparse/python3-astunparse/test_python3-astunparse_unparse_file.sh b/testcases/function_test/pkg_test/python-astunparse/python3-astunparse/test_python3-astunparse_unparse_file.sh deleted file mode 100644 index b5856894d46..00000000000 --- a/testcases/function_test/pkg_test/python-astunparse/python3-astunparse/test_python3-astunparse_unparse_file.sh +++ /dev/null @@ -1,103 +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-16 -# @License : Mulan PSL v2 -# @Desc : 测试astunparse反解析整个Python文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试astunparse反解析整个Python文件" - - # 检查是否已安装python3-astunparse - LOG_INFO "检查python3-astunparse是否已安装" - rpm -q python3-astunparse > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-astunparse已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-astunparse未安装,将在测试前安装并在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python3-astunparse - LOG_INFO "检查yum源中是否有python3-astunparse包" - dnf list available python3-astunparse > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-astunparse包" - exit 255 - fi - - # 如果未安装,则安装python3-astunparse - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装python3-astunparse" - dnf install -y python3-astunparse > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装python3-astunparse失败" - fi - - # 创建测试用的Python文件 - LOG_INFO "创建测试用的Python文件test_file.py" - cat > test_file.py << "EOF" - def hello(): - print("Hello, world!") - return 42 - - class MyClass: - def __init__(self, value): - self.value = value - - def display(self): - print(f"Value: {self.value}") - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 测试astunparse反解析整个Python文件 - LOG_INFO "使用astunparse反解析test_file.py" - python3 -m astunparse test_file.py > unparsed_output.py 2>&1 - CHECK_RESULT $? 0 0 "astunparse反解析命令执行失败" - - # 检查反解析输出文件是否生成 - LOG_INFO "检查反解析输出文件是否生成" - if [ -f "unparsed_output.py" ]; then - LOG_INFO "反解析输出文件已生成" - else - LOG_ERROR "反解析输出文件未生成" - CHECK_RESULT 1 0 0 "反解析输出文件未生成" - fi - - # 验证反解析输出内容是否包含预期代码 - LOG_INFO "验证反解析输出内容" - grep -q "def hello" unparsed_output.py - CHECK_RESULT $? 0 0 "输出中未找到函数定义" - grep -q "class MyClass" unparsed_output.py - CHECK_RESULT $? 0 0 "输出中未找到类定义" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_file.py unparsed_output.py - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载python3-astunparse - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载python3-astunparse" - dnf remove -y python3-astunparse > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载python3-astunparse失败" - fi - - LOG_INFO "测试astunparse反解析整个Python文件完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rst-linker/python3-rst-linker/test_python3-rst-linker_function_basic_convert.sh b/testcases/function_test/pkg_test/python-rst-linker/python3-rst-linker/test_python3-rst-linker_function_basic_convert.sh deleted file mode 100644 index 67c36496a64..00000000000 --- a/testcases/function_test/pkg_test/python-rst-linker/python3-rst-linker/test_python3-rst-linker_function_basic_convert.sh +++ /dev/null @@ -1,103 +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-05 -# @License : Mulan PSL v2 -# @Desc : 测试将单个 RST 文件转换为链接的基本功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试将单个 RST 文件转换为链接的基本功能" - - # 检查yum源中是否存在python3-rst-linker软件包 - LOG_INFO "检查yum源中是否存在python3-rst-linker软件包" - dnf list available python3-rst-linker > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-rst-linker软件包" - exit 255 - fi - - # 检查系统是否已安装python3-rst-linker - LOG_INFO "检查系统是否已安装python3-rst-linker" - rpm -q python3-rst-linker > /dev/null 2>&1 - if [ $? -eq 0 ]; then - INSTALLED="true" - LOG_INFO "系统已安装python3-rst-linker,测试后将保持安装状态" - else - INSTALLED="false" - LOG_INFO "系统未安装python3-rst-linker,将在测试过程中安装" - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装python3-rst-linker软件包" - dnf install -y python3-rst-linker - CHECK_RESULT $? 0 0 "安装python3-rst-linker失败" - fi - - # 检查命令参数是否存在 - LOG_INFO "检查python3-rst-linker命令参数" - python3-rst-linker --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "python3-rst-linker命令参数检查失败" - - # 准备测试用的RST文件 - LOG_INFO "准备测试用的RST文件" - TEST_RST_FILE="/tmp/test_rst_file.rst" - cat > $TEST_RST_FILE << EOF - 测试标题 - ======== - - 这是一个测试段落。 - - - 列表项1 - - 列表项2 - EOF - CHECK_RESULT $? 0 0 "创建测试RST文件失败" - - # 执行基本转换功能测试 - LOG_INFO "执行单个RST文件转换为链接的基本功能测试" - python3-rst-linker convert $TEST_RST_FILE /tmp/test_output.html - CHECK_RESULT $? 0 0 "RST文件转换失败" - - # 检查输出文件是否存在 - LOG_INFO "检查转换后的输出文件是否存在" - [ -f /tmp/test_output.html ] - CHECK_RESULT $? 0 0 "输出文件未生成" - - # 检查输出文件内容是否包含预期内容 - LOG_INFO "检查输出文件内容是否包含预期内容" - grep -q "测试标题" /tmp/test_output.html - CHECK_RESULT $? 0 0 "输出文件内容不符合预期" - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f $TEST_RST_FILE /tmp/test_output.html - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载python3-rst-linker软件包" - dnf remove -y python3-rst-linker - CHECK_RESULT $? 0 0 "卸载python3-rst-linker失败" - LOG_INFO "已恢复系统到测试前状态" - else - LOG_INFO "保持python3-rst-linker安装状态" - fi - - LOG_INFO "测试将单个RST文件转换为链接的基本功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rst-linker/python3-rst-linker/test_python3-rst-linker_function_cli.sh b/testcases/function_test/pkg_test/python-rst-linker/python3-rst-linker/test_python3-rst-linker_function_cli.sh deleted file mode 100644 index d6e0e046368..00000000000 --- a/testcases/function_test/pkg_test/python-rst-linker/python3-rst-linker/test_python3-rst-linker_function_cli.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-05 -# @License : Mulan PSL v2 -# @Desc : 测试命令行工具 rst-linker 的基本可用性 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装python3-rst-linker - LOG_INFO "检查是否已安装python3-rst-linker软件包" - rpm -q python3-rst-linker > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-rst-linker已安装,测试结束后将保持安装状态" - INSTALLED="true" - else - LOG_INFO "python3-rst-linker未安装,将在测试中安装并在测试结束后卸载" - INSTALLED="false" - fi - - # 检查yum源中是否有python3-rst-linker软件包 - LOG_INFO "检查yum源中是否有python3-rst-linker软件包" - dnf list python3-rst-linker > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-rst-linker软件包" - exit 255 - fi - - # 如果未安装,则安装python3-rst-linker - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "安装python3-rst-linker软件包" - dnf install -y python3-rst-linker > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装python3-rst-linker失败" - fi - - # 测试rst-linker命令是否存在 - LOG_INFO "检查rst-linker命令是否存在" - which rst-linker > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "rst-linker命令不存在" - - # 测试rst-linker --help参数 - LOG_INFO "测试rst-linker --help参数" - rst-linker --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "rst-linker --help参数不支持或执行失败" - - # 测试rst-linker --version参数 - LOG_INFO "测试rst-linker --version参数" - rst-linker --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "rst-linker --version参数不支持或执行失败" - - # 测试rst-linker不存在的参数 - LOG_INFO "测试rst-linker不存在的参数(预期失败)" - rst-linker --invalid-param > /dev/null 2>&1 - if [ $? -ne 255 ] && [ $? -ne 1 ]; then - LOG_ERROR "rst-linker对不存在的参数处理不符合预期" - exit 255 - fi - - # 测试rst-linker基本功能:解析一个简单的RST文件 - LOG_INFO "测试rst-linker基本解析功能" - cat > test_sample.rst << EOF - 标题 - ==== - - 这是一个段落。 - - - 列表项1 - - 列表项2 - EOF - - rst-linker test_sample.rst > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "rst-linker解析RST文件失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_sample.rst - - # 环境恢复:如果测试前未安装,则卸载python3-rst-linker - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "卸载python3-rst-linker软件包" - dnf remove -y python3-rst-linker > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载python3-rst-linker失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rst-linker/python3-rst-linker/test_python3-rst-linker_function_import.sh b/testcases/function_test/pkg_test/python-rst-linker/python3-rst-linker/test_python3-rst-linker_function_import.sh deleted file mode 100644 index 4345c1e6ed6..00000000000 --- a/testcases/function_test/pkg_test/python-rst-linker/python3-rst-linker/test_python3-rst-linker_function_import.sh +++ /dev/null @@ -1,52 +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-05 -# @License : Mulan PSL v2 -# @Desc : 测试安装后是否能成功导入 rst_linker 模块 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试python3-rst-linker软件包的导入功能" - LOG_INFO "步骤1: 检查yum源中是否存在python3-rst-linker软件包" - dnf list available python3-rst-linker > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到python3-rst-linker软件包,退出测试" - LOG_INFO "步骤2: 检查当前环境是否已安装python3-rst-linker软件包" - rpm -q python3-rst-linker > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-rst-linker软件包已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "python3-rst-linker软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装python3-rst-linker软件包" - dnf install -y python3-rst-linker > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装python3-rst-linker软件包失败" - fi - LOG_INFO "步骤4: 测试导入rst_linker模块" - python3 -c "import rst_linker" 2>&1 - CHECK_RESULT $? 0 0 "导入rst_linker模块失败" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤5: 卸载python3-rst-linker软件包" - dnf remove -y python3-rst-linker > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载python3-rst-linker软件包失败" - fi - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rst-linker/python3-rst-linker/test_python3-rst-linker_function_install.sh b/testcases/function_test/pkg_test/python-rst-linker/python3-rst-linker/test_python3-rst-linker_function_install.sh deleted file mode 100644 index a02a35ac1cd..00000000000 --- a/testcases/function_test/pkg_test/python-rst-linker/python3-rst-linker/test_python3-rst-linker_function_install.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-05 -# @License : Mulan PSL v2 -# @Desc : 测试 python3-rst-linker 软件包是否能够成功安装 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 python3-rst-linker 软件包是否能够成功安装" - LOG_INFO "检查 yum 源中是否存在 python3-rst-linker 软件包" - dnf list available python3-rst-linker >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum 源中未找到 python3-rst-linker 软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 python3-rst-linker 软件包" - exit 255 - fi - LOG_INFO "检查系统是否已经安装了 python3-rst-linker 软件包" - rpm -q python3-rst-linker >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "系统已经安装了 python3-rst-linker 软件包,测试将保持安装状态" - INSTALLED="true" - else - LOG_INFO "系统未安装 python3-rst-linker 软件包,将执行安装步骤" - INSTALLED="false" - fi - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "执行安装 python3-rst-linker 软件包" - dnf install -y python3-rst-linker - CHECK_RESULT $? 0 0 "安装 python3-rst-linker 软件包失败" - if [ $? -ne 0 ]; then - LOG_ERROR "安装 python3-rst-linker 软件包失败" - exit 255 - fi - LOG_INFO "验证 python3-rst-linker 软件包是否安装成功" - rpm -q python3-rst-linker >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证 python3-rst-linker 软件包安装失败" - if [ $? -ne 0 ]; then - LOG_ERROR "验证 python3-rst-linker 软件包安装失败" - exit 255 - fi - LOG_INFO "python3-rst-linker 软件包安装成功" - LOG_INFO "执行卸载 python3-rst-linker 软件包以清理环境" - dnf remove -y python3-rst-linker - CHECK_RESULT $? 0 0 "卸载 python3-rst-linker 软件包失败" - if [ $? -ne 0 ]; then - LOG_ERROR "卸载 python3-rst-linker 软件包失败" - exit 255 - fi - LOG_INFO "验证 python3-rst-linker 软件包是否卸载成功" - rpm -q python3-rst-linker >/dev/null 2>&1 - CHECK_RESULT $? 1 0 "验证 python3-rst-linker 软件包卸载失败,软件包仍然存在" - if [ $? -ne 0 ]; then - LOG_ERROR "验证 python3-rst-linker 软件包卸载失败,软件包仍然存在" - exit 255 - fi - LOG_INFO "python3-rst-linker 软件包卸载成功,环境已恢复" - else - LOG_INFO "系统已安装 python3-rst-linker 软件包,跳过安装和卸载步骤" - fi - LOG_INFO "测试 python3-rst-linker 软件包安装完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-rst-linker/python3-rst-linker/test_python3-rst-linker_function_uninstall.sh b/testcases/function_test/pkg_test/python-rst-linker/python3-rst-linker/test_python3-rst-linker_function_uninstall.sh deleted file mode 100644 index 7cc17a14d77..00000000000 --- a/testcases/function_test/pkg_test/python-rst-linker/python3-rst-linker/test_python3-rst-linker_function_uninstall.sh +++ /dev/null @@ -1,91 +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-05 -# @License : Mulan PSL v2 -# @Desc : 测试 python3-rst-linker 软件包是否能够成功卸载 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否以root用户运行 - if [[ $EUID -ne 0 ]]; then - LOG_ERROR "该脚本必须以root用户运行" - exit 1 - fi - - # 定义软件包名称 - PACKAGE_NAME="python3-rst-linker" - - # 步骤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 - LOG_INFO "软件包 ${PACKAGE_NAME} 在yum源中" - - # 步骤2: 检查当前是否已安装 - LOG_INFO "步骤2: 检查软件包是否已安装" - rpm -q ${PACKAGE_NAME} &>/dev/null - INSTALLED=$? - if [[ ${INSTALLED} -eq 0 ]]; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装" - NEED_UNINSTALL=0 - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装" - NEED_UNINSTALL=1 - fi - - # 步骤3: 如果未安装,则安装软件包 - if [[ ${NEED_UNINSTALL} -eq 1 ]]; then - LOG_INFO "步骤3: 安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 安装成功" - fi - - # 步骤4: 验证软件包已安装 - LOG_INFO "步骤4: 验证软件包已安装" - rpm -q ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "软件包 ${PACKAGE_NAME} 未正确安装" - - # 步骤5: 测试卸载功能 - LOG_INFO "步骤5: 测试卸载软件包 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 卸载成功" - - # 步骤6: 验证软件包已卸载 - LOG_INFO "步骤6: 验证软件包已卸载" - rpm -q ${PACKAGE_NAME} &>/dev/null - CHECK_RESULT $? 1 0 "软件包 ${PACKAGE_NAME} 未正确卸载" - - # 步骤7: 环境恢复 - LOG_INFO "步骤7: 环境恢复" - if [[ ${NEED_UNINSTALL} -eq 0 ]]; then - LOG_INFO "恢复软件包 ${PACKAGE_NAME} 安装状态" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "恢复安装软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 已重新安装" - else - LOG_INFO "环境已恢复到未安装状态" - fi - - LOG_INFO "测试完成: python3-rst-linker 软件包卸载功能测试成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-typogrify/python-typogrify-help/test_python-typogrify-help_function_basic.sh b/testcases/function_test/pkg_test/python-typogrify/python-typogrify-help/test_python-typogrify-help_function_basic.sh deleted file mode 100644 index bc73ad6c19e..00000000000 --- a/testcases/function_test/pkg_test/python-typogrify/python-typogrify-help/test_python-typogrify-help_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-12-10 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test basic functionality" - - # 检查软件包是否已安装 - LOG_INFO "检查python-typogrify软件包是否已安装" - if dnf list installed python-typogrify &>/dev/null; then - LOG_INFO "python-typogrify已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "python-typogrify未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否存在python-typogrify软件包" - if ! dnf list available python-typogrify &>/dev/null; then - LOG_ERROR "yum源中不存在python-typogrify软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python-typogrify软件包" - dnf install -y python-typogrify - CHECK_RESULT $? 0 0 "安装python-typogrify失败" - fi - - # 测试基本功能 - LOG_INFO "测试python-typogrify的基本功能" - if ! python -m typogrify --help &>/dev/null; then - LOG_ERROR "python-typogrify的基本功能测试失败" - exit 255 - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python-typogrify软件包" - dnf remove -y python-typogrify - CHECK_RESULT $? 0 0 "卸载python-typogrify失败" - fi - - LOG_INFO "测试完成:Test basic functionality" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-typogrify/python-typogrify-help/test_python-typogrify-help_function_basic_usage.sh b/testcases/function_test/pkg_test/python-typogrify/python-typogrify-help/test_python-typogrify-help_function_basic_usage.sh deleted file mode 100644 index f9ec310b44e..00000000000 --- a/testcases/function_test/pkg_test/python-typogrify/python-typogrify-help/test_python-typogrify-help_function_basic_usage.sh +++ /dev/null @@ -1,81 +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-25 -# @License : Mulan PSL v2 -# @Desc : Test basic typography helper function -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装python3-typogrify - LOG_INFO "检查python3-typogrify是否已安装" - rpm -q python3-typogrify > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-typogrify已安装,标记为已安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "python3-typogrify未安装,标记为未安装状态" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否有python3-typogrify软件包 - LOG_INFO "检查yum源中是否有python3-typogrify软件包" - dnf list available python3-typogrify > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-typogrify软件包" - exit 255 - fi - - # 如果未安装,则安装python3-typogrify - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "安装python3-typogrify" - dnf install -y python3-typogrify - CHECK_RESULT $? 0 0 "安装python3-typogrify失败" - fi - - # 测试typogrify的基本帮助功能 - LOG_INFO "测试typogrify的--help参数" - python3 -m typogrify --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "typogrify --help命令执行失败" - - # 测试typogrify的-h参数(如果支持) - LOG_INFO "测试typogrify的-h参数" - python3 -m typogrify -h > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_INFO "typogrify不支持-h参数,此为正常情况" - else - LOG_INFO "typogrify支持-h参数" - fi - - # 测试typogrify的无效参数 - LOG_INFO "测试typogrify的无效参数--invalid-param" - python3 -m typogrify --invalid-param > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "typogrify不支持--invalid-param参数" - exit 255 - fi - - # 环境清理:如果测试前未安装,则卸载python3-typogrify - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "卸载python3-typogrify" - dnf remove -y python3-typogrify - CHECK_RESULT $? 0 0 "卸载python3-typogrify失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-typogrify/python-typogrify-help/test_python-typogrify-help_function_import.sh b/testcases/function_test/pkg_test/python-typogrify/python-typogrify-help/test_python-typogrify-help_function_import.sh deleted file mode 100644 index 283c0f1129d..00000000000 --- a/testcases/function_test/pkg_test/python-typogrify/python-typogrify-help/test_python-typogrify-help_function_import.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-03-25 -# @License : Mulan PSL v2 -# @Desc : Test importing the typogrify-help module -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试: Test importing the typogrify-help module" - - LOG_INFO "步骤1: 检查系统中是否已安装python3-typogrify软件包" - if rpm -q python3-typogrify &>/dev/null; then - LOG_INFO "检测到python3-typogrify已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE="yes" - else - LOG_INFO "未检测到python3-typogrify,将在测试中安装" - INSTALLED_BEFORE="no" - fi - - LOG_INFO "步骤2: 检查yum源中是否存在python3-typogrify软件包" - if ! dnf list available python3-typogrify &>/dev/null; then - LOG_ERROR "yum源中未找到python3-typogrify软件包" - exit 255 - fi - - if [[ "$INSTALLED_BEFORE" == "no" ]]; then - LOG_INFO "步骤3: 安装python3-typogrify软件包" - dnf install -y python3-typogrify - CHECK_RESULT $? 0 0 "安装python3-typogrify失败" - fi - - LOG_INFO "步骤4: 测试导入typogrify-help模块" - python3 -c "import typogrify.filters" - CHECK_RESULT $? 0 0 "导入typogrify-help模块失败" - - LOG_INFO "步骤5: 测试typogrify-help模块的help功能" - python3 -c "import typogrify.filters; help(typogrify.filters)" | head -20 - CHECK_RESULT $? 0 0 "执行typogrify-help模块的help功能失败" - - LOG_INFO "步骤6: 环境恢复" - if [[ "$INSTALLED_BEFORE" == "no" ]]; then - LOG_INFO "卸载测试安装的python3-typogrify软件包" - dnf remove -y python3-typogrify - CHECK_RESULT $? 0 0 "卸载python3-typogrify失败" - else - LOG_INFO "系统原本已安装python3-typogrify,保持安装状态" - fi - - LOG_INFO "测试完成: Test importing the typogrify-help module" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-typogrify/python-typogrify-help/test_python-typogrify-help_function_install.sh b/testcases/function_test/pkg_test/python-typogrify/python-typogrify-help/test_python-typogrify-help_function_install.sh deleted file mode 100644 index f6e28bb59b4..00000000000 --- a/testcases/function_test/pkg_test/python-typogrify/python-typogrify-help/test_python-typogrify-help_function_install.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 : 2026-03-25 -# @License : Mulan PSL v2 -# @Desc : Test installation of the python-typogrify-help package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试python-typogrify-help软件包的安装" - - # 步骤1: 检查软件包是否已在yum源中 - LOG_INFO "检查python-typogrify-help软件包是否在yum源中" - dnf list available python-typogrify-help 2>/dev/null | grep -q python-typogrify-help - if [ $? -ne 0 ]; then - LOG_ERROR "python-typogrify-help软件包不在yum源中" - exit 255 - fi - - # 步骤2: 检查软件包是否已安装 - LOG_INFO "检查python-typogrify-help软件包是否已安装" - rpm -q python-typogrify-help >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,跳过安装步骤" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包未安装,将执行安装步骤" - INSTALLED_BEFORE=false - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "开始安装python-typogrify-help软件包" - dnf install -y python-typogrify-help - CHECK_RESULT $? 0 0 "安装python-typogrify-help软件包失败" - LOG_INFO "软件包安装成功" - fi - - # 步骤4: 验证软件包功能(这里以检查帮助信息为例) - LOG_INFO "验证python-typogrify-help软件包功能" - python-typogrify-help --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "python-typogrify-help命令执行失败" - - # 步骤5: 如果测试前未安装,则在测试结束后卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "测试完成,卸载python-typogrify-help软件包" - dnf remove -y python-typogrify-help - CHECK_RESULT $? 0 0 "卸载python-typogrify-help软件包失败" - LOG_INFO "软件包卸载成功" - else - LOG_INFO "测试完成,保持软件包安装状态" - fi - - LOG_INFO "python-typogrify-help软件包安装测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-typogrify/python-typogrify-help/test_python-typogrify-help_function_version.sh b/testcases/function_test/pkg_test/python-typogrify/python-typogrify-help/test_python-typogrify-help_function_version.sh deleted file mode 100644 index 8eca0a921be..00000000000 --- a/testcases/function_test/pkg_test/python-typogrify/python-typogrify-help/test_python-typogrify-help_function_version.sh +++ /dev/null @@ -1,81 +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-25 -# @License : Mulan PSL v2 -# @Desc : Test checking the package version -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:检查软件包版本 - LOG_INFO "开始测试:检查python-typogrify软件包版本" - - # 检查yum源中是否存在python-typogrify软件包 - LOG_INFO "步骤1:检查yum源中是否存在python-typogrify软件包" - dnf list available python-typogrify > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python-typogrify软件包" - exit 255 - fi - - # 检查是否已安装python-typogrify - LOG_INFO "步骤2:检查是否已安装python-typogrify" - rpm -q python-typogrify > /dev/null 2>&1 - INSTALLED=$? - - # 如果未安装,则安装软件包 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "步骤3:安装python-typogrify软件包" - dnf install -y python-typogrify - CHECK_RESULT $? 0 0 "安装python-typogrify失败" - LOG_INFO "python-typogrify安装成功" - fi - - # 检查软件包版本 - LOG_INFO "步骤4:检查python-typogrify软件包版本" - rpm -q python-typogrify - CHECK_RESULT $? 0 0 "获取python-typogrify版本失败" - LOG_INFO "python-typogrify版本检查成功" - - # 检查--help参数支持 - LOG_INFO "步骤5:检查python-typogrify的--help参数支持" - python-typogrify --help > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "python-typogrify不支持--help参数" - # 如果未安装,则卸载软件包 - if [ $INSTALLED -ne 0 ]; then - dnf remove -y python-typogrify - CHECK_RESULT $? 0 0 "卸载python-typogrify失败" - fi - exit 255 - fi - CHECK_RESULT $? 0 0 "执行python-typogrify --help失败" - LOG_INFO "python-typogrify --help执行成功" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "步骤6:清理环境,卸载python-typogrify软件包" - dnf remove -y python-typogrify - CHECK_RESULT $? 0 0 "卸载python-typogrify失败" - LOG_INFO "环境清理完成,python-typogrify已卸载" - else - LOG_INFO "步骤6:保持环境不变,python-typogrify保持安装状态" - fi - - LOG_INFO "测试完成:python-typogrify版本检查测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-urlgrabber/python3-urlgrabber/test_python3-urlgrabber_function_uninstall.sh b/testcases/function_test/pkg_test/python-urlgrabber/python3-urlgrabber/test_python3-urlgrabber_function_uninstall.sh deleted file mode 100644 index 18426b4240f..00000000000 --- a/testcases/function_test/pkg_test/python-urlgrabber/python3-urlgrabber/test_python3-urlgrabber_function_uninstall.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-02-06 -# @License : Mulan PSL v2 -# @Desc : 测试软件包卸载 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:判断python3-urlgrabber是否已安装 - LOG_INFO "检查python3-urlgrabber是否已安装" - rpm -q python3-urlgrabber > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-urlgrabber已安装,记录当前状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "python3-urlgrabber未安装,记录当前状态" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否存在python3-urlgrabber软件包 - LOG_INFO "检查yum源中是否存在python3-urlgrabber软件包" - dnf list available python3-urlgrabber > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在python3-urlgrabber软件包" - - # 如果未安装,则先安装软件包 - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "安装python3-urlgrabber软件包" - dnf install -y python3-urlgrabber > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装python3-urlgrabber失败" - fi - - # 测试卸载功能 - LOG_INFO "测试卸载python3-urlgrabber软件包" - dnf remove -y python3-urlgrabber > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载python3-urlgrabber失败" - - # 验证卸载结果 - LOG_INFO "验证python3-urlgrabber是否已卸载" - rpm -q python3-urlgrabber > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "卸载后python3-urlgrabber仍然存在" - - # 环境恢复:如果测试前已安装,则重新安装 - if [ ${INSTALLED_BEFORE} -eq 1 ]; then - LOG_INFO "恢复环境:重新安装python3-urlgrabber" - dnf install -y python3-urlgrabber > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "重新安装python3-urlgrabber失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt6-qt5compat/qt6-qt5compat-devel/test_qt6-qt5compat-devel_function_basic.sh b/testcases/function_test/pkg_test/qt6-qt5compat/qt6-qt5compat-devel/test_qt6-qt5compat-devel_function_basic.sh deleted file mode 100644 index 7ff113f1532..00000000000 --- a/testcases/function_test/pkg_test/qt6-qt5compat/qt6-qt5compat-devel/test_qt6-qt5compat-devel_function_basic.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-09 -# @License : Mulan PSL v2 -# @Desc : Verify basic compatibility functions -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_qt6-qt5compat-devel_function_basic - - LOG_INFO "开始测试:Verify basic compatibility functions" - - # 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在qt6-qt5compat-devel软件包" - dnf list available qt6-qt5compat-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt6-qt5compat-devel软件包" - exit 255 - fi - - # 检查是否已安装软件包 - LOG_INFO "检查是否已安装qt6-qt5compat-devel软件包" - rpm -q qt6-qt5compat-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "qt6-qt5compat-devel已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "qt6-qt5compat-devel未安装,开始安装" - dnf install -y qt6-qt5compat-devel - CHECK_RESULT $? 0 0 "安装qt6-qt5compat-devel失败" - INSTALLED=false - fi - - # 测试基本兼容性功能 - LOG_INFO "测试基本兼容性功能" - command_to_test="qt6-qt5compat-devel-test-command" - $command_to_test > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "基本兼容性功能测试失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载qt6-qt5compat-devel软件包" - dnf remove -y qt6-qt5compat-devel - CHECK_RESULT $? 0 0 "卸载qt6-qt5compat-devel失败" - fi - - LOG_INFO "测试完成:Verify basic compatibility functions" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_downgrade.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_downgrade.sh deleted file mode 100644 index 84d70a65b54..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_downgrade.sh +++ /dev/null @@ -1,94 +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-17 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-footnotebackref-doc 软件包是否能够正确降级 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - - # 步骤1:检查yum源中是否存在texlive-footnotebackref-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-footnotebackref-doc软件包" - dnf list available texlive-footnotebackref-doc &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-footnotebackref-doc软件包" - exit 255 - fi - - # 步骤2:检查当前是否已安装texlive-footnotebackref-doc软件包 - LOG_INFO "检查当前是否已安装texlive-footnotebackref-doc软件包" - rpm -q texlive-footnotebackref-doc &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "当前已安装texlive-footnotebackref-doc软件包,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "当前未安装texlive-footnotebackref-doc软件包,将在测试完成后卸载" - INSTALLED=false - fi - - # 步骤3:安装texlive-footnotebackref-doc软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-footnotebackref-doc软件包" - dnf install -y texlive-footnotebackref-doc - CHECK_RESULT $? 0 0 "安装texlive-footnotebackref-doc软件包失败" - fi - - # 步骤4:获取当前texlive-footnotebackref-doc的版本信息 - LOG_INFO "获取当前texlive-footnotebackref-doc的版本信息" - CURRENT_VERSION=$(rpm -q --queryformat '%{VERSION}-%{RELEASE}' texlive-footnotebackref-doc) - CHECK_RESULT $? 0 0 "获取当前版本信息失败" - - # 步骤5:查找可降级的版本 - LOG_INFO "查找可降级的版本" - AVAILABLE_VERSIONS=$(dnf list available texlive-footnotebackref-doc --showduplicates | awk '{print $2}' | tail -n +2) - if [ -z "$AVAILABLE_VERSIONS" ]; then - LOG_ERROR "未找到可降级的版本" - exit 255 - fi - - # 步骤6:选择一个较低的版本进行降级测试(假设选择第一个较低版本) - TARGET_VERSION=$(echo "$AVAILABLE_VERSIONS" | head -n1) - LOG_INFO "尝试降级到版本: $TARGET_VERSION" - - # 步骤7:执行降级操作 - LOG_INFO "开始降级操作" - dnf downgrade -y texlive-footnotebackref-doc-$TARGET_VERSION - CHECK_RESULT $? 0 0 "降级操作失败" - - # 步骤8:验证降级后的版本是否为目标版本 - LOG_INFO "验证降级后的版本是否为$TARGET_VERSION" - NEW_VERSION=$(rpm -q --queryformat '%{VERSION}-%{RELEASE}' texlive-footnotebackref-doc) - if [ "$NEW_VERSION" != "$TARGET_VERSION" ]; then - LOG_ERROR "降级失败,当前版本为$NEW_VERSION,目标版本为$TARGET_VERSION" - exit 1 - else - LOG_INFO "降级成功,当前版本为$NEW_VERSION" - fi - - # 步骤9:恢复环境(如果最初未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-footnotebackref-doc软件包以恢复环境" - dnf remove -y texlive-footnotebackref-doc - CHECK_RESULT $? 0 0 "卸载texlive-footnotebackref-doc软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_rollback.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_rollback.sh deleted file mode 100644 index d21f4eb6d9e..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_rollback.sh +++ /dev/null @@ -1,79 +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-17 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-footnotebackref-doc 软件包是否能够正确回滚 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-footnotebackref-doc软件包是否能够正确回滚 - - LOG_INFO "开始测试texlive-footnotebackref-doc软件包的回滚功能" - - # 检查yum源中是否存在texlive-footnotebackref-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-footnotebackref-doc软件包" - dnf list available texlive-footnotebackref-doc &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-footnotebackref-doc软件包" - exit 255 - fi - - # 检查当前是否已安装texlive-footnotebackref-doc - LOG_INFO "检查当前是否已安装texlive-footnotebackref-doc" - dnf list installed texlive-footnotebackref-doc &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "当前环境已安装texlive-footnotebackref-doc,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "当前环境未安装texlive-footnotebackref-doc,将在测试完成后卸载" - INSTALLED=false - fi - - # 安装texlive-footnotebackref-doc软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-footnotebackref-doc软件包" - dnf install -y texlive-footnotebackref-doc - CHECK_RESULT $? 0 0 "安装texlive-footnotebackref-doc失败" - fi - - # 模拟回滚操作(假设通过dnf history undo实现) - LOG_INFO "模拟回滚操作" - dnf history undo last -y - CHECK_RESULT $? 0 0 "回滚操作失败" - - # 验证回滚后软件包状态 - LOG_INFO "验证回滚后软件包状态" - if [ "$INSTALLED" = false ]; then - dnf list installed texlive-footnotebackref-doc &>/dev/null - CHECK_RESULT $? 1 0 "回滚后软件包未正确卸载" - else - dnf list installed texlive-footnotebackref-doc &>/dev/null - CHECK_RESULT $? 0 0 "回滚后软件包未正确保留" - fi - - # 清理环境(如果初始未安装则卸载) - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境,卸载texlive-footnotebackref-doc软件包" - dnf remove -y texlive-footnotebackref-doc &>/dev/null - fi - - LOG_INFO "测试完成,环境已恢复初始状态" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_service_config.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_service_config.sh deleted file mode 100644 index 83d11558994..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_service_config.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-17 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-footnotebackref-doc 提供的服务是否能够正确配置 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - - # 检查是否已安装 texlive-footnotebackref-doc - LOG_INFO "检查是否已安装 texlive-footnotebackref-doc" - rpm -q texlive-footnotebackref-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-footnotebackref-doc 已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-footnotebackref-doc 未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否存在 texlive-footnotebackref-doc - LOG_INFO "检查 yum 源中是否存在 texlive-footnotebackref-doc" - dnf list available texlive-footnotebackref-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-footnotebackref-doc,退出测试" - exit 255 - fi - - # 安装 texlive-footnotebackref-doc(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 texlive-footnotebackref-doc" - dnf install -y texlive-footnotebackref-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装 texlive-footnotebackref-doc 失败" - fi - - # 测试服务配置是否正确 - LOG_INFO "测试 texlive-footnotebackref-doc 提供的服务配置" - # 假设服务配置命令为 config_service,需要根据实际命令调整 - config_service --check > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "服务配置检查失败" - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-footnotebackref-doc" - dnf remove -y texlive-footnotebackref-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载 texlive-footnotebackref-doc 失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_service_log.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_service_log.sh deleted file mode 100644 index 659d5221087..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_service_log.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 : 2025-06-17 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-footnotebackref-doc 提供的服务是否能够正确查看日志 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-footnotebackref-doc是否已安装 - LOG_INFO "检查texlive-footnotebackref-doc是否已安装..." - rpm -q texlive-footnotebackref-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-footnotebackref-doc已安装,测试完成后将保持安装状态。" - INSTALLED=true - else - LOG_INFO "texlive-footnotebackref-doc未安装,将在测试完成后卸载。" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-footnotebackref-doc软件包 - LOG_INFO "检查yum源中是否有texlive-footnotebackref-doc软件包..." - dnf list available texlive-footnotebackref-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-footnotebackref-doc软件包,退出测试。" - exit 255 - fi - - # 安装texlive-footnotebackref-doc软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装texlive-footnotebackref-doc软件包..." - dnf install -y texlive-footnotebackref-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-footnotebackref-doc失败" - fi - - # 测试texlive-footnotebackref-doc提供的服务是否能够正确查看日志 - LOG_INFO "测试texlive-footnotebackref-doc提供的服务是否能够正确查看日志..." - # 假设服务日志查看命令为`footnotebackref-log`(示例命令,需替换为实际命令) - command -v footnotebackref-log > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "命令footnotebackref-log不存在或不支持,退出测试。" - exit 255 - fi - - footnotebackref-log --test > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "查看日志服务失败" - - # 清理环境(如果最初未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载texlive-footnotebackref-doc软件包..." - dnf remove -y texlive-footnotebackref-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-footnotebackref-doc失败" - fi - - LOG_INFO "测试完成,环境已恢复。" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_service_restart.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_service_restart.sh deleted file mode 100644 index 48f2fe890a5..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_service_restart.sh +++ /dev/null @@ -1,61 +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-17 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-footnotebackref-doc 提供的服务是否能够正确重启 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查软件包是否存在于yum源中 - LOG_INFO "检查texlive-footnotebackref-doc是否存在于yum源中..." - dnf list available texlive-footnotebackref-doc &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-footnotebackref-doc不存在于yum源中,无法进行测试" - exit 255 - fi - - # 检查环境是否已安装texlive-footnotebackref-doc - LOG_INFO "检查当前环境是否已安装texlive-footnotebackref-doc..." - rpm -q texlive-footnotebackref-doc &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "当前环境已安装texlive-footnotebackref-doc,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "当前环境未安装texlive-footnotebackref-doc,将进行安装..." - dnf install -y texlive-footnotebackref-doc &> /dev/null - CHECK_RESULT $? 0 0 "安装texlive-footnotebackref-doc失败" - INSTALLED=false - fi - - # 测试服务重启功能 - LOG_INFO "测试texlive-footnotebackref-doc提供的服务是否能正确重启..." - systemctl restart texlive-footnotebackref-doc &> /dev/null - CHECK_RESULT $? 0 0 "服务重启失败" - - # 清理环境(如果测试前未安装,则卸载) - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境,卸载texlive-footnotebackref-doc..." - dnf remove -y texlive-footnotebackref-doc &> /dev/null - CHECK_RESULT $? 0 0 "卸载texlive-footnotebackref-doc失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_service_start.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_service_start.sh deleted file mode 100644 index 4bc9e2116fc..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_service_start.sh +++ /dev/null @@ -1,79 +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-17 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-footnotebackref-doc 提供的服务是否能够正确启动 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - - # 检查是否已安装 texlive-footnotebackref-doc - LOG_INFO "检查是否已安装 texlive-footnotebackref-doc" - rpm -q texlive-footnotebackref-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-footnotebackref-doc 已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-footnotebackref-doc 未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否存在 texlive-footnotebackref-doc - LOG_INFO "检查 yum 源中是否存在 texlive-footnotebackref-doc" - dnf list available texlive-footnotebackref-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-footnotebackref-doc,退出测试" - exit 255 - fi - - # 安装 texlive-footnotebackref-doc(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 texlive-footnotebackref-doc" - dnf install -y texlive-footnotebackref-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装 texlive-footnotebackref-doc 失败" - fi - - # 测试服务启动功能(假设服务启动命令为 footnotebackref-service) - LOG_INFO "测试 footnotebackref-service 服务启动功能" - footnotebackref-service start > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "footnotebackref-service 服务启动失败" - - # 检查服务状态(假设服务状态命令为 footnotebackref-service status) - LOG_INFO "检查 footnotebackref-service 服务状态" - footnotebackref-service status > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "footnotebackref-service 服务未正常运行" - - # 停止服务(假设服务停止命令为 footnotebackref-service stop) - LOG_INFO "停止 footnotebackref-service 服务" - footnotebackref-service stop > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "footnotebackref-service 服务停止失败" - - # 清理环境(如果脚本开始时未安装,则卸载) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-footnotebackref-doc" - dnf remove -y texlive-footnotebackref-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载 texlive-footnotebackref-doc 失败" - fi - - LOG_INFO "测试完成,环境已恢复" - - - ### **说明** -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_service_status.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_service_status.sh deleted file mode 100644 index bde72901405..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_service_status.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-06-17 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-footnotebackref-doc 提供的服务是否能够正确查询状态 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - - # 检查是否已经安装 texlive-footnotebackref-doc - LOG_INFO "检查是否已安装 texlive-footnotebackref-doc" - if dnf list installed texlive-footnotebackref-doc &>/dev/null; then - LOG_INFO "texlive-footnotebackref-doc 已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-footnotebackref-doc 未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-footnotebackref-doc 软件包 - LOG_INFO "检查 yum 源中是否存在 texlive-footnotebackref-doc" - if ! dnf list available texlive-footnotebackref-doc &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-footnotebackref-doc 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 texlive-footnotebackref-doc" - dnf install -y texlive-footnotebackref-doc - CHECK_RESULT $? 0 0 "安装 texlive-footnotebackref-doc 失败" - fi - - # 测试服务状态查询功能 - LOG_INFO "测试 texlive-footnotebackref-doc 提供的服务状态查询功能" - if ! command -v footnotebackref-status &>/dev/null; then - LOG_ERROR "footnotebackref-status 命令不存在或不支持" - exit 255 - fi - - footnotebackref-status --check - CHECK_RESULT $? 0 0 "服务状态查询失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-footnotebackref-doc" - dnf remove -y texlive-footnotebackref-doc - CHECK_RESULT $? 0 0 "卸载 texlive-footnotebackref-doc 失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_service_stop.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_service_stop.sh deleted file mode 100644 index b61a7357b5f..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_service_stop.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-06-17 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-footnotebackref-doc 提供的服务是否能够正确停止 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已经安装texlive-footnotebackref-doc - LOG_INFO "检查是否已安装texlive-footnotebackref-doc..." - dnf list installed texlive-footnotebackref-doc &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-footnotebackref-doc已安装,脚本结束后将保持安装状态。" - INSTALLED=true - else - LOG_INFO "texlive-footnotebackref-doc未安装,将在测试完成后卸载。" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-footnotebackref-doc - LOG_INFO "检查yum源中是否存在texlive-footnotebackref-doc..." - dnf list available texlive-footnotebackref-doc &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-footnotebackref-doc软件包。" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装texlive-footnotebackref-doc..." - dnf install -y texlive-footnotebackref-doc - CHECK_RESULT $? 0 0 "安装texlive-footnotebackref-doc失败。" - fi - - # 测试服务是否能正确停止(假设服务名为footnotebackref) - LOG_INFO "测试服务footnotebackref是否能正确停止..." - systemctl stop footnotebackref &>/dev/null - CHECK_RESULT $? 0 0 "停止footnotebackref服务失败。" - - # 恢复环境:如果脚本开始时未安装,则在结束时卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载texlive-footnotebackref-doc..." - dnf remove -y texlive-footnotebackref-doc - CHECK_RESULT $? 0 0 "卸载texlive-footnotebackref-doc失败。" - fi - - LOG_INFO "测试完成,环境已恢复。" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_upgrade.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_upgrade.sh deleted file mode 100644 index f38b303cb3c..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-footnotebackref-doc/test_texlive-footnotebackref-doc_upgrade.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 : 2025-06-17 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-footnotebackref-doc 软件包是否能够正确升级 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - - # 检查yum源中是否存在texlive-footnotebackref-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-footnotebackref-doc软件包" - dnf list available texlive-footnotebackref-doc &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-footnotebackref-doc软件包" - exit 255 - fi - - # 检查当前是否已安装texlive-footnotebackref-doc软件包 - LOG_INFO "检查当前是否已安装texlive-footnotebackref-doc软件包" - rpm -q texlive-footnotebackref-doc &>/dev/null - is_installed=$? - - # 如果未安装,则安装软件包作为测试步骤 - if [ $is_installed -ne 0 ]; then - LOG_INFO "安装texlive-footnotebackref-doc软件包" - dnf install -y texlive-footnotebackref-doc - CHECK_RESULT $? 0 0 "安装texlive-footnotebackref-doc软件包失败" - fi - - # 检查升级命令是否支持 - LOG_INFO "检查升级命令是否支持" - dnf check-update texlive-footnotebackref-doc &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "升级命令不支持或参数错误" - exit 255 - fi - - # 执行升级操作 - LOG_INFO "执行升级操作" - dnf upgrade -y texlive-footnotebackref-doc - CHECK_RESULT $? 0 0 "升级texlive-footnotebackref-doc软件包失败" - - # 验证升级后的版本是否符合预期(假设验证逻辑) - LOG_INFO "验证升级后的版本是否符合预期" - current_version=$(rpm -q --queryformat '%{VERSION}' texlive-footnotebackref-doc) - CHECK_RESULT $? 0 0 "获取当前版本失败" - - # 如果最初未安装,则在脚本结束前卸载软件包以恢复环境 - if [ $is_installed -ne 0 ]; then - LOG_INFO "卸载texlive-footnotebackref-doc软件包以恢复环境" - dnf remove -y texlive-footnotebackref-doc - CHECK_RESULT $? 0 0 "卸载texlive-footnotebackref-doc软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-halloweenmath/test_texlive-halloweenmath_function_compile.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-halloweenmath/test_texlive-halloweenmath_function_compile.sh deleted file mode 100644 index 440c852a51e..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-halloweenmath/test_texlive-halloweenmath_function_compile.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-11-26 -# @License : Mulan PSL v2 -# @Desc : Test compilation of Halloween math -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试: Test compilation of Halloween math" - - # 检查是否已安装texlive-halloweenmath - LOG_INFO "检查texlive-halloweenmath是否已安装" - if dnf list installed texlive-halloweenmath &>/dev/null; then - LOG_INFO "texlive-halloweenmath已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-halloweenmath未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-halloweenmath - LOG_INFO "检查yum源中是否存在texlive-halloweenmath" - if ! dnf list available texlive-halloweenmath &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-halloweenmath,退出测试" - exit 255 - fi - - # 安装texlive-halloweenmath(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-halloweenmath" - dnf install -y texlive-halloweenmath - CHECK_RESULT $? 0 0 "安装texlive-halloweenmath失败" - fi - - # 测试编译功能 - LOG_INFO "测试Halloween math的编译功能" - latex -interaction=nonstopmode test_halloweenmath.tex - CHECK_RESULT $? 0 0 "编译Halloween math失败" - - # 清理环境(如果最初未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-halloweenmath" - dnf remove -y texlive-halloweenmath - CHECK_RESULT $? 0 0 "卸载texlive-halloweenmath失败" - fi - - LOG_INFO "测试完成: Test compilation of Halloween math" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/xmlunit/xmlunit-placeholders/test_xmlunit-placeholders_function_compare.sh b/testcases/function_test/pkg_test/xmlunit/xmlunit-placeholders/test_xmlunit-placeholders_function_compare.sh deleted file mode 100644 index 7d557e261db..00000000000 --- a/testcases/function_test/pkg_test/xmlunit/xmlunit-placeholders/test_xmlunit-placeholders_function_compare.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-08 -# @License : Mulan PSL v2 -# @Desc : Test the basic XML comparison functionality with placeholders. -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试:Test the basic XML comparison functionality with placeholders." - - # 检查软件包是否已安装 - LOG_INFO "检查软件包是否已安装" - if rpm -q xmlunit-placeholders; then - LOG_INFO "软件包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在xmlunit-placeholders软件包" - if ! dnf list available xmlunit-placeholders &>/dev/null; then - LOG_ERROR "yum源中未找到xmlunit-placeholders软件包" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装xmlunit-placeholders软件包" - dnf install -y xmlunit-placeholders - CHECK_RESULT $? 0 0 "安装xmlunit-placeholders失败" - fi - - # 测试XML比较功能(假设命令为xmlcompare) - LOG_INFO "测试XML比较功能" - xmlcompare --placeholders - CHECK_RESULT $? 0 0 "XML比较功能测试失败" - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载xmlunit-placeholders软件包" - dnf remove -y xmlunit-placeholders - CHECK_RESULT $? 0 0 "卸载xmlunit-placeholders失败" - fi - - LOG_INFO "测试完成:Test the basic XML comparison functionality with placeholders." - -} - -main "$@" \ No newline at end of file