update testcase for testsuite texlive-bguq

This commit is contained in:
2026-04-14 23:10:38 +08:00
parent 6bdc74e295
commit cb744095ad
5 changed files with 0 additions and 309 deletions

View File

@@ -2,25 +2,9 @@
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-c/texlive-bguq",
"machine num": 1,
"cases": [
{
"name": "test_texlive-bguq_function_install",
"desc": "Test installation of texlive-bguq package"
},
{
"name": "test_texlive-bguq_function_uninstall",
"desc": "Test removal of texlive-bguq package"
},
{
"name": "test_texlive-bguq_function_check_installed",
"desc": "Verify texlive-bguq is correctly installed"
},
{
"name": "test_texlive-bguq_function_basic_usage",
"desc": "Test basic command usage of texlive-bguq"
},
{
"name": "test_texlive-bguq_function_file_compilation",
"desc": "Test compiling a LaTeX file using the package"
}
]
}

View File

@@ -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-20
# @License : Mulan PSL v2
# @Desc : Test basic command usage of texlive-bguq
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试 texlive-bguq 基本命令使用功能"
# 定义软件包名称
PACKAGE_NAME="texlive-bguq"
# 步骤1: 检查软件包是否在yum源中
LOG_INFO "检查软件包是否在yum源中"
dnf list available $PACKAGE_NAME &>/dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中"
exit 255
fi
# 步骤2: 检查软件包是否已安装
LOG_INFO "检查软件包是否已安装"
if rpm -q $PACKAGE_NAME &>/dev/null; then
LOG_INFO "软件包 $PACKAGE_NAME 已安装,测试后保持安装状态"
INSTALLED_BEFORE=true
else
LOG_INFO "软件包 $PACKAGE_NAME 未安装,将进行安装测试"
INSTALLED_BEFORE=false
fi
# 步骤3: 如果未安装,则安装软件包
if [ "$INSTALLED_BEFORE" = false ]; then
LOG_INFO "安装软件包 $PACKAGE_NAME"
dnf install -y $PACKAGE_NAME
CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败"
fi
# 步骤4: 测试基本命令使用
LOG_INFO "测试 texlive-bguq 基本命令使用"
# 假设 texlive-bguq 有一个基本命令 "texlive-bguq --version" 来显示版本信息
texlive-bguq --version
CHECK_RESULT $? 0 0 "texlive-bguq 基本命令执行失败"
# 步骤5: 测试不支持的参数
LOG_INFO "测试不支持的参数"
texlive-bguq --invalid-parameter 2>/dev/null
if [ $? -ne 255 ] && [ $? -ne 1 ]; then
LOG_ERROR "不支持的参数未正确处理"
exit 255
fi
# 步骤6: 清理环境
LOG_INFO "清理测试环境"
if [ "$INSTALLED_BEFORE" = false ]; then
LOG_INFO "卸载软件包 $PACKAGE_NAME"
dnf remove -y $PACKAGE_NAME
CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败"
else
LOG_INFO "软件包 $PACKAGE_NAME 在测试前已安装,保持安装状态"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -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 : 2026-02-20
# @License : Mulan PSL v2
# @Desc : Verify texlive-bguq is correctly installed
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试:验证 texlive-bguq 是否正确安装"
LOG_INFO "步骤1: 检查环境是否已安装 texlive-bguq"
if dnf list installed texlive-bguq &>/dev/null; then
LOG_INFO "环境已安装 texlive-bguq脚本结束后将保持安装状态"
INSTALLED_BEFORE=true
else
LOG_INFO "环境未安装 texlive-bguq将在测试步骤中安装并在脚本结束前卸载"
INSTALLED_BEFORE=false
fi
LOG_INFO "步骤2: 检查 yum 源中是否有 texlive-bguq 软件包"
if ! dnf list available texlive-bguq &>/dev/null; then
LOG_ERROR "yum 源中未找到 texlive-bguq 软件包"
exit 255
fi
if [ "$INSTALLED_BEFORE" = "false" ]; then
LOG_INFO "步骤3: 安装 texlive-bguq 软件包"
dnf install -y texlive-bguq
CHECK_RESULT $? 0 0 "安装 texlive-bguq 失败"
fi
LOG_INFO "步骤4: 验证 texlive-bguq 命令是否可用"
command -v texlive-bguq &>/dev/null
CHECK_RESULT $? 0 0 "texlive-bguq 命令不可用"
LOG_INFO "步骤5: 验证 texlive-bguq 基本功能"
texlive-bguq --version &>/dev/null
CHECK_RESULT $? 0 0 "texlive-bguq 版本检查失败"
LOG_INFO "步骤6: 清理环境"
if [ "$INSTALLED_BEFORE" = "false" ]; then
LOG_INFO "卸载 texlive-bguq 软件包"
dnf remove -y texlive-bguq
CHECK_RESULT $? 0 0 "卸载 texlive-bguq 失败"
else
LOG_INFO "环境在测试前已安装 texlive-bguq保持安装状态"
fi
LOG_INFO "测试完成texlive-bguq 安装验证通过"
}
main "$@"

View File

@@ -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-20
# @License : Mulan PSL v2
# @Desc : Test compiling a LaTeX file using the package
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试:使用 texlive-bguq 软件包编译 LaTeX 文件"
LOG_INFO "步骤1检查 yum 源中是否存在 texlive-bguq 软件包"
if ! dnf list available texlive-bguq &>/dev/null; then
LOG_ERROR "yum 源中未找到 texlive-bguq 软件包"
exit 255
fi
LOG_INFO "步骤2检查当前环境是否已安装 texlive-bguq"
if rpm -q texlive-bguq &>/dev/null; then
LOG_INFO "texlive-bguq 已安装,测试后保持安装状态"
INSTALLED_BEFORE_TEST=true
else
LOG_INFO "texlive-bguq 未安装,将在测试过程中安装"
INSTALLED_BEFORE_TEST=false
fi
if [ "$INSTALLED_BEFORE_TEST" = false ]; then
LOG_INFO "步骤3安装 texlive-bguq 软件包"
dnf install -y texlive-bguq
CHECK_RESULT $? 0 0 "安装 texlive-bguq 失败"
fi
LOG_INFO "步骤4创建一个测试用的 LaTeX 文件"
cat > test_document.tex << "EOF"
\documentclass{article}
\usepackage{bguq}
\begin{document}
Test document using bguq package.
\end{document}
EOF
CHECK_RESULT $? 0 0 "创建 LaTeX 文件失败"
LOG_INFO "步骤5使用 pdflatex 编译 LaTeX 文件"
if ! command -v pdflatex &>/dev/null; then
LOG_ERROR "pdflatex 命令不存在或不支持"
exit 255
fi
pdflatex -interaction=nonstopmode test_document.tex
CHECK_RESULT $? 0 0 "编译 LaTeX 文件失败"
LOG_INFO "步骤6检查生成的 PDF 文件"
if [ -f test_document.pdf ]; then
LOG_INFO "PDF 文件生成成功"
else
LOG_ERROR "PDF 文件未生成"
exit 1
fi
LOG_INFO "步骤7清理测试文件"
rm -f test_document.tex test_document.log test_document.aux test_document.pdf
CHECK_RESULT $? 0 0 "清理测试文件失败"
if [ "$INSTALLED_BEFORE_TEST" = false ]; then
LOG_INFO "步骤8卸载 texlive-bguq 软件包"
dnf remove -y texlive-bguq
CHECK_RESULT $? 0 0 "卸载 texlive-bguq 失败"
else
LOG_INFO "步骤8测试前已安装 texlive-bguq保持安装状态"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -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-29
# @License : Mulan PSL v2
# @Desc : Test installation of texlive-bguq package
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查是否已经安装texlive-bguq
LOG_INFO "检查是否已经安装texlive-bguq"
rpm -q texlive-bguq > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "texlive-bguq已经安装脚本结束时保持安装状态"
installed=true
else
installed=false
fi
# 检查yum源中是否有texlive-bguq软件包
LOG_INFO "检查yum源中是否有texlive-bguq软件包"
dnf list available texlive-bguq > /dev/null 2>&1
CHECK_RESULT $? 0 255 "yum源中没有texlive-bguq软件包"
# 安装texlive-bguq软件包
if [ "$installed" = false ]; then
LOG_INFO "开始安装texlive-bguq软件包"
dnf install -y texlive-bguq > /dev/null 2>&1
CHECK_RESULT $? 0 0 "安装texlive-bguq软件包失败"
fi
# 测试texlive-bguq功能
LOG_INFO "测试texlive-bguq功能"
command_to_test="some_texlive_command"
$command_to_test > /dev/null 2>&1
CHECK_RESULT $? 0 255 "命令$command_to_test不存在或不支持"
# 清理环境
if [ "$installed" = false ]; then
LOG_INFO "卸载texlive-bguq软件包"
dnf remove -y texlive-bguq > /dev/null 2>&1
CHECK_RESULT $? 0 0 "卸载texlive-bguq软件包失败"
fi
LOG_INFO "测试脚本执行完成"
}
main "$@"