From 8e37c74324519bb9d08f8e80569cedea901ab3d2 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 09:50:25 +0800 Subject: [PATCH 01/18] update testcase for testsuite texlive-fithesis --- .../texlive-split-i/texlive-fithesis.json | 10 --- .../test_texlive-fithesis_function_install.sh | 63 ------------------- 2 files changed, 73 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-i/texlive-fithesis.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-i/texlive-fithesis/test_texlive-fithesis_function_install.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fithesis.json b/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fithesis.json deleted file mode 100644 index 34b9f71cf41..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fithesis.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-i/texlive-fithesis", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-fithesis_function_install", - "desc": "Test installation of texlive-fithesis" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-i/texlive-fithesis/test_texlive-fithesis_function_install.sh b/testcases/function_test/pkg_test/texlive-split-i/texlive-fithesis/test_texlive-fithesis_function_install.sh deleted file mode 100644 index 28cae4975b2..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-i/texlive-fithesis/test_texlive-fithesis_function_install.sh +++ /dev/null @@ -1,63 +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-19 -# @License : Mulan PSL v2 -# @Desc : Test installation of texlive-fithesis -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-fithesis - LOG_INFO "检查是否已安装texlive-fithesis..." - dnf list installed texlive-fithesis > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-fithesis已安装,脚本结束后将保持安装状态。" - INSTALLED=true - else - LOG_INFO "texlive-fithesis未安装,将在测试完成后卸载。" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-fithesis软件包 - LOG_INFO "检查yum源中是否有texlive-fithesis软件包..." - dnf list available texlive-fithesis > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到texlive-fithesis软件包" - - # 安装texlive-fithesis - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-fithesis..." - dnf install -y texlive-fithesis - CHECK_RESULT $? 0 0 "安装texlive-fithesis失败" - fi - - # 测试texlive-fithesis功能 - LOG_INFO "测试texlive-fithesis功能..." - texdoc fithesis > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "texlive-fithesis功能测试失败" - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-fithesis..." - dnf remove -y texlive-fithesis - CHECK_RESULT $? 0 0 "卸载texlive-fithesis失败" - fi - - LOG_INFO "测试完成,环境已恢复。" - -} - -main "$@" \ No newline at end of file From fe98a07d5cdf4bf9f9c670198f85bf19e63781d4 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 09:52:17 +0800 Subject: [PATCH 02/18] update testcase for testsuite preflight --- .../pkg_test/pdfbox/preflight.json | 4 -- .../test_preflight_function_check.sh | 62 ------------------- 2 files changed, 66 deletions(-) delete mode 100644 testcases/function_test/pkg_test/pdfbox/preflight/test_preflight_function_check.sh diff --git a/suite2cases/function_test/pkg_test/pdfbox/preflight.json b/suite2cases/function_test/pkg_test/pdfbox/preflight.json index 50d8887833a..3345fa9d394 100644 --- a/suite2cases/function_test/pkg_test/pdfbox/preflight.json +++ b/suite2cases/function_test/pkg_test/pdfbox/preflight.json @@ -11,10 +11,6 @@ "name": "test_preflight_uninstall_package", "desc": "测试preflight软件包的卸载功能,验证是否能够成功卸载。", "machine num": 1 - }, - { - "name": "test_preflight_function_check", - "desc": "测试preflight软件包的基本功能检查,验证其核心功能是否正常。" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/pdfbox/preflight/test_preflight_function_check.sh b/testcases/function_test/pkg_test/pdfbox/preflight/test_preflight_function_check.sh deleted file mode 100644 index 07a125be198..00000000000 --- a/testcases/function_test/pkg_test/pdfbox/preflight/test_preflight_function_check.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-10 -# @License : Mulan PSL v2 -# @Desc : 测试preflight软件包的基本功能检查,验证其核心功能是否正常。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试preflight软件包的基本功能检查,验证其核心功能是否正常 - - LOG_INFO "开始测试preflight软件包的基本功能检查" - - # 检查preflight软件包是否已安装 - if ! rpm -q preflight &>/dev/null; then - LOG_INFO "preflight软件包未安装,开始安装" - if ! dnf list available preflight &>/dev/null; then - LOG_ERROR "yum源中未找到preflight软件包" - exit 255 - fi - dnf install -y preflight - CHECK_RESULT $? 0 0 "安装preflight软件包失败" - INSTALLED=true - else - LOG_INFO "preflight软件包已安装" - INSTALLED=false - fi - - # 验证preflight命令是否存在 - LOG_INFO "验证preflight命令是否存在" - command -v preflight &>/dev/null - CHECK_RESULT $? 0 0 "preflight命令不存在" - - # 验证preflight命令的基本功能 - LOG_INFO "验证preflight命令的基本功能" - preflight --help &>/dev/null - CHECK_RESULT $? 0 0 "preflight命令基本功能检查失败" - - # 清理环境 - if [ "$INSTALLED" = true ]; then - LOG_INFO "卸载preflight软件包" - dnf remove -y preflight - CHECK_RESULT $? 0 0 "卸载preflight软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file From a6035862c75ab1dd5dae069e2aa27ab43d0ab125 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 09:52:40 +0800 Subject: [PATCH 03/18] update testcase for testsuite texlive-mex --- .../pkg_test/texlive-base/texlive-mex.json | 86 ------------------- .../test_texlive-mex_function_basic.sh | 64 -------------- .../test_texlive-mex_mex_draftmode.sh | 68 --------------- .../texlive-mex/test_texlive-mex_mex_enc.sh | 69 --------------- .../texlive-mex/test_texlive-mex_mex_etex.sh | 64 -------------- .../texlive-mex/test_texlive-mex_mex_fmt.sh | 77 ----------------- .../test_texlive-mex_mex_halt_on_error.sh | 67 --------------- .../test_texlive-mex_mex_interaction.sh | 68 --------------- .../test_texlive-mex_mex_jobname.sh | 77 ----------------- ...test_texlive-mex_mex_no_file_line_error.sh | 64 -------------- .../test_texlive-mex_mex_output_directory.sh | 83 ------------------ .../test_texlive-mex_pdfmex__draftmode.sh | 64 -------------- .../test_texlive-mex_pdfmex__enc.sh | 73 ---------------- .../test_texlive-mex_pdfmex__etex.sh | 66 -------------- ...est_texlive-mex_pdfmex__file_line_error.sh | 64 -------------- .../test_texlive-mex_pdfmex__fmt_FMTNAME.sh | 73 ---------------- .../test_texlive-mex_pdfmex__halt_on_error.sh | 58 ------------- .../test_texlive-mex_pdfmex__ini.sh | 72 ---------------- ...xlive-mex_pdfmex__interaction_batchmode.sh | 64 -------------- ..._texlive-mex_pdfmex__no_file_line_error.sh | 66 -------------- .../test_texlive-mex_utf8mex__upper_v.sh | 69 --------------- 21 files changed, 1456 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-base/texlive-mex.json delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_function_basic.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_draftmode.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_enc.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_etex.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_fmt.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_halt_on_error.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_interaction.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_jobname.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_no_file_line_error.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_output_directory.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__draftmode.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__enc.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__etex.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__file_line_error.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__fmt_FMTNAME.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__halt_on_error.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__ini.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__interaction_batchmode.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__no_file_line_error.sh delete mode 100644 testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_utf8mex__upper_v.sh diff --git a/suite2cases/function_test/pkg_test/texlive-base/texlive-mex.json b/suite2cases/function_test/pkg_test/texlive-base/texlive-mex.json deleted file mode 100644 index 23848b9c336..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-base/texlive-mex.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-base/texlive-mex", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-mex_mex_draftmode", - "desc": "测试 mex 命令的 draftmode 参数,生成无输出 PDF 的草稿模式" - }, - { - "name": "test_texlive-mex_mex_enc", - "desc": "测试 mex 命令的 enc 参数,启用 encTeX 扩展" - }, - { - "name": "test_texlive-mex_mex_etex", - "desc": "测试 mex 命令的 etex 参数,启用 e-TeX 扩展" - }, - { - "name": "test_texlive-mex_mex_no_file_line_error", - "desc": "测试 mex 命令的 no-file-line-error 参数,禁用文件:行:错误样式消息" - }, - { - "name": "test_texlive-mex_mex_fmt", - "desc": "测试 mex 命令的 fmt 参数,使用指定的格式文件" - }, - { - "name": "test_texlive-mex_mex_halt_on_error", - "desc": "测试 mex 命令的 halt-on-error 参数,在第一个错误时停止处理" - }, - { - "name": "test_texlive-mex_mex_interaction", - "desc": "测试 mex 命令的 interaction 参数,设置交互模式为 batchmode/nonstopmode/scrollmode/errorstopmode" - }, - { - "name": "test_texlive-mex_mex_jobname", - "desc": "测试 mex 命令的 jobname 参数,设置作业名称" - }, - { - "name": "test_texlive-mex_mex_output_directory", - "desc": "测试 mex 命令的 output-directory 参数,指定输出文件的目录" - }, - { - "name": "test_texlive-mex_pdfmex__draftmode", - "desc": "测试 pdfmex 命令的 draftmode 参数,生成无输出 PDF 的草稿模式" - }, - { - "name": "test_texlive-mex_pdfmex__enc", - "desc": "测试 pdfmex 命令的 enc 参数,启用 encTeX 扩展功能" - }, - { - "name": "test_texlive-mex_pdfmex__etex", - "desc": "测试 pdfmex 命令的 etex 参数,启用 e-TeX 扩展功能" - }, - { - "name": "test_texlive-mex_pdfmex__no_file_line_error", - "desc": "测试 pdfmex 命令的 no-file-line-error 参数,禁用文件:行:错误样式消息" - }, - { - "name": "test_texlive-mex_pdfmex__file_line_error", - "desc": "测试 pdfmex 命令的 file-line-error 参数,启用文件:行:错误样式消息" - }, - { - "name": "test_texlive-mex_pdfmex__fmt_FMTNAME", - "desc": "测试 pdfmex 命令的 fmt 参数,使用指定的 FMTNAME 替代程序名或 %& 行" - }, - { - "name": "test_texlive-mex_pdfmex__halt_on_error", - "desc": "测试 pdfmex 命令的 halt-on-error 参数,在第一个错误处停止处理" - }, - { - "name": "test_texlive-mex_pdfmex__ini", - "desc": "测试 pdfmex 命令的 ini 参数,作为 pdfinitex 运行,用于转储格式" - }, - { - "name": "test_texlive-mex_pdfmex__interaction_batchmode", - "desc": "测试 pdfmex 命令的 interaction=batchmode 参数,设置交互模式为批处理模式" - }, - { - "name": "test_texlive-mex_utf8mex__upper_v", - "desc": "测试 utf8mex 命令的版本信息参数" - }, - { - "name": "test_texlive-mex_function_basic", - "desc": "测试 texlive-mex 基础功能是否正常" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_function_basic.sh b/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_function_basic.sh deleted file mode 100644 index b237e1b7fdb..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_function_basic.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-mex 基础功能是否正常 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-mex 基础功能是否正常" - - # 检查环境是否已安装 texlive-mex - LOG_INFO "检查 texlive-mex 是否已安装" - if dnf list installed texlive-mex &>/dev/null; then - LOG_INFO "texlive-mex 已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-mex 未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-mex - LOG_INFO "检查 yum 源中是否有 texlive-mex" - if ! dnf list available texlive-mex &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-mex 软件包" - exit 255 - fi - - # 安装 texlive-mex(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-mex" - dnf install -y texlive-mex - CHECK_RESULT $? 0 0 "安装 texlive-mex 失败" - fi - - # 测试 texlive-mex 基础功能 - LOG_INFO "测试 texlive-mex 基础功能" - texlive-mex --version &>/dev/null - CHECK_RESULT $? 0 0 "texlive-mex 基础功能测试失败" - - # 清理环境(如果最初未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-mex" - dnf remove -y texlive-mex - CHECK_RESULT $? 0 0 "卸载 texlive-mex 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_draftmode.sh b/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_draftmode.sh deleted file mode 100644 index 67c75849789..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_draftmode.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-27 -# @License : Mulan PSL v2 -# @Desc : 测试 mex 命令的 draftmode 参数,生成无输出 PDF 的草稿模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装 texlive-mex 软件包 - LOG_INFO "检查 texlive-mex 软件包是否已安装" - dnf list installed texlive-mex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-mex 已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-mex 未安装,脚本结束后将卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-mex 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-mex 软件包" - dnf list available texlive-mex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-mex 软件包" - exit 255 - fi - - # 如果未安装,则安装 texlive-mex - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 texlive-mex 软件包" - dnf install -y texlive-mex - CHECK_RESULT $? 0 0 "安装 texlive-mex 失败" - fi - - # 测试 mex 命令的 draftmode 参数生成无输出 PDF - LOG_INFO "测试 mex 命令的 draftmode 参数生成无输出 PDF" - mex --draftmode test.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "mex draftmode 参数测试失败" - - # 清理生成的临时文件 - LOG_INFO "清理临时文件" - rm -f test.aux test.log test.pdf > /dev/null 2>&1 - - # 如果脚本开始时未安装,则卸载 texlive-mex - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-mex" - dnf remove -y texlive-mex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载 texlive-mex 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_enc.sh b/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_enc.sh deleted file mode 100644 index 362ebca30fb..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_enc.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 mex 命令的 enc 参数,启用 encTeX 扩展 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-mex软件包 - LOG_INFO "检查是否已安装texlive-mex软件包" - if dnf list installed texlive-mex &>/dev/null; then - LOG_INFO "texlive-mex已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-mex未安装,测试完成后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-mex软件包 - LOG_INFO "检查yum源中是否存在texlive-mex软件包" - if ! dnf list available texlive-mex &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-mex软件包" - exit 255 - fi - - # 若未安装则安装texlive-mex软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装texlive-mex软件包" - dnf install -y texlive-mex &>/dev/null - CHECK_RESULT $? 0 0 "安装texlive-mex失败" - fi - - # 测试mex命令的enc参数,启用encTeX扩展 - LOG_INFO "测试mex命令的enc参数,启用encTeX扩展" - mex --help | grep enc &>/dev/null - CHECK_RESULT $? 0 0 "mex命令不支持enc参数" - - # 执行mex命令的enc参数 - LOG_INFO "执行mex命令的enc参数" - mex enc testfile.tex &>/dev/null - CHECK_RESULT $? 0 0 "执行mex命令的enc参数失败" - - # 清理环境:若之前未安装则卸载texlive-mex软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载texlive-mex软件包" - dnf remove -y texlive-mex &>/dev/null - CHECK_RESULT $? 0 0 "卸载texlive-mex失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_etex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_etex.sh deleted file mode 100644 index 2a5f3f727f9..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_etex.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 mex 命令的 etex 参数,启用 e-TeX 扩展 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mex 命令的 etex 参数,启用 e-TeX 扩展" - - # 检查是否已安装 texlive-mex 软件包 - LOG_INFO "检查 texlive-mex 是否已安装" - if dnf list installed texlive-mex &>/dev/null; then - LOG_INFO "texlive-mex 已安装,脚本结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-mex 未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-mex 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-mex" - if ! dnf list available texlive-mex &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-mex,退出测试" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 texlive-mex" - dnf install -y texlive-mex - CHECK_RESULT $? 0 0 "安装 texlive-mex 失败" - fi - - # 测试 mex --etex 命令 - LOG_INFO "测试 mex --etex 命令" - mex --etex - CHECK_RESULT $? 0 0 "mex --etex 命令执行失败" - - # 如果之前未安装,则在测试后卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载 texlive-mex" - dnf remove -y texlive-mex - CHECK_RESULT $? 0 0 "卸载 texlive-mex 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_fmt.sh b/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_fmt.sh deleted file mode 100644 index 3f4017b27d7..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_fmt.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 mex 命令的 fmt 参数,使用指定的格式文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mex 命令的 fmt 参数,使用指定的格式文件" - - # 检查环境是否已安装 texlive-mex 软件包 - LOG_INFO "检查 texlive-mex 是否已安装" - if dnf list installed texlive-mex &>/dev/null; then - LOG_INFO "texlive-mex 已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "texlive-mex 未安装,将在测试结束后卸载" - installed=false - fi - - # 检查 yum 源中是否有 texlive-mex 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-mex" - if ! dnf list available texlive-mex &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-mex 软件包" - exit 255 - fi - - # 如果未安装,则安装 texlive-mex - if [ "$installed" = false ]; then - LOG_INFO "正在安装 texlive-mex" - dnf install -y texlive-mex || { - LOG_ERROR "安装 texlive-mex 失败" - exit $? - } - fi - - # 测试 mex fmt 参数功能 - LOG_INFO "测试 mex fmt 参数功能" - mex fmt --help &>/dev/null - CHECK_RESULT $? 0 0 "mex fmt --help 命令执行失败" - - # 使用指定的格式文件测试 mex fmt - LOG_INFO "使用指定的格式文件测试 mex fmt" - if [ ! -f test.fmt ]; then - LOG_ERROR "指定的格式文件 test.fmt 不存在" - exit 255 - fi - mex fmt -f test.fmt test.tex - CHECK_RESULT $? 0 0 "mex fmt -f test.fmt test.tex 命令执行失败" - - # 清理环境:如果脚本开始时未安装,则卸载 texlive-mex - if [ "$installed" = false ]; then - LOG_INFO "正在卸载 texlive-mex" - dnf remove -y texlive-mex || { - LOG_ERROR "卸载 texlive-mex失败" - exit $? - } - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_halt_on_error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_halt_on_error.sh deleted file mode 100644 index c86b9d369a9..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_halt_on_error.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 mex 命令的 halt-on-error 参数,在第一个错误时停止处理 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mex 命令的 halt-on-error 参数,在第一个错误时停止处理" - - # 检查是否已安装 texlive-mex - LOG_INFO "检查 texlive-mex 是否已安装" - if dnf list installed texlive-mex &>/dev/null; then - LOG_INFO "texlive-mex 已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-mex 未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-mex - LOG_INFO "检查 yum 源中是否有 texlive-mex" - if ! dnf list available texlive-mex &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-mex" - exit 255 - fi - - # 如果未安装,则安装 texlive-mex - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 texlive-mex" - dnf install -y texlive-mex - CHECK_RESULT $? 0 0 "安装 texlive-mex 失败" - fi - - # 测试 mex 命令的 halt-on-error 参数 - LOG_INFO "测试 mex 命令的 halt-on-error 参数" - - # 模拟一个会出错的命令以测试 halt-on-error - LOG_INFO "执行 mex 命令并故意触发错误以测试 halt-on-error" - mex --halt-on-error invalid-command - CHECK_RESULT $? 1 0 "halt-on-error 参数未在第一个错误时停止处理" - - # 清理环境:如果之前未安装,则卸载 texlive-mex - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载 texlive-mex" - dnf remove -y texlive-mex - CHECK_RESULT $? 0 0 "卸载 texlive-mex 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_interaction.sh b/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_interaction.sh deleted file mode 100644 index bc8cf1304ec..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_interaction.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-27 -# @License : Mulan PSL v2 -# @Desc : 测试 mex 命令的 interaction 参数,设置交互模式为 batchmode/nonstopmode/scrollmode/errorstopmode -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mex 命令的 interaction 参数" - - # 检查是否已安装 texlive-mex - LOG_INFO "检查 texlive-mex 是否已安装" - if ! dnf list installed texlive-mex &>/dev/null; then - LOG_INFO "texlive-mex 未安装,将进行安装" - INSTALLED=false - else - LOG_INFO "texlive-mex 已安装" - INSTALLED=true - fi - - # 检查 yum 源中是否有 texlive-mex - LOG_INFO "检查 yum 源中是否有 texlive-mex" - if ! dnf list available texlive-mex &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-mex 软件包" - exit 255 - fi - - # 如果未安装,则安装 texlive-mex - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-mex" - dnf install -y texlive-mex - CHECK_RESULT $? 0 0 "安装 texlive-mex 失败" - fi - - # 测试 interaction 参数的 batchmode/nonstopmode/scrollmode/errorstopmode - INTERACTION_MODES=("batchmode" "nonstopmode" "scrollmode" "errorstopmode") - - for mode in "${INTERACTION_MODES[@]}"; do - LOG_INFO "测试 interaction 参数为 $mode" - mex --interaction="$mode" &>/dev/null - CHECK_RESULT $? 0 0 "mex --interaction=$mode 执行失败" - done - - # 恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-mex" - dnf remove -y texlive-mex - CHECK_RESULT $? 0 0 "卸载 texlive-mex 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_jobname.sh b/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_jobname.sh deleted file mode 100644 index c7417cd410d..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_jobname.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 mex 命令的 jobname 参数,设置作业名称 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mex 命令的 jobname 参数,设置作业名称" - - # 检查是否已安装 texlive-mex 软件包 - LOG_INFO "检查 texlive-mex 软件包是否已安装" - if rpm -q texlive-mex &>/dev/null; then - LOG_INFO "texlive-mex 已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-mex 未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-mex 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-mex 软件包" - if ! dnf list available texlive-mex &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-mex 软件包" - exit 255 - fi - - # 如果未安装,则安装 texlive-mex - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 texlive-mex 软件包" - dnf install -y texlive-mex - CHECK_RESULT $? 0 0 "安装 texlive-mex 失败" - fi - - # 测试 mex 命令的 jobname 参数 - LOG_INFO "测试 mex 命令的 jobname 参数" - mex --jobname=test_job &>/dev/null - CHECK_RESULT $? 0 0 "mex --jobname=test_job 执行失败" - - #验证作业名称是否设置成功(假设 mex 会生成一个以作业名称命名的文件) - LOG_INFO "验证作业名称是否设置成功" - if [ -f "test_job" ]; then - LOG_INFO "作业名称设置成功" - else - LOG_ERROR "作业名称设置失败" - exit 1 - fi - - # 清理测试生成的文件 - LOG_INFO "清理测试生成的文件" - rm -f test_job - - #如果脚本开始时未安装 texlive-mex,则在结束时卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-mex 软件包" - dnf remove -y texlive-mex - CHECK_RESULT $? 0 0 "卸载 texlive-mex 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_no_file_line_error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_no_file_line_error.sh deleted file mode 100644 index b27ff998336..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_no_file_line_error.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 mex 命令的 no-file-line-error 参数,禁用文件:行:错误样式消息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mex 命令的 no-file-line-error 参数,禁用文件:行:错误样式消息" - - # 检查是否已安装 texlive-mex - LOG_INFO "检查 texlive-mex 是否已安装" - if dnf list installed texlive-mex &>/dev/null; then - LOG_INFO "texlive-mex 已安装,脚本结束后将保持安装状态" - installed=true - else - LOG_INFO "texlive-mex 未安装,脚本结束后将卸载" - installed=false - fi - - # 检查 yum 源中是否有 texlive-mex - LOG_INFO "检查 yum 源中是否有 texlive-mex" - if ! dnf list available texlive-mex &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-mex" - exit 255 - fi - - # 如果未安装,则安装 texlive-mex - if [ "$installed" = false ]; then - LOG_INFO "安装 texlive-mex" - dnf install -y texlive-mex - CHECK_RESULT $? 0 0 "安装 texlive-mex 失败" - fi - - # 测试 mex 命令的 no-file-line-error 参数 - LOG_INFO "测试 mex no-file-line-error 参数" - mex --no-file-line-error &>/dev/null - CHECK_RESULT $? 0 0 "mex no-file-line-error 参数不支持或执行失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载 texlive-mex" - dnf remove -y texlive-mex - CHECK_RESULT $? 0 0 "卸载 texlive-mex 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_output_directory.sh b/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_output_directory.sh deleted file mode 100644 index 2f4eb940ea2..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_mex_output_directory.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 mex 命令的 output-directory 参数,指定输出文件的目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 mex 命令的 output-directory 参数,指定输出文件的目录" - - # 检查软件包是否已安装 - if rpm -q texlive-mex &>/dev/null; then - LOG_INFO "texlive-mex 已安装,测试完成后将保持安装状态" - already_installed=true - else - LOG_INFO "texlive-mex 未安装,将在测试完成后卸载" - already_installed=false - fi - - # 检查 yum 源中是否有 texlive-mex 软件包 - LOG_INFO "检查 yum 源中是否存在 texlive-mex 软件包" - if ! dnf list available texlive-mex &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-mex 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "正在安装 texlive-mex 软件包" - dnf install -y texlive-mex - CHECK_RESULT $? 0 0 "安装 texlive-mex 失败" - fi - - # 测试 mex 命令的 output-directory 参数 - LOG_INFO "测试 mex 命令的 output-directory 参数" - output_dir="/tmp/mex_output" - mkdir -p "$output_dir" - - # 执行 mex 命令并指定输出目录 - LOG_INFO "执行 mex -output-directory $output_dir test.tex" - mex -output-directory "$output_dir" test.tex &>/dev/null - CHECK_RESULT $? 0 0 "mex -output-directory 执行失败" - - # 检查输出目录是否生成文件 - LOG_INFO "检查输出目录是否生成文件" - if [ -f "$output_dir/test.pdf" ]; then - LOG_INFO "输出目录成功生成文件 test.pdf" - else - LOG_ERROR "输出目录未生成文件 test.pdf" - exit ${LINENO} - fi - - # 清理测试环境 - LOG_INFO "清理测试环境" - rm -rf "$output_dir" - - # 如果测试前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载 texlive-mex 软件包" - dnf remove -y texlive-mex - CHECK_RESULT $? 0 0 "卸载 texlive-mex 失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__draftmode.sh b/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__draftmode.sh deleted file mode 100644 index 4acd6fd710b..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__draftmode.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 pdfmex 命令的 draftmode 参数,生成无输出 PDF 的草稿模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-mex软件包 - LOG_INFO "检查texlive-mex软件包是否已安装" - if dnf list installed texlive-mex &>/dev/null; then - LOG_INFO "texlive-mex软件包已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-mex软件包未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-mex软件包 - LOG_INFO "检查yum源中是否存在texlive-mex软件包" - if ! dnf list available texlive-mex &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-mex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-mex软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-mex软件包" - dnf install -y texlive-mex - CHECK_RESULT $? 0 0 "安装texlive-mex软件包失败" - fi - - # 测试pdfmex命令的draftmode参数 - LOG_INFO "测试pdfmex命令的draftmode参数,生成无输出PDF的草稿模式" - pdfmex --draftmode test.tex - CHECK_RESULT $? 0 0 "pdfmec命令的draftmode参数测试失败" - - # 清理环境:如果脚本开始时未安装,则卸载texlive-mex软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-mex软件包" - dnf remove -y texlive-mex - CHECK_RESULT $? 0 0 "卸载texlive-mec软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__enc.sh b/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__enc.sh deleted file mode 100644 index 99a1685e9b0..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__enc.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 pdfmex 命令的 enc 参数,启用 encTeX 扩展功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查环境是否已安装texlive-mex - LOG_INFO "检查是否已安装texlive-mex..." - dnf list installed texlive-mex &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-mex已安装,测试完成后将保持安装状态。" - INSTALLED=1 - else - LOG_INFO "texlive-mex未安装,将在测试完成后卸载。" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-mex - LOG_INFO "检查yum源中是否有texlive-mex..." - dnf list available texlive-mex &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-mex,退出测试。" - exit 255 - fi - - # 若未安装则安装texlive-mex - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-mex..." - dnf install -y texlive-mex &>/dev/null - CHECK_RESULT $? 0 0 "安装texlive-mex失败" - fi - - # 测试pdfmex命令的enc参数 - LOG_INFO "测试pdfmex命令的enc参数..." - pdfmex --help | grep -q "\-\-enc" - if [ $? -ne 0 ]; then - LOG_ERROR "pdfmec命令不支持enc参数,退出测试。" - exit 255 - fi - - LOG_INFO "执行pdfmec --enc测试..." - pdfmex --enc test.tex &>/dev/null - CHECK_RESULT $? 0 0 "pdfmec --enc执行失败" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-mec..." - dnf remove -y texlive-mex &>/dev/null - CHECK_RESULT $? 0 0 "卸载texlive-mext失败" - fi - - LOG_INFO "测试完成,环境已恢复。" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__etex.sh b/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__etex.sh deleted file mode 100644 index 47008430de6..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__etex.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 pdfmex 命令的 etex 参数,启用 e-TeX 扩展功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 pdfmex 命令的 etex 参数,启用 e-TeX 扩展功能" - - # 检查是否已安装 texlive-mex 软件包 - LOG_INFO "检查 texlive-mex 是否已安装" - if dnf list installed texlive-mex &>/dev/null; then - LOG_INFO "texlive-mex 已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-mex 未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-mex - LOG_INFO "检查 yum 源中是否有 texlive-mex" - if ! dnf list available texlive-mex &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-mex,退出测试" - exit 255 - fi - - # 如果未安装,则安装 texlive-mex - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 texlive-mex" - dnf install -y texlive-mex - CHECK_RESULT $? 0 0 "安装 texlive-mex 失败" - fi - - # 测试 pdfmex etex 参数 - LOG_INFO "测试 pdfmex 命令的 etex 参数" - pdfmex --etex test.tex - CHECK_RESULT $? 0 0 "pdfmex etex 参数测试失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载 texlive-mex" - dnf remove -y texlive-mex - CHECK_RESULT $? 0 0 "卸载 texlive-mex 失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__file_line_error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__file_line_error.sh deleted file mode 100644 index 92ae979931d..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__file_line_error.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 pdfmex 命令的 file-line-error 参数,启用文件:行:错误样式消息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装 texlive-mex 软件包 - LOG_INFO "检查 texlive-mex 是否已安装" - if dnf list installed texlive-mex &>/dev/null; then - LOG_INFO "texlive-mex 已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-mex 未安装,脚本结束后将卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-mex 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-mex 软件包" - if ! dnf list available texlive-mex &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-mex 软件包" - exit 255 - fi - - # 如果未安装,则安装 texlive-mex - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-mex" - dnf install -y texlive-mex - CHECK_RESULT $? 0 0 "安装 texlive-mex 失败" - fi - - # 测试 pdfmex 命令的 file-line-error 参数 - LOG_INFO "测试 pdfmex file-line-error 参数" - pdfmex --file-line-error test.tex - CHECK_RESULT $? 0 0 "pdfmec file-line-error 参数测试失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-mex" - dnf remove -y texlive-mex - CHECK_RESULT $? 0 0 "卸载 texlive-mex 失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__fmt_FMTNAME.sh b/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__fmt_FMTNAME.sh deleted file mode 100644 index ca27c4936c2..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__fmt_FMTNAME.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 pdfmex 命令的 fmt 参数,使用指定的 FMTNAME 替代程序名或 %& 行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 pdfmex 命令的 fmt 参数,使用指定的 FMTNAME 替代程序名或 %& 行" - - # 检查是否已安装 texlive-mex 软件包 - LOG_INFO "检查 texlive-mex 是否已安装" - if ! dnf list installed texlive-mex &> /dev/null; then - LOG_INFO "texlive-mex 未安装,将进行安装" - if ! dnf list available texlive-mex &> /dev/null; then - LOG_ERROR "yum源中未找到 texlive-mex 软件包" - exit 255 - fi - dnf install -y texlive-mex - CHECK_RESULT $? 0 0 "安装 texlive-mex 失败" - INSTALLED=true - else - LOG_INFO "texlive-mex 已安装,跳过安装步骤" - INSTALLED=false - fi - - # 测试 pdfmex 命令的 fmt 参数 - LOG_INFO "测试 pdfmex 命令的 fmt 参数" - if ! command -v pdfmex &> /dev/null; then - LOG_ERROR "pdfmex 命令不存在" - exit 255 - fi - - # FMTNAME为测试用例中指定的参数,此处假设为testfmt - FMTNAME="testfmt" - pdfmex --fmt $FMTNAME - CHECK_RESULT $? 0 0 "pdfmex --fmt $FMTNAME 执行失败" - - # FMTNAME为空的情况测试 - LOG_INFO "测试 FMTNAME 为空的情况" - pdfmex --fmt "" - CHECK_RESULT $? 255 0 "pdfmex --fmt \"\" 应返回255" - - # FMTNAME包含非法字符的情况测试 - LOG_INFO "测试 FMTNAME 包含非法字符的情况" - pdfmex --fmt "*invalid*" - CHECK_RESULT $? ? ? "pdfmex --fmt \"*invalid*\"应返回非零值" # 根据实际返回值调整 - - # 清理环境,如果脚本开始时安装了软件包则卸载 - if [ "$INSTALLED" = true ]; then - LOG_INFO "卸载 texlive-mex 软件包" - dnf remove -y texlive-mex - CHECK_RESULT $? ? ? "卸载 texlive-mes失败" # 根据实际返回值调整,确保清理成功即可无需强制判断具体退出码 - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__halt_on_error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__halt_on_error.sh deleted file mode 100644 index fcc614effe1..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__halt_on_error.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 pdfmex 命令的 halt-on-error 参数,在第一个错误处停止处理 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 pdfmex 命令的 halt-on-error 参数,在第一个错误处停止处理" - - # 检查是否已安装 texlive-mex 软件包 - LOG_INFO "检查 texlive-mex 是否已安装" - if ! dnf list installed texlive-mex &>/dev/null; then - LOG_INFO "texlive-mex 未安装,将进行安装" - # 检查 yum 源中是否有 texlive-mex - if ! dnf list available texlive-mex &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-mex 软件包" - exit 255 - fi - # 安装 texlive-mex - dnf install -y texlive-mex - CHECK_RESULT $? 0 0 "安装 texlive-mex 失败" - # 标记为测试过程中安装,需要在结束时卸载 - CLEANUP_INSTALLED=true - else - LOG_INFO "texlive-mex 已安装,无需重新安装" - CLEANUP_INSTALLED=false - fi - - # 测试 pdfmex halt-on-error 参数功能 - LOG_INFO "测试 pdfmex 命令的 halt-on-error 参数" - # 模拟一个会出错的场景(假设 test.tex 文件不存在) - pdfmex --halt-on-error test.tex &>/dev/null - CHECK_RESULT $? 1 0 "pdfmex halt-on-error 参数未在第一个错误处停止处理" - - # 清理环境(如果测试过程中安装了软件包) - if [ "$CLEANUP_INSTALLED" = true ]; then - LOG_INFO "卸载 texlive-mex 软件包" - dnf remove -y texlive-mex - CHECK_RESULT $?2 -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__ini.sh b/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__ini.sh deleted file mode 100644 index 207e2550622..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__ini.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 : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 pdfmex 命令的 ini 参数,作为 pdfinitex 运行,用于转储格式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 pdfmex 命令的 ini 参数,作为 pdfinitex 运行,用于转储格式" - - # 检查环境是否已安装 texlive-mex 软件包 - LOG_INFO "检查 texlive-mex 是否已安装" - if dnf list installed texlive-mex &>/dev/null; then - LOG_INFO "texlive-mex 已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-mex 未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-mex 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-mex" - if ! dnf list available texlive-mex &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-mex 软件包" - exit 255 - fi - - # 如果未安装,则安装 texlive-mex - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 texlive-mex" - dnf install -y texlive-mex - CHECK_RESULT $? 0 0 "安装 texlive-mex 失败" - fi - - # 测试 pdfmex ini参数是否存在或支持 - LOG_INFO "测试 pdfmex ini参数是否存在" - pdfmex --help | grep -q "ini" - CHECK_RESULT $? 0 0 "pdfmex不支持ini参数" - - #执行pdfmec ini参数命令并检查结果 - LOG_INFO "执行 pdfmec ini参数命令" - pdfmec ini test.tex &>/dev/null - CHECK_RESULT $? 0 0 "执行 pdfmec ini参数命令失败" - - #清理环境,如果之前未安装则卸载texliev_mec - if [ "$INSTALLED" = false ]; then - LOG_INFO “正在卸载 texliev_mec” - dnf remove -y textliev_mec - CHECK_RESULT $?00“卸载 textliev_mec失败” - fi - - LOG_INFO“测试完成” - exit0 - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__interaction_batchmode.sh b/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__interaction_batchmode.sh deleted file mode 100644 index 6b040ea0781..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__interaction_batchmode.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 pdfmex 命令的 interaction=batchmode 参数,设置交互模式为批处理模式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-mex软件包 - LOG_INFO "检查是否已安装texlive-mex软件包" - if dnf list installed texlive-mex &>/dev/null; then - LOG_INFO "texlive-mex已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-mex未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-mex软件包 - LOG_INFO "检查yum源中是否有texlive-mex软件包" - if ! dnf list available texlive-mex &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-mex软件包" - exit 255 - fi - - # 安装texlive-mex软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-mex软件包" - dnf install -y texlive-mex - CHECK_RESULT $? 0 0 "安装texlive-mex失败" - fi - - # 测试pdfmex命令的interaction=batchmode参数 - LOG_INFO "测试pdfmex命令的interaction=batchmode参数" - pdfmex --interaction=batchmode &>/dev/null - CHECK_RESULT $? 0 0 "pdfmex命令不支持interaction=batchmode参数" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-mex软件包" - dnf remove -y texlive-mex - CHECK_RESULT $? 0 0 "卸载texlive-mex失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__no_file_line_error.sh b/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__no_file_line_error.sh deleted file mode 100644 index 6b58e8cb3ad..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_pdfmex__no_file_line_error.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 pdfmex 命令的 no-file-line-error 参数,禁用文件:行:错误样式消息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-mex软件包 - LOG_INFO "检查是否已安装texlive-mex软件包" - rpm -q texlive-mex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-mex已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "texlive-mex未安装,准备安装" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-mex软件包 - LOG_INFO "检查yum源中是否存在texlive-mex软件包" - dnf list available texlive-mex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-mex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-mex - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-mex软件包" - dnf install -y texlive-mex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-mex失败" - fi - - # 测试pdfmec命令的no-file-line-error参数 - LOG_INFO "测试pdfmec命令的no-file-line-error参数" - pdfmex --no-file-line-error > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pdfmex命令不支持--no-file-line-error参数" - - # 恢复环境:如果脚本安装了软件包,则卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-mex软件包" - dnf remove -y texlive-mex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-mex失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_utf8mex__upper_v.sh b/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_utf8mex__upper_v.sh deleted file mode 100644 index ffd895dae84..00000000000 --- a/testcases/function_test/pkg_test/texlive-base/texlive-mex/test_texlive-mex_utf8mex__upper_v.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-27 -# @License : Mulan PSL v2 -# @Desc : 测试 utf8mex 命令的版本信息参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 utf8mex 命令的版本信息参数" - - # 检查是否已安装 texlive-mex 软件包 - LOG_INFO "检查 texlive-mex 是否已安装" - if rpm -q texlive-mex > /dev/null 2>&1; then - LOG_INFO "texlive-mex 已安装,脚本结束时保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-mex 未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-mex 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-mex" - if ! dnf list available texlive-mex > /dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 texlive-mex 软件包" - exit 255 - fi - - # 如果未安装,则安装 texlive-mex - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-mex" - dnf install -y texlive-mex - CHECK_RESULT $? 0 0 "安装 texlive-mex 失败" - fi - - # 测试 utf8mex --version 命令 - LOG_INFO "测试 utf8mex --version 命令" - utf8mex --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "utf8mex --version 命令执行失败" - - # 测试 utf8mex -v 命令 - LOG_INFO "测试 utf8mex -v 命令" - utf8mex -v > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "utf8mex -v 命令执行失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-mex" - dnf remove -y texlive-mex - CHECK_RESULT $? 0 0 "卸载 texlive-mex 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file From 5e20bd476d81bf9d44e354a7d75e1836da2d0845 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 09:53:03 +0800 Subject: [PATCH 04/18] update testcase for testsuite texlive-moodle --- .../texlive-split-p/texlive-moodle.json | 8 -- ...est_texlive-moodle_function_compile_doc.sh | 100 ---------------- ...t_texlive-moodle_function_help_document.sh | 111 ------------------ 3 files changed, 219 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-p/texlive-moodle/test_texlive-moodle_function_compile_doc.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-p/texlive-moodle/test_texlive-moodle_function_help_document.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-p/texlive-moodle.json b/suite2cases/function_test/pkg_test/texlive-split-p/texlive-moodle.json index 6dad74ffddc..cb5ca932bc1 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-p/texlive-moodle.json +++ b/suite2cases/function_test/pkg_test/texlive-split-p/texlive-moodle.json @@ -13,14 +13,6 @@ { "name": "test_texlive-moodle_function_check_installed", "desc": "Verify texlive-moodle is installed in system" - }, - { - "name": "test_texlive-moodle_function_compile_doc", - "desc": "Test compiling a basic LaTeX document using moodle package" - }, - { - "name": "test_texlive-moodle_function_help_document", - "desc": "Check availability of package documentation (texdoc)" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-moodle/test_texlive-moodle_function_compile_doc.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-moodle/test_texlive-moodle_function_compile_doc.sh deleted file mode 100644 index 70c24602edb..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-moodle/test_texlive-moodle_function_compile_doc.sh +++ /dev/null @@ -1,100 +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 : Test compiling a basic LaTeX document using moodle package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用moodle包编译基础LaTeX文档" - - # 检查是否已安装texlive-moodle - LOG_INFO "步骤1:检查texlive-moodle是否已安装" - if rpm -q texlive-moodle &>/dev/null; then - LOG_INFO "texlive-moodle已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-moodle未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有texlive-moodle包 - LOG_INFO "步骤2:检查yum源中是否有texlive-moodle包" - if ! dnf list available texlive-moodle &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-moodle包" - exit 255 - fi - - # 如果未安装,则安装texlive-moodle - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-moodle" - dnf install -y texlive-moodle - CHECK_RESULT $? 0 0 "安装texlive-moodle失败" - fi - - # 创建测试LaTeX文档 - LOG_INFO "步骤4:创建测试LaTeX文档" - cat > test_moodle.tex << "EOF" - \documentclass{article} - \usepackage{moodle} - \begin{document} - \begin{quiz}{Test Quiz} - \begin{multi}[shuffle]{Test Question} - Which package is used for creating quizzes in LaTeX? - \item moodle - \item exam - \item beamer - \item graphicx - \end{multi} - \end{quiz} - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文档失败" - - # 编译LaTeX文档 - LOG_INFO "步骤5:使用pdflatex编译LaTeX文档" - pdflatex -interaction=nonstopmode test_moodle.tex - CHECK_RESULT $? 0 0 "编译LaTeX文档失败" - - # 检查生成的PDF文件 - LOG_INFO "步骤6:检查生成的PDF文件" - if [ -f test_moodle.pdf ]; then - LOG_INFO "成功生成PDF文件" - CHECK_RESULT 0 0 0 "PDF文件生成检查" - else - LOG_ERROR "未找到生成的PDF文件" - CHECK_RESULT 1 0 1 "PDF文件生成检查" - fi - - # 清理测试文件 - LOG_INFO "步骤7:清理测试文件" - rm -f test_moodle.tex test_moodle.pdf test_moodle.aux test_moodle.log test_moodle.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载texlive-moodle - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤8:卸载texlive-moodle" - dnf remove -y texlive-moodle - CHECK_RESULT $? 0 0 "卸载texlive-moodle失败" - else - LOG_INFO "步骤8:保持texlive-moodle安装状态" - fi - - LOG_INFO "测试完成:使用moodle包编译基础LaTeX文档" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-moodle/test_texlive-moodle_function_help_document.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-moodle/test_texlive-moodle_function_help_document.sh deleted file mode 100644 index 69c69b11e2e..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-moodle/test_texlive-moodle_function_help_document.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-03 -# @License : Mulan PSL v2 -# @Desc : Check availability of package documentation (texdoc) -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-moodle软件包文档可用性测试脚本 - - LOG_INFO "开始测试:检查texlive-moodle软件包文档可用性(texdoc)" - - # 检查是否已经安装texlive-moodle - LOG_INFO "步骤1:检查texlive-moodle是否已安装" - dnf list installed texlive-moodle 2>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-moodle已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-moodle未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有texlive-moodle软件包 - LOG_INFO "步骤2:检查yum源中是否有texlive-moodle软件包" - dnf list available texlive-moodle 2>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-moodle软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-moodle软件包" - dnf install -y texlive-moodle - CHECK_RESULT $? 0 0 "安装texlive-moodle软件包失败" - fi - - # 检查texdoc命令是否存在 - LOG_INFO "步骤4:检查texdoc命令是否存在" - which texdoc >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "texdoc命令不存在" - - # 检查texdoc命令的帮助文档 - LOG_INFO "步骤5:检查texdoc命令的帮助文档" - texdoc --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "texdoc命令帮助文档不可用" - - # 检查texdoc命令是否支持--list参数 - LOG_INFO "步骤6:检查texdoc命令是否支持--list参数" - texdoc --list >/dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "texdoc命令不支持--list参数" - exit 255 - fi - - # 检查texdoc命令是否支持--version参数 - LOG_INFO "步骤7:检查texdoc命令是否支持--version参数" - texdoc --version >/dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "texdoc命令不支持--version参数" - exit 255 - fi - - # 检查texlive-moodle相关文档 - LOG_INFO "步骤8:检查texlive-moodle相关文档" - texdoc --list | grep -i moodle >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "找到texlive-moodle相关文档" - - # 尝试查看一个moodle相关文档 - LOG_INFO "步骤9:尝试查看moodle相关文档" - texdoc --list | grep -i moodle | head -1 | awk "{print $1}" | xargs texdoc --view >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "成功查看moodle文档" - else - LOG_INFO "无法直接查看文档,但文档列表中存在相关条目" - fi - else - LOG_INFO "未找到texlive-moodle特定文档,但命令功能正常" - fi - - # 环境清理 - LOG_INFO "步骤10:环境清理" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的texlive-moodle软件包" - dnf remove -y texlive-moodle - CHECK_RESULT $? 0 0 "卸载texlive-moodle软件包失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "保持texlive-moodle安装状态不变" - fi - - LOG_INFO "测试完成:texlive-moodle软件包文档可用性检查通过" -} - -main "$@" \ No newline at end of file From 51a58e34e603df74c9e789ab0842c65112a66740 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 09:54:43 +0800 Subject: [PATCH 05/18] update testcase for testsuite texlive-physunits --- .../texlive-split-y/texlive-physunits.json | 10 --- ...est_texlive-physunits_function_unitconv.sh | 77 ------------------- 2 files changed, 87 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-y/texlive-physunits.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-y/texlive-physunits/test_texlive-physunits_function_unitconv.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-physunits.json b/suite2cases/function_test/pkg_test/texlive-split-y/texlive-physunits.json deleted file mode 100644 index 2b875958d77..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-physunits.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-y/texlive-physunits", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-physunits_function_unitconv", - "desc": "Test unit conversion functionality" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-physunits/test_texlive-physunits_function_unitconv.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-physunits/test_texlive-physunits_function_unitconv.sh deleted file mode 100644 index 0284ba96814..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-physunits/test_texlive-physunits_function_unitconv.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test unit conversion functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在texlive-physunits软件包 - LOG_INFO "检查yum源中是否存在texlive-physunits软件包" - dnf list available texlive-physunits > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-physunits软件包" - exit 255 - fi - - # 检查是否已安装texlive-physunits - LOG_INFO "检查是否已安装texlive-physunits" - rpm -q texlive-physunits > /dev/null 2>&1 - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "texlive-physunits已安装,脚本结束时将保持安装状态" - else - installed=false - LOG_INFO "texlive-physunits未安装,将在测试结束后卸载" - fi - - # 如果未安装,则安装texlive-physunits - if [ "$installed" = false ]; then - LOG_INFO "正在安装texlive-physunits" - dnf install -y texlive-physunits - CHECK_RESULT $? 0 0 "安装texlive-physunits失败" - fi - - # 测试unit conversion功能 - LOG_INFO "测试unit conversion功能" - unitconv --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "unitconv命令不支持或参数错误" - - # 示例测试:转换单位 - LOG_INFO "测试单位转换功能:将1米转换为厘米" - output=$(unitconv 1 m cm 2>&1) - expected_output="1 m = 100 cm" - if [[ "$output" == "$expected_output" ]]; then - LOG_INFO "单位转换测试通过" - else - LOG_ERROR "单位转换测试失败,预期输出: $expected_output, 实际输出: $output" - exit 1 - fi - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "正在卸载texlive-physunits" - dnf remove -y texlive-physunits > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-physunits失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file From 603b368b7efc770588ed856ec2f54ea5b41060db Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 09:55:14 +0800 Subject: [PATCH 06/18] update testcase for testsuite python3-pytest-runner --- .../python3-pytest-runner.json | 12 ---- ...est_python3-pytest-runner_function_deps.sh | 64 ----------------- ..._python3-pytest-runner_function_install.sh | 71 ------------------- ...test_python3-pytest-runner_function_run.sh | 62 ---------------- 4 files changed, 209 deletions(-) delete mode 100644 testcases/function_test/pkg_test/python-pytest-runner/python3-pytest-runner/test_python3-pytest-runner_function_deps.sh delete mode 100644 testcases/function_test/pkg_test/python-pytest-runner/python3-pytest-runner/test_python3-pytest-runner_function_install.sh delete mode 100644 testcases/function_test/pkg_test/python-pytest-runner/python3-pytest-runner/test_python3-pytest-runner_function_run.sh diff --git a/suite2cases/function_test/pkg_test/python-pytest-runner/python3-pytest-runner.json b/suite2cases/function_test/pkg_test/python-pytest-runner/python3-pytest-runner.json index d507947fa43..fe2d51e834d 100644 --- a/suite2cases/function_test/pkg_test/python-pytest-runner/python3-pytest-runner.json +++ b/suite2cases/function_test/pkg_test/python-pytest-runner/python3-pytest-runner.json @@ -6,18 +6,6 @@ "name": "test_python3-pytest-runner_install", "desc": "测试python3-pytest-runner软件包的安装功能", "machine num": 1 - }, - { - "name": "test_python3-pytest-runner_function_install", - "desc": "Test the installation functionality of python3-pytest-runner" - }, - { - "name": "test_python3-pytest-runner_function_run", - "desc": "Test the running functionality of python3-pytest-runner" - }, - { - "name": "test_python3-pytest-runner_function_deps", - "desc": "Test the dependency resolution of python3-pytest-runner" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pytest-runner/python3-pytest-runner/test_python3-pytest-runner_function_deps.sh b/testcases/function_test/pkg_test/python-pytest-runner/python3-pytest-runner/test_python3-pytest-runner_function_deps.sh deleted file mode 100644 index 082f0e70567..00000000000 --- a/testcases/function_test/pkg_test/python-pytest-runner/python3-pytest-runner/test_python3-pytest-runner_function_deps.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-06 -# @License : Mulan PSL v2 -# @Desc : Test the dependency resolution of python3-pytest-runner -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test the dependency resolution of python3-pytest-runner" - - # 检查环境是否已安装python3-pytest-runner - LOG_INFO "检查是否已安装python3-pytest-runner" - if dnf list installed python3-pytest-runner &>/dev/null; then - LOG_INFO "python3-pytest-runner已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "python3-pytest-runner未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有python3-pytest-runner - LOG_INFO "检查yum源中是否有python3-pytest-runner" - if ! dnf list available python3-pytest-runner &>/dev/null; then - LOG_ERROR "yum源中未找到python3-pytest-runner" - exit 255 - fi - - # 安装python3-pytest-runner(如果未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装python3-pytest-runner" - dnf install -y python3-pytest-runner - CHECK_RESULT $? 0 0 "安装python3-pytest-runner失败" - fi - - # 测试依赖解析功能 - LOG_INFO "测试python3-pytest-runner的依赖解析功能" - pytest-runner --help &>/dev/null - CHECK_RESULT $? 0 0 "pytest-runner命令执行失败" - - # 清理环境(如果最初未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载python3-pytest-runner" - dnf remove -y python3-pytest-runner - CHECK_RESULT $? 0 0 "卸载python3-pytest-runner失败" - fi - - LOG_INFO "测试完成:Test the dependency resolution of python3-pytest-runner" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pytest-runner/python3-pytest-runner/test_python3-pytest-runner_function_install.sh b/testcases/function_test/pkg_test/python-pytest-runner/python3-pytest-runner/test_python3-pytest-runner_function_install.sh deleted file mode 100644 index 1831d4d9c60..00000000000 --- a/testcases/function_test/pkg_test/python-pytest-runner/python3-pytest-runner/test_python3-pytest-runner_function_install.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-06 -# @License : Mulan PSL v2 -# @Desc : Test the installation functionality of python3-pytest-runner -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 python3-pytest-runner 的安装功能" - - # 检查是否已安装 python3-pytest-runner - LOG_INFO "检查是否已安装 python3-pytest-runner" - if dnf list installed python3-pytest-runner &>/dev/null; then - LOG_INFO "python3-pytest-runner 已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-pytest-runner 未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否存在 python3-pytest-runner - LOG_INFO "检查 yum 源中是否存在 python3-pytest-runner" - if ! dnf list available python3-pytest-runner &>/dev/null; then - LOG_ERROR "yum 源中未找到 python3-pytest-runner" - exit 255 - fi - - # 安装 python3-pytest-runner - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 python3-pytest-runner" - dnf install -y python3-pytest-runner - CHECK_RESULT $? 0 0 "安装 python3-pytest-runner 失败" - fi - - # 验证 python3-pytest-runner 是否安装成功 - LOG_INFO "验证 python3-pytest-runner 是否安装成功" - if ! command -v pytest-runner &>/dev/null; then - LOG_ERROR "python3-pytest-runner 安装后未找到 pytest-runner 命令" - exit 1 - fi - - # 测试 pytest-runner 命令 - LOG_INFO "测试 pytest-runner 命令" - pytest-runner --version - CHECK_RESULT $? 0 0 "pytest-runner 命令执行失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 python3-pytest-runner" - dnf remove -y python3-pytest-runner - CHECK_RESULT $? 0 0 "卸载 python3-pytest-runner 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pytest-runner/python3-pytest-runner/test_python3-pytest-runner_function_run.sh b/testcases/function_test/pkg_test/python-pytest-runner/python3-pytest-runner/test_python3-pytest-runner_function_run.sh deleted file mode 100644 index 04494e29520..00000000000 --- a/testcases/function_test/pkg_test/python-pytest-runner/python3-pytest-runner/test_python3-pytest-runner_function_run.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-06 -# @License : Mulan PSL v2 -# @Desc : Test the running functionality of python3-pytest-runner -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在python3-pytest-runner软件包 - LOG_INFO "检查yum源中是否存在python3-pytest-runner软件包" - dnf list available python3-pytest-runner > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在python3-pytest-runner软件包" - exit 255 - fi - - # 检查是否已安装python3-pytest-runner - LOG_INFO "检查是否已安装python3-pytest-runner" - rpm -q python3-pytest-runner > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-pytest-runner已安装,无需重复安装" - installed=true - else - installed=false - # 安装python3-pytest-runner - LOG_INFO "安装python3-pytest-runner" - dnf install -y python3-pytest-runner - CHECK_RESULT $? 0 0 "安装python3-pytest-runner失败" - fi - - # 测试python3-pytest-runner运行功能 - LOG_INFO "测试python3-pytest-runner运行功能" - pytest-runner --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "python3-pytest-runner运行功能测试失败" - - # 清理环境,恢复到之前的状态 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-pytest-runner" - dnf remove -y python3-pytest-runner - CHECK_RESULT $? 0 0 "卸载python3-pytest-runner失败" - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file From 16d00df7cc45fefe507544a67d931319989aa538 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 09:56:24 +0800 Subject: [PATCH 07/18] update testcase for testsuite boilerpipe-javadoc --- .../boilerpipe/boilerpipe-javadoc.json | 14 ---- ...est_boilerpipe-javadoc_function_extract.sh | 76 ------------------- .../test_boilerpipe-javadoc_function_parse.sh | 63 --------------- 3 files changed, 153 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/boilerpipe/boilerpipe-javadoc.json delete mode 100644 testcases/function_test/pkg_test/boilerpipe/boilerpipe-javadoc/test_boilerpipe-javadoc_function_extract.sh delete mode 100644 testcases/function_test/pkg_test/boilerpipe/boilerpipe-javadoc/test_boilerpipe-javadoc_function_parse.sh diff --git a/suite2cases/function_test/pkg_test/boilerpipe/boilerpipe-javadoc.json b/suite2cases/function_test/pkg_test/boilerpipe/boilerpipe-javadoc.json deleted file mode 100644 index 8d6f3b953ed..00000000000 --- a/suite2cases/function_test/pkg_test/boilerpipe/boilerpipe-javadoc.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/boilerpipe/boilerpipe-javadoc", - "machine num": 1, - "cases": [ - { - "name": "test_boilerpipe-javadoc_function_extract", - "desc": "Test content extraction" - }, - { - "name": "test_boilerpipe-javadoc_function_parse", - "desc": "Test HTML parsing" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/boilerpipe/boilerpipe-javadoc/test_boilerpipe-javadoc_function_extract.sh b/testcases/function_test/pkg_test/boilerpipe/boilerpipe-javadoc/test_boilerpipe-javadoc_function_extract.sh deleted file mode 100644 index ddd992d233a..00000000000 --- a/testcases/function_test/pkg_test/boilerpipe/boilerpipe-javadoc/test_boilerpipe-javadoc_function_extract.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : Test content extraction -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试内容提取功能" - - # 检查是否已安装boilerpipe-javadoc软件包 - LOG_INFO "检查boilerpipe-javadoc是否已安装" - if dnf list installed boilerpipe-javadoc &>/dev/null; then - LOG_INFO "boilerpipe-javadoc已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "boilerpipe-javadoc未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有boilerpipe-javadoc软件包 - LOG_INFO "检查yum源中是否存在boilerpipe-javadoc软件包" - if ! dnf list available boilerpipe-javadoc &>/dev/null; then - LOG_ERROR "yum源中未找到boilerpipe-javadoc软件包" - exit 255 - fi - - # 安装boilerpipe-javadoc软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装boilerpipe-javadoc软件包" - dnf install -y boilerpipe-javadoc - CHECK_RESULT $? 0 0 "安装boilerpipe-javadoc失败" - fi - - # 测试内容提取功能 - LOG_INFO "测试内容提取功能" - output=$(boilerpipe-extractor --help) - CHECK_RESULT $? 0 0 "执行内容提取命令失败" - - # 检查参数支持情况 - LOG_INFO "检查参数支持情况" - if ! echo "$output" | grep -q "\-\-extract"; then - LOG_ERROR "参数--extract不支持或不存在" - exit 255 - fi - - # 执行实际内容提取测试 - LOG_INFO "执行实际内容提取测试" - boilerpipe-extractor --extract http://example.com - CHECK_RESULT $? 0 0 "内容提取测试失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载boilerpipe-javadoc软件包" - dnf remove -y boilerpipe-javadoc - CHECK_RESULT $? 0 0 "卸载boilerpipe-javadoc失败" - fi - - LOG_INFO "测试内容提取功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/boilerpipe/boilerpipe-javadoc/test_boilerpipe-javadoc_function_parse.sh b/testcases/function_test/pkg_test/boilerpipe/boilerpipe-javadoc/test_boilerpipe-javadoc_function_parse.sh deleted file mode 100644 index 693dc46e15d..00000000000 --- a/testcases/function_test/pkg_test/boilerpipe/boilerpipe-javadoc/test_boilerpipe-javadoc_function_parse.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-09 -# @License : Mulan PSL v2 -# @Desc : Test HTML parsing -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装boilerpipe-javadoc - LOG_INFO "检查是否已安装boilerpipe-javadoc" - if dnf list installed boilerpipe-javadoc &>/dev/null; then - LOG_INFO "boilerpipe-javadoc已安装" - installed=true - else - LOG_INFO "boilerpipe-javadoc未安装" - installed=false - fi - - # 检查yum源中是否存在boilerpipe-javadoc - LOG_INFO "检查yum源中是否存在boilerpipe-javadoc" - if ! dnf list available boilerpipe-javadoc &>/dev/null; then - LOG_ERROR "yum源中未找到boilerpipe-javadoc" - exit 255 - fi - - # 如果未安装,则安装boilerpipe-javadoc - if [ "$installed" = false ]; then - LOG_INFO "开始安装boilerpipe-javadoc" - dnf install -y boilerpipe-javadoc - CHECK_RESULT $? 0 0 "安装boilerpipe-javadoc失败" - fi - - # 测试HTML解析功能 - LOG_INFO "测试HTML解析功能" - output=$(java -cp /usr/share/java/boilerpipe-javadoc.jar TestHTMLParsing) - CHECK_RESULT $? 0 0 "HTML解析测试失败" - LOG_INFO "HTML解析测试输出: $output" - - # 如果脚本开始时未安装,则卸载boilerpipe-javadoc - if [ "$installed" = false ]; then - LOG_INFO "卸载boilerpipe-javadoc" - dnf remove -y boilerpipe-javadoc - CHECK_RESULT $? 0 0 "卸载boilerpipe-javadoc失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file From b1be964b8c16e93a8cecacf71e427539a4a664b4 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 09:59:17 +0800 Subject: [PATCH 08/18] update testcase for testsuite texlive-present --- .../texlive-split-s/texlive-present.json | 20 --- ..._texlive-present_function_basic_compile.sh | 122 ---------------- ...texlive-present_function_figure_include.sh | 99 ------------- ...t_texlive-present_function_math_typeset.sh | 133 ------------------ ...st_texlive-present_function_theme_usage.sh | 89 ------------ .../test_texlive-present_function_version.sh | 69 --------- 6 files changed, 532 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-s/texlive-present/test_texlive-present_function_basic_compile.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-s/texlive-present/test_texlive-present_function_figure_include.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-s/texlive-present/test_texlive-present_function_math_typeset.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-s/texlive-present/test_texlive-present_function_theme_usage.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-s/texlive-present/test_texlive-present_function_version.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-s/texlive-present.json b/suite2cases/function_test/pkg_test/texlive-split-s/texlive-present.json index 767188e957b..b3520878cec 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-s/texlive-present.json +++ b/suite2cases/function_test/pkg_test/texlive-split-s/texlive-present.json @@ -13,26 +13,6 @@ { "name": "test_texlive-present_function_remove", "desc": "Test the removal of texlive-present package" - }, - { - "name": "test_texlive-present_function_version", - "desc": "Test querying texlive-present version info" - }, - { - "name": "test_texlive-present_function_basic_compile", - "desc": "Test basic beamer presentation compile" - }, - { - "name": "test_texlive-present_function_theme_usage", - "desc": "Test using beamer themes and colors" - }, - { - "name": "test_texlive-present_function_math_typeset", - "desc": "Test math typesetting in presentation" - }, - { - "name": "test_texlive-present_function_figure_include", - "desc": "Test including figures in slides" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-s/texlive-present/test_texlive-present_function_basic_compile.sh b/testcases/function_test/pkg_test/texlive-split-s/texlive-present/test_texlive-present_function_basic_compile.sh deleted file mode 100644 index 58dfbff463e..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-s/texlive-present/test_texlive-present_function_basic_compile.sh +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-28 -# @License : Mulan PSL v2 -# @Desc : Test basic beamer presentation compile -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试基础beamer演示文稿编译功能 - - LOG_INFO "开始测试基础beamer演示文稿编译功能" - - # 检查系统是否已安装texlive-beamer - LOG_INFO "检查系统是否已安装texlive-beamer" - if rpm -q texlive-beamer &> /dev/null; then - LOG_INFO "系统已安装texlive-beamer,测试后将保持安装状态" - already_installed=true - else - LOG_INFO "系统未安装texlive-beamer,将进行安装测试" - already_installed=false - fi - - # 检查yum源中是否有texlive-beamer软件包 - LOG_INFO "检查yum源中是否有texlive-beamer软件包" - if ! dnf list available texlive-beamer &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-beamer软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-beamer - if [ "$already_installed" = false ]; then - LOG_INFO "安装texlive-beamer软件包" - dnf install -y texlive-beamer - CHECK_RESULT $? 0 0 "安装texlive-beamer失败" - fi - - # 创建测试用的beamer演示文稿文件 - LOG_INFO "创建测试用的beamer演示文稿文件" - cat > test_presentation.tex << "EOF" - \documentclass{beamer} - \usetheme{Madrid} - \title{测试演示文稿} - \author{测试作者} - \date{\today} - \begin{document} - \frame{\titlepage} - \begin{frame} - \frametitle{测试框架} - 这是一个测试用的beamer演示文稿。 - \end{frame} - \end{document} - EOF - - CHECK_RESULT $? 0 0 "创建测试演示文稿文件失败" - - # 检查pdflatex命令是否存在 - LOG_INFO "检查pdflatex命令是否存在" - if ! command -v pdflatex &> /dev/null; then - LOG_ERROR "pdflatex命令不存在" - # 如果是安装测试,需要卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "清理环境:卸载texlive-beamer" - dnf remove -y texlive-beamer - fi - exit 255 - fi - - # 编译beamer演示文稿 - LOG_INFO "编译beamer演示文稿" - pdflatex -interaction=nonstopmode test_presentation.tex - CHECK_RESULT $? 0 0 "编译beamer演示文稿失败" - - # 检查是否生成PDF文件 - LOG_INFO "检查是否生成PDF文件" - if [ -f "test_presentation.pdf" ]; then - LOG_INFO "成功生成PDF文件:test_presentation.pdf" - # 检查PDF文件大小 - pdf_size=$(stat -c%s "test_presentation.pdf") - if [ "$pdf_size" -gt 0 ]; then - LOG_INFO "PDF文件大小正常:${pdf_size}字节" - else - LOG_ERROR "生成的PDF文件大小为0" - CHECK_RESULT 1 0 0 "PDF文件大小异常" - fi - else - LOG_ERROR "未生成PDF文件" - CHECK_RESULT 1 0 0 "PDF文件生成失败" - fi - - # 清理生成的中间文件 - LOG_INFO "清理生成的中间文件" - rm -f test_presentation.aux test_presentation.log test_presentation.nav test_presentation.out test_presentation.snm test_presentation.toc - - # 如果是在测试中安装的软件包,测试完成后卸载 - if [ "$already_installed" = false ]; then - LOG_INFO "清理环境:卸载texlive-beamer" - dnf remove -y texlive-beamer - CHECK_RESULT $? 0 0 "卸载texlive-beamer失败" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_presentation.tex test_presentation.pdf - - LOG_INFO "基础beamer演示文稿编译功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-s/texlive-present/test_texlive-present_function_figure_include.sh b/testcases/function_test/pkg_test/texlive-split-s/texlive-present/test_texlive-present_function_figure_include.sh deleted file mode 100644 index bb2e098e73a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-s/texlive-present/test_texlive-present_function_figure_include.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-28 -# @License : Mulan PSL v2 -# @Desc : Test including figures in slides -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:在幻灯片中包含图表功能" - - # 定义软件包名称 - PACKAGE_NAME="texlive-present" - LOG_INFO "测试步骤1:检查yum源中是否存在${PACKAGE_NAME}软件包" - dnf list available ${PACKAGE_NAME} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "测试步骤2:检查系统是否已安装${PACKAGE_NAME}" - rpm -q ${PACKAGE_NAME} &>/dev/null - if [ $? -eq 0 ]; then - ALREADY_INSTALLED=1 - LOG_INFO "系统已安装${PACKAGE_NAME},测试结束后将保持安装状态" - else - ALREADY_INSTALLED=0 - LOG_INFO "系统未安装${PACKAGE_NAME},将进行安装测试" - fi - - # 如果未安装,则安装 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "测试步骤3:安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败" - fi - - # 测试基本命令和参数 - LOG_INFO "测试步骤4:验证texlive-present基本命令" - which present &>/dev/null - CHECK_RESULT $? 0 0 "未找到present命令" - - LOG_INFO "测试步骤5:测试present命令的--help参数" - present --help &>/dev/null - CHECK_RESULT $? 0 0 "present命令不支持--help参数" - - # 测试包含图表的功能 - LOG_INFO "测试步骤6:创建测试幻灯片文件包含图表" - TEST_FILE="test_slide.tex" - cat > ${TEST_FILE} << "EOF" - \documentclass{beamer} - \usepackage{graphicx} - \begin{document} - \begin{frame} - \frametitle{包含图表的幻灯片} - \begin{figure} - \includegraphics[width=0.8\textwidth]{example-image} - \caption{示例图表} - \end{figure} - \end{frame} - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - LOG_INFO "测试步骤7:编译包含图表的幻灯片" - pdflatex -interaction=nonstopmode ${TEST_FILE} &>/dev/null - CHECK_RESULT $? 0 0 "编译包含图表的幻灯片失败" - - # 清理测试文件 - LOG_INFO "测试步骤8:清理测试生成的文件" - rm -f ${TEST_FILE} *.aux *.log *.nav *.out *.snm *.toc *.pdf 2>/dev/null - - # 如果测试前未安装,则卸载软件包 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "测试步骤9:卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败" - else - LOG_INFO "测试步骤9:保持${PACKAGE_NAME}安装状态" - fi - - LOG_INFO "测试完成:在幻灯片中包含图表功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-s/texlive-present/test_texlive-present_function_math_typeset.sh b/testcases/function_test/pkg_test/texlive-split-s/texlive-present/test_texlive-present_function_math_typeset.sh deleted file mode 100644 index 2cb4d0aa2a1..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-s/texlive-present/test_texlive-present_function_math_typeset.sh +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-28 -# @License : Mulan PSL v2 -# @Desc : Test math typesetting in presentation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试数学公式排版功能 - LOG_INFO "测试开始:验证数学公式排版功能" - - # 定义软件包名称 - PACKAGE_NAME="texlive-presentation" - LOG_INFO "检查软件包:${PACKAGE_NAME}" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在软件包" - dnf list available ${PACKAGE_NAME} 2>/dev/null | grep -q ${PACKAGE_NAME} - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 在yum源中不存在" - exit 255 - fi - - # 检查当前是否已安装 - LOG_INFO "检查软件包是否已安装" - rpm -q ${PACKAGE_NAME} >/dev/null 2>&1 - INSTALLED=$? - - # 记录初始安装状态 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "软件包已安装,测试后将保持安装状态" - NEED_CLEANUP=0 - else - LOG_INFO "软件包未安装,测试后将卸载" - NEED_CLEANUP=1 - fi - - # 如果未安装,则安装软件包 - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "安装软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "软件包安装失败" - fi - - # 验证tex命令是否可用 - LOG_INFO "检查tex命令是否可用" - which tex >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "tex命令不存在" - - # 创建测试LaTeX文档 - LOG_INFO "创建测试LaTeX文档" - TEST_FILE="test_math.tex" - cat > ${TEST_FILE} << "EOF" - \documentclass{beamer} - \begin{document} - \begin{frame} - \frametitle{数学公式测试} - 这是一个行内公式:$E = mc^2$ - - 这是一个行间公式: - \[ - \int_{a}^{b} f(x) dx = F(b) - F(a) - \] - - 这是另一个行间公式: - \begin{equation} - \frac{\partial u}{\partial t} = \alpha \nabla^2 u - \end{equation} - \end{frame} - \end{document} - EOF - - # 检查文件是否创建成功 - [ -f "${TEST_FILE}" ] - CHECK_RESULT $? 0 0 "测试文件创建失败" - - # 编译LaTeX文档 - LOG_INFO "编译LaTeX文档" - pdflatex -interaction=nonstopmode ${TEST_FILE} >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "LaTeX文档编译失败" - - # 检查生成的PDF文件 - LOG_INFO "检查生成的PDF文件" - [ -f "test_math.pdf" ] - CHECK_RESULT $? 0 0 "PDF文件生成失败" - - # 检查PDF文件大小(确保不是空文件) - LOG_INFO "验证PDF文件内容" - PDF_SIZE=$(stat -c%s "test_math.pdf" 2>/dev/null || stat -f%z "test_math.pdf") - if [ $PDF_SIZE -lt 1000 ]; then - LOG_ERROR "生成的PDF文件过小,可能内容为空" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_math.tex test_math.log test_math.aux test_math.nav test_math.out test_math.snm test_math.toc test_math.pdf 2>/dev/null - - # 如果测试前未安装,则卸载软件包 - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "软件包卸载失败" - - # 验证已卸载 - rpm -q ${PACKAGE_NAME} >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "软件包卸载失败" - exit 1 - fi - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成:数学公式排版功能正常" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-s/texlive-present/test_texlive-present_function_theme_usage.sh b/testcases/function_test/pkg_test/texlive-split-s/texlive-present/test_texlive-present_function_theme_usage.sh deleted file mode 100644 index 7bec399eb83..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-s/texlive-present/test_texlive-present_function_theme_usage.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-28 -# @License : Mulan PSL v2 -# @Desc : Test using beamer themes and colors -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:Test using beamer themes and colors" - - LOG_INFO "步骤1:检查是否已安装texlive-beamer包" - if dnf list installed texlive-beamer &>/dev/null; then - LOG_INFO "texlive-beamer已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-beamer未安装,将在测试中安装" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否有texlive-beamer包" - if ! dnf list available texlive-beamer &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-beamer包" - exit 255 - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装texlive-beamer包" - dnf install -y texlive-beamer - CHECK_RESULT $? 0 0 "安装texlive-beamer失败" - fi - - LOG_INFO "步骤4:创建测试LaTeX文档测试beamer主题和颜色" - cat > test_theme.tex << "EOF" - \documentclass{beamer} - \usetheme{Madrid} - \usecolortheme{beaver} - \begin{document} - \begin{frame} - \frametitle{测试标题} - 这是一个测试beamer主题和颜色的文档。 - \end{frame} - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文档失败" - - LOG_INFO "步骤5:使用pdflatex编译测试文档" - pdflatex -interaction=nonstopmode test_theme.tex - CHECK_RESULT $? 0 0 "编译LaTeX文档失败" - - LOG_INFO "步骤6:检查生成的PDF文件" - if [ -f test_theme.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件未生成" - exit 1 - fi - - LOG_INFO "步骤7:清理生成的中间文件" - rm -f test_theme.aux test_theme.log test_theme.nav test_theme.out test_theme.snm test_theme.toc - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤8:卸载texlive-beamer包恢复环境" - dnf remove -y texlive-beamer - CHECK_RESULT $? 0 0 "卸载texlive-beamer失败" - fi - - LOG_INFO "步骤9:删除测试文件" - rm -f test_theme.tex test_theme.pdf - - LOG_INFO "测试完成:Test using beamer themes and colors" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-s/texlive-present/test_texlive-present_function_version.sh b/testcases/function_test/pkg_test/texlive-split-s/texlive-present/test_texlive-present_function_version.sh deleted file mode 100644 index 0d1714d27f0..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-s/texlive-present/test_texlive-present_function_version.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-28 -# @License : Mulan PSL v2 -# @Desc : Test querying texlive-present version info -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:查询texlive-present版本信息" - - # 检查texlive-present是否已安装 - LOG_INFO "步骤1:检查texlive-present是否已安装" - if rpm -q texlive-present &>/dev/null; then - LOG_INFO "texlive-present已安装" - INSTALLED=true - else - LOG_INFO "texlive-present未安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-present软件包 - LOG_INFO "步骤2:检查yum源中是否有texlive-present软件包" - if ! dnf list available texlive-present &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-present软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-present软件包" - dnf install -y texlive-present - CHECK_RESULT $? 0 0 "安装texlive-present失败" - fi - - # 查询texlive-present版本信息 - LOG_INFO "步骤4:查询texlive-present版本信息" - if command -v texlive-present &>/dev/null; then - texlive-present --version - CHECK_RESULT $? 0 0 "查询texlive-present版本信息失败" - else - LOG_ERROR "texlive-present命令不存在或不支持" - exit 255 - fi - - # 环境恢复:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤5:卸载texlive-present软件包" - dnf remove -y texlive-present - CHECK_RESULT $? 0 0 "卸载texlive-present失败" - fi - - LOG_INFO "测试完成:查询texlive-present版本信息" -} - -main "$@" \ No newline at end of file From 1a05d9ccc19cdeb2976c354f916f43d7f40c5307 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 09:59:44 +0800 Subject: [PATCH 09/18] update testcase for testsuite texlive-ec --- .../pkg_test/texlive-split-h/texlive-ec.json | 22 ----- .../test_texlive-ec_function_check_fonts.sh | 75 ----------------- .../test_texlive-ec_function_install.sh | 83 ------------------- .../test_texlive-ec_function_uninstall.sh | 63 -------------- .../test_texlive-ec_function_use_in_doc.sh | 83 ------------------- 5 files changed, 326 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-h/texlive-ec.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-h/texlive-ec/test_texlive-ec_function_check_fonts.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-h/texlive-ec/test_texlive-ec_function_install.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-h/texlive-ec/test_texlive-ec_function_uninstall.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-h/texlive-ec/test_texlive-ec_function_use_in_doc.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-ec.json b/suite2cases/function_test/pkg_test/texlive-split-h/texlive-ec.json deleted file mode 100644 index c9408d8d5bf..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-h/texlive-ec.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-h/texlive-ec", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-ec_function_uninstall", - "desc": "Test package removal" - }, - { - "name": "test_texlive-ec_function_install", - "desc": "Test package installation and availability" - }, - { - "name": "test_texlive-ec_function_check_fonts", - "desc": "Test if EC fonts are present" - }, - { - "name": "test_texlive-ec_function_use_in_doc", - "desc": "Test using EC fonts in TeX document" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-h/texlive-ec/test_texlive-ec_function_check_fonts.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-ec/test_texlive-ec_function_check_fonts.sh deleted file mode 100644 index b06bc560fba..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-ec/test_texlive-ec_function_check_fonts.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Test if EC fonts are present -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:检查EC字体是否存在" - - # 步骤1:检查环境是否已安装texlive-ec软件包 - LOG_INFO "步骤1:检查texlive-ec软件包是否已安装" - if rpm -q texlive-ec &>/dev/null; then - LOG_INFO "texlive-ec已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ec未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 步骤2:检查yum源中是否有texlive-ec软件包 - LOG_INFO "步骤2:检查yum源中是否存在texlive-ec软件包" - if ! dnf list available texlive-ec &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-ec软件包" - exit 255 - fi - - # 步骤3:如果未安装,则安装texlive-ec软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-ec软件包" - dnf install -y texlive-ec - CHECK_RESULT $? 0 0 "安装texlive-ec失败" - fi - - # 步骤4:检查EC字体文件是否存在 - LOG_INFO "步骤4:检查EC字体文件是否存在" - # 查找EC字体文件,通常位于texlive字体目录 - FONT_FILES=$(find /usr/share/texlive/texmf-dist/fonts/ -name "*ec*" -type f 2>/dev/null | head -5) - if [ -z "$FONT_FILES" ]; then - LOG_ERROR "未找到EC字体文件" - CHECK_RESULT 1 0 0 "EC字体文件不存在" - else - LOG_INFO "找到EC字体文件:" - echo "$FONT_FILES" - CHECK_RESULT 0 0 0 "EC字体文件检查成功" - fi - - # 步骤5:清理环境,如果测试前未安装则卸载软件包 - LOG_INFO "步骤5:清理测试环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-ec软件包" - dnf remove -y texlive-ec - CHECK_RESULT $? 0 0 "卸载texlive-ec失败" - else - LOG_INFO "测试前已安装texlive-ec,保持安装状态" - fi - - LOG_INFO "测试完成:EC字体检查结束" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-h/texlive-ec/test_texlive-ec_function_install.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-ec/test_texlive-ec_function_install.sh deleted file mode 100644 index e7b8912bb9c..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-ec/test_texlive-ec_function_install.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Test package installation and availability -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装texlive-ec软件包 - LOG_INFO "检查texlive-ec软件包是否已安装" - rpm -q texlive-ec > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ec已安装,脚本结束时将保持安装状态" - already_installed=1 - else - LOG_INFO "texlive-ec未安装,将在测试中安装" - already_installed=0 - fi - - # 检查yum源中是否有texlive-ec软件包 - LOG_INFO "检查yum源中是否存在texlive-ec软件包" - dnf list available texlive-ec > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-ec软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ec软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "开始安装texlive-ec软件包" - dnf install -y texlive-ec - CHECK_RESULT $? 0 0 "安装texlive-ec软件包失败" - LOG_INFO "texlive-ec软件包安装成功" - fi - - # 验证软件包是否可用 - LOG_INFO "验证texlive-ec软件包是否可用" - # 检查texlive-ec提供的命令或文件是否存在 - # 这里假设texlive-ec会安装一些字体文件,检查是否存在 - ls /usr/share/texlive/texmf-dist/fonts/ec/* > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-ec软件包未正确安装或文件不存在" - - # 测试texlive-ec相关的命令 - LOG_INFO "测试texlive-ec相关命令" - # 假设texlive-ec包含ecfonts命令,测试其是否存在 - which ecfonts > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "测试ecfonts命令" - ecfonts --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ecfonts命令执行失败" - else - LOG_INFO "未找到ecfonts命令,跳过命令测试" - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-ec软件包" - dnf remove -y texlive-ec - CHECK_RESULT $? 0 0 "卸载texlive-ec软件包失败" - LOG_INFO "texlive-ec软件包卸载成功" - else - LOG_INFO "测试前已安装texlive-ec,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-h/texlive-ec/test_texlive-ec_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-ec/test_texlive-ec_function_uninstall.sh deleted file mode 100644 index 4b3937fe8c3..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-ec/test_texlive-ec_function_uninstall.sh +++ /dev/null @@ -1,63 +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-18 -# @License : Mulan PSL v2 -# @Desc : Test package removal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ec软件包 - LOG_INFO "检查是否已安装texlive-ec软件包" - rpm -q texlive-ec > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ec已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-ec未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在texlive-ec软件包 - LOG_INFO "检查yum源中是否存在texlive-ec软件包" - dnf list available texlive-ec > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-ec软件包" - - # 安装texlive-ec软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-ec软件包" - dnf install -y texlive-ec > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-ec失败" - fi - - # 测试卸载功能 - LOG_INFO "测试卸载texlive-ec软件包" - dnf remove -y texlive-ec > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-ec失败" - - # 恢复环境(如果最初未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "恢复环境,重新安装texlive-ec" - dnf install -y texlive-ec > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "重新安装texlive-ec失败" - else - LOG_INFO "环境已恢复为初始状态(保持安装)" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-h/texlive-ec/test_texlive-ec_function_use_in_doc.sh b/testcases/function_test/pkg_test/texlive-split-h/texlive-ec/test_texlive-ec_function_use_in_doc.sh deleted file mode 100644 index 9dd37b8e061..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-h/texlive-ec/test_texlive-ec_function_use_in_doc.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Test using EC fonts in TeX document -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "检查texlive-ec软件包是否在yum源中" - dnf list available texlive-ec > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ec软件包" - exit 255 - fi - - LOG_INFO "检查系统是否已安装texlive-ec" - rpm -q texlive-ec > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ec已安装,标记为保持安装状态" - KEEP_INSTALLED=true - else - LOG_INFO "texlive-ec未安装,标记为需要清理" - KEEP_INSTALLED=false - fi - - if [ "$KEEP_INSTALLED" = "false" ]; then - LOG_INFO "开始安装texlive-ec软件包" - dnf install -y texlive-ec - CHECK_RESULT $? 0 0 "安装texlive-ec失败" - fi - - LOG_INFO "创建测试用TeX文档" - cat > test_ec_font.tex << "EOF" - \documentclass{article} - \usepackage[T1]{fontenc} - \usepackage{ec} - \begin{document} - This is a test document using EC fonts. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文档失败" - - LOG_INFO "使用pdflatex编译TeX文档" - pdflatex -interaction=nonstopmode test_ec_font.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用EC字体编译文档失败" - - LOG_INFO "检查生成的PDF文件" - if [ -f test_ec_font.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件未生成" - exit 1 - fi - - LOG_INFO "清理生成的临时文件" - rm -f test_ec_font.aux test_ec_font.log test_ec_font.pdf test_ec_font.tex - - if [ "$KEEP_INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-ec软件包" - dnf remove -y texlive-ec - CHECK_RESULT $? 0 0 "卸载texlive-ec失败" - else - LOG_INFO "保持texlive-ec软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file From 7bba592590f568ab26e849ffbe7a1e122900c4aa Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 10:02:47 +0800 Subject: [PATCH 10/18] update testcase for testsuite libkcapi-help --- .../pkg_test/libkcapi/libkcapi-help.json | 12 --- .../test_libkcapi-help_function_info.sh | 91 ------------------- .../test_libkcapi-help_function_list.sh | 68 -------------- .../test_libkcapi-help_function_manpage.sh | 69 -------------- 4 files changed, 240 deletions(-) delete mode 100644 testcases/function_test/pkg_test/libkcapi/libkcapi-help/test_libkcapi-help_function_info.sh delete mode 100644 testcases/function_test/pkg_test/libkcapi/libkcapi-help/test_libkcapi-help_function_list.sh delete mode 100644 testcases/function_test/pkg_test/libkcapi/libkcapi-help/test_libkcapi-help_function_manpage.sh diff --git a/suite2cases/function_test/pkg_test/libkcapi/libkcapi-help.json b/suite2cases/function_test/pkg_test/libkcapi/libkcapi-help.json index c5d30b49398..f56f303fba7 100644 --- a/suite2cases/function_test/pkg_test/libkcapi/libkcapi-help.json +++ b/suite2cases/function_test/pkg_test/libkcapi/libkcapi-help.json @@ -9,18 +9,6 @@ { "name": "test_libkcapi-help_function_remove", "desc": "Test if the libkcapi-help package can be successfully removed/uninstalled." - }, - { - "name": "test_libkcapi-help_function_manpage", - "desc": "Test if the man page for libkcapi-help is available and accessible." - }, - { - "name": "test_libkcapi-help_function_info", - "desc": "Test if basic package info (version, description) can be queried." - }, - { - "name": "test_libkcapi-help_function_list", - "desc": "Test if the package installs expected documentation files." } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libkcapi/libkcapi-help/test_libkcapi-help_function_info.sh b/testcases/function_test/pkg_test/libkcapi/libkcapi-help/test_libkcapi-help_function_info.sh deleted file mode 100644 index fd63f1f91a4..00000000000 --- a/testcases/function_test/pkg_test/libkcapi/libkcapi-help/test_libkcapi-help_function_info.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-02-20 -# @License : Mulan PSL v2 -# @Desc : Test if basic package info (version, description) can be queried. -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test if basic package info (version, description) can be queried." - - LOG_INFO "步骤1: 检查libkcapi-help软件包是否在yum源中可用" - dnf list available libkcapi-help 2>/dev/null | grep -q "libkcapi-help" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到libkcapi-help软件包" - exit 255 - fi - - LOG_INFO "步骤2: 检查当前环境是否已安装libkcapi-help" - rpm -q libkcapi-help > /dev/null 2>&1 - PACKAGE_INSTALLED=$? - if [ $PACKAGE_INSTALLED -eq 0 ]; then - LOG_INFO "libkcapi-help软件包已安装,测试完成后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "libkcapi-help软件包未安装,将在测试前安装,测试后卸载" - INSTALLED_BEFORE_TEST=false - fi - - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "步骤3: 安装libkcapi-help软件包" - dnf install -y libkcapi-help - CHECK_RESULT $? 0 0 "安装libkcapi-help软件包失败" - fi - - LOG_INFO "步骤4: 检查libkcapi-help命令是否支持--version参数" - libkcapi-help --version > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "libkcapi-help命令不支持--version参数" - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - dnf remove -y libkcapi-help - fi - exit 255 - fi - - LOG_INFO "步骤5: 检查libkcapi-help命令是否支持--description参数" - libkcapi-help --description > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "libkcapi-help命令不支持--description参数" - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - dnf remove -y libkcapi-help - fi - exit 255 - fi - - LOG_INFO "步骤6: 查询libkcapi-help软件包版本信息" - VERSION_OUTPUT=$(libkcapi-help --version) - CHECK_RESULT $? 0 0 "查询版本信息失败" - LOG_INFO "版本信息: $VERSION_OUTPUT" - - LOG_INFO "步骤7: 查询libkcapi-help软件包描述信息" - DESCRIPTION_OUTPUT=$(libkcapi-help --description) - CHECK_RESULT $? 0 0 "查询描述信息失败" - LOG_INFO "描述信息: $DESCRIPTION_OUTPUT" - - LOG_INFO "步骤8: 清理测试环境" - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "卸载libkcapi-help软件包" - dnf remove -y libkcapi-help - CHECK_RESULT $? 0 0 "卸载libkcapi-help软件包失败" - else - LOG_INFO "保持libkcapi-help软件包安装状态" - fi - - LOG_INFO "测试完成:成功查询libkcapi-help软件包的基本信息(版本、描述)" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libkcapi/libkcapi-help/test_libkcapi-help_function_list.sh b/testcases/function_test/pkg_test/libkcapi/libkcapi-help/test_libkcapi-help_function_list.sh deleted file mode 100644 index 21faf11eb99..00000000000 --- a/testcases/function_test/pkg_test/libkcapi/libkcapi-help/test_libkcapi-help_function_list.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-02-20 -# @License : Mulan PSL v2 -# @Desc : Test if the package installs expected documentation files. -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:检查软件包是否安装预期的文档文件" - LOG_INFO "步骤1:检查当前环境中是否已安装libkcapi-help软件包" - rpm -q libkcapi-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "libkcapi-help软件包已安装,测试结束后将保持安装状态" - installed_before_test=true - else - LOG_INFO "libkcapi-help软件包未安装,将在测试前安装" - installed_before_test=false - fi - - if [ "$installed_before_test" = false ]; then - LOG_INFO "步骤2:检查yum源中是否存在libkcapi-help软件包" - dnf list available libkcapi-help > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到libkcapi-help软件包" - - LOG_INFO "步骤3:安装libkcapi-help软件包" - dnf install -y libkcapi-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装libkcapi-help软件包失败" - fi - - LOG_INFO "步骤4:检查libkcapi-help软件包是否安装了预期的文档文件" - rpm -ql libkcapi-help | grep -E "/usr/share/doc/|/usr/share/man/" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "libkcapi-help软件包未安装预期的文档文件" - - LOG_INFO "步骤5:检查特定命令参数是否存在" - if libkcapi-hmac --help 2>&1 | grep -q "\-\-key"; then - LOG_INFO "参数--key存在且受支持" - else - LOG_ERROR "参数--key不存在或不支持" - exit 255 - fi - - LOG_INFO "步骤6:清理测试环境" - if [ "$installed_before_test" = false ]; then - LOG_INFO "卸载libkcapi-help软件包" - dnf remove -y libkcapi-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载libkcapi-help软件包失败" - else - LOG_INFO "测试前已安装libkcapi-help,保持安装状态" - fi - - LOG_INFO "测试完成:libkcapi-help软件包安装了预期的文档文件" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libkcapi/libkcapi-help/test_libkcapi-help_function_manpage.sh b/testcases/function_test/pkg_test/libkcapi/libkcapi-help/test_libkcapi-help_function_manpage.sh deleted file mode 100644 index 3eaf786b82c..00000000000 --- a/testcases/function_test/pkg_test/libkcapi/libkcapi-help/test_libkcapi-help_function_manpage.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-20 -# @License : Mulan PSL v2 -# @Desc : Test if the man page for libkcapi-help is available and accessible. -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:判断libkcapi-help是否已安装 - LOG_INFO "检查libkcapi-help是否已安装" - rpm -q libkcapi-help > /dev/null 2>&1 - installed=$? - - # 如果未安装,则安装libkcapi-help - if [ $installed -ne 0 ]; then - LOG_INFO "libkcapi-help未安装,开始安装" - # 检查yum源中是否存在libkcapi-help软件包 - LOG_INFO "检查yum源中是否存在libkcapi-help软件包" - dnf list available libkcapi-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到libkcapi-help软件包" - exit 255 - fi - # 安装libkcapi-help - dnf install -y libkcapi-help - CHECK_RESULT $? 0 0 "安装libkcapi-help失败" - LOG_INFO "libkcapi-help安装成功" - else - LOG_INFO "libkcapi-help已安装,跳过安装步骤" - fi - - # 测试man page是否可用 - LOG_INFO "测试libkcapi-help的man page是否可用" - man -w libkcapi-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "libkcapi-help的man page不可用" - - # 测试man page内容是否可访问 - LOG_INFO "测试libkcapi-help的man page内容是否可访问" - man libkcapi-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "无法访问libkcapi-help的man page内容" - - LOG_INFO "libkcapi-help的man page测试通过" - - # 环境恢复:如果测试前未安装,则卸载libkcapi-help - if [ $installed -ne 0 ]; then - LOG_INFO "测试前未安装libkcapi-help,开始卸载" - dnf remove -y libkcapi-help - CHECK_RESULT $? 0 0 "卸载libkcapi-help失败" - LOG_INFO "libkcapi-help卸载成功,环境已恢复" - else - LOG_INFO "测试前已安装libkcapi-help,保持安装状态,无需卸载" - fi -} - -main "$@" \ No newline at end of file From 3b00501711c157403e99e1c153c538de60a99f55 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 10:03:36 +0800 Subject: [PATCH 11/18] update testcase for testsuite python3-mistune-v1 --- .../python-mistune/python3-mistune-v1.json | 28 ----- ...test_python3-mistune-v1_function_escape.sh | 79 ------------ ...est_python3-mistune-v1_function_install.sh | 68 ----------- .../test_python3-mistune-v1_function_parse.sh | 71 ----------- ...test_python3-mistune-v1_function_plugin.sh | 112 ------------------ ...python3-mistune-v1_function_render_html.sh | 86 -------------- ...t_python3-mistune-v1_function_uninstall.sh | 97 --------------- ...est_python3-mistune-v1_function_version.sh | 64 ---------- 8 files changed, 605 deletions(-) delete mode 100644 testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_escape.sh delete mode 100644 testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_install.sh delete mode 100644 testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_parse.sh delete mode 100644 testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_plugin.sh delete mode 100644 testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_render_html.sh delete mode 100644 testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_uninstall.sh delete mode 100644 testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_version.sh diff --git a/suite2cases/function_test/pkg_test/python-mistune/python3-mistune-v1.json b/suite2cases/function_test/pkg_test/python-mistune/python3-mistune-v1.json index 3be20eecbcb..887044deb46 100644 --- a/suite2cases/function_test/pkg_test/python-mistune/python3-mistune-v1.json +++ b/suite2cases/function_test/pkg_test/python-mistune/python3-mistune-v1.json @@ -6,34 +6,6 @@ "name": "test_python3-mistune-v1_install", "desc": "测试python3-mistune-v1软件包的安装功能,验证是否能够成功安装。", "machine num": 1 - }, - { - "name": "test_python3-mistune-v1_function_parse", - "desc": "测试python3-mistune-v1的Markdown解析功能,验证是否能正确解析Markdown文本。" - }, - { - "name": "test_python3-mistune-v1_function_install", - "desc": "测试python3-mistune-v1软件包的安装功能,验证是否能够成功安装到系统中。" - }, - { - "name": "test_python3-mistune-v1_function_uninstall", - "desc": "测试python3-mistune-v1软件包的卸载功能,验证是否能够完全卸载且不残留关键文件。" - }, - { - "name": "test_python3-mistune-v1_function_version", - "desc": "测试python3-mistune-v1的版本查询功能,验证是否能正确输出软件包版本信息。" - }, - { - "name": "test_python3-mistune-v1_function_render_html", - "desc": "测试python3-mistune-v1的HTML渲染功能,验证解析后的Markdown是否能正确转换为HTML。" - }, - { - "name": "test_python3-mistune-v1_function_escape", - "desc": "测试python3-mistune-v1的HTML转义功能,验证特殊字符是否能被正确转义以防止XSS。" - }, - { - "name": "test_python3-mistune-v1_function_plugin", - "desc": "测试python3-mistune-v1的插件加载功能,验证是否能成功加载并使用官方或自定义插件。" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_escape.sh b/testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_escape.sh deleted file mode 100644 index 2e8970ec057..00000000000 --- a/testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_escape.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试python3-mistune-v1的HTML转义功能,验证特殊字符是否能被正确转义以防止XSS。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试python3-mistune-v1的HTML转义功能,验证特殊字符是否能被正确转义以防止XSS。" - - LOG_INFO "步骤1:检查python3-mistune-v1软件包是否在yum源中" - if ! dnf list available python3-mistune-v1 &>/dev/null; then - LOG_ERROR "yum源中未找到python3-mistune-v1软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查当前环境是否已安装python3-mistune-v1" - if rpm -q python3-mistune-v1 &>/dev/null; then - LOG_INFO "python3-mistune-v1已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "python3-mistune-v1未安装,将在测试过程中安装,并在测试结束后卸载" - INSTALLED_BEFORE_TEST=false - fi - - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "步骤3:安装python3-mistune-v1软件包" - dnf install -y python3-mistune-v1 - CHECK_RESULT $? 0 0 "安装python3-mistune-v1失败" - fi - - LOG_INFO "步骤4:验证mistune命令是否支持escape参数" - if ! python3 -m mistune --help 2>&1 | grep -q "escape"; then - LOG_ERROR "mistune命令不支持escape参数" - exit 255 - fi - - LOG_INFO "步骤5:测试HTML转义功能,验证特殊字符是否能被正确转义以防止XSS" - TEST_INPUT=" & < > \" "" - EXPECTED_OUTPUT="<script>alert('xss')</script> & < > " '" - ACTUAL_OUTPUT=$(python3 -m mistune escape "$TEST_INPUT") - CHECK_RESULT $? 0 0 "执行mistune escape命令失败" - - if [ "$ACTUAL_OUTPUT" = "$EXPECTED_OUTPUT" ]; then - LOG_INFO "HTML转义功能测试通过,特殊字符被正确转义" - else - LOG_ERROR "HTML转义功能测试失败,期望输出: $EXPECTED_OUTPUT, 实际输出: $ACTUAL_OUTPUT" - exit 1 - fi - - LOG_INFO "步骤6:清理测试环境,恢复到之前的状态" - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "卸载python3-mistune-v1软件包" - dnf remove -y python3-mistune-v1 - CHECK_RESULT $? 0 0 "卸载python3-mistune-v1失败" - else - LOG_INFO "测试前已安装python3-mistune-v1,保持安装状态" - fi - - LOG_INFO "测试完成,环境已恢复。" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_install.sh b/testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_install.sh deleted file mode 100644 index ef557df32b9..00000000000 --- a/testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_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-08 -# @License : Mulan PSL v2 -# @Desc : 测试python3-mistune-v1软件包的安装功能,验证是否能够成功安装到系统中。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查python3-mistune-v1软件包是否已安装 - LOG_INFO "检查python3-mistune-v1软件包是否已安装" - rpm -q python3-mistune-v1 > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-mistune-v1软件包已安装" - already_installed=1 - else - LOG_INFO "python3-mistune-v1软件包未安装" - already_installed=0 - fi - - # 检查yum源中是否存在python3-mistune-v1软件包 - LOG_INFO "检查yum源中是否存在python3-mistune-v1软件包" - dnf list available python3-mistune-v1 > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在python3-mistune-v1软件包" - exit 255 - fi - LOG_INFO "yum源中存在python3-mistune-v1软件包" - - # 如果软件包未安装,则进行安装测试 - if [ $already_installed -eq 0 ]; then - LOG_INFO "开始安装python3-mistune-v1软件包" - dnf install -y python3-mistune-v1 - CHECK_RESULT $? 0 0 "安装python3-mistune-v1软件包失败" - LOG_INFO "python3-mistune-v1软件包安装成功" - - # 验证软件包是否成功安装 - LOG_INFO "验证python3-mistune-v1软件包是否成功安装" - rpm -q python3-mistune-v1 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证python3-mistune-v1软件包安装失败" - LOG_INFO "python3-mistune-v1软件包验证成功" - - # 清理环境:卸载已安装的软件包 - LOG_INFO "清理环境:卸载python3-mistune-v1软件包" - dnf remove -y python3-mistune-v1 - CHECK_RESULT $? 0 0 "卸载python3-mistune-v1软件包失败" - LOG_INFO "python3-mistune-v1软件包卸载成功" - else - LOG_INFO "python3-mistune-v1软件包已存在,跳过安装测试" - fi - - LOG_INFO "测试python3-mistune-v1软件包的安装功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_parse.sh b/testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_parse.sh deleted file mode 100644 index 9203538b807..00000000000 --- a/testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_parse.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-09 -# @License : Mulan PSL v2 -# @Desc : 测试python3-mistune-v1的Markdown解析功能,验证是否能正确解析Markdown文本。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试python3-mistune-v1的Markdown解析功能,验证是否能正确解析Markdown文本。" - - # 检查是否已安装python3-mistune-v1 - LOG_INFO "检查是否已安装python3-mistune-v1" - if dnf list installed python3-mistune-v1 &>/dev/null; then - LOG_INFO "python3-mistune-v1已安装,测试结束后保持安装状态" - installed=true - else - LOG_INFO "python3-mistune-v1未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有python3-mistune-v1软件包 - LOG_INFO "检查yum源中是否有python3-mistune-v1软件包" - if ! dnf list available python3-mistune-v1 &>/dev/null; then - LOG_ERROR "yum源中未找到python3-mistune-v1软件包" - exit 255 - fi - - # 安装python3-mistune-v1 - if [ "$installed" = false ]; then - LOG_INFO "安装python3-mistune-v1" - dnf install -y python3-mistune-v1 - CHECK_RESULT $? 0 0 "安装python3-mistune-v1失败" - fi - - # 验证Markdown解析功能 - LOG_INFO "验证Markdown解析功能" - markdown_text="# Heading\nThis is a **bold** text." - parsed_text=$(python3 -c "import mistune; print(mistune.markdown("$markdown_text"))" 2>/dev/null) - CHECK_RESULT $? 0 0 "Markdown解析失败" - - expected_output="

Heading

\n

This is a bold text.

" - if [ "$parsed_text" != "$expected_output" ]; then - LOG_ERROR "Markdown解析结果不符合预期" - exit 1 - fi - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-mistune-v1" - dnf remove -y python3-mistune-v1 - CHECK_RESULT $? 0 0 "卸载python3-mistune-v1失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_plugin.sh b/testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_plugin.sh deleted file mode 100644 index af4d145dfa8..00000000000 --- a/testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_plugin.sh +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试python3-mistune-v1的插件加载功能,验证是否能成功加载并使用官方或自定义插件。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 初始化环境变量 - LOG_INFO "开始测试python3-mistune-v1的插件加载功能" - - # 步骤1:检查python3-mistune-v1软件包是否在yum源中 - LOG_INFO "步骤1:检查python3-mistune-v1软件包是否在yum源中" - dnf list available python3-mistune-v1 > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "python3-mistune-v1软件包不在yum源中" - exit 255 - fi - - # 步骤2:检查当前是否已安装python3-mistune-v1 - LOG_INFO "步骤2:检查当前是否已安装python3-mistune-v1" - rpm -q python3-mistune-v1 > /dev/null 2>&1 - if [ $? -eq 0 ]; then - already_installed=true - LOG_INFO "python3-mistune-v1已安装,测试后将保持安装状态" - else - already_installed=false - LOG_INFO "python3-mistune-v1未安装,将在测试后卸载" - fi - - # 步骤3:如果未安装,则安装python3-mistune-v1 - if [ "$already_installed" = "false" ]; then - LOG_INFO "步骤3:安装python3-mistune-v1软件包" - dnf install -y python3-mistune-v1 - CHECK_RESULT $? 0 0 "安装python3-mistune-v1失败" - fi - - # 步骤4:验证python3-mistune-v1基本功能 - LOG_INFO "步骤4:验证python3-mistune-v1基本功能" - python3 -c "import mistune; print("mistune version:", mistune.__version__)" - CHECK_RESULT $? 0 0 "python3-mistune-v1基本功能验证失败" - - # 步骤5:测试插件加载功能 - 加载内置插件 - LOG_INFO "步骤5:测试插件加载功能 - 加载内置插件" - python3 -c " - import mistune - from mistune.plugins import plugin_strikethrough, plugin_table - - markdown = mistune.create_markdown(plugins=[plugin_strikethrough, plugin_table]) - result = markdown("~~删除线~~\\n\\n| 表头1 | 表头2 |\\n|-------|-------|\\n| 内容1 | 内容2 |") - print("插件加载测试成功,输出长度:", len(result)) - " - CHECK_RESULT $? 0 0 "内置插件加载测试失败" - - # 步骤6:测试自定义插件加载功能 - LOG_INFO "步骤6:测试自定义插件加载功能" - cat > /tmp/test_plugin.py << "EOF" - import mistune - - def custom_plugin(md): - def parse_custom_block(block, m, state): - return {"type": "custom_block", "text": m.group(1)} - - md.block.register("custom_block", r"^:::(\w+)\n", parse_custom_block) - - def render_custom_block(renderer, text): - return f"
{text}
" - - if md.renderer.NAME == "html": - md.renderer.register("custom_block", render_custom_block) - - return md - - markdown = mistune.create_markdown(plugins=[custom_plugin]) - result = markdown(":::test\n自定义内容\n:::") - print("自定义插件测试成功,输出:", result) - EOF - - python3 /tmp/test_plugin.py - CHECK_RESULT $? 0 0 "自定义插件加载测试失败" - - # 步骤7:清理临时文件 - LOG_INFO "步骤7:清理临时文件" - rm -f /tmp/test_plugin.py - - # 步骤8:恢复环境 - 如果测试前未安装,则卸载软件包 - if [ "$already_installed" = "false" ]; then - LOG_INFO "步骤8:卸载python3-mistune-v1软件包" - dnf remove -y python3-mistune-v1 - CHECK_RESULT $? 0 0 "卸载python3-mistune-v1失败" - else - LOG_INFO "步骤8:保持python3-mistune-v1安装状态" - fi - - LOG_INFO "测试完成:python3-mistune-v1插件加载功能测试成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_render_html.sh b/testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_render_html.sh deleted file mode 100644 index 5754244dc6a..00000000000 --- a/testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_render_html.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试python3-mistune-v1的HTML渲染功能,验证解析后的Markdown是否能正确转换为HTML。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试python3-mistune-v1的HTML渲染功能" - LOG_INFO "步骤1:检查python3-mistune-v1软件包是否在yum源中" - dnf list python3-mistune-v1 &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-mistune-v1软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查环境是否已安装python3-mistune-v1" - rpm -q python3-mistune-v1 &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "python3-mistune-v1已安装,测试结束后保持安装状态" - already_installed=1 - else - LOG_INFO "python3-mistune-v1未安装,将进行安装" - already_installed=0 - fi - - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤3:安装python3-mistune-v1软件包" - dnf install -y python3-mistune-v1 - CHECK_RESULT $? 0 0 "安装python3-mistune-v1失败" - fi - - LOG_INFO "步骤4:验证mistune命令是否支持HTML渲染功能" - mistune --help 2>&1 | grep -q "html" - if [ $? -ne 0 ]; then - LOG_ERROR "mistune命令不支持HTML渲染参数" - exit 255 - fi - - LOG_INFO "步骤5:创建测试Markdown文件" - cat > test_input.md << EOF - # 测试标题 - 这是一个**加粗**文本。 - - 列表项1 - - 列表项2 - EOF - - LOG_INFO "步骤6:使用mistune将Markdown渲染为HTML" - mistune test_input.md --html > output.html - CHECK_RESULT $? 0 0 "Markdown渲染为HTML失败" - - LOG_INFO "步骤7:验证生成的HTML内容" - grep -q "

测试标题

" output.html - CHECK_RESULT $? 0 0 "HTML中未找到预期的标题标签" - grep -q "加粗" output.html - CHECK_RESULT $? 0 0 "HTML中未找到预期的加粗标签" - grep -q "
  • 列表项1
  • " output.html - CHECK_RESULT $? 0 0 "HTML中未找到预期的列表项标签" - - LOG_INFO "步骤8:清理测试文件" - rm -f test_input.md output.html - - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤9:卸载python3-mistune-v1软件包" - dnf remove -y python3-mistune-v1 - CHECK_RESULT $? 0 0 "卸载python3-mistune-v1失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_uninstall.sh b/testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_uninstall.sh deleted file mode 100644 index 45650d6d38b..00000000000 --- a/testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_uninstall.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试python3-mistune-v1软件包的卸载功能,验证是否能够完全卸载且不残留关键文件。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="python3-mistune-v1" - - # 步骤1: 检查yum源中是否存在该软件包 - LOG_INFO "1. 检查yum源中是否存在软件包: ${PACKAGE_NAME}" - dnf list available ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 在yum源中不存在" - exit 255 - fi - LOG_INFO "软件包 ${PACKAGE_NAME} 在yum源中存在" - - # 步骤2: 检查当前环境是否已安装该软件包 - LOG_INFO "2. 检查当前环境是否已安装软件包: ${PACKAGE_NAME}" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE="yes" - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,将进行安装测试" - INSTALLED_BEFORE="no" - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ "${INSTALLED_BEFORE}" = "no" ]; then - LOG_INFO "3. 安装软件包: ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 安装成功" - fi - - # 步骤4: 验证软件包安装后文件存在 - LOG_INFO "4. 验证软件包安装后关键文件是否存在" - rpm -ql ${PACKAGE_NAME} | head -5 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "软件包 ${PACKAGE_NAME} 安装后未找到关键文件" - - # 步骤5: 执行卸载操作 - LOG_INFO "5. 执行卸载软件包: ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 卸载成功" - - # 步骤6: 验证软件包是否完全卸载 - LOG_INFO "6. 验证软件包是否完全卸载" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 卸载后仍存在" - exit 1 - fi - LOG_INFO "软件包 ${PACKAGE_NAME} 已完全卸载" - - # 步骤7: 检查是否残留关键文件 - LOG_INFO "7. 检查是否残留关键文件" - RESIDUAL_FILES=$(rpm -ql ${PACKAGE_NAME} 2>/dev/null | head -5) - if [ -n "${RESIDUAL_FILES}" ]; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 卸载后残留关键文件: ${RESIDUAL_FILES}" - exit 1 - fi - LOG_INFO "软件包 ${PACKAGE_NAME} 卸载后无关键文件残留" - - # 步骤8: 环境恢复 - LOG_INFO "8. 环境恢复" - if [ "${INSTALLED_BEFORE}" = "no" ]; then - LOG_INFO "测试前未安装软件包,无需重新安装" - else - LOG_INFO "重新安装软件包以恢复环境" - dnf install -y ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "重新安装软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "环境恢复完成" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_version.sh b/testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_version.sh deleted file mode 100644 index 6f3b14f07c1..00000000000 --- a/testcases/function_test/pkg_test/python-mistune/python3-mistune-v1/test_python3-mistune-v1_function_version.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 : 2026-03-08 -# @License : Mulan PSL v2 -# @Desc : 测试python3-mistune-v1的版本查询功能,验证是否能正确输出软件包版本信息。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试python3-mistune-v1的版本查询功能" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在python3-mistune-v1软件包" - dnf list available python3-mistune-v1 &>/dev/null - CHECK_RESULT $? 0 0 "软件包python3-mistune-v1在yum源中不存在" - if [ $? -ne 0 ]; then - LOG_ERROR "软件包python3-mistune-v1在yum源中不存在" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查python3-mistune-v1是否已安装" - if rpm -q python3-mistune-v1 &>/dev/null; then - LOG_INFO "python3-mistune-v1已安装,跳过安装步骤" - installed=true - else - LOG_INFO "python3-mistune-v1未安装,开始安装" - dnf install -y python3-mistune-v1 - CHECK_RESULT $? 0 0 "安装python3-mistune-v1失败" - installed=false - fi - - # 测试版本查询功能 - LOG_INFO "测试python3-mistune-v1的版本查询功能" - python3 -c "import mistune; print(mistune.__version__)" 2>/dev/null - CHECK_RESULT $? 0 0 "查询python3-mistune-v1版本失败" - - # 环境恢复 - LOG_INFO "环境恢复" - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-mistune-v1" - dnf remove -y python3-mistune-v1 - CHECK_RESULT $? 0 0 "卸载python3-mistune-v1失败" - else - LOG_INFO "保持python3-mistune-v1安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file From a8bdeb18b263d658995f3b9beae54068904b86af Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 10:06:17 +0800 Subject: [PATCH 12/18] update testcase for testsuite apr-util-devel --- .../pkg_test/apr-util/apr-util-devel.json | 88 ----------- ...r-util-devel_apu-1-config_--apu-la-file.sh | 121 ---------------- ...st_apr-util-devel_apu-1-config_--bindir.sh | 79 ---------- ...pr-util-devel_apu-1-config_--db-version.sh | 73 ---------- ..._apr-util-devel_apu-1-config_--dbm-libs.sh | 84 ----------- ...test_apr-util-devel_apu-1-config_--help.sh | 79 ---------- ...pr-util-devel_apu-1-config_--includedir.sh | 134 ----------------- ..._apr-util-devel_apu-1-config_--includes.sh | 92 ------------ ...apr-util-devel_apu-1-config_--ldap-libs.sh | 76 ---------- ...t_apr-util-devel_apu-1-config_--ldflags.sh | 77 ---------- ...test_apr-util-devel_apu-1-config_--libs.sh | 80 ---------- ...til-devel_apu-1-config_--link-ld_--libs.sh | 123 ---------------- ...apr-util-devel_apu-1-config_--old-expat.sh | 79 ---------- ...st_apr-util-devel_apu-1-config_--prefix.sh | 93 ------------ ...st_apr-util-devel_apu-1-config_--srcdir.sh | 87 ----------- ...test_apr-util-devel_function_apu_config.sh | 137 ------------------ ...t_apr-util-devel_function_basic_compile.sh | 86 ----------- ...apr-util-devel_function_check_installed.sh | 67 --------- ...st_apr-util-devel_function_link_program.sh | 84 ----------- .../test_apr-util-devel_function_remove.sh | 80 ---------- 20 files changed, 1819 deletions(-) delete mode 100644 testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--apu-la-file.sh delete mode 100644 testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--bindir.sh delete mode 100644 testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--db-version.sh delete mode 100644 testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--dbm-libs.sh delete mode 100644 testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--help.sh delete mode 100644 testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--includedir.sh delete mode 100644 testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--includes.sh delete mode 100644 testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--ldap-libs.sh delete mode 100644 testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--ldflags.sh delete mode 100644 testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--libs.sh delete mode 100644 testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--link-ld_--libs.sh delete mode 100644 testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--old-expat.sh delete mode 100644 testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--prefix.sh delete mode 100644 testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--srcdir.sh delete mode 100644 testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_function_apu_config.sh delete mode 100644 testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_function_basic_compile.sh delete mode 100644 testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_function_check_installed.sh delete mode 100644 testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_function_link_program.sh delete mode 100644 testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_function_remove.sh diff --git a/suite2cases/function_test/pkg_test/apr-util/apr-util-devel.json b/suite2cases/function_test/pkg_test/apr-util/apr-util-devel.json index 660f4a484e3..3f8773049a7 100644 --- a/suite2cases/function_test/pkg_test/apr-util/apr-util-devel.json +++ b/suite2cases/function_test/pkg_test/apr-util/apr-util-devel.json @@ -6,97 +6,9 @@ "name": "test_apr-util-devel_function_install", "desc": "Test installation of apr-util-devel package" }, - { - "name": "test_apr-util-devel_apu-1-config_--prefix", - "desc": "测试使用--prefix参数改变安装前缀" - }, - { - "name": "test_apr-util-devel_apu-1-config_--bindir", - "desc": "测试使用--bindir参数打印二进制文件安装位置" - }, - { - "name": "test_apr-util-devel_apu-1-config_--includes", - "desc": "测试使用--includes参数打印包含信息" - }, - { - "name": "test_apr-util-devel_apu-1-config_--includedir", - "desc": "测试使用--includedir参数打印头文件安装位置" - }, - { - "name": "test_apr-util-devel_apu-1-config_--ldflags", - "desc": "测试使用--ldflags参数打印链接器标志" - }, - { - "name": "test_apr-util-devel_apu-1-config_--libs", - "desc": "测试使用--libs参数打印库信息" - }, - { - "name": "test_apr-util-devel_apu-1-config_--avoid-ldap_--libs", - "desc": "测试组合使用--avoid-ldap和--libs参数,在库信息中排除ldap库" - }, - { - "name": "test_apr-util-devel_apu-1-config_--ldap-libs", - "desc": "测试使用--ldap-libs参数打印链接ldap所需的库信息" - }, - { - "name": "test_apr-util-devel_apu-1-config_--avoid-dbm_--libs", - "desc": "测试组合使用--avoid-dbm和--libs参数,在库信息中排除DBM库" - }, - { - "name": "test_apr-util-devel_apu-1-config_--dbm-libs", - "desc": "测试使用--dbm-libs参数打印链接DBM所需的附加库信息" - }, - { - "name": "test_apr-util-devel_apu-1-config_--srcdir", - "desc": "测试使用--srcdir参数打印APR-util源码目录" - }, - { - "name": "test_apr-util-devel_apu-1-config_--link-ld_--libs", - "desc": "测试组合使用--link-ld和--libs参数,获取直接链接到APR-util的库信息" - }, - { - "name": "test_apr-util-devel_apu-1-config_--link-libtool_--libs", - "desc": "测试组合使用--link-libtool和--libs参数,获取通过libtool链接到APR-util的库信息" - }, - { - "name": "test_apr-util-devel_apu-1-config_--apu-la-file", - "desc": "测试使用--apu-la-file参数打印.la文件路径" - }, - { - "name": "test_apr-util-devel_apu-1-config_--old-expat", - "desc": "测试使用--old-expat参数检查APR-util是否链接到旧版expat" - }, - { - "name": "test_apr-util-devel_apu-1-config_--db-version", - "desc": "测试使用--db-version参数打印DB版本" - }, { "name": "test_apr-util-devel_apu-1-config_--version", "desc": "测试使用--version参数打印APR-util版本号" - }, - { - "name": "test_apr-util-devel_apu-1-config_--help", - "desc": "测试使用--help参数打印帮助信息" - }, - { - "name": "test_apr-util-devel_function_check_installed", - "desc": "Verify that apr-util-devel is installed" - }, - { - "name": "test_apr-util-devel_function_basic_compile", - "desc": "Test basic compilation using apu headers" - }, - { - "name": "test_apr-util-devel_function_link_program", - "desc": "Test linking a program with apu libs" - }, - { - "name": "test_apr-util-devel_function_apu_config", - "desc": "Test basic apu-1-config usage" - }, - { - "name": "test_apr-util-devel_function_remove", - "desc": "Test removal of apr-util-devel package" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--apu-la-file.sh b/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--apu-la-file.sh deleted file mode 100644 index 8ef756e54a9..00000000000 --- a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--apu-la-file.sh +++ /dev/null @@ -1,121 +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-25 -# @License : Mulan PSL v2 -# @Desc : 测试使用--apu-la-file参数打印.la文件路径 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - - # 定义检查结果函数 - CHECK_RESULT() { - local actual=$1 - local expected=$2 - local exit_code=$3 - local error_msg=$4 - - if [ "$actual" -eq "$expected" ]; then - LOG_INFO "检查通过" - else - LOG_ERROR "$error_msg" - exit $exit_code - fi - } - - # 定义SSH命令函数 - SSH_CMD() { - local cmd=$1 - local node_ip=$2 - local node_password=$3 - local node_user=$4 - - sshpass -p "$node_password" ssh -o StrictHostKeyChecking=no "$node_user@$node_ip" "$cmd" - } - - # 主测试函数 - main() { - LOG_INFO "开始测试:测试使用--apu-la-file参数打印.la文件路径" - - # 检查软件包是否已安装 - LOG_INFO "步骤1:检查apr-util-devel软件包是否已安装" - rpm -q apr-util-devel > /dev/null 2>&1 - local is_installed=$? - - # 检查yum源中是否有该软件包 - LOG_INFO "步骤2:检查yum源中是否有apr-util-devel软件包" - dnf list available apr-util-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中没有apr-util-devel软件包" - - # 如果未安装,则安装软件包 - if [ $is_installed -ne 0 ]; then - LOG_INFO "步骤3:安装apr-util-devel软件包" - dnf install -y apr-util-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 1 "安装apr-util-devel软件包失败" - else - LOG_INFO "步骤3:apr-util-devel软件包已安装,跳过安装步骤" - fi - - # 检查apu-1-config命令是否存在 - LOG_INFO "步骤4:检查apu-1-config命令是否存在" - which apu-1-config > /dev/null 2>&1 - CHECK_RESULT $? 0 1 "apu-1-config命令不存在" - - # 检查--apu-la-file参数是否支持 - LOG_INFO "步骤5:检查--apu-la-file参数是否支持" - apu-1-config --help 2>&1 | grep -q -- "--apu-la-file" - CHECK_RESULT $? 0 255 "apu-1-config命令不支持--apu-la-file参数" - - # 执行测试命令 - LOG_INFO "步骤6:执行apu-1-config --apu-la-file命令" - apu-1-config --apu-la-file > /dev/null 2>&1 - CHECK_RESULT $? 0 1 "执行apu-1-config --apu-la-file命令失败" - - # 验证输出结果 - LOG_INFO "步骤7:验证输出结果包含.la文件路径" - local output=$(apu-1-config --apu-la-file 2>&1) - if echo "$output" | grep -q "\.la$"; then - LOG_INFO "输出包含.la文件路径:$output" - else - LOG_ERROR "输出不包含.la文件路径:$output" - exit 1 - fi - - # 清理环境:如果之前未安装,则卸载软件包 - if [ $is_installed -ne 0 ]; then - LOG_INFO "步骤8:清理环境,卸载apr-util-devel软件包" - dnf remove -y apr-util-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 1 "卸载apr-util-devel软件包失败" - else - LOG_INFO "步骤8:保持apr-util-devel软件包安装状态" - fi - - LOG_INFO "测试完成:所有步骤执行成功" - } - - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--bindir.sh b/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--bindir.sh deleted file mode 100644 index 1bab8f9590e..00000000000 --- a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--bindir.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试使用--bindir参数打印二进制文件安装位置 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装apr-util-devel软件包 - LOG_INFO "检查是否已安装apr-util-devel软件包" - rpm -q apr-util-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "apr-util-devel软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "apr-util-devel软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在apr-util-devel软件包 - LOG_INFO "检查yum源中是否存在apr-util-devel软件包" - dnf list available apr-util-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在apr-util-devel软件包" - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装apr-util-devel软件包" - dnf install -y apr-util-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装apr-util-devel软件包失败" - fi - - # 测试apu-1-config命令是否支持--bindir参数 - LOG_INFO "检查apu-1-config命令是否支持--bindir参数" - apu-1-config --help 2>&1 | grep -q "\-\-bindir" - CHECK_RESULT $? 0 255 "apu-1-config命令不支持--bindir参数" - - # 测试使用--bindir参数打印二进制文件安装位置 - LOG_INFO "测试使用--bindir参数打印二进制文件安装位置" - apu-1-config --bindir > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行apu-1-config --bindir命令失败" - - # 验证输出内容是否包含有效路径 - LOG_INFO "验证--bindir参数输出内容" - BINDIR_OUTPUT=$(apu-1-config --bindir) - if [ -n "$BINDIR_OUTPUT" ] && [ -d "$BINDIR_OUTPUT" ]; then - LOG_INFO "apu-1-config --bindir输出有效路径: $BINDIR_OUTPUT" - CHECK_RESULT $? 0 0 "apu-1-config --bindir输出无效路径" - else - LOG_ERROR "apu-1-config --bindir输出无效或空路径" - CHECK_RESULT $? 1 0 "apu-1-config --bindir输出无效路径" - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载apr-util-devel软件包" - dnf remove -y apr-util-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载apr-util-devel软件包失败" - else - LOG_INFO "测试前已安装apr-util-devel软件包,保持安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--db-version.sh b/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--db-version.sh deleted file mode 100644 index 6ed53cd4c64..00000000000 --- a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--db-version.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试使用--db-version参数打印DB版本 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 apr-util-devel 软件包的 apu-1-config --db-version 参数功能" - - # 检查是否已安装 apr-util-devel 软件包 - LOG_INFO "检查系统中是否已安装 apr-util-devel 软件包" - rpm -q apr-util-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "apr-util-devel 软件包已安装,标记为已存在" - INSTALLED_FLAG=1 - else - LOG_INFO "apr-util-devel 软件包未安装" - INSTALLED_FLAG=0 - fi - - # 检查 yum 源中是否存在 apr-util-devel 软件包 - LOG_INFO "检查 yum 源中是否存在 apr-util-devel 软件包" - dnf list available apr-util-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 apr-util-devel 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "开始安装 apr-util-devel 软件包" - dnf install -y apr-util-devel - CHECK_RESULT $? 0 0 "安装 apr-util-devel 软件包失败" - fi - - # 测试 apu-1-config --db-version 参数 - LOG_INFO "测试 apu-1-config --db-version 参数" - apu-1-config --db-version > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "apu-1-config 命令不支持 --db-version 参数" - exit 255 - fi - apu-1-config --db-version - CHECK_RESULT $? 0 0 "执行 apu-1-config --db-version 命令失败" - - # 如果之前未安装,则卸载软件包以恢复环境 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "恢复环境:卸载 apr-util-devel 软件包" - dnf remove -y apr-util-devel - CHECK_RESULT $? 0 0 "卸载 apr-util-devel 软件包失败" - else - LOG_INFO "环境已安装 apr-util-devel 软件包,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--dbm-libs.sh b/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--dbm-libs.sh deleted file mode 100644 index 163ece5941b..00000000000 --- a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--dbm-libs.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-25 -# @License : Mulan PSL v2 -# @Desc : 测试使用--dbm-libs参数打印链接DBM所需的附加库信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试apr-util-devel软件包的apu-1-config --dbm-libs参数功能" - - LOG_INFO "步骤1:检查当前环境是否已安装apr-util-devel软件包" - if rpm -q apr-util-devel &>/dev/null; then - LOG_INFO "当前环境已安装apr-util-devel软件包,测试结束后将保持安装状态" - already_installed=true - else - LOG_INFO "当前环境未安装apr-util-devel软件包,将在测试步骤中安装" - already_installed=false - fi - - LOG_INFO "步骤2:检查yum源中是否存在apr-util-devel软件包" - if ! dnf list available apr-util-devel &>/dev/null; then - LOG_ERROR "yum源中未找到apr-util-devel软件包" - exit 255 - fi - - if [ "$already_installed" = false ]; then - LOG_INFO "步骤3:安装apr-util-devel软件包" - dnf install -y apr-util-devel - CHECK_RESULT $? 0 0 "安装apr-util-devel软件包失败" - fi - - LOG_INFO "步骤4:检查apu-1-config命令是否存在" - if ! command -v apu-1-config &>/dev/null; then - LOG_ERROR "apu-1-config命令不存在" - exit 255 - fi - - LOG_INFO "步骤5:检查apu-1-config命令是否支持--dbm-libs参数" - if ! apu-1-config --help 2>&1 | grep -q "\-\-dbm-libs"; then - LOG_ERROR "apu-1-config命令不支持--dbm-libs参数" - exit 255 - fi - - LOG_INFO "步骤6:执行apu-1-config --dbm-libs命令,验证其功能" - apu-1-config --dbm-libs - CHECK_RESULT $? 0 0 "执行apu-1-config --dbm-libs命令失败" - - LOG_INFO "步骤7:验证命令输出包含库信息" - output=$(apu-1-config --dbm-libs 2>&1) - if [ -z "$output" ]; then - LOG_ERROR "apu-1-config --dbm-libs未输出任何信息" - exit 1 - else - LOG_INFO "apu-1-config --dbm-libs输出内容:$output" - fi - - if [ "$already_installed" = false ]; then - LOG_INFO "步骤8:卸载测试过程中安装的apr-util-devel软件包" - dnf remove -y apr-util-devel - CHECK_RESULT $? 0 0 "卸载apr-util-devel软件包失败" - else - LOG_INFO "步骤8:环境已安装apr-util-devel,跳过卸载步骤" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--help.sh b/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--help.sh deleted file mode 100644 index 9a7fbc96edf..00000000000 --- a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--help.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试使用--help参数打印帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 apr-util-devel 软件包 apu-1-config 命令的 --help 参数" - - LOG_INFO "检查 yum 源中是否存在 apr-util-devel 软件包" - if ! dnf list available apr-util-devel &>/dev/null; then - LOG_ERROR "yum 源中未找到 apr-util-devel 软件包" - exit 255 - fi - - LOG_INFO "检查当前环境是否已安装 apr-util-devel 软件包" - if rpm -q apr-util-devel &>/dev/null; then - LOG_INFO "apr-util-devel 软件包已安装,测试完成后将保持安装状态" - already_installed=true - else - LOG_INFO "apr-util-devel 软件包未安装,将在测试前安装" - already_installed=false - fi - - if [ "$already_installed" = false ]; then - LOG_INFO "安装 apr-util-devel 软件包" - dnf install -y apr-util-devel - CHECK_RESULT $? 0 0 "安装 apr-util-devel 软件包失败" - fi - - LOG_INFO "检查 apu-1-config 命令是否存在" - if ! command -v apu-1-config &>/dev/null; then - LOG_ERROR "apu-1-config 命令不存在" - if [ "$already_installed" = false ]; then - LOG_INFO "清理环境:卸载 apr-util-devel 软件包" - dnf remove -y apr-util-devel - fi - exit 255 - fi - - LOG_INFO "检查 apu-1-config 命令是否支持 --help 参数" - if ! apu-1-config --help &>/dev/null; then - LOG_ERROR "apu-1-config 命令不支持 --help 参数" - if [ "$already_installed" = false ]; then - LOG_INFO "清理环境:卸载 apr-util-devel 软件包" - dnf remove -y apr-util-devel - fi - exit 255 - fi - - LOG_INFO "执行 apu-1-config --help 命令" - apu-1-config --help - CHECK_RESULT $? 0 0 "执行 apu-1-config --help 命令失败" - - if [ "$already_installed" = false ]; then - LOG_INFO "清理环境:卸载 apr-util-devel 软件包" - dnf remove -y apr-util-devel - CHECK_RESULT $? 0 0 "卸载 apr-util-devel 软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--includedir.sh b/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--includedir.sh deleted file mode 100644 index 23ee4dff232..00000000000 --- a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--includedir.sh +++ /dev/null @@ -1,134 +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-25 -# @License : Mulan PSL v2 -# @Desc : 测试使用--includedir参数打印头文件安装位置 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否以root用户运行 - if [ $(id -u) -ne 0 ]; then - LOG_ERROR "请使用root用户运行此脚本" - exit 1 - fi - - # 定义软件包名称 - PACKAGE_NAME="apr-util-devel" - COMMAND="apu-1-config" - PARAM="--includedir" - - LOG_INFO "开始测试${COMMAND}命令的${PARAM}参数" - - # 检查yum源中是否存在该软件包 - LOG_INFO "步骤1:检查yum源中是否存在${PACKAGE_NAME}软件包" - dnf list available ${PACKAGE_NAME} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - LOG_INFO "yum源中存在${PACKAGE_NAME}软件包" - - # 检查软件包是否已安装 - LOG_INFO "步骤2:检查${PACKAGE_NAME}是否已安装" - rpm -q ${PACKAGE_NAME} &>/dev/null - INSTALLED=$? - - # 记录初始安装状态 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "${PACKAGE_NAME}已安装,测试结束后将保持安装状态" - NEED_CLEANUP=0 - else - LOG_INFO "${PACKAGE_NAME}未安装,将在测试结束后卸载" - NEED_CLEANUP=1 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "步骤3:安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败" - LOG_INFO "安装${PACKAGE_NAME}成功" - fi - - # 检查命令是否存在 - LOG_INFO "步骤4:检查${COMMAND}命令是否存在" - which ${COMMAND} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "${COMMAND}命令不存在" - # 如果是测试安装的,需要清理 - if [ $NEED_CLEANUP -eq 1 ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit 255 - fi - LOG_INFO "${COMMAND}命令存在" - - # 检查参数是否支持 - LOG_INFO "步骤5:检查${COMMAND}命令是否支持${PARAM}参数" - ${COMMAND} --help 2>&1 | grep -q "${PARAM}" - if [ $? -ne 0 ]; then - LOG_ERROR "${COMMAND}命令不支持${PARAM}参数" - # 如果是测试安装的,需要清理 - if [ $NEED_CLEANUP -eq 1 ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit 255 - fi - LOG_INFO "${COMMAND}命令支持${PARAM}参数" - - # 执行测试命令 - LOG_INFO "步骤6:执行${COMMAND} ${PARAM}命令" - OUTPUT=$(${COMMAND} ${PARAM} 2>&1) - EXIT_CODE=$? - - # 检查命令执行结果 - if [ $EXIT_CODE -ne 0 ]; then - LOG_ERROR "执行${COMMAND} ${PARAM}失败,退出码:${EXIT_CODE}" - # 如果是测试安装的,需要清理 - if [ $NEED_CLEANUP -eq 1 ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit $EXIT_CODE - fi - - LOG_INFO "命令执行成功,输出:${OUTPUT}" - - # 验证输出内容 - LOG_INFO "步骤7:验证输出内容是否包含头文件路径" - if [ -z "${OUTPUT}" ]; then - LOG_ERROR "输出为空,未返回头文件路径" - CHECK_RESULT 1 0 0 "输出为空" - else - LOG_INFO "成功获取头文件安装位置:${OUTPUT}" - CHECK_RESULT 0 0 0 "获取头文件安装位置" - fi - - # 清理环境 - LOG_INFO "步骤8:清理测试环境" - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "卸载测试安装的${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "保持${PACKAGE_NAME}的安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--includes.sh b/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--includes.sh deleted file mode 100644 index 78d27e1f88a..00000000000 --- a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--includes.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试使用--includes参数打印包含信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装apr-util-devel - LOG_INFO "检查系统是否已安装apr-util-devel软件包" - rpm -q apr-util-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "apr-util-devel已安装,脚本结束时将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "apr-util-devel未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有apr-util-devel软件包 - LOG_INFO "检查yum源中是否有apr-util-devel软件包" - dnf list available apr-util-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有apr-util-devel软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有apr-util-devel软件包" - exit 255 - fi - - # 如果未安装,则安装apr-util-devel - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装apr-util-devel软件包" - dnf install -y apr-util-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装apr-util-devel失败" - fi - - # 检查apu-1-config命令是否支持--includes参数 - LOG_INFO "检查apu-1-config命令是否支持--includes参数" - apu-1-config --includes > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "apu-1-config命令不支持--includes参数" - # 清理环境:如果之前未安装,则卸载 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载apr-util-devel软件包" - dnf remove -y apr-util-devel > /dev/null 2>&1 - fi - exit 255 - fi - - # 执行测试:使用--includes参数打印包含信息 - LOG_INFO "执行测试:使用--includes参数打印包含信息" - INCLUDES_OUTPUT=$(apu-1-config --includes 2>&1) - CHECK_RESULT $? 0 0 "执行apu-1-config --includes命令失败" - LOG_INFO "apu-1-config --includes输出:$INCLUDES_OUTPUT" - - # 验证输出内容非空 - LOG_INFO "验证--includes参数输出内容非空" - if [ -z "$INCLUDES_OUTPUT" ]; then - LOG_ERROR "--includes参数输出为空" - CHECK_RESULT 1 0 0 "--includes参数输出为空" - else - LOG_INFO "--includes参数输出内容验证通过" - CHECK_RESULT 0 0 0 "--includes参数输出内容验证通过" - fi - - # 清理环境:如果之前未安装,则卸载 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载apr-util-devel软件包" - dnf remove -y apr-util-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载apr-util-devel失败" - LOG_INFO "环境已恢复到初始状态" - else - LOG_INFO "apr-util-devel已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--ldap-libs.sh b/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--ldap-libs.sh deleted file mode 100644 index 15542666808..00000000000 --- a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--ldap-libs.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-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试使用--ldap-libs参数打印链接ldap所需的库信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装apr-util-devel软件包 - LOG_INFO "检查apr-util-devel软件包是否已安装" - rpm -q apr-util-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "apr-util-devel软件包已安装,测试结束将保持安装状态" - INSTALLED=1 - else - LOG_INFO "apr-util-devel软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有apr-util-devel软件包 - LOG_INFO "检查yum源中是否有apr-util-devel软件包" - dnf list available apr-util-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中无apr-util-devel软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中无apr-util-devel软件包" - exit 255 - fi - - # 如果未安装,则安装apr-util-devel软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装apr-util-devel软件包" - dnf install -y apr-util-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装apr-util-devel软件包失败" - fi - - # 检查apu-1-config命令是否存在 - LOG_INFO "检查apu-1-config命令是否存在" - which apu-1-config > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "apu-1-config命令不存在" - - # 检查apu-1-config命令是否支持--ldap-libs参数 - LOG_INFO "检查apu-1-config命令是否支持--ldap-libs参数" - apu-1-config --ldap-libs > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "apu-1-config命令不支持--ldap-libs参数" - exit 255 - fi - - # 测试使用--ldap-libs参数打印链接ldap所需的库信息 - LOG_INFO "测试使用--ldap-libs参数打印链接ldap所需的库信息" - apu-1-config --ldap-libs - CHECK_RESULT $? 0 0 "执行apu-1-config --ldap-libs失败" - - # 环境恢复:如果测试前未安装,则卸载apr-util-devel软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载apr-util-devel软件包" - dnf remove -y apr-util-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载apr-util-devel软件包失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--ldflags.sh b/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--ldflags.sh deleted file mode 100644 index e2173a69568..00000000000 --- a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--ldflags.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试使用--ldflags参数打印链接器标志 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 初始化环境变量 - SCRIPT_NAME="test_apr-util-devel_apu-1-config_--ldflags" - PACKAGE_NAME="apr-util-devel" - - # 检查是否已安装目标软件包 - LOG_INFO "检查是否已安装 ${PACKAGE_NAME} 软件包" - if rpm -q ${PACKAGE_NAME} > /dev/null 2>&1; then - LOG_INFO "${PACKAGE_NAME} 已安装,标记为已存在" - PACKAGE_INSTALLED="true" - else - LOG_INFO "${PACKAGE_NAME} 未安装,标记为未存在" - PACKAGE_INSTALLED="false" - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在 ${PACKAGE_NAME} 软件包" - if ! dnf list available ${PACKAGE_NAME} > /dev/null 2>&1; then - LOG_ERROR "yum源中不存在 ${PACKAGE_NAME} 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "${PACKAGE_INSTALLED}" = "false" ]; then - LOG_INFO "开始安装 ${PACKAGE_NAME} 软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装 ${PACKAGE_NAME} 失败" - LOG_INFO "安装 ${PACKAGE_NAME} 完成" - fi - - # 检查 apu-1-config 命令是否支持 --ldflags 参数 - LOG_INFO "检查 apu-1-config 命令是否支持 --ldflags 参数" - if ! apu-1-config --help 2>&1 | grep -q -- "--ldflags"; then - LOG_ERROR "apu-1-config 命令不支持 --ldflags 参数" - exit 255 - fi - - # 测试使用 --ldflags 参数打印链接器标志 - LOG_INFO "测试使用 --ldflags 参数打印链接器标志" - apu-1-config --ldflags - CHECK_RESULT $? 0 0 "执行 apu-1-config --ldflags 失败" - - # 环境恢复:如果脚本开始时未安装,则卸载软件包 - if [ "${PACKAGE_INSTALLED}" = "false" ]; then - LOG_INFO "恢复环境:卸载 ${PACKAGE_NAME} 软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载 ${PACKAGE_NAME} 失败" - LOG_INFO "环境恢复完成" - else - LOG_INFO "环境保持已安装状态,无需卸载" - fi - - LOG_INFO "测试脚本 ${SCRIPT_NAME} 执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--libs.sh b/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--libs.sh deleted file mode 100644 index ad58179e23d..00000000000 --- a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--libs.sh +++ /dev/null @@ -1,80 +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-25 -# @License : Mulan PSL v2 -# @Desc : 测试使用--libs参数打印库信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试apr-util-devel软件包的apu-1-config命令的--libs参数功能" - LOG_INFO "步骤1:检查系统中是否已安装apr-util-devel软件包" - rpm -q apr-util-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "apr-util-devel软件包已安装,测试后将保持安装状态" - INSTALLED="true" - else - LOG_INFO "apr-util-devel软件包未安装,将在测试过程中安装" - INSTALLED="false" - fi - - LOG_INFO "步骤2:检查yum源中是否存在apr-util-devel软件包" - dnf list available apr-util-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到apr-util-devel软件包" - exit 255 - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装apr-util-devel软件包" - dnf install -y apr-util-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装apr-util-devel软件包失败" - fi - - LOG_INFO "步骤4:验证apu-1-config命令是否存在" - which apu-1-config > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未找到apu-1-config命令" - - LOG_INFO "步骤5:测试apu-1-config命令是否支持--libs参数" - apu-1-config --libs > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "apu-1-config命令不支持--libs参数" - exit 255 - fi - - LOG_INFO "步骤6:执行apu-1-config --libs命令并检查输出" - LIB_OUTPUT=$(apu-1-config --libs) - if [ -n "$LIB_OUTPUT" ]; then - LOG_INFO "apu-1-config --libs输出库信息:$LIB_OUTPUT" - CHECK_RESULT $? 0 0 "apu-1-config --libs命令执行失败" - else - LOG_ERROR "apu-1-config --libs未输出任何信息" - exit 1 - fi - - LOG_INFO "步骤7:清理测试环境" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载测试安装的apr-util-devel软件包" - dnf remove -y apr-util-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载apr-util-devel软件包失败" - else - LOG_INFO "系统原本已安装apr-util-devel,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--link-ld_--libs.sh b/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--link-ld_--libs.sh deleted file mode 100644 index d9b45309618..00000000000 --- a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--link-ld_--libs.sh +++ /dev/null @@ -1,123 +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-25 -# @License : Mulan PSL v2 -# @Desc : 测试组合使用--link-ld和--libs参数,获取直接链接到APR-util的库信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 设置环境变量 - LOG_INFO() { - echo "[INFO] $1" - } - - LOG_ERROR() { - echo "[ERROR] $1" - } - - # 检查软件包是否在yum源中 - check_package_in_repo() { - local pkg_name=$1 - LOG_INFO "检查yum源中是否存在软件包: $pkg_name" - dnf list available "$pkg_name" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在软件包: $pkg_name" - exit 255 - fi - LOG_INFO "软件包 $pkg_name 在yum源中存在" - } - - # 检查命令参数是否支持 - check_command_param() { - local cmd=$1 - local param=$2 - LOG_INFO "检查命令 $cmd 是否支持参数 $param" - $cmd --help 2>&1 | grep -q "$param" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $cmd 不支持参数 $param" - exit 255 - fi - LOG_INFO "命令 $cmd 支持参数 $param" - } - - # 主测试函数 - main_test() { - local pkg_name="apr-util-devel" - local installed=false - - # 步骤1: 检查环境是否已安装软件包 - LOG_INFO "步骤1: 检查环境是否已安装软件包 $pkg_name" - rpm -q "$pkg_name" &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $pkg_name 已安装" - installed=true - else - LOG_INFO "软件包 $pkg_name 未安装" - installed=false - fi - - # 步骤2: 如果未安装,检查yum源并安装 - if [ "$installed" = false ]; then - LOG_INFO "步骤2: 检查yum源并安装软件包 $pkg_name" - check_package_in_repo "$pkg_name" - dnf install -y "$pkg_name" - CHECK_RESULT $? 0 0 "安装软件包 $pkg_name 失败" - LOG_INFO "软件包 $pkg_name 安装成功" - fi - - # 步骤3: 检查apu-1-config命令是否存在 - LOG_INFO "步骤3: 检查apu-1-config命令是否存在" - command -v apu-1-config &>/dev/null - CHECK_RESULT $? 0 0 "apu-1-config命令不存在" - - # 步骤4: 检查--link-ld和--libs参数是否支持 - LOG_INFO "步骤4: 检查--link-ld和--libs参数是否支持" - check_command_param "apu-1-config" "--link-ld" - check_command_param "apu-1-config" "--libs" - - # 步骤5: 测试组合使用--link-ld和--libs参数 - LOG_INFO "步骤5: 测试组合使用--link-ld和--libs参数,获取直接链接到APR-util的库信息" - local output - output=$(apu-1-config --link-ld --libs 2>&1) - local cmd_result=$? - CHECK_RESULT $cmd_result 0 0 "执行apu-1-config --link-ld --libs失败" - LOG_INFO "apu-1-config --link-ld --libs 输出: $output" - - # 步骤6: 验证输出是否包含预期的库信息 - LOG_INFO "步骤6: 验证输出是否包含预期的库信息" - echo "$output" | grep -q "-laprutil" - CHECK_RESULT $? 0 0 "输出中未找到APR-util库信息" - - # 步骤7: 清理环境 - LOG_INFO "步骤7: 清理环境" - if [ "$installed" = false ]; then - LOG_INFO "卸载软件包 $pkg_name" - dnf remove -y "$pkg_name" - CHECK_RESULT $? 0 0 "卸载软件包 $pkg_name 失败" - LOG_INFO "软件包 $pkg_name 卸载成功" - else - LOG_INFO "保持软件包 $pkg_name 的安装状态" - fi - - LOG_INFO "测试完成" - } - - # 执行主测试 - main_test -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--old-expat.sh b/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--old-expat.sh deleted file mode 100644 index dcef35a2ae2..00000000000 --- a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--old-expat.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试使用--old-expat参数检查APR-util是否链接到旧版expat -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:判断apr-util-devel是否已安装 - LOG_INFO "检查apr-util-devel软件包是否已安装" - rpm -q apr-util-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "apr-util-devel已安装,标记为保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "apr-util-devel未安装,标记为需要清理安装" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否存在apr-util-devel软件包 - LOG_INFO "检查yum源中是否存在apr-util-devel软件包" - dnf list available apr-util-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到apr-util-devel软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "安装apr-util-devel软件包" - dnf install -y apr-util-devel - CHECK_RESULT $? 0 0 "安装apr-util-devel失败" - fi - - # 检查apu-1-config命令是否支持--old-expat参数 - LOG_INFO "检查apu-1-config命令是否支持--old-expat参数" - apu-1-config --help | grep -q "\-\-old-expat" - if [ $? -ne 0 ]; then - LOG_ERROR "apu-1-config命令不支持--old-expat参数" - # 如果之前未安装,则卸载软件包 - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "清理环境:卸载apr-util-devel软件包" - dnf remove -y apr-util-devel - fi - exit 255 - fi - - # 执行测试:使用--old-expat参数检查APR-util是否链接到旧版expat - LOG_INFO "执行测试:使用--old-expat参数检查APR-util是否链接到旧版expat" - apu-1-config --old-expat - CHECK_RESULT $? 0 0 "apu-1-config --old-expat执行失败" - - # 环境恢复:如果之前未安装,则卸载软件包 - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "清理环境:卸载apr-util-devel软件包" - dnf remove -y apr-util-devel - CHECK_RESULT $? 0 0 "卸载apr-util-devel失败" - else - LOG_INFO "环境保持:apr-util-devel软件包保持安装状态" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--prefix.sh b/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--prefix.sh deleted file mode 100644 index 1db6a4444b4..00000000000 --- a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--prefix.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-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试使用--prefix参数改变安装前缀 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试apr-util-devel软件包的apu-1-config命令的--prefix参数功能" - - # 检查系统中是否已安装apr-util-devel软件包 - LOG_INFO "检查是否已安装apr-util-devel软件包" - if rpm -q apr-util-devel &>/dev/null; then - LOG_INFO "apr-util-devel软件包已安装" - installed=true - else - LOG_INFO "apr-util-devel软件包未安装" - installed=false - fi - - # 检查yum源中是否有apr-util-devel软件包 - LOG_INFO "检查yum源中是否有apr-util-devel软件包" - if dnf list available apr-util-devel &>/dev/null; then - LOG_INFO "yum源中存在apr-util-devel软件包" - else - LOG_ERROR "yum源中不存在apr-util-devel软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if ! $installed; then - LOG_INFO "安装apr-util-devel软件包" - dnf install -y apr-util-devel - CHECK_RESULT $? 0 0 "安装apr-util-devel软件包失败" - fi - - # 检查apu-1-config命令是否支持--prefix参数 - LOG_INFO "检查apu-1-config命令是否支持--prefix参数" - if apu-1-config --help | grep -q -- --prefix; then - LOG_INFO "apu-1-config命令支持--prefix参数" - else - LOG_ERROR "apu-1-config命令不支持--prefix参数" - exit 255 - fi - - # 测试使用--prefix参数改变安装前缀 - LOG_INFO "测试使用--prefix参数改变安装前缀" - test_prefix="/tmp/test_prefix" - # 创建一个临时目录作为测试前缀 - mkdir -p $test_prefix - # 运行apu-1-config --prefix命令 - apu-1-config --prefix=$test_prefix - CHECK_RESULT $? 0 0 "执行apu-1-config --prefix命令失败" - - # 检查命令输出是否符合预期 - LOG_INFO "检查--prefix参数输出" - output=$(apu-1-config --prefix=$test_prefix) - expected_prefix=$test_prefix - if [[ "$output" == "$expected_prefix" ]]; then - LOG_INFO "--prefix参数功能正常" - else - LOG_ERROR "--prefix参数功能异常,期望输出:$expected_prefix,实际输出:$output" - CHECK_RESULT 1 0 0 "--prefix参数功能异常" - fi - - # 清理临时目录 - rm -rf $test_prefix - - # 如果测试前未安装软件包,则在测试结束后卸载 - if ! $installed; then - LOG_INFO "卸载apr-util-devel软件包" - dnf remove -y apr-util-devel - CHECK_RESULT $? 0 0 "卸载apr-util-devel软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--srcdir.sh b/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--srcdir.sh deleted file mode 100644 index 3b0523db05d..00000000000 --- a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_apu-1-config_--srcdir.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-02-25 -# @License : Mulan PSL v2 -# @Desc : 测试使用--srcdir参数打印APR-util源码目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用--srcdir参数打印APR-util源码目录" - - # 检查yum源中是否有apr-util-devel软件包 - LOG_INFO "检查yum源中是否存在apr-util-devel软件包" - dnf list available apr-util-devel &> /dev/null - CHECK_RESULT $? 0 0 "yum源中未找到apr-util-devel软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到apr-util-devel软件包" - exit 255 - fi - - # 检查是否已经安装了apr-util-devel - LOG_INFO "检查系统中是否已经安装了apr-util-devel" - rpm -q apr-util-devel &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "apr-util-devel已经安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "apr-util-devel未安装,将进行安装" - INSTALLED=0 - fi - - # 如果未安装,则安装apr-util-devel - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装apr-util-devel软件包" - dnf install -y apr-util-devel - CHECK_RESULT $? 0 0 "安装apr-util-devel失败" - fi - - # 检查apu-1-config命令是否支持--srcdir参数 - LOG_INFO "检查apu-1-config命令是否支持--srcdir参数" - apu-1-config --help 2>&1 | grep -q "\-\-srcdir" - CHECK_RESULT $? 0 0 "apu-1-config命令不支持--srcdir参数" - if [ $? -ne 0 ]; then - LOG_ERROR "apu-1-config命令不支持--srcdir参数" - exit 255 - fi - - # 执行测试:使用--srcdir参数打印APR-util源码目录 - LOG_INFO "执行apu-1-config --srcdir命令" - SRCDIR=$(apu-1-config --srcdir) - CHECK_RESULT $? 0 0 "执行apu-1-config --srcdir命令失败" - - # 检查输出是否非空 - LOG_INFO "检查输出结果是否非空" - if [ -n "$SRCDIR" ]; then - LOG_INFO "APR-util源码目录为: $SRCDIR" - else - LOG_ERROR "apu-1-config --srcdir未输出任何内容" - exit 1 - fi - - # 环境清理:如果测试前未安装,则卸载apr-util-devel - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载apr-util-devel软件包" - dnf remove -y apr-util-devel - CHECK_RESULT $? 0 0 "卸载apr-util-devel失败" - else - LOG_INFO "测试前已安装apr-util-devel,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_function_apu_config.sh b/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_function_apu_config.sh deleted file mode 100644 index 97135bcc0b7..00000000000 --- a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_function_apu_config.sh +++ /dev/null @@ -1,137 +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-25 -# @License : Mulan PSL v2 -# @Desc : Test basic apu-1-config usage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $1" - } - - LOG_ERROR() { - echo "[ERROR] $1" >&2 - } - - # 测试基本 apu-1-config 使用 - LOG_INFO "开始测试: Test basic apu-1-config usage" - - # 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在apr-util-devel软件包" - if ! dnf list available apr-util-devel &>/dev/null; then - LOG_ERROR "yum源中未找到apr-util-devel软件包" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查系统是否已安装apr-util-devel" - if rpm -q apr-util-devel &>/dev/null; then - LOG_INFO "apr-util-devel已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "apr-util-devel未安装,将在测试前安装并在测试后卸载" - INSTALLED_BEFORE_TEST=false - fi - - # 如果未安装则安装 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "安装apr-util-devel软件包" - dnf install -y apr-util-devel - CHECK_RESULT $? 0 0 "安装apr-util-devel失败" - fi - - # 检查apu-1-config命令是否存在 - LOG_INFO "检查apu-1-config命令是否存在" - if ! command -v apu-1-config &>/dev/null; then - LOG_ERROR "apu-1-config命令不存在" - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "清理环境:卸载apr-util-devel" - dnf remove -y apr-util-devel - fi - exit 255 - fi - - # 测试apu-1-config基本用法 - LOG_INFO "测试apu-1-config --version命令" - apu-1-config --version - CHECK_RESULT $? 0 0 "apu-1-config --version执行失败" - - LOG_INFO "测试apu-1-config --help命令" - apu-1-config --help - CHECK_RESULT $? 0 0 "apu-1-config --help执行失败" - - # 测试不支持的参数 - LOG_INFO "测试apu-1-config不支持参数--invalid-param" - apu-1-config --invalid-param 2>/dev/null - if [ $? -ne 255 ] && [ $? -ne 1 ]; then - LOG_ERROR "apu-1-config不支持参数--invalid-param但未正确退出" - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "清理环境:卸载apr-util-devel" - dnf remove -y apr-util-devel - fi - exit 255 - fi - - # 测试获取版本信息 - LOG_INFO "测试获取apu-1-config版本信息" - VERSION=$(apu-1-config --version 2>/dev/null | head -1) - if [ -n "$VERSION" ]; then - LOG_INFO "apu-1-config版本: $VERSION" - else - LOG_ERROR "无法获取apu-1-config版本信息" - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "清理环境:卸载apr-util-devel" - dnf remove -y apr-util-devel - fi - exit 1 - fi - - # 测试获取包含目录 - LOG_INFO "测试获取apu-1-config包含目录" - INCLUDES=$(apu-1-config --includes 2>/dev/null) - CHECK_RESULT $? 0 0 "获取apu-1-config包含目录失败" - LOG_INFO "apu-1-config包含目录: $INCLUDES" - - # 测试获取库目录 - LOG_INFO "测试获取apu-1-config库目录" - LIBS=$(apu-1-config --libs 2>/dev/null) - CHECK_RESULT $? 0 0 "获取apu-1-config库目录失败" - LOG_INFO "apu-1-config库目录: $LIBS" - - # 测试获取链接参数 - LOG_INFO "测试获取apu-1-config链接参数" - LINK_ARGS=$(apu-1-config --link-ld 2>/dev/null) - CHECK_RESULT $? 0 0 "获取apu-1-config链接参数失败" - LOG_INFO "apu-1-config链接参数: $LINK_ARGS" - - # 清理环境 - LOG_INFO "开始清理测试环境" - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "卸载apr-util-devel软件包" - dnf remove -y apr-util-devel - CHECK_RESULT $? 0 0 "卸载apr-util-devel失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "apr-util-devel在测试前已安装,保持安装状态" - fi - - LOG_INFO "测试完成: Test basic apu-1-config usage" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_function_basic_compile.sh b/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_function_basic_compile.sh deleted file mode 100644 index bc829841fa2..00000000000 --- a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_function_basic_compile.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-25 -# @License : Mulan PSL v2 -# @Desc : Test basic compilation using apu headers -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用apu头文件进行基本编译测试" - - # 检查yum源中是否存在apr-util-devel软件包 - LOG_INFO "步骤1:检查yum源中是否存在apr-util-devel软件包" - dnf list available apr-util-devel 2>/dev/null | grep -q "apr-util-devel" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到apr-util-devel软件包" - exit 255 - fi - - # 检查是否已经安装apr-util-devel - LOG_INFO "步骤2:检查系统中是否已安装apr-util-devel" - rpm -q apr-util-devel >/dev/null 2>&1 - already_installed=$? - - # 如果未安装,则安装软件包 - if [ $already_installed -ne 0 ]; then - LOG_INFO "步骤3:安装apr-util-devel软件包" - dnf install -y apr-util-devel - CHECK_RESULT $? 0 0 "安装apr-util-devel失败" - fi - - # 创建测试源文件 - LOG_INFO "步骤4:创建测试源文件test_apr_util.c" - cat > test_apr_util.c << "EOF" - #include - #include - #include - - int main() { - apr_initialize(); - printf("APR initialized successfully\n"); - apr_terminate(); - return 0; - } - EOF - - # 编译测试程序 - LOG_INFO "步骤5:使用apu头文件编译测试程序" - gcc -o test_apr_util test_apr_util.c -lapr-1 -laprutil-1 - CHECK_RESULT $? 0 0 "编译测试程序失败" - - # 运行测试程序 - LOG_INFO "步骤6:运行编译后的测试程序" - ./test_apr_util - CHECK_RESULT $? 0 0 "运行测试程序失败" - - # 清理临时文件 - LOG_INFO "步骤7:清理临时文件" - rm -f test_apr_util.c test_apr_util - - # 如果之前未安装,则卸载软件包 - if [ $already_installed -ne 0 ]; then - LOG_INFO "步骤8:卸载apr-util-devel软件包" - dnf remove -y apr-util-devel - CHECK_RESULT $? 0 0 "卸载apr-util-devel失败" - else - LOG_INFO "步骤8:系统原本已安装apr-util-devel,保持安装状态" - fi - - LOG_INFO "测试完成:使用apu头文件进行基本编译测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_function_check_installed.sh b/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_function_check_installed.sh deleted file mode 100644 index 40a9eb15a08..00000000000 --- a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_function_check_installed.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-25 -# @License : Mulan PSL v2 -# @Desc : Verify that apr-util-devel is installed -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:验证apr-util-devel是否安装" - - # 检查是否已安装apr-util-devel - LOG_INFO "检查apr-util-devel是否已安装" - rpm -q apr-util-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "apr-util-devel已安装,跳过安装步骤" - INSTALLED=1 - else - LOG_INFO "apr-util-devel未安装,将在测试中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有apr-util-devel软件包 - LOG_INFO "检查yum源中是否有apr-util-devel软件包" - dnf list available apr-util-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有apr-util-devel软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有apr-util-devel软件包" - exit 255 - fi - - # 如果未安装,则安装apr-util-devel - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装apr-util-devel" - dnf install -y apr-util-devel - CHECK_RESULT $? 0 0 "安装apr-util-devel失败" - fi - - # 验证apr-util-devel是否安装成功 - LOG_INFO "验证apr-util-devel是否安装成功" - rpm -q apr-util-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "apr-util-devel未安装成功" - - # 如果测试前未安装,则在测试结束后卸载 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "测试结束,卸载apr-util-devel" - dnf remove -y apr-util-devel - CHECK_RESULT $? 0 0 "卸载apr-util-devel失败" - fi - - LOG_INFO "测试完成:apr-util-devel安装验证成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_function_link_program.sh b/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_function_link_program.sh deleted file mode 100644 index 411a300ab4c..00000000000 --- a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_function_link_program.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-25 -# @License : Mulan PSL v2 -# @Desc : Test linking a program with apu libs -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test linking a program with apu libs" - LOG_INFO "步骤1: 检查apr-util-devel软件包是否在yum源中" - dnf list apr-util-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到apr-util-devel软件包" - exit 255 - fi - - LOG_INFO "步骤2: 检查环境是否已安装apr-util-devel" - rpm -q apr-util-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "apr-util-devel已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "apr-util-devel未安装,将作为测试步骤安装" - INSTALLED=0 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装apr-util-devel软件包" - dnf install -y apr-util-devel - CHECK_RESULT $? 0 0 "安装apr-util-devel失败" - fi - - LOG_INFO "步骤4: 创建测试C程序文件" - cat > test_apu_link.c << "EOF" - #include - #include - int main() { - apr_initialize(); - apr_uri_t uri; - apr_uri_parse("http://example.com", &uri); - apr_terminate(); - return 0; - } - EOF - CHECK_RESULT $? 0 0 "创建测试C程序文件失败" - - LOG_INFO "步骤5: 编译测试程序,链接apu库" - gcc test_apu_link.c -o test_apu_link -lapr-1 -laprutil-1 - CHECK_RESULT $? 0 0 "编译链接测试程序失败" - - LOG_INFO "步骤6: 运行测试程序" - ./test_apu_link - CHECK_RESULT $? 0 0 "运行测试程序失败" - - LOG_INFO "步骤7: 清理临时文件" - rm -f test_apu_link.c test_apu_link - CHECK_RESULT $? 0 0 "清理临时文件失败" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤8: 卸载apr-util-devel软件包" - dnf remove -y apr-util-devel - CHECK_RESULT $? 0 0 "卸载apr-util-devel失败" - else - LOG_INFO "apr-util-devel已预先安装,保持安装状态" - fi - - LOG_INFO "测试完成:Test linking a program with apu libs" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_function_remove.sh b/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_function_remove.sh deleted file mode 100644 index 7fc8e397840..00000000000 --- a/testcases/function_test/pkg_test/apr-util/apr-util-devel/test_apr-util-devel_function_remove.sh +++ /dev/null @@ -1,80 +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-25 -# @License : Mulan PSL v2 -# @Desc : Test removal of apr-util-devel package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装apr-util-devel软件包 - LOG_INFO "检查当前环境是否已安装apr-util-devel软件包" - rpm -q apr-util-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "当前环境已安装apr-util-devel软件包,脚本结束时将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "当前环境未安装apr-util-devel软件包,将在测试过程中安装" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否存在apr-util-devel软件包 - LOG_INFO "检查yum源中是否存在apr-util-devel软件包" - dnf list available apr-util-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在apr-util-devel软件包" - exit 255 - fi - - # 如果未安装,则安装apr-util-devel软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "安装apr-util-devel软件包" - dnf install -y apr-util-devel - CHECK_RESULT $? 0 0 "安装apr-util-devel软件包失败" - fi - - # 验证apr-util-devel软件包已安装 - LOG_INFO "验证apr-util-devel软件包已安装" - rpm -q apr-util-devel - CHECK_RESULT $? 0 0 "apr-util-devel软件包未正确安装" - - # 测试移除apr-util-devel软件包 - LOG_INFO "测试移除apr-util-devel软件包" - dnf remove -y apr-util-devel - CHECK_RESULT $? 0 0 "移除apr-util-devel软件包失败" - - # 验证apr-util-devel软件包已移除 - LOG_INFO "验证apr-util-devel软件包已移除" - rpm -q apr-util-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "apr-util-devel软件包移除失败" - exit 1 - else - LOG_INFO "apr-util-devel软件包已成功移除" - fi - - # 环境恢复:如果之前未安装,则保持未安装状态;如果之前已安装,则重新安装 - if [ $INSTALLED_BEFORE -eq 1 ]; then - LOG_INFO "恢复环境:重新安装apr-util-devel软件包" - dnf install -y apr-util-devel - CHECK_RESULT $? 0 0 "重新安装apr-util-devel软件包失败" - LOG_INFO "环境已恢复:apr-util-devel软件包已安装" - else - LOG_INFO "环境已恢复:apr-util-devel软件包未安装" - fi -} - -main "$@" \ No newline at end of file From bb27fa0c3f8c1dd8fdca60fba600c4ab3e4228ec Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 10:07:14 +0800 Subject: [PATCH 13/18] update testcase for testsuite janino-help --- .../pkg_test/janino/janino-help.json | 10 --- .../test_janino-help_function_compile.sh | 64 ------------------- 2 files changed, 74 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/janino/janino-help.json delete mode 100644 testcases/function_test/pkg_test/janino/janino-help/test_janino-help_function_compile.sh diff --git a/suite2cases/function_test/pkg_test/janino/janino-help.json b/suite2cases/function_test/pkg_test/janino/janino-help.json deleted file mode 100644 index fb7eb171e28..00000000000 --- a/suite2cases/function_test/pkg_test/janino/janino-help.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/janino/janino-help", - "machine num": 1, - "cases": [ - { - "name": "test_janino-help_function_compile", - "desc": "Test compilation functionality" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/janino/janino-help/test_janino-help_function_compile.sh b/testcases/function_test/pkg_test/janino/janino-help/test_janino-help_function_compile.sh deleted file mode 100644 index 3f660e252b9..00000000000 --- a/testcases/function_test/pkg_test/janino/janino-help/test_janino-help_function_compile.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-09 -# @License : Mulan PSL v2 -# @Desc : Test compilation functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试编译功能" - - # 检查是否已安装janino-help软件包 - LOG_INFO "检查janino-help软件包是否已安装" - if dnf list installed janino-help &>/dev/null; then - LOG_INFO "janino-help软件包已安装,测试结束后将保持安装状态" - installed=true - else - LOG_INFO "janino-help软件包未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否存在janino-help软件包 - LOG_INFO "检查yum源中是否存在janino-help软件包" - if ! dnf list available janino-help &>/dev/null; then - LOG_ERROR "yum源中不存在janino-help软件包" - exit 255 - fi - - # 安装janino-help软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装janino-help软件包" - dnf install -y janino-help - CHECK_RESULT $? 0 0 "安装janino-help软件包失败" - fi - - # 测试编译功能 - LOG_INFO "测试编译功能" - janino --help - CHECK_RESULT $? 0 0 "编译功能测试失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载janino-help软件包" - dnf remove -y janino-help - CHECK_RESULT $? 0 0 "卸载janino-help软件包失败" - fi - - LOG_INFO "测试编译功能完成" -} - -main "$@" \ No newline at end of file From 634684f7d5587220a06369f0ae0eca45e43a7a4f Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 10:07:47 +0800 Subject: [PATCH 14/18] update testcase for testsuite texlive-context-annotation-doc --- .../texlive-context-annotation-doc.json | 10 --- ...e-context-annotation-doc_function_basic.sh | 65 ------------------- 2 files changed, 75 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-e/texlive-context-annotation-doc.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-e/texlive-context-annotation-doc/test_texlive-context-annotation-doc_function_basic.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-e/texlive-context-annotation-doc.json b/suite2cases/function_test/pkg_test/texlive-split-e/texlive-context-annotation-doc.json deleted file mode 100644 index 43a19f8859a..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-e/texlive-context-annotation-doc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-e/texlive-context-annotation-doc", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-context-annotation-doc_function_basic", - "desc": "Test basic functionality of the package" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-e/texlive-context-annotation-doc/test_texlive-context-annotation-doc_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-e/texlive-context-annotation-doc/test_texlive-context-annotation-doc_function_basic.sh deleted file mode 100644 index 10d88690ba5..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-e/texlive-context-annotation-doc/test_texlive-context-annotation-doc_function_basic.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-27 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality of the package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查环境是否已安装指定软件包 - LOG_INFO "检查环境是否已安装 texlive-context-annotation-doc 软件包" - if dnf list installed texlive-context-annotation-doc &>/dev/null; then - LOG_INFO "环境已安装 texlive-context-annotation-doc 软件包" - installed=true - else - LOG_INFO "环境未安装 texlive-context-annotation-doc 软件包" - installed=false - fi - - # 检查 yum 源中是否存在该软件包 - LOG_INFO "检查 yum 源中是否存在 texlive-context-annotation-doc 软件包" - if ! dnf list available texlive-context-annotation-doc &>/dev/null; then - LOG_ERROR "yum 源中不存在 texlive-context-annotation-doc 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装 texlive-context-annotation-doc 软件包" - dnf install -y texlive-context-annotation-doc - CHECK_RESULT $? 0 0 "安装 texlive-context-annotation-doc 软件包失败" - fi - - # 测试基本功能 - LOG_INFO "测试 texlive-context-annotation-doc 的基本功能" - context --version &>/dev/null - CHECK_RESULT $? 0 0 "context --version 命令执行失败" - - # 检查参数是否支持 - LOG_INFO "检查 context --help参数是否支持" - context --help &>/dev/null - CHECK_RESULT $? 0 0 "context --help 参数不支持" - - #如果未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载 texlive-context-annotation-doc软软包" - dnf remove -y texlive-context-annotation-doc - CHECK_RESULT $? 00"卸载 texlve-conetxt-annotaion-dc软软包失败” - fi -} - -main "$@" \ No newline at end of file From c7f1bf296358b88af6c527a64a4dcddab7b52cfc Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 10:08:24 +0800 Subject: [PATCH 15/18] update testcase for testsuite texlive-table-fct --- .../texlive-split-w/texlive-table-fct.json | 10 --- .../test_texlive-table-fct_function_basic.sh | 73 ------------------- 2 files changed, 83 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-w/texlive-table-fct.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-w/texlive-table-fct/test_texlive-table-fct_function_basic.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-w/texlive-table-fct.json b/suite2cases/function_test/pkg_test/texlive-split-w/texlive-table-fct.json deleted file mode 100644 index 671229dc27a..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-w/texlive-table-fct.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-w/texlive-table-fct", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-table-fct_function_basic", - "desc": "Test basic functionality of texlive-table-fct" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-w/texlive-table-fct/test_texlive-table-fct_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-w/texlive-table-fct/test_texlive-table-fct_function_basic.sh deleted file mode 100644 index 866825545d2..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-w/texlive-table-fct/test_texlive-table-fct_function_basic.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality of texlive-table-fct -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 texlive-table-fct 的基本功能" - - # 检查是否已安装 texlive-table-fct - if dnf list installed texlive-table-fct &>/dev/null; then - LOG_INFO "texlive-table-fct 已安装,测试结束后将保持安装状态" - installed=true - else - LOG_INFO "texlive-table-fct 未安装,将在测试结束后卸载" - installed=false - fi - - # 检查 yum 源中是否有 texlive-table-fct 软件包 - LOG_INFO "检查 yum 源中是否存在 texlive-table-fct 软件包" - if ! dnf list available texlive-table-fct &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-table-fct 软件包" - exit 255 - fi - - # 安装 texlive-table-fct - if [ "$installed" = false ]; then - LOG_INFO "安装 texlive-table-fct" - dnf install -y texlive-table-fct - CHECK_RESULT $? 0 0 "安装 texlive-table-fct 失败" - fi - - # 测试 texlive-table-fct 的基本功能 - LOG_INFO "测试 texlive-table-fct 的基本功能" - texlive-table-fct --version - CHECK_RESULT $? 0 0 "texlive-table-fct --version 执行失败" - - # 检查不支持的参数 - LOG_INFO "检查 texlive-table-fct 不支持的参数" - texlive-table-fct --invalid-arg &>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "texlive-table-fc t不支持 --invalid-arg 参数,但未返回退出码 255" - exit 255 - fi - - #清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载 texlive-tabl e- fct" - dnf remove -y tex live-tabl e- f ct - CHECK_RESULT $? 0 0 "卸载 tex live-tabl e- f ct失败" - fi - - LOG _ INFO"测试完成" - -} - -main "$@" \ No newline at end of file From 27b113cb3bd4a59a193570361a574f49776ee983 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 10:12:15 +0800 Subject: [PATCH 16/18] update testcase for testsuite texlive-makebox --- .../texlive-split-o/texlive-makebox.json | 10 --- .../test_texlive-makebox_function_install.sh | 61 ------------------- 2 files changed, 71 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-o/texlive-makebox.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-o/texlive-makebox/test_texlive-makebox_function_install.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-o/texlive-makebox.json b/suite2cases/function_test/pkg_test/texlive-split-o/texlive-makebox.json deleted file mode 100644 index d3e10da2e1e..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-o/texlive-makebox.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-o/texlive-makebox", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-makebox_function_install", - "desc": "Test package installation" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-o/texlive-makebox/test_texlive-makebox_function_install.sh b/testcases/function_test/pkg_test/texlive-split-o/texlive-makebox/test_texlive-makebox_function_install.sh deleted file mode 100644 index 94ea75b0cac..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-o/texlive-makebox/test_texlive-makebox_function_install.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-09-27 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-makebox - LOG_INFO "检查是否已安装texlive-makebox" - rpm -q texlive-makebox > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-makebox已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "texlive-makebox未安装,准备安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-makebox - LOG_INFO "检查yum源中是否有texlive-makebox" - dnf list available texlive-makebox > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-makebox软件包" - - # 安装texlive-makebox - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-makebox" - dnf install -y texlive-makebox - CHECK_RESULT $? 0 0 "安装texlive-makebox失败" - fi - - # 测试texlive-makebox功能 - LOG_INFO "测试texlive-makebox功能" - texlive-makebox --version > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "texlive-makebox命令不支持或参数错误" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-makebox" - dnf remove -y texlive-makebox - CHECK_RESULT $? 0 0 "卸载texlive-makebox失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file From 1005d9f581f83ddf54f4333e370aea89356ea160 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 10:12:22 +0800 Subject: [PATCH 17/18] update testcase for testsuite texlive-postcards --- .../texlive-split-r/texlive-postcards.json | 11 --- .../test_texlive-postcards_rollback.sh | 76 ------------------- 2 files changed, 87 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-r/texlive-postcards.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-r/texlive-postcards/test_texlive-postcards_rollback.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-r/texlive-postcards.json b/suite2cases/function_test/pkg_test/texlive-split-r/texlive-postcards.json deleted file mode 100644 index c9d0aca18e7..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-r/texlive-postcards.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-r/texlive-postcards", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-postcards_rollback", - "desc": "测试texlive-postcards软件包的回滚功能,验证是否能够正确回滚到之前的版本。", - "machine num": 1 - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-r/texlive-postcards/test_texlive-postcards_rollback.sh b/testcases/function_test/pkg_test/texlive-split-r/texlive-postcards/test_texlive-postcards_rollback.sh deleted file mode 100644 index f4f0b16ec8e..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-r/texlive-postcards/test_texlive-postcards_rollback.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-06-19 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-postcards软件包的回滚功能,验证是否能够正确回滚到之前的版本。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-postcards软件包的回滚功能" - - # 检查是否已安装texlive-postcards - LOG_INFO "检查是否已安装texlive-postcards" - dnf list installed texlive-postcards > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-postcards已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-postcards未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-postcards软件包 - LOG_INFO "检查yum源中是否有texlive-postcards软件包" - dnf list available texlive-postcards > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到texlive-postcards软件包" - - # 安装texlive-postcards软件包 - LOG_INFO "安装texlive-postcards软件包" - dnf install -y texlive-postcards - CHECK_RESULT $? 0 0 "安装texlive-postcards软件包失败" - - # 获取当前版本信息 - LOG_INFO "获取当前版本信息" - CURRENT_VERSION=$(rpm -q texlive-postcards) - LOG_INFO "当前版本: $CURRENT_VERSION" - - # 回滚到上一个版本 - LOG_INFO "尝试回滚到上一个版本" - dnf history undo last -y --skip-broken > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "回滚操作失败" - - # 验证回滚后的版本 - LOG_INFO "验证回滚后的版本" - ROLLBACK_VERSION=$(rpm -q texlive-postcards) - if [ "$ROLLBACK_VERSION" != "$CURRENT_VERSION" ]; then - LOG_INFO "回滚成功,当前版本: $ROLLBACK_VERSION" - else - LOG_ERROR "回滚失败,版本未变化" - exit 1 - fi - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境,卸载texlive-postcards软件包" - dnf remove -y texlive-postcars > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-postcars软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file From 1da32536fed1b4de8edbc0a1bbd57ba945bf64c7 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 23 Apr 2026 10:14:01 +0800 Subject: [PATCH 18/18] update testcase for testsuite texlive-mweights-doc --- .../texlive-split-p/texlive-mweights-doc.json | 4 -- ...xlive-mweights-doc_function_query_files.sh | 72 ------------------- 2 files changed, 76 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-p/texlive-mweights-doc/test_texlive-mweights-doc_function_query_files.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-p/texlive-mweights-doc.json b/suite2cases/function_test/pkg_test/texlive-split-p/texlive-mweights-doc.json index 46aa1d76e0f..0b65bea54b3 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-p/texlive-mweights-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-p/texlive-mweights-doc.json @@ -10,10 +10,6 @@ "name": "test_texlive-mweights-doc_function_check_installed", "desc": "Test if the package is installed on the system" }, - { - "name": "test_texlive-mweights-doc_function_query_files", - "desc": "Test listing package documentation files" - }, { "name": "test_texlive-mweights-doc_function_view_doc", "desc": "Test viewing a key documentation file" diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-mweights-doc/test_texlive-mweights-doc_function_query_files.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-mweights-doc/test_texlive-mweights-doc_function_query_files.sh deleted file mode 100644 index f69118c0112..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-mweights-doc/test_texlive-mweights-doc_function_query_files.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-12 -# @License : Mulan PSL v2 -# @Desc : Test listing package documentation files -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test listing package documentation files" - LOG_INFO "步骤1:检查texlive-mweights-doc软件包是否在yum源中" - dnf list texlive-mweights-doc 2>/dev/null | grep -q "texlive-mweights-doc" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-mweights-doc软件包" - exit 255 - fi - LOG_INFO "texlive-mweights-doc软件包在yum源中存在" - - LOG_INFO "步骤2:检查系统是否已安装texlive-mweights-doc软件包" - rpm -q texlive-mweights-doc >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-mweights-doc软件包已安装" - INSTALLED=1 - else - LOG_INFO "texlive-mweights-doc软件包未安装,将进行安装" - INSTALLED=0 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-mweights-doc软件包" - dnf install -y texlive-mweights-doc - CHECK_RESULT $? 0 0 "安装texlive-mweights-doc软件包失败" - LOG_INFO "texlive-mweights-doc软件包安装成功" - fi - - LOG_INFO "步骤4:执行rpm -ql texlive-mweights-doc命令列出文档文件" - rpm -ql texlive-mweights-doc > /tmp/texlive_mweights_doc_files.txt 2>&1 - CHECK_RESULT $? 0 0 "执行rpm -ql texlive-mweights-doc命令失败" - - LOG_INFO "步骤5:检查列出的文档文件是否包含特定文件" - grep -q "mweights.pdf" /tmp/texlive_mweights_doc_files.txt - CHECK_RESULT $? 0 0 "文档文件中未找到mweights.pdf文件" - - LOG_INFO "步骤6:清理临时文件" - rm -f /tmp/texlive_mweights_doc_files.txt - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤7:卸载texlive-mweights-doc软件包" - dnf remove -y texlive-mweights-doc - CHECK_RESULT $? 0 0 "卸载texlive-mweights-doc软件包失败" - LOG_INFO "texlive-mweights-doc软件包卸载成功" - else - LOG_INFO "步骤7:保持texlive-mweights-doc软件包安装状态,无需卸载" - fi - - LOG_INFO "测试完成:Test listing package documentation files" -} - -main "$@" \ No newline at end of file