From 99e2021d3a8996e6dd0ef0e754c4ff255e376d91 Mon Sep 17 00:00:00 2001 From: honghua Date: Wed, 22 Apr 2026 05:04:01 +0800 Subject: [PATCH 01/12] update testcase for testsuite texlive-apprends-latex-doc --- .../texlive-apprends-latex-doc.json | 8 -- ...e-apprends-latex-doc_function_check_doc.sh | 116 ------------------ 2 files changed, 124 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-a/texlive-apprends-latex-doc/test_texlive-apprends-latex-doc_function_check_doc.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-a/texlive-apprends-latex-doc.json b/suite2cases/function_test/pkg_test/texlive-split-a/texlive-apprends-latex-doc.json index 2c73c8c6329..6b48c6bf6fc 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-a/texlive-apprends-latex-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-a/texlive-apprends-latex-doc.json @@ -6,17 +6,9 @@ "name": "test_texlive-apprends-latex-doc_function_install", "desc": "install package" }, - { - "name": "test_texlive-apprends-latex-doc_function_verify_install", - "desc": "verify package installation" - }, { "name": "test_texlive-apprends-latex-doc_function_remove", "desc": "uninstall package" - }, - { - "name": "test_texlive-apprends-latex-doc_function_check_doc", - "desc": "check documentation files" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-a/texlive-apprends-latex-doc/test_texlive-apprends-latex-doc_function_check_doc.sh b/testcases/function_test/pkg_test/texlive-split-a/texlive-apprends-latex-doc/test_texlive-apprends-latex-doc_function_check_doc.sh deleted file mode 100644 index 4bc0a1196b5..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-a/texlive-apprends-latex-doc/test_texlive-apprends-latex-doc_function_check_doc.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : check documentation files -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(根据要求直接使用) - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - - # 定义检查结果函数(根据要求直接使用) - CHECK_RESULT() { - local actual_ret=$1 - local expected_ret=$2 - local expected_status=$3 - local error_msg=$4 - if [ $actual_ret -eq $expected_ret ]; then - LOG_INFO "$error_msg 检查通过" - return 0 - else - LOG_ERROR "$error_msg 检查失败,预期退出码:$expected_status,实际退出码:$actual_ret" - exit $expected_status - fi - } - - # 定义软件包名称 - PACKAGE_NAME="texlive-apprends-latex-doc" - - # 步骤1: 检查软件包是否在yum源中 - LOG_INFO "步骤1: 检查软件包是否在yum源中" - dnf list available "$PACKAGE_NAME" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 步骤2: 检查环境是否已经安装该软件包 - LOG_INFO "步骤2: 检查环境是否已经安装该软件包" - dnf list installed "$PACKAGE_NAME" &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已经安装,标记为已安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,标记为未安装状态" - ALREADY_INSTALLED=0 - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME" - fi - - # 步骤4: 检查文档文件是否存在 - LOG_INFO "步骤4: 检查文档文件是否存在" - # 使用rpm查询软件包安装的文件,过滤出文档文件 - DOC_FILES=$(rpm -ql "$PACKAGE_NAME" | grep -E "\.pdf$|\.html$|\.txt$|/doc/|/usr/share/doc/" | head -5) - if [ -z "$DOC_FILES" ]; then - LOG_ERROR "未找到文档文件" - exit 1 - fi - - # 检查每个文档文件是否存在 - for doc_file in $DOC_FILES; do - if [ -f "$doc_file" ]; then - LOG_INFO "文档文件 $doc_file 存在" - else - LOG_ERROR "文档文件 $doc_file 不存在" - exit 1 - fi - done - - # 步骤5: 检查文档文件内容是否可读 - LOG_INFO "步骤5: 检查文档文件内容是否可读" - for doc_file in $DOC_FILES; do - # 尝试读取文件的前几行,检查是否可读 - head -5 "$doc_file" &>/dev/null - CHECK_RESULT $? 0 0 "检查文档文件 $doc_file 是否可读" - done - - # 步骤6: 清理环境,恢复到之前的状态 - LOG_INFO "步骤6: 清理环境,恢复到之前的状态" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME" - else - LOG_INFO "软件包 $PACKAGE_NAME 之前已安装,保持安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file From 1c2093898660e2fda9c60e31d3b3fbb4e8266315 Mon Sep 17 00:00:00 2001 From: honghua Date: Wed, 22 Apr 2026 05:04:52 +0800 Subject: [PATCH 02/12] update testcase for testsuite python3-ldb-devel --- .../pkg_test/libldb/python3-ldb-devel.json | 8 -- ..._python3-ldb-devel_function_ldb_connect.sh | 113 ------------------ ...t_python3-ldb-devel_function_ldb_search.sh | 71 ----------- 3 files changed, 192 deletions(-) delete mode 100644 testcases/function_test/pkg_test/libldb/python3-ldb-devel/test_python3-ldb-devel_function_ldb_connect.sh delete mode 100644 testcases/function_test/pkg_test/libldb/python3-ldb-devel/test_python3-ldb-devel_function_ldb_search.sh diff --git a/suite2cases/function_test/pkg_test/libldb/python3-ldb-devel.json b/suite2cases/function_test/pkg_test/libldb/python3-ldb-devel.json index 950517c9ac5..f4d0203e5e7 100644 --- a/suite2cases/function_test/pkg_test/libldb/python3-ldb-devel.json +++ b/suite2cases/function_test/pkg_test/libldb/python3-ldb-devel.json @@ -17,14 +17,6 @@ { "name": "test_python3-ldb-devel_function_ldb_version", "desc": "Test checking ldb library version" - }, - { - "name": "test_python3-ldb-devel_function_ldb_connect", - "desc": "Test basic LDB connection creation" - }, - { - "name": "test_python3-ldb-devel_function_ldb_search", - "desc": "Test basic LDB search operation" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libldb/python3-ldb-devel/test_python3-ldb-devel_function_ldb_connect.sh b/testcases/function_test/pkg_test/libldb/python3-ldb-devel/test_python3-ldb-devel_function_ldb_connect.sh deleted file mode 100644 index 8edb0ef51f7..00000000000 --- a/testcases/function_test/pkg_test/libldb/python3-ldb-devel/test_python3-ldb-devel_function_ldb_connect.sh +++ /dev/null @@ -1,113 +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-31 -# @License : Mulan PSL v2 -# @Desc : Test basic LDB connection creation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - initial_status="unknown" - pre_installed="false" - test_package="python3-ldb-devel" - - check_package_existence() { - LOG_INFO "检查yum源中是否存在软件包:$test_package" - if ! dnf list installed "$test_package" && ! dnf list available "$test_package" 2>&1 | grep -q "$test_package"; then - LOG_ERROR "软件包 $test_package 在yum源中不存在" - exit 255 - fi - LOG_INFO "软件包 $test_package 在yum源中存在" - } - - check_package_installed() { - LOG_INFO "检查系统是否已安装 $test_package" - if dnf list installed "$test_package" &>/dev/null; then - initial_status="installed" - pre_installed="true" - LOG_INFO "检测到 $test_package 已安装" - else - initial_status="not_installed" - LOG_INFO "检测到 $test_package 未安装" - fi - } - - install_if_necessary() { - if [ "$pre_installed" = "false" ]; then - LOG_INFO "系统未安装 $test_package,开始安装" - dnf install -y "$test_package" - CHECK_RESULT $? 0 0 "安装 $test_package 失败" - LOG_INFO "$test_package 安装成功" - fi - } - - uninstall_if_necessary() { - if [ "$pre_installed" = "false" ]; then - LOG_INFO "执行环境清理:卸载 $test_package" - dnf remove -y "$test_package" - CHECK_RESULT $? 0 0 "卸载 $test_package 失败" - LOG_INFO "$test_package 卸载成功,环境已恢复" - fi - } - - execute_ldb_test() { - LOG_INFO "开始执行基础LDB连接创建测试" - # 检查并执行 ldb 连接命令 - # 假设测试命令为:ldb --help 查看支持的参数 - # 实际测试命令可能需要根据具体测试需求调整,这里以 --help 为例 - command_to_test="ldb --help" - # 检查命令是否存在 - if ! command -v ldb &>/dev/null; then - LOG_ERROR "ldb 命令不存在" - # 如果 ldb 命令不存在,可能由两个原因: - # 1. python3-ldb-devel 包未正确安装,此时退出码应为非0(包安装失败) - # 2. 包安装了但 ldb 命令不在 PATH 中,需要具体判断 - # 根据规则,如果由于包未安装导致的失败已在前期检查 - # 这里假设如果包安装了但没命令,按一般命令失败处理 - echo "如果 $test_package 已安装但 ldb 命令不可用,请检查包内容" - exit 255 - fi - LOG_INFO "执行命令:$command_to_test" - # 检查 --help 参数是否被支持 - if ! ldb --help &>/dev/null 2>&1; then - LOG_ERROR "ldb 命令不支持 --help 参数" - exit 255 - fi - $command_to_test > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ldb --help 命令执行失败" - LOG_INFO "基础LDB连接创建测试执行成功" - } - - main() { - LOG_INFO "开始执行测试脚本:test_python3-ldb-devel_function_ldb_connect" - # 检查软件包是否存在 - check_package_existence - # 检查初始安装状态 - check_package_installed - # 如果未安装,则安装 - install_if_necessary - # 执行LDB连接创建测试 - execute_ldb_test - LOG_INFO "测试执行完成" - # 环境清理 - uninstall_if_necessary - LOG_INFO "测试脚本执行结束,环境状态已恢复" - } - - main "$@" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libldb/python3-ldb-devel/test_python3-ldb-devel_function_ldb_search.sh b/testcases/function_test/pkg_test/libldb/python3-ldb-devel/test_python3-ldb-devel_function_ldb_search.sh deleted file mode 100644 index 6ba17d309db..00000000000 --- a/testcases/function_test/pkg_test/libldb/python3-ldb-devel/test_python3-ldb-devel_function_ldb_search.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 : 2026-01-31 -# @License : Mulan PSL v2 -# @Desc : Test basic LDB search operation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test basic LDB search operation" - LOG_INFO "步骤1: 检查环境中是否已安装python3-ldb-devel软件包" - if rpm -q python3-ldb-devel > /dev/null 2>&1; then - LOG_INFO "python3-ldb-devel已安装,测试后保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-ldb-devel未安装,将在测试过程中安装并在测试后卸载" - INSTALLED=false - fi - - LOG_INFO "步骤2: 检查yum源中是否有python3-ldb-devel软件包" - if ! dnf list available python3-ldb-devel > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到python3-ldb-devel软件包" - exit 255 - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3: 安装python3-ldb-devel软件包" - dnf install -y python3-ldb-devel - CHECK_RESULT $? 0 0 "安装python3-ldb-devel失败" - fi - - LOG_INFO "步骤4: 验证ldb search命令是否存在" - if ! command -v ldbsearch > /dev/null 2>&1; then - LOG_ERROR "ldbsearch命令不存在" - exit 255 - fi - - LOG_INFO "步骤5: 检查ldb search命令是否支持基本参数" - if ! ldbsearch --help > /dev/null 2>&1; then - LOG_ERROR "ldbsearch命令不支持--help参数" - exit 255 - fi - - LOG_INFO "步骤6: 执行基本LDB搜索操作测试" - ldbsearch --help | grep -q "Usage:" - CHECK_RESULT $? 0 0 "ldbsearch基本功能测试失败" - - LOG_INFO "步骤7: 清理测试环境" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载python3-ldb-devel软件包" - dnf remove -y python3-ldb-devel - CHECK_RESULT $? 0 0 "卸载python3-ldb-devel失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file From d26c172f5c3dcb47cbae1c654630f10e08e7de82 Mon Sep 17 00:00:00 2001 From: honghua Date: Wed, 22 Apr 2026 05:06:17 +0800 Subject: [PATCH 03/12] update testcase for testsuite qt5-qtdatavis3d-doc --- .../pkg_test/qt5-doc/qt5-qtdatavis3d-doc.json | 10 --- .../test_qt5-qtdatavis3d-doc_function_doc.sh | 71 ------------------- 2 files changed, 81 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/qt5-doc/qt5-qtdatavis3d-doc.json delete mode 100644 testcases/function_test/pkg_test/qt5-doc/qt5-qtdatavis3d-doc/test_qt5-qtdatavis3d-doc_function_doc.sh diff --git a/suite2cases/function_test/pkg_test/qt5-doc/qt5-qtdatavis3d-doc.json b/suite2cases/function_test/pkg_test/qt5-doc/qt5-qtdatavis3d-doc.json deleted file mode 100644 index acaac339ad7..00000000000 --- a/suite2cases/function_test/pkg_test/qt5-doc/qt5-qtdatavis3d-doc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/qt5-doc/qt5-qtdatavis3d-doc", - "machine num": 1, - "cases": [ - { - "name": "test_qt5-qtdatavis3d-doc_function_doc", - "desc": "Verify documentation files existence" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt5-doc/qt5-qtdatavis3d-doc/test_qt5-qtdatavis3d-doc_function_doc.sh b/testcases/function_test/pkg_test/qt5-doc/qt5-qtdatavis3d-doc/test_qt5-qtdatavis3d-doc_function_doc.sh deleted file mode 100644 index 7ab6789caaa..00000000000 --- a/testcases/function_test/pkg_test/qt5-doc/qt5-qtdatavis3d-doc/test_qt5-qtdatavis3d-doc_function_doc.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-12-07 -# @License : Mulan PSL v2 -# @Desc : Verify documentation files existence -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查文档文件是否存在 - LOG_INFO "开始测试:验证qt5-qtdatavis3d-doc文档文件是否存在" - - # 检查软件包是否已安装 - if rpm -q qt5-qtdatavis3d-doc &>/dev/null; then - LOG_INFO "qt5-qtdatavis3d-doc已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "qt5-qtdatavis3d-doc未安装,准备安装" - INSTALLED=false - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在qt5-qtdatavis3d-doc软件包" - if ! dnf list available qt5-qtdatavis3d-doc &>/dev/null; then - LOG_ERROR "yum源中未找到qt5-qtdatavis3d-doc软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装qt5-qtdatavis3d-doc软件包" - dnf install -y qt5-qtdatavis3d-doc - CHECK_RESULT $? 0 0 "安装qt5-qtdatavis3d-doc失败" - fi - - # 验证文档文件是否存在 - LOG_INFO "验证qt5-qtdatavis3d-doc文档文件是否存在" - DOC_PATH="/usr/share/doc/qt5-qtdatavis3d-doc" - if [ -d "$DOC_PATH" ]; then - LOG_INFO "文档文件存在于$DOC_PATH" - else - LOG_ERROR "文档文件不存在于$DOC_PATH" - exit 1 - fi - - # 清理环境:如果脚本安装了软件包,则卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载qt5-qtdatavis3d-doc软件包" - dnf remove -y qt5-qtdatavis3d-doc - CHECK_RESULT $? 0 0 "卸载qt5-qtdatavis3d-doc失败" - fi - - LOG_INFO "测试完成:验证qt5-qtdatavis3d-doc文档文件是否存在成功" - -} - -main "$@" \ No newline at end of file From 919f3af7475adff57d909760728050b6f2e6ff0f Mon Sep 17 00:00:00 2001 From: honghua Date: Wed, 22 Apr 2026 05:10:54 +0800 Subject: [PATCH 04/12] update testcase for testsuite python-zope-component-help --- .../python-zope-component-help.json | 16 --- ...hon-zope-component-help_function_config.sh | 66 ------------ ...ython-zope-component-help_function_init.sh | 62 ----------- ...thon-zope-component-help_function_query.sh | 102 ------------------ ...n-zope-component-help_function_register.sh | 64 ----------- 5 files changed, 310 deletions(-) delete mode 100644 testcases/function_test/pkg_test/python-zope-component/python-zope-component-help/test_python-zope-component-help_function_config.sh delete mode 100644 testcases/function_test/pkg_test/python-zope-component/python-zope-component-help/test_python-zope-component-help_function_init.sh delete mode 100644 testcases/function_test/pkg_test/python-zope-component/python-zope-component-help/test_python-zope-component-help_function_query.sh delete mode 100644 testcases/function_test/pkg_test/python-zope-component/python-zope-component-help/test_python-zope-component-help_function_register.sh diff --git a/suite2cases/function_test/pkg_test/python-zope-component/python-zope-component-help.json b/suite2cases/function_test/pkg_test/python-zope-component/python-zope-component-help.json index 48ec080660c..f9ca6b7ccbc 100644 --- a/suite2cases/function_test/pkg_test/python-zope-component/python-zope-component-help.json +++ b/suite2cases/function_test/pkg_test/python-zope-component/python-zope-component-help.json @@ -6,22 +6,6 @@ "name": "test_python-zope-component-help_install", "desc": "测试软件包的安装功能,验证是否能成功安装python-zope-component-help。", "machine num": 1 - }, - { - "name": "test_python-zope-component-help_function_init", - "desc": "测试软件包的初始化功能,验证是否能正确初始化python-zope-component-help。" - }, - { - "name": "test_python-zope-component-help_function_config", - "desc": "测试软件包的配置功能,验证是否能正确配置python-zope-component-help。" - }, - { - "name": "test_python-zope-component-help_function_register", - "desc": "测试软件包的注册功能,验证是否能正确注册组件。" - }, - { - "name": "test_python-zope-component-help_function_query", - "desc": "测试软件包的查询功能,验证是否能正确查询组件。" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-zope-component/python-zope-component-help/test_python-zope-component-help_function_config.sh b/testcases/function_test/pkg_test/python-zope-component/python-zope-component-help/test_python-zope-component-help_function_config.sh deleted file mode 100644 index 81db67e6ac3..00000000000 --- a/testcases/function_test/pkg_test/python-zope-component/python-zope-component-help/test_python-zope-component-help_function_config.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-03 -# @License : Mulan PSL v2 -# @Desc : 测试软件包的配置功能,验证是否能正确配置python-zope-component-help。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试python-zope-component-help的配置功能" - - # 检查yum源中是否存在python-zope-component-help包 - LOG_INFO "检查yum源中是否存在python-zope-component-help包" - dnf list available python-zope-component-help >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python-zope-component-help包" - exit 255 - fi - - # 检查是否已安装python-zope-component-help - LOG_INFO "检查是否已安装python-zope-component-help" - rpm -q python-zope-component-help >/dev/null 2>&1 - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "python-zope-component-help已安装" - else - installed=false - LOG_INFO "python-zope-component-help未安装,将进行安装" - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装python-zope-component-help" - dnf install -y python-zope-component-help - CHECK_RESULT $? 0 0 "安装python-zope-component-help失败" - fi - - # 验证配置功能 - LOG_INFO "验证python-zope-component-help的配置功能" - command_output=$(python -c "import zope.component; print(zope.component.__version__)" 2>&1) - CHECK_RESULT $? 0 0 "执行配置验证命令失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载python-zope-component-help" - dnf remove -y python-zope-component-help - CHECK_RESULT $? 0 0 "卸载python-zope-component-help失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-zope-component/python-zope-component-help/test_python-zope-component-help_function_init.sh b/testcases/function_test/pkg_test/python-zope-component/python-zope-component-help/test_python-zope-component-help_function_init.sh deleted file mode 100644 index ec72894ee58..00000000000 --- a/testcases/function_test/pkg_test/python-zope-component/python-zope-component-help/test_python-zope-component-help_function_init.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-12-03 -# @License : Mulan PSL v2 -# @Desc : 测试软件包的初始化功能,验证是否能正确初始化python-zope-component-help。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装python-zope-component-help - LOG_INFO "检查是否已安装python-zope-component-help" - if dnf list installed python-zope-component-help &>/dev/null; then - LOG_INFO "python-zope-component-help已安装,脚本结束后保持安装状态" - installed=true - else - LOG_INFO "python-zope-component-help未安装,脚本结束后将卸载" - installed=false - fi - - # 检查yum源中是否有python-zope-component-help - LOG_INFO "检查yum源中是否有python-zope-component-help" - if ! dnf list available python-zope-component-help &>/dev/null; then - LOG_ERROR "yum源中未找到python-zope-component-help,退出" - exit 255 - fi - - # 安装python-zope-component-help - if [ "$installed" = false ]; then - LOG_INFO "安装python-zope-component-help" - dnf install -y python-zope-component-help - CHECK_RESULT $? 0 0 "安装python-zope-component-help失败" - fi - - # 验证初始化功能 - LOG_INFO "验证python-zope-component-help的初始化功能" - python -c "import zope.component" &>/dev/null - CHECK_RESULT $? 0 0 "python-zope-component-help初始化失败" - - # 清理环境(如果之前未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载python-zope-component-help" - dnf remove -y python-zope-component-help - CHECK_RESULT $? 0 0 "卸载python-zope-component-help失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-zope-component/python-zope-component-help/test_python-zope-component-help_function_query.sh b/testcases/function_test/pkg_test/python-zope-component/python-zope-component-help/test_python-zope-component-help_function_query.sh deleted file mode 100644 index c4b5c0abf67..00000000000 --- a/testcases/function_test/pkg_test/python-zope-component/python-zope-component-help/test_python-zope-component-help_function_query.sh +++ /dev/null @@ -1,102 +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-03 -# @License : Mulan PSL v2 -# @Desc : 测试软件包的查询功能,验证是否能正确查询组件。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查软件包是否存在于yum源中 - check_package_in_repo() { - dnf list available "$1" &>/dev/null - return $? - } - - # 安装软件包 - install_package() { - LOG_INFO "开始安装软件包: $1" - dnf install -y "$1" - CHECK_RESULT $? 0 0 "安装软件包失败" - } - - # 卸载软件包 - uninstall_package() { - LOG_INFO "开始卸载软件包: $1" - dnf remove -y "$1" - CHECK_RESULT $? 0 0 "卸载软件包失败" - } - - # 检查命令是否支持参数 - check_command_option() { - if ! $1 --help | grep -q "$2"; then - LOG_ERROR "命令 $1 不支持参数 $2" - exit 255 - fi - } - - # 主测试函数 - test_python_zope_component_help_function_query() { - local package_name="python-zope-component" - - # 检查环境是否已安装软件包 - if rpm -q "$package_name" &>/dev/null; then - LOG_INFO "环境已安装软件包 $package_name,测试结束后将保持安装状态" - local keep_installed=true - else - LOG_INFO "环境未安装软件包 $package_name,测试结束后将卸载软件包" - local keep_installed=false - fi - - # 检查yum源中是否有该软件包 - check_package_in_repo "$package_name" || { - LOG_ERROR "yum源中不存在软件包 $package_name" - exit 255 - } - - # 安装软件包(如果未安装) - if ! $keep_installed; then - install_package "$package_name" - fi - - # 测试查询功能:验证是否能正确查询组件信息 - LOG_INFO "测试查询功能:验证是否能正确查询组件信息" - - # zopectl是python-zope-component软件包的组件之一,通过--help选项验证查询功能 - command="zopectl" - option="--help" - - check_command_option "$command" "$option" - - LOG_INFO "执行命令: $command $option" - $command $option - CHECK_RESULT $? 0 0 "执行命令 $command $option 失败" - - LOG_INFO "测试通过:软件包的查询功能正常" - - # 清理环境(如果之前未安装) - if ! $keep_installed; then - uninstall_package "$package_name" - fi - } - - # 执行主测试函数 - test_python_zope_component_help_function_query - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-zope-component/python-zope-component-help/test_python-zope-component-help_function_register.sh b/testcases/function_test/pkg_test/python-zope-component/python-zope-component-help/test_python-zope-component-help_function_register.sh deleted file mode 100644 index 9ed54a22c9d..00000000000 --- a/testcases/function_test/pkg_test/python-zope-component/python-zope-component-help/test_python-zope-component-help_function_register.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-03 -# @License : Mulan PSL v2 -# @Desc : 测试软件包的注册功能,验证是否能正确注册组件。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试软件包的注册功能,验证是否能正确注册组件。" - - # 检查是否已安装python-zope-component-help - LOG_INFO "检查是否已安装python-zope-component-help" - if dnf list installed python-zope-component-help &>/dev/null; then - LOG_INFO "python-zope-component-help已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "python-zope-component-help未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有python-zope-component-help - LOG_INFO "检查yum源中是否有python-zope-component-help" - if ! dnf list available python-zope-component-help &>/dev/null; then - LOG_ERROR "yum源中未找到python-zope-component-help软件包" - exit 255 - fi - - # 安装python-zope-component-help - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装python-zope-component-help" - dnf install -y python-zope-component-help - CHECK_RESULT $? 0 0 "安装python-zope-component-help失败" - fi - - # 测试注册功能 - LOG_INFO "测试注册功能" - zope-component-help register - CHECK_RESULT $? 0 0 "注册功能测试失败" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载python-zope-component-help" - dnf remove -y python-zope-component-help - CHECK_RESULT $? 0 0 "卸载python-zope-component-help失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file From a5a63aa2d6b82a8b0dba8fe55d0d1fc6c08ffaf7 Mon Sep 17 00:00:00 2001 From: honghua Date: Wed, 22 Apr 2026 05:13:56 +0800 Subject: [PATCH 05/12] update testcase for testsuite texlive-amiri --- .../texlive-split-a/texlive-amiri.json | 20 --- .../test_texlive-amiri_function_check.sh | 84 ------------- .../test_texlive-amiri_function_install.sh | 64 ---------- .../test_texlive-amiri_function_remove.sh | 104 ---------------- ...test_texlive-amiri_function_usage_latex.sh | 114 ------------------ ...test_texlive-amiri_function_usage_xetex.sh | 105 ---------------- 6 files changed, 491 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-a/texlive-amiri/test_texlive-amiri_function_check.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-a/texlive-amiri/test_texlive-amiri_function_install.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-a/texlive-amiri/test_texlive-amiri_function_remove.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-a/texlive-amiri/test_texlive-amiri_function_usage_latex.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-a/texlive-amiri/test_texlive-amiri_function_usage_xetex.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-a/texlive-amiri.json b/suite2cases/function_test/pkg_test/texlive-split-a/texlive-amiri.json index 689aa65cf33..ae3dcdfd8c3 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-a/texlive-amiri.json +++ b/suite2cases/function_test/pkg_test/texlive-split-a/texlive-amiri.json @@ -2,26 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-a/texlive-amiri", "machine num": 1, "cases": [ - { - "name": "test_texlive-amiri_function_install", - "desc": "Test package installation" - }, - { - "name": "test_texlive-amiri_function_remove", - "desc": "Test package removal" - }, - { - "name": "test_texlive-amiri_function_check", - "desc": "Test package existence" - }, - { - "name": "test_texlive-amiri_function_usage_latex", - "desc": "Test LaTeX usage with Amiri font" - }, - { - "name": "test_texlive-amiri_function_usage_xetex", - "desc": "Test XeLaTeX usage with Amiri font" - }, { "name": "test_texlive-amiri_function_list_files", "desc": "Test listing package files" diff --git a/testcases/function_test/pkg_test/texlive-split-a/texlive-amiri/test_texlive-amiri_function_check.sh b/testcases/function_test/pkg_test/texlive-split-a/texlive-amiri/test_texlive-amiri_function_check.sh deleted file mode 100644 index a48e85e66bf..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-a/texlive-amiri/test_texlive-amiri_function_check.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-27 -# @License : Mulan PSL v2 -# @Desc : Test package existence -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:检查texlive-amiri软件包是否存在" - LOG_INFO "步骤1: 检查yum源中是否存在texlive-amiri软件包" - dnf list available texlive-amiri - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-amiri软件包" - exit 255 - fi - LOG_INFO "步骤2: 检查当前是否已安装texlive-amiri软件包" - rpm -q texlive-amiri - if [ $? -eq 0 ]; then - LOG_INFO "texlive-amiri已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-amiri未安装,将进行安装作为测试步骤" - INSTALLED=0 - fi - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装texlive-amiri软件包" - dnf install -y texlive-amiri - CHECK_RESULT $? 0 0 "安装texlive-amiri失败" - fi - LOG_INFO "步骤4: 验证texlive-amiri软件包的基本功能" - LOG_INFO "步骤4.1: 检查amiri字体文件是否存在" - ls /usr/share/texlive/texmf-dist/fonts/tfm/public/amiri/amiri*.tfm > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未找到amiri字体tfm文件" - ls /usr/share/texlive/texmf-dist/fonts/opentype/public/amiri/amiri*.otf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未找到amiri字体otf文件" - LOG_INFO "步骤4.2: 检查amiri包是否能在LaTeX中加载(通过kpsewhich工具)" - kpsewhich amiri.sty > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "无法通过kpsewhich找到amiri.sty文件" - LOG_INFO "步骤5: 测试amiri字体在简单LaTeX文档中的使用" - TEST_TEX_FILE="/tmp/test_amiri.tex" - TEST_PDF_FILE="/tmp/test_amiri.pdf" - cat > $TEST_TEX_FILE << "EOF" - \documentclass{article} - \usepackage{amiri} - \begin{document} - {\amiri Test text in Amiri font.} - \end{document} - EOF - LOG_INFO "生成测试PDF文件" - pdflatex -interaction=nonstopmode -output-directory=/tmp $TEST_TEX_FILE > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用amiri字体生成PDF失败" - if [ -f "$TEST_PDF_FILE" ]; then - LOG_INFO "成功生成包含amiri字体的PDF文件" - rm -f $TEST_TEX_FILE $TEST_PDF_FILE /tmp/test_amiri.aux /tmp/test_amiri.log - else - LOG_ERROR "未找到生成的PDF文件" - CHECK_RESULT 1 0 0 "PDF文件未生成" - fi - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤6: 清理环境,卸载测试安装的texlive-amiri软件包" - dnf remove -y texlive-amiri - CHECK_RESULT $? 0 0 "卸载texlive-amiri失败" - LOG_INFO "已卸载texlive-amiri软件包" - else - LOG_INFO "步骤6: 测试前已安装texlive-amiri,保持安装状态,无需卸载" - fi - LOG_INFO "测试完成:texlive-amiri软件包存在且功能正常" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-a/texlive-amiri/test_texlive-amiri_function_install.sh b/testcases/function_test/pkg_test/texlive-split-a/texlive-amiri/test_texlive-amiri_function_install.sh deleted file mode 100644 index 64fbb52a407..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-a/texlive-amiri/test_texlive-amiri_function_install.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-09-17 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-amiri软件包 - LOG_INFO "检查是否已安装texlive-amiri软件包" - rpm -q texlive-amiri > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-amiri已安装,脚本结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-amiri未安装,将在测试后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-amiri软件包 - LOG_INFO "检查yum源中是否有texlive-amiri软件包" - dnf list available texlive-amiri > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-amiri软件包" - - # 安装texlive-amiri软件包 - LOG_INFO "开始安装texlive-amiri软件包" - dnf install -y texlive-amiri - CHECK_RESULT $? 0 0 "安装texlive-amiri软件包失败" - - # 验证安装是否成功 - LOG_INFO "验证texlive-amiri软件包是否成功安装" - rpm -q texlive-amiri > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-amiri软件包未正确安装" - - # 执行测试命令(示例命令,可根据实际需求调整) - LOG_INFO "执行测试命令" - tex --version > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "tex命令不存在或不支持" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-amiri软件包" - dnf remove -y texlive-amiri > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-amiri软件包失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-a/texlive-amiri/test_texlive-amiri_function_remove.sh b/testcases/function_test/pkg_test/texlive-split-a/texlive-amiri/test_texlive-amiri_function_remove.sh deleted file mode 100644 index e784347375d..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-a/texlive-amiri/test_texlive-amiri_function_remove.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-02-27 -# @License : Mulan PSL v2 -# @Desc : Test package removal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试 texlive-amiri 软件包卸载功能" - - # 检查软件包是否在yum源中 - LOG_INFO "步骤1:检查 texlive-amiri 软件包是否在yum源中" - dnf list available texlive-amiri 2>/dev/null | grep -q texlive-amiri - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-amiri 软件包不在yum源中" - exit 255 - fi - - # 检查当前是否已安装 - LOG_INFO "步骤2:检查当前是否已安装 texlive-amiri" - rpm -q texlive-amiri >/dev/null 2>&1 - already_installed=$? - - if [ $already_installed -eq 0 ]; then - LOG_INFO "texlive-amiri 已安装,测试结束后将保持安装状态" - test_install=0 - else - LOG_INFO "texlive-amiri 未安装,将先安装再测试卸载" - test_install=1 - - # 安装软件包 - LOG_INFO "步骤3:安装 texlive-amiri 软件包" - dnf install -y texlive-amiri - CHECK_RESULT $? 0 0 "安装 texlive-amiri 失败" - fi - - # 验证安装成功 - LOG_INFO "步骤4:验证 texlive-amiri 安装成功" - rpm -q texlive-amiri >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-amiri 未正确安装" - - # 测试卸载功能 - LOG_INFO "步骤5:测试 texlive-amiri 卸载功能" - dnf remove -y texlive-amiri - CHECK_RESULT $? 0 0 "卸载 texlive-amiri 失败" - - # 验证卸载成功 - LOG_INFO "步骤6:验证 texlive-amiri 已卸载" - rpm -q texlive-amiri >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "texlive-amiri 卸载后仍然存在" - exit 1 - fi - LOG_INFO "texlive-amiri 已成功卸载" - - # 环境恢复 - LOG_INFO "步骤7:恢复测试环境" - if [ $test_install -eq 1 ]; then - # 如果是测试安装的,清理环境 - LOG_INFO "清理测试安装的软件包" - # 检查是否还有残留(理论上不应该有) - rpm -q texlive-amiri >/dev/null 2>&1 && dnf remove -y texlive-amiri - else - # 如果是原本就安装的,重新安装 - LOG_INFO "重新安装 texlive-amiri 到原始状态" - dnf install -y texlive-amiri - CHECK_RESULT $? 0 0 "重新安装 texlive-amiri 失败" - fi - - # 最终验证 - LOG_INFO "步骤8:最终环境验证" - if [ $already_installed -eq 0 ]; then - rpm -q texlive-amiri >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "环境未恢复到原始安装状态" - LOG_INFO "环境已恢复到原始安装状态" - else - rpm -q texlive-amiri >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "环境清理不彻底,texlive-amiri 仍然存在" - exit 1 - fi - LOG_INFO "环境已完全清理" - fi - - LOG_INFO "texlive-amiri 软件包卸载功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-a/texlive-amiri/test_texlive-amiri_function_usage_latex.sh b/testcases/function_test/pkg_test/texlive-split-a/texlive-amiri/test_texlive-amiri_function_usage_latex.sh deleted file mode 100644 index 5ef21cff1b5..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-a/texlive-amiri/test_texlive-amiri_function_usage_latex.sh +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-27 -# @License : Mulan PSL v2 -# @Desc : Test LaTeX usage with Amiri font -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试: Test LaTeX usage with Amiri font" - - # 检查是否已安装 texlive-amiri 软件包 - LOG_INFO "检查 texlive-amiri 是否已安装" - rpm -q texlive-amiri > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-amiri 已安装,测试后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-amiri 未安装,将在测试过程中安装并在测试后卸载" - INSTALLED=0 - fi - - # 检查 yum 源中是否有 texlive-amiri 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-amiri 软件包" - dnf list available texlive-amiri > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum 源中未找到 texlive-amiri 软件包,退出测试" - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-amiri 软件包" - exit 255 - fi - - # 如果未安装,则安装 texlive-amiri - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 texlive-amiri 软件包" - dnf install -y texlive-amiri > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装 texlive-amiri 失败" - if [ $? -ne 0 ]; then - LOG_ERROR "安装 texlive-amiri 失败" - exit 1 - fi - fi - - # 测试 LaTeX 使用 Amiri 字体 - LOG_INFO "测试 LaTeX 使用 Amiri 字体" - cat > test_amiri.tex << "EOF" - \documentclass{article} - \usepackage{amiri} - \begin{document} - This is a test document using Amiri font. - \end{document} - EOF - - # 检查是否支持 pdflatex 命令 - LOG_INFO "检查 pdflatex 命令是否可用" - which pdflatex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "pdflatex 命令不存在或不支持" - exit 255 - fi - - # 使用 pdflatex 编译 LaTeX 文档 - LOG_INFO "使用 pdflatex 编译 LaTeX 文档" - pdflatex -interaction=nonstopmode test_amiri.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pdflatex 编译失败" - if [ $? -ne 0 ]; then - LOG_ERROR "pdflatex 编译失败" - # 清理临时文件 - rm -f test_amiri.tex test_amiri.aux test_amiri.log test_amiri.pdf - exit 1 - fi - - # 检查生成的 PDF 文件是否存在 - LOG_INFO "检查生成的 PDF 文件是否存在" - if [ -f test_amiri.pdf ]; then - LOG_INFO "PDF 文件生成成功" - else - LOG_ERROR "PDF 文件生成失败" - # 清理临时文件 - rm -f test_amiri.tex test_amiri.aux test_amiri.log - exit 1 - fi - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f test_amiri.tex test_amiri.aux test_amiri.log test_amiri.pdf - - # 如果测试前未安装,则卸载 texlive-amiri - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-amiri 软件包" - dnf remove -y texlive-amiri > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载 texlive-amiri 失败" - if [ $? -ne 0 ]; then - LOG_ERROR "卸载 texlive-amiri 失败" - exit 1 - fi - fi - - LOG_INFO "测试完成: Test LaTeX usage with Amiri font" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-a/texlive-amiri/test_texlive-amiri_function_usage_xetex.sh b/testcases/function_test/pkg_test/texlive-split-a/texlive-amiri/test_texlive-amiri_function_usage_xetex.sh deleted file mode 100644 index fa063fd33a1..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-a/texlive-amiri/test_texlive-amiri_function_usage_xetex.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-27 -# @License : Mulan PSL v2 -# @Desc : Test XeLaTeX usage with Amiri font -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-amiri软件包 - LOG_INFO "检查是否已安装texlive-amiri软件包" - rpm -q texlive-amiri > /dev/null 2>&1 - already_installed=$? - - # 判断软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在texlive-amiri软件包" - dnf list available texlive-amiri --quiet > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-amiri软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -ne 0 ]; then - LOG_INFO "安装texlive-amiri软件包" - dnf install -y texlive-amiri --nogpgcheck - CHECK_RESULT $? 0 0 "安装texlive-amiri软件包失败" - fi - - # 创建测试目录 - LOG_INFO "创建测试目录" - test_dir="/tmp/test_texlive_amiri_$(date +%s)" - mkdir -p $test_dir - CHECK_RESULT $? 0 0 "创建测试目录失败" - - # 进入测试目录 - cd $test_dir - - # 创建测试LaTeX文档 - LOG_INFO "创建测试LaTeX文档" - cat > test_amiri.tex << "EOF" - \documentclass{article} - \usepackage{fontspec} - \setmainfont{Amiri} - \begin{document} - \section{测试Amiri字体} - 这是一段使用Amiri字体的测试文本。 - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败" - - # 使用xelatex编译文档 - LOG_INFO "使用xelatex编译测试文档" - xelatex -interaction=nonstopmode test_amiri.tex > xelatex_output.log 2>&1 - CHECK_RESULT $? 0 0 "xelatex编译失败" - - # 检查生成的PDF文件 - LOG_INFO "检查生成的PDF文件" - if [ -f "test_amiri.pdf" ]; then - LOG_INFO "PDF文件生成成功" - # 检查PDF文件大小 - pdf_size=$(stat -c%s test_amiri.pdf) - if [ $pdf_size -gt 1000 ]; then - LOG_INFO "PDF文件大小正常: ${pdf_size}字节" - else - LOG_ERROR "PDF文件大小异常: ${pdf_size}字节" - CHECK_RESULT 1 0 0 "PDF文件大小异常" - fi - else - LOG_ERROR "PDF文件未生成" - CHECK_RESULT 1 0 0 "PDF文件未生成" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - cd / - rm -rf $test_dir - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $already_installed -ne 0 ]; then - LOG_INFO "卸载texlive-amiri软件包" - dnf remove -y texlive-amiri - CHECK_RESULT $? 0 0 "卸载texlive-amiri软件包失败" - else - LOG_INFO "测试前已安装texlive-amiri,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file From 94798914343cdfce59830b843ae8c6be01021e63 Mon Sep 17 00:00:00 2001 From: honghua Date: Wed, 22 Apr 2026 05:16:14 +0800 Subject: [PATCH 06/12] update testcase for testsuite farstream02-devel --- .../farstream02/farstream02-devel.json | 42 ------- .../test_farstream02-devel_function_build.sh | 113 ------------------ .../test_farstream02-devel_function_check.sh | 91 -------------- ...test_farstream02-devel_function_connect.sh | 71 ----------- ...test_farstream02-devel_function_headers.sh | 111 ----------------- .../test_farstream02-devel_function_init.sh | 68 ----------- ...test_farstream02-devel_function_install.sh | 93 -------------- ...st_farstream02-devel_function_pkgconfig.sh | 76 ------------ ...st_farstream02-devel_function_uninstall.sh | 95 --------------- ...test_farstream02-devel_function_version.sh | 87 -------------- 10 files changed, 847 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/farstream02/farstream02-devel.json delete mode 100644 testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_build.sh delete mode 100644 testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_check.sh delete mode 100644 testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_connect.sh delete mode 100644 testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_headers.sh delete mode 100644 testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_init.sh delete mode 100644 testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_install.sh delete mode 100644 testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_pkgconfig.sh delete mode 100644 testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_uninstall.sh delete mode 100644 testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_version.sh diff --git a/suite2cases/function_test/pkg_test/farstream02/farstream02-devel.json b/suite2cases/function_test/pkg_test/farstream02/farstream02-devel.json deleted file mode 100644 index 6752501f688..00000000000 --- a/suite2cases/function_test/pkg_test/farstream02/farstream02-devel.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/farstream02/farstream02-devel", - "machine num": 1, - "cases": [ - { - "name": "test_farstream02-devel_function_init", - "desc": "Test initialization of farstream02-devel" - }, - { - "name": "test_farstream02-devel_function_connect", - "desc": "Test connection functionality of farstream02-devel" - }, - { - "name": "test_farstream02-devel_function_install", - "desc": "Test installation of farstream02-devel package" - }, - { - "name": "test_farstream02-devel_function_uninstall", - "desc": "Test uninstallation of farstream02-devel package" - }, - { - "name": "test_farstream02-devel_function_version", - "desc": "Test version query of farstream02-devel package" - }, - { - "name": "test_farstream02-devel_function_check", - "desc": "Test if farstream02-devel is installed" - }, - { - "name": "test_farstream02-devel_function_headers", - "desc": "Test presence of development headers" - }, - { - "name": "test_farstream02-devel_function_pkgconfig", - "desc": "Test pkg-config file for farstream02" - }, - { - "name": "test_farstream02-devel_function_build", - "desc": "Test basic compile and link with library" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_build.sh b/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_build.sh deleted file mode 100644 index 35a56c430b0..00000000000 --- a/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_build.sh +++ /dev/null @@ -1,113 +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-27 -# @License : Mulan PSL v2 -# @Desc : Test basic compile and link with library -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试环境检查 - LOG_INFO "开始测试:Test basic compile and link with library" - LOG_INFO "步骤1:检查测试环境是否已安装farstream02-devel包" - - # 检查farstream02-devel是否已安装 - if dnf list installed farstream02-devel &>/dev/null; then - LOG_INFO "farstream02-devel已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "farstream02-devel未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有farstream02-devel包 - LOG_INFO "步骤2:检查yum源中是否有farstream02-devel包" - if ! dnf list available farstream02-devel &>/dev/null; then - LOG_ERROR "yum源中未找到farstream02-devel包" - exit 255 - fi - - # 如果未安装,则安装farstream02-devel包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装farstream02-devel包" - dnf install -y farstream02-devel - CHECK_RESULT $? 0 0 "安装farstream02-devel失败" - fi - - # 检查pkg-config是否支持farstream-0.2 - LOG_INFO "步骤4:检查pkg-config是否支持farstream-0.2" - if ! pkg-config --exists farstream-0.2; then - LOG_ERROR "pkg-config不支持farstream-0.2参数" - exit 255 - fi - - # 获取farstream库的编译和链接参数 - LOG_INFO "步骤5:获取farstream库的编译和链接参数" - CFLAGS=$(pkg-config --cflags farstream-0.2) - CHECK_RESULT $? 0 0 "获取CFLAGS失败" - LIBS=$(pkg-config --libs farstream-0.2) - CHECK_RESULT $? 0 0 "获取LIBS失败" - - LOG_INFO "CFLAGS: $CFLAGS" - LOG_INFO "LIBS: $LIBS" - - # 创建测试C程序 - LOG_INFO "步骤6:创建测试C程序" - cat > test_farstream.c << "EOF" - #include - #include - - int main() { - printf("farstream library test program\n"); - printf("farstream version: %s\n", fs_get_version()); - return 0; - } - EOF - - CHECK_RESULT $? 0 0 "创建测试C程序失败" - - # 编译测试程序 - LOG_INFO "步骤7:编译测试程序" - gcc $CFLAGS -c test_farstream.c -o test_farstream.o - CHECK_RESULT $? 0 0 "编译源文件失败" - - # 链接测试程序 - LOG_INFO "步骤8:链接测试程序" - gcc test_farstream.o $LIBS -o test_farstream - CHECK_RESULT $? 0 0 "链接程序失败" - - # 运行测试程序 - LOG_INFO "步骤9:运行测试程序" - ./test_farstream - CHECK_RESULT $? 0 0 "运行测试程序失败" - - LOG_INFO "步骤10:清理临时文件" - rm -f test_farstream.c test_farstream.o test_farstream - - # 环境恢复 - LOG_INFO "步骤11:恢复测试环境" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载farstream02-devel包" - dnf remove -y farstream02-devel - CHECK_RESULT $? 0 0 "卸载farstream02-devel失败" - else - LOG_INFO "保持farstream02-devel安装状态" - fi - - LOG_INFO "测试完成:Test basic compile and link with library" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_check.sh b/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_check.sh deleted file mode 100644 index 29612baabb2..00000000000 --- a/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_check.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-27 -# @License : Mulan PSL v2 -# @Desc : Test if farstream02-devel is installed -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试farstream02-devel是否安装" - LOG_INFO "检查farstream02-devel软件包是否已在yum源中" - dnf list available farstream02-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到farstream02-devel软件包" - exit 255 - fi - - LOG_INFO "检查当前环境是否已安装farstream02-devel" - rpm -q farstream02-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装farstream02-devel,测试后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "环境未安装farstream02-devel,将进行安装测试" - INSTALLED=0 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装farstream02-devel软件包" - dnf install -y farstream02-devel - CHECK_RESULT $? 0 0 "安装farstream02-devel失败" - fi - - LOG_INFO "验证farstream02-devel软件包安装成功" - rpm -q farstream02-devel - CHECK_RESULT $? 0 0 "farstream02-devel软件包未正确安装" - - LOG_INFO "测试farstream02-devel相关功能" - LOG_INFO "检查farstream02-devel提供的头文件" - ls /usr/include/farstream-0.2/farstream/*.h > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "farstream02-devel头文件不存在" - - LOG_INFO "检查farstream02-devel提供的pkg-config文件" - pkg-config --cflags farstream-0.2 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "farstream02-devel pkg-config配置失败" - - LOG_INFO "测试编译简单程序验证开发包功能" - cat > test_farstream.c << "EOF" - #include - int main() { - return 0; - } - EOF - - gcc -c test_farstream.c -o test_farstream.o $(pkg-config --cflags --libs farstream-0.2) > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "farstream02-devel开发包编译测试失败" - - rm -f test_farstream.c test_farstream.o - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理测试环境,卸载farstream02-devel软件包" - dnf remove -y farstream02-devel - CHECK_RESULT $? 0 0 "卸载farstream02-devel失败" - - LOG_INFO "验证farstream02-devel已成功卸载" - rpm -q farstream02-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "farstream02-devel卸载失败" - exit 1 - fi - else - LOG_INFO "测试完成,保持farstream02-devel安装状态" - fi - - LOG_INFO "farstream02-devel功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_connect.sh b/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_connect.sh deleted file mode 100644 index 6f5a63b6d97..00000000000 --- a/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_connect.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-12-02 -# @License : Mulan PSL v2 -# @Desc : Test connection functionality of farstream02-devel -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 farstream02-devel 的连接功能" - - # 检查 farstream02-devel 是否已安装 - LOG_INFO "检查 farstream02-devel 是否已安装" - if dnf list installed farstream02-devel &> /dev/null; then - LOG_INFO "farstream02-devel 已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "farstream02-devel 未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 farstream02-devel 软件包 - LOG_INFO "检查 yum 源中是否有 farstream02-devel" - if ! dnf list available farstream02-devel &> /dev/null; then - LOG_ERROR "yum 源中未找到 farstream02-devel,退出测试" - exit 255 - fi - - # 如果未安装,则安装 farstream02-devel - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 farstream02-devel" - dnf install -y farstream02-devel - CHECK_RESULT $? 0 0 "安装 farstream02-devel 失败" - fi - - # 测试连接功能 - LOG_INFO "测试 farstream02-devel 的连接功能" - if ! command -v fs-connect &> /dev/null; then - LOG_ERROR "fs-connect 命令不存在或不支持,退出测试" - exit 255 - fi - - # 执行连接测试命令 - LOG_INFO "执行 fs-connect 命令进行连接测试" - fs-connect --test - CHECK_RESULT $? 0 0 "fs-connect 命令执行失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 farstream02-devel" - dnf remove -y farstream02-devel - CHECK_RESULT $? 0 0 "卸载 farstream02-devel 失败" - fi - - LOG_INFO "farstream02-devel 连接功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_headers.sh b/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_headers.sh deleted file mode 100644 index ea90ebfe09c..00000000000 --- a/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_headers.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-27 -# @License : Mulan PSL v2 -# @Desc : Test presence of development headers -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试开发头文件是否存在 - LOG_INFO "开始测试开发头文件是否存在" - - # 定义软件包名称 - PACKAGE_NAME="farstream02-devel" - LOG_INFO "测试的软件包为: ${PACKAGE_NAME}" - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在${PACKAGE_NAME}软件包" - if ! dnf list available ${PACKAGE_NAME} &>/dev/null; then - LOG_ERROR "yum源中不存在${PACKAGE_NAME}软件包" - exit 255 - fi - LOG_INFO "yum源中存在${PACKAGE_NAME}软件包" - - # 检查是否已安装 - LOG_INFO "检查${PACKAGE_NAME}是否已安装" - if rpm -q ${PACKAGE_NAME} &>/dev/null; then - LOG_INFO "${PACKAGE_NAME}已安装,测试结束后保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "${PACKAGE_NAME}未安装,将进行安装测试" - ALREADY_INSTALLED=0 - fi - - # 如果未安装,则安装软件包 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败" - LOG_INFO "成功安装${PACKAGE_NAME}软件包" - fi - - # 测试开发头文件是否存在 - LOG_INFO "测试开发头文件是否存在" - # 查找farstream02开发头文件 - if find /usr/include -name "*farstream*" -type f 2>/dev/null | grep -q .; then - LOG_INFO "找到farstream02开发头文件" - # 检查具体的头文件 - if [ -f /usr/include/farstream-0.2/farstream.h ] || [ -f /usr/include/farstream-0.2/farstream/fs.h ]; then - LOG_INFO "farstream02开发头文件存在且完整" - else - LOG_ERROR "farstream02开发头文件不完整" - # 如果之前未安装,则卸载软件包 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit 1 - fi - else - LOG_ERROR "未找到farstream02开发头文件" - # 如果之前未安装,则卸载软件包 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit 1 - fi - - # 测试pkg-config文件是否存在 - LOG_INFO "测试pkg-config文件是否存在" - if pkg-config --exists farstream-0.2; then - LOG_INFO "farstream-0.2 pkg-config文件存在" - # 获取版本信息 - VERSION=$(pkg-config --modversion farstream-0.2) - LOG_INFO "farstream-0.2版本为: ${VERSION}" - else - LOG_ERROR "farstream-0.2 pkg-config文件不存在" - # 如果之前未安装,则卸载软件包 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit 1 - fi - - # 清理环境 - LOG_INFO "清理测试环境" - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败" - LOG_INFO "成功卸载${PACKAGE_NAME}软件包" - else - LOG_INFO "${PACKAGE_NAME}原本已安装,保持安装状态" - fi - - LOG_INFO "测试开发头文件是否存在的测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_init.sh b/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_init.sh deleted file mode 100644 index 659f35872d3..00000000000 --- a/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_init.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-11-29 -# @License : Mulan PSL v2 -# @Desc : Test initialization of farstream02-devel -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查farstream02-devel是否已安装 - LOG_INFO "检查farstream02-devel是否已安装" - dnf list installed farstream02-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "farstream02-devel已安装,脚本结束时保持安装状态" - INSTALLED=true - else - LOG_INFO "farstream02-devel未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查yum源中是否有farstream02-devel软件包 - LOG_INFO "检查yum源中是否有farstream02-devel软件包" - dnf list available farstream02-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到farstream02-devel软件包" - exit 255 - fi - - # 如果未安装,则安装farstream02-devel - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装farstream02-devel" - dnf install -y farstream02-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装farstream02-devel失败" - fi - - # 测试初始化功能 - LOG_INFO "测试初始化功能" - # 假设初始化命令为 farstream-init,参数为 --test - LOG_INFO "执行初始化命令 farstream-init --test" - farstream-init --test > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "初始化命令执行失败" - - # 如果脚本开始时未安装farstream02-devel,则在结束时卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载farstream02-devel以恢复环境" - dnf remove -y farstream02-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载farstream02-devel失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_install.sh b/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_install.sh deleted file mode 100644 index 808e7addfef..00000000000 --- a/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_install.sh +++ /dev/null @@ -1,93 +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-26 -# @License : Mulan PSL v2 -# @Desc : Test installation of farstream02-devel package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test installation of farstream02-devel package" - - # 步骤1:检查当前环境是否已安装farstream02-devel软件包 - LOG_INFO "步骤1:检查farstream02-devel软件包是否已安装" - rpm -q farstream02-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "farstream02-devel软件包已安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "farstream02-devel软件包未安装,将在测试过程中安装并在结束前卸载" - INSTALLED_BEFORE=0 - fi - - # 步骤2:检查yum源中是否存在farstream02-devel软件包 - LOG_INFO "步骤2:检查yum源中是否存在farstream02-devel软件包" - dnf list available farstream02-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到farstream02-devel软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在farstream02-devel软件包" - exit 255 - fi - - # 步骤3:安装farstream02-devel软件包 - LOG_INFO "步骤3:安装farstream02-devel软件包" - if [ $INSTALLED_BEFORE -eq 0 ]; then - dnf install -y farstream02-devel - CHECK_RESULT $? 0 0 "安装farstream02-devel软件包失败" - else - LOG_INFO "farstream02-devel软件包已安装,跳过安装步骤" - fi - - # 步骤4:验证farstream02-devel软件包是否安装成功 - LOG_INFO "步骤4:验证farstream02-devel软件包是否安装成功" - rpm -q farstream02-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "farstream02-devel软件包未成功安装" - - # 步骤5:检查farstream02-devel软件包提供的文件 - LOG_INFO "步骤5:检查farstream02-devel软件包提供的文件" - rpm -ql farstream02-devel | head -5 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "无法获取farstream02-devel软件包文件列表" - - # 步骤6:清理环境,恢复到之前状态 - LOG_INFO "步骤6:清理环境,恢复到之前状态" - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "卸载farstream02-devel软件包" - dnf remove -y farstream02-devel - CHECK_RESULT $? 0 0 "卸载farstream02-devel软件包失败" - else - LOG_INFO "保持farstream02-devel软件包安装状态" - fi - - # 步骤7:最终验证 - LOG_INFO "步骤7:最终验证环境状态" - if [ $INSTALLED_BEFORE -eq 0 ]; then - rpm -q farstream02-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "farstream02-devel软件包卸载失败" - exit 1 - else - LOG_INFO "farstream02-devel软件包已成功卸载,环境已恢复" - fi - else - rpm -q farstream02-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "farstream02-devel软件包意外丢失" - LOG_INFO "farstream02-devel软件包保持安装状态" - fi - - LOG_INFO "测试完成:Test installation of farstream02-devel package" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_pkgconfig.sh b/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_pkgconfig.sh deleted file mode 100644 index fc5d80f7a48..00000000000 --- a/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_pkgconfig.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 : 2026-03-27 -# @License : Mulan PSL v2 -# @Desc : Test pkg-config file for farstream02 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test pkg-config file for farstream02" - LOG_INFO "步骤1:检查环境是否已安装farstream02-devel软件包" - rpm -q farstream02-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装farstream02-devel,测试后保持安装状态" - INSTALLED=1 - else - LOG_INFO "环境未安装farstream02-devel,将在测试后卸载" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查yum源中是否存在farstream02-devel软件包" - dnf list available farstream02-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到farstream02-devel软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到farstream02-devel软件包,退出测试" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装farstream02-devel软件包" - dnf install -y farstream02-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装farstream02-devel软件包失败" - fi - - LOG_INFO "步骤4:检查pkg-config文件是否存在" - pkg-config --exists farstream02 - CHECK_RESULT $? 0 0 "pkg-config文件不存在" - - LOG_INFO "步骤5:获取farstream02的版本信息" - VERSION=$(pkg-config --modversion farstream02 2>/dev/null) - if [ -z "$VERSION" ]; then - LOG_ERROR "无法获取farstream02的版本信息" - exit 255 - fi - LOG_INFO "farstream02版本:$VERSION" - - LOG_INFO "步骤6:检查pkg-config参数是否支持" - pkg-config --cflags farstream02 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pkg-config不支持--cflags参数" - pkg-config --libs farstream02 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pkg-config不支持--libs参数" - - LOG_INFO "步骤7:清理测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载farstream02-devel软件包" - dnf remove -y farstream02-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载farstream02-devel软件包失败" - fi - - LOG_INFO "测试完成:Test pkg-config file for farstream02" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_uninstall.sh b/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_uninstall.sh deleted file mode 100644 index fa69d5886c3..00000000000 --- a/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_uninstall.sh +++ /dev/null @@ -1,95 +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-27 -# @License : Mulan PSL v2 -# @Desc : Test uninstallation of farstream02-devel package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查farstream02-devel软件包是否已安装 - LOG_INFO "检查farstream02-devel软件包是否已安装" - rpm -q farstream02-devel > /dev/null 2>&1 - pkg_installed=$? - - # 如果已安装,记录状态并在脚本结束后保持安装 - if [ $pkg_installed -eq 0 ]; then - LOG_INFO "farstream02-devel软件包已安装,脚本结束后将保持安装状态" - initial_state="installed" - else - LOG_INFO "farstream02-devel软件包未安装,将进行安装测试" - initial_state="not_installed" - fi - - # 检查yum源中是否存在farstream02-devel软件包 - LOG_INFO "检查yum源中是否存在farstream02-devel软件包" - dnf list available farstream02-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到farstream02-devel软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到farstream02-devel软件包" - exit 255 - fi - - # 如果未安装,则安装软件包作为测试步骤 - if [ $initial_state = "not_installed" ]; then - LOG_INFO "安装farstream02-devel软件包" - dnf install -y farstream02-devel - CHECK_RESULT $? 0 0 "安装farstream02-devel软件包失败" - LOG_INFO "farstream02-devel软件包安装成功" - fi - - # 验证软件包是否已正确安装 - LOG_INFO "验证farstream02-devel软件包是否已正确安装" - rpm -q farstream02-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "farstream02-devel软件包未正确安装" - - # 测试卸载farstream02-devel软件包 - LOG_INFO "测试卸载farstream02-devel软件包" - dnf remove -y farstream02-devel - CHECK_RESULT $? 0 0 "卸载farstream02-devel软件包失败" - LOG_INFO "farstream02-devel软件包卸载成功" - - # 验证软件包是否已正确卸载 - LOG_INFO "验证farstream02-devel软件包是否已正确卸载" - rpm -q farstream02-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 1 "farstream02-devel软件包未正确卸载" - - # 环境恢复:如果初始状态是未安装,则保持未安装状态;如果初始状态是已安装,则重新安装 - LOG_INFO "恢复环境到初始状态" - if [ $initial_state = "not_installed" ]; then - LOG_INFO "初始状态为未安装,无需重新安装" - else - LOG_INFO "重新安装farstream02-devel软件包以恢复到初始状态" - dnf install -y farstream02-devel - CHECK_RESULT $? 0 0 "重新安装farstream02-devel软件包失败" - LOG_INFO "farstream02-devel软件包重新安装成功" - fi - - # 最终验证环境状态 - LOG_INFO "最终验证环境状态" - rpm -q farstream02-devel > /dev/null 2>&1 - if [ $initial_state = "installed" ]; then - CHECK_RESULT $? 0 0 "环境未恢复到初始安装状态" - LOG_INFO "环境已恢复到初始安装状态" - else - CHECK_RESULT $? 0 1 "环境未恢复到初始未安装状态" - LOG_INFO "环境已恢复到初始未安装状态" - fi - - LOG_INFO "farstream02-devel软件包卸载功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_version.sh b/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_version.sh deleted file mode 100644 index 7495eebed47..00000000000 --- a/testcases/function_test/pkg_test/farstream02/farstream02-devel/test_farstream02-devel_function_version.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-27 -# @License : Mulan PSL v2 -# @Desc : Test version query of farstream02-devel package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试 farstream02-devel 软件包版本查询功能 - - LOG_INFO "开始测试 farstream02-devel 软件包版本查询功能" - - # 检查当前环境是否已安装 farstream02-devel 软件包 - LOG_INFO "检查 farstream02-devel 软件包是否已安装" - if dnf list installed farstream02-devel > /dev/null 2>&1; then - LOG_INFO "farstream02-devel 软件包已安装" - ALREADY_INSTALLED=1 - else - LOG_INFO "farstream02-devel 软件包未安装" - ALREADY_INSTALLED=0 - fi - - # 检查 yum 源中是否有 farstream02-devel 软件包 - LOG_INFO "检查 yum 源中是否有 farstream02-devel 软件包" - if ! dnf list available farstream02-devel > /dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 farstream02-devel 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "开始安装 farstream02-devel 软件包" - dnf install -y farstream02-devel - CHECK_RESULT $? 0 0 "安装 farstream02-devel 软件包失败" - LOG_INFO "farstream02-devel 软件包安装成功" - fi - - # 测试 farstream02-devel 软件包版本查询 - LOG_INFO "测试 farstream02-devel 软件包版本查询" - rpm -q farstream02-devel --queryformat "%{VERSION}-%{RELEASE}\n" - CHECK_RESULT $? 0 0 "查询 farstream02-devel 软件包版本失败" - - # 测试 farstream02-devel 软件包提供的库文件版本 - LOG_INFO "测试 farstream02-devel 软件包提供的库文件版本" - if [ -d /usr/include/farstream-0.2 ]; then - LOG_INFO "检查 farstream02-devel 提供的头文件目录" - ls -la /usr/include/farstream-0.2/ - CHECK_RESULT $? 0 0 "检查 farstream02-devel 头文件目录失败" - else - LOG_ERROR "未找到 farstream02-devel 头文件目录" - exit 1 - fi - - # 测试 pkg-config 信息 - LOG_INFO "测试 pkg-config 信息" - pkg-config --modversion farstream-0.2 - CHECK_RESULT $? 0 0 "查询 farstream-0.2 pkg-config 信息失败" - - # 清理环境 - LOG_INFO "清理测试环境" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载 farstream02-devel 软件包" - dnf remove -y farstream02-devel - CHECK_RESULT $? 0 0 "卸载 farstream02-devel 软件包失败" - LOG_INFO "farstream02-devel 软件包卸载成功" - else - LOG_INFO "保持 farstream02-devel 软件包安装状态" - fi - - LOG_INFO "farstream02-devel 软件包版本查询功能测试完成" -} - -main "$@" \ No newline at end of file From 2421a64ce46f2621cc806ba46d890dfc9d687dca Mon Sep 17 00:00:00 2001 From: honghua Date: Wed, 22 Apr 2026 05:17:27 +0800 Subject: [PATCH 07/12] update testcase for testsuite texlive-pdftricks2-doc --- .../texlive-pdftricks2-doc.json | 8 - .../test_texlive-pdftricks2-doc_content.sh | 91 ----------- .../test_texlive-pdftricks2-doc_example.sh | 141 ------------------ 3 files changed, 240 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-r/texlive-pdftricks2-doc/test_texlive-pdftricks2-doc_content.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-r/texlive-pdftricks2-doc/test_texlive-pdftricks2-doc_example.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-r/texlive-pdftricks2-doc.json b/suite2cases/function_test/pkg_test/texlive-split-r/texlive-pdftricks2-doc.json index c23ff1d230b..9e1ed963be6 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-r/texlive-pdftricks2-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-r/texlive-pdftricks2-doc.json @@ -14,14 +14,6 @@ { "name": "test_texlive-pdftricks2-doc_remove", "desc": "测试 texlive-pdftricks2-doc 软件包的卸载功能,验证卸载过程是否成功。" - }, - { - "name": "test_texlive-pdftricks2-doc_content", - "desc": "检查软件包文档的主要文件(如README、手册)是否存在且内容完整。" - }, - { - "name": "test_texlive-pdftricks2-doc_example", - "desc": "验证软件包文档中包含的示例文件或代码片段是否可访问。" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-r/texlive-pdftricks2-doc/test_texlive-pdftricks2-doc_content.sh b/testcases/function_test/pkg_test/texlive-split-r/texlive-pdftricks2-doc/test_texlive-pdftricks2-doc_content.sh deleted file mode 100644 index 6d5ea1b4336..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-r/texlive-pdftricks2-doc/test_texlive-pdftricks2-doc_content.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-02 -# @License : Mulan PSL v2 -# @Desc : 检查软件包文档的主要文件(如README、手册)是否存在且内容完整。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义变量 - PACKAGE_NAME="texlive-pdftricks2-doc" - LOG_INFO "开始测试:检查软件包文档的主要文件是否存在且内容完整" - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - dnf list available ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 不在yum源中" - exit 255 - fi - - # 步骤2:检查是否已安装软件包 - LOG_INFO "步骤2:检查是否已安装软件包" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,测试完成后将保持安装状态" - INSTALLED="true" - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,将进行安装测试" - INSTALLED="false" - fi - - # 步骤3:安装软件包(如果未安装) - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "步骤3:安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4:获取软件包文档文件列表 - LOG_INFO "步骤4:获取软件包文档文件列表" - DOC_FILES=$(rpm -ql ${PACKAGE_NAME} | grep -E "README|manual|手册|doc" | head -5) - if [ -z "${DOC_FILES}" ]; then - LOG_ERROR "未找到软件包文档文件" - exit 1 - fi - - # 步骤5:检查文档文件是否存在且内容完整 - LOG_INFO "步骤5:检查文档文件是否存在且内容完整" - for file in ${DOC_FILES}; do - LOG_INFO "检查文件: ${file}" - if [ ! -f "${file}" ]; then - LOG_ERROR "文件 ${file} 不存在" - exit 1 - fi - if [ ! -s "${file}" ]; then - LOG_ERROR "文件 ${file} 内容为空" - exit 1 - fi - # 检查文件是否包含文本内容(非二进制文件) - file "${file}" | grep -q "text" - if [ $? -ne 0 ]; then - LOG_ERROR "文件 ${file} 不是文本文件或内容格式异常" - exit 1 - fi - done - - # 步骤6:清理环境(如果测试前未安装) - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "步骤6:卸载软件包 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成:软件包文档的主要文件存在且内容完整" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-r/texlive-pdftricks2-doc/test_texlive-pdftricks2-doc_example.sh b/testcases/function_test/pkg_test/texlive-split-r/texlive-pdftricks2-doc/test_texlive-pdftricks2-doc_example.sh deleted file mode 100644 index 32a64bb3e8e..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-r/texlive-pdftricks2-doc/test_texlive-pdftricks2-doc_example.sh +++ /dev/null @@ -1,141 +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 : 验证软件包文档中包含的示例文件或代码片段是否可访问。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-pdftricks2-doc软件包文档示例文件可访问性" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查软件包texlive-pdftricks2-doc是否在yum源中" - dnf list available texlive-pdftricks2-doc &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包texlive-pdftricks2-doc不在yum源中" - exit 255 - fi - - # 检查当前是否已安装 - LOG_INFO "检查软件包texlive-pdftricks2-doc是否已安装" - rpm -q texlive-pdftricks2-doc &>/dev/null - PACKAGE_INSTALLED=$? - - if [ $PACKAGE_INSTALLED -eq 0 ]; then - LOG_INFO "软件包texlive-pdftricks2-doc已安装,测试后保持安装状态" - NEED_UNINSTALL=0 - else - LOG_INFO "软件包texlive-pdftricks2-doc未安装,将在测试后卸载" - NEED_UNINSTALL=1 - - # 安装软件包 - LOG_INFO "安装软件包texlive-pdftricks2-doc" - dnf install -y texlive-pdftricks2-doc - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 查找文档目录 - LOG_INFO "查找texlive-pdftricks2-doc文档目录" - DOC_DIR=$(rpm -ql texlive-pdftricks2-doc | grep -E "/doc/|/examples/" | head -1) - if [ -z "$DOC_DIR" ]; then - DOC_DIR=$(rpm -ql texlive-pdftricks2-doc | grep -E "\.tex$|\.pdf$" | head -1) - fi - - if [ -z "$DOC_DIR" ]; then - LOG_ERROR "未找到texlive-pdftricks2-doc文档目录" - if [ $NEED_UNINSTALL -eq 1 ]; then - dnf remove -y texlive-pdftricks2-doc - fi - exit 1 - fi - - LOG_INFO "文档目录为: $DOC_DIR" - - # 检查文档目录是否存在 - LOG_INFO "检查文档目录是否存在" - if [ ! -d "$DOC_DIR" ]; then - LOG_ERROR "文档目录不存在: $DOC_DIR" - if [ $NEED_UNINSTALL -eq 1 ]; then - dnf remove -y texlive-pdftricks2-doc - fi - exit 1 - fi - - # 查找示例文件 - LOG_INFO "查找示例文件" - EXAMPLE_FILES=$(find "$DOC_DIR" -name "*.tex" -o -name "*.pdf" -o -name "example*" 2>/dev/null | head -5) - - if [ -z "$EXAMPLE_FILES" ]; then - LOG_ERROR "未找到示例文件" - if [ $NEED_UNINSTALL -eq 1 ]; then - dnf remove -y texlive-pdftricks2-doc - fi - exit 1 - fi - - # 测试示例文件可访问性 - LOG_INFO "测试示例文件可访问性" - for file in $EXAMPLE_FILES; do - LOG_INFO "检查文件: $file" - - # 检查文件是否存在 - if [ ! -e "$file" ]; then - LOG_ERROR "文件不存在: $file" - if [ $NEED_UNINSTALL -eq 1 ]; then - dnf remove -y texlive-pdftricks2-doc - fi - exit 1 - fi - - # 检查文件是否可读 - if [ ! -r "$file" ]; then - LOG_ERROR "文件不可读: $file" - if [ $NEED_UNINSTALL -eq 1 ]; then - dnf remove -y texlive-pdftricks2-doc - fi - exit 1 - fi - - # 检查文件大小 - file_size=$(stat -c%s "$file" 2>/dev/null || stat -f%z "$file" 2>/dev/null) - if [ $? -eq 0 ] && [ "$file_size" -gt 0 ]; then - LOG_INFO "文件 $file 大小: ${file_size}字节,可正常访问" - else - LOG_ERROR "文件 $file 大小为0或无法获取大小" - if [ $NEED_UNINSTALL -eq 1 ]; then - dnf remove -y texlive-pdftricks2-doc - fi - exit 1 - fi - done - - LOG_INFO "所有示例文件均可正常访问" - - # 清理环境 - if [ $NEED_UNINSTALL -eq 1 ]; then - LOG_INFO "卸载软件包texlive-pdftricks2-doc" - dnf remove -y texlive-pdftricks2-doc - CHECK_RESULT $? 0 0 "卸载软件包失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file From f4a920288e5e5ad081f4e4b25c50562a7e9b6c69 Mon Sep 17 00:00:00 2001 From: honghua Date: Wed, 22 Apr 2026 05:17:39 +0800 Subject: [PATCH 08/12] update testcase for testsuite texlive-math-into-latex-4-doc --- .../texlive-math-into-latex-4-doc.json | 16 --- ...ive-math-into-latex-4-doc_function_math.sh | 106 ------------------ 2 files changed, 122 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-o/texlive-math-into-latex-4-doc/test_texlive-math-into-latex-4-doc_function_math.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-o/texlive-math-into-latex-4-doc.json b/suite2cases/function_test/pkg_test/texlive-split-o/texlive-math-into-latex-4-doc.json index d503acf8652..834a00ddb2e 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-o/texlive-math-into-latex-4-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-o/texlive-math-into-latex-4-doc.json @@ -2,14 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-o/texlive-math-into-latex-4-doc", "machine num": 1, "cases": [ - { - "name": "test_texlive-math-into-latex-4-doc_function_math", - "desc": "Test math conversion" - }, - { - "name": "test_texlive-math-into-latex-4-doc_function_install", - "desc": "Test package installation" - }, { "name": "test_texlive-math-into-latex-4-doc_function_remove", "desc": "Test package removal" @@ -17,14 +9,6 @@ { "name": "test_texlive-math-into-latex-4-doc_function_check", "desc": "Test package existence" - }, - { - "name": "test_texlive-math-into-latex-4-doc_function_doc_path", - "desc": "Test documentation path" - }, - { - "name": "test_texlive-math-into-latex-4-doc_function_list_files", - "desc": "Test list package files" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-o/texlive-math-into-latex-4-doc/test_texlive-math-into-latex-4-doc_function_math.sh b/testcases/function_test/pkg_test/texlive-split-o/texlive-math-into-latex-4-doc/test_texlive-math-into-latex-4-doc_function_math.sh deleted file mode 100644 index 6d365150d27..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-o/texlive-math-into-latex-4-doc/test_texlive-math-into-latex-4-doc_function_math.sh +++ /dev/null @@ -1,106 +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 math conversion -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试:Test math conversion" - - # 检查是否已安装texlive-math-into-latex-4-doc - LOG_INFO "检查texlive-math-into-latex-4-doc是否已安装" - if dnf list installed texlive-math-into-latex-4-doc &> /dev/null; then - LOG_INFO "texlive-math-into-latex-4-doc已安装,脚本结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-math-into-latex-4-doc未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-math-into-latex-4-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-math-into-latex-4-doc软件包" - if ! dnf list available texlive-math-into-latex-4-doc &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-math-into-latex-4-doc软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装texlive-math-into-latex-4-doc" - dnf install -y texlive-math-into-latex-4-doc - CHECK_RESULT $? 0 0 "安装texlive-math-into-latex-4-doc失败" - fi - - # 测试math转换功能 - LOG_INFO "测试math转换功能" - echo "\sqrt{x^2 + y^2}" > test_math.tex - pdflatex test_math.tex &> /dev/null - CHECK_RESULT $? 0 0 "math转换失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_math.tex test_math.pdf test_math.log test_math.aux - - # 如果脚本开始时未安装,则在结束时卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-math### Continuing from where it was cut off due to length: - - - LOG_INFO "卸载texlive-math-into-latex-## Continuing from where it was cut off due to length: - - - - LOG_INFO "卸载textive-match-info-laTeX-## Continuing from where it was cut off due to length: - - - LOG_INFО «Удаление textive-match-info-lаTeX-### Final corrected and complete script: - - - LOG_INFO «Начало теста: Test math conversion» - - # Проверка установлен ли textive-mаth-intо-lаtех-## Final corrected and complete script: - - - LOG_INFO "Starting test: Test math conversion" - - # Check if textive-mаth-intо-lаtех-## Final corrected and complete script: - - - LOG_INFO "Starting test: Test math conversion" - - # Check if texlive-match-info-laTeX-## Final corrected and complete script: - - - LOG_INFO «Starting test: Test math conversion» - ### The correct and complete script is as follows: - - - LOG_INFO "Starting test: Test math conversion" - - # Check if texlive-math-into-latex-# The correct and complete script is as follows: - - - LOG_INFO "[INFO] Starting test: Test math conversion" - - # Check if texlivede-mathe-intoe-# The correct and complete script is as follows (without any placeholders or errors): - - -} - -main "$@" \ No newline at end of file From 34ce16418162cb32807feca76d57fdd142c5e782 Mon Sep 17 00:00:00 2001 From: honghua Date: Wed, 22 Apr 2026 05:19:17 +0800 Subject: [PATCH 09/12] update testcase for testsuite texlive-syllogism --- .../texlive-split-v/texlive-syllogism.json | 8 -- .../test_texlive-syllogism_package_check.sh | 116 ------------------ .../test_texlive-syllogism_usage.sh | 76 ------------ 3 files changed, 200 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-v/texlive-syllogism/test_texlive-syllogism_package_check.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-v/texlive-syllogism/test_texlive-syllogism_usage.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-v/texlive-syllogism.json b/suite2cases/function_test/pkg_test/texlive-split-v/texlive-syllogism.json index da64e0a5ecc..8b370e1dc51 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-v/texlive-syllogism.json +++ b/suite2cases/function_test/pkg_test/texlive-split-v/texlive-syllogism.json @@ -10,14 +10,6 @@ { "name": "test_texlive-syllogism_remove", "desc": "测试 texlive-syllogism 软件包的卸载功能,验证是否能够成功卸载。" - }, - { - "name": "test_texlive-syllogism_usage", - "desc": "测试 texlive-syllogism 软件包的基本用法,验证能否正确生成三段论逻辑图表。" - }, - { - "name": "test_texlive-syllogism_package_check", - "desc": "检查 texlive-syllogism 软件包是否已正确安装且其宏包文件可用。" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-v/texlive-syllogism/test_texlive-syllogism_package_check.sh b/testcases/function_test/pkg_test/texlive-split-v/texlive-syllogism/test_texlive-syllogism_package_check.sh deleted file mode 100644 index 94fb88086f2..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-v/texlive-syllogism/test_texlive-syllogism_package_check.sh +++ /dev/null @@ -1,116 +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-03 -# @License : Mulan PSL v2 -# @Desc : 检查 texlive-syllogism 软件包是否已正确安装且其宏包文件可用。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-syllogism软件包是否已正确安装且其宏包文件可用 - - LOG_INFO "开始检查texlive-syllogism软件包" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在texlive-syllogism软件包" - dnf list available texlive-syllogism &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-syllogism软件包" - exit 255 - fi - - # 检查当前是否已安装 - LOG_INFO "检查当前是否已安装texlive-syllogism" - rpm -q texlive-syllogism &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-syllogism已安装,测试完成后将保持安装状态" - already_installed=1 - else - LOG_INFO "texlive-syllogism未安装,将进行安装测试" - already_installed=0 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texlive-syllogism软件包" - dnf install -y texlive-syllogism - CHECK_RESULT $? 0 0 "安装texlive-syllogism失败" - fi - - # 验证软件包是否已正确安装 - LOG_INFO "验证texlive-syllogism软件包是否正确安装" - rpm -q texlive-syllogism - CHECK_RESULT $? 0 0 "texlive-syllogism软件包未正确安装" - - # 检查宏包文件是否可用 - LOG_INFO "检查texlive-syllogism宏包文件" - # 查找syllogism.sty文件 - kpsewhich syllogism.sty &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "找到syllogism.sty宏包文件" - # 验证文件内容 - kpsewhich syllogism.sty | xargs file | grep -q "text" - CHECK_RESULT $? 0 0 "syllogism.sty文件格式不正确" - - # 检查文件是否可读 - kpsewhich syllogism.sty | xargs test -r - CHECK_RESULT $? 0 0 "syllogism.sty文件不可读" - else - LOG_ERROR "未找到syllogism.sty宏包文件" - CHECK_RESULT 1 0 0 "texlive-syllogism宏包文件不可用" - fi - - # 测试简单的LaTeX文档是否能编译(使用syllogism宏包) - LOG_INFO "测试使用syllogism宏包的简单LaTeX文档" - TEST_FILE="/tmp/test_syllogism_$$.tex" - cat > $TEST_FILE << "EOF" - \documentclass{article} - \usepackage{syllogism} - \begin{document} - 测试文档。 - \end{document} - EOF - - # 尝试编译(不生成PDF,只检查语法) - pdflatex -draftmode -interaction=nonstopmode $TEST_FILE &>/dev/null - CHECK_RESULT $? 0 0 "使用syllogism宏包的LaTeX文档编译失败" - - # 清理测试文件 - rm -f $TEST_FILE ${TEST_FILE%.tex}.aux ${TEST_FILE%.tex}.log ${TEST_FILE%.tex}.out - - # 环境恢复 - LOG_INFO "开始环境恢复" - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载测试安装的texlive-syllogism软件包" - dnf remove -y texlive-syllogism - CHECK_RESULT $? 0 0 "卸载texlive-syllogism失败" - - # 验证是否已卸载 - rpm -q texlive-syllogism &>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "texlive-syllogism卸载不彻底" - CHECK_RESULT 1 0 0 "环境恢复失败" - else - LOG_INFO "texlive-syllogism已成功卸载" - fi - else - LOG_INFO "保持texlive-syllogism的安装状态" - fi - - LOG_INFO "texlive-syllogism软件包检查完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-v/texlive-syllogism/test_texlive-syllogism_usage.sh b/testcases/function_test/pkg_test/texlive-split-v/texlive-syllogism/test_texlive-syllogism_usage.sh deleted file mode 100644 index 750bdee302e..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-v/texlive-syllogism/test_texlive-syllogism_usage.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 : 2026-04-03 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-syllogism 软件包的基本用法,验证能否正确生成三段论逻辑图表。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "1. 检查系统中是否已安装 texlive-syllogism 软件包" - if dnf list installed texlive-syllogism &>/dev/null; then - LOG_INFO "texlive-syllogism 已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texlive-syllogism 未安装,将在测试步骤中安装,并在脚本结束前卸载" - INSTALLED_BEFORE=false - fi - - LOG_INFO "2. 检查 yum 源中是否存在 texlive-syllogism 软件包" - if ! dnf list available texlive-syllogism &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-syllogism 软件包" - exit 255 - fi - - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "3. 安装 texlive-syllogism 软件包" - dnf install -y texlive-syllogism - CHECK_RESULT $? 0 0 "安装 texlive-syllogism 失败" - fi - - LOG_INFO "4. 验证 texlive-syllogism 基本命令是否存在" - if ! command -v syllogism &>/dev/null; then - LOG_ERROR "syllogism 命令未找到" - exit 255 - fi - - LOG_INFO "5. 测试 syllogism 命令的基本用法,生成三段论逻辑图表" - syllogism --help - CHECK_RESULT $? 0 0 "syllogism --help 命令执行失败" - - LOG_INFO "6. 尝试使用 syllogism 生成一个简单的三段论图表" - syllogism --output test_syllogism.pdf "All men are mortal. Socrates is a man. Therefore, Socrates is mortal." - CHECK_RESULT $? 0 0 "生成三段论逻辑图表失败" - - LOG_INFO "7. 检查生成的图表文件是否存在" - if [ -f test_syllogism.pdf ]; then - LOG_INFO "成功生成三段论逻辑图表文件: test_syllogism.pdf" - rm -f test_syllogism.pdf - else - LOG_ERROR "未找到生成的图表文件 test_syllogism.pdf" - exit 1 - fi - - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "8. 卸载 texlive-syllogism 软件包,恢复环境" - dnf remove -y texlive-syllogism - CHECK_RESULT $? 0 0 "卸载 texlive-syllogism 失败" - fi - - LOG_INFO "9. 测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file From e38feb96651f4df2f068f70b7ed2d3121b10d215 Mon Sep 17 00:00:00 2001 From: honghua Date: Wed, 22 Apr 2026 05:20:13 +0800 Subject: [PATCH 10/12] update testcase for testsuite texlive-infwarerr --- .../texlive-split-y/texlive-infwarerr.json | 10 --- .../test_texlive-infwarerr_function_error.sh | 65 ------------------- 2 files changed, 75 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-y/texlive-infwarerr.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-y/texlive-infwarerr/test_texlive-infwarerr_function_error.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-infwarerr.json b/suite2cases/function_test/pkg_test/texlive-split-y/texlive-infwarerr.json deleted file mode 100644 index 4939e21358a..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-infwarerr.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-y/texlive-infwarerr", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-infwarerr_function_error", - "desc": "Test error handling functionality" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-infwarerr/test_texlive-infwarerr_function_error.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-infwarerr/test_texlive-infwarerr_function_error.sh deleted file mode 100644 index 9769608f165..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-infwarerr/test_texlive-infwarerr_function_error.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-11-26 -# @License : Mulan PSL v2 -# @Desc : Test error handling functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-infwarerr - LOG_INFO "检查是否已安装texlive-infwarerr软件包" - dnf list installed texlive-infwarerr > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-infwarerr已安装,脚本结束时保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-infwarerr未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-infwarerr软件包 - LOG_INFO "检查yum源中是否有texlive-infwarerr软件包" - dnf list available texlive-infwarerr > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-infwarerr软件包" - - # 安装texlive-infwarerr软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-infwarerr软件包" - dnf install -y texlive-infwarerr - CHECK_RESULT $? 0 1 "安装texlive-infwarerr软件包失败" - fi - - # 测试错误处理功能 - LOG_INFO "测试错误处理功能:执行不支持的命令参数" - tex --invalid-param > /dev/null 2>&1 - CHECK_RESULT $? 255 255 "命令参数不支持但未正确退出" - - LOG_INFO "测试错误处理功能:执行不存在的命令" - nonexistent-command > /dev/null 2>&1 - CHECK_RESULT $? 127 127 "执行不存在的命令但未正确退出" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-infwarerr软件包" - dnf remove -y texlive-infwarerr - CHECK_RESULT $? 0 1 "卸载texlive-infwarerr软件包失败" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file From d79f04151938ab6db6d95080b642c26ff5d1a51c Mon Sep 17 00:00:00 2001 From: honghua Date: Wed, 22 Apr 2026 05:23:13 +0800 Subject: [PATCH 11/12] update testcase for testsuite ant-apache-bsf --- .../pkg_test/ant/ant-apache-bsf.json | 16 -- ...st_ant-apache-bsf_function_basic_script.sh | 72 --------- .../test_ant-apache-bsf_function_config.sh | 64 -------- ...est_ant-apache-bsf_function_config_file.sh | 143 ------------------ ..._ant-apache-bsf_function_verify_install.sh | 68 --------- 5 files changed, 363 deletions(-) delete mode 100644 testcases/function_test/pkg_test/ant/ant-apache-bsf/test_ant-apache-bsf_function_basic_script.sh delete mode 100644 testcases/function_test/pkg_test/ant/ant-apache-bsf/test_ant-apache-bsf_function_config.sh delete mode 100644 testcases/function_test/pkg_test/ant/ant-apache-bsf/test_ant-apache-bsf_function_config_file.sh delete mode 100644 testcases/function_test/pkg_test/ant/ant-apache-bsf/test_ant-apache-bsf_function_verify_install.sh diff --git a/suite2cases/function_test/pkg_test/ant/ant-apache-bsf.json b/suite2cases/function_test/pkg_test/ant/ant-apache-bsf.json index f06aba1e87d..15dd952d5a3 100644 --- a/suite2cases/function_test/pkg_test/ant/ant-apache-bsf.json +++ b/suite2cases/function_test/pkg_test/ant/ant-apache-bsf.json @@ -6,10 +6,6 @@ "name": "test_ant-apache-bsf_function_script", "desc": "Test script execution functionality" }, - { - "name": "test_ant-apache-bsf_function_config", - "desc": "Test configuration loading functionality" - }, { "name": "test_ant-apache-bsf_function_install", "desc": "Test package installation" @@ -17,18 +13,6 @@ { "name": "test_ant-apache-bsf_function_uninstall", "desc": "Test package removal" - }, - { - "name": "test_ant-apache-bsf_function_verify_install", - "desc": "Test installation verification" - }, - { - "name": "test_ant-apache-bsf_function_basic_script", - "desc": "Test basic script execution" - }, - { - "name": "test_ant-apache-bsf_function_config_file", - "desc": "Test configuration file usage" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ant/ant-apache-bsf/test_ant-apache-bsf_function_basic_script.sh b/testcases/function_test/pkg_test/ant/ant-apache-bsf/test_ant-apache-bsf_function_basic_script.sh deleted file mode 100644 index 7ed49bd37e1..00000000000 --- a/testcases/function_test/pkg_test/ant/ant-apache-bsf/test_ant-apache-bsf_function_basic_script.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : Test basic script execution -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test basic script execution" - - LOG_INFO "步骤1:检查ant-apache-bsf软件包是否在yum源中" - dnf list available ant-apache-bsf > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到ant-apache-bsf软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查系统是否已安装ant-apache-bsf" - rpm -q ant-apache-bsf > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "ant-apache-bsf已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "ant-apache-bsf未安装,将在测试过程中安装" - INSTALLED=false - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装ant-apache-bsf软件包" - dnf install -y ant-apache-bsf - CHECK_RESULT $? 0 0 "安装ant-apache-bsf失败" - fi - - LOG_INFO "步骤4:测试基本脚本执行功能" - bsh --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "bsh命令执行失败" - - LOG_INFO "步骤5:测试bsh命令参数支持" - bsh --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "bsh命令不支持--help参数" - - LOG_INFO "步骤6:执行简单BeanShell脚本" - echo "print("Hello BeanShell");" > /tmp/test.bsh - bsh /tmp/test.bsh > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "BeanShell脚本执行失败" - rm -f /tmp/test.bsh - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤7:卸载ant-apache-bsf软件包" - dnf remove -y ant-apache-bsf - CHECK_RESULT $? 0 0 "卸载ant-apache-bsf失败" - fi - - LOG_INFO "步骤8:环境清理完成" - LOG_INFO "测试结束:Test basic script execution" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ant/ant-apache-bsf/test_ant-apache-bsf_function_config.sh b/testcases/function_test/pkg_test/ant/ant-apache-bsf/test_ant-apache-bsf_function_config.sh deleted file mode 100644 index a020abe1801..00000000000 --- a/testcases/function_test/pkg_test/ant/ant-apache-bsf/test_ant-apache-bsf_function_config.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : Test configuration loading functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装ant-apache-bsf软件包 - LOG_INFO "检查ant-apache-bsf是否已安装" - if dnf list installed ant-apache-bsf &>/dev/null; then - LOG_INFO "ant-apache-bsf已安装,测试结束后将保持安装状态" - installed=true - else - LOG_INFO "ant-apache-bsf未安装,测试结束后将卸载" - installed=false - fi - - # 检查yum源中是否存在ant-apache-bsf软件包 - LOG_INFO "检查yum源中是否存在ant-apache-bsf软件包" - if ! dnf list available ant-apache-bsf &>/dev/null; then - LOG_ERROR "yum源中未找到ant-apache-bsf软件包" - exit 255 - fi - - # 若未安装则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装ant-apache-bsf软件包" - dnf install -y ant-apache-bsf - CHECK_RESULT $? 0 0 "安装ant-apache-bsf失败" - fi - - # 测试配置加载功能 - LOG_INFO "测试配置加载功能" - ant -f /path/to/build.xml load-configuration - CHECK_RESULT $? 0 0 "配置加载失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载ant-apache-bsf软件包" - dnf remove -y ant-apache-bsf - CHECK_RESULT $? 0 0 "卸载ant-apache-bsf失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ant/ant-apache-bsf/test_ant-apache-bsf_function_config_file.sh b/testcases/function_test/pkg_test/ant/ant-apache-bsf/test_ant-apache-bsf_function_config_file.sh deleted file mode 100644 index e7b33b30c86..00000000000 --- a/testcases/function_test/pkg_test/ant/ant-apache-bsf/test_ant-apache-bsf_function_config_file.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : Test configuration file usage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - # 测试配置文件的用法 - LOG_INFO "开始测试配置文件用法" - - # 检查环境是否已安装ant-apache-bsf - LOG_INFO "检查ant-apache-bsf是否已安装" - if dnf list installed ant-apache-bsf &>/dev/null; then - LOG_INFO "检测到ant-apache-bsf已安装,测试结束后保持安装状态" - ALREADY_INSTALLED=true - else - LOG_INFO "ant-apache-bsf未安装,将在测试过程中安装" - ALREADY_INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有ant-apache-bsf软件包" - if ! dnf list available ant-apache-bsf &>/dev/null; then - LOG_ERROR "yum源中未找到ant-apache-bsf软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$ALREADY_INSTALLED" = "false" ]; then - LOG_INFO "安装ant-apache-bsf软件包" - dnf install -y ant-apache-bsf - CHECK_RESULT $? 0 0 "安装ant-apache-bsf失败" - fi - - # 测试配置文件是否存在 - LOG_INFO "检查配置文件是否存在" - if [ -f /etc/ant-apache-bsf/bsf.conf ]; then - LOG_INFO "找到配置文件: /etc/ant-apache-bsf/bsf.conf" - CONFIG_FILE="/etc/ant-apache-bsf/bsf.conf" - elif [ -f /usr/share/ant-apache-bsf/conf/bsf.conf ]; then - LOG_INFO "找到配置文件: /usr/share/ant-apache-bsf/conf/bsf.conf" - CONFIG_FILE="/usr/share/ant-apache-bsf/conf/bsf.conf" - else - LOG_INFO "搜索ant-apache-bsf配置文件" - CONFIG_FILE=$(find /etc /usr -name "*bsf*.conf" -type f 2>/dev/null | head -1) - if [ -n "$CONFIG_FILE" ]; then - LOG_INFO "找到配置文件: $CONFIG_FILE" - else - LOG_ERROR "未找到ant-apache-bsf配置文件" - exit 1 - fi - fi - - # 检查配置文件是否可读 - LOG_INFO "检查配置文件是否可读" - if [ -r "$CONFIG_FILE" ]; then - LOG_INFO "配置文件可读" - else - LOG_ERROR "配置文件不可读: $CONFIG_FILE" - exit 1 - fi - - # 检查配置文件语法 - LOG_INFO "检查配置文件语法" - if command -v bsftest &>/dev/null; then - bsftest -c "$CONFIG_FILE" - CHECK_RESULT $? 0 0 "配置文件语法检查失败" - LOG_INFO "配置文件语法检查通过" - else - LOG_INFO "未找到bsftest命令,跳过语法检查" - fi - - # 测试使用配置文件运行命令 - LOG_INFO "测试使用配置文件运行命令" - if command -v bsf &>/dev/null; then - # 检查bsf命令是否支持-c参数 - LOG_INFO "检查bsf命令是否支持-c参数" - if bsf --help 2>&1 | grep -q "\-c"; then - LOG_INFO "bsf命令支持-c参数" - # 测试使用配置文件 - bsf -c "$CONFIG_FILE" --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用配置文件执行命令失败" - LOG_INFO "使用配置文件执行命令成功" - else - LOG_ERROR "bsf命令不支持-c参数" - exit 255 - fi - else - LOG_INFO "未找到bsf命令,跳过命令测试" - fi - - # 测试配置文件内容 - LOG_INFO "检查配置文件基本内容" - if [ -s "$CONFIG_FILE" ]; then - LOG_INFO "配置文件非空" - # 检查是否有基本配置项 - if grep -q "^[[:space:]]*[^#]" "$CONFIG_FILE"; then - LOG_INFO "配置文件包含有效配置项" - # 显示前几行配置 - LOG_INFO "配置文件前5行内容:" - head -5 "$CONFIG_FILE" | while IFS= read -r line; do - LOG_INFO " $line" - done - else - LOG_INFO "配置文件可能只包含注释或为空行" - fi - else - LOG_ERROR "配置文件为空" - exit 1 - fi - - # 清理环境 - LOG_INFO "清理测试环境" - if [ "$ALREADY_INSTALLED" = "false" ]; then - LOG_INFO "卸载测试安装的ant-apache-bsf软件包" - dnf remove -y ant-apache-bsf - CHECK_RESULT $? 0 0 "卸载ant-apache-bsf失败" - LOG_INFO "ant-apache-bsf已卸载" - else - LOG_INFO "保持ant-apache-bsf安装状态" - fi - - LOG_INFO "配置文件用法测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ant/ant-apache-bsf/test_ant-apache-bsf_function_verify_install.sh b/testcases/function_test/pkg_test/ant/ant-apache-bsf/test_ant-apache-bsf_function_verify_install.sh deleted file mode 100644 index a9bf8c68030..00000000000 --- a/testcases/function_test/pkg_test/ant/ant-apache-bsf/test_ant-apache-bsf_function_verify_install.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 : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : Test installation verification -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始执行测试:Test installation verification" - - LOG_INFO "步骤1: 检查测试环境是否已安装ant-apache-bsf软件包" - if dnf list installed ant-apache-bsf &>/dev/null; then - LOG_INFO "环境已安装ant-apache-bsf软件包,脚本结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "环境未安装ant-apache-bsf软件包,将在测试过程中安装,并在测试结束后卸载" - INSTALLED_BEFORE_TEST=false - fi - - LOG_INFO "步骤2: 检查yum源中是否存在ant-apache-bsf软件包" - if ! dnf list available ant-apache-bsf &>/dev/null; then - LOG_ERROR "yum源中不存在ant-apache-bsf软件包" - exit 255 - fi - - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤3: 安装ant-apache-bsf软件包" - dnf install -y ant-apache-bsf - CHECK_RESULT $? 0 0 "安装ant-apache-bsf软件包失败" - fi - - LOG_INFO "步骤4: 验证ant-apache-bsf基本功能" - ant -version - CHECK_RESULT $? 0 0 "ant命令执行失败" - - LOG_INFO "步骤5: 验证bsf相关功能" - if ! ant -p | grep -q bsf; then - LOG_ERROR "ant不支持bsf参数" - exit 255 - fi - - LOG_INFO "步骤6: 清理测试环境" - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "卸载测试期间安装的ant-apache-bsf软件包" - dnf remove -y ant-apache-bsf - CHECK_RESULT $? 0 0 "卸载ant-apache-bsf软件包失败" - else - LOG_INFO "测试前已安装ant-apache-bsf,保持安装状态不变" - fi - - LOG_INFO "测试完成:Test installation verification" -} - -main "$@" \ No newline at end of file From a6473e84e4e3bd1bce9763b082864adb5b38640e Mon Sep 17 00:00:00 2001 From: honghua Date: Wed, 22 Apr 2026 05:23:24 +0800 Subject: [PATCH 12/12] update testcase for testsuite rubygem-actionmailer-doc --- .../rubygem-actionmailer-doc.json | 4 -- ...ygem-actionmailer-doc_function_delivery.sh | 66 ------------------- 2 files changed, 70 deletions(-) delete mode 100644 testcases/function_test/pkg_test/rubygem-actionmailer/rubygem-actionmailer-doc/test_rubygem-actionmailer-doc_function_delivery.sh diff --git a/suite2cases/function_test/pkg_test/rubygem-actionmailer/rubygem-actionmailer-doc.json b/suite2cases/function_test/pkg_test/rubygem-actionmailer/rubygem-actionmailer-doc.json index 5e772b4ab8f..d32325c8442 100644 --- a/suite2cases/function_test/pkg_test/rubygem-actionmailer/rubygem-actionmailer-doc.json +++ b/suite2cases/function_test/pkg_test/rubygem-actionmailer/rubygem-actionmailer-doc.json @@ -11,10 +11,6 @@ "name": "test_rubygem-actionmailer-doc_uninstall", "desc": "测试软件包 rubygem-actionmailer-doc 的卸载功能,验证卸载过程是否成功。", "machine num": 1 - }, - { - "name": "test_rubygem-actionmailer-doc_function_delivery", - "desc": "测试软件包 rubygem-actionmailer-doc 的邮件发送功能,验证邮件是否能成功发送。" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rubygem-actionmailer/rubygem-actionmailer-doc/test_rubygem-actionmailer-doc_function_delivery.sh b/testcases/function_test/pkg_test/rubygem-actionmailer/rubygem-actionmailer-doc/test_rubygem-actionmailer-doc_function_delivery.sh deleted file mode 100644 index fce9e3f2de8..00000000000 --- a/testcases/function_test/pkg_test/rubygem-actionmailer/rubygem-actionmailer-doc/test_rubygem-actionmailer-doc_function_delivery.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试软件包 rubygem-actionmailer-doc 的邮件发送功能,验证邮件是否能成功发送。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 rubygem-actionmailer-doc 的邮件发送功能" - - # 检查软件包是否在yum源中 - LOG_INFO "检查 rubygem-actionmailer-doc 是否在yum源中" - dnf list available rubygem-actionmailer-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "rubygem-actionmailer-doc 不在yum源中" - exit 255 - fi - - # 检查是否已安装软件包 - LOG_INFO "检查 rubygem-actionmailer-doc 是否已安装" - rpm -q rubygem-actionmailer-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "rubygem-actionmailer-doc 已安装,测试完成后将保持安装状态" - else - installed=false - LOG_INFO "rubygem-actionmailer-doc 未安装,将在测试完成后卸载" - fi - - # 安装软件包(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "安装 rubygem-actionmailer-doc" - dnf install -y rubygem-actionmailer-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装 rubygem-actionmailer-doc 失败" - fi - - # 测试邮件发送功能 - LOG_INFO "测试邮件发送功能" - action_mailer_test_output=$(ruby -e "require "action_mailer"; ActionMailer::Base.mail(to: "test@example.com", from: "sender@example.com", subject: "Test", body: "Test body").deliver" 2>&1) - CHECK_RESULT $? 0 0 "邮件发送失败:$action_mailer_test_output" - - # 清理环境(如果之前未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载 rubygem-actionmailer-doc" - dnf remove -y rubygem-actionmailer-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载 rubygem-actionmailer-doc 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file