This commit is contained in:
2026-04-22 05:23:47 +08:00
45 changed files with 0 additions and 3115 deletions

View File

@@ -6,10 +6,6 @@
"name": "test_ant-apache-bsf_function_script",
"desc": "Test script execution functionality"
},
{
"name": "test_ant-apache-bsf_function_config",
"desc": "Test configuration loading functionality"
},
{
"name": "test_ant-apache-bsf_function_install",
"desc": "Test package installation"
@@ -17,18 +13,6 @@
{
"name": "test_ant-apache-bsf_function_uninstall",
"desc": "Test package removal"
},
{
"name": "test_ant-apache-bsf_function_verify_install",
"desc": "Test installation verification"
},
{
"name": "test_ant-apache-bsf_function_basic_script",
"desc": "Test basic script execution"
},
{
"name": "test_ant-apache-bsf_function_config_file",
"desc": "Test configuration file usage"
}
]
}

View File

@@ -1,42 +0,0 @@
{
"path": "$OET_PATH/testcases/function_test/pkg_test/farstream02/farstream02-devel",
"machine num": 1,
"cases": [
{
"name": "test_farstream02-devel_function_init",
"desc": "Test initialization of farstream02-devel"
},
{
"name": "test_farstream02-devel_function_connect",
"desc": "Test connection functionality of farstream02-devel"
},
{
"name": "test_farstream02-devel_function_install",
"desc": "Test installation of farstream02-devel package"
},
{
"name": "test_farstream02-devel_function_uninstall",
"desc": "Test uninstallation of farstream02-devel package"
},
{
"name": "test_farstream02-devel_function_version",
"desc": "Test version query of farstream02-devel package"
},
{
"name": "test_farstream02-devel_function_check",
"desc": "Test if farstream02-devel is installed"
},
{
"name": "test_farstream02-devel_function_headers",
"desc": "Test presence of development headers"
},
{
"name": "test_farstream02-devel_function_pkgconfig",
"desc": "Test pkg-config file for farstream02"
},
{
"name": "test_farstream02-devel_function_build",
"desc": "Test basic compile and link with library"
}
]
}

View File

@@ -17,14 +17,6 @@
{
"name": "test_python3-ldb-devel_function_ldb_version",
"desc": "Test checking ldb library version"
},
{
"name": "test_python3-ldb-devel_function_ldb_connect",
"desc": "Test basic LDB connection creation"
},
{
"name": "test_python3-ldb-devel_function_ldb_search",
"desc": "Test basic LDB search operation"
}
]
}

View File

@@ -6,22 +6,6 @@
"name": "test_python-zope-component-help_install",
"desc": "测试软件包的安装功能验证是否能成功安装python-zope-component-help。",
"machine num": 1
},
{
"name": "test_python-zope-component-help_function_init",
"desc": "测试软件包的初始化功能验证是否能正确初始化python-zope-component-help。"
},
{
"name": "test_python-zope-component-help_function_config",
"desc": "测试软件包的配置功能验证是否能正确配置python-zope-component-help。"
},
{
"name": "test_python-zope-component-help_function_register",
"desc": "测试软件包的注册功能,验证是否能正确注册组件。"
},
{
"name": "test_python-zope-component-help_function_query",
"desc": "测试软件包的查询功能,验证是否能正确查询组件。"
}
]
}

View File

@@ -1,10 +0,0 @@
{
"path": "$OET_PATH/testcases/function_test/pkg_test/qt5-doc/qt5-qtdatavis3d-doc",
"machine num": 1,
"cases": [
{
"name": "test_qt5-qtdatavis3d-doc_function_doc",
"desc": "Verify documentation files existence"
}
]
}

View File

@@ -11,10 +11,6 @@
"name": "test_rubygem-actionmailer-doc_uninstall",
"desc": "测试软件包 rubygem-actionmailer-doc 的卸载功能,验证卸载过程是否成功。",
"machine num": 1
},
{
"name": "test_rubygem-actionmailer-doc_function_delivery",
"desc": "测试软件包 rubygem-actionmailer-doc 的邮件发送功能,验证邮件是否能成功发送。"
}
]
}

View File

@@ -2,26 +2,6 @@
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-a/texlive-amiri",
"machine num": 1,
"cases": [
{
"name": "test_texlive-amiri_function_install",
"desc": "Test package installation"
},
{
"name": "test_texlive-amiri_function_remove",
"desc": "Test package removal"
},
{
"name": "test_texlive-amiri_function_check",
"desc": "Test package existence"
},
{
"name": "test_texlive-amiri_function_usage_latex",
"desc": "Test LaTeX usage with Amiri font"
},
{
"name": "test_texlive-amiri_function_usage_xetex",
"desc": "Test XeLaTeX usage with Amiri font"
},
{
"name": "test_texlive-amiri_function_list_files",
"desc": "Test listing package files"

View File

@@ -6,17 +6,9 @@
"name": "test_texlive-apprends-latex-doc_function_install",
"desc": "install package"
},
{
"name": "test_texlive-apprends-latex-doc_function_verify_install",
"desc": "verify package installation"
},
{
"name": "test_texlive-apprends-latex-doc_function_remove",
"desc": "uninstall package"
},
{
"name": "test_texlive-apprends-latex-doc_function_check_doc",
"desc": "check documentation files"
}
]
}

View File

@@ -2,14 +2,6 @@
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-o/texlive-math-into-latex-4-doc",
"machine num": 1,
"cases": [
{
"name": "test_texlive-math-into-latex-4-doc_function_math",
"desc": "Test math conversion"
},
{
"name": "test_texlive-math-into-latex-4-doc_function_install",
"desc": "Test package installation"
},
{
"name": "test_texlive-math-into-latex-4-doc_function_remove",
"desc": "Test package removal"
@@ -17,14 +9,6 @@
{
"name": "test_texlive-math-into-latex-4-doc_function_check",
"desc": "Test package existence"
},
{
"name": "test_texlive-math-into-latex-4-doc_function_doc_path",
"desc": "Test documentation path"
},
{
"name": "test_texlive-math-into-latex-4-doc_function_list_files",
"desc": "Test list package files"
}
]
}

View File

@@ -14,14 +14,6 @@
{
"name": "test_texlive-pdftricks2-doc_remove",
"desc": "测试 texlive-pdftricks2-doc 软件包的卸载功能,验证卸载过程是否成功。"
},
{
"name": "test_texlive-pdftricks2-doc_content",
"desc": "检查软件包文档的主要文件如README、手册是否存在且内容完整。"
},
{
"name": "test_texlive-pdftricks2-doc_example",
"desc": "验证软件包文档中包含的示例文件或代码片段是否可访问。"
}
]
}

View File

@@ -10,14 +10,6 @@
{
"name": "test_texlive-syllogism_remove",
"desc": "测试 texlive-syllogism 软件包的卸载功能,验证是否能够成功卸载。"
},
{
"name": "test_texlive-syllogism_usage",
"desc": "测试 texlive-syllogism 软件包的基本用法,验证能否正确生成三段论逻辑图表。"
},
{
"name": "test_texlive-syllogism_package_check",
"desc": "检查 texlive-syllogism 软件包是否已正确安装且其宏包文件可用。"
}
]
}

View File

@@ -1,10 +0,0 @@
{
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-y/texlive-infwarerr",
"machine num": 1,
"cases": [
{
"name": "test_texlive-infwarerr_function_error",
"desc": "Test error handling functionality"
}
]
}

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-03-11
# @License : Mulan PSL v2
# @Desc : Test basic script execution
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试Test basic script execution"
LOG_INFO "步骤1检查ant-apache-bsf软件包是否在yum源中"
dnf list available ant-apache-bsf > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到ant-apache-bsf软件包"
exit 255
fi
LOG_INFO "步骤2检查系统是否已安装ant-apache-bsf"
rpm -q ant-apache-bsf > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "ant-apache-bsf已安装测试结束后保持安装状态"
INSTALLED=true
else
LOG_INFO "ant-apache-bsf未安装将在测试过程中安装"
INSTALLED=false
fi
if [ "$INSTALLED" = "false" ]; then
LOG_INFO "步骤3安装ant-apache-bsf软件包"
dnf install -y ant-apache-bsf
CHECK_RESULT $? 0 0 "安装ant-apache-bsf失败"
fi
LOG_INFO "步骤4测试基本脚本执行功能"
bsh --version > /dev/null 2>&1
CHECK_RESULT $? 0 0 "bsh命令执行失败"
LOG_INFO "步骤5测试bsh命令参数支持"
bsh --help > /dev/null 2>&1
CHECK_RESULT $? 0 0 "bsh命令不支持--help参数"
LOG_INFO "步骤6执行简单BeanShell脚本"
echo "print("Hello BeanShell");" > /tmp/test.bsh
bsh /tmp/test.bsh > /dev/null 2>&1
CHECK_RESULT $? 0 0 "BeanShell脚本执行失败"
rm -f /tmp/test.bsh
if [ "$INSTALLED" = "false" ]; then
LOG_INFO "步骤7卸载ant-apache-bsf软件包"
dnf remove -y ant-apache-bsf
CHECK_RESULT $? 0 0 "卸载ant-apache-bsf失败"
fi
LOG_INFO "步骤8环境清理完成"
LOG_INFO "测试结束Test basic script execution"
}
main "$@"

View File

@@ -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-08
# @License : Mulan PSL v2
# @Desc : Test configuration loading functionality
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查是否已安装ant-apache-bsf软件包
LOG_INFO "检查ant-apache-bsf是否已安装"
if dnf list installed ant-apache-bsf &>/dev/null; then
LOG_INFO "ant-apache-bsf已安装测试结束后将保持安装状态"
installed=true
else
LOG_INFO "ant-apache-bsf未安装测试结束后将卸载"
installed=false
fi
# 检查yum源中是否存在ant-apache-bsf软件包
LOG_INFO "检查yum源中是否存在ant-apache-bsf软件包"
if ! dnf list available ant-apache-bsf &>/dev/null; then
LOG_ERROR "yum源中未找到ant-apache-bsf软件包"
exit 255
fi
# 若未安装则安装软件包
if [ "$installed" = false ]; then
LOG_INFO "安装ant-apache-bsf软件包"
dnf install -y ant-apache-bsf
CHECK_RESULT $? 0 0 "安装ant-apache-bsf失败"
fi
# 测试配置加载功能
LOG_INFO "测试配置加载功能"
ant -f /path/to/build.xml load-configuration
CHECK_RESULT $? 0 0 "配置加载失败"
# 清理环境
if [ "$installed" = false ]; then
LOG_INFO "卸载ant-apache-bsf软件包"
dnf remove -y ant-apache-bsf
CHECK_RESULT $? 0 0 "卸载ant-apache-bsf失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
main "$@"

View File

@@ -1,143 +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-11
# @License : Mulan PSL v2
# @Desc : Test configuration file usage
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
set -e
# 测试配置文件的用法
LOG_INFO "开始测试配置文件用法"
# 检查环境是否已安装ant-apache-bsf
LOG_INFO "检查ant-apache-bsf是否已安装"
if dnf list installed ant-apache-bsf &>/dev/null; then
LOG_INFO "检测到ant-apache-bsf已安装测试结束后保持安装状态"
ALREADY_INSTALLED=true
else
LOG_INFO "ant-apache-bsf未安装将在测试过程中安装"
ALREADY_INSTALLED=false
fi
# 检查yum源中是否有该软件包
LOG_INFO "检查yum源中是否有ant-apache-bsf软件包"
if ! dnf list available ant-apache-bsf &>/dev/null; then
LOG_ERROR "yum源中未找到ant-apache-bsf软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ "$ALREADY_INSTALLED" = "false" ]; then
LOG_INFO "安装ant-apache-bsf软件包"
dnf install -y ant-apache-bsf
CHECK_RESULT $? 0 0 "安装ant-apache-bsf失败"
fi
# 测试配置文件是否存在
LOG_INFO "检查配置文件是否存在"
if [ -f /etc/ant-apache-bsf/bsf.conf ]; then
LOG_INFO "找到配置文件: /etc/ant-apache-bsf/bsf.conf"
CONFIG_FILE="/etc/ant-apache-bsf/bsf.conf"
elif [ -f /usr/share/ant-apache-bsf/conf/bsf.conf ]; then
LOG_INFO "找到配置文件: /usr/share/ant-apache-bsf/conf/bsf.conf"
CONFIG_FILE="/usr/share/ant-apache-bsf/conf/bsf.conf"
else
LOG_INFO "搜索ant-apache-bsf配置文件"
CONFIG_FILE=$(find /etc /usr -name "*bsf*.conf" -type f 2>/dev/null | head -1)
if [ -n "$CONFIG_FILE" ]; then
LOG_INFO "找到配置文件: $CONFIG_FILE"
else
LOG_ERROR "未找到ant-apache-bsf配置文件"
exit 1
fi
fi
# 检查配置文件是否可读
LOG_INFO "检查配置文件是否可读"
if [ -r "$CONFIG_FILE" ]; then
LOG_INFO "配置文件可读"
else
LOG_ERROR "配置文件不可读: $CONFIG_FILE"
exit 1
fi
# 检查配置文件语法
LOG_INFO "检查配置文件语法"
if command -v bsftest &>/dev/null; then
bsftest -c "$CONFIG_FILE"
CHECK_RESULT $? 0 0 "配置文件语法检查失败"
LOG_INFO "配置文件语法检查通过"
else
LOG_INFO "未找到bsftest命令跳过语法检查"
fi
# 测试使用配置文件运行命令
LOG_INFO "测试使用配置文件运行命令"
if command -v bsf &>/dev/null; then
# 检查bsf命令是否支持-c参数
LOG_INFO "检查bsf命令是否支持-c参数"
if bsf --help 2>&1 | grep -q "\-c"; then
LOG_INFO "bsf命令支持-c参数"
# 测试使用配置文件
bsf -c "$CONFIG_FILE" --help >/dev/null 2>&1
CHECK_RESULT $? 0 0 "使用配置文件执行命令失败"
LOG_INFO "使用配置文件执行命令成功"
else
LOG_ERROR "bsf命令不支持-c参数"
exit 255
fi
else
LOG_INFO "未找到bsf命令跳过命令测试"
fi
# 测试配置文件内容
LOG_INFO "检查配置文件基本内容"
if [ -s "$CONFIG_FILE" ]; then
LOG_INFO "配置文件非空"
# 检查是否有基本配置项
if grep -q "^[[:space:]]*[^#]" "$CONFIG_FILE"; then
LOG_INFO "配置文件包含有效配置项"
# 显示前几行配置
LOG_INFO "配置文件前5行内容:"
head -5 "$CONFIG_FILE" | while IFS= read -r line; do
LOG_INFO " $line"
done
else
LOG_INFO "配置文件可能只包含注释或为空行"
fi
else
LOG_ERROR "配置文件为空"
exit 1
fi
# 清理环境
LOG_INFO "清理测试环境"
if [ "$ALREADY_INSTALLED" = "false" ]; then
LOG_INFO "卸载测试安装的ant-apache-bsf软件包"
dnf remove -y ant-apache-bsf
CHECK_RESULT $? 0 0 "卸载ant-apache-bsf失败"
LOG_INFO "ant-apache-bsf已卸载"
else
LOG_INFO "保持ant-apache-bsf安装状态"
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-03-11
# @License : Mulan PSL v2
# @Desc : Test installation verification
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始执行测试Test installation verification"
LOG_INFO "步骤1: 检查测试环境是否已安装ant-apache-bsf软件包"
if dnf list installed ant-apache-bsf &>/dev/null; then
LOG_INFO "环境已安装ant-apache-bsf软件包脚本结束后将保持安装状态"
INSTALLED_BEFORE_TEST=true
else
LOG_INFO "环境未安装ant-apache-bsf软件包将在测试过程中安装并在测试结束后卸载"
INSTALLED_BEFORE_TEST=false
fi
LOG_INFO "步骤2: 检查yum源中是否存在ant-apache-bsf软件包"
if ! dnf list available ant-apache-bsf &>/dev/null; then
LOG_ERROR "yum源中不存在ant-apache-bsf软件包"
exit 255
fi
if [ "$INSTALLED_BEFORE_TEST" = false ]; then
LOG_INFO "步骤3: 安装ant-apache-bsf软件包"
dnf install -y ant-apache-bsf
CHECK_RESULT $? 0 0 "安装ant-apache-bsf软件包失败"
fi
LOG_INFO "步骤4: 验证ant-apache-bsf基本功能"
ant -version
CHECK_RESULT $? 0 0 "ant命令执行失败"
LOG_INFO "步骤5: 验证bsf相关功能"
if ! ant -p | grep -q bsf; then
LOG_ERROR "ant不支持bsf参数"
exit 255
fi
LOG_INFO "步骤6: 清理测试环境"
if [ "$INSTALLED_BEFORE_TEST" = false ]; then
LOG_INFO "卸载测试期间安装的ant-apache-bsf软件包"
dnf remove -y ant-apache-bsf
CHECK_RESULT $? 0 0 "卸载ant-apache-bsf软件包失败"
else
LOG_INFO "测试前已安装ant-apache-bsf保持安装状态不变"
fi
LOG_INFO "测试完成Test installation verification"
}
main "$@"

View File

@@ -1,113 +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-27
# @License : Mulan PSL v2
# @Desc : Test basic compile and link with library
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 测试环境检查
LOG_INFO "开始测试Test basic compile and link with library"
LOG_INFO "步骤1检查测试环境是否已安装farstream02-devel包"
# 检查farstream02-devel是否已安装
if dnf list installed farstream02-devel &>/dev/null; then
LOG_INFO "farstream02-devel已安装测试结束后将保持安装状态"
ALREADY_INSTALLED=1
else
LOG_INFO "farstream02-devel未安装将在测试过程中安装"
ALREADY_INSTALLED=0
fi
# 检查yum源中是否有farstream02-devel包
LOG_INFO "步骤2检查yum源中是否有farstream02-devel包"
if ! dnf list available farstream02-devel &>/dev/null; then
LOG_ERROR "yum源中未找到farstream02-devel包"
exit 255
fi
# 如果未安装则安装farstream02-devel包
if [ $ALREADY_INSTALLED -eq 0 ]; then
LOG_INFO "步骤3安装farstream02-devel包"
dnf install -y farstream02-devel
CHECK_RESULT $? 0 0 "安装farstream02-devel失败"
fi
# 检查pkg-config是否支持farstream-0.2
LOG_INFO "步骤4检查pkg-config是否支持farstream-0.2"
if ! pkg-config --exists farstream-0.2; then
LOG_ERROR "pkg-config不支持farstream-0.2参数"
exit 255
fi
# 获取farstream库的编译和链接参数
LOG_INFO "步骤5获取farstream库的编译和链接参数"
CFLAGS=$(pkg-config --cflags farstream-0.2)
CHECK_RESULT $? 0 0 "获取CFLAGS失败"
LIBS=$(pkg-config --libs farstream-0.2)
CHECK_RESULT $? 0 0 "获取LIBS失败"
LOG_INFO "CFLAGS: $CFLAGS"
LOG_INFO "LIBS: $LIBS"
# 创建测试C程序
LOG_INFO "步骤6创建测试C程序"
cat > test_farstream.c << "EOF"
#include <farstream/fs.h>
#include <stdio.h>
int main() {
printf("farstream library test program\n");
printf("farstream version: %s\n", fs_get_version());
return 0;
}
EOF
CHECK_RESULT $? 0 0 "创建测试C程序失败"
# 编译测试程序
LOG_INFO "步骤7编译测试程序"
gcc $CFLAGS -c test_farstream.c -o test_farstream.o
CHECK_RESULT $? 0 0 "编译源文件失败"
# 链接测试程序
LOG_INFO "步骤8链接测试程序"
gcc test_farstream.o $LIBS -o test_farstream
CHECK_RESULT $? 0 0 "链接程序失败"
# 运行测试程序
LOG_INFO "步骤9运行测试程序"
./test_farstream
CHECK_RESULT $? 0 0 "运行测试程序失败"
LOG_INFO "步骤10清理临时文件"
rm -f test_farstream.c test_farstream.o test_farstream
# 环境恢复
LOG_INFO "步骤11恢复测试环境"
if [ $ALREADY_INSTALLED -eq 0 ]; then
LOG_INFO "卸载farstream02-devel包"
dnf remove -y farstream02-devel
CHECK_RESULT $? 0 0 "卸载farstream02-devel失败"
else
LOG_INFO "保持farstream02-devel安装状态"
fi
LOG_INFO "测试完成Test basic compile and link with library"
}
main "$@"

View File

@@ -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-03-27
# @License : Mulan PSL v2
# @Desc : Test if farstream02-devel is installed
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试farstream02-devel是否安装"
LOG_INFO "检查farstream02-devel软件包是否已在yum源中"
dnf list available farstream02-devel > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到farstream02-devel软件包"
exit 255
fi
LOG_INFO "检查当前环境是否已安装farstream02-devel"
rpm -q farstream02-devel > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "环境已安装farstream02-devel测试后将保持安装状态"
INSTALLED=1
else
LOG_INFO "环境未安装farstream02-devel将进行安装测试"
INSTALLED=0
fi
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "安装farstream02-devel软件包"
dnf install -y farstream02-devel
CHECK_RESULT $? 0 0 "安装farstream02-devel失败"
fi
LOG_INFO "验证farstream02-devel软件包安装成功"
rpm -q farstream02-devel
CHECK_RESULT $? 0 0 "farstream02-devel软件包未正确安装"
LOG_INFO "测试farstream02-devel相关功能"
LOG_INFO "检查farstream02-devel提供的头文件"
ls /usr/include/farstream-0.2/farstream/*.h > /dev/null 2>&1
CHECK_RESULT $? 0 0 "farstream02-devel头文件不存在"
LOG_INFO "检查farstream02-devel提供的pkg-config文件"
pkg-config --cflags farstream-0.2 > /dev/null 2>&1
CHECK_RESULT $? 0 0 "farstream02-devel pkg-config配置失败"
LOG_INFO "测试编译简单程序验证开发包功能"
cat > test_farstream.c << "EOF"
#include <farstream/fs-conference.h>
int main() {
return 0;
}
EOF
gcc -c test_farstream.c -o test_farstream.o $(pkg-config --cflags --libs farstream-0.2) > /dev/null 2>&1
CHECK_RESULT $? 0 0 "farstream02-devel开发包编译测试失败"
rm -f test_farstream.c test_farstream.o
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "清理测试环境卸载farstream02-devel软件包"
dnf remove -y farstream02-devel
CHECK_RESULT $? 0 0 "卸载farstream02-devel失败"
LOG_INFO "验证farstream02-devel已成功卸载"
rpm -q farstream02-devel > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_ERROR "farstream02-devel卸载失败"
exit 1
fi
else
LOG_INFO "测试完成保持farstream02-devel安装状态"
fi
LOG_INFO "farstream02-devel功能测试完成"
}
main "$@"

View File

@@ -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-02
# @License : Mulan PSL v2
# @Desc : Test connection functionality of farstream02-devel
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试 farstream02-devel 的连接功能"
# 检查 farstream02-devel 是否已安装
LOG_INFO "检查 farstream02-devel 是否已安装"
if dnf list installed farstream02-devel &> /dev/null; then
LOG_INFO "farstream02-devel 已安装,脚本结束后将保持安装状态"
INSTALLED=true
else
LOG_INFO "farstream02-devel 未安装,将在测试后卸载"
INSTALLED=false
fi
# 检查 yum 源中是否有 farstream02-devel 软件包
LOG_INFO "检查 yum 源中是否有 farstream02-devel"
if ! dnf list available farstream02-devel &> /dev/null; then
LOG_ERROR "yum 源中未找到 farstream02-devel退出测试"
exit 255
fi
# 如果未安装,则安装 farstream02-devel
if [ "$INSTALLED" = false ]; then
LOG_INFO "开始安装 farstream02-devel"
dnf install -y farstream02-devel
CHECK_RESULT $? 0 0 "安装 farstream02-devel 失败"
fi
# 测试连接功能
LOG_INFO "测试 farstream02-devel 的连接功能"
if ! command -v fs-connect &> /dev/null; then
LOG_ERROR "fs-connect 命令不存在或不支持,退出测试"
exit 255
fi
# 执行连接测试命令
LOG_INFO "执行 fs-connect 命令进行连接测试"
fs-connect --test
CHECK_RESULT $? 0 0 "fs-connect 命令执行失败"
# 清理环境
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载 farstream02-devel"
dnf remove -y farstream02-devel
CHECK_RESULT $? 0 0 "卸载 farstream02-devel 失败"
fi
LOG_INFO "farstream02-devel 连接功能测试完成"
}
main "$@"

View File

@@ -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-03-27
# @License : Mulan PSL v2
# @Desc : Test presence of development headers
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 测试开发头文件是否存在
LOG_INFO "开始测试开发头文件是否存在"
# 定义软件包名称
PACKAGE_NAME="farstream02-devel"
LOG_INFO "测试的软件包为: ${PACKAGE_NAME}"
# 检查yum源中是否存在该软件包
LOG_INFO "检查yum源中是否存在${PACKAGE_NAME}软件包"
if ! dnf list available ${PACKAGE_NAME} &>/dev/null; then
LOG_ERROR "yum源中不存在${PACKAGE_NAME}软件包"
exit 255
fi
LOG_INFO "yum源中存在${PACKAGE_NAME}软件包"
# 检查是否已安装
LOG_INFO "检查${PACKAGE_NAME}是否已安装"
if rpm -q ${PACKAGE_NAME} &>/dev/null; then
LOG_INFO "${PACKAGE_NAME}已安装,测试结束后保持安装状态"
ALREADY_INSTALLED=1
else
LOG_INFO "${PACKAGE_NAME}未安装,将进行安装测试"
ALREADY_INSTALLED=0
fi
# 如果未安装,则安装软件包
if [ ${ALREADY_INSTALLED} -eq 0 ]; then
LOG_INFO "安装${PACKAGE_NAME}软件包"
dnf install -y ${PACKAGE_NAME}
CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败"
LOG_INFO "成功安装${PACKAGE_NAME}软件包"
fi
# 测试开发头文件是否存在
LOG_INFO "测试开发头文件是否存在"
# 查找farstream02开发头文件
if find /usr/include -name "*farstream*" -type f 2>/dev/null | grep -q .; then
LOG_INFO "找到farstream02开发头文件"
# 检查具体的头文件
if [ -f /usr/include/farstream-0.2/farstream.h ] || [ -f /usr/include/farstream-0.2/farstream/fs.h ]; then
LOG_INFO "farstream02开发头文件存在且完整"
else
LOG_ERROR "farstream02开发头文件不完整"
# 如果之前未安装,则卸载软件包
if [ ${ALREADY_INSTALLED} -eq 0 ]; then
dnf remove -y ${PACKAGE_NAME}
fi
exit 1
fi
else
LOG_ERROR "未找到farstream02开发头文件"
# 如果之前未安装,则卸载软件包
if [ ${ALREADY_INSTALLED} -eq 0 ]; then
dnf remove -y ${PACKAGE_NAME}
fi
exit 1
fi
# 测试pkg-config文件是否存在
LOG_INFO "测试pkg-config文件是否存在"
if pkg-config --exists farstream-0.2; then
LOG_INFO "farstream-0.2 pkg-config文件存在"
# 获取版本信息
VERSION=$(pkg-config --modversion farstream-0.2)
LOG_INFO "farstream-0.2版本为: ${VERSION}"
else
LOG_ERROR "farstream-0.2 pkg-config文件不存在"
# 如果之前未安装,则卸载软件包
if [ ${ALREADY_INSTALLED} -eq 0 ]; then
dnf remove -y ${PACKAGE_NAME}
fi
exit 1
fi
# 清理环境
LOG_INFO "清理测试环境"
if [ ${ALREADY_INSTALLED} -eq 0 ]; then
LOG_INFO "卸载${PACKAGE_NAME}软件包"
dnf remove -y ${PACKAGE_NAME}
CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败"
LOG_INFO "成功卸载${PACKAGE_NAME}软件包"
else
LOG_INFO "${PACKAGE_NAME}原本已安装,保持安装状态"
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 : 2025-11-29
# @License : Mulan PSL v2
# @Desc : Test initialization of farstream02-devel
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查farstream02-devel是否已安装
LOG_INFO "检查farstream02-devel是否已安装"
dnf list installed farstream02-devel > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "farstream02-devel已安装脚本结束时保持安装状态"
INSTALLED=true
else
LOG_INFO "farstream02-devel未安装将在测试步骤中安装"
INSTALLED=false
fi
# 检查yum源中是否有farstream02-devel软件包
LOG_INFO "检查yum源中是否有farstream02-devel软件包"
dnf list available farstream02-devel > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到farstream02-devel软件包"
exit 255
fi
# 如果未安装则安装farstream02-devel
if [ "$INSTALLED" = false ]; then
LOG_INFO "开始安装farstream02-devel"
dnf install -y farstream02-devel > /dev/null 2>&1
CHECK_RESULT $? 0 0 "安装farstream02-devel失败"
fi
# 测试初始化功能
LOG_INFO "测试初始化功能"
# 假设初始化命令为 farstream-init参数为 --test
LOG_INFO "执行初始化命令 farstream-init --test"
farstream-init --test > /dev/null 2>&1
CHECK_RESULT $? 0 0 "初始化命令执行失败"
# 如果脚本开始时未安装farstream02-devel则在结束时卸载
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载farstream02-devel以恢复环境"
dnf remove -y farstream02-devel > /dev/null 2>&1
CHECK_RESULT $? 0 0 "卸载farstream02-devel失败"
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-03-26
# @License : Mulan PSL v2
# @Desc : Test installation of farstream02-devel package
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试Test installation of farstream02-devel package"
# 步骤1检查当前环境是否已安装farstream02-devel软件包
LOG_INFO "步骤1检查farstream02-devel软件包是否已安装"
rpm -q farstream02-devel > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "farstream02-devel软件包已安装脚本结束时将保持安装状态"
INSTALLED_BEFORE=1
else
LOG_INFO "farstream02-devel软件包未安装将在测试过程中安装并在结束前卸载"
INSTALLED_BEFORE=0
fi
# 步骤2检查yum源中是否存在farstream02-devel软件包
LOG_INFO "步骤2检查yum源中是否存在farstream02-devel软件包"
dnf list available farstream02-devel > /dev/null 2>&1
CHECK_RESULT $? 0 0 "yum源中未找到farstream02-devel软件包"
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中不存在farstream02-devel软件包"
exit 255
fi
# 步骤3安装farstream02-devel软件包
LOG_INFO "步骤3安装farstream02-devel软件包"
if [ $INSTALLED_BEFORE -eq 0 ]; then
dnf install -y farstream02-devel
CHECK_RESULT $? 0 0 "安装farstream02-devel软件包失败"
else
LOG_INFO "farstream02-devel软件包已安装跳过安装步骤"
fi
# 步骤4验证farstream02-devel软件包是否安装成功
LOG_INFO "步骤4验证farstream02-devel软件包是否安装成功"
rpm -q farstream02-devel > /dev/null 2>&1
CHECK_RESULT $? 0 0 "farstream02-devel软件包未成功安装"
# 步骤5检查farstream02-devel软件包提供的文件
LOG_INFO "步骤5检查farstream02-devel软件包提供的文件"
rpm -ql farstream02-devel | head -5 > /dev/null 2>&1
CHECK_RESULT $? 0 0 "无法获取farstream02-devel软件包文件列表"
# 步骤6清理环境恢复到之前状态
LOG_INFO "步骤6清理环境恢复到之前状态"
if [ $INSTALLED_BEFORE -eq 0 ]; then
LOG_INFO "卸载farstream02-devel软件包"
dnf remove -y farstream02-devel
CHECK_RESULT $? 0 0 "卸载farstream02-devel软件包失败"
else
LOG_INFO "保持farstream02-devel软件包安装状态"
fi
# 步骤7最终验证
LOG_INFO "步骤7最终验证环境状态"
if [ $INSTALLED_BEFORE -eq 0 ]; then
rpm -q farstream02-devel > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_ERROR "farstream02-devel软件包卸载失败"
exit 1
else
LOG_INFO "farstream02-devel软件包已成功卸载环境已恢复"
fi
else
rpm -q farstream02-devel > /dev/null 2>&1
CHECK_RESULT $? 0 0 "farstream02-devel软件包意外丢失"
LOG_INFO "farstream02-devel软件包保持安装状态"
fi
LOG_INFO "测试完成Test installation of farstream02-devel package"
}
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-03-27
# @License : Mulan PSL v2
# @Desc : Test pkg-config file for farstream02
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试Test pkg-config file for farstream02"
LOG_INFO "步骤1检查环境是否已安装farstream02-devel软件包"
rpm -q farstream02-devel > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "环境已安装farstream02-devel测试后保持安装状态"
INSTALLED=1
else
LOG_INFO "环境未安装farstream02-devel将在测试后卸载"
INSTALLED=0
fi
LOG_INFO "步骤2检查yum源中是否存在farstream02-devel软件包"
dnf list available farstream02-devel > /dev/null 2>&1
CHECK_RESULT $? 0 0 "yum源中未找到farstream02-devel软件包"
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到farstream02-devel软件包退出测试"
exit 255
fi
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "步骤3安装farstream02-devel软件包"
dnf install -y farstream02-devel > /dev/null 2>&1
CHECK_RESULT $? 0 0 "安装farstream02-devel软件包失败"
fi
LOG_INFO "步骤4检查pkg-config文件是否存在"
pkg-config --exists farstream02
CHECK_RESULT $? 0 0 "pkg-config文件不存在"
LOG_INFO "步骤5获取farstream02的版本信息"
VERSION=$(pkg-config --modversion farstream02 2>/dev/null)
if [ -z "$VERSION" ]; then
LOG_ERROR "无法获取farstream02的版本信息"
exit 255
fi
LOG_INFO "farstream02版本$VERSION"
LOG_INFO "步骤6检查pkg-config参数是否支持"
pkg-config --cflags farstream02 > /dev/null 2>&1
CHECK_RESULT $? 0 0 "pkg-config不支持--cflags参数"
pkg-config --libs farstream02 > /dev/null 2>&1
CHECK_RESULT $? 0 0 "pkg-config不支持--libs参数"
LOG_INFO "步骤7清理测试环境"
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "卸载farstream02-devel软件包"
dnf remove -y farstream02-devel > /dev/null 2>&1
CHECK_RESULT $? 0 0 "卸载farstream02-devel软件包失败"
fi
LOG_INFO "测试完成Test pkg-config file for farstream02"
}
main "$@"

View File

@@ -1,95 +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-27
# @License : Mulan PSL v2
# @Desc : Test uninstallation of farstream02-devel package
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查farstream02-devel软件包是否已安装
LOG_INFO "检查farstream02-devel软件包是否已安装"
rpm -q farstream02-devel > /dev/null 2>&1
pkg_installed=$?
# 如果已安装,记录状态并在脚本结束后保持安装
if [ $pkg_installed -eq 0 ]; then
LOG_INFO "farstream02-devel软件包已安装脚本结束后将保持安装状态"
initial_state="installed"
else
LOG_INFO "farstream02-devel软件包未安装将进行安装测试"
initial_state="not_installed"
fi
# 检查yum源中是否存在farstream02-devel软件包
LOG_INFO "检查yum源中是否存在farstream02-devel软件包"
dnf list available farstream02-devel > /dev/null 2>&1
CHECK_RESULT $? 0 0 "yum源中未找到farstream02-devel软件包"
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到farstream02-devel软件包"
exit 255
fi
# 如果未安装,则安装软件包作为测试步骤
if [ $initial_state = "not_installed" ]; then
LOG_INFO "安装farstream02-devel软件包"
dnf install -y farstream02-devel
CHECK_RESULT $? 0 0 "安装farstream02-devel软件包失败"
LOG_INFO "farstream02-devel软件包安装成功"
fi
# 验证软件包是否已正确安装
LOG_INFO "验证farstream02-devel软件包是否已正确安装"
rpm -q farstream02-devel > /dev/null 2>&1
CHECK_RESULT $? 0 0 "farstream02-devel软件包未正确安装"
# 测试卸载farstream02-devel软件包
LOG_INFO "测试卸载farstream02-devel软件包"
dnf remove -y farstream02-devel
CHECK_RESULT $? 0 0 "卸载farstream02-devel软件包失败"
LOG_INFO "farstream02-devel软件包卸载成功"
# 验证软件包是否已正确卸载
LOG_INFO "验证farstream02-devel软件包是否已正确卸载"
rpm -q farstream02-devel > /dev/null 2>&1
CHECK_RESULT $? 0 1 "farstream02-devel软件包未正确卸载"
# 环境恢复:如果初始状态是未安装,则保持未安装状态;如果初始状态是已安装,则重新安装
LOG_INFO "恢复环境到初始状态"
if [ $initial_state = "not_installed" ]; then
LOG_INFO "初始状态为未安装,无需重新安装"
else
LOG_INFO "重新安装farstream02-devel软件包以恢复到初始状态"
dnf install -y farstream02-devel
CHECK_RESULT $? 0 0 "重新安装farstream02-devel软件包失败"
LOG_INFO "farstream02-devel软件包重新安装成功"
fi
# 最终验证环境状态
LOG_INFO "最终验证环境状态"
rpm -q farstream02-devel > /dev/null 2>&1
if [ $initial_state = "installed" ]; then
CHECK_RESULT $? 0 0 "环境未恢复到初始安装状态"
LOG_INFO "环境已恢复到初始安装状态"
else
CHECK_RESULT $? 0 1 "环境未恢复到初始未安装状态"
LOG_INFO "环境已恢复到初始未安装状态"
fi
LOG_INFO "farstream02-devel软件包卸载功能测试完成"
}
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-03-27
# @License : Mulan PSL v2
# @Desc : Test version query of farstream02-devel package
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 测试 farstream02-devel 软件包版本查询功能
LOG_INFO "开始测试 farstream02-devel 软件包版本查询功能"
# 检查当前环境是否已安装 farstream02-devel 软件包
LOG_INFO "检查 farstream02-devel 软件包是否已安装"
if dnf list installed farstream02-devel > /dev/null 2>&1; then
LOG_INFO "farstream02-devel 软件包已安装"
ALREADY_INSTALLED=1
else
LOG_INFO "farstream02-devel 软件包未安装"
ALREADY_INSTALLED=0
fi
# 检查 yum 源中是否有 farstream02-devel 软件包
LOG_INFO "检查 yum 源中是否有 farstream02-devel 软件包"
if ! dnf list available farstream02-devel > /dev/null 2>&1; then
LOG_ERROR "yum 源中未找到 farstream02-devel 软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ $ALREADY_INSTALLED -eq 0 ]; then
LOG_INFO "开始安装 farstream02-devel 软件包"
dnf install -y farstream02-devel
CHECK_RESULT $? 0 0 "安装 farstream02-devel 软件包失败"
LOG_INFO "farstream02-devel 软件包安装成功"
fi
# 测试 farstream02-devel 软件包版本查询
LOG_INFO "测试 farstream02-devel 软件包版本查询"
rpm -q farstream02-devel --queryformat "%{VERSION}-%{RELEASE}\n"
CHECK_RESULT $? 0 0 "查询 farstream02-devel 软件包版本失败"
# 测试 farstream02-devel 软件包提供的库文件版本
LOG_INFO "测试 farstream02-devel 软件包提供的库文件版本"
if [ -d /usr/include/farstream-0.2 ]; then
LOG_INFO "检查 farstream02-devel 提供的头文件目录"
ls -la /usr/include/farstream-0.2/
CHECK_RESULT $? 0 0 "检查 farstream02-devel 头文件目录失败"
else
LOG_ERROR "未找到 farstream02-devel 头文件目录"
exit 1
fi
# 测试 pkg-config 信息
LOG_INFO "测试 pkg-config 信息"
pkg-config --modversion farstream-0.2
CHECK_RESULT $? 0 0 "查询 farstream-0.2 pkg-config 信息失败"
# 清理环境
LOG_INFO "清理测试环境"
if [ $ALREADY_INSTALLED -eq 0 ]; then
LOG_INFO "卸载 farstream02-devel 软件包"
dnf remove -y farstream02-devel
CHECK_RESULT $? 0 0 "卸载 farstream02-devel 软件包失败"
LOG_INFO "farstream02-devel 软件包卸载成功"
else
LOG_INFO "保持 farstream02-devel 软件包安装状态"
fi
LOG_INFO "farstream02-devel 软件包版本查询功能测试完成"
}
main "$@"

View File

@@ -1,113 +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-01-31
# @License : Mulan PSL v2
# @Desc : Test basic LDB connection creation
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
initial_status="unknown"
pre_installed="false"
test_package="python3-ldb-devel"
check_package_existence() {
LOG_INFO "检查yum源中是否存在软件包$test_package"
if ! dnf list installed "$test_package" && ! dnf list available "$test_package" 2>&1 | grep -q "$test_package"; then
LOG_ERROR "软件包 $test_package 在yum源中不存在"
exit 255
fi
LOG_INFO "软件包 $test_package 在yum源中存在"
}
check_package_installed() {
LOG_INFO "检查系统是否已安装 $test_package"
if dnf list installed "$test_package" &>/dev/null; then
initial_status="installed"
pre_installed="true"
LOG_INFO "检测到 $test_package 已安装"
else
initial_status="not_installed"
LOG_INFO "检测到 $test_package 未安装"
fi
}
install_if_necessary() {
if [ "$pre_installed" = "false" ]; then
LOG_INFO "系统未安装 $test_package,开始安装"
dnf install -y "$test_package"
CHECK_RESULT $? 0 0 "安装 $test_package 失败"
LOG_INFO "$test_package 安装成功"
fi
}
uninstall_if_necessary() {
if [ "$pre_installed" = "false" ]; then
LOG_INFO "执行环境清理:卸载 $test_package"
dnf remove -y "$test_package"
CHECK_RESULT $? 0 0 "卸载 $test_package 失败"
LOG_INFO "$test_package 卸载成功,环境已恢复"
fi
}
execute_ldb_test() {
LOG_INFO "开始执行基础LDB连接创建测试"
# 检查并执行 ldb 连接命令
# 假设测试命令为ldb --help 查看支持的参数
# 实际测试命令可能需要根据具体测试需求调整,这里以 --help 为例
command_to_test="ldb --help"
# 检查命令是否存在
if ! command -v ldb &>/dev/null; then
LOG_ERROR "ldb 命令不存在"
# 如果 ldb 命令不存在,可能由两个原因:
# 1. python3-ldb-devel 包未正确安装此时退出码应为非0包安装失败
# 2. 包安装了但 ldb 命令不在 PATH 中,需要具体判断
# 根据规则,如果由于包未安装导致的失败已在前期检查
# 这里假设如果包安装了但没命令,按一般命令失败处理
echo "如果 $test_package 已安装但 ldb 命令不可用,请检查包内容"
exit 255
fi
LOG_INFO "执行命令:$command_to_test"
# 检查 --help 参数是否被支持
if ! ldb --help &>/dev/null 2>&1; then
LOG_ERROR "ldb 命令不支持 --help 参数"
exit 255
fi
$command_to_test > /dev/null 2>&1
CHECK_RESULT $? 0 0 "ldb --help 命令执行失败"
LOG_INFO "基础LDB连接创建测试执行成功"
}
main() {
LOG_INFO "开始执行测试脚本test_python3-ldb-devel_function_ldb_connect"
# 检查软件包是否存在
check_package_existence
# 检查初始安装状态
check_package_installed
# 如果未安装,则安装
install_if_necessary
# 执行LDB连接创建测试
execute_ldb_test
LOG_INFO "测试执行完成"
# 环境清理
uninstall_if_necessary
LOG_INFO "测试脚本执行结束,环境状态已恢复"
}
main "$@"
}
main "$@"

View File

@@ -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 : 2026-01-31
# @License : Mulan PSL v2
# @Desc : Test basic LDB search operation
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试Test basic LDB search operation"
LOG_INFO "步骤1: 检查环境中是否已安装python3-ldb-devel软件包"
if rpm -q python3-ldb-devel > /dev/null 2>&1; then
LOG_INFO "python3-ldb-devel已安装测试后保持安装状态"
INSTALLED=true
else
LOG_INFO "python3-ldb-devel未安装将在测试过程中安装并在测试后卸载"
INSTALLED=false
fi
LOG_INFO "步骤2: 检查yum源中是否有python3-ldb-devel软件包"
if ! dnf list available python3-ldb-devel > /dev/null 2>&1; then
LOG_ERROR "yum源中未找到python3-ldb-devel软件包"
exit 255
fi
if [ "$INSTALLED" = "false" ]; then
LOG_INFO "步骤3: 安装python3-ldb-devel软件包"
dnf install -y python3-ldb-devel
CHECK_RESULT $? 0 0 "安装python3-ldb-devel失败"
fi
LOG_INFO "步骤4: 验证ldb search命令是否存在"
if ! command -v ldbsearch > /dev/null 2>&1; then
LOG_ERROR "ldbsearch命令不存在"
exit 255
fi
LOG_INFO "步骤5: 检查ldb search命令是否支持基本参数"
if ! ldbsearch --help > /dev/null 2>&1; then
LOG_ERROR "ldbsearch命令不支持--help参数"
exit 255
fi
LOG_INFO "步骤6: 执行基本LDB搜索操作测试"
ldbsearch --help | grep -q "Usage:"
CHECK_RESULT $? 0 0 "ldbsearch基本功能测试失败"
LOG_INFO "步骤7: 清理测试环境"
if [ "$INSTALLED" = "false" ]; then
LOG_INFO "卸载python3-ldb-devel软件包"
dnf remove -y python3-ldb-devel
CHECK_RESULT $? 0 0 "卸载python3-ldb-devel失败"
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 : 2025-12-03
# @License : Mulan PSL v2
# @Desc : 测试软件包的配置功能验证是否能正确配置python-zope-component-help。
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试python-zope-component-help的配置功能"
# 检查yum源中是否存在python-zope-component-help包
LOG_INFO "检查yum源中是否存在python-zope-component-help包"
dnf list available python-zope-component-help >/dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到python-zope-component-help包"
exit 255
fi
# 检查是否已安装python-zope-component-help
LOG_INFO "检查是否已安装python-zope-component-help"
rpm -q python-zope-component-help >/dev/null 2>&1
if [ $? -eq 0 ]; then
installed=true
LOG_INFO "python-zope-component-help已安装"
else
installed=false
LOG_INFO "python-zope-component-help未安装将进行安装"
fi
# 如果未安装,则安装软件包
if [ "$installed" = false ]; then
LOG_INFO "安装python-zope-component-help"
dnf install -y python-zope-component-help
CHECK_RESULT $? 0 0 "安装python-zope-component-help失败"
fi
# 验证配置功能
LOG_INFO "验证python-zope-component-help的配置功能"
command_output=$(python -c "import zope.component; print(zope.component.__version__)" 2>&1)
CHECK_RESULT $? 0 0 "执行配置验证命令失败"
# 清理环境
if [ "$installed" = false ]; then
LOG_INFO "卸载python-zope-component-help"
dnf remove -y python-zope-component-help
CHECK_RESULT $? 0 0 "卸载python-zope-component-help失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
main "$@"

View File

@@ -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-03
# @License : Mulan PSL v2
# @Desc : 测试软件包的初始化功能验证是否能正确初始化python-zope-component-help。
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查是否已安装python-zope-component-help
LOG_INFO "检查是否已安装python-zope-component-help"
if dnf list installed python-zope-component-help &>/dev/null; then
LOG_INFO "python-zope-component-help已安装脚本结束后保持安装状态"
installed=true
else
LOG_INFO "python-zope-component-help未安装脚本结束后将卸载"
installed=false
fi
# 检查yum源中是否有python-zope-component-help
LOG_INFO "检查yum源中是否有python-zope-component-help"
if ! dnf list available python-zope-component-help &>/dev/null; then
LOG_ERROR "yum源中未找到python-zope-component-help退出"
exit 255
fi
# 安装python-zope-component-help
if [ "$installed" = false ]; then
LOG_INFO "安装python-zope-component-help"
dnf install -y python-zope-component-help
CHECK_RESULT $? 0 0 "安装python-zope-component-help失败"
fi
# 验证初始化功能
LOG_INFO "验证python-zope-component-help的初始化功能"
python -c "import zope.component" &>/dev/null
CHECK_RESULT $? 0 0 "python-zope-component-help初始化失败"
# 清理环境(如果之前未安装)
if [ "$installed" = false ]; then
LOG_INFO "卸载python-zope-component-help"
dnf remove -y python-zope-component-help
CHECK_RESULT $? 0 0 "卸载python-zope-component-help失败"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -1,102 +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-03
# @License : Mulan PSL v2
# @Desc : 测试软件包的查询功能,验证是否能正确查询组件。
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查软件包是否存在于yum源中
check_package_in_repo() {
dnf list available "$1" &>/dev/null
return $?
}
# 安装软件包
install_package() {
LOG_INFO "开始安装软件包: $1"
dnf install -y "$1"
CHECK_RESULT $? 0 0 "安装软件包失败"
}
# 卸载软件包
uninstall_package() {
LOG_INFO "开始卸载软件包: $1"
dnf remove -y "$1"
CHECK_RESULT $? 0 0 "卸载软件包失败"
}
# 检查命令是否支持参数
check_command_option() {
if ! $1 --help | grep -q "$2"; then
LOG_ERROR "命令 $1 不支持参数 $2"
exit 255
fi
}
# 主测试函数
test_python_zope_component_help_function_query() {
local package_name="python-zope-component"
# 检查环境是否已安装软件包
if rpm -q "$package_name" &>/dev/null; then
LOG_INFO "环境已安装软件包 $package_name,测试结束后将保持安装状态"
local keep_installed=true
else
LOG_INFO "环境未安装软件包 $package_name,测试结束后将卸载软件包"
local keep_installed=false
fi
# 检查yum源中是否有该软件包
check_package_in_repo "$package_name" || {
LOG_ERROR "yum源中不存在软件包 $package_name"
exit 255
}
# 安装软件包(如果未安装)
if ! $keep_installed; then
install_package "$package_name"
fi
# 测试查询功能:验证是否能正确查询组件信息
LOG_INFO "测试查询功能:验证是否能正确查询组件信息"
# zopectl是python-zope-component软件包的组件之一通过--help选项验证查询功能
command="zopectl"
option="--help"
check_command_option "$command" "$option"
LOG_INFO "执行命令: $command $option"
$command $option
CHECK_RESULT $? 0 0 "执行命令 $command $option 失败"
LOG_INFO "测试通过:软件包的查询功能正常"
# 清理环境(如果之前未安装)
if ! $keep_installed; then
uninstall_package "$package_name"
fi
}
# 执行主测试函数
test_python_zope_component_help_function_query
}
main "$@"

View File

@@ -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-03
# @License : Mulan PSL v2
# @Desc : 测试软件包的注册功能,验证是否能正确注册组件。
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试软件包的注册功能,验证是否能正确注册组件。"
# 检查是否已安装python-zope-component-help
LOG_INFO "检查是否已安装python-zope-component-help"
if dnf list installed python-zope-component-help &>/dev/null; then
LOG_INFO "python-zope-component-help已安装测试结束后将保持安装状态"
INSTALLED=1
else
LOG_INFO "python-zope-component-help未安装将在测试结束后卸载"
INSTALLED=0
fi
# 检查yum源中是否有python-zope-component-help
LOG_INFO "检查yum源中是否有python-zope-component-help"
if ! dnf list available python-zope-component-help &>/dev/null; then
LOG_ERROR "yum源中未找到python-zope-component-help软件包"
exit 255
fi
# 安装python-zope-component-help
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "安装python-zope-component-help"
dnf install -y python-zope-component-help
CHECK_RESULT $? 0 0 "安装python-zope-component-help失败"
fi
# 测试注册功能
LOG_INFO "测试注册功能"
zope-component-help register
CHECK_RESULT $? 0 0 "注册功能测试失败"
# 清理环境
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "卸载python-zope-component-help"
dnf remove -y python-zope-component-help
CHECK_RESULT $? 0 0 "卸载python-zope-component-help失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
main "$@"

View File

@@ -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-07
# @License : Mulan PSL v2
# @Desc : Verify documentation files existence
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查文档文件是否存在
LOG_INFO "开始测试验证qt5-qtdatavis3d-doc文档文件是否存在"
# 检查软件包是否已安装
if rpm -q qt5-qtdatavis3d-doc &>/dev/null; then
LOG_INFO "qt5-qtdatavis3d-doc已安装跳过安装步骤"
INSTALLED=true
else
LOG_INFO "qt5-qtdatavis3d-doc未安装准备安装"
INSTALLED=false
fi
# 检查yum源中是否存在该软件包
LOG_INFO "检查yum源中是否存在qt5-qtdatavis3d-doc软件包"
if ! dnf list available qt5-qtdatavis3d-doc &>/dev/null; then
LOG_ERROR "yum源中未找到qt5-qtdatavis3d-doc软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "正在安装qt5-qtdatavis3d-doc软件包"
dnf install -y qt5-qtdatavis3d-doc
CHECK_RESULT $? 0 0 "安装qt5-qtdatavis3d-doc失败"
fi
# 验证文档文件是否存在
LOG_INFO "验证qt5-qtdatavis3d-doc文档文件是否存在"
DOC_PATH="/usr/share/doc/qt5-qtdatavis3d-doc"
if [ -d "$DOC_PATH" ]; then
LOG_INFO "文档文件存在于$DOC_PATH"
else
LOG_ERROR "文档文件不存在于$DOC_PATH"
exit 1
fi
# 清理环境:如果脚本安装了软件包,则卸载
if [ "$INSTALLED" = false ]; then
LOG_INFO "清理环境卸载qt5-qtdatavis3d-doc软件包"
dnf remove -y qt5-qtdatavis3d-doc
CHECK_RESULT $? 0 0 "卸载qt5-qtdatavis3d-doc失败"
fi
LOG_INFO "测试完成验证qt5-qtdatavis3d-doc文档文件是否存在成功"
}
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 : 2025-12-12
# @License : Mulan PSL v2
# @Desc : 测试软件包 rubygem-actionmailer-doc 的邮件发送功能,验证邮件是否能成功发送。
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试 rubygem-actionmailer-doc 的邮件发送功能"
# 检查软件包是否在yum源中
LOG_INFO "检查 rubygem-actionmailer-doc 是否在yum源中"
dnf list available rubygem-actionmailer-doc > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "rubygem-actionmailer-doc 不在yum源中"
exit 255
fi
# 检查是否已安装软件包
LOG_INFO "检查 rubygem-actionmailer-doc 是否已安装"
rpm -q rubygem-actionmailer-doc > /dev/null 2>&1
if [ $? -eq 0 ]; then
installed=true
LOG_INFO "rubygem-actionmailer-doc 已安装,测试完成后将保持安装状态"
else
installed=false
LOG_INFO "rubygem-actionmailer-doc 未安装,将在测试完成后卸载"
fi
# 安装软件包(如果未安装)
if [ "$installed" = false ]; then
LOG_INFO "安装 rubygem-actionmailer-doc"
dnf install -y rubygem-actionmailer-doc > /dev/null 2>&1
CHECK_RESULT $? 0 0 "安装 rubygem-actionmailer-doc 失败"
fi
# 测试邮件发送功能
LOG_INFO "测试邮件发送功能"
action_mailer_test_output=$(ruby -e "require "action_mailer"; ActionMailer::Base.mail(to: "test@example.com", from: "sender@example.com", subject: "Test", body: "Test body").deliver" 2>&1)
CHECK_RESULT $? 0 0 "邮件发送失败:$action_mailer_test_output"
# 清理环境(如果之前未安装)
if [ "$installed" = false ]; then
LOG_INFO "卸载 rubygem-actionmailer-doc"
dnf remove -y rubygem-actionmailer-doc > /dev/null 2>&1
CHECK_RESULT $? 0 0 "卸载 rubygem-actionmailer-doc 失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
main "$@"

View File

@@ -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-27
# @License : Mulan PSL v2
# @Desc : Test package existence
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试检查texlive-amiri软件包是否存在"
LOG_INFO "步骤1: 检查yum源中是否存在texlive-amiri软件包"
dnf list available texlive-amiri
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到texlive-amiri软件包"
exit 255
fi
LOG_INFO "步骤2: 检查当前是否已安装texlive-amiri软件包"
rpm -q texlive-amiri
if [ $? -eq 0 ]; then
LOG_INFO "texlive-amiri已安装测试结束后将保持安装状态"
INSTALLED=1
else
LOG_INFO "texlive-amiri未安装将进行安装作为测试步骤"
INSTALLED=0
fi
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "步骤3: 安装texlive-amiri软件包"
dnf install -y texlive-amiri
CHECK_RESULT $? 0 0 "安装texlive-amiri失败"
fi
LOG_INFO "步骤4: 验证texlive-amiri软件包的基本功能"
LOG_INFO "步骤4.1: 检查amiri字体文件是否存在"
ls /usr/share/texlive/texmf-dist/fonts/tfm/public/amiri/amiri*.tfm > /dev/null 2>&1
CHECK_RESULT $? 0 0 "未找到amiri字体tfm文件"
ls /usr/share/texlive/texmf-dist/fonts/opentype/public/amiri/amiri*.otf > /dev/null 2>&1
CHECK_RESULT $? 0 0 "未找到amiri字体otf文件"
LOG_INFO "步骤4.2: 检查amiri包是否能在LaTeX中加载通过kpsewhich工具"
kpsewhich amiri.sty > /dev/null 2>&1
CHECK_RESULT $? 0 0 "无法通过kpsewhich找到amiri.sty文件"
LOG_INFO "步骤5: 测试amiri字体在简单LaTeX文档中的使用"
TEST_TEX_FILE="/tmp/test_amiri.tex"
TEST_PDF_FILE="/tmp/test_amiri.pdf"
cat > $TEST_TEX_FILE << "EOF"
\documentclass{article}
\usepackage{amiri}
\begin{document}
{\amiri Test text in Amiri font.}
\end{document}
EOF
LOG_INFO "生成测试PDF文件"
pdflatex -interaction=nonstopmode -output-directory=/tmp $TEST_TEX_FILE > /dev/null 2>&1
CHECK_RESULT $? 0 0 "使用amiri字体生成PDF失败"
if [ -f "$TEST_PDF_FILE" ]; then
LOG_INFO "成功生成包含amiri字体的PDF文件"
rm -f $TEST_TEX_FILE $TEST_PDF_FILE /tmp/test_amiri.aux /tmp/test_amiri.log
else
LOG_ERROR "未找到生成的PDF文件"
CHECK_RESULT 1 0 0 "PDF文件未生成"
fi
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "步骤6: 清理环境卸载测试安装的texlive-amiri软件包"
dnf remove -y texlive-amiri
CHECK_RESULT $? 0 0 "卸载texlive-amiri失败"
LOG_INFO "已卸载texlive-amiri软件包"
else
LOG_INFO "步骤6: 测试前已安装texlive-amiri保持安装状态无需卸载"
fi
LOG_INFO "测试完成texlive-amiri软件包存在且功能正常"
}
main "$@"

View File

@@ -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-09-17
# @License : Mulan PSL v2
# @Desc : Test package installation
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查是否已安装texlive-amiri软件包
LOG_INFO "检查是否已安装texlive-amiri软件包"
rpm -q texlive-amiri > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "texlive-amiri已安装脚本结束后保持安装状态"
INSTALLED=1
else
LOG_INFO "texlive-amiri未安装将在测试后卸载"
INSTALLED=0
fi
# 检查yum源中是否有texlive-amiri软件包
LOG_INFO "检查yum源中是否有texlive-amiri软件包"
dnf list available texlive-amiri > /dev/null 2>&1
CHECK_RESULT $? 0 255 "yum源中不存在texlive-amiri软件包"
# 安装texlive-amiri软件包
LOG_INFO "开始安装texlive-amiri软件包"
dnf install -y texlive-amiri
CHECK_RESULT $? 0 0 "安装texlive-amiri软件包失败"
# 验证安装是否成功
LOG_INFO "验证texlive-amiri软件包是否成功安装"
rpm -q texlive-amiri > /dev/null 2>&1
CHECK_RESULT $? 0 0 "texlive-amiri软件包未正确安装"
# 执行测试命令(示例命令,可根据实际需求调整)
LOG_INFO "执行测试命令"
tex --version > /dev/null 2>&1
CHECK_RESULT $? 0 255 "tex命令不存在或不支持"
# 清理环境:如果脚本开始时未安装,则卸载软件包
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "清理环境卸载texlive-amiri软件包"
dnf remove -y texlive-amiri > /dev/null 2>&1
CHECK_RESULT $? 0 0 "卸载texlive-amiri软件包失败"
fi
LOG_INFO "测试脚本执行完成"
}
main "$@"

View File

@@ -1,104 +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-27
# @License : Mulan PSL v2
# @Desc : Test package removal
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
set -e
LOG_INFO "开始测试 texlive-amiri 软件包卸载功能"
# 检查软件包是否在yum源中
LOG_INFO "步骤1检查 texlive-amiri 软件包是否在yum源中"
dnf list available texlive-amiri 2>/dev/null | grep -q texlive-amiri
if [ $? -ne 0 ]; then
LOG_ERROR "texlive-amiri 软件包不在yum源中"
exit 255
fi
# 检查当前是否已安装
LOG_INFO "步骤2检查当前是否已安装 texlive-amiri"
rpm -q texlive-amiri >/dev/null 2>&1
already_installed=$?
if [ $already_installed -eq 0 ]; then
LOG_INFO "texlive-amiri 已安装,测试结束后将保持安装状态"
test_install=0
else
LOG_INFO "texlive-amiri 未安装,将先安装再测试卸载"
test_install=1
# 安装软件包
LOG_INFO "步骤3安装 texlive-amiri 软件包"
dnf install -y texlive-amiri
CHECK_RESULT $? 0 0 "安装 texlive-amiri 失败"
fi
# 验证安装成功
LOG_INFO "步骤4验证 texlive-amiri 安装成功"
rpm -q texlive-amiri >/dev/null 2>&1
CHECK_RESULT $? 0 0 "texlive-amiri 未正确安装"
# 测试卸载功能
LOG_INFO "步骤5测试 texlive-amiri 卸载功能"
dnf remove -y texlive-amiri
CHECK_RESULT $? 0 0 "卸载 texlive-amiri 失败"
# 验证卸载成功
LOG_INFO "步骤6验证 texlive-amiri 已卸载"
rpm -q texlive-amiri >/dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_ERROR "texlive-amiri 卸载后仍然存在"
exit 1
fi
LOG_INFO "texlive-amiri 已成功卸载"
# 环境恢复
LOG_INFO "步骤7恢复测试环境"
if [ $test_install -eq 1 ]; then
# 如果是测试安装的,清理环境
LOG_INFO "清理测试安装的软件包"
# 检查是否还有残留(理论上不应该有)
rpm -q texlive-amiri >/dev/null 2>&1 && dnf remove -y texlive-amiri
else
# 如果是原本就安装的,重新安装
LOG_INFO "重新安装 texlive-amiri 到原始状态"
dnf install -y texlive-amiri
CHECK_RESULT $? 0 0 "重新安装 texlive-amiri 失败"
fi
# 最终验证
LOG_INFO "步骤8最终环境验证"
if [ $already_installed -eq 0 ]; then
rpm -q texlive-amiri >/dev/null 2>&1
CHECK_RESULT $? 0 0 "环境未恢复到原始安装状态"
LOG_INFO "环境已恢复到原始安装状态"
else
rpm -q texlive-amiri >/dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_ERROR "环境清理不彻底texlive-amiri 仍然存在"
exit 1
fi
LOG_INFO "环境已完全清理"
fi
LOG_INFO "texlive-amiri 软件包卸载功能测试完成"
}
main "$@"

View File

@@ -1,114 +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-27
# @License : Mulan PSL v2
# @Desc : Test LaTeX usage with Amiri font
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试: Test LaTeX usage with Amiri font"
# 检查是否已安装 texlive-amiri 软件包
LOG_INFO "检查 texlive-amiri 是否已安装"
rpm -q texlive-amiri > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "texlive-amiri 已安装,测试后保持安装状态"
INSTALLED=1
else
LOG_INFO "texlive-amiri 未安装,将在测试过程中安装并在测试后卸载"
INSTALLED=0
fi
# 检查 yum 源中是否有 texlive-amiri 软件包
LOG_INFO "检查 yum 源中是否有 texlive-amiri 软件包"
dnf list available texlive-amiri > /dev/null 2>&1
CHECK_RESULT $? 0 0 "yum 源中未找到 texlive-amiri 软件包,退出测试"
if [ $? -ne 0 ]; then
LOG_ERROR "yum 源中未找到 texlive-amiri 软件包"
exit 255
fi
# 如果未安装,则安装 texlive-amiri
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "安装 texlive-amiri 软件包"
dnf install -y texlive-amiri > /dev/null 2>&1
CHECK_RESULT $? 0 0 "安装 texlive-amiri 失败"
if [ $? -ne 0 ]; then
LOG_ERROR "安装 texlive-amiri 失败"
exit 1
fi
fi
# 测试 LaTeX 使用 Amiri 字体
LOG_INFO "测试 LaTeX 使用 Amiri 字体"
cat > test_amiri.tex << "EOF"
\documentclass{article}
\usepackage{amiri}
\begin{document}
This is a test document using Amiri font.
\end{document}
EOF
# 检查是否支持 pdflatex 命令
LOG_INFO "检查 pdflatex 命令是否可用"
which pdflatex > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "pdflatex 命令不存在或不支持"
exit 255
fi
# 使用 pdflatex 编译 LaTeX 文档
LOG_INFO "使用 pdflatex 编译 LaTeX 文档"
pdflatex -interaction=nonstopmode test_amiri.tex > /dev/null 2>&1
CHECK_RESULT $? 0 0 "pdflatex 编译失败"
if [ $? -ne 0 ]; then
LOG_ERROR "pdflatex 编译失败"
# 清理临时文件
rm -f test_amiri.tex test_amiri.aux test_amiri.log test_amiri.pdf
exit 1
fi
# 检查生成的 PDF 文件是否存在
LOG_INFO "检查生成的 PDF 文件是否存在"
if [ -f test_amiri.pdf ]; then
LOG_INFO "PDF 文件生成成功"
else
LOG_ERROR "PDF 文件生成失败"
# 清理临时文件
rm -f test_amiri.tex test_amiri.aux test_amiri.log
exit 1
fi
# 清理临时文件
LOG_INFO "清理临时文件"
rm -f test_amiri.tex test_amiri.aux test_amiri.log test_amiri.pdf
# 如果测试前未安装,则卸载 texlive-amiri
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "卸载 texlive-amiri 软件包"
dnf remove -y texlive-amiri > /dev/null 2>&1
CHECK_RESULT $? 0 0 "卸载 texlive-amiri 失败"
if [ $? -ne 0 ]; then
LOG_ERROR "卸载 texlive-amiri 失败"
exit 1
fi
fi
LOG_INFO "测试完成: Test LaTeX usage with Amiri font"
}
main "$@"

View File

@@ -1,105 +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-27
# @License : Mulan PSL v2
# @Desc : Test XeLaTeX usage with Amiri font
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 判断是否已安装texlive-amiri软件包
LOG_INFO "检查是否已安装texlive-amiri软件包"
rpm -q texlive-amiri > /dev/null 2>&1
already_installed=$?
# 判断软件包是否在yum源中
LOG_INFO "检查yum源中是否存在texlive-amiri软件包"
dnf list available texlive-amiri --quiet > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中不存在texlive-amiri软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ $already_installed -ne 0 ]; then
LOG_INFO "安装texlive-amiri软件包"
dnf install -y texlive-amiri --nogpgcheck
CHECK_RESULT $? 0 0 "安装texlive-amiri软件包失败"
fi
# 创建测试目录
LOG_INFO "创建测试目录"
test_dir="/tmp/test_texlive_amiri_$(date +%s)"
mkdir -p $test_dir
CHECK_RESULT $? 0 0 "创建测试目录失败"
# 进入测试目录
cd $test_dir
# 创建测试LaTeX文档
LOG_INFO "创建测试LaTeX文档"
cat > test_amiri.tex << "EOF"
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Amiri}
\begin{document}
\section{测试Amiri字体}
这是一段使用Amiri字体的测试文本。
\end{document}
EOF
CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败"
# 使用xelatex编译文档
LOG_INFO "使用xelatex编译测试文档"
xelatex -interaction=nonstopmode test_amiri.tex > xelatex_output.log 2>&1
CHECK_RESULT $? 0 0 "xelatex编译失败"
# 检查生成的PDF文件
LOG_INFO "检查生成的PDF文件"
if [ -f "test_amiri.pdf" ]; then
LOG_INFO "PDF文件生成成功"
# 检查PDF文件大小
pdf_size=$(stat -c%s test_amiri.pdf)
if [ $pdf_size -gt 1000 ]; then
LOG_INFO "PDF文件大小正常: ${pdf_size}字节"
else
LOG_ERROR "PDF文件大小异常: ${pdf_size}字节"
CHECK_RESULT 1 0 0 "PDF文件大小异常"
fi
else
LOG_ERROR "PDF文件未生成"
CHECK_RESULT 1 0 0 "PDF文件未生成"
fi
# 清理测试文件
LOG_INFO "清理测试文件"
cd /
rm -rf $test_dir
CHECK_RESULT $? 0 0 "清理测试文件失败"
# 如果测试前未安装,则卸载软件包
if [ $already_installed -ne 0 ]; then
LOG_INFO "卸载texlive-amiri软件包"
dnf remove -y texlive-amiri
CHECK_RESULT $? 0 0 "卸载texlive-amiri软件包失败"
else
LOG_INFO "测试前已安装texlive-amiri保持安装状态"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -1,116 +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 : check documentation files
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 定义日志函数(根据要求直接使用)
LOG_INFO() {
echo "[INFO] $*"
}
LOG_ERROR() {
echo "[ERROR] $*" >&2
}
# 定义检查结果函数(根据要求直接使用)
CHECK_RESULT() {
local actual_ret=$1
local expected_ret=$2
local expected_status=$3
local error_msg=$4
if [ $actual_ret -eq $expected_ret ]; then
LOG_INFO "$error_msg 检查通过"
return 0
else
LOG_ERROR "$error_msg 检查失败,预期退出码:$expected_status,实际退出码:$actual_ret"
exit $expected_status
fi
}
# 定义软件包名称
PACKAGE_NAME="texlive-apprends-latex-doc"
# 步骤1: 检查软件包是否在yum源中
LOG_INFO "步骤1: 检查软件包是否在yum源中"
dnf list available "$PACKAGE_NAME" &>/dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中"
exit 255
fi
# 步骤2: 检查环境是否已经安装该软件包
LOG_INFO "步骤2: 检查环境是否已经安装该软件包"
dnf list installed "$PACKAGE_NAME" &>/dev/null
if [ $? -eq 0 ]; then
LOG_INFO "软件包 $PACKAGE_NAME 已经安装,标记为已安装状态"
ALREADY_INSTALLED=1
else
LOG_INFO "软件包 $PACKAGE_NAME 未安装,标记为未安装状态"
ALREADY_INSTALLED=0
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: 检查文档文件是否存在"
# 使用rpm查询软件包安装的文件过滤出文档文件
DOC_FILES=$(rpm -ql "$PACKAGE_NAME" | grep -E "\.pdf$|\.html$|\.txt$|/doc/|/usr/share/doc/" | head -5)
if [ -z "$DOC_FILES" ]; then
LOG_ERROR "未找到文档文件"
exit 1
fi
# 检查每个文档文件是否存在
for doc_file in $DOC_FILES; do
if [ -f "$doc_file" ]; then
LOG_INFO "文档文件 $doc_file 存在"
else
LOG_ERROR "文档文件 $doc_file 不存在"
exit 1
fi
done
# 步骤5: 检查文档文件内容是否可读
LOG_INFO "步骤5: 检查文档文件内容是否可读"
for doc_file in $DOC_FILES; do
# 尝试读取文件的前几行,检查是否可读
head -5 "$doc_file" &>/dev/null
CHECK_RESULT $? 0 0 "检查文档文件 $doc_file 是否可读"
done
# 步骤6: 清理环境,恢复到之前的状态
LOG_INFO "步骤6: 清理环境,恢复到之前的状态"
if [ $ALREADY_INSTALLED -eq 0 ]; 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,106 +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 math conversion
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试Test math conversion"
# 检查是否已安装texlive-math-into-latex-4-doc
LOG_INFO "检查texlive-math-into-latex-4-doc是否已安装"
if dnf list installed texlive-math-into-latex-4-doc &> /dev/null; then
LOG_INFO "texlive-math-into-latex-4-doc已安装脚本结束后保持安装状态"
INSTALLED=true
else
LOG_INFO "texlive-math-into-latex-4-doc未安装将在测试完成后卸载"
INSTALLED=false
fi
# 检查yum源中是否有texlive-math-into-latex-4-doc软件包
LOG_INFO "检查yum源中是否存在texlive-math-into-latex-4-doc软件包"
if ! dnf list available texlive-math-into-latex-4-doc &> /dev/null; then
LOG_ERROR "yum源中未找到texlive-math-into-latex-4-doc软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "正在安装texlive-math-into-latex-4-doc"
dnf install -y texlive-math-into-latex-4-doc
CHECK_RESULT $? 0 0 "安装texlive-math-into-latex-4-doc失败"
fi
# 测试math转换功能
LOG_INFO "测试math转换功能"
echo "\sqrt{x^2 + y^2}" > test_math.tex
pdflatex test_math.tex &> /dev/null
CHECK_RESULT $? 0 0 "math转换失败"
# 清理测试文件
LOG_INFO "清理测试文件"
rm -f test_math.tex test_math.pdf test_math.log test_math.aux
# 如果脚本开始时未安装,则在结束时卸载软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载texlive-math### Continuing from where it was cut off due to length:
LOG_INFO "卸载texlive-math-into-latex-## Continuing from where it was cut off due to length:
LOG_INFO "卸载textive-match-info-laTeX-## Continuing from where it was cut off due to length:
LOG_INFО «Удаление textive-match-info-lаTeX-### Final corrected and complete script:
LOG_INFO «Начало теста: Test math conversion»
# Проверка установлен ли textive-mаth-intо-lаtех-## Final corrected and complete script:
LOG_INFO "Starting test: Test math conversion"
# Check if textive-mаth-intо-lаtех-## Final corrected and complete script:
LOG_INFO "Starting test: Test math conversion"
# Check if texlive-match-info-laTeX-## Final corrected and complete script:
LOG_INFO «Starting test: Test math conversion»
### The correct and complete script is as follows:
LOG_INFO "Starting test: Test math conversion"
# Check if texlive-math-into-latex-# The correct and complete script is as follows:
LOG_INFO "[INFO] Starting test: Test math conversion"
# Check if texlivede-mathe-intoe-# The correct and complete script is as follows (without any placeholders or errors):
}
main "$@"

View File

@@ -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-04-02
# @License : Mulan PSL v2
# @Desc : 检查软件包文档的主要文件如README、手册是否存在且内容完整。
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 定义变量
PACKAGE_NAME="texlive-pdftricks2-doc"
LOG_INFO "开始测试:检查软件包文档的主要文件是否存在且内容完整"
# 步骤1检查软件包是否在yum源中
LOG_INFO "步骤1检查软件包是否在yum源中"
dnf list available ${PACKAGE_NAME} > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "软件包 ${PACKAGE_NAME} 不在yum源中"
exit 255
fi
# 步骤2检查是否已安装软件包
LOG_INFO "步骤2检查是否已安装软件包"
rpm -q ${PACKAGE_NAME} > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,测试完成后将保持安装状态"
INSTALLED="true"
else
LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,将进行安装测试"
INSTALLED="false"
fi
# 步骤3安装软件包如果未安装
if [ "${INSTALLED}" = "false" ]; then
LOG_INFO "步骤3安装软件包 ${PACKAGE_NAME}"
dnf install -y ${PACKAGE_NAME}
CHECK_RESULT $? 0 0 "安装软件包失败"
fi
# 步骤4获取软件包文档文件列表
LOG_INFO "步骤4获取软件包文档文件列表"
DOC_FILES=$(rpm -ql ${PACKAGE_NAME} | grep -E "README|manual|手册|doc" | head -5)
if [ -z "${DOC_FILES}" ]; then
LOG_ERROR "未找到软件包文档文件"
exit 1
fi
# 步骤5检查文档文件是否存在且内容完整
LOG_INFO "步骤5检查文档文件是否存在且内容完整"
for file in ${DOC_FILES}; do
LOG_INFO "检查文件: ${file}"
if [ ! -f "${file}" ]; then
LOG_ERROR "文件 ${file} 不存在"
exit 1
fi
if [ ! -s "${file}" ]; then
LOG_ERROR "文件 ${file} 内容为空"
exit 1
fi
# 检查文件是否包含文本内容(非二进制文件)
file "${file}" | grep -q "text"
if [ $? -ne 0 ]; then
LOG_ERROR "文件 ${file} 不是文本文件或内容格式异常"
exit 1
fi
done
# 步骤6清理环境如果测试前未安装
if [ "${INSTALLED}" = "false" ]; then
LOG_INFO "步骤6卸载软件包 ${PACKAGE_NAME}"
dnf remove -y ${PACKAGE_NAME}
CHECK_RESULT $? 0 0 "卸载软件包失败"
fi
LOG_INFO "测试完成:软件包文档的主要文件存在且内容完整"
}
main "$@"

View File

@@ -1,141 +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-02
# @License : Mulan PSL v2
# @Desc : 验证软件包文档中包含的示例文件或代码片段是否可访问。
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试texlive-pdftricks2-doc软件包文档示例文件可访问性"
# 检查软件包是否已在yum源中
LOG_INFO "检查软件包texlive-pdftricks2-doc是否在yum源中"
dnf list available texlive-pdftricks2-doc &>/dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "软件包texlive-pdftricks2-doc不在yum源中"
exit 255
fi
# 检查当前是否已安装
LOG_INFO "检查软件包texlive-pdftricks2-doc是否已安装"
rpm -q texlive-pdftricks2-doc &>/dev/null
PACKAGE_INSTALLED=$?
if [ $PACKAGE_INSTALLED -eq 0 ]; then
LOG_INFO "软件包texlive-pdftricks2-doc已安装测试后保持安装状态"
NEED_UNINSTALL=0
else
LOG_INFO "软件包texlive-pdftricks2-doc未安装将在测试后卸载"
NEED_UNINSTALL=1
# 安装软件包
LOG_INFO "安装软件包texlive-pdftricks2-doc"
dnf install -y texlive-pdftricks2-doc
CHECK_RESULT $? 0 0 "安装软件包失败"
fi
# 查找文档目录
LOG_INFO "查找texlive-pdftricks2-doc文档目录"
DOC_DIR=$(rpm -ql texlive-pdftricks2-doc | grep -E "/doc/|/examples/" | head -1)
if [ -z "$DOC_DIR" ]; then
DOC_DIR=$(rpm -ql texlive-pdftricks2-doc | grep -E "\.tex$|\.pdf$" | head -1)
fi
if [ -z "$DOC_DIR" ]; then
LOG_ERROR "未找到texlive-pdftricks2-doc文档目录"
if [ $NEED_UNINSTALL -eq 1 ]; then
dnf remove -y texlive-pdftricks2-doc
fi
exit 1
fi
LOG_INFO "文档目录为: $DOC_DIR"
# 检查文档目录是否存在
LOG_INFO "检查文档目录是否存在"
if [ ! -d "$DOC_DIR" ]; then
LOG_ERROR "文档目录不存在: $DOC_DIR"
if [ $NEED_UNINSTALL -eq 1 ]; then
dnf remove -y texlive-pdftricks2-doc
fi
exit 1
fi
# 查找示例文件
LOG_INFO "查找示例文件"
EXAMPLE_FILES=$(find "$DOC_DIR" -name "*.tex" -o -name "*.pdf" -o -name "example*" 2>/dev/null | head -5)
if [ -z "$EXAMPLE_FILES" ]; then
LOG_ERROR "未找到示例文件"
if [ $NEED_UNINSTALL -eq 1 ]; then
dnf remove -y texlive-pdftricks2-doc
fi
exit 1
fi
# 测试示例文件可访问性
LOG_INFO "测试示例文件可访问性"
for file in $EXAMPLE_FILES; do
LOG_INFO "检查文件: $file"
# 检查文件是否存在
if [ ! -e "$file" ]; then
LOG_ERROR "文件不存在: $file"
if [ $NEED_UNINSTALL -eq 1 ]; then
dnf remove -y texlive-pdftricks2-doc
fi
exit 1
fi
# 检查文件是否可读
if [ ! -r "$file" ]; then
LOG_ERROR "文件不可读: $file"
if [ $NEED_UNINSTALL -eq 1 ]; then
dnf remove -y texlive-pdftricks2-doc
fi
exit 1
fi
# 检查文件大小
file_size=$(stat -c%s "$file" 2>/dev/null || stat -f%z "$file" 2>/dev/null)
if [ $? -eq 0 ] && [ "$file_size" -gt 0 ]; then
LOG_INFO "文件 $file 大小: ${file_size}字节,可正常访问"
else
LOG_ERROR "文件 $file 大小为0或无法获取大小"
if [ $NEED_UNINSTALL -eq 1 ]; then
dnf remove -y texlive-pdftricks2-doc
fi
exit 1
fi
done
LOG_INFO "所有示例文件均可正常访问"
# 清理环境
if [ $NEED_UNINSTALL -eq 1 ]; then
LOG_INFO "卸载软件包texlive-pdftricks2-doc"
dnf remove -y texlive-pdftricks2-doc
CHECK_RESULT $? 0 0 "卸载软件包失败"
LOG_INFO "环境已恢复到测试前状态"
else
LOG_INFO "保持软件包安装状态"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -1,116 +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 : 检查 texlive-syllogism 软件包是否已正确安装且其宏包文件可用。
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查texlive-syllogism软件包是否已正确安装且其宏包文件可用
LOG_INFO "开始检查texlive-syllogism软件包"
# 检查软件包是否已在yum源中
LOG_INFO "检查yum源中是否存在texlive-syllogism软件包"
dnf list available texlive-syllogism &>/dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中不存在texlive-syllogism软件包"
exit 255
fi
# 检查当前是否已安装
LOG_INFO "检查当前是否已安装texlive-syllogism"
rpm -q texlive-syllogism &>/dev/null
if [ $? -eq 0 ]; then
LOG_INFO "texlive-syllogism已安装测试完成后将保持安装状态"
already_installed=1
else
LOG_INFO "texlive-syllogism未安装将进行安装测试"
already_installed=0
fi
# 如果未安装,则安装软件包
if [ $already_installed -eq 0 ]; then
LOG_INFO "安装texlive-syllogism软件包"
dnf install -y texlive-syllogism
CHECK_RESULT $? 0 0 "安装texlive-syllogism失败"
fi
# 验证软件包是否已正确安装
LOG_INFO "验证texlive-syllogism软件包是否正确安装"
rpm -q texlive-syllogism
CHECK_RESULT $? 0 0 "texlive-syllogism软件包未正确安装"
# 检查宏包文件是否可用
LOG_INFO "检查texlive-syllogism宏包文件"
# 查找syllogism.sty文件
kpsewhich syllogism.sty &>/dev/null
if [ $? -eq 0 ]; then
LOG_INFO "找到syllogism.sty宏包文件"
# 验证文件内容
kpsewhich syllogism.sty | xargs file | grep -q "text"
CHECK_RESULT $? 0 0 "syllogism.sty文件格式不正确"
# 检查文件是否可读
kpsewhich syllogism.sty | xargs test -r
CHECK_RESULT $? 0 0 "syllogism.sty文件不可读"
else
LOG_ERROR "未找到syllogism.sty宏包文件"
CHECK_RESULT 1 0 0 "texlive-syllogism宏包文件不可用"
fi
# 测试简单的LaTeX文档是否能编译使用syllogism宏包
LOG_INFO "测试使用syllogism宏包的简单LaTeX文档"
TEST_FILE="/tmp/test_syllogism_$$.tex"
cat > $TEST_FILE << "EOF"
\documentclass{article}
\usepackage{syllogism}
\begin{document}
测试文档。
\end{document}
EOF
# 尝试编译不生成PDF只检查语法
pdflatex -draftmode -interaction=nonstopmode $TEST_FILE &>/dev/null
CHECK_RESULT $? 0 0 "使用syllogism宏包的LaTeX文档编译失败"
# 清理测试文件
rm -f $TEST_FILE ${TEST_FILE%.tex}.aux ${TEST_FILE%.tex}.log ${TEST_FILE%.tex}.out
# 环境恢复
LOG_INFO "开始环境恢复"
if [ $already_installed -eq 0 ]; then
LOG_INFO "卸载测试安装的texlive-syllogism软件包"
dnf remove -y texlive-syllogism
CHECK_RESULT $? 0 0 "卸载texlive-syllogism失败"
# 验证是否已卸载
rpm -q texlive-syllogism &>/dev/null
if [ $? -eq 0 ]; then
LOG_ERROR "texlive-syllogism卸载不彻底"
CHECK_RESULT 1 0 0 "环境恢复失败"
else
LOG_INFO "texlive-syllogism已成功卸载"
fi
else
LOG_INFO "保持texlive-syllogism的安装状态"
fi
LOG_INFO "texlive-syllogism软件包检查完成"
}
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-04-03
# @License : Mulan PSL v2
# @Desc : 测试 texlive-syllogism 软件包的基本用法,验证能否正确生成三段论逻辑图表。
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "1. 检查系统中是否已安装 texlive-syllogism 软件包"
if dnf list installed texlive-syllogism &>/dev/null; then
LOG_INFO "texlive-syllogism 已安装,脚本结束后将保持安装状态"
INSTALLED_BEFORE=true
else
LOG_INFO "texlive-syllogism 未安装,将在测试步骤中安装,并在脚本结束前卸载"
INSTALLED_BEFORE=false
fi
LOG_INFO "2. 检查 yum 源中是否存在 texlive-syllogism 软件包"
if ! dnf list available texlive-syllogism &>/dev/null; then
LOG_ERROR "yum 源中未找到 texlive-syllogism 软件包"
exit 255
fi
if [ "$INSTALLED_BEFORE" = false ]; then
LOG_INFO "3. 安装 texlive-syllogism 软件包"
dnf install -y texlive-syllogism
CHECK_RESULT $? 0 0 "安装 texlive-syllogism 失败"
fi
LOG_INFO "4. 验证 texlive-syllogism 基本命令是否存在"
if ! command -v syllogism &>/dev/null; then
LOG_ERROR "syllogism 命令未找到"
exit 255
fi
LOG_INFO "5. 测试 syllogism 命令的基本用法,生成三段论逻辑图表"
syllogism --help
CHECK_RESULT $? 0 0 "syllogism --help 命令执行失败"
LOG_INFO "6. 尝试使用 syllogism 生成一个简单的三段论图表"
syllogism --output test_syllogism.pdf "All men are mortal. Socrates is a man. Therefore, Socrates is mortal."
CHECK_RESULT $? 0 0 "生成三段论逻辑图表失败"
LOG_INFO "7. 检查生成的图表文件是否存在"
if [ -f test_syllogism.pdf ]; then
LOG_INFO "成功生成三段论逻辑图表文件: test_syllogism.pdf"
rm -f test_syllogism.pdf
else
LOG_ERROR "未找到生成的图表文件 test_syllogism.pdf"
exit 1
fi
if [ "$INSTALLED_BEFORE" = false ]; then
LOG_INFO "8. 卸载 texlive-syllogism 软件包,恢复环境"
dnf remove -y texlive-syllogism
CHECK_RESULT $? 0 0 "卸载 texlive-syllogism 失败"
fi
LOG_INFO "9. 测试完成,环境已恢复"
}
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 : 2025-11-26
# @License : Mulan PSL v2
# @Desc : Test error handling functionality
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查是否已安装texlive-infwarerr
LOG_INFO "检查是否已安装texlive-infwarerr软件包"
dnf list installed texlive-infwarerr > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "texlive-infwarerr已安装脚本结束时保持安装状态"
INSTALLED=true
else
LOG_INFO "texlive-infwarerr未安装将在测试后卸载"
INSTALLED=false
fi
# 检查yum源中是否有texlive-infwarerr软件包
LOG_INFO "检查yum源中是否有texlive-infwarerr软件包"
dnf list available texlive-infwarerr > /dev/null 2>&1
CHECK_RESULT $? 0 255 "yum源中不存在texlive-infwarerr软件包"
# 安装texlive-infwarerr软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "安装texlive-infwarerr软件包"
dnf install -y texlive-infwarerr
CHECK_RESULT $? 0 1 "安装texlive-infwarerr软件包失败"
fi
# 测试错误处理功能
LOG_INFO "测试错误处理功能:执行不支持的命令参数"
tex --invalid-param > /dev/null 2>&1
CHECK_RESULT $? 255 255 "命令参数不支持但未正确退出"
LOG_INFO "测试错误处理功能:执行不存在的命令"
nonexistent-command > /dev/null 2>&1
CHECK_RESULT $? 127 127 "执行不存在的命令但未正确退出"
# 清理环境
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载texlive-infwarerr软件包"
dnf remove -y texlive-infwarerr
CHECK_RESULT $? 0 1 "卸载texlive-infwarerr软件包失败"
fi
LOG_INFO "测试脚本执行完毕"
}
main "$@"