update testcase for testsuite texlive-cmexb-doc
This commit is contained in:
@@ -13,10 +13,6 @@
|
||||
{
|
||||
"name": "test_texlive-cmexb-doc_function_verify",
|
||||
"desc": "Verify package files exist"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-cmexb-doc_function_doc_access",
|
||||
"desc": "Test documentation access"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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-24
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test documentation access
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试:Test documentation access"
|
||||
|
||||
# 检查是否已安装texlive-cmexb-doc
|
||||
LOG_INFO "检查texlive-cmexb-doc是否已安装"
|
||||
dnf list installed texlive-cmexb-doc > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-cmexb-doc已安装,标记为保持安装状态"
|
||||
KEEP_INSTALLED=1
|
||||
else
|
||||
LOG_INFO "texlive-cmexb-doc未安装,标记为需要卸载"
|
||||
KEEP_INSTALLED=0
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有texlive-cmexb-doc软件包
|
||||
LOG_INFO "检查yum源中是否有texlive-cmexb-doc软件包"
|
||||
dnf list available texlive-cmexb-doc > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到texlive-cmexb-doc软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ $KEEP_INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "安装texlive-cmexb-doc软件包"
|
||||
dnf install -y texlive-cmexb-doc
|
||||
CHECK_RESULT $? 0 0 "安装texlive-cmexb-doc失败"
|
||||
fi
|
||||
|
||||
# 测试文档访问功能
|
||||
LOG_INFO "测试文档访问功能"
|
||||
# 假设文档位于/usr/share/texlive-doc/latex/cmexb/目录下,检查是否存在README文件
|
||||
DOC_PATH="/usr/share/texlive-doc/latex/cmexb/README"
|
||||
if [ -f "$DOC_PATH" ]; then
|
||||
LOG_INFO "找到文档文件:$DOC_PATH"
|
||||
# 尝试读取文档内容
|
||||
head -n 5 "$DOC_PATH" > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "读取文档内容失败"
|
||||
else
|
||||
LOG_ERROR "未找到预期的文档文件:$DOC_PATH"
|
||||
# 尝试查找其他可能的文档位置
|
||||
find /usr/share/texlive-doc -name "*cmexb*" -type f 2>/dev/null | head -5
|
||||
CHECK_RESULT $? 0 1 "未找到任何cmexb相关文档"
|
||||
fi
|
||||
|
||||
# 清理环境:如果脚本开始时未安装,则卸载软件包
|
||||
if [ $KEEP_INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "卸载texlive-cmexb-doc软件包"
|
||||
dnf remove -y texlive-cmexb-doc
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-cmexb-doc失败"
|
||||
else
|
||||
LOG_INFO "保持texlive-cmexb-doc安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:Test documentation access"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user