From e6d72e338d0ff31969ea163ffbb54b91aa4ae311 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 16 Apr 2026 02:45:41 +0800 Subject: [PATCH] update testcase for testsuite texlive-download-doc --- .../texlive-split-g/texlive-download-doc.json | 8 -- ..._texlive-download-doc_function_download.sh | 80 ----------------- ...test_texlive-download-doc_function_list.sh | 85 ------------------- 3 files changed, 173 deletions(-) delete mode 100644 testcases/function_test/pkg_test/texlive-split-g/texlive-download-doc/test_texlive-download-doc_function_download.sh delete mode 100644 testcases/function_test/pkg_test/texlive-split-g/texlive-download-doc/test_texlive-download-doc_function_list.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-g/texlive-download-doc.json b/suite2cases/function_test/pkg_test/texlive-split-g/texlive-download-doc.json index a30d21cbda8..b25aa26783c 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-g/texlive-download-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-g/texlive-download-doc.json @@ -13,14 +13,6 @@ { "name": "test_texlive-download-doc_function_query", "desc": "测试能否通过包管理器(如 dpkg -s 或 rpm -q)查询到 texlive-download-doc 软件包的安装状态和版本信息。" - }, - { - "name": "test_texlive-download-doc_function_download", - "desc": "测试软件包核心功能:能否成功下载指定的 TeX Live 文档包(例如通过 tlmgr 或特定脚本)。" - }, - { - "name": "test_texlive-download-doc_function_list", - "desc": "测试能否列出可通过 texlive-download-doc 获取的 TeX Live 文档包列表。" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-download-doc/test_texlive-download-doc_function_download.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-download-doc/test_texlive-download-doc_function_download.sh deleted file mode 100644 index b93c31d9e79..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-download-doc/test_texlive-download-doc_function_download.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-03-30 -# @License : Mulan PSL v2 -# @Desc : 测试软件包核心功能:能否成功下载指定的 TeX Live 文档包(例如通过 tlmgr 或特定脚本)。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试TeX Live文档包下载功能" - LOG_INFO "步骤1:检查环境是否已安装TeX Live" - if command -v tlmgr >/dev/null 2>&1; then - LOG_INFO "TeX Live已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "TeX Live未安装,将进行安装测试" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否存在texlive-doc软件包" - if ! dnf list available texlive-doc 2>/dev/null | grep -q texlive-doc; then - LOG_ERROR "yum源中未找到texlive-doc软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装texlive-doc软件包" - dnf install -y texlive-doc - CHECK_RESULT $? 0 0 "安装texlive-doc失败" - fi - - LOG_INFO "步骤4:检查tlmgr命令是否支持下载文档包" - if ! tlmgr help 2>&1 | grep -q "doc"; then - LOG_ERROR "tlmgr命令不支持文档包下载参数" - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载texlive-doc" - dnf remove -y texlive-doc - fi - exit 255 - fi - - LOG_INFO "步骤5:尝试下载指定TeX Live文档包(示例:amsmath文档)" - tlmgr install --reinstall --docfiles amsmath - CHECK_RESULT $? 0 0 "下载TeX Live文档包失败" - - LOG_INFO "步骤6:验证文档包是否下载成功" - if [ -d "/usr/share/texlive/texmf-dist/doc/latex/amsmath" ]; then - LOG_INFO "amsmath文档包下载成功" - else - LOG_ERROR "amsmath文档包下载后未找到" - CHECK_RESULT 1 0 0 "文档包验证失败" - fi - - LOG_INFO "步骤7:环境恢复" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载测试安装的texlive-doc软件包" - dnf remove -y texlive-doc - CHECK_RESULT $? 0 0 "卸载texlive-doc失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "保持TeX Live安装状态,未进行卸载" - fi - - LOG_INFO "测试完成:TeX Live文档包下载功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-download-doc/test_texlive-download-doc_function_list.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-download-doc/test_texlive-download-doc_function_list.sh deleted file mode 100644 index 9b760ee2d05..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-download-doc/test_texlive-download-doc_function_list.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-30 -# @License : Mulan PSL v2 -# @Desc : 测试能否列出可通过 texlive-download-doc 获取的 TeX Live 文档包列表。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装 texlive-download-doc 软件包 - LOG_INFO "检查 texlive-download-doc 是否已经安装" - rpm -q texlive-download-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-download-doc 已经安装,测试结束后将保持安装状态" - INSTALLED="true" - else - LOG_INFO "texlive-download-doc 未安装,测试结束后将卸载" - INSTALLED="false" - fi - - # 检查 yum 源中是否有 texlive-download-doc 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-download-doc 软件包" - dnf list available texlive-download-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中没有 texlive-download-doc 软件包" - exit 255 - fi - - # 如果未安装,则安装 texlive-download-doc 软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装 texlive-download-doc 软件包" - dnf install -y texlive-download-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装 texlive-download-doc 软件包失败" - fi - - # 测试 texlive-download-doc 命令是否支持 --list 参数 - LOG_INFO "测试 texlive-download-doc 命令是否支持 --list 参数" - texlive-download-doc --list > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "texlive-download-doc 命令不支持 --list 参数" - exit 255 - fi - - # 执行 texlive-download-doc --list 命令并检查结果 - LOG_INFO "执行 texlive-download-doc --list 命令列出文档包列表" - texlive-download-doc --list > /tmp/texlive_doc_list.txt 2>&1 - CHECK_RESULT $? 0 0 "执行 texlive-download-doc --list 命令失败" - - # 检查输出是否包含文档包列表 - LOG_INFO "检查输出是否包含文档包列表" - if [ -s /tmp/texlive_doc_list.txt ]; then - LOG_INFO "成功列出 TeX Live 文档包列表" - else - LOG_ERROR "未列出任何 TeX Live 文档包" - CHECK_RESULT 1 0 0 "未列出任何 TeX Live 文档包" - fi - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f /tmp/texlive_doc_list.txt - - # 如果测试前未安装,则在测试结束后卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载 texlive-download-doc 软件包" - dnf remove -y texlive-download-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载 texlive-download-doc 软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file