diff --git a/suite2cases/function_test/pkg_test/file/file-devel.json b/suite2cases/function_test/pkg_test/file/file-devel.json index 0062777003a..1846d492fc7 100644 --- a/suite2cases/function_test/pkg_test/file/file-devel.json +++ b/suite2cases/function_test/pkg_test/file/file-devel.json @@ -2,10 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/file/file-devel", "machine num": 1, "cases": [ - { - "name": "test_file-devel_function_install", - "desc": "Test the installation of file-devel package" - }, { "name": "test_file-devel_function_remove", "desc": "Test the removal of file-devel package" @@ -13,14 +9,6 @@ { "name": "test_file-devel_function_version", "desc": "Test the version of file-devel package" - }, - { - "name": "test_file-devel_function_devfiles", - "desc": "Test the existence of development files" - }, - { - "name": "test_file-devel_function_link", - "desc": "Test linking with libmagic library" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/gv/gv-help.json b/suite2cases/function_test/pkg_test/gv/gv-help.json index 27633924c13..aa548785970 100644 --- a/suite2cases/function_test/pkg_test/gv/gv-help.json +++ b/suite2cases/function_test/pkg_test/gv/gv-help.json @@ -7,60 +7,10 @@ "desc": "测试gv-help软件包的安装功能,验证软件包是否可以正常安装。", "machine num": 1 }, - { - "name": "test_gv-help_uninstall", - "desc": "测试gv-help软件包的卸载功能,验证软件包是否可以正常卸载。", - "machine num": 1 - }, - { - "name": "test_gv-help_upgrade", - "desc": "测试gv-help软件包的升级功能,验证软件包是否可以正常升级。", - "machine num": 1 - }, - { - "name": "test_gv-help_downgrade", - "desc": "测试gv-help软件包的降级功能,验证软件包是否可以正常降级到指定版本。", - "machine num": 1 - }, - { - "name": "test_gv-help_rollback", - "desc": "测试gv-help软件包的回滚功能,验证软件包是否可以正常回滚到上一个版本。", - "machine num": 1 - }, - { - "name": "test_gv-help_service_start", - "desc": "测试gv-help软件包服务的启动功能,验证服务是否可以正常启动。", - "machine num": 1 - }, - { - "name": "test_gv-help_service_stop", - "desc": "测试gv-help软件包服务的停止功能,验证服务是否可以正常停止。", - "machine num": 1 - }, - { - "name": "test_gv-help_service_restart", - "desc": "测试gv-help软件包服务的重启功能,验证服务是否可以正常重启。", - "machine num": 1 - }, - { - "name": "test_gv-help_service_status", - "desc": "测试gv-help软件包服务的状态查询功能,验证服务是否可以正常查询当前状态。", - "machine num": 1 - }, { "name": "test_gv-help_service_log", "desc": "测试gv-help软件包服务的日志查看功能,验证服务是否可以正常查看日志。", "machine num": 1 - }, - { - "name": "test_gv-help_service_config", - "desc": "测试gv-help软件包服务的配置功能,验证服务是否可以正常配置。", - "machine num": 1 - }, - { - "name": "test_gv-help_reinstall", - "desc": "测试gv-help软件包的重新安装功能,验证软件包是否可以正常重新安装。", - "machine num": 1 } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/libutempter/libutempter-devel.json b/suite2cases/function_test/pkg_test/libutempter/libutempter-devel.json index dff3eeafcc9..57b76fab636 100644 --- a/suite2cases/function_test/pkg_test/libutempter/libutempter-devel.json +++ b/suite2cases/function_test/pkg_test/libutempter/libutempter-devel.json @@ -6,14 +6,6 @@ "name": "test_libutempter-devel_function_install", "desc": "测试 libutempter-devel 软件包能否通过包管理器成功安装" }, - { - "name": "test_libutempter-devel_function_check_files", - "desc": "测试安装 libutempter-devel 软件包后,关键的开发文件(如头文件和库文件)是否存在于标准路径中" - }, - { - "name": "test_libutempter-devel_function_compile_link", - "desc": "测试使用 libutempter-devel 提供的头文件和库文件,能否成功编译并链接一个简单的测试程序" - }, { "name": "test_libutempter-devel_function_uninstall", "desc": "测试 libutempter-devel 软件包能否通过包管理器被干净地卸载,且相关开发文件被移除" diff --git a/suite2cases/function_test/pkg_test/python-Arpeggio/python3-Arpeggio.json b/suite2cases/function_test/pkg_test/python-Arpeggio/python3-Arpeggio.json index a39cf132cd2..e2cbf9e1285 100644 --- a/suite2cases/function_test/pkg_test/python-Arpeggio/python3-Arpeggio.json +++ b/suite2cases/function_test/pkg_test/python-Arpeggio/python3-Arpeggio.json @@ -6,18 +6,6 @@ "name": "test_python3-Arpeggio_function_install", "desc": "测试python3-Arpeggio软件包能否通过包管理器正常安装" }, - { - "name": "test_python3-Arpeggio_function_import", - "desc": "测试在Python环境中能否成功导入arpeggio模块" - }, - { - "name": "test_python3-Arpeggio_function_parse_simple", - "desc": "测试使用Arpeggio解析一个简单的语法规则" - }, - { - "name": "test_python3-Arpeggio_function_visitor", - "desc": "测试使用访客模式遍历和操作解析树" - }, { "name": "test_python3-Arpeggio_function_uninstall", "desc": "测试python3-Arpeggio软件包能否通过包管理器正常卸载" diff --git a/suite2cases/function_test/pkg_test/qt6-qttools/qt6-qttools-libs-help.json b/suite2cases/function_test/pkg_test/qt6-qttools/qt6-qttools-libs-help.json deleted file mode 100644 index ad9ef7ba00d..00000000000 --- a/suite2cases/function_test/pkg_test/qt6-qttools/qt6-qttools-libs-help.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/qt6-qttools/qt6-qttools-libs-help", - "machine num": 1, - "cases": [ - { - "name": "test_qt6-qttools-libs-help_function_basic", - "desc": "Basic functionality test for qt6-qttools-libs-help" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/rubygem-prawn/rubygem-prawn-doc.json b/suite2cases/function_test/pkg_test/rubygem-prawn/rubygem-prawn-doc.json deleted file mode 100644 index a503dea4a44..00000000000 --- a/suite2cases/function_test/pkg_test/rubygem-prawn/rubygem-prawn-doc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/rubygem-prawn/rubygem-prawn-doc", - "machine num": 1, - "cases": [ - { - "name": "test_rubygem-prawn-doc_function_doc_generation", - "desc": "Test document generation functionality" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-e/texlive-comfortaa-doc.json b/suite2cases/function_test/pkg_test/texlive-split-e/texlive-comfortaa-doc.json deleted file mode 100644 index a55373c9049..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-e/texlive-comfortaa-doc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-e/texlive-comfortaa-doc", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-comfortaa-doc_function_install", - "desc": "Test package installation" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-e/texlive-cormorantgaramond.json b/suite2cases/function_test/pkg_test/texlive-split-e/texlive-cormorantgaramond.json index ff52530bceb..ecf31926590 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-e/texlive-cormorantgaramond.json +++ b/suite2cases/function_test/pkg_test/texlive-split-e/texlive-cormorantgaramond.json @@ -2,22 +2,10 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-e/texlive-cormorantgaramond", "machine num": 1, "cases": [ - { - "name": "test_texlive-cormorantgaramond_function_font", - "desc": "Test the font rendering functionality" - }, { "name": "test_texlive-cormorantgaramond_function_install", "desc": "Test the installation of texlive-cormorantgaramond package" }, - { - "name": "test_texlive-cormorantgaramond_function_check_font", - "desc": "Test the availability of CormorantGaramond font in TeX" - }, - { - "name": "test_texlive-cormorantgaramond_function_basic_usage", - "desc": "Test basic LaTeX document using the font" - }, { "name": "test_texlive-cormorantgaramond_function_uninstall", "desc": "Test the removal of texlive-cormorantgaramond package" diff --git a/suite2cases/function_test/pkg_test/texlive-split-g/texlive-doi.json b/suite2cases/function_test/pkg_test/texlive-split-g/texlive-doi.json index 494b8c20798..1da6d0bd48c 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-g/texlive-doi.json +++ b/suite2cases/function_test/pkg_test/texlive-split-g/texlive-doi.json @@ -10,14 +10,6 @@ "name": "test_texlive-doi_function_version", "desc": "测试查询已安装的texlive-doi软件包版本信息" }, - { - "name": "test_texlive-doi_function_usage", - "desc": "测试在LaTeX文档中使用\\usepackage{doi}并编译通过" - }, - { - "name": "test_texlive-doi_function_hyperlink", - "desc": "测试使用doi宏包提供的命令正确生成指向DOI的链接" - }, { "name": "test_texlive-doi_function_uninstall", "desc": "测试通过包管理器成功卸载texlive-doi软件包" diff --git a/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fancynum-doc.json b/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fancynum-doc.json index 9d2c550fa54..133be49cd4d 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fancynum-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fancynum-doc.json @@ -17,10 +17,6 @@ { "name": "test_texlive-fancynum-doc_function_verify_files", "desc": "Verify doc files presence" - }, - { - "name": "test_texlive-fancynum-doc_function_usage_example", - "desc": "Test basic usage example" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-r/texlive-powerdot-doc.json b/suite2cases/function_test/pkg_test/texlive-split-r/texlive-powerdot-doc.json index 72e63907a62..1391c5ca824 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-r/texlive-powerdot-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-r/texlive-powerdot-doc.json @@ -10,17 +10,9 @@ "name": "test_texlive-powerdot-doc_function_uninstall", "desc": "Test package removal" }, - { - "name": "test_texlive-powerdot-doc_function_version", - "desc": "Check installed version" - }, { "name": "test_texlive-powerdot-doc_function_files", "desc": "Verify core files exist" - }, - { - "name": "test_texlive-powerdot-doc_function_usage", - "desc": "Test basic usage demo" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-u/texlive-sepnum.json b/suite2cases/function_test/pkg_test/texlive-split-u/texlive-sepnum.json deleted file mode 100644 index c343a4cda82..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-u/texlive-sepnum.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-u/texlive-sepnum", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-sepnum_install", - "desc": "测试 texlive-sepnum 软件包的安装功能,确保能够正确安装到系统中。", - "machine num": 1 - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-x/texlive-beamerthemenord.json b/suite2cases/function_test/pkg_test/texlive-split-x/texlive-beamerthemenord.json deleted file mode 100644 index 3d19d21b71d..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-x/texlive-beamerthemenord.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-x/texlive-beamerthemenord", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-beamerthemenord_function_render", - "desc": "Test rendering of beamer theme" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-uspace.json b/suite2cases/function_test/pkg_test/texlive-split-y/texlive-uspace.json deleted file mode 100644 index 1a748f2a368..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-uspace.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-y/texlive-uspace", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-uspace_function_install", - "desc": "Test package installation" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-ziffer.json b/suite2cases/function_test/pkg_test/texlive-split-z/texlive-ziffer.json index c7928e02e08..8d5498557c0 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-ziffer.json +++ b/suite2cases/function_test/pkg_test/texlive-split-z/texlive-ziffer.json @@ -6,26 +6,6 @@ "name": "test_texlive-ziffer_install", "desc": "测试texlive-ziffer软件包的安装功能", "machine num": 1 - }, - { - "name": "test_texlive-ziffer_function_install", - "desc": "测试texlive-ziffer软件包的安装功能" - }, - { - "name": "test_texlive-ziffer_function_remove", - "desc": "测试texlive-ziffer软件包的卸载功能" - }, - { - "name": "test_texlive-ziffer_function_ziffer_usage", - "desc": "测试texlive-ziffer包提供的数字格式化功能在LaTeX文档中的基本用法" - }, - { - "name": "test_texlive-ziffer_function_ziffer_switch", - "desc": "测试texlive-ziffer包中数字显示模式的切换功能" - }, - { - "name": "test_texlive-ziffer_function_file_exist", - "desc": "验证texlive-ziffer包的核心文件(如ziffer.sty)在系统中存在" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/tpm2-abrmd/tpm2-abrmd-selinux.json b/suite2cases/function_test/pkg_test/tpm2-abrmd/tpm2-abrmd-selinux.json deleted file mode 100644 index 585321b698f..00000000000 --- a/suite2cases/function_test/pkg_test/tpm2-abrmd/tpm2-abrmd-selinux.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/tpm2-abrmd/tpm2-abrmd-selinux", - "machine num": 1, - "cases": [ - { - "name": "test_tpm2-abrmd-selinux_function_install", - "desc": "Verify the installation of tpm2-abrmd-selinux package" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/file/file-devel/test_file-devel_function_devfiles.sh b/testcases/function_test/pkg_test/file/file-devel/test_file-devel_function_devfiles.sh deleted file mode 100644 index 96f12f51c8d..00000000000 --- a/testcases/function_test/pkg_test/file/file-devel/test_file-devel_function_devfiles.sh +++ /dev/null @@ -1,224 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-30 -# @License : Mulan PSL v2 -# @Desc : Test the existence of development files -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - ## 测试开发文件存在的测试脚本 - - LOG_INFO "===== 开始测试 development files 的存在性 =====" - - ## 1. 检查软件包是否已安装 - LOG_INFO "步骤1: 检查 file-devel 软件包是否已安装" - dnf list installed file-devel > /dev/null 2>&1 - INSTALLED_FLAG=$? - - ## 2. 记录初始状态并执行测试逻辑 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "file-devel 软件包已安装,测试结束后将保持安装状态" - PACKAGE_NEEDS_CLEANUP=0 - else - LOG_INFO "file-devel 软件包未安装,将作为测试步骤安装并在结束后卸载" - PACKAGE_NEEDS_CLEANUP=1 - fi - - ## 3. 检查软件包是否在yum源中可用 - LOG_INFO "步骤2: 检查 file-devel 软件包在yum源中的可用性" - dnf list available file-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有可用的 file-devel 软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "file-devel 软件包在yum源中不可用" - exit 255 - fi - - ## 4. 如果未安装则安装软件包 - if [ $PACKAGE_NEEDS_CLEANUP -eq 1 ]; then - LOG_INFO "步骤3: 安装 file-devel 软件包" - dnf install -y file-devel - CHECK_RESULT $? 0 0 "安装 file-devel 软件包失败" - fi - - ## 5. 测试开发文件的存在性 - LOG_INFO "步骤4: 验证开发文件的存在性" - - ### 5.1 检查头文件是否存在 - LOG_INFO "检查 file 相关的头文件" - HEADER_FILES_EXIST=0 - HEADER_FILES=( - "/usr/include/magic.h" - "/usr/include/file.h" - ) - - for header in "${HEADER_FILES[@]}"; do - if [ -f "$header" ]; then - LOG_INFO "找到头文件: $header" - ((HEADER_FILES_EXIST++)) - else - LOG_ERROR "未找到头文件: $header" - fi - done - - [[ $HEADER_FILES_EXIST -gt 0 ]] - CHECK_RESULT $? 0 0 "未找到任何 file 开发头文件" - - ### 5.2 检查库文件是否存在 - LOG_INFO "检查 file 相关的库文件" - LIB_FILES_EXIST=0 - LIB_FILES=( - "/usr/lib/libmagic.so" - "/usr/lib64/libmagic.so" - ) - - for lib in "${LIB_FILES[@]}"; do - if [ -f "$lib" ] || [ -L "$lib" ]; then - LOG_INFO "找到库文件: $lib" - ((LIB_FILES_EXIST++)) - fi - done - - [[ $LIB_FILES_EXIST -gt 0 ]] - CHECK_RESULT $? 0 0 "未找到任何 file 库文件" - - ### 5.3 检查pkg-config文件 - LOG_INFO "检查 pkg-config 配置文件" - PKG_CONFIG_FILES=( - "/usr/lib/pkgconfig/libmagic.pc" - "/usr/lib64/pkgconfig/libmagic.pc" - "/usr/share/pkgconfig/libmagic.pc" - ) - - PKG_CONFIG_EXIST=0 - for pkg_file in "${PKG_CONFIG_FILES[@]}"; do - if [ -f "$pkg_file" ]; then - LOG_INFO "找到pkg-config文件: $pkg_file" - ((PKG_CONFIG_EXIST++)) - # 验证pkg-config命令是否可用 - pkg-config --exists libmagic - CHECK_RESULT $? 0 0 "pkg-config 无法识别 libmagic" - LOG_INFO "pkg-config 成功识别 libmagic 包" - break - fi - done - - ### 5.4 检查其他开发文件 - LOG_INFO "检查其他开发相关文件" - OTHER_FILES=( - "/usr/include/magic.h.in" - "/usr/share/file/magic.mgc" - "/usr/share/misc/magic.mgc" - ) - - OTHER_FILES_EXIST=0 - for other_file in "${OTHER_FILES[@]}"; do - if [ -e "$other_file" ]; then - LOG_INFO "找到开发相关文件: $other_file" - ((OTHER_FILES_EXIST++)) - fi - done - - ## 6. 验证基本编译测试 - LOG_INFO "步骤5: 执行基本编译测试" - - # 创建测试C文件 - TEST_C_FILE=$(mktemp /tmp/test_magic_XXXXXX.c) - cat > "$TEST_C_FILE" << "EOF" - #include - #include - - int main() { - magic_t cookie = magic_open(MAGIC_MIME_TYPE); - if (cookie == NULL) { - printf("无法初始化magic库\n"); - return 1; - } - - if (magic_load(cookie, NULL) != 0) { - printf("无法加载magic数据库: %s\n", magic_error(cookie)); - magic_close(cookie); - return 1; - } - - printf("magic库初始化成功\n"); - magic_close(cookie); - return 0; - } - EOF - - # 编译测试程序 - TEST_BINARY=$(mktemp /tmp/test_magic_XXXXXX) - LOG_INFO "编译测试程序验证开发文件可用性" - gcc "$TEST_C_FILE" -o "$TEST_BINARY" -lmagic 2>/dev/null - COMPILE_RESULT=$? - - if [ $COMPILE_RESULT -eq 0 ]; then - LOG_INFO "编译成功: 开发文件完整可用" - - # 运行测试程序 - "$TEST_BINARY" - RUN_RESULT=$? - CHECK_RESULT $RUN_RESULT 0 0 "测试程序运行时出错" - else - LOG_ERROR "编译失败: 开发文件不完整或不可用" - CHECK_RESULT 1 0 0 "开发文件无法用于编译" - fi - - # 清理临时文件 - rm -f "$TEST_C_FILE" "$TEST_BINARY" - - ## 7. 环境清理 - LOG_INFO "步骤6: 清理测试环境" - - if [ $PACKAGE_NEEDS_CLEANUP -eq 1 ]; then - LOG_INFO "卸载测试期间安装的 file-devel 软件包" - dnf remove -y file-devel - CHECK_RESULT $? 0 0 "卸载 file-devel 软件包失败" - - LOG_INFO "验证软件包已成功卸载" - dnf list installed file-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "软件包卸载失败,仍有残留" - CHECK_RESULT 1 0 0 "软件包卸载不彻底" - else - LOG_INFO "软件包成功卸载" - fi - else - LOG_INFO "保持 file-devel 软件包的安装状态" - fi - - ## 8. 最终验证 - LOG_INFO "步骤7: 最终环境验证" - - # 检查命令是否存在(不应依赖file-devel包) - command -v file > /dev/null - CHECK_RESULT $? 0 0 "file命令不存在,环境可能被破坏" - - # 验证基本file命令功能 - echo "test" | file - - CHECK_RESULT $? 0 0 "file命令基本功能异常" - - LOG_INFO "===== 测试完成: development files 存在性测试成功 =====" - LOG_INFO "测试总结:" - LOG_INFO "- 开发文件头文件: 存在" - LOG_INFO "- 开发库文件: 存在" - LOG_INFO "- pkg-config配置: 可用" - LOG_INFO "- 编译功能: 正常" - LOG_INFO "- 环境状态: 已恢复到测试前状态" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/file/file-devel/test_file-devel_function_install.sh b/testcases/function_test/pkg_test/file/file-devel/test_file-devel_function_install.sh deleted file mode 100644 index c369c20c483..00000000000 --- a/testcases/function_test/pkg_test/file/file-devel/test_file-devel_function_install.sh +++ /dev/null @@ -1,65 +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-08-15 -# @License : Mulan PSL v2 -# @Desc : Test the installation of file-devel package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 file-devel 软件包的安装功能" - - # 检查是否已经安装了 file-devel 包 - LOG_INFO "检查系统中是否已安装 file-devel 包" - rpm -q file-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "file-devel 包已安装,脚本结束后将保持安装状态" - already_installed=true - else - LOG_INFO "file-devel 包未安装,将在测试步骤中安装" - already_installed=false - fi - - # 检查 yum 源中是否有 file-devel 包 - LOG_INFO "检查 yum 源中是否有 file-devel 包" - dnf list available file-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中没有找到file-devel包" - - # 安装 file-devel 包(如果未安装) - if [ "$already_installed" = false ]; then - LOG_INFO "开始安装 file-devel 包" - dnf install -y file-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "安装file-devel包失败" - LOG_INFO "file-devel包安装成功" - fi - - # 测试文件开发功能 - LOG_INFO "测试文件开发功能是否正常" - gcc -v > /dev/null 2>&1 - CHECK_RESULT $? 0 $? "gcc命令执行失败" - - # 清理环境(如果之前未安装) - if [ "$already_installed" = false ]; then - LOG_INFO "清理环境,卸载file-devel包" - dnf remove -y file-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 $? "卸载file-devel包失败" - LOG_INFO "file-devel包卸载成功" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/file/file-devel/test_file-devel_function_link.sh b/testcases/function_test/pkg_test/file/file-devel/test_file-devel_function_link.sh deleted file mode 100644 index 9a63f9d7ca2..00000000000 --- a/testcases/function_test/pkg_test/file/file-devel/test_file-devel_function_link.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-01-30 -# @License : Mulan PSL v2 -# @Desc : Test linking with libmagic library -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "1. 检查系统是否已安装file-devel软件包" - rpm -q file-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "file-devel已安装,标记为已安装状态" - INSTALLED=1 - else - LOG_INFO "file-devel未安装,标记为未安装状态" - INSTALLED=0 - fi - - LOG_INFO "2. 检查yum源中是否存在file-devel软件包" - dnf list available file-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到file-devel软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到file-devel软件包,退出测试" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "3. 安装file-devel软件包" - dnf install -y file-devel - CHECK_RESULT $? 0 0 "安装file-devel失败" - fi - - LOG_INFO "4. 编写测试C程序,链接libmagic库" - cat > test_magic.c << "EOF" - #include - #include - - int main() { - magic_t cookie = magic_open(MAGIC_MIME_TYPE); - if (cookie == NULL) { - printf("magic_open failed\n"); - return 1; - } - if (magic_load(cookie, NULL) != 0) { - printf("magic_load failed: %s\n", magic_error(cookie)); - magic_close(cookie); - return 1; - } - const char *result = magic_file(cookie, "/etc/passwd"); - if (result == NULL) { - printf("magic_file failed: %s\n", magic_error(cookie)); - magic_close(cookie); - return 1; - } - printf("File type: %s\n", result); - magic_close(cookie); - return 0; - } - EOF - CHECK_RESULT $? 0 0 "创建测试C程序失败" - - LOG_INFO "5. 编译测试程序,链接libmagic库" - gcc test_magic.c -o test_magic -lmagic - CHECK_RESULT $? 0 0 "编译测试程序失败" - - LOG_INFO "6. 运行测试程序" - ./test_magic - CHECK_RESULT $? 0 0 "运行测试程序失败" - - LOG_INFO "7. 清理临时文件" - rm -f test_magic.c test_magic - CHECK_RESULT $? 0 0 "清理临时文件失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "8. 卸载file-devel软件包" - dnf remove -y file-devel - CHECK_RESULT $? 0 0 "卸载file-devel失败" - else - LOG_INFO "8. 系统已安装file-devel,保持安装状态" - fi - - LOG_INFO "9. 测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_downgrade.sh b/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_downgrade.sh deleted file mode 100644 index 05db7fd730e..00000000000 --- a/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_downgrade.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试gv-help软件包的降级功能,验证软件包是否可以正常降级到指定版本。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查软件包是否已安装 - check_package_installed() { - local package_name=$1 - rpm -q "$package_name" >/dev/null 2>&1 - return $? - } - - # 检查yum源中是否存在软件包 - check_package_in_repo() { - local package_name=$1 - dnf list available "$package_name" >/dev/null 2>&1 - return $? - } - - # 安装软件包 - install_package() { - local package_name=$1 - LOG_INFO "开始安装软件包: $package_name" - dnf install -y "$package_name" - CHECK_RESULT $? 0 0 "安装软件包失败" - } - - # 卸载软件包 - uninstall_package() { - local package_name=$1 - LOG_INFO "开始卸载软件包: $package_name" - dnf remove -y "$package_name" - CHECK_RESULT $? 0 0 "卸载软件包失败" - } - - # 降级软件包到指定版本 - downgrade_package() { - local package_name=$1 - local target_version=$2 - LOG_INFO "开始降级软件包: $package_name 到版本: $target_version" - dnf downgrade -y "${package_name}-${target_version}" - CHECK_RESULT $? 0 0 "降级软件包失败" - } - - # 主函数 - main() { - local package_name="gv-help" - - # 检查yum源中是否存在gv-help软件包 - LOG_INFO "检查yum源中是否存在gv-help软件包" - if ! check_package_in_repo "$package_name"; then - LOG_ERROR "yum源中不存在gv-help软件包" - exit 255 - fi - - # 检查是否已安装gv-help软件包 - LOG_INFO "检查是否已安装gv-help软件包" - - # 获取当前安装的版本(如果已安装) - current_version="$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" "$package_name" 2>/dev/null)" - was_installed=$([ -n "$current_version" ] && echo "true" || echo "false") - - if [ "$was_installed" = "false" ]; then - LOG_INFO "环境未安装gv-help软件包,开始安装最新版本" - install_package "$package_name" - else - LOG_INFO "环境已安装gv-help当前版本为:$current_version" - fi - - # TODO:替换为实际需要降级的版本号 - target_version="x.y.z-r" - - # 验证目标版本是否存在 - if ! dnf list available "${package_name}-${target_version}" >/dev/null 2>&1; then - LOG_ERROR "目标版本 ${package_name}-${target_version}不存在于yum源中" - exit 255 - fi - - downgrade_package "${package_name}" "${target_version}" - - # 如果最初未安装,则卸载以恢复环境 - if [ "$was_installed" = false ]; then - uninstall_package "${package}" - fi - - exit 0 - } - - main "$@" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_reinstall.sh b/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_reinstall.sh deleted file mode 100644 index 2d436fbe19a..00000000000 --- a/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_reinstall.sh +++ /dev/null @@ -1,62 +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-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试gv-help软件包的重新安装功能,验证软件包是否可以正常重新安装。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装gv-help软件包 - LOG_INFO "检查gv-help软件包是否已安装" - rpm -q gv-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "gv-help软件包已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "gv-help软件包未安装,脚本结束时将卸载软件包" - INSTALLED=false - fi - - # 检查yum源中是否有gv-help软件包 - LOG_INFO "检查yum源中是否有gv-help软件包" - dnf list available gv-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到gv-help软件包" - exit 255 - fi - - # 重新安装gv-help软件包 - LOG_INFO "开始重新安装gv-help软件包" - dnf reinstall -y gv-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "重新安装gv-help软件包失败" - - # 验证软件包是否成功安装 - LOG_INFO "验证gv-help软件包是否成功安装" - rpm -q gv-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "gv-help软件包未成功安装" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载gv-help软件包" - dnf remove -y gv-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载gv-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_rollback.sh b/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_rollback.sh deleted file mode 100644 index 539695d4c16..00000000000 --- a/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_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-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试gv-help软件包的回滚功能,验证软件包是否可以正常回滚到上一个版本。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装gv-help软件包 - LOG_INFO "检查是否已安装gv-help软件包" - rpm -q gv-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "gv-help软件包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "gv-help软件包未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在gv-help软件包 - LOG_INFO "检查yum源中是否存在gv-help软件包" - dnf list available gv-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在gv-help软件包" - exit 255 - fi - - # 安装gv-help软件包 - LOG_INFO "开始安装gv-help软件包" - dnf install -y gv-help - CHECK_RESULT $? 0 0 "安装gv-help软件包失败" - - # 获取当前安装的版本 - LOG_INFO "获取当前安装的gv-help版本" - CURRENT_VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" gv-help) - LOG_INFO "当前安装的gv-help版本为: $CURRENT_VERSION" - - # 回滚到上一个版本 - LOG_INFO "开始回滚gv-help到上一个版本" - dnf history undo last -y --skip-broken > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "回滚gv-help到上一个版本失败" - - # 验证回滚后的版本 - LOG_INFO "验证回滚后的gv-help版本" - ROLLBACK_VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" gv-help) - if [ "$ROLLBACK_VERSION" != "$CURRENT_VERSION" ]; then - LOG_INFO "回滚成功,当前版本为: $ROLLBACK_VERSION" - else - LOG_ERROR "回滚失败,当前版本仍为: $ROLLBACK_VERSION" - exit 1 - fi - - # 清理环境:如果脚本开始时未安装gv-help,则卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载gv-help软件包" - dnf remove -y gv-help - CHECK_RESULT $? 0 0 "卸载gv-help软件包失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_service_config.sh b/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_service_config.sh deleted file mode 100644 index 47da45f4510..00000000000 --- a/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_service_config.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-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试gv-help软件包服务的配置功能,验证服务是否可以正常配置。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试gv-help软件包服务的配置功能,验证服务是否可以正常配置。" - - # 检查gv-help软件包是否已安装 - LOG_INFO "检查gv-help软件包是否已安装..." - if rpm -q gv-help; then - LOG_INFO "gv-help软件包已安装,脚本结束时将保持安装状态。" - INSTALLED=true - else - LOG_INFO "gv-help软件包未安装,将在测试过程中安装并在结束时卸载。" - INSTALLED=false - fi - - # 检查yum源中是否有gv-help软件包 - LOG_INFO "检查yum源中是否有gv-help软件包..." - if ! dnf list available gv-help &>/dev/null; then - LOG_ERROR "yum源中未找到gv-help软件包,退出测试。" - exit 255 - fi - - # 如果未安装,则安装gv-help软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装gv-help软件包..." - dnf install -y gv-help - CHECK_RESULT $? 0 0 "安装gv-help软件包失败。" - fi - - # 验证服务配置功能 - LOG_INFO "验证gv-help服务配置功能..." - systemctl enable gv-help - CHECK_RESULT $? 0 0 "启用gv-help服务失败。" - - systemctl start gv-help - CHECK_RESULT $? 0 0 "启动gv-help服务失败。" - - systemctl status gv-help | grep -q "active (running)" - CHECK_RESULT $? 0 0 "gv-help服务未正常运行。" - - # 清理环境:如果脚本开始时未安装gv-help,则卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载gv-help软件包..." - dnf remove -y gv-help - CHECK_RESULT $? 0 0 "卸载gv-help软件包失败。" - fi - - LOG_INFO "测试完成,环境已恢复。" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_service_restart.sh b/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_service_restart.sh deleted file mode 100644 index e8ef89959e8..00000000000 --- a/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_service_restart.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-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试gv-help软件包服务的重启功能,验证服务是否可以正常重启。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试gv-help软件包服务的重启功能,验证服务是否可以正常重启 - - LOG_INFO "开始测试gv-help软件包服务的重启功能" - - # 检查gv-help软件包是否已安装 - if ! dnf list installed gv-help &>/dev/null; then - LOG_INFO "gv-help软件包未安装,开始安装" - # 检查yum源中是否有gv-help软件包 - if ! dnf list available gv-help &>/dev/null; then - LOG_ERROR "yum源中未找到gv-help软件包" - exit 255 - fi - # 安装gv-help软件包 - dnf install -y gv-help - CHECK_RESULT $? 0 0 "安装gv-help软件包失败" - INSTALLED=true - else - LOG_INFO "gv-help软件包已安装" - INSTALLED=false - fi - - # 检查服务是否存在 - systemctl list-unit-files | grep -q gv-help.service - CHECK_RESULT $? 0 0 "gv-help服务不存在" - - # 重启服务 - LOG_INFO "重启gv-help服务" - systemctl restart gv-help.service - CHECK_RESULT $? 0 0 "重启gv-help服务失败" - - # 检查服务状态 - LOG_INFO "检查gv-help服务状态" - systemctl status gv-help.service | grep -q "active (running)" - CHECK_RESULT $? 0 0 "gv-help服务未正常运行" - - # 清理环境 - if [ "$INSTALLED" = true ]; then - LOG_INFO "卸载gv-help软件包" - dnf remove -y gv-help - CHECK_RESULT $? 0 0 "卸载gv-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_service_start.sh b/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_service_start.sh deleted file mode 100644 index 1b27cf3e643..00000000000 --- a/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_service_start.sh +++ /dev/null @@ -1,75 +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-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试gv-help软件包服务的启动功能,验证服务是否可以正常启动。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试gv-help软件包服务的启动功能,验证服务是否可以正常启动 - - LOG_INFO "开始测试gv-help软件包服务的启动功能" - - # 检查gv-help软件包是否已安装 - if ! rpm -q gv-help > /dev/null 2>&1; then - LOG_INFO "gv-help软件包未安装,开始安装" - # 检查yum源中是否有gv-help软件包 - if ! dnf list available gv-help > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到gv-help软件包" - exit 255 - fi - # 安装gv-help软件包 - dnf install -y gv-help - CHECK_RESULT $? 0 0 "安装gv-help软件包失败" - # 标记为需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "gv-help软件包已安装" - fi - - # 检查服务是否存在 - if ! systemctl list-unit-files | grep -q gv-help.service; then - LOG_ERROR "gv-help服务不存在" - exit 255 - fi - - # 启动gv-help服务 - LOG_INFO "启动gv-help服务" - systemctl start gv-help - CHECK_RESULT $? 0 0 "启动gv-help服务失败" - - # 检查服务状态是否为active - LOG_INFO "检查gv-help服务状态" - systemctl is-active gv-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "gv-help服务未正常运行" - - # 停止服务以清理环境 - LOG_INFO "停止gv-help服务以清理环境" - systemctl stop gv-help - CHECK_RESULT $? 0 0 "停止gv-help服务失败" - - # 如果之前未安装,则卸载软件包 - if [ "$NEED_UNINSTALL" -eq 1 ]; then - LOG_INFO "卸载gv-help软件包以清理环境" - dnf remove -y gv-help - CHECK_RESULT $? 0 0 "卸载gv-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_service_status.sh b/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_service_status.sh deleted file mode 100644 index c0c7f757c4d..00000000000 --- a/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_service_status.sh +++ /dev/null @@ -1,56 +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-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试gv-help软件包服务的状态查询功能,验证服务是否可以正常查询当前状态。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试gv-help软件包服务的状态查询功能" - - # 检查gv-help软件包是否已安装 - if ! rpm -q gv-help > /dev/null 2>&1; then - LOG_INFO "gv-help软件包未安装,开始安装" - # 检查yum源中是否有gv-help软件包 - if ! dnf list available gv-help > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到gv-help软件包" - exit 255 - fi - dnf install -y gv-help - CHECK_RESULT $? 0 0 "安装gv-help软件包失败" - INSTALLED=1 - else - LOG_INFO "gv-help软件包已安装" - INSTALLED=0 - fi - - # 测试服务状态查询功能 - LOG_INFO "测试服务状态查询功能" - systemctl status gv-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "查询gv-help服务状态失败" - - # 清理环境,如果脚本开始时安装了软件包,则卸载 - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "清理环境,卸载gv-help软件包" - dnf remove -y gv-help - CHECK_RESULT $? 0 0 "卸载gv-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_service_stop.sh b/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_service_stop.sh deleted file mode 100644 index f6c0261412e..00000000000 --- a/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_service_stop.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试gv-help软件包服务的停止功能,验证服务是否可以正常停止。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查gv-help软件包是否已安装 - LOG_INFO "检查gv-help软件包是否已安装" - rpm -q gv-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "gv-help软件包已安装" - INSTALLED=1 - else - LOG_INFO "gv-help软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有gv-help软件包 - LOG_INFO "检查yum源中是否有gv-help软件包" - dnf list available gv-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到gv-help软件包" - exit 255 - fi - - # 如果未安装,则安装gv-help软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装gv-help软件包" - dnf install -y gv-help - CHECK_RESULT $? 0 0 "安装gv-help软件包失败" - fi - - # 检查服务是否存在 - LOG_INFO "检查gv-help服务是否存在" - systemctl list-unit-files | grep gv-help.service > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "gv-help服务不存在" - exit 255 - fi - - # 停止服务 - LOG_INFO "停止gv-help服务" - systemctl stop gv-help.service - CHECK_RESULT $? 0 0 "停止gv-help服务失败" - - # 检查服务状态是否为停止 - LOG_INFO "检查gv-help服务状态是否为停止" - systemctl status gv-help.service | grep -E "inactive|dead" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 “服务未成功停止” - - # 恢复环境:如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载gv-help软件包" - dnf remove -y gv-help - CHECK_RESULT $?   “卸载失败” - fi - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_uninstall.sh b/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_uninstall.sh deleted file mode 100644 index 6587a6015dd..00000000000 --- a/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_uninstall.sh +++ /dev/null @@ -1,65 +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-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试gv-help软件包的卸载功能,验证软件包是否可以正常卸载。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试gv-help软件包的卸载功能,验证软件包是否可以正常卸载 - - LOG_INFO "开始测试gv-help软件包的卸载功能" - - # 检查gv-help软件包是否已安装 - if rpm -q gv-help &>/dev/null; then - LOG_INFO "检测到gv-help软件包已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "未检测到gv-help软件包,将在测试前安装并在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在gv-help软件包 - LOG_INFO "检查yum源中是否存在gv-help软件包" - dnf list available gv-help &>/dev/null - CHECK_RESULT $? 0 255 "yum源中不存在gv-help软件包" - - if [ "$INSTALLED" = false ]; then - # 安装gv-help软件包 - LOG_INFO "开始安装gv-help软件包" - dnf install -y gv-help &>/dev/null - CHECK_RESULT $? 0 0 "安装gv-help软件包失败" - fi - - # 验证卸载功能 - LOG_INFO "开始验证gv-help软件包的卸载功能" - dnf remove -y gv-help &>/dev/null - CHECK_RESULT $? 0 0 "卸载gv-help软件包失败" - - if [ "$INSTALLED" = false ]; then - # 环境恢复:重新安装gv-help(如果测试前未安装) - LOG_INFO "恢复环境:重新安装gv-help软件包" - dnf install -y gv-help &>/dev/null - CHECK_RESULT $? 0 0 "恢复环境时重新安装gv-help软件包失败" - else - LOG_INFO "环境恢复:无需操作,保持原有状态" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_upgrade.sh b/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_upgrade.sh deleted file mode 100644 index dbddabd50cf..00000000000 --- a/testcases/function_test/pkg_test/gv/gv-help/test_gv-help_upgrade.sh +++ /dev/null @@ -1,92 +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-07-06 -# @License : Mulan PSL v2 -# @Desc : 测试gv-help软件包的升级功能,验证软件包是否可以正常升级。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查gv-help软件包是否已安装 - LOG_INFO "检查gv-help软件包是否已安装" - rpm -q gv-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "gv-help软件包已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "gv-help软件包未安装,脚本结束后将卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在gv-help软件包 - LOG_INFO "检查yum源中是否存在gv-help软件包" - dnf list available gv-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在gv-help软件包" - exit 255 - fi - - # 安装gv-help软件包(如果未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装gv-help软件包" - dnf install -y gv-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装gv-help软件包失败" - fi - - # 检查当前安装的gv-help版本 - LOG_INFO "检查当前安装的gv-help版本" - CURRENT_VERSION=$(rpm -q --queryformat "%{VERSION}" gv-help) - LOG_INFO "当前gv-help版本为: $CURRENT_VERSION" - - # 检查是否有可用的升级版本 - LOG_INFO "检查是否有可用的升级版本" - dnf check-update gv-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "没有可用的升级版本" - exit 255 - fi - - # 升级gv-help软件包 - LOG_INFO "开始升级gv-help软件包" - dnf upgrade -y gv-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "升级gv-help软件包失败" - - # 验证升级后的版本 - LOG_INFO "验证升级后的版本" - NEW_VERSION=$(rpm -q --queryformat "%{VERSION}" gv-help) - LOG_INFO "升级后gv-help版本为: $NEW_VERSION" - - # 比较版本是否更新成功 - if [ "$CURRENT_VERSION" == "$NEW_VERSION" ]; then - LOG_ERROR "gv-help软件包未成功升级" - exit 1 - else - LOG_INFO "gv-help软件包升级成功" - fi - - # 清理环境(如果初始未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境,卸载gv-help软件包" - dnf remove -y gv-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载gv-help软件包失败" - fi - - exit 0 - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libutempter/libutempter-devel/test_libutempter-devel_function_check_files.sh b/testcases/function_test/pkg_test/libutempter/libutempter-devel/test_libutempter-devel_function_check_files.sh deleted file mode 100644 index ac1cfac9d35..00000000000 --- a/testcases/function_test/pkg_test/libutempter/libutempter-devel/test_libutempter-devel_function_check_files.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-01-29 -# @License : Mulan PSL v2 -# @Desc : 测试安装 libutempter-devel 软件包后,关键的开发文件(如头文件和库文件)是否存在于标准路径中 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $*" - } - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - - # 检查命令是否存在 - check_command() { - if ! command -v "$1" &> /dev/null; then - LOG_ERROR "命令 $1 不存在" - exit 255 - fi - } - - # 检查软件包是否在yum源中 - check_package_in_repo() { - LOG_INFO "检查软件包 $1 是否在yum源中" - if ! dnf list available "$1" &> /dev/null; then - LOG_ERROR "软件包 $1 不在yum源中" - exit 255 - fi - } - - # 检查参数是否存在 - check_parameter() { - if [ -z "$1" ]; then - LOG_ERROR "参数不存在或不支持" - exit 255 - fi - } - - # 检查安装状态 - check_installation_status() { - LOG_INFO "检查 libutempter-devel 是否已安装" - if rpm -q libutempter-devel &> /dev/null; then - LOG_INFO "libutempter-devel 已安装" - INSTALLED=true - else - LOG_INFO "libutempter-devel 未安装" - INSTALLED=false - fi - } - - # 安装软件包 - install_package() { - LOG_INFO "安装 libutempter-devel 软件包" - dnf install -y libutempter-devel - CHECK_RESULT $? 0 0 "安装 libutempter-devel 失败" - } - - # 卸载软件包 - uninstall_package() { - LOG_INFO "卸载 libutempter-devel 软件包" - dnf remove -y libutempter-devel - CHECK_RESULT $? 0 0 "卸载 libutempter-devel 失败" - } - - # 检查关键文件是否存在 - check_key_files() { - LOG_INFO "检查 libutempter-devel 的关键开发文件是否存在于标准路径中" - - # 定义需要检查的文件列表 - files_to_check=( - "/usr/include/utempter.h" - "/usr/lib64/libutempter.so" - "/usr/lib64/pkgconfig/libutempter.pc" - ) - - for file in "${files_to_check[@]}"; do - if [ -f "$file" ]; then - LOG_INFO "文件 $file 存在" - else - LOG_ERROR "文件 $file 不存在" - CHECK_RESULT 1 0 0 "关键开发文件 $file 不存在" - fi - done - } - - # 主函数 - main() { - LOG_INFO "开始测试 libutempter-devel 软件包的关键开发文件" - - # 检查命令是否存在 - check_command dnf - check_command rpm - - # 检查软件包是否在yum源中 - check_package_in_repo libutempter-devel - - # 检查安装状态 - check_installation_status - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - install_package - NEED_UNINSTALL=true - else - NEED_UNINSTALL=false - fi - - # 检查关键文件是否存在 - check_key_files - - # 清理环境 - LOG_INFO "清理环境" - if [ "$NEED_UNINSTALL" = true ]; then - uninstall_package - else - LOG_INFO "保持 libutempter-devel 安装状态" - fi - - LOG_INFO "测试完成" - } - - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libutempter/libutempter-devel/test_libutempter-devel_function_compile_link.sh b/testcases/function_test/pkg_test/libutempter/libutempter-devel/test_libutempter-devel_function_compile_link.sh deleted file mode 100644 index 704c1e1cbd5..00000000000 --- a/testcases/function_test/pkg_test/libutempter/libutempter-devel/test_libutempter-devel_function_compile_link.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 : 2026-01-29 -# @License : Mulan PSL v2 -# @Desc : 测试使用 libutempter-devel 提供的头文件和库文件,能否成功编译并链接一个简单的测试程序 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试libutempter-devel功能编译链接" - - LOG_INFO "检查libutempter-devel软件包是否在yum源中" - if ! dnf list available libutempter-devel 2>/dev/null | grep -q libutempter-devel; then - LOG_ERROR "libutempter-devel软件包不在yum源中" - exit 255 - fi - - LOG_INFO "检查系统是否已安装libutempter-devel" - if rpm -q libutempter-devel >/dev/null 2>&1; then - LOG_INFO "libutempter-devel已安装,测试完成后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "libutempter-devel未安装,将在测试过程中安装" - INSTALLED_BEFORE=0 - fi - - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "安装libutempter-devel软件包" - dnf install -y libutempter-devel - CHECK_RESULT $? 0 0 "安装libutempter-devel失败" - fi - - LOG_INFO "创建测试程序源代码" - cat > test_utempter.c << "EOF" - #include - #include - - int main() { - printf("Testing libutempter-devel compile and link\n"); - return 0; - } - EOF - - LOG_INFO "编译测试程序" - gcc -o test_utempter test_utempter.c -lutempter - CHECK_RESULT $? 0 0 "编译测试程序失败" - - LOG_INFO "运行测试程序" - ./test_utempter - CHECK_RESULT $? 0 0 "运行测试程序失败" - - LOG_INFO "清理测试文件" - rm -f test_utempter test_utempter.c - - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "卸载libutempter-devel软件包" - dnf remove -y libutempter-devel - CHECK_RESULT $? 0 0 "卸载libutempter-devel失败" - else - LOG_INFO "保持libutempter-devel安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-Arpeggio/python3-Arpeggio/test_python3-Arpeggio_function_import.sh b/testcases/function_test/pkg_test/python-Arpeggio/python3-Arpeggio/test_python3-Arpeggio_function_import.sh deleted file mode 100644 index 91c566cd379..00000000000 --- a/testcases/function_test/pkg_test/python-Arpeggio/python3-Arpeggio/test_python3-Arpeggio_function_import.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-14 -# @License : Mulan PSL v2 -# @Desc : 测试在Python环境中能否成功导入arpeggio模块 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试在Python环境中能否成功导入arpeggio模块" - LOG_INFO "检查系统是否已安装python3-arpeggio软件包" - dnf list installed python3-arpeggio > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到python3-arpeggio已安装,将保持安装状态" - already_installed=1 - else - LOG_INFO "未检测到python3-arpeggio安装" - already_installed=0 - LOG_INFO "检查yum源中是否存在python3-arpeggio软件包" - dnf list available python3-arpeggio > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到python3-arpeggio软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-arpeggio软件包,测试终止" - exit 255 - fi - LOG_INFO "开始安装python3-arpeggio软件包" - dnf install -y python3-arpeggio > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装python3-arpeggio软件包失败" - if [ $? -ne 0 ]; then - LOG_ERROR "安装python3-arpeggio软件包失败" - exit $? - fi - LOG_INFO "python3-arpeggio软件包安装成功" - fi - LOG_INFO "测试在Python环境中导入arpeggio模块" - python3 -c "import arpeggio" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "在Python环境中导入arpeggio模块失败" - if [ $? -ne 0 ]; then - LOG_ERROR "在Python环境中导入arpeggio模块失败" - exit $? - fi - LOG_INFO "在Python环境中导入arpeggio模块成功" - LOG_INFO "开始清理测试环境" - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载测试安装的python3-arpeggio软件包" - dnf remove -y python3-arpeggio > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载python3-arpeggio软件包失败" - if [ $? -ne 0 ]; then - LOG_ERROR "卸载python3-arpeggio软件包失败" - exit $? - fi - LOG_INFO "python3-arpeggio软件包卸载成功,环境已恢复" - else - LOG_INFO "系统原有python3-arpeggio软件包保持安装,无需卸载" - fi - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-Arpeggio/python3-Arpeggio/test_python3-Arpeggio_function_parse_simple.sh b/testcases/function_test/pkg_test/python-Arpeggio/python3-Arpeggio/test_python3-Arpeggio_function_parse_simple.sh deleted file mode 100644 index 717916219fe..00000000000 --- a/testcases/function_test/pkg_test/python-Arpeggio/python3-Arpeggio/test_python3-Arpeggio_function_parse_simple.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 : 2026-03-14 -# @License : Mulan PSL v2 -# @Desc : 测试使用Arpeggio解析一个简单的语法规则 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "1. 检查yum源中是否存在python3-Arpeggio软件包" - dnf list python3-Arpeggio &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-Arpeggio软件包" - exit 255 - fi - - LOG_INFO "2. 检查当前环境中是否已安装python3-Arpeggio" - rpm -q python3-Arpeggio &> /dev/null - if [ $? -eq 0 ]; then - already_installed=true - LOG_INFO "python3-Arpeggio已安装,脚本结束后将保持安装状态" - else - already_installed=false - LOG_INFO "python3-Arpeggio未安装,将在测试步骤中安装" - fi - - LOG_INFO "3. 测试使用Arpeggio解析一个简单的语法规则" - if [ "$already_installed" = "false" ]; then - LOG_INFO "3.1 安装python3-Arpeggio软件包" - dnf install -y python3-Arpeggio - CHECK_RESULT $? 0 0 "安装python3-Arpeggio失败" - fi - - LOG_INFO "3.2 创建测试Python脚本,使用Arpeggio解析简单语法" - cat > test_arpeggio_simple.py << "EOF" - from arpeggio import ParserPython, visit_parse_tree - from arpeggio import RegExMatch as _ - - def number(): return _(r"\d+") - def expression(): return number, "+", number - - parser = ParserPython(expression) - parse_tree = parser.parse("2+3") - print("解析成功,语法树为:", parse_tree) - EOF - - LOG_INFO "3.3 执行测试脚本" - python3 test_arpeggio_simple.py - CHECK_RESULT $? 0 0 "使用Arpeggio解析简单语法失败" - - LOG_INFO "4. 清理临时测试文件" - rm -f test_arpeggio_simple.py - - LOG_INFO "5. 环境恢复" - if [ "$already_installed" = "false" ]; then - LOG_INFO "5.1 卸载测试安装的python3-Arpeggio软件包" - dnf remove -y python3-Arpeggio - CHECK_RESULT $? 0 0 "卸载python3-Arpeggio失败" - else - LOG_INFO "5.1 保持python3-Arpeggio安装状态,无需卸载" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-Arpeggio/python3-Arpeggio/test_python3-Arpeggio_function_visitor.sh b/testcases/function_test/pkg_test/python-Arpeggio/python3-Arpeggio/test_python3-Arpeggio_function_visitor.sh deleted file mode 100644 index a2e4ac626f0..00000000000 --- a/testcases/function_test/pkg_test/python-Arpeggio/python3-Arpeggio/test_python3-Arpeggio_function_visitor.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-14 -# @License : Mulan PSL v2 -# @Desc : 测试使用访客模式遍历和操作解析树 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断Python3-Arpeggio是否已安装 - LOG_INFO "检查Python3-Arpeggio是否已安装" - if dnf list installed | grep -q python3-arpeggio; then - LOG_INFO "Python3-Arpeggio已安装,标记为已安装状态" - INSTALLED=true - else - LOG_INFO "Python3-Arpeggio未安装,标记为未安装状态" - INSTALLED=false - fi - - # 检查yum源中是否有python3-arpeggio软件包 - LOG_INFO "检查yum源中是否有python3-arpeggio软件包" - if ! dnf list available python3-arpeggio &>/dev/null; then - LOG_ERROR "yum源中未找到python3-arpeggio软件包" - exit 255 - fi - - # 如果未安装,则安装python3-arpeggio - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python3-arpeggio" - dnf install -y python3-arpeggio - CHECK_RESULT $? 0 0 "安装python3-arpeggio失败" - fi - - # 测试使用访客模式遍历和操作解析树 - LOG_INFO "测试使用访客模式遍历和操作解析树" - - # 创建测试Python脚本 - LOG_INFO "创建测试Python脚本" - cat > test_visitor.py << "EOF" - from arpeggio import ParserPython, visit_parse_tree - from arpeggio.visitor import Visitor - - # 定义简单语法 - def grammar(): return ("hello", "world") - - # 创建解析器 - parser = ParserPython(grammar) - - # 解析输入 - parse_tree = parser.parse("hello world") - - # 定义访客类 - class MyVisitor(Visitor): - def visit_hello(self, node, children): - return "Hello" - def visit_world(self, node, children): - return "World" - - # 使用访客模式遍历解析树 - visitor = MyVisitor() - result = visit_parse_tree(parse_tree, visitor) - - # 检查结果 - expected = ["Hello", "World"] - if result == expected: - print("访客模式遍历和操作解析树测试成功") - else: - print(f"访客模式遍历和操作解析树测试失败: 期望 {expected}, 实际 {result}") - exit(1) - EOF - - # 执行测试脚本 - LOG_INFO "执行测试脚本" - python3 test_visitor.py - CHECK_RESULT $? 0 0 "访客模式遍历和操作解析树测试失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_visitor.py - - # 如果之前未安装,则卸载python3-arpeggio - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-arpeggio" - dnf remove -y python3-arpeggio - CHECK_RESULT $? 0 0 "卸载python3-arpeggio失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt6-qttools/qt6-qttools-libs-help/test_qt6-qttools-libs-help_function_basic.sh b/testcases/function_test/pkg_test/qt6-qttools/qt6-qttools-libs-help/test_qt6-qttools-libs-help_function_basic.sh deleted file mode 100644 index 196de4c42a0..00000000000 --- a/testcases/function_test/pkg_test/qt6-qttools/qt6-qttools-libs-help/test_qt6-qttools-libs-help_function_basic.sh +++ /dev/null @@ -1,75 +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-05 -# @License : Mulan PSL v2 -# @Desc : Basic functionality test for qt6-qttools-libs-help -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试qt6-qttools-libs-help基本功能 - LOG_INFO "开始测试qt6-qttools-libs-help基本功能" - - # 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在qt6-qttools-libs-help软件包" - dnf list available qt6-qttools-libs-help >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt6-qttools-libs-help软件包" - exit 255 - fi - - # 检查是否已安装软件包 - LOG_INFO "检查系统是否已安装qt6-qttools-libs-help" - rpm -q qt6-qttools-libs-help >/dev/null 2>&1 - if [ $? -eq 0 ]; then - already_installed=true - LOG_INFO "qt6-qttools-libs-help已安装,测试完成后将保持安装状态" - else - already_installed=false - LOG_INFO "qt6-qttools-libs-help未安装,将在测试完成后卸载" - fi - - # 安装软件包(如果未安装) - if [ "$already_installed" = false ]; then - LOG_INFO "开始安装qt6-qttools-libs-help" - dnf install -y qt6-qttools-libs-help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装qt6-qttools-libs-help失败" - fi - - # 测试基本功能 - LOG_INFO "测试qt6-qttools-libs-help基本功能" - - # 检查命令参数支持情况 - LOG_INFO "检查命令参数支持情况" - help_output=$(qt6-qttools-libs-help --help) - if [ $? -ne 0 ]; then - LOG_ERROR "命令参数不支持或不存在" - exit 255 - fi - - CHECK_RESULT $? 0 0 "qt6-qttools-libs-help命令执行失败" - - # 清理环境(如果之前未安装) - if [ "$already_installed" = false ]; then - LOG_INFO "卸载qt6-qttools-libs-hop软件包" - dnf remove -y qt6-qttools-libs-help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载qt6-qttools-libs-hop失败" - fi - - LOG_INFO "qt6-qttools-libs-hop基本功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rubygem-prawn/rubygem-prawn-doc/test_rubygem-prawn-doc_function_doc_generation.sh b/testcases/function_test/pkg_test/rubygem-prawn/rubygem-prawn-doc/test_rubygem-prawn-doc_function_doc_generation.sh deleted file mode 100644 index dc4db439e37..00000000000 --- a/testcases/function_test/pkg_test/rubygem-prawn/rubygem-prawn-doc/test_rubygem-prawn-doc_function_doc_generation.sh +++ /dev/null @@ -1,76 +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 document generation functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装rubygem-prawn-doc - LOG_INFO "检查是否已安装rubygem-prawn-doc" - if dnf list installed rubygem-prawn-doc &>/dev/null; then - LOG_INFO "rubygem-prawn-doc已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "rubygem-prawn-doc未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有rubygem-prawn-doc软件包 - LOG_INFO "检查yum源中是否有rubygem-prawn-doc软件包" - if ! dnf list available rubygem-prawn-doc &>/dev/null; then - LOG_ERROR "yum源中未找到rubygem-prawn-doc软件包" - exit 255 - fi - - # 安装rubygem-prawn-doc - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装rubygem-prawn-doc" - dnf install -y rubygem-prawn-doc - CHECK_RESULT $? 0 0 "安装rubygem-prawn-doc失败" - fi - - # 测试文档生成功能 - LOG_INFO "测试文档生成功能" - prawn-doc generate test_doc.pdf --content "Test document generation functionality" - CHECK_RESULT $? 0 0 "文档生成失败" - - # 检查生成的文档是否存在 - LOG_INFO "检查生成的文档是否存在" - if [ ! -f "test_doc.pdf" ]; then - LOG_ERROR "未找到生成的文档test_doc.pdf" - exit 1 - fi - - # 清理环境 - LOG_INFO "清理环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载rubygem-prawn-doc" - dnf remove -y rubygem-prawn-doc - CHECK_RESULT $? 0 0 "卸载rubygem-prawn-doc失败" - fi - - # 删除测试生成的文档 - LOG_INFO "删除测试生成的文档" - rm -f test_doc.pdf - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-e/texlive-comfortaa-doc/test_texlive-comfortaa-doc_function_install.sh b/testcases/function_test/pkg_test/texlive-split-e/texlive-comfortaa-doc/test_texlive-comfortaa-doc_function_install.sh deleted file mode 100644 index 16377d043e6..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-e/texlive-comfortaa-doc/test_texlive-comfortaa-doc_function_install.sh +++ /dev/null @@ -1,65 +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-10-07 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装texlive-comfortaa-doc软件包 - LOG_INFO "检查是否已经安装texlive-comfortaa-doc软件包" - rpm -q texlive-comfortaa-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-comfortaa-doc已经安装,脚本结束时保持安装状态" - installed=true - else - installed=false - fi - - # 检查yum源中是否有texlive-comfortaa-doc软件包 - LOG_INFO "检查yum源中是否有texlive-comfortaa-doc软件包" - dnf list available texlive-comfortaa-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中没有texlive-comfortaa-doc软件包" - - # 安装texlive-comfortaa-doc软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-comfortaa-doc软件包" - dnf install -y texlive-comfortaa-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-comfortaa-doc软件包失败" - fi - - # 验证安装是否成功 - LOG_INFO "验证texlive-comfortaa-doc软件包是否安装成功" - rpm -q texlive-comfortaa-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-comfortaa-doc软件包未安装成功" - - # 测试完成后清理环境(如果脚本开始时未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-comfortaa-doc软件包" - dnf remove -y texlive-comfortaa-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-comfortaa-doc软件包失败" - - # 验证卸载是否成功 - LOG_INFO "验证texlive-comfortaa-doc软件包是否卸载成功" - rpm -q texlive-comfortaa-doc > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "texlive-comfortaa-doc软件包未卸载成功" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-e/texlive-cormorantgaramond/test_texlive-cormorantgaramond_function_check_font.sh b/testcases/function_test/pkg_test/texlive-split-e/texlive-cormorantgaramond/test_texlive-cormorantgaramond_function_check_font.sh deleted file mode 100644 index e6bcd98f9b3..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-e/texlive-cormorantgaramond/test_texlive-cormorantgaramond_function_check_font.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-07 -# @License : Mulan PSL v2 -# @Desc : Test the availability of CormorantGaramond font in TeX -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试TeX中的CormorantGaramond字体可用性" - - # 检查是否已经安装了texlive-cormorantgaramond包 - LOG_INFO "检查texlive-cormorantgaramond包是否已安装" - if dnf list installed texlive-cormorantgaramond &>/dev/null; then - LOG_INFO "texlive-cormorantgaramond包已安装" - INSTALLED=1 - else - LOG_INFO "texlive-cormorantgaramond包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-cormorantgaramond包" - if ! dnf list available texlive-cormorantgaramond &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-cormorantgaramond包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-cormorantgaramond包" - dnf install -y texlive-cormorantgaramond - CHECK_RESULT $? 0 0 "安装texlive-cormorantgaramond包失败" - fi - - # 测试CormorantGaramond字体可用性 - LOG_INFO "测试CormorantGaramond字体可用性" - # 创建一个简单的TeX文件测试字体 - cat > test_font.tex << "EOF" - \documentclass{article} - \usepackage{cormorantgaramond} - \begin{document} - This is a test of CormorantGaramond font. - \end{document} - EOF - - # 编译TeX文件测试字体 - LOG_INFO "编译TeX文件测试字体" - pdflatex test_font.tex - CHECK_RESULT $? 0 0 "编译TeX文件失败,可能字体不可用" - - # 检查生成的PDF文件 - LOG_INFO "检查生成的PDF文件" - if [ -f test_font.pdf ]; then - LOG_INFO "PDF文件生成成功,字体可用" - else - LOG_ERROR "PDF文件未生成,字体可能不可用" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_font.tex test_font.aux test_font.log test_font.pdf - - # 如果测试前未安装,则在测试结束后卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-cormorantgaramond包" - dnf remove -y texlive-cormorantgaramond - CHECK_RESULT $? 0 0 "卸载texlive-cormorantgaramond包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-e/texlive-cormorantgaramond/test_texlive-cormorantgaramond_function_font.sh b/testcases/function_test/pkg_test/texlive-split-e/texlive-cormorantgaramond/test_texlive-cormorantgaramond_function_font.sh deleted file mode 100644 index 47341972d01..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-e/texlive-cormorantgaramond/test_texlive-cormorantgaramond_function_font.sh +++ /dev/null @@ -1,76 +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-27 -# @License : Mulan PSL v2 -# @Desc : Test the font rendering functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在texlive-cormorantgaramond软件包 - LOG_INFO "检查yum源中是否存在texlive-cormorantgaramond软件包" - dnf list available texlive-cormorantgaramond &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-cormorantgaramond软件包" - exit 255 - fi - - # 检查是否已安装texlive-cormorantgaramond - LOG_INFO "检查是否已安装texlive-cormorantgaramond" - rpm -q texlive-cormorantgaramond &>/dev/null - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "texlive-cormorantgaramond已安装,脚本结束时将保持安装状态" - else - installed=false - LOG_INFO "texlive-cormorantgaramond未安装,将在测试后卸载" - fi - - # 安装texlive-cormorantgaramond - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-cormorantgaramond" - dnf install -y texlive-cormorantgaramond - CHECK_RESULT $? 0 0 "安装texlive-cormorantgaramond失败" - fi - - # 测试字体渲染功能 - LOG_INFO "测试字体渲染功能" - echo "\documentclass{article} - \usepackage{cormorantgaramond} - \begin{document} - Test font rendering. - \end{document}" > test_font.tex - - pdflatex test_font.tex &>/dev/null - CHECK_RESULT $? 0 0 "字体渲染功能测试失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_font.tex test_font.aux test_font.log test_font.pdf - - # 如果之前未安装,则卸载texlive-cormorantgaramond - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-cormorantgaramond" - dnf remove -y texlive-cormorantgaramond - CHECK_RESULT $? 0 0 "卸载texlive-cormorantgaramond失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-doi/test_texlive-doi_function_hyperlink.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-doi/test_texlive-doi_function_hyperlink.sh deleted file mode 100644 index 04ee81765a6..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-doi/test_texlive-doi_function_hyperlink.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-04-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用doi宏包提供的命令正确生成指向DOI的链接 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:使用doi宏包提供的命令正确生成指向DOI的链接" - - LOG_INFO "步骤1:检查系统是否已安装texlive-doi软件包" - if rpm -q texlive-doi &>/dev/null; then - LOG_INFO "texlive-doi已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "texlive-doi未安装,将在测试中安装" - INSTALLED_BEFORE_TEST=false - fi - - LOG_INFO "步骤2:检查yum源中是否存在texlive-doi软件包" - if ! dnf list available texlive-doi &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-doi软件包" - exit 255 - fi - - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "步骤3:安装texlive-doi软件包" - dnf install -y texlive-doi - CHECK_RESULT $? 0 0 "安装texlive-doi软件包失败" - fi - - LOG_INFO "步骤4:创建一个简单的LaTeX测试文档" - TEST_TEX_FILE="test_doi.tex" - cat > "$TEST_TEX_FILE" << "EOF" - \documentclass{article} - \usepackage{doi} - \begin{document} - 测试文档。 - \doi{10.1000/abc123} - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建LaTeX测试文档失败" - - LOG_INFO "步骤5:使用pdflatex命令编译LaTeX文档" - if ! command -v pdflatex &>/dev/null; then - LOG_ERROR "命令pdflatex不存在或不支持" - exit 255 - fi - pdflatex -interaction=nonstopmode "$TEST_TEX_FILE" > pdflatex_output.log 2>&1 - CHECK_RESULT $? 0 0 "使用pdflatex编译LaTeX文档失败" - - LOG_INFO "步骤6:检查生成的PDF文件中是否包含DOI链接文本" - if [ ! -f "test_doi.pdf" ]; then - LOG_ERROR "未找到生成的PDF文件test_doi.pdf" - exit 1 - fi - if ! pdftotext test_doi.pdf - 2>/dev/null | grep -q "10.1000/abc123"; then - LOG_ERROR "生成的PDF文件中未找到预期的DOI链接文本" - exit 1 - fi - LOG_INFO "成功在PDF中检测到DOI链接文本" - - LOG_INFO "步骤7:清理测试生成的临时文件" - rm -f test_doi.aux test_doi.log test_doi.out test_doi.pdf pdflatex_output.log "$TEST_TEX_FILE" 2>/dev/null - - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "步骤8:卸载测试安装的texlive-doi软件包" - dnf remove -y texlive-doi - CHECK_RESULT $? 0 0 "卸载texlive-doi软件包失败" - LOG_INFO "环境已恢复至测试前状态" - else - LOG_INFO "环境保持原有的texlive-doi安装状态" - fi - - LOG_INFO "测试完成:使用doi宏包提供的命令正确生成指向DOI的链接功能验证成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-doi/test_texlive-doi_function_usage.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-doi/test_texlive-doi_function_usage.sh deleted file mode 100644 index 2c777c54728..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-doi/test_texlive-doi_function_usage.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-04-02 -# @License : Mulan PSL v2 -# @Desc : 测试在LaTeX文档中使用\usepackage{doi}并编译通过 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试LaTeX文档中使用\\usepackage{doi}并编译通过" - LOG_INFO "步骤1: 检查环境中是否已安装texlive-doi软件包" - if dnf list installed texlive-doi > /dev/null 2>&1; then - LOG_INFO "texlive-doi已安装,脚本结束时将保持安装状态" - INSTALLED="yes" - else - LOG_INFO "texlive-doi未安装,将在测试过程中安装" - INSTALLED="no" - fi - LOG_INFO "步骤2: 检查yum源中是否存在texlive-doi软件包" - dnf list available texlive-doi > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-doi软件包" - LOG_INFO "步骤3: 安装texlive-doi软件包(如果未安装)" - if [ "$INSTALLED" = "no" ]; then - dnf install -y texlive-doi - CHECK_RESULT $? 0 0 "安装texlive-doi失败" - LOG_INFO "安装texlive-doi成功" - else - LOG_INFO "texlive-doi已安装,跳过安装步骤" - fi - LOG_INFO "步骤4: 创建测试LaTeX文档" - cat > test_doi.tex << "EOF" - \documentclass{article} - \usepackage{doi} - \begin{document} - Test document for doi package. - \doi{10.1000/123456} - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败" - LOG_INFO "步骤5: 使用pdflatex编译LaTeX文档" - pdflatex -interaction=nonstopmode test_doi.tex - CHECK_RESULT $? 0 0 "编译LaTeX文档失败" - LOG_INFO "步骤6: 检查生成的PDF文件" - if [ -f "test_doi.pdf" ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件生成失败" - exit 1 - fi - LOG_INFO "步骤7: 清理测试文件" - rm -f test_doi.tex test_doi.log test_doi.aux test_doi.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - LOG_INFO "步骤8: 卸载texlive-doi软件包(如果脚本开始时未安装)" - if [ "$INSTALLED" = "no" ]; then - dnf remove -y texlive-doi - CHECK_RESULT $? 0 0 "卸载texlive-doi失败" - LOG_INFO "卸载texlive-doi成功" - else - LOG_INFO "脚本开始时texlive-doi已安装,保持安装状态" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fancynum-doc/test_texlive-fancynum-doc_function_usage_example.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fancynum-doc/test_texlive-fancynum-doc_function_usage_example.sh deleted file mode 100644 index 529466c26f5..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fancynum-doc/test_texlive-fancynum-doc_function_usage_example.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-07 -# @License : Mulan PSL v2 -# @Desc : Test basic usage example -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断环境是否已经安装texlive-fancynum-doc软件包 - LOG_INFO "检查系统是否已安装texlive-fancynum-doc软件包" - rpm -q texlive-fancynum-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到系统已安装texlive-fancynum-doc软件包,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "系统未安装texlive-fancynum-doc软件包,将在测试中安装并在结束前卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-fancynum-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-fancynum-doc软件包" - dnf list available texlive-fancynum-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-fancynum-doc软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-fancynum-doc软件包,退出测试" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-fancynum-doc软件包" - dnf install -y texlive-fancynum-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-fancynum-doc软件包失败" - fi - - # 测试基本使用示例 - LOG_INFO "测试texlive-fancynum-doc基本使用示例" - # 假设texlive-fancynum-doc包含一个示例命令或文档,这里以检查文档文件为例 - # 查找示例文档文件 - EXAMPLE_FILE=$(rpm -ql texlive-fancynum-doc | grep -i example | head -1) - if [ -z "$EXAMPLE_FILE" ]; then - LOG_ERROR "未找到texlive-fancynum-doc的示例文件" - exit 255 - fi - - LOG_INFO "找到示例文件: $EXAMPLE_FILE" - # 检查文件是否存在并可读 - if [ -r "$EXAMPLE_FILE" ]; then - LOG_INFO "示例文件存在且可读" - else - LOG_ERROR "示例文件不存在或不可读" - exit 1 - fi - - # 如果需要执行特定命令,检查命令是否存在 - COMMAND="some_fancynum_command" - LOG_INFO "检查命令 $COMMAND 是否存在" - type $COMMAND > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $COMMAND 不存在或不支持" - exit 255 - fi - - # 执行命令(假设命令) - LOG_INFO "执行命令 $COMMAND 示例" - $COMMAND --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行 $COMMAND --help 失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-fancynum-doc软件包" - dnf remove -y texlive-fancynum-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-fancynum-doc软件包失败" - LOG_INFO "已卸载texlive-fancynum-doc软件包,环境已恢复" - else - LOG_INFO "系统原本已安装texlive-fancynum-doc软件包,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-r/texlive-powerdot-doc/test_texlive-powerdot-doc_function_usage.sh b/testcases/function_test/pkg_test/texlive-split-r/texlive-powerdot-doc/test_texlive-powerdot-doc_function_usage.sh deleted file mode 100644 index ec2cc0ac8d7..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-r/texlive-powerdot-doc/test_texlive-powerdot-doc_function_usage.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 : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : Test basic usage demo -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装texlive-powerdot-doc - LOG_INFO "检查是否已经安装texlive-powerdot-doc" - rpm -q texlive-powerdot-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-powerdot-doc已经安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-powerdot-doc未安装,将在测试前安装并在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-powerdot-doc软件包 - LOG_INFO "检查yum源中是否有texlive-powerdot-doc软件包" - dnf list available texlive-powerdot-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中没有texlive-powerdot-doc软件包" - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装texlive-powerdot-doc软件包" - dnf install -y texlive-powerdot-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-powerdot-doc失败" - fi - - # 测试基本用法演示 - LOG_INFO "测试texlive-powerdot-doc的基本用法演示" - # 这里假设texlive-powerdot-doc包含一个演示命令或文档 - # 例如,检查是否有示例文档 - if [ -d /usr/share/texlive/texmf-dist/doc/latex/powerdot/examples ]; then - LOG_INFO "找到powerdot示例文档目录" - ls /usr/share/texlive/texmf-dist/doc/latex/powerdot/examples > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "列出示例文档失败" - else - LOG_ERROR "未找到powerdot示例文档目录" - exit 255 - fi - - # 检查是否有演示命令(假设为powerdot-demo) - command -v powerdot-demo > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "找到powerdot-demo命令,执行演示" - powerdot-demo --help > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "powerdot-demo命令参数不支持" - else - LOG_INFO "未找到powerdot-demo命令,跳过命令测试" - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-powerdot-doc软件包" - dnf remove -y texlive-powerdot-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-powerdot-doc失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-r/texlive-powerdot-doc/test_texlive-powerdot-doc_function_version.sh b/testcases/function_test/pkg_test/texlive-split-r/texlive-powerdot-doc/test_texlive-powerdot-doc_function_version.sh deleted file mode 100644 index 8e03d138b05..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-r/texlive-powerdot-doc/test_texlive-powerdot-doc_function_version.sh +++ /dev/null @@ -1,115 +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-08 -# @License : Mulan PSL v2 -# @Desc : Check installed version -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 设置环境变量和常量 - PACKAGE_NAME="texlive-powerdot-doc" - LOG_FILE="/tmp/test_texlive-powerdot-doc_function_version.log" - - # 清理函数,用于脚本退出时的清理工作 - cleanup() { - LOG_INFO "开始清理环境" - - # 检查是否是在测试过程中安装的软件包 - if [[ "${INSTALLED_DURING_TEST}" == "true" ]]; then - LOG_INFO "卸载在测试过程中安装的软件包: ${PACKAGE_NAME}" - dnf remove -y "${PACKAGE_NAME}" > /dev/null 2>&1 - if [[ $? -eq 0 ]]; then - LOG_INFO "软件包卸载成功" - else - LOG_ERROR "软件包卸载失败" - fi - fi - - # 清理临时文件 - if [[ -f "${LOG_FILE}" ]]; then - rm -f "${LOG_FILE}" - LOG_INFO "清理临时日志文件" - fi - - LOG_INFO "环境清理完成" - } - - # 设置trap,确保脚本退出时执行清理 - trap cleanup EXIT - - # 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在软件包: ${PACKAGE_NAME}" - dnf list available "${PACKAGE_NAME}" > /dev/null 2>&1 - if [[ $? -ne 0 ]]; then - LOG_ERROR "yum源中不存在软件包: ${PACKAGE_NAME}" - exit 255 - fi - LOG_INFO "软件包在yum源中存在" - - # 检查当前是否已安装软件包 - LOG_INFO "检查当前是否已安装软件包: ${PACKAGE_NAME}" - INSTALLED_DURING_TEST="false" - if rpm -q "${PACKAGE_NAME}" > /dev/null 2>&1; then - LOG_INFO "软件包已安装,测试结束后保持安装状态" - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED_DURING_TEST="true" - fi - - # 如果未安装,则安装软件包 - if [[ "${INSTALLED_DURING_TEST}" == "true" ]]; then - LOG_INFO "开始安装软件包: ${PACKAGE_NAME}" - dnf install -y "${PACKAGE_NAME}" > "${LOG_FILE}" 2>&1 - CHECK_RESULT $? 0 0 "软件包安装失败" - LOG_INFO "软件包安装成功" - fi - - # 检查安装的版本 - LOG_INFO "检查已安装软件包的版本" - INSTALLED_VERSION=$(rpm -q --queryformat="%{VERSION}-%{RELEASE}" "${PACKAGE_NAME}" 2>/dev/null) - if [[ $? -ne 0 ]]; then - LOG_ERROR "获取软件包版本失败" - exit 1 - fi - LOG_INFO "已安装软件包版本: ${INSTALLED_VERSION}" - - # 检查版本信息是否有效 - if [[ -z "${INSTALLED_VERSION}" ]]; then - LOG_ERROR "获取的版本信息为空" - exit 1 - fi - - # 验证版本格式(基本检查) - if [[ ! "${INSTALLED_VERSION}" =~ ^[0-9] ]]; then - LOG_ERROR "版本格式不正确: ${INSTALLED_VERSION}" - exit 1 - fi - - LOG_INFO "版本检查完成,版本信息有效: ${INSTALLED_VERSION}" - - # 检查软件包文件 - LOG_INFO "检查软件包安装的文件" - rpm -ql "${PACKAGE_NAME}" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "软件包文件检查失败" - - LOG_INFO "软件包文件检查完成" - - # 测试完成 - LOG_INFO "测试完成,所有检查通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-u/texlive-sepnum/test_texlive-sepnum_install.sh b/testcases/function_test/pkg_test/texlive-split-u/texlive-sepnum/test_texlive-sepnum_install.sh deleted file mode 100644 index 9b146d49816..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-u/texlive-sepnum/test_texlive-sepnum_install.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-14 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-sepnum 软件包的安装功能,确保能够正确安装到系统中。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-sepnum 软件包的安装功能" - - # 检查是否已安装 texlive-sepnum - LOG_INFO "检查 texlive-sepnum 是否已安装" - dnf list installed texlive-sepnum > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-sepnum 已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-sepnum 未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-sepnum 软件包 - LOG_INFO "检查 yum 源中是否存在 texlive-sepnum 软件包" - dnf list available texlive-sepnum > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum 源中不存在 texlive-sepnum 软件包" - - # 安装 texlive-sepnum - LOG_INFO "开始安装 texlive-sepnum" - dnf install -y texlive-sepnum > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装 texlive-sepnum 失败" - - # 验证安装是否成功 - LOG_INFO "验证 texlive-sepnum 是否成功安装" - dnf list installed texlive-sepnum > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-sepnum 未成功安装" - - # 如果需要卸载,则执行卸载操作 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-sepnum" - dnf remove -y texlive-sepnum > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载 texlive-sepnum 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-x/texlive-beamerthemenord/test_texlive-beamerthemenord_function_render.sh b/testcases/function_test/pkg_test/texlive-split-x/texlive-beamerthemenord/test_texlive-beamerthemenord_function_render.sh deleted file mode 100644 index 420ce10b3af..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-x/texlive-beamerthemenord/test_texlive-beamerthemenord_function_render.sh +++ /dev/null @@ -1,71 +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 rendering of beamer theme -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-beamerthemenord - LOG_INFO "检查是否已安装texlive-beamerthemenord" - dnf list installed texlive-beamerthemenord > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-beamerthemenord已安装,测试完成后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-beamerthemenord未安装,测试完成后将卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-beamerthemenord - LOG_INFO "检查yum源中是否有texlive-beamerthemenord" - dnf list available texlive-beamerthemenord > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-beamerthemenord软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-beamerthemenord软件包" - exit 255 - fi - - # 安装texlive-beamerthemenord - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-beamerthemenord" - dnf install -y texlive-beamerthemenord > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-beamerthemenord失败" - fi - - # Test rendering of beamer theme - LOG_INFO "测试beamer主题渲染功能" - pdflatex -interaction=nonstopmode \\documentclass{beamer}\\usetheme{nord}\\begin{document}\\frame{Test}\\end{document} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "beamer主题渲染失败" - - # 清理生成的临时文件 - LOG_INFO "清理临时文件" - rm -f *.aux *.log *.nav *.out *.snm *.toc *.pdf > /dev/null 2>&1 - - # 如果测试前未安装,则卸载texlive-beamerthemenord - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-beamerthemenord" - dnf remove -y texlive-beamerthemenord > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-beamerthemenord失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-uspace/test_texlive-uspace_function_install.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-uspace/test_texlive-uspace_function_install.sh deleted file mode 100644 index 3b3e6dbe0f8..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-uspace/test_texlive-uspace_function_install.sh +++ /dev/null @@ -1,71 +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-10-04 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-uspace - LOG_INFO "检查是否已安装texlive-uspace" - rpm -q texlive-uspace > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-uspace已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-uspace未安装,将在脚本结束时卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-uspace包 - LOG_INFO "检查yum源中是否有texlive-uspace包" - dnf list available texlive-uspace > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到texlive-uspace包" - - # 安装texlive-uspace包 - LOG_INFO "安装texlive-uspace包" - dnf install -y texlive-uspace - CHECK_RESULT $? 0 0 "安装texlive-uspace包失败" - - # 验证安装是否成功 - LOG_INFO "验证texlive-uspace是否安装成功" - rpm -q texlive-uspace > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-uspace未成功安装" - - # 测试texlive-uspace功能(示例命令,需根据实际功能调整) - LOG_INFO "测试texlive-uspace功能" - some_texlive_command --version > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "指定的参数不存在或不支持" - - # 清理环境(如果脚本开始时未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-uspace包" - dnf remove -y texlive-uspace - CHECK_RESULT $? 0 0 "卸载texlive-uspace包失败" - - # 验证卸载是否成功 - LOG_INFO "验证texlive-uspace是否卸载成功" - rpm -q texlive-uspace > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "texlive-uspace未成功卸载" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-ziffer/test_texlive-ziffer_function_file_exist.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-ziffer/test_texlive-ziffer_function_file_exist.sh deleted file mode 100644 index b32cc80a1d2..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-ziffer/test_texlive-ziffer_function_file_exist.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-28 -# @License : Mulan PSL v2 -# @Desc : 验证texlive-ziffer包的核心文件(如ziffer.sty)在系统中存在 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色和日志函数(虽然题目说不用定义,但实际需要定义才能使用) - RED="\033[0;31m" - GREEN="\033[0;32m" - NC="\033[0m" - LOG_INFO() { - echo -e "${GREEN}[INFO]${NC} $1" - } - LOG_ERROR() { - echo -e "${RED}[ERROR]${NC} $1" - } - - # 定义软件包名称 - PACKAGE_NAME="texlive-ziffer" - # 定义要检查的核心文件 - CORE_FILE="/usr/share/texlive/texmf-dist/tex/latex/ziffer/ziffer.sty" - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在${PACKAGE_NAME}软件包..." - dnf list available ${PACKAGE_NAME} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - - # 步骤2:检查当前是否已安装软件包 - LOG_INFO "检查系统是否已安装${PACKAGE_NAME}软件包..." - rpm -q ${PACKAGE_NAME} &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "检测到${PACKAGE_NAME}已安装,标记为已安装状态" - INSTALLED="yes" - else - LOG_INFO "检测到${PACKAGE_NAME}未安装,标记为未安装状态" - INSTALLED="no" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "${INSTALLED}" = "no" ]; then - LOG_INFO "开始安装${PACKAGE_NAME}软件包..." - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}软件包失败" - LOG_INFO "成功安装${PACKAGE_NAME}软件包" - fi - - # 步骤4:验证核心文件是否存在 - LOG_INFO "验证核心文件${CORE_FILE}是否存在..." - if [ -f "${CORE_FILE}" ]; then - LOG_INFO "核心文件${CORE_FILE}存在" - CHECK_RESULT 0 0 0 "核心文件不存在" - else - LOG_ERROR "核心文件${CORE_FILE}不存在" - CHECK_RESULT 1 0 0 "核心文件不存在" - fi - - # 步骤5:环境恢复 - LOG_INFO "开始环境恢复..." - if [ "${INSTALLED}" = "no" ]; 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 - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-ziffer/test_texlive-ziffer_function_install.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-ziffer/test_texlive-ziffer_function_install.sh deleted file mode 100644 index 239f144eeb8..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-ziffer/test_texlive-ziffer_function_install.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-28 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-ziffer软件包的安装功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-ziffer软件包的安装功能" - - # 检查yum源中是否存在texlive-ziffer软件包 - LOG_INFO "检查yum源中是否存在texlive-ziffer软件包" - dnf list available texlive-ziffer 2>/dev/null | grep texlive-ziffer - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-ziffer软件包" - exit 255 - fi - - # 检查当前是否已安装texlive-ziffer - LOG_INFO "检查当前是否已安装texlive-ziffer" - rpm -q texlive-ziffer - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ziffer已经安装,记录安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ziffer未安装" - INSTALLED=0 - fi - - # 如果未安装,则执行安装步骤 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-ziffer软件包" - dnf install -y texlive-ziffer - CHECK_RESULT $? 0 0 "安装texlive-ziffer失败" - LOG_INFO "texlive-ziffer安装成功" - fi - - # 验证安装是否成功 - LOG_INFO "验证texlive-ziffer是否安装成功" - rpm -q texlive-ziffer - CHECK_RESULT $? 0 0 "texlive-ziffer未正确安装" - - # 测试texlive-ziffer的基本功能 - LOG_INFO "测试texlive-ziffer的基本功能" - # 这里可以根据texlive-ziffer的实际命令进行测试,例如: - # texlive-ziffer --version 或 texlive-ziffer --help - # 假设texlive-ziffer有--version参数 - texlive-ziffer --version - if [ $? -ne 0 ]; then - # 如果--version不支持,尝试--help - texlive-ziffer --help - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-ziffer命令参数不存在或不支持" - exit 255 - fi - fi - CHECK_RESULT $? 0 0 "texlive-ziffer基本功能测试失败" - - # 环境恢复:如果脚本开始时未安装,则卸载 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始卸载texlive-ziffer软件包" - dnf remove -y texlive-ziffer - CHECK_RESULT $? 0 0 "卸载texlive-ziffer失败" - LOG_INFO "texlive-ziffer卸载成功" - else - LOG_INFO "保持texlive-ziffer的安装状态" - fi - - LOG_INFO "texlive-ziffer软件包的安装功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-ziffer/test_texlive-ziffer_function_remove.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-ziffer/test_texlive-ziffer_function_remove.sh deleted file mode 100644 index 6cf193e5165..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-ziffer/test_texlive-ziffer_function_remove.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-28 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-ziffer软件包的卸载功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - PACKAGE_NAME="texlive-ziffer" - LOG_INFO "开始测试软件包 ${PACKAGE_NAME} 的卸载功能" - LOG_INFO "步骤1:检查当前系统是否已安装 ${PACKAGE_NAME}" - rpm -q ${PACKAGE_NAME} - INSTALLED_STATUS=$? - if [ ${INSTALLED_STATUS} -eq 0 ]; then - LOG_INFO "检测到 ${PACKAGE_NAME} 已安装,测试后将保持安装状态。" - WAS_INSTALLED=true - else - LOG_INFO "检测到 ${PACKAGE_NAME} 未安装,将在测试前安装,并在测试后卸载。" - WAS_INSTALLED=false - fi - LOG_INFO "步骤2:检查yum源中是否存在软件包 ${PACKAGE_NAME}" - dnf list available ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到软件包 ${PACKAGE_NAME},测试终止。" - exit 255 - fi - if [ "${WAS_INSTALLED}" = "false" ]; then - LOG_INFO "步骤3:安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装 ${PACKAGE_NAME} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 安装成功。" - fi - LOG_INFO "步骤4:验证软件包 ${PACKAGE_NAME} 的卸载功能" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载 ${PACKAGE_NAME} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 卸载成功。" - LOG_INFO "步骤5:验证软件包 ${PACKAGE_NAME} 是否已卸载" - rpm -q ${PACKAGE_NAME} - CHECK_RESULT $? 1 0 "卸载后,${PACKAGE_NAME} 软件包仍存在,卸载不彻底" - LOG_INFO "验证通过,软件包 ${PACKAGE_NAME} 已从系统中移除。" - if [ "${WAS_INSTALLED}" = "true" ]; then - LOG_INFO "步骤6:恢复测试前环境,重新安装 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "重新安装 ${PACKAGE_NAME} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 已重新安装,环境已恢复。" - else - LOG_INFO "步骤6:测试前环境未安装 ${PACKAGE_NAME},无需重新安装,环境已恢复。" - fi - LOG_INFO "测试完成:${PACKAGE_NAME} 软件包的卸载功能测试通过。" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-ziffer/test_texlive-ziffer_function_ziffer_switch.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-ziffer/test_texlive-ziffer_function_ziffer_switch.sh deleted file mode 100644 index d81486bc13d..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-ziffer/test_texlive-ziffer_function_ziffer_switch.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-28 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-ziffer包中数字显示模式的切换功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ziffer包 - LOG_INFO "检查是否已安装texlive-ziffer包" - rpm -q texlive-ziffer > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ziffer包已安装,脚本结束前将保持安装状态" - INSTALLED="true" - else - LOG_INFO "texlive-ziffer包未安装,将在测试过程中安装" - INSTALLED="false" - fi - - # 检查yum源中是否有texlive-ziffer包 - LOG_INFO "检查yum源中是否有texlive-ziffer包" - dnf list available texlive-ziffer > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ziffer包" - exit 255 - fi - - # 如果未安装,则安装texlive-ziffer包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装texlive-ziffer包" - dnf install -y texlive-ziffer - CHECK_RESULT $? 0 0 "安装texlive-ziffer包失败" - fi - - # 检查命令参数是否存在 - LOG_INFO "检查命令参数是否存在" - texlua --help 2>&1 | grep -q "ziffer" - if [ $? -ne 0 ]; then - LOG_ERROR "texlua命令不支持ziffer参数" - exit 255 - fi - - # 测试数字显示模式的切换功能 - LOG_INFO "测试数字显示模式的切换功能" - echo "\documentclass{article} - \usepackage{ziffer} - \begin{document} - 阿拉伯数字: \ziffer{123} - 中文数字: \ziffer[cn]{123} - \end{document}" > test_ziffer.tex - - # 编译测试文档 - LOG_INFO "编译测试文档" - pdflatex -interaction=nonstopmode test_ziffer.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "编译测试文档失败" - - # 检查生成的PDF文件 - LOG_INFO "检查生成的PDF文件" - if [ -f test_ziffer.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件生成失败" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_ziffer.tex test_ziffer.aux test_ziffer.log test_ziffer.pdf - - # 如果测试前未安装,则卸载texlive-ziffer包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-ziffer包" - dnf remove -y texlive-ziffer - CHECK_RESULT $? 0 0 "卸载texlive-ziffer包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-ziffer/test_texlive-ziffer_function_ziffer_usage.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-ziffer/test_texlive-ziffer_function_ziffer_usage.sh deleted file mode 100644 index 950b3bfa432..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-ziffer/test_texlive-ziffer_function_ziffer_usage.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-28 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-ziffer包提供的数字格式化功能在LaTeX文档中的基本用法 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ziffer - LOG_INFO "检查texlive-ziffer是否已安装" - rpm -q texlive-ziffer - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ziffer已安装,测试后将保持安装状态" - INSTALLED="true" - else - LOG_INFO "texlive-ziffer未安装,将在测试后卸载" - INSTALLED="false" - fi - - # 检查yum源中是否有texlive-ziffer包 - LOG_INFO "检查yum源中是否有texlive-ziffer包" - dnf list available texlive-ziffer 2>&1 | grep -q "texlive-ziffer" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ziffer包" - exit 255 - fi - - # 如果未安装,则安装texlive-ziffer - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装texlive-ziffer" - dnf install -y texlive-ziffer - CHECK_RESULT $? 0 0 "安装texlive-ziffer失败" - fi - - # 创建测试LaTeX文档 - LOG_INFO "创建测试LaTeX文档" - cat > test_ziffer.tex << "EOF" - \documentclass{article} - \usepackage{ziffer} - \begin{document} - 测试数字格式化功能:\\ - 1234567890 应该显示为 1,234,567,890:\ziffer{1234567890}\\ - 9876543210 应该显示为 9,876,543,210:\ziffer{9876543210}\\ - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败" - - # 使用latex命令编译文档 - LOG_INFO "使用latex命令编译LaTeX文档" - latex test_ziffer.tex 2>&1 | tee latex_output.log - CHECK_RESULT $? 0 0 "编译LaTeX文档失败" - - # 检查编译输出中是否包含预期的格式化数字 - LOG_INFO "检查编译输出中是否包含预期的格式化数字" - grep -q "1,234,567,890" test_ziffer.dvi && grep -q "9,876,543,210" test_ziffer.dvi - CHECK_RESULT $? 0 0 "数字格式化功能未按预期工作" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_ziffer.tex test_ziffer.dvi test_ziffer.log test_ziffer.aux latex_output.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载texlive-ziffer - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-ziffer" - dnf remove -y texlive-ziffer - CHECK_RESULT $? 0 0 "卸载texlive-ziffer失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/tpm2-abrmd/tpm2-abrmd-selinux/test_tpm2-abrmd-selinux_function_install.sh b/testcases/function_test/pkg_test/tpm2-abrmd/tpm2-abrmd-selinux/test_tpm2-abrmd-selinux_function_install.sh deleted file mode 100644 index c7787106248..00000000000 --- a/testcases/function_test/pkg_test/tpm2-abrmd/tpm2-abrmd-selinux/test_tpm2-abrmd-selinux_function_install.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-25 -# @License : Mulan PSL v2 -# @Desc : Verify the installation of tpm2-abrmd-selinux package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在tpm2-abrmd-selinux软件包 - LOG_INFO "检查yum源中是否存在tpm2-abrmd-selinux软件包" - dnf list available tpm2-abrmd-selinux > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到tpm2-abrmd-selinux软件包" - exit 255 - fi - - # 检查是否已安装tpm2-abrmd-selinux - LOG_INFO "检查是否已安装tpm2-abrmd-selinux" - rpm -q tpm2-abrmd-selinux > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "tpm2-abrmd-selinux已安装,脚本结束时将保持安装状态" - installed=true - else - installed=false - fi - - # 如果未安装,则安装tpm2-abrmd-selinux - if [ "$installed" = false ]; then - LOG_INFO "开始安装tpm2-abrmd-selinux" - dnf install -y tpm2-abrmd-selinux - CHECK_RESULT $? 0 0 "安装tpm2-abrmd-selinux失败" - fi - - # 验证安装后的功能(示例命令,根据实际需求调整) - LOG_INFO "验证tpm2-abrmd-selinux功能" - systemctl status tpm2-abrmd > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "tpm2-abrmd服务未正常运行" - - # 如果脚本开始时未安装,则在结束时卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载tpm2-abrmd-selinux" - dnf remove -y tpm2-abrmd-selinux - CHECK_RESULT $? 0 0 "卸载tpm2-abrmd-selinux失败" - - # 检查是否成功卸载 - rpm -q tpm2-abrmd-selinux > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "tpm2-abrmd-selinux未成功卸载" - fi - - LOG_INFO "测试脚本执行完成,环境已恢复" - -} - -main "$@" \ No newline at end of file