This commit is contained in:
2026-04-14 19:45:01 +08:00
22 changed files with 0 additions and 1579 deletions

View File

@@ -10,10 +10,6 @@
"name": "test_libiscsi-utils_iscsi-ls__usage",
"desc": "测试iscsi-ls命令的简要用法信息"
},
{
"name": "test_libiscsi-utils_iscsi-readcapacity16_usage",
"desc": "测试使用 --usage 参数显示简要用法信息"
},
{
"name": "test_libiscsi-utils_iscsi-readcapacity16_s_d",
"desc": "测试组合使用 -s 和 -d 参数"

View File

@@ -1,66 +0,0 @@
{
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-base/texlive-pmxchords",
"machine num": 1,
"cases": [
{
"name": "test_texlive-pmxchords_pmxchords__upper_v",
"desc": "测试pmxchords命令的-V参数用于显示版本信息"
},
{
"name": "test_texlive-pmxchords_pmxchords__upper_h",
"desc": "测试pmxchords命令的-H参数用于显示帮助信息"
},
{
"name": "test_texlive-pmxchords_pmxchords__v",
"desc": "测试pmxchords命令的-v参数用于设置详细输出模式"
},
{
"name": "test_texlive-pmxchords_pmxchords__upper_d",
"desc": "测试pmxchords命令的-D参数用于设置调试级别"
},
{
"name": "test_texlive-pmxchords_pmxchords__upper_o",
"desc": "测试pmxchords命令的-O参数用于指定输出文件"
},
{
"name": "test_texlive-pmxchords_pmxchords__upper_c",
"desc": "测试pmxchords命令的-C参数用于指定配置文件"
},
{
"name": "test_texlive-pmxchords_function_install",
"desc": "测试软件包安装功能,验证能否正确安装"
},
{
"name": "test_texlive-pmxchords_function_uninstall",
"desc": "测试软件包卸载功能,验证能否完全移除"
},
{
"name": "test_texlive-pmxchords_function_version",
"desc": "测试pmxchords命令的版本查询功能"
},
{
"name": "test_texlive-pmxchords_function_help",
"desc": "测试pmxchords命令的帮助文档功能"
},
{
"name": "test_texlive-pmxchords_function_basic_convert",
"desc": "测试pmxchords基本乐谱转换功能"
},
{
"name": "test_texlive-pmxchords_function_output_file",
"desc": "测试pmxchords指定输出文件功能"
},
{
"name": "test_texlive-pmxchords_function_config",
"desc": "测试pmxchords使用配置文件功能"
},
{
"name": "test_texlive-pmxchords_function_verbose",
"desc": "测试pmxchords详细输出模式"
},
{
"name": "test_texlive-pmxchords_function_debug",
"desc": "测试pmxchords调试模式功能"
}
]
}

View File

@@ -1,10 +0,0 @@
{
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-p/texlive-navigator",
"machine num": 1,
"cases": [
{
"name": "test_texlive-navigator_function_open",
"desc": "Test opening the navigator"
}
]
}

View File

@@ -1,10 +0,0 @@
{
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-x/texlive-tkz-base",
"machine num": 1,
"cases": [
{
"name": "test_texlive-tkz-base_function_draw",
"desc": "Test basic drawing functionality"
}
]
}

View File

@@ -1,156 +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-15
# @License : Mulan PSL v2
# @Desc : 测试使用 --usage 参数显示简要用法信息
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 设置环境变量
SCRIPT_DIR=$(cd $(dirname $0); pwd)
LOG_FILE="${SCRIPT_DIR}/test_libiscsi-utils_iscsi-readcapacity16_usage.log"
# 定义日志函数
LOG_INFO() {
echo "[INFO] $(date "+%Y-%m-%d %H:%M:%S") $@" | tee -a $LOG_FILE
}
LOG_ERROR() {
echo "[ERROR] $(date "+%Y-%m-%d %H:%M:%S") $@" | tee -a $LOG_FILE
}
# 检查命令是否存在
check_command() {
command -v $1 >/dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "命令 $1 不存在"
exit 255
fi
}
# 检查软件包是否在yum源中
check_package_in_repo() {
dnf list available $1 2>/dev/null | grep -q "$1"
if [ $? -ne 0 ]; then
LOG_ERROR "软件包 $1 不在yum源中"
exit 255
fi
}
# 主测试函数
run_test() {
LOG_INFO "开始测试:使用 --usage 参数显示简要用法信息"
# 检查iscsi-readcapacity16命令是否存在
LOG_INFO "步骤1检查iscsi-readcapacity16命令是否已安装"
if command -v iscsi-readcapacity16 >/dev/null 2>&1; then
LOG_INFO "iscsi-readcapacity16命令已存在记录安装状态"
IS_INSTALLED=true
else
LOG_INFO "iscsi-readcapacity16命令未安装"
IS_INSTALLED=false
# 检查软件包是否在yum源中
LOG_INFO "步骤2检查libiscsi-utils软件包是否在yum源中"
check_package_in_repo libiscsi-utils
# 安装软件包
LOG_INFO "步骤3安装libiscsi-utils软件包"
dnf install -y libiscsi-utils
CHECK_RESULT $? 0 0 "安装libiscsi-utils软件包失败"
# 验证安装
LOG_INFO "步骤4验证iscsi-readcapacity16命令是否安装成功"
command -v iscsi-readcapacity16 >/dev/null 2>&1
CHECK_RESULT $? 0 0 "iscsi-readcapacity16命令安装后仍不存在"
fi
# 测试--usage参数
LOG_INFO "步骤5测试iscsi-readcapacity16 --usage参数"
iscsi-readcapacity16 --usage >/dev/null 2>&1
CHECK_RESULT $? 0 0 "iscsi-readcapacity16 --usage执行失败"
# 检查输出内容
LOG_INFO "步骤6检查--usage参数的输出内容"
OUTPUT=$(iscsi-readcapacity16 --usage 2>&1)
echo "$OUTPUT" | grep -q -i "usage"
CHECK_RESULT $? 0 0 "--usage参数未显示用法信息"
LOG_INFO "步骤7测试完成开始环境清理"
}
# 清理函数
cleanup() {
LOG_INFO "清理步骤:恢复测试环境"
# 如果测试前未安装,则卸载软件包
if [ "$IS_INSTALLED" = "false" ]; then
LOG_INFO "卸载测试期间安装的libiscsi-utils软件包"
dnf remove -y libiscsi-utils
if [ $? -ne 0 ]; then
LOG_ERROR "卸载libiscsi-utils软件包失败"
exit 1
fi
# 验证卸载
command -v iscsi-readcapacity16 >/dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_ERROR "卸载后iscsi-readcapacity16命令仍然存在"
exit 1
fi
else
LOG_INFO "测试前已安装libiscsi-utils保持安装状态"
fi
LOG_INFO "环境清理完成"
}
# 主程序
main() {
LOG_INFO "================================================"
LOG_INFO "测试脚本test_libiscsi-utils_iscsi-readcapacity16_usage"
LOG_INFO "开始时间:$(date "+%Y-%m-%d %H:%M:%S")"
LOG_INFO "================================================"
# 初始化变量
IS_INSTALLED=false
# 检查必要命令
check_command dnf
# 运行测试
run_test
# 清理环境
cleanup
LOG_INFO "================================================"
LOG_INFO "测试脚本执行完成"
LOG_INFO "结束时间:$(date "+%Y-%m-%d %H:%M:%S")"
LOG_INFO "================================================"
exit 0
}
# 异常处理
trap "LOG_ERROR "测试被中断"; cleanup; exit 1" INT TERM
# 执行主程序
main
}
main "$@"

View File

@@ -1,88 +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-21
# @License : Mulan PSL v2
# @Desc : 测试pmxchords基本乐谱转换功能
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试pmxchords基本乐谱转换功能"
# 检查yum源中是否存在texlive-pmxchords软件包
LOG_INFO "检查yum源中是否存在texlive-pmxchords软件包"
if ! dnf list available texlive-pmxchords &>/dev/null; then
LOG_ERROR "yum源中未找到texlive-pmxchords软件包"
exit 255
fi
# 检查是否已安装texlive-pmxchords
LOG_INFO "检查是否已安装texlive-pmxchords"
if rpm -q texlive-pmxchords &>/dev/null; then
LOG_INFO "texlive-pmxchords已安装脚本结束后将保持安装状态"
INSTALLED=true
else
LOG_INFO "texlive-pmxchords未安装将在测试步骤中安装"
INSTALLED=false
fi
# 如果未安装,则安装软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "安装texlive-pmxchords软件包"
dnf install -y texlive-pmxchords
CHECK_RESULT $? 0 0 "安装texlive-pmxchords失败"
fi
# 测试pmxchords基本乐谱转换功能
LOG_INFO "测试pmxchords基本乐谱转换功能"
# 假设pmxchords命令为pmxchords参数为--convert
# 检查参数是否存在
LOG_INFO "检查pmxchords命令是否支持--convert参数"
if ! pmxchords --help 2>&1 | grep -q -- "--convert"; then
LOG_ERROR "pmxchords命令不支持--convert参数"
exit 255
fi
# 执行转换测试
LOG_INFO "执行pmxchords基本乐谱转换测试"
# 这里假设有一个测试用的乐谱文件test.music实际使用时需要根据实际情况调整
if [ -f test.music ]; then
pmxchords --convert test.music output.pdf
CHECK_RESULT $? 0 0 "pmxchords基本乐谱转换失败"
# 检查输出文件是否存在
if [ -f output.pdf ]; then
LOG_INFO "转换成功输出文件output.pdf已生成"
rm -f output.pdf
else
LOG_ERROR "转换失败未生成输出文件output.pdf"
exit 1
fi
else
LOG_INFO "未找到测试文件test.music跳过转换测试"
fi
# 环境恢复
LOG_INFO "环境恢复"
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载texlive-pmxchords软件包"
dnf remove -y texlive-pmxchords
CHECK_RESULT $? 0 0 "卸载texlive-pmxchords失败"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -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-21
# @License : Mulan PSL v2
# @Desc : 测试pmxchords使用配置文件功能
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 定义测试软件包名称
PACKAGE_NAME="texlive-pmxchords"
CONFIG_FILE="/etc/texmf/texmf.d/80pmxchords.cnf"
# 步骤1: 检查环境是否已安装软件包
LOG_INFO "步骤1: 检查环境是否已安装软件包"
rpm -q $PACKAGE_NAME >/dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "环境已安装 $PACKAGE_NAME,测试结束后将保持安装状态"
ALREADY_INSTALLED=1
else
LOG_INFO "环境未安装 $PACKAGE_NAME,将在测试过程中安装并在结束后卸载"
ALREADY_INSTALLED=0
fi
# 步骤2: 检查yum源中是否有该软件包
LOG_INFO "步骤2: 检查yum源中是否有软件包 $PACKAGE_NAME"
dnf list available $PACKAGE_NAME >/dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到软件包 $PACKAGE_NAME"
exit 255
fi
# 步骤3: 如果未安装则安装软件包
if [ $ALREADY_INSTALLED -eq 0 ]; then
LOG_INFO "步骤3: 安装软件包 $PACKAGE_NAME"
dnf install -y $PACKAGE_NAME
CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败"
fi
# 步骤4: 检查配置文件是否存在
LOG_INFO "步骤4: 检查配置文件是否存在"
if [ -f $CONFIG_FILE ]; then
LOG_INFO "配置文件 $CONFIG_FILE 存在"
else
LOG_ERROR "配置文件 $CONFIG_FILE 不存在"
exit 255
fi
# 步骤5: 测试pmxchords使用配置文件功能
LOG_INFO "步骤5: 测试pmxchords使用配置文件功能"
# 创建一个简单的测试tex文件
TEST_TEX_FILE="/tmp/test_pmxchords.tex"
cat > $TEST_TEX_FILE << "EOF"
\documentclass{article}
\usepackage{pmxchords}
\begin{document}
Test pmxchords with configuration.
\end{document}
EOF
# 尝试使用配置文件编译tex文件
pdflatex -interaction=nonstopmode $TEST_TEX_FILE >/dev/null 2>&1
CHECK_RESULT $? 0 0 "使用配置文件编译pmxchords测试文件失败"
# 步骤6: 清理测试文件
LOG_INFO "步骤6: 清理测试文件"
rm -f $TEST_TEX_FILE
rm -f /tmp/test_pmxchords.aux /tmp/test_pmxchords.log /tmp/test_pmxchords.pdf
# 步骤7: 如果测试开始时未安装,则卸载软件包
if [ $ALREADY_INSTALLED -eq 0 ]; then
LOG_INFO "步骤7: 卸载软件包 $PACKAGE_NAME"
dnf remove -y $PACKAGE_NAME
CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -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-21
# @License : Mulan PSL v2
# @Desc : 测试pmxchords调试模式功能
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "测试pmxchords调试模式功能"
LOG_INFO "检查环境是否已安装texlive-pmxchords"
# 检查是否已安装
if dnf list installed texlive-pmxchords >/dev/null 2>&1; then
LOG_INFO "texlive-pmxchords已安装标记为已存在"
INSTALLED_BEFORE=true
else
LOG_INFO "texlive-pmxchords未安装标记为需要清理"
INSTALLED_BEFORE=false
fi
LOG_INFO "检查yum源中是否存在texlive-pmxchords包"
if ! dnf list available texlive-pmxchords >/dev/null 2>&1; then
LOG_ERROR "yum源中不存在texlive-pmxchords包"
exit 255
fi
if [ "$INSTALLED_BEFORE" = false ]; then
LOG_INFO "开始安装texlive-pmxchords"
dnf install -y texlive-pmxchords
CHECK_RESULT $? 0 0 "安装texlive-pmxchords失败"
fi
LOG_INFO "验证pmxchords命令是否存在"
if ! command -v pmxchords >/dev/null 2>&1; then
LOG_ERROR "pmxchords命令未找到"
exit 255
fi
LOG_INFO "测试pmxchords调试模式功能"
LOG_INFO "检查是否支持--debug参数"
if ! pmxchords --help 2>&1 | grep -q "\-\-debug"; then
LOG_ERROR "pmxchords不支持--debug参数"
exit 255
fi
LOG_INFO "执行pmxchords --debug命令"
pmxchords --debug
CHECK_RESULT $? 0 0 "pmxchords调试模式执行失败"
LOG_INFO "清理测试环境"
if [ "$INSTALLED_BEFORE" = false ]; then
LOG_INFO "卸载texlive-pmxchords"
dnf remove -y texlive-pmxchords
CHECK_RESULT $? 0 0 "卸载texlive-pmxchords失败"
else
LOG_INFO "保持texlive-pmxchords安装状态"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -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-21
# @License : Mulan PSL v2
# @Desc : 测试pmxchords命令的帮助文档功能
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试pmxchords命令的帮助文档功能"
# 检查是否已安装texlive-pmxchords包
LOG_INFO "步骤1检查texlive-pmxchords是否已安装"
rpm -q texlive-pmxchords > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "texlive-pmxchords已安装测试后将保持安装状态"
ALREADY_INSTALLED=1
else
LOG_INFO "texlive-pmxchords未安装将在测试中安装"
ALREADY_INSTALLED=0
fi
# 检查yum源中是否有texlive-pmxchords包
LOG_INFO "步骤2检查yum源中是否存在texlive-pmxchords包"
dnf list available texlive-pmxchords > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到texlive-pmxchords包"
exit 255
fi
# 如果未安装,则安装软件包
if [ $ALREADY_INSTALLED -eq 0 ]; then
LOG_INFO "步骤3安装texlive-pmxchords包"
dnf install -y texlive-pmxchords
CHECK_RESULT $? 0 0 "安装texlive-pmxchords失败"
fi
# 测试pmxchords命令的帮助文档功能
LOG_INFO "步骤4测试pmxchords命令的帮助文档功能"
pmxchords --help > /dev/null 2>&1
CHECK_RESULT $? 0 0 "pmxchords命令帮助文档功能测试失败"
# 如果之前未安装,则在测试结束后卸载软件包
if [ $ALREADY_INSTALLED -eq 0 ]; then
LOG_INFO "步骤5卸载texlive-pmxchords包"
dnf remove -y texlive-pmxchords
CHECK_RESULT $? 0 0 "卸载texlive-pmxchords失败"
else
LOG_INFO "步骤5保持texlive-pmxchords安装状态不执行卸载"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -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-21
# @License : Mulan PSL v2
# @Desc : 测试软件包安装功能,验证能否正确安装
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试 texlive-pmxchords 软件包安装功能"
# 检查是否已安装
if rpm -q texlive-pmxchords &>/dev/null; then
LOG_INFO "检测到 texlive-pmxchords 已安装,将保持安装状态"
installed_before_test=true
else
LOG_INFO "检测到 texlive-pmxchords 未安装,将在测试后卸载"
installed_before_test=false
fi
# 检查 yum 源中是否存在该软件包
LOG_INFO "检查 yum 源中是否存在 texlive-pmxchords 软件包"
dnf list available texlive-pmxchords &>/dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "yum 源中未找到 texlive-pmxchords 软件包"
exit 255
fi
# 如果未安装,则进行安装测试
if [ "$installed_before_test" = false ]; then
LOG_INFO "开始安装 texlive-pmxchords 软件包"
dnf install -y texlive-pmxchords
CHECK_RESULT $? 0 0 "安装 texlive-pmxchords 失败"
LOG_INFO "texlive-pmxchords 软件包安装成功"
fi
# 验证软件包是否已安装并可正常使用
LOG_INFO "验证 texlive-pmxchords 软件包是否正常安装"
rpm -q texlive-pmxchords
CHECK_RESULT $? 0 0 "验证 texlive-pmxchords 安装状态失败"
# 尝试执行软件包相关命令(假设有可测试的命令)
LOG_INFO "尝试执行 texlive-pmxchords 相关命令"
# 这里假设 texlive-pmxchords 安装后会提供 "pmxchords" 命令
# 如果实际命令不同,请根据实际情况修改
if command -v pmxchords &>/dev/null; then
pmxchords --version
CHECK_RESULT $? 0 0 "执行 pmxchords 命令失败"
else
LOG_INFO "未找到 pmxchords 命令,跳过命令执行测试"
fi
# 测试完成后,如果测试前未安装,则卸载软件包
if [ "$installed_before_test" = false ]; then
LOG_INFO "测试完成,开始卸载 texlive-pmxchords 软件包"
dnf remove -y texlive-pmxchords
CHECK_RESULT $? 0 0 "卸载 texlive-pmxchords 失败"
LOG_INFO "texlive-pmxchords 软件包卸载成功"
else
LOG_INFO "测试完成,保持 texlive-pmxchords 安装状态"
fi
LOG_INFO "texlive-pmxchords 软件包安装功能测试完成"
}
main "$@"

View File

@@ -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-02-21
# @License : Mulan PSL v2
# @Desc : 测试pmxchords指定输出文件功能
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 测试pmxchords指定输出文件功能
LOG_INFO "1. 检查测试环境是否已安装texlive-pmxchords软件包"
rpm -q texlive-pmxchords
if [ $? -eq 0 ]; then
LOG_INFO "texlive-pmxchords已安装测试结束后将保持安装状态"
INSTALLED_BEFORE_TEST=1
else
LOG_INFO "texlive-pmxchords未安装将在测试过程中安装"
INSTALLED_BEFORE_TEST=0
fi
LOG_INFO "2. 检查yum源中是否有texlive-pmxchords软件包"
dnf list available texlive-pmxchords
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中没有texlive-pmxchords软件包"
exit 255
fi
if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then
LOG_INFO "3. 安装texlive-pmxchords软件包"
dnf install -y texlive-pmxchords
CHECK_RESULT $? 0 0 "安装texlive-pmxchords失败"
fi
LOG_INFO "4. 检查pmxchords命令是否可用"
which pmxchords
CHECK_RESULT $? 0 0 "pmxchords命令不可用"
LOG_INFO "5. 创建测试输入文件"
cat > test_input.tex << "EOF"
\documentclass{article}
\usepackage{pmxchords}
\begin{document}
Test chord: \chord{C}
\end{document}
EOF
CHECK_RESULT $? 0 0 "创建测试输入文件失败"
LOG_INFO "6. 测试pmxchords指定输出文件功能 - 正常情况"
pmxchords test_input.tex -o test_output.tex
CHECK_RESULT $? 0 0 "pmxchords执行失败"
LOG_INFO "7. 验证输出文件是否生成"
[ -f test_output.tex ]
CHECK_RESULT $? 0 0 "输出文件未生成"
LOG_INFO "8. 验证输出文件内容是否有效"
grep -q "chord" test_output.tex
CHECK_RESULT $? 0 0 "输出文件内容无效"
LOG_INFO "9. 测试pmxchords不支持的参数"
pmxchords --invalid-param test_input.tex 2>/dev/null
if [ $? -eq 255 ]; then
LOG_INFO "不支持的参数正确处理返回退出码255"
CHECK_RESULT $? 255 0 "不支持的参数未正确处理"
else
LOG_ERROR "不支持的参数未返回正确的退出码"
exit 255
fi
LOG_INFO "10. 清理测试文件"
rm -f test_input.tex test_output.tex
CHECK_RESULT $? 0 0 "清理测试文件失败"
if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then
LOG_INFO "11. 卸载测试安装的texlive-pmxchords软件包"
dnf remove -y texlive-pmxchords
CHECK_RESULT $? 0 0 "卸载texlive-pmxchords失败"
else
LOG_INFO "11. 测试前已安装texlive-pmxchords保持安装状态"
fi
LOG_INFO "12. 测试完成,环境已恢复"
}
main "$@"

View File

@@ -1,70 +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-21
# @License : Mulan PSL v2
# @Desc : 测试软件包卸载功能,验证能否完全移除
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试texlive-pmxchords软件包卸载功能"
LOG_INFO "步骤1检查yum源中是否存在texlive-pmxchords软件包"
dnf list available texlive-pmxchords &>/dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到texlive-pmxchords软件包"
exit 255
fi
LOG_INFO "步骤2检查当前环境是否已安装texlive-pmxchords软件包"
rpm -q texlive-pmxchords &>/dev/null
if [ $? -eq 0 ]; then
LOG_INFO "当前环境已安装texlive-pmxchords测试结束后将保持安装状态"
INSTALLED_BEFORE_TEST=1
else
LOG_INFO "当前环境未安装texlive-pmxchords将执行安装作为测试步骤"
INSTALLED_BEFORE_TEST=0
fi
if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then
LOG_INFO "步骤3安装texlive-pmxchords软件包"
dnf install -y texlive-pmxchords
CHECK_RESULT $? 0 0 "安装texlive-pmxchords软件包失败"
fi
LOG_INFO "步骤4验证软件包已成功安装"
rpm -q texlive-pmxchords
CHECK_RESULT $? 0 0 "验证texlive-pmxchords安装状态失败"
LOG_INFO "步骤5卸载texlive-pmxchords软件包"
dnf remove -y texlive-pmxchords
CHECK_RESULT $? 0 0 "卸载texlive-pmxchords软件包失败"
LOG_INFO "步骤6验证软件包已完全移除"
rpm -q texlive-pmxchords
if [ $? -eq 0 ]; then
LOG_ERROR "texlive-pmxchords软件包卸载后仍存在卸载不彻底"
exit 1
else
LOG_INFO "texlive-pmxchords软件包已完全移除"
fi
if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then
LOG_INFO "步骤7清理测试环境恢复原始状态"
LOG_INFO "由于测试前未安装,无需额外恢复操作"
else
LOG_INFO "步骤7清理测试环境恢复原始状态"
LOG_INFO "重新安装texlive-pmxchords以恢复原始安装状态"
dnf install -y texlive-pmxchords
CHECK_RESULT $? 0 0 "恢复安装texlive-pmxchords软件包失败"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -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-02-21
# @License : Mulan PSL v2
# @Desc : 测试pmxchords详细输出模式
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 环境检查检查texlive-pmxchords软件包是否已安装
LOG_INFO "检查texlive-pmxchords软件包是否已安装"
rpm -q texlive-pmxchords > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "texlive-pmxchords软件包已安装"
INSTALLED=1
else
LOG_INFO "texlive-pmxchords软件包未安装"
INSTALLED=0
fi
# 检查yum源中是否有texlive-pmxchords软件包
LOG_INFO "检查yum源中是否有texlive-pmxchords软件包"
dnf list available texlive-pmxchords > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中没有texlive-pmxchords软件包"
exit 255
fi
# 如果未安装则安装texlive-pmxchords软件包
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "安装texlive-pmxchords软件包"
dnf install -y texlive-pmxchords
CHECK_RESULT $? 0 0 "安装texlive-pmxchords软件包失败"
fi
# 检查pmxchords命令是否支持--verbose参数
LOG_INFO "检查pmxchords命令是否支持--verbose参数"
pmxchords --help 2>&1 | grep -q -- "--verbose"
if [ $? -ne 0 ]; then
LOG_ERROR "pmxchords命令不支持--verbose参数"
exit 255
fi
# 测试pmxchords详细输出模式
LOG_INFO "测试pmxchords详细输出模式"
pmxchords --verbose --help > /dev/null 2>&1
CHECK_RESULT $? 0 0 "pmxchords详细输出模式测试失败"
# 清理环境:如果测试前未安装,则卸载软件包
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "卸载texlive-pmxchords软件包"
dnf remove -y texlive-pmxchords
CHECK_RESULT $? 0 0 "卸载texlive-pmxchords软件包失败"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -1,70 +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-21
# @License : Mulan PSL v2
# @Desc : 测试pmxchords命令的版本查询功能
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试pmxchords命令的版本查询功能"
LOG_INFO "步骤1检查系统中是否已安装texlive-pmxchords软件包"
if rpm -q texlive-pmxchords &>/dev/null; then
LOG_INFO "texlive-pmxchords已安装脚本结束时将保持安装状态"
INSTALLED=1
else
LOG_INFO "texlive-pmxchords未安装将在测试过程中安装并在结束后卸载"
INSTALLED=0
fi
LOG_INFO "步骤2检查yum源中是否有texlive-pmxchords软件包"
if ! dnf list texlive-pmxchords &>/dev/null; then
LOG_ERROR "yum源中未找到texlive-pmxchords软件包"
exit 255
fi
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "步骤3安装texlive-pmxchords软件包"
dnf install -y texlive-pmxchords
CHECK_RESULT $? 0 0 "安装texlive-pmxchords失败"
fi
LOG_INFO "步骤4检查pmxchords命令是否存在"
if ! command -v pmxchords &>/dev/null; then
LOG_ERROR "pmxchords命令不存在"
if [ $INSTALLED -eq 0 ]; then
dnf remove -y texlive-pmxchords
fi
exit 255
fi
LOG_INFO "步骤5测试pmxchords命令的版本查询功能"
pmxchords --version
CHECK_RESULT $? 0 0 "pmxchords命令版本查询失败"
LOG_INFO "步骤6清理测试环境"
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "卸载texlive-pmxchords软件包"
dnf remove -y texlive-pmxchords
CHECK_RESULT $? 0 0 "卸载texlive-pmxchords失败"
else
LOG_INFO "保持texlive-pmxchords软件包安装状态"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -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-21
# @License : Mulan PSL v2
# @Desc : 测试pmxchords命令的-C参数用于指定配置文件
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试pmxchords命令的-C参数用于指定配置文件"
LOG_INFO "检查texlive-pmxchords软件包是否在yum源中"
dnf list available texlive-pmxchords 2>/dev/null | grep -q texlive-pmxchords
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到texlive-pmxchords软件包"
exit 255
fi
LOG_INFO "检查系统是否已安装texlive-pmxchords软件包"
rpm -q texlive-pmxchords >/dev/null 2>&1
installed=$?
if [ $installed -eq 0 ]; then
LOG_INFO "texlive-pmxchords软件包已安装测试后保持安装状态"
need_uninstall=false
else
LOG_INFO "texlive-pmxchords软件包未安装将进行安装"
need_uninstall=true
LOG_INFO "安装texlive-pmxchords软件包"
dnf install -y texlive-pmxchords
CHECK_RESULT $? 0 0 "安装texlive-pmxchords软件包失败"
fi
LOG_INFO "测试pmxchords命令-C参数检查参数是否存在"
pmxchords --help 2>&1 | grep -q -- "-C"
if [ $? -ne 0 ]; then
LOG_ERROR "pmxchords命令不支持-C参数"
if [ "$need_uninstall" = true ]; then
LOG_INFO "卸载texlive-pmxchords软件包"
dnf remove -y texlive-pmxchords
fi
exit 255
fi
LOG_INFO "创建测试配置文件test_config.cfg"
cat > test_config.cfg << EOF
% 测试配置文件内容
EOF
CHECK_RESULT $? 0 0 "创建测试配置文件失败"
LOG_INFO "执行pmxchords命令使用-C参数指定配置文件"
pmxchords -C test_config.cfg --help >/dev/null 2>&1
CHECK_RESULT $? 0 0 "pmxchords命令使用-C参数执行失败"
LOG_INFO "清理测试配置文件"
rm -f test_config.cfg
CHECK_RESULT $? 0 0 "删除测试配置文件失败"
if [ "$need_uninstall" = true ]; then
LOG_INFO "卸载texlive-pmxchords软件包"
dnf remove -y texlive-pmxchords
CHECK_RESULT $? 0 0 "卸载texlive-pmxchords软件包失败"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -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-02-21
# @License : Mulan PSL v2
# @Desc : 测试pmxchords命令的-D参数用于设置调试级别
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查当前环境是否已安装texlive-pmxchords软件包
LOG_INFO "检查是否已安装texlive-pmxchords软件包"
rpm -q texlive-pmxchords > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "texlive-pmxchords软件包已安装测试结束后将保持安装状态"
INSTALLED_BEFORE=1
else
LOG_INFO "texlive-pmxchords软件包未安装测试结束后将卸载软件包"
INSTALLED_BEFORE=0
fi
# 检查yum源中是否有texlive-pmxchords软件包
LOG_INFO "检查yum源中是否有texlive-pmxchords软件包"
dnf list available texlive-pmxchords > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到texlive-pmxchords软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ $INSTALLED_BEFORE -eq 0 ]; then
LOG_INFO "安装texlive-pmxchords软件包"
dnf install -y texlive-pmxchords
CHECK_RESULT $? 0 0 "安装texlive-pmxchords软件包失败"
fi
# 测试pmxchords命令的-D参数用于设置调试级别
LOG_INFO "测试pmxchords命令的-D参数设置调试级别为1"
pmxchords -D 1 --help > /dev/null 2>&1
CHECK_RESULT $? 0 0 "pmxchords命令的-D参数设置调试级别为1失败"
LOG_INFO "测试pmxchords命令的-D参数设置调试级别为2"
pmxchords -D 2 --help > /dev/null 2>&1
CHECK_RESULT $? 0 0 "pmxchords命令的-D参数设置调试级别为2失败"
LOG_INFO "测试pmxchords命令的-D参数设置调试级别为3"
pmxchords -D 3 --help > /dev/null 2>&1
CHECK_RESULT $? 0 0 "pmxchords命令的-D参数设置调试级别为3失败"
# 测试不支持的参数
LOG_INFO "测试pmxchords命令不支持的参数预期失败"
pmxchords --invalid-parameter > /dev/null 2>&1
if [ $? -eq 255 ]; then
LOG_INFO "不支持的参数测试通过命令返回退出码255"
else
LOG_ERROR "不支持的参数测试失败命令未返回预期退出码255"
exit 255
fi
# 清理环境
LOG_INFO "清理测试环境"
if [ $INSTALLED_BEFORE -eq 0 ]; then
LOG_INFO "卸载texlive-pmxchords软件包"
dnf remove -y texlive-pmxchords
CHECK_RESULT $? 0 0 "卸载texlive-pmxchords软件包失败"
else
LOG_INFO "测试前已安装texlive-pmxchords软件包保持安装状态"
fi
}
main "$@"

View File

@@ -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 : 2026-02-21
# @License : Mulan PSL v2
# @Desc : 测试pmxchords命令的-H参数用于显示帮助信息
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试pmxchords命令的-H参数"
LOG_INFO "检查软件包是否已在yum源中"
dnf list available texlive-pmxchords 2>/dev/null | grep -q texlive-pmxchords
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到texlive-pmxchords软件包"
exit 255
fi
LOG_INFO "检查系统是否已安装texlive-pmxchords"
rpm -q texlive-pmxchords >/dev/null 2>&1
INSTALLED=$?
if [ $INSTALLED -ne 0 ]; then
LOG_INFO "安装texlive-pmxchords软件包"
dnf install -y texlive-pmxchords
CHECK_RESULT $? 0 0 "安装texlive-pmxchords失败"
fi
LOG_INFO "测试pmxchords命令的-H参数"
pmxchords -H 2>&1 | head -5
CHECK_RESULT $? 0 0 "pmxchords命令不支持-H参数"
LOG_INFO "验证-H参数输出包含帮助信息"
pmxchords -H 2>&1 | grep -i "usage\|help\|选项" >/dev/null
CHECK_RESULT $? 0 0 "pmxchords -H未显示帮助信息"
if [ $INSTALLED -ne 0 ]; then
LOG_INFO "清理环境卸载texlive-pmxchords软件包"
dnf remove -y texlive-pmxchords
CHECK_RESULT $? 0 0 "卸载texlive-pmxchords失败"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -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-21
# @License : Mulan PSL v2
# @Desc : 测试pmxchords命令的-O参数用于指定输出文件
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "测试开始测试pmxchords命令的-O参数用于指定输出文件"
# 检查软件包是否在yum源中
LOG_INFO "步骤1检查texlive-pmxchords软件包是否在yum源中"
dnf list texlive-pmxchords &> /dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "texlive-pmxchords软件包不在yum源中"
exit 255
fi
# 检查是否已安装
LOG_INFO "步骤2检查texlive-pmxchords软件包是否已安装"
rpm -q texlive-pmxchords &> /dev/null
if [ $? -eq 0 ]; then
LOG_INFO "texlive-pmxchords软件包已安装测试结束后将保持安装状态"
INSTALLED=1
else
LOG_INFO "texlive-pmxchords软件包未安装将进行安装"
INSTALLED=0
fi
# 如果未安装,则安装软件包
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "步骤3安装texlive-pmxchords软件包"
dnf install -y texlive-pmxchords
CHECK_RESULT $? 0 0 "安装texlive-pmxchords软件包失败"
fi
# 测试pmxchords命令的-O参数
LOG_INFO "步骤4测试pmxchords命令的-O参数"
TEST_INPUT="test_input.tex"
TEST_OUTPUT="test_output.tex"
# 创建一个简单的测试输入文件
cat > $TEST_INPUT << EOF
\documentclass{article}
\usepackage{pmxchords}
\begin{document}
test
\end{document}
EOF
# 执行pmxchords命令使用-O参数指定输出文件
pmxchords -O $TEST_OUTPUT $TEST_INPUT &> /dev/null
CHECK_RESULT $? 0 0 "pmxchords命令执行失败或-O参数不支持"
# 检查输出文件是否存在
LOG_INFO "步骤5检查输出文件是否生成"
if [ -f $TEST_OUTPUT ]; then
LOG_INFO "输出文件 $TEST_OUTPUT 已成功生成"
else
LOG_ERROR "输出文件 $TEST_OUTPUT 未生成"
CHECK_RESULT 1 0 0 "输出文件未生成"
fi
# 清理测试文件
LOG_INFO "步骤6清理测试文件"
rm -f $TEST_INPUT $TEST_OUTPUT
# 如果测试前未安装,则卸载软件包
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "步骤7卸载texlive-pmxchords软件包"
dnf remove -y texlive-pmxchords
CHECK_RESULT $? 0 0 "卸载texlive-pmxchords软件包失败"
fi
LOG_INFO "测试结束pmxchords命令的-O参数测试完成"
}
main "$@"

View File

@@ -1,94 +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-21
# @License : Mulan PSL v2
# @Desc : 测试pmxchords命令的-V参数用于显示版本信息
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 测试pmxchords命令的-V参数用于显示版本信息
LOG_INFO "开始测试pmxchords命令的-V参数"
# 检查软件包是否在yum源中
LOG_INFO "检查yum源中是否存在texlive-pmxchords软件包"
if ! dnf list texlive-pmxchords &>/dev/null; then
LOG_ERROR "yum源中未找到texlive-pmxchords软件包"
exit 255
fi
# 检查是否已安装
LOG_INFO "检查系统是否已安装texlive-pmxchords"
if rpm -q texlive-pmxchords &>/dev/null; then
LOG_INFO "texlive-pmxchords已安装测试完成后保持安装状态"
INSTALLED_BEFORE_TEST=true
else
LOG_INFO "texlive-pmxchords未安装将在测试前安装"
INSTALLED_BEFORE_TEST=false
fi
# 如果未安装则安装
if [ "$INSTALLED_BEFORE_TEST" = false ]; then
LOG_INFO "安装texlive-pmxchords软件包"
dnf install -y texlive-pmxchords
CHECK_RESULT $? 0 0 "安装texlive-pmxchords失败"
fi
# 测试pmxchords命令是否存在
LOG_INFO "检查pmxchords命令是否存在"
command -v pmxchords &>/dev/null
CHECK_RESULT $? 0 0 "pmxchords命令不存在"
# 测试-V参数是否存在
LOG_INFO "测试pmxchords命令是否支持-V参数"
pmxchords -V &>/dev/null
if [ $? -eq 255 ]; then
LOG_ERROR "pmxchords命令不支持-V参数"
exit 255
fi
# 执行测试
LOG_INFO "执行pmxchords -V命令"
VERSION_OUTPUT=$(pmxchords -V 2>&1)
EXIT_CODE=$?
# 检查命令执行结果
CHECK_RESULT $EXIT_CODE 0 0 "pmxchords -V命令执行失败"
# 检查输出是否包含版本信息
LOG_INFO "检查版本信息输出"
if [ -z "$VERSION_OUTPUT" ]; then
LOG_ERROR "版本信息输出为空"
exit 1
fi
LOG_INFO "版本信息: $VERSION_OUTPUT"
LOG_INFO "pmxchords -V参数测试通过"
# 环境清理
LOG_INFO "开始环境清理"
if [ "$INSTALLED_BEFORE_TEST" = false ]; then
LOG_INFO "卸载测试期间安装的texlive-pmxchords软件包"
dnf remove -y texlive-pmxchords
CHECK_RESULT $? 0 0 "卸载texlive-pmxchords失败"
else
LOG_INFO "保持texlive-pmxchords安装状态"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -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 : 2026-02-21
# @License : Mulan PSL v2
# @Desc : 测试pmxchords命令的-v参数用于设置详细输出模式
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试pmxchords命令的-v参数用于设置详细输出模式"
LOG_INFO "检查环境中是否已安装texlive-pmxchords软件包"
rpm -q texlive-pmxchords > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "环境中已安装texlive-pmxchords软件包测试后保持安装状态"
INSTALLED=true
else
LOG_INFO "环境中未安装texlive-pmxchords软件包将在测试前安装"
INSTALLED=false
fi
LOG_INFO "检查yum源中是否存在texlive-pmxchords软件包"
dnf list available texlive-pmxchords > /dev/null 2>&1
CHECK_RESULT $? 0 0 "yum源中不存在texlive-pmxchords软件包"
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中不存在texlive-pmxchords软件包"
exit 255
fi
if [ "$INSTALLED" = "false" ]; then
LOG_INFO "开始安装texlive-pmxchords软件包"
dnf install -y texlive-pmxchords > /dev/null 2>&1
CHECK_RESULT $? 0 0 "安装texlive-pmxchords软件包失败"
fi
LOG_INFO "检查pmxchords命令是否支持-v参数"
pmxchords --help | grep -q -- "-v"
CHECK_RESULT $? 0 0 "pmxchords命令不支持-v参数"
if [ $? -ne 0 ]; then
LOG_ERROR "pmxchords命令不支持-v参数"
exit 255
fi
LOG_INFO "执行pmxchords命令的-v参数测试"
pmxchords -v > /dev/null 2>&1
CHECK_RESULT $? 0 0 "执行pmxchords -v命令失败"
LOG_INFO "测试完成,开始清理环境"
if [ "$INSTALLED" = "false" ]; then
LOG_INFO "卸载texlive-pmxchords软件包"
dnf remove -y texlive-pmxchords > /dev/null 2>&1
CHECK_RESULT $? 0 0 "卸载texlive-pmxchords软件包失败"
else
LOG_INFO "环境中已安装texlive-pmxchords软件包保持安装状态"
fi
LOG_INFO "环境清理完成,测试结束"
}
main "$@"

View File

@@ -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-26
# @License : Mulan PSL v2
# @Desc : Test opening the navigator
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试Test opening the navigator"
# 检查是否已安装texlive-navigator
LOG_INFO "检查是否已安装texlive-navigator"
dnf list installed texlive-navigator &>/dev/null
if [ $? -eq 0 ]; then
LOG_INFO "texlive-navigator已安装保持安装状态"
installed=true
else
LOG_INFO "texlive-navigator未安装将在测试结束后卸载"
installed=false
fi
# 检查yum源中是否有texlive-navigator软件包
LOG_INFO "检查yum源中是否有texlive-navigator软件包"
dnf list available texlive-navigator &>/dev/null
CHECK_RESULT $? 0 0 "yum源中未找到texlive-navigator软件包"
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到texlive-navigator软件包退出测试"
exit 255
fi
# 安装texlive-navigator如果未安装
if [ "$installed" = false ]; then
LOG_INFO "安装texlive-navigator"
dnf install -y texlive-navigator
CHECK_RESULT $? 0 0 "安装texlive-navigator失败"
fi
# 测试打开navigator功能
LOG_INFO "测试打开navigator功能"
texlive-navigator --open
CHECK_RESULT $? 0 0 "打开navigator失败"
# 清理环境(如果之前未安装)
if [ "$installed" = false ]; then
LOG_INFO "卸载texlive-navigator"
dnf remove -y texlive-navigator
CHECK_RESULT $? 0 0 "卸载texlive-navigator失败"
fi
LOG_INFO "测试完成Test opening the navigator"
}
main "$@"

View File

@@ -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 : 2025-11-26
# @License : Mulan PSL v2
# @Desc : Test basic drawing functionality
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查texlive-tkz-base软件包是否已安装
if dnf list installed texlive-tkz-base &>/dev/null; then
LOG_INFO "texlive-tkz-base软件包已安装测试完成后将保持安装状态"
INSTALLED=true
else
LOG_INFO "texlive-tkz-base软件包未安装测试完成后将卸载"
INSTALLED=false
fi
# 检查yum源中是否存在texlive-tkz-base软件包
LOG_INFO "检查yum源中是否存在texlive-tkz-base软件包"
if ! dnf list available texlive-tkz-base &>/dev/null; then
LOG_ERROR "yum源中不存在texlive-tkz-base软件包"
exit 255
fi
# 安装texlive-tkz-base软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "正在安装texlive-tkz-base软件包"
dnf install -y texlive-tkz-base
CHECK_RESULT $? 0 0 "安装texlive-tkz-base软件包失败"
fi
# 测试基本绘图功能
LOG_INFO "测试基本绘图功能"
cat > test_draw.tex << "EOF"
\documentclass{article}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture}
\tkzDefPoint(0,0){A}
\tkzDefPoint(2,2){B}
\tkzDrawSegment(A,B)
\end{tikzpicture}
\end{document}
EOF
pdflatex test_draw.tex
CHECK_RESULT $? 0 0 "生成PDF文件失败"
# 清理生成的临时文件
LOG_INFO "清理临时文件"
rm -f test_draw.aux test_draw.log test_draw.pdf test_draw.tex
# 卸载texlive-tkz-base软件包如果测试前未安装
if [ "$INSTALLED" = false ]; then
LOG_INFO "正在卸载texlive-tkz-base软件包"
dnf remove -y texlive-tkz-base
CHECK_RESULT $? 0 0 "卸载texlive-tkz-base软件包失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
main "$@"