This commit is contained in:
2026-04-16 20:25:21 +08:00
82 changed files with 0 additions and 5061 deletions

View File

@@ -6,10 +6,6 @@
"name": "test_libwinpr-devel_function_install",
"desc": "Test the installation of libwinpr-devel package"
},
{
"name": "test_libwinpr-devel_function_check",
"desc": "Check if libwinpr-devel package is installed on the system"
},
{
"name": "test_libwinpr-devel_function_remove",
"desc": "Test the removal/uninstallation of libwinpr-devel package"
@@ -17,26 +13,6 @@
{
"name": "test_libwinpr-devel_function_update",
"desc": "Test updating the libwinpr-devel package to the latest version"
},
{
"name": "test_libwinpr-devel_function_verify",
"desc": "Verify the integrity of the installed libwinpr-devel package"
},
{
"name": "test_libwinpr-devel_function_headers",
"desc": "Check the presence of essential header files after installation"
},
{
"name": "test_libwinpr-devel_function_libs",
"desc": "Check the presence and linking of essential library files"
},
{
"name": "test_libwinpr-devel_function_pkgconfig",
"desc": "Test pkg-config support for libwinpr-devel"
},
{
"name": "test_libwinpr-devel_function_compile",
"desc": "Test compiling a simple program using libwinpr headers and libraries"
}
]
}

View File

@@ -6,10 +6,6 @@
"name": "test_glassfish-jaxb-bom_install",
"desc": "测试 glassfish-jaxb-bom 软件包的安装功能,验证安装过程是否成功。",
"machine num": 1
},
{
"name": "test_glassfish-jaxb-bom_function_validation",
"desc": "测试 glassfish-jaxb-bom 的 XML 数据验证功能,确保其正确性。"
}
]
}

View File

@@ -10,10 +10,6 @@
"name": "test_gsettings-desktop-schemas-devel_verify",
"desc": "验证gsettings-desktop-schemas-devel软件包是否已正确安装并包含必要的开发文件"
},
{
"name": "test_gsettings-desktop-schemas-devel_usage",
"desc": "测试使用gsettings-desktop-schemas-devel中的头文件进行简单编译"
},
{
"name": "test_gsettings-desktop-schemas-devel_uninstall",
"desc": "测试gsettings-desktop-schemas-devel软件包能否被成功卸载"

View File

@@ -9,26 +9,6 @@
{
"name": "test_libwebsockets_function_uninstall",
"desc": "Test the uninstallation of libwebsockets package"
},
{
"name": "test_libwebsockets_function_basic_echo",
"desc": "Test basic WebSocket echo server functionality"
},
{
"name": "test_libwebsockets_function_ssl_support",
"desc": "Test WebSocket SSL/TLS secure connection"
},
{
"name": "test_libwebsockets_function_multiple_clients",
"desc": "Test server handling multiple concurrent clients"
},
{
"name": "test_libwebsockets_function_ping_pong",
"desc": "Test WebSocket ping-pong heartbeat mechanism"
},
{
"name": "test_libwebsockets_function_version_check",
"desc": "Check installed libwebsockets library version"
}
]
}

View File

@@ -6,10 +6,6 @@
"name": "test_maven-doxia-core_install",
"desc": "测试maven-doxia-core软件包的安装功能",
"machine num": 1
},
{
"name": "test_maven-doxia-core_function_parse",
"desc": "测试maven-doxia-core软件包的解析功能"
}
]
}

View File

@@ -6,22 +6,6 @@
"name": "test_openwebbeans-resource_install",
"desc": "测试openwebbeans-resource软件包的安装功能",
"machine num": 1
},
{
"name": "test_openwebbeans-resource_function_load",
"desc": "测试openwebbeans-resource软件包的资源加载功能"
},
{
"name": "test_openwebbeans-resource_function_config",
"desc": "测试openwebbeans-resource软件包的配置功能"
},
{
"name": "test_openwebbeans-resource_function_inject",
"desc": "测试openwebbeans-resource软件包的依赖注入功能"
},
{
"name": "test_openwebbeans-resource_function_scope",
"desc": "测试openwebbeans-resource软件包的作用域功能"
}
]
}

View File

@@ -1,14 +0,0 @@
{
"path": "$OET_PATH/testcases/function_test/pkg_test/protobuf2/protobuf2-emacs",
"machine num": 1,
"cases": [
{
"name": "test_protobuf2-emacs_function_parse",
"desc": "Test parsing protobuf messages"
},
{
"name": "test_protobuf2-emacs_function_serialize",
"desc": "Test serializing protobuf messages"
}
]
}

View File

@@ -6,10 +6,6 @@
"name": "test_python3-hypothesis-fspaths_install",
"desc": "测试软件包 python3-hypothesis-fspaths 的安装功能,验证安装是否成功",
"machine num": 1
},
{
"name": "test_python3-hypothesis-fspaths_function_filepath",
"desc": "测试软件包 python3-hypothesis-fspaths 的文件路径生成功能"
}
]
}

View File

@@ -13,50 +13,6 @@
{
"name": "test_python3-tensorboard_tensorboard_bind_all",
"desc": "测试使用 --bind_all 参数在所有公共接口上服务"
},
{
"name": "test_python3-tensorboard_tensorboard_port",
"desc": "测试使用 --port 参数指定服务端口"
},
{
"name": "test_python3-tensorboard_tensorboard_reuse_port",
"desc": "测试使用 --reuse_port 参数启用端口重用"
},
{
"name": "test_python3-tensorboard_tensorboard_load_fast",
"desc": "测试使用 --load_fast 参数启用快速加载模式"
},
{
"name": "test_python3-tensorboard_tensorboard_purge_orphaned_data",
"desc": "测试使用 --purge_orphaned_data 参数控制是否清除孤立数据"
},
{
"name": "test_python3-tensorboard_tensorball_inspect",
"desc": "测试使用 --inspect 参数检查事件文件摘要"
},
{
"name": "test_python3-tensorball_version_tb",
"desc": "测试使用 --version_tb 参数打印 TensorBoard 版本"
},
{
"name": "test_python3-tensorboard_function_logdir_path",
"desc": "测试指定日志目录路径的功能"
},
{
"name": "test_python3-tensorboard_tensorboard_inspect",
"desc": "测试使用 --inspect 参数检查事件文件摘要"
},
{
"name": "test_python3-tensorboard_tensorboard_version_tb",
"desc": "测试使用 --version_tb 参数打印 TensorBoard 版本"
},
{
"name": "test_python3-tensorboard_tensorball_path_prefix",
"desc": "测试使用 --path_prefix 参数设置相对路径前缀"
},
{
"name": "test_python3-tensorboard_function_custom_tags",
"desc": "测试使用自定义标签的功能"
}
]
}

View File

@@ -6,18 +6,6 @@
"name": "test_rrdtool-devel_function_install",
"desc": "Test installation of rrdtool-devel package"
},
{
"name": "test_rrdtool-devel_function_verify_install",
"desc": "Verify rrdtool-devel package is installed"
},
{
"name": "test_rrdtool-devel_function_check_files",
"desc": "Check existence of key header and lib files"
},
{
"name": "test_rrdtool-devel_function_compile_test",
"desc": "Test compile a simple program with rrdtool libs"
},
{
"name": "test_rrdtool-devel_function_uninstall",
"desc": "Test uninstallation of rrdtool-devel package"

View File

@@ -6,10 +6,6 @@
"name": "test_rubygem-rr-doc_install",
"desc": "测试软件包 rubygem-rr-doc 的安装功能,验证是否能够成功安装到系统中。",
"machine num": 1
},
{
"name": "test_rubygem-rr-doc_function_load",
"desc": "测试软件包 rubygem-rr-doc 的加载功能,验证是否能够成功加载到系统中。"
}
]
}

View File

@@ -1,10 +0,0 @@
{
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-c/texlive-biblatex-phys-doc",
"machine num": 1,
"cases": [
{
"name": "test_texlive-biblatex-phys-doc_function_bib",
"desc": "Test bibliography generation"
}
]
}

View File

@@ -6,10 +6,6 @@
"name": "test_texlive-draftcopy-doc_install",
"desc": "测试texlive-draftcopy-doc软件包的安装功能",
"machine num": 1
},
{
"name": "test_texlive-draftcopy-doc_function_build",
"desc": "测试texlive-draftcopy-doc软件包的构建功能"
}
]
}

View File

@@ -1,10 +0,0 @@
{
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-i/texlive-fei",
"machine num": 1,
"cases": [
{
"name": "test_texlive-fei_function_install",
"desc": "Test installation of texlive-fei package"
}
]
}

View File

@@ -2,17 +2,9 @@
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-l/texlive-ijmart",
"machine num": 1,
"cases": [
{
"name": "test_texlive-ijmart_function_install",
"desc": "Test package installation"
},
{
"name": "test_texlive-ijmart_function_uninstall",
"desc": "Test package removal"
},
{
"name": "test_texlive-ijmart_function_basic",
"desc": "Test basic command usage"
}
]
}

View File

@@ -1,10 +0,0 @@
{
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-n/texlive-ledmac",
"machine num": 1,
"cases": [
{
"name": "test_texlive-ledmac_function_basic",
"desc": "Test basic functionality of texlive-ledmac"
}
]
}

View File

@@ -1,10 +0,0 @@
{
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-n/texlive-luainputenc",
"machine num": 1,
"cases": [
{
"name": "test_texlive-luainputenc_function_load",
"desc": "Test loading the package"
}
]
}

View File

@@ -7,29 +7,9 @@
"desc": "测试texlive-numname软件包的安装功能验证安装过程是否正常完成",
"machine num": 1
},
{
"name": "test_texlive-numname_function_render",
"desc": "测试texlive-numname软件包的渲染功能验证是否能正确渲染数字名称"
},
{
"name": "test_texlive-numname_uninstall",
"desc": "测试texlive-numname软件包的卸载功能验证卸载过程是否正常完成"
},
{
"name": "test_texlive-numname_function_basic",
"desc": "测试texlive-numname的基本数字名称渲染功能"
},
{
"name": "test_texlive-numname_function_format",
"desc": "测试texlive-numname的格式化选项功能"
},
{
"name": "test_texlive-numname_function_lang",
"desc": "测试texlive-numname的多语言支持功能"
},
{
"name": "test_texlive-numname_function_compile",
"desc": "测试texlive-numname在完整LaTeX文档中的编译功能"
}
]
}

View File

@@ -2,10 +2,6 @@
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-x/texlive-foliono",
"machine num": 1,
"cases": [
{
"name": "test_texlive-foliono_function_install",
"desc": "Test package installation"
},
{
"name": "test_texlive-foliono_function_remove",
"desc": "Test package removal"
@@ -13,14 +9,6 @@
{
"name": "test_texlive-foliono_function_installed",
"desc": "Verify package is installed"
},
{
"name": "test_texlive-foliono_function_help",
"desc": "Test help command availability"
},
{
"name": "test_texlive-foliono_function_version",
"desc": "Test version command output"
}
]
}

View File

@@ -1,30 +0,0 @@
{
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-z/texlive-amscdx",
"machine num": 1,
"cases": [
{
"name": "test_texlive-amscdx_function_compile",
"desc": "Test compilation of amscdx package"
},
{
"name": "test_texlive-amscdx_function_install",
"desc": "Test installation of texlive-amscdx package"
},
{
"name": "test_texlive-amscdx_function_uninstall",
"desc": "Test uninstallation of texlive-amscdx package"
},
{
"name": "test_texlive-amscdx_function_check_installed",
"desc": "Test checking if texlive-amscdx is installed"
},
{
"name": "test_texlive-amscdx_function_basic_usage",
"desc": "Test basic LaTeX usage of amscdx package"
},
{
"name": "test_texlive-amscdx_function_commutative_diagram",
"desc": "Test drawing a simple commutative diagram"
}
]
}

View File

@@ -2,14 +2,6 @@
"path": "$OET_PATH/testcases/function_test/pkg_test/uwsgi/uwsgi-plugin-cplusplus",
"machine num": 1,
"cases": [
{
"name": "test_uwsgi-plugin-cplusplus_function_load",
"desc": "Test loading the C++ plugin"
},
{
"name": "test_uwsgi-plugin-cplusplus_function_exec",
"desc": "Test executing C++ code"
},
{
"name": "test_uwsgi-plugin-cplusplus_function_config",
"desc": "Test plugin configuration"
@@ -21,18 +13,6 @@
{
"name": "test_uwsgi-plugin-cplusplus_function_uninstall",
"desc": "Test removal of the uwsgi-plugin-cplusplus package"
},
{
"name": "test_uwsgi-plugin-cplusplus_function_version",
"desc": "Test checking the installed plugin version"
},
{
"name": "test_uwsgi-plugin-cplusplus_function_integration",
"desc": "Test integration with uWSGI server"
},
{
"name": "test_uwsgi-plugin-cplusplus_function_compile",
"desc": "Test compiling C++ app with plugin"
}
]
}

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-21
# @License : Mulan PSL v2
# @Desc : Check if libwinpr-devel package is installed on the system
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试检查系统是否安装了libwinpr-devel软件包"
# 检查libwinpr-devel软件包是否已安装
LOG_INFO "检查libwinpr-devel软件包是否已安装"
rpm -q libwinpr-devel
if [ $? -eq 0 ]; then
LOG_INFO "libwinpr-devel软件包已安装"
installed=true
else
LOG_INFO "libwinpr-devel软件包未安装"
installed=false
fi
# 检查yum源中是否有libwinpr-devel软件包
LOG_INFO "检查yum源中是否有libwinpr-devel软件包"
dnf list available libwinpr-devel 2>/dev/null | grep -q libwinpr-devel
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中没有libwinpr-devel软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ "$installed" = false ]; then
LOG_INFO "安装libwinpr-devel软件包"
dnf install -y libwinpr-devel
CHECK_RESULT $? 0 0 "安装libwinpr-devel软件包失败"
fi
# 验证软件包安装成功
LOG_INFO "验证libwinpr-devel软件包安装成功"
rpm -q libwinpr-devel
CHECK_RESULT $? 0 0 "libwinpr-devel软件包未正确安装"
# 测试软件包功能
LOG_INFO "测试libwinpr-devel软件包功能"
# 这里可以添加具体的功能测试命令,例如检查头文件或库文件是否存在
ls /usr/include/winpr2/winpr.h >/dev/null 2>&1
CHECK_RESULT $? 0 0 "libwinpr-devel软件包功能测试失败"
# 清理环境:如果测试前未安装,则卸载软件包
if [ "$installed" = false ]; then
LOG_INFO "卸载libwinpr-devel软件包"
dnf remove -y libwinpr-devel
CHECK_RESULT $? 0 0 "卸载libwinpr-devel软件包失败"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -1,82 +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-21
# @License : Mulan PSL v2
# @Desc : Test compiling a simple program using libwinpr headers and libraries
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查是否已安装libwinpr-devel
LOG_INFO "检查是否已安装libwinpr-devel软件包"
if rpm -q libwinpr-devel &> /dev/null; then
LOG_INFO "libwinpr-devel已安装标记为保持安装状态"
KEEP_INSTALLED=1
else
LOG_INFO "libwinpr-devel未安装将在测试后卸载"
KEEP_INSTALLED=0
fi
# 检查yum源中是否有libwinpr-devel软件包
LOG_INFO "检查yum源中是否有libwinpr-devel软件包"
if ! dnf list available libwinpr-devel &> /dev/null; then
LOG_ERROR "yum源中未找到libwinpr-devel软件包"
exit 255
fi
# 如果未安装则安装libwinpr-devel
if [ $KEEP_INSTALLED -eq 0 ]; then
LOG_INFO "安装libwinpr-devel软件包"
dnf install -y libwinpr-devel
CHECK_RESULT $? 0 0 "安装libwinpr-devel失败"
fi
# 创建测试C程序
LOG_INFO "创建测试C程序"
cat > test_winpr.c << "EOF"
#include <winpr/wtypes.h>
#include <stdio.h>
int main() {
printf("Testing libwinpr compilation\n");
return 0;
}
EOF
# 编译测试程序
LOG_INFO "编译测试程序"
gcc -o test_winpr test_winpr.c -lwinpr
CHECK_RESULT $? 0 0 "编译测试程序失败"
# 运行测试程序
LOG_INFO "运行测试程序"
./test_winpr
CHECK_RESULT $? 0 0 "运行测试程序失败"
# 清理测试文件
LOG_INFO "清理测试文件"
rm -f test_winpr test_winpr.c
# 如果测试前未安装则卸载libwinpr-devel
if [ $KEEP_INSTALLED -eq 0 ]; then
LOG_INFO "卸载libwinpr-devel软件包"
dnf remove -y libwinpr-devel
CHECK_RESULT $? 0 0 "卸载libwinpr-devel失败"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -1,81 +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-21
# @License : Mulan PSL v2
# @Desc : Check the presence of essential header files after installation
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试:检查安装后必要的头文件是否存在"
# 检查环境是否已安装libwinpr-devel
LOG_INFO "步骤1检查libwinpr-devel是否已安装"
if dnf list installed libwinpr-devel &>/dev/null; then
LOG_INFO "libwinpr-devel已安装测试结束后保持安装状态"
ALREADY_INSTALLED=1
else
LOG_INFO "libwinpr-devel未安装将在测试步骤中安装"
ALREADY_INSTALLED=0
fi
# 检查yum源中是否有libwinpr-devel软件包
LOG_INFO "步骤2检查yum源中是否存在libwinpr-devel软件包"
if ! dnf list available libwinpr-devel &>/dev/null; then
LOG_ERROR "yum源中未找到libwinpr-devel软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ $ALREADY_INSTALLED -eq 0 ]; then
LOG_INFO "步骤3安装libwinpr-devel软件包"
dnf install -y libwinpr-devel
CHECK_RESULT $? 0 0 "安装libwinpr-devel失败"
fi
# 检查必要的头文件是否存在
LOG_INFO "步骤4检查必要的头文件是否存在"
HEADER_FILES=(
"/usr/include/winpr/winpr.h"
"/usr/include/winpr/version.h"
"/usr/include/winpr/wtypes.h"
)
for header in "${HEADER_FILES[@]}"; do
if [ ! -f "$header" ]; then
LOG_ERROR "头文件 $header 不存在"
exit 1
else
LOG_INFO "头文件 $header 存在"
fi
done
LOG_INFO "步骤5所有必要的头文件检查通过"
# 环境恢复:如果测试前未安装,则卸载软件包
if [ $ALREADY_INSTALLED -eq 0 ]; then
LOG_INFO "步骤6恢复环境卸载libwinpr-devel软件包"
dnf remove -y libwinpr-devel
CHECK_RESULT $? 0 0 "卸载libwinpr-devel失败"
LOG_INFO "环境已恢复libwinpr-devel已卸载"
else
LOG_INFO "步骤6保持libwinpr-devel安装状态无需卸载"
fi
LOG_INFO "测试完成:所有必要的头文件在安装后均存在"
}
main "$@"

View File

@@ -1,89 +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-21
# @License : Mulan PSL v2
# @Desc : Check the presence and linking of essential library files
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试:检查必需库文件的存在和链接"
# 定义软件包名称
PACKAGE_NAME="libwinpr-devel"
LOG_INFO "步骤1检查yum源中是否存在软件包 $PACKAGE_NAME"
if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then
LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在"
exit 255
fi
# 检查是否已安装
LOG_INFO "步骤2检查系统是否已安装 $PACKAGE_NAME"
if rpm -q "$PACKAGE_NAME" &>/dev/null; then
LOG_INFO "软件包 $PACKAGE_NAME 已安装,脚本结束后将保持安装状态"
INSTALLED_BEFORE=true
else
LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试步骤中安装"
INSTALLED_BEFORE=false
fi
# 如果未安装,则安装软件包
if [ "$INSTALLED_BEFORE" = false ]; then
LOG_INFO "步骤3安装软件包 $PACKAGE_NAME"
dnf install -y "$PACKAGE_NAME"
CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败"
fi
# 检查必需库文件是否存在
LOG_INFO "步骤4检查必需库文件是否存在"
LIB_FILES=("/usr/lib64/libwinpr2.so" "/usr/lib64/libwinpr2.a")
for lib in "${LIB_FILES[@]}"; do
if [ -f "$lib" ]; then
LOG_INFO "库文件 $lib 存在"
else
LOG_ERROR "库文件 $lib 不存在"
exit 1
fi
done
# 检查库文件是否正确链接
LOG_INFO "步骤5检查库文件是否正确链接"
for lib in "${LIB_FILES[@]}"; do
if [ -L "$lib" ]; then
LOG_INFO "库文件 $lib 是一个符号链接"
link_target=$(readlink -f "$lib")
if [ -f "$link_target" ]; then
LOG_INFO "链接目标 $link_target 存在"
else
LOG_ERROR "链接目标 $link_target 不存在"
exit 1
fi
else
LOG_INFO "库文件 $lib 不是一个符号链接"
fi
done
# 清理环境:如果之前未安装,则卸载软件包
if [ "$INSTALLED_BEFORE" = false ]; then
LOG_INFO "步骤6卸载软件包 $PACKAGE_NAME"
dnf remove -y "$PACKAGE_NAME"
CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败"
fi
LOG_INFO "测试完成:必需库文件的存在和链接检查通过"
}
main "$@"

View File

@@ -1,98 +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-21
# @License : Mulan PSL v2
# @Desc : Test pkg-config support for libwinpr-devel
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查pkg-config对libwinpr-devel的支持
LOG_INFO "开始测试Test pkg-config support for libwinpr-devel"
# 检查是否已安装libwinpr-devel
LOG_INFO "步骤1检查libwinpr-devel是否已安装"
if dnf list installed libwinpr-devel &>/dev/null; then
LOG_INFO "libwinpr-devel已安装"
ALREADY_INSTALLED=true
else
LOG_INFO "libwinpr-devel未安装"
ALREADY_INSTALLED=false
fi
# 检查yum源中是否有libwinpr-devel软件包
LOG_INFO "步骤2检查yum源中是否有libwinpr-devel软件包"
if ! dnf list available libwinpr-devel &>/dev/null; then
LOG_ERROR "yum源中未找到libwinpr-devel软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ "$ALREADY_INSTALLED" = false ]; then
LOG_INFO "步骤3安装libwinpr-devel软件包"
dnf install -y libwinpr-devel
CHECK_RESULT $? 0 0 "安装libwinpr-devel失败"
fi
# 测试pkg-config支持
LOG_INFO "步骤4测试pkg-config对libwinpr-devel的支持"
# 检查pkg-config命令是否存在
if ! command -v pkg-config &>/dev/null; then
LOG_ERROR "pkg-config命令不存在"
exit 255
fi
# 检查libwinpr-devel是否提供.pc文件
LOG_INFO "步骤4.1检查libwinpr-devel是否提供.pc文件"
pkg-config --list-all | grep -i winpr
CHECK_RESULT $? 0 0 "libwinpr-devel未提供pkg-config支持"
# 测试pkg-config查询功能
LOG_INFO "步骤4.2测试pkg-config查询功能"
pkg-config --cflags winpr
CHECK_RESULT $? 0 0 "查询winpr的cflags失败"
pkg-config --libs winpr
CHECK_RESULT $? 0 0 "查询winpr的libs失败"
# 测试pkg-config版本查询
LOG_INFO "步骤4.3测试pkg-config版本查询"
pkg-config --modversion winpr
CHECK_RESULT $? 0 0 "查询winpr版本失败"
# 测试pkg-config存在性检查
LOG_INFO "步骤4.4测试pkg-config存在性检查"
pkg-config --exists winpr
CHECK_RESULT $? 0 0 "winpr.pc文件不存在或不完整"
# 清理环境
LOG_INFO "步骤5清理测试环境"
# 如果测试前未安装,则卸载软件包
if [ "$ALREADY_INSTALLED" = false ]; then
LOG_INFO "卸载libwinpr-devel软件包"
dnf remove -y libwinpr-devel
CHECK_RESULT $? 0 0 "卸载libwinpr-devel失败"
LOG_INFO "已恢复到测试前的环境状态"
else
LOG_INFO "保持libwinpr-devel安装状态"
fi
LOG_INFO "测试完成pkg-config对libwinpr-devel的支持测试通过"
}
main "$@"

View File

@@ -1,85 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2026-03-21
# @License : Mulan PSL v2
# @Desc : Verify the integrity of the installed libwinpr-devel package
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始验证 libwinpr-devel 软件包的完整性"
LOG_INFO "步骤1: 检查系统中是否已安装 libwinpr-devel 软件包"
if rpm -q libwinpr-devel > /dev/null 2>&1; then
LOG_INFO "libwinpr-devel 软件包已安装,脚本结束时将保持安装状态"
already_installed=true
else
LOG_INFO "libwinpr-devel 软件包未安装,将在测试过程中安装并在结束后卸载"
already_installed=false
fi
LOG_INFO "步骤2: 检查 yum 源中是否存在 libwinpr-devel 软件包"
if ! dnf list available libwinpr-devel > /dev/null 2>&1; then
LOG_ERROR "yum 源中未找到 libwinpr-devel 软件包"
exit 255
fi
if [ "$already_installed" = "false" ]; then
LOG_INFO "步骤3: 安装 libwinpr-devel 软件包"
dnf install -y libwinpr-devel
CHECK_RESULT $? 0 0 "安装 libwinpr-devel 软件包失败"
fi
LOG_INFO "步骤4: 验证 libwinpr-devel 软件包的文件完整性"
rpm -V libwinpr-devel
CHECK_RESULT $? 0 0 "libwinpr-devel 软件包文件完整性验证失败"
LOG_INFO "步骤5: 验证 libwinpr-devel 软件包的头文件是否存在"
if [ -d /usr/include/winpr2 ]; then
LOG_INFO "libwinpr-devel 头文件目录存在"
if [ -f /usr/include/winpr2/winpr.h ]; then
LOG_INFO "找到 winpr.h 头文件"
else
LOG_ERROR "未找到 winpr.h 头文件"
exit 1
fi
else
LOG_ERROR "libwinpr-devel 头文件目录不存在"
exit 1
fi
LOG_INFO "步骤6: 验证 libwinpr-devel 软件包的 pkg-config 文件"
if pkg-config --exists winpr2; then
LOG_INFO "winpr2 pkg-config 文件存在"
pkg-config --modversion winpr2
CHECK_RESULT $? 0 0 "获取 winpr2 版本信息失败"
else
LOG_ERROR "winpr2 pkg-config 文件不存在"
exit 1
fi
LOG_INFO "步骤7: 清理测试环境"
if [ "$already_installed" = "false" ]; then
LOG_INFO "卸载测试安装的 libwinpr-devel 软件包"
dnf remove -y libwinpr-devel
CHECK_RESULT $? 0 0 "卸载 libwinpr-devel 软件包失败"
else
LOG_INFO "保持原安装状态,不卸载 libwinpr-devel 软件包"
fi
LOG_INFO "libwinpr-devel 软件包完整性验证完成"
}
main "$@"

View File

@@ -1,77 +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 : 测试 glassfish-jaxb-bom 的 XML 数据验证功能,确保其正确性。
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试 glassfish-jaxb-bom 的 XML 数据验证功能"
# 检查软件包是否在yum源中
LOG_INFO "检查 glassfish-jaxb-bom 是否在yum源中"
dnf list available glassfish-jaxb-bom &>/dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "glassfish-jaxb-bom 不在yum源中"
exit 255
fi
# 检查环境是否已安装 glassfish-jaxb-bom
LOG_INFO "检查环境是否已安装 glassfish-jaxb-bom"
rpm -q glassfish-jaxb-bom &>/dev/null
if [ $? -eq 0 ]; then
installed=true
LOG_INFO "glassfish-jaxb-bom 已安装"
else
installed=false
LOG_INFO "glassfish-jaxb-bom 未安装,将进行安装"
fi
# 如果未安装,则安装软件包
if [ "$installed" = false ]; then
LOG_INFO "安装 glassfish-jaxb-bom"
dnf install -y glassfish-jaxb-bom
CHECK_RESULT $? 0 0 "安装 glassfish-jaxb-bom 失败"
fi
# 测试 XML 数据验证功能
LOG_INFO "测试 XML 数据验证功能"
# 示例命令验证XML文件
xml_file="test.xml"
if [ ! -f "$xml_file" ]; then
LOG_ERROR "测试文件 $xml_file 不存在"
exit 255
fi
# 使用 jaxb 工具验证 XML假设命令为 jaxb-validate
jaxb-validate "$xml_file"
CHECK_RESULT $? 0 0 "XML 数据验证失败"
# 清理环境:如果脚本开始时未安装,则卸载软件包
if [ "$installed" = false ]; then
LOG_INFO "卸载 glassfish-jaxb-bom"
dnf remove -y glassfish-jaxb-bom
CHECK_RESULT $? 0 0 "卸载 glassfish-jaxb-bom 失败"
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-19
# @License : Mulan PSL v2
# @Desc : 测试使用gsettings-desktop-schemas-devel中的头文件进行简单编译
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查是否已安装gsettings-desktop-schemas-devel软件包
LOG_INFO "检查是否已安装gsettings-desktop-schemas-devel软件包"
rpm -q gsettings-desktop-schemas-devel > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "gsettings-desktop-schemas-devel软件包已安装"
INSTALLED="true"
else
LOG_INFO "gsettings-desktop-schemas-devel软件包未安装"
INSTALLED="false"
fi
# 检查yum源中是否存在gsettings-desktop-schemas-devel软件包
LOG_INFO "检查yum源中是否存在gsettings-desktop-schemas-devel软件包"
dnf list available gsettings-desktop-schemas-devel > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中不存在gsettings-desktop-schemas-devel软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ "$INSTALLED" = "false" ]; then
LOG_INFO "开始安装gsettings-desktop-schemas-devel软件包"
dnf install -y gsettings-desktop-schemas-devel
CHECK_RESULT $? 0 0 "安装gsettings-desktop-schemas-devel软件包失败"
LOG_INFO "gsettings-desktop-schemas-devel软件包安装成功"
fi
# 检查gsettings-desktop-schemas-devel提供的头文件是否存在
LOG_INFO "检查gsettings-desktop-schemas-devel提供的头文件是否存在"
if [ ! -f /usr/include/gsettings-desktop-schemas/gsettings-desktop-schemas.h ]; then
LOG_ERROR "gsettings-desktop-schemas.h头文件不存在"
exit 255
fi
LOG_INFO "gsettings-desktop-schemas.h头文件存在"
# 创建一个简单的C程序使用gsettings-desktop-schemas-devel的头文件
LOG_INFO "创建测试C程序"
cat > test_gsettings.c << "EOF"
#include <gsettings-desktop-schemas/gsettings-desktop-schemas.h>
#include <stdio.h>
int main() {
printf("gsettings-desktop-schemas-devel头文件测试成功\n");
return 0;
}
EOF
# 编译测试程序
LOG_INFO "编译测试C程序"
gcc -o test_gsettings test_gsettings.c $(pkg-config --cflags --libs gsettings-desktop-schemas)
CHECK_RESULT $? 0 0 "编译测试程序失败"
# 运行测试程序
LOG_INFO "运行测试程序"
./test_gsettings
CHECK_RESULT $? 0 0 "运行测试程序失败"
# 清理测试程序
LOG_INFO "清理测试程序"
rm -f test_gsettings test_gsettings.c
# 如果之前未安装,则卸载软件包
if [ "$INSTALLED" = "false" ]; then
LOG_INFO "卸载gsettings-desktop-schemas-devel软件包"
dnf remove -y gsettings-desktop-schemas-devel
CHECK_RESULT $? 0 0 "卸载gsettings-desktop-schemas-devel软件包失败"
LOG_INFO "gsettings-desktop-schemas-devel软件包卸载成功"
fi
}
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-04-04
# @License : Mulan PSL v2
# @Desc : Test basic WebSocket echo server functionality
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
set -e
LOG_INFO "开始测试Test basic WebSocket echo server functionality"
LOG_INFO "步骤1检查libwebsockets软件包是否在yum源中"
if ! dnf list --available libwebsockets 2>&1 | grep -q "libwebsockets"; then
LOG_ERROR "yum源中未找到libwebsockets软件包"
exit 255
fi
LOG_INFO "步骤2检查系统是否已安装libwebsockets"
if rpm -q libwebsockets &> /dev/null; then
INSTALLED=true
LOG_INFO "libwebsockets已安装测试后将保持安装状态"
else
INSTALLED=false
LOG_INFO "libwebsockets未安装将在测试前安装"
fi
if [ "$INSTALLED" = false ]; then
LOG_INFO "步骤3安装libwebsockets软件包"
dnf install -y libwebsockets
CHECK_RESULT $? 0 0 "安装libwebsockets失败"
fi
LOG_INFO "步骤4检查libwebsockets-test-server命令是否存在"
if ! command -v libwebsockets-test-server &> /dev/null; then
LOG_ERROR "libwebsockets-test-server命令不存在"
exit 255
fi
LOG_INFO "步骤5启动libwebsockets echo服务器"
libwebsockets-test-server --port=7681 &
SERVER_PID=$!
sleep 2
CHECK_RESULT $? 0 0 "启动libwebsockets echo服务器失败"
LOG_INFO "步骤6使用wscat工具测试WebSocket echo功能"
if ! command -v wscat &> /dev/null; then
LOG_INFO "wscat未安装尝试安装nodejs-ws工具"
if ! dnf list --available nodejs-ws 2>&1 | grep -q "nodejs-ws"; then
LOG_ERROR "yum源中未找到nodejs-ws软件包"
kill $SERVER_PID 2>/dev/null
exit 255
fi
dnf install -y nodejs-ws
CHECK_RESULT $? 0 0 "安装nodejs-ws失败"
WS_INSTALLED=true
else
WS_INSTALLED=false
fi
LOG_INFO "步骤7发送测试消息到WebSocket服务器"
echo "{"test": "message"}" | timeout 5 wscat -c ws://localhost:7681 2>&1 | grep -q "{"test": "message"}"
CHECK_RESULT $? 0 0 "WebSocket echo功能测试失败"
LOG_INFO "步骤8停止libwebsockets echo服务器"
kill $SERVER_PID
CHECK_RESULT $? 0 0 "停止libwebsockets echo服务器失败"
LOG_INFO "步骤9清理测试环境"
if [ "$WS_INSTALLED" = true ]; then
LOG_INFO "卸载测试期间安装的nodejs-ws"
dnf remove -y nodejs-ws
CHECK_RESULT $? 0 0 "卸载nodejs-ws失败"
fi
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载测试期间安装的libwebsockets"
dnf remove -y libwebsockets
CHECK_RESULT $? 0 0 "卸载libwebsockets失败"
fi
LOG_INFO "测试完成WebSocket echo服务器基本功能测试通过"
}
main "$@"

View File

@@ -1,85 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2026-04-04
# @License : Mulan PSL v2
# @Desc : Test server handling multiple concurrent clients
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "测试开始:测试服务器处理多个并发客户端"
# 检查libwebsockets软件包是否在yum源中
LOG_INFO "步骤1检查libwebsockets软件包是否在yum源中"
if ! dnf list available libwebsockets 2>/dev/null | grep -q libwebsockets; then
LOG_ERROR "libwebsockets软件包不在yum源中"
exit 255
fi
# 检查libwebsockets是否已安装
LOG_INFO "步骤2检查libwebsockets是否已安装"
if rpm -q libwebsockets &>/dev/null; then
LIBWEBSOCKETS_INSTALLED=true
LOG_INFO "libwebsockets已安装脚本结束后将保持安装状态"
else
LIBWEBSOCKETS_INSTALLED=false
LOG_INFO "libwebsockets未安装将作为测试步骤安装"
fi
# 如果未安装则安装libwebsockets
if [ "$LIBWEBSOCKETS_INSTALLED" = false ]; then
LOG_INFO "步骤3安装libwebsockets"
dnf install -y libwebsockets
CHECK_RESULT $? 0 0 "安装libwebsockets失败"
fi
# 启动libwebsockets测试服务器
LOG_INFO "步骤4启动libwebsockets测试服务器"
/usr/bin/libwebsockets-test-server &
SERVER_PID=$!
sleep 2
CHECK_RESULT $? 0 0 "启动libwebsockets测试服务器失败"
# 测试多个并发客户端连接
LOG_INFO "步骤5测试多个并发客户端连接"
for i in {1..5}; do
/usr/bin/libwebsockets-test-client &
CLIENT_PIDS[$i]=$!
done
# 等待所有客户端进程完成
for pid in ${CLIENT_PIDS[@]}; do
wait $pid
CHECK_RESULT $? 0 0 "客户端连接失败"
done
# 停止测试服务器
LOG_INFO "步骤6停止libwebsockets测试服务器"
kill $SERVER_PID
wait $SERVER_PID 2>/dev/null
CHECK_RESULT $? 0 0 "停止libwebsockets测试服务器失败"
# 如果测试前未安装则卸载libwebsockets
if [ "$LIBWEBSOCKETS_INSTALLED" = false ]; then
LOG_INFO "步骤7卸载libwebsockets"
dnf remove -y libwebsockets
CHECK_RESULT $? 0 0 "卸载libwebsockets失败"
fi
LOG_INFO "测试结束:服务器成功处理多个并发客户端"
}
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-04-04
# @License : Mulan PSL v2
# @Desc : Test WebSocket ping-pong heartbeat mechanism
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试Test WebSocket ping-pong heartbeat mechanism"
# 定义软件包名称
PACKAGE_NAME="libwebsockets"
LOG_INFO "检查系统中是否已安装 $PACKAGE_NAME"
if rpm -q $PACKAGE_NAME &> /dev/null; then
LOG_INFO "$PACKAGE_NAME 已安装,脚本结束后将保持安装状态"
INSTALLED_BEFORE=true
else
LOG_INFO "$PACKAGE_NAME 未安装,将在测试前安装,测试后卸载"
INSTALLED_BEFORE=false
fi
# 检查yum源中是否存在该软件包
LOG_INFO "检查yum源中是否存在 $PACKAGE_NAME 软件包"
if ! dnf list available $PACKAGE_NAME &> /dev/null; then
LOG_ERROR "yum源中未找到 $PACKAGE_NAME 软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ "$INSTALLED_BEFORE" = false ]; then
LOG_INFO "安装 $PACKAGE_NAME 软件包"
dnf install -y $PACKAGE_NAME
CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败"
fi
# 检查libwebsockets是否支持ping-pong参数
LOG_INFO "检查libwebsockets是否支持ping-pong参数"
if ! libwebsockets-test-server --help 2>&1 | grep -q "ping-pong"; then
LOG_ERROR "libwebsockets不支持ping-pong参数"
exit 255
fi
# 启动libwebsockets测试服务器
LOG_INFO "启动libwebsockets测试服务器"
libwebsockets-test-server --ping-pong &
SERVER_PID=$!
sleep 2
CHECK_RESULT $? 0 0 "启动libwebsockets测试服务器失败"
# 使用libwebsockets测试客户端发送ping消息
LOG_INFO "使用libwebsockets测试客户端发送ping消息"
libwebsockets-test-client --ping
CHECK_RESULT $? 0 0 "发送ping消息失败"
# 检查服务器是否收到ping并回复pong
LOG_INFO "检查服务器是否收到ping并回复pong"
if ps -p $SERVER_PID > /dev/null; then
LOG_INFO "服务器正常运行ping-pong机制正常"
else
LOG_ERROR "服务器异常退出ping-pong机制可能存在问题"
exit 1
fi
# 停止测试服务器
LOG_INFO "停止测试服务器"
kill $SERVER_PID
CHECK_RESULT $? 0 0 "停止测试服务器失败"
# 清理环境:如果之前未安装,则卸载软件包
if [ "$INSTALLED_BEFORE" = false ]; then
LOG_INFO "卸载 $PACKAGE_NAME 软件包"
dnf remove -y $PACKAGE_NAME
CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败"
else
LOG_INFO "保持 $PACKAGE_NAME 安装状态"
fi
LOG_INFO "测试完成Test WebSocket ping-pong heartbeat mechanism"
}
main "$@"

View File

@@ -1,75 +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-04
# @License : Mulan PSL v2
# @Desc : Test WebSocket SSL/TLS secure connection
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试WebSocket SSL/TLS安全连接功能"
LOG_INFO "步骤1: 检查系统中是否已安装libwebsockets软件包"
rpm -q libwebsockets >/dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "libwebsockets软件包已安装测试结束后保持安装状态"
INSTALLED=true
else
LOG_INFO "libwebsockets软件包未安装将在测试过程中安装"
INSTALLED=false
fi
LOG_INFO "步骤2: 检查yum源中是否存在libwebsockets软件包"
dnf list available libwebsockets >/dev/null 2>&1
CHECK_RESULT $? 0 255 "yum源中未找到libwebsockets软件包"
if [ "$INSTALLED" = "false" ]; then
LOG_INFO "步骤3: 安装libwebsockets软件包"
dnf install -y libwebsockets >/dev/null 2>&1
CHECK_RESULT $? 0 0 "安装libwebsockets软件包失败"
fi
LOG_INFO "步骤4: 检查libwebsockets是否支持SSL/TLS"
libwebsockets-test-server --help 2>&1 | grep -q -- "--ssl"
CHECK_RESULT $? 0 255 "libwebsockets不支持SSL/TLS参数"
LOG_INFO "步骤5: 启动支持SSL/TLS的WebSocket测试服务器"
libwebsockets-test-server --port 7681 --ssl &
SERVER_PID=$!
sleep 2
LOG_INFO "步骤6: 检查WebSocket测试服务器进程是否正常运行"
ps -p $SERVER_PID >/dev/null 2>&1
CHECK_RESULT $? 0 0 "WebSocket测试服务器启动失败"
LOG_INFO "步骤7: 测试SSL/TLS WebSocket连接"
wscat -c wss://localhost:7681 --no-check 2>&1 | grep -q "Connected"
CHECK_RESULT $? 0 0 "SSL/TLS WebSocket连接失败"
LOG_INFO "步骤8: 停止WebSocket测试服务器"
kill $SERVER_PID 2>/dev/null
wait $SERVER_PID 2>/dev/null
LOG_INFO "步骤9: 清理测试环境"
if [ "$INSTALLED" = "false" ]; then
LOG_INFO "卸载测试过程中安装的libwebsockets软件包"
dnf remove -y libwebsockets >/dev/null 2>&1
CHECK_RESULT $? 0 0 "卸载libwebsockets软件包失败"
fi
LOG_INFO "WebSocket SSL/TLS安全连接功能测试完成"
}
main "$@"

View File

@@ -1,80 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2026-04-04
# @License : Mulan PSL v2
# @Desc : Check installed libwebsockets library version
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试检查已安装的libwebsockets库版本"
# 定义软件包名称
PACKAGE_NAME="libwebsockets"
# 步骤1检查yum源中是否存在libwebsockets软件包
LOG_INFO "步骤1检查yum源中是否存在${PACKAGE_NAME}软件包"
if ! dnf list available ${PACKAGE_NAME} &>/dev/null; then
LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包"
exit 255
fi
# 步骤2检查系统是否已安装libwebsockets
LOG_INFO "步骤2检查系统是否已安装${PACKAGE_NAME}"
if rpm -q ${PACKAGE_NAME} &>/dev/null; then
LOG_INFO "${PACKAGE_NAME}已安装,标记为已安装状态"
INSTALLED_BEFORE_TEST=true
else
LOG_INFO "${PACKAGE_NAME}未安装,标记为未安装状态"
INSTALLED_BEFORE_TEST=false
fi
# 步骤3如果未安装则安装libwebsockets
if [ "${INSTALLED_BEFORE_TEST}" = "false" ]; then
LOG_INFO "步骤3安装${PACKAGE_NAME}软件包"
dnf install -y ${PACKAGE_NAME}
CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败"
fi
# 步骤4检查libwebsockets版本
LOG_INFO "步骤4检查libwebsockets库版本"
if command -v libwebsockets-test-server &>/dev/null; then
LOG_INFO "使用libwebsockets-test-server检查版本"
libwebsockets-test-server --version
CHECK_RESULT $? 0 0 "获取libwebsockets版本失败"
elif command -v pkg-config &>/dev/null; then
LOG_INFO "使用pkg-config检查版本"
pkg-config --modversion libwebsockets
CHECK_RESULT $? 0 0 "获取libwebsockets版本失败"
else
LOG_ERROR "无法找到检查libwebsockets版本的命令"
exit 255
fi
# 步骤5清理环境恢复到之前的状态
LOG_INFO "步骤5清理环境"
if [ "${INSTALLED_BEFORE_TEST}" = "false" ]; then
LOG_INFO "卸载${PACKAGE_NAME}软件包"
dnf remove -y ${PACKAGE_NAME}
CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败"
else
LOG_INFO "保持${PACKAGE_NAME}的安装状态"
fi
LOG_INFO "测试完成检查已安装的libwebsockets库版本"
}
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-01
# @License : Mulan PSL v2
# @Desc : 测试maven-doxia-core软件包的解析功能
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查是否已安装maven-doxia-core
LOG_INFO "检查是否已安装maven-doxia-core"
rpm -q maven-doxia-core > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "maven-doxia-core已安装"
installed=true
else
LOG_INFO "maven-doxia-core未安装"
installed=false
fi
# 检查yum源中是否存在maven-doxia-core
LOG_INFO "检查yum源中是否存在maven-doxia-core"
dnf list available maven-doxia-core > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中不存在maven-doxia-core软件包"
exit 255
fi
# 如果未安装则安装maven-doxia-core
if [ "$installed" = false ]; then
LOG_INFO "开始安装maven-doxia-core"
dnf install -y maven-doxia-core > /dev/null 2>&1
CHECK_RESULT $? 0 0 "安装maven-doxia-core失败"
fi
# 测试解析功能
LOG_INFO "测试maven-doxia-core的解析功能"
mvn doxia:parse > /dev/null 2>&1
CHECK_RESULT $? 0 0 "解析功能测试失败"
# 如果脚本开始时未安装,则在结束时卸载
if [ "$installed" = false ]; then
LOG_INFO "卸载maven-doxia-core"
dnf remove -y maven-doxia-core > /dev/null 2>&1
CHECK_RESULT $? 0 0 "卸载maven-doxia-core失败"
fi
LOG_INFO "测试脚本执行完毕"
}
main "$@"

View File

@@ -1,65 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2025-12-13
# @License : Mulan PSL v2
# @Desc : 测试openwebbeans-resource软件包的配置功能
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试openwebbeans-resource软件包的配置功能"
# 检查是否已安装openwebbeans-resource
LOG_INFO "检查是否已安装openwebbeans-resource"
if dnf list installed openwebbeans-resource &>/dev/null; then
LOG_INFO "openwebbeans-resource已安装保持安装状态"
installed=true
else
LOG_INFO "openwebbeans-resource未安装将在测试后卸载"
installed=false
fi
# 检查yum源中是否有openwebbeans-resource软件包
LOG_INFO "检查yum源中是否有openwebbeans-resource软件包"
if ! dnf list available openwebbeans-resource &>/dev/null; then
LOG_ERROR "yum源中未找到openwebbeans-resource软件包"
exit 255
fi
# 如果未安装则安装openwebbeans-resource
if [ "$installed" = false ]; then
LOG_INFO "开始安装openwebbeans-resource"
dnf install -y openwebbeans-resource
CHECK_RESULT $? 0 0 "安装openwebbeans-resource失败"
fi
# 测试配置功能
LOG_INFO "测试openwebbeans-resource的配置功能"
command_to_test="openwebbeans-resource --config" # 假设--config是测试参数
$command_to_test
CHECK_RESULT $? 0 0 "执行配置功能失败"
# 清理环境
if [ "$installed" = false ]; then
LOG_INFO "卸载openwebbeans-resource"
dnf remove -y openwebbeans-resource
CHECK_RESULT $? 0 0 "卸载openwebbeans-resource失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
main "$@"

View File

@@ -1,63 +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-13
# @License : Mulan PSL v2
# @Desc : 测试openwebbeans-resource软件包的依赖注入功能
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试openwebbeans-resource软件包的依赖注入功能"
# 检查yum源中是否存在openwebbeans-resource软件包
LOG_INFO "检查yum源中是否存在openwebbeans-resource软件包"
dnf list available openwebbeans-resource &>/dev/null
CHECK_RESULT $? 0 255 "yum源中不存在openwebbeans-resource软件包"
# 检查是否已安装openwebbeans-resource
LOG_INFO "检查是否已安装openwebbeans-resource"
if rpm -q openwebbeans-resource &>/dev/null; then
LOG_INFO "openwebbeans-resource已安装测试结束后保持安装状态"
INSTALLED=true
else
LOG_INFO "openwebbeans-resource未安装测试结束后将卸载"
INSTALLED=false
fi
# 安装openwebbeans-resource
if [ "$INSTALLED" = false ]; then
LOG_INFO "安装openwebbeans-resource"
dnf install -y openwebbeans-resource
CHECK_RESULT $? 0 255 "安装openwebbeans-resource失败"
fi
# 测试依赖注入功能
LOG_INFO "测试依赖注入功能"
test_command="java -jar /path/to/testjar.jar" # 假设测试命令为java -jar实际需替换为具体命令
$test_command
CHECK_RESULT $? 0 0 "依赖注入功能测试失败"
# 清理环境
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载openwebbeans-resource"
dnf remove -y openwebbeans-resource
CHECK_RESULT $? 0 0 "卸载openwebbeans-resource失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
main "$@"

View File

@@ -1,69 +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-13
# @License : Mulan PSL v2
# @Desc : 测试openwebbeans-resource软件包的资源加载功能
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 测试openwebbeans-resource软件包的资源加载功能
LOG_INFO "开始测试openwebbeans-resource软件包的资源加载功能"
# 检查yum源中是否存在openwebbeans-resource软件包
LOG_INFO "检查yum源中是否存在openwebbeans-resource软件包"
dnf list available openwebbeans-resource &>/dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中不存在openwebbeans-resource软件包"
exit 255
fi
# 检查是否已安装openwebbeans-resource软件包
LOG_INFO "检查是否已安装openwebbeans-resource软件包"
rpm -q openwebbeans-resource &>/dev/null
if [ $? -eq 0 ]; then
installed=true
LOG_INFO "openwebbeans-resource软件包已安装"
else
installed=false
LOG_INFO "openwebbeans-resource软件包未安装将进行安装"
fi
# 如果未安装,则安装软件包
if [ "$installed" = false ]; then
LOG_INFO "安装openwebbeans-resource软件包"
dnf install -y openwebbeans-resource
CHECK_RESULT $? 0 0 "安装openwebbeans-resource软件包失败"
fi
# 测试资源加载功能
LOG_INFO "测试openwebbeans-resource软件包的资源加载功能"
command_to_test="openwebbeans-resource --load" # 假设这是测试命令,根据实际命令调整
$command_to_test
CHECK_RESULT $? 0 0 "资源加载功能测试失败"
# 清理环境
if [ "$installed" = false ]; then
LOG_INFO "卸载openwebbeans-resource软件包"
dnf remove -y openwebbeans-resource
CHECK_RESULT $? 0 0 "卸载openwebbeans-resource软件包失败"
fi
LOG_INFO "测试openwebbeans-resource软件包的资源加载功能完成"
}
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 : 2025-12-13
# @License : Mulan PSL v2
# @Desc : 测试openwebbeans-resource软件包的作用域功能
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 测试openwebbeans-resource软件包的作用域功能
# 步骤1检查yum源中是否存在openwebbeans-resource软件包
LOG_INFO "检查yum源中是否存在openwebbeans-resource软件包"
dnf list available openwebbeans-resource > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到openwebbeans-resource软件包"
exit 255
fi
# 步骤2检查是否已安装openwebbeans-resource软件包
LOG_INFO "检查是否已安装openwebbeans-resource软件包"
rpm -q openwebbeans-resource > /dev/null 2>&1
if [ $? -eq 0 ]; then
installed=true
LOG_INFO "openwebbeans-resource已安装脚本结束时将保持安装状态"
else
installed=false
LOG_INFO "openwebbeans-resource未安装将在测试后卸载"
fi
# 步骤3如果未安装则安装openwebbeans-resource软件包
if [ "$installed" = false ]; then
LOG_INFO "开始安装openwebbeans-resource软件包"
dnf install -y openwebbeans-resource > /dev/null 2>&1
CHECK_RESULT $? 0 0 "安装openwebbeans-resource软件包失败"
fi
# 步骤4测试openwebbeans-resource的作用域功能
LOG_INFO "测试openwebbeans-resource的作用域功能"
# 假设测试命令为test_command这里仅为示例
test_command="some_command_related_to_openwebbeans_resource"
$test_command > /dev/null 2>&1
CHECK_RESULT $? 0 0 "测试openwebbeans-resource作用域功能失败"
# 步骤5如果之前未安装则卸载openwebbeans-resource软件包以恢复环境
if [ "$installed" = false ]; then
LOG_INFO "卸载openwebbeans-resource软件包以恢复环境"
dnf remove -y openwebbeans-resource > /dev/null 2>&1
CHECK_RESULT $? 0 0 "卸载openwebbeans-resource软件包失败"
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-11-30
# @License : Mulan PSL v2
# @Desc : Test parsing protobuf messages
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 测试脚本test_protobuf2-emacs_function_parse
LOG_INFO "开始测试Test parsing protobuf messages"
# 检查protobuf2-emacs是否已安装
LOG_INFO "检查protobuf2-emacs是否已安装"
if dnf list installed protobuf2-emacs &>/dev/null; then
LOG_INFO "protobuf2-emacs已安装脚本结束后将保持安装状态"
INSTALLED=true
else
LOG_INFO "protobuf2-emacs未安装将在测试结束后卸载"
INSTALLED=false
fi
# 检查yum源中是否有protobuf2-emacs软件包
LOG_INFO "检查yum源中是否有protobuf2-emacs软件包"
if ! dnf list available protobuf2-emacs &>/dev/null; then
LOG_ERROR "yum源中未找到protobuf2-emacs软件包"
exit 255
fi
# 安装protobuf2-emacs如果未安装
if [ "$INSTALLED" = false ]; then
LOG_INFO "正在安装protobuf2-emacs"
dnf install -y protobuf2-emacs
CHECK_RESULT $? 0 0 "安装protobuf2-emacs失败"
fi
# 测试解析protobuf消息的功能
LOG_INFO "测试解析protobuf消息的功能"
emacs --batch --eval "(require "protobuf-mode)" --eval "(message \"Protobuf mode loaded successfully\")" &>/dev/null
CHECK_RESULT $? 0 0 "加载protobuf-mode失败"
# 清理环境(如果之前未安装)
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载protobuf2-emacs"
dnf remove -y protobuf2-emacs
CHECK_RESULT $? 0 0 "卸载protobuf2-emacs失败"
fi
LOG_INFO "测试完成Test parsing protobuf messages"
}
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 : 2025-12-13
# @License : Mulan PSL v2
# @Desc : Test serializing protobuf messages
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试Test serializing protobuf messages"
# 检查protobuf2-emacs是否已安装
LOG_INFO "检查protobuf2-emacs是否已安装"
if dnf list installed protobuf2-emacs &>/dev/null; then
LOG_INFO "protobuf2-emacs已安装脚本结束时将保持安装状态"
INSTALLED=true
else
LOG_INFO "protobuf2-emacs未安装将在测试结束后卸载"
INSTALLED=false
fi
# 检查yum源中是否有protobuf2-emacs软件包
LOG_INFO "检查yum源中是否有protobuf2-emacs软件包"
if ! dnf list available protobuf2-emacs &>/dev/null; then
LOG_ERROR "yum源中未找到protobuf2-emacs软件包"
exit 255
fi
# 安装protobuf2-emacs如果未安装
if [ "$INSTALLED" = false ]; then
LOG_INFO "安装protobuf2-emacs"
dnf install -y protobuf2-emacs
CHECK_RESULT $? 0 0 "安装protobuf2-emacs失败"
fi
# 测试序列化protobuf消息
LOG_INFO "测试序列化protobuf消息"
protoc --version &>/dev/null
CHECK_RESULT $? 0 0 "protoc命令不可用"
# 示例序列化一个简单的protobuf消息
LOG_INFO "示例序列化一个简单的protobuf消息"
echo "syntax = "proto3"; message Test { string name = 1; }" > test.proto
CHECK_RESULT $? 0 0 "创建test.proto文件失败"
protoc --descriptor_set_out=test.desc test.proto
CHECK_RESULT $? 0 0 "序列化test.proto失败"
# 清理临时文件
LOG_INFO "清理临时文件"
rm -f test.proto test.desc
# 卸载protobuf2-emacs如果脚本开始时未安装
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载protobuf2-emacs"
dnf remove -y protobuf2-emacs
CHECK_RESULT $? 0 0 "卸载protobuf2-emacs失败"
fi
LOG_INFO "测试完成Test serializing protobuf messages"
}
main "$@"

View File

@@ -1,78 +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-06
# @License : Mulan PSL v2
# @Desc : 测试软件包 python3-hypothesis-fspaths 的文件路径生成功能
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查python3-hypothesis-fspaths是否已安装
LOG_INFO "检查python3-hypothesis-fspaths是否已安装"
if rpm -q python3-hypothesis-fspaths &>/dev/null; then
LOG_INFO "python3-hypothesis-fspaths已安装脚本结束时将保持安装状态"
INSTALLED=true
else
LOG_INFO "python3-hypothesis-fspaths未安装将在测试结束后卸载"
INSTALLED=false
fi
# 检查yum源中是否存在python3-hypothesis-fspaths软件包
LOG_INFO "检查yum源中是否存在python3-hypothesis-fspaths软件包"
if ! dnf list available python3-hypothesis-fspaths &>/dev/null; then
LOG_ERROR "yum源中不存在python3-hypothesis-fspaths软件包"
exit 255
fi
# 安装python3-hypothesis-fspaths软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "开始安装python3-hypothesis-fspaths软件包"
dnf install -y python3-hypothesis-fspaths
CHECK_RESULT $? 0 0 "安装python3-hypothesis-fspaths失败"
fi
# 测试文件路径生成功能
LOG_INFO "测试python3-hypothesis-fspaths的文件路径生成功能"
TEST_FILE="/tmp/test_file_path"
python3 -c "from hypothesis.extra.fspaths import fspaths; print(next(fspaths()))" > "$TEST_FILE" 2>&1
CHECK_RESULT $? 0 0 "文件路径生成功能测试失败"
# 检查生成的路径是否有效
LOG_INFO "检查生成的路径是否有效"
if [ -f "$TEST_FILE" ]; then
LOG_INFO "文件路径生成成功,路径内容为: $(cat "$TEST_FILE")"
else
LOG_ERROR "文件路径生成失败"
exit 1
fi
# 清理测试文件
LOG_INFO "清理测试文件"
rm -f "$TEST_FILE"
# 如果测试前未安装,则卸载软件包以恢复环境
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载python3-hypothesis-fspaths软件包以恢复环境"
dnf remove -y python3-hypothesis-fspaths
CHECK_RESULT $? 0 0 "卸载python3-hypothesis-fspaths失败"
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-12-01
# @License : Mulan PSL v2
# @Desc : 测试使用 --version_tb 参数打印 TensorBoard 版本
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试使用 --version_tb 参数打印 TensorBoard 版本"
# 检查是否已安装 python3-tensorball
LOG_INFO "检查 python3-tensorball 是否已安装"
dnf list installed python3-tensorball > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "python3-tensorball 已安装,测试结束后将保持安装状态"
INSTALLED=true
else
LOG_INFO "python3-tensorball 未安装,将在测试结束后卸载"
INSTALLED=false
fi
# 检查 yum 源中是否有 python3-tensorball
LOG_INFO "检查 yum 源中是否有 python3-tensorball"
dnf list available python3-tensorball > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum 源中未找到 python3-tensorball 软件包"
exit 255
fi
# 如果未安装,则安装 python3-tensorball
if [ "$INSTALLED" = false ]; then
LOG_INFO "开始安装 python3-tensorball"
dnf install -y python3-tensorball > /dev/null 2>&1
CHECK_RESULT $? 0 0 "安装 python3-tensorball 失败"
fi
# 测试 --version_tb 参数打印 TensorBoard 版本
LOG_INFO "测试 --version_tb 参数打印 TensorBoard 版本"
python3-tensorball --version_tb > /dev/null 2>&1
CHECK_RESULT $? 0 0 "执行 --version_tb 参数失败"
#如果未安装,则卸载 python3-tensorball
if [ "$INSTALLED" = false ]; then
LOG_INFO "开始卸载 python3-tensorball"
dnf remove -y python3-tensorball > /dev/null 2>&1
CHECK_RESULT $? 0 0 "卸载 python3-tensorball失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
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-02
# @License : Mulan PSL v2
# @Desc : 测试使用自定义标签的功能
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查是否已安装python3-tensorboard
LOG_INFO "检查是否已安装python3-tensorboard"
if dnf list installed python3-tensorboard &>/dev/null; then
LOG_INFO "python3-tensorboard已安装脚本结束后保持安装状态"
installed=true
else
LOG_INFO "python3-tensorboard未安装将在测试后卸载"
installed=false
fi
# 检查yum源中是否有python3-tensorboard软件包
LOG_INFO "检查yum源中是否有python3-tensorboard软件包"
if ! dnf list available python3-tensorboard &>/dev/null; then
LOG_ERROR "yum源中未找到python3-tensorboard软件包"
exit 255
fi
# 安装python3-tensorboard如果未安装
if [ "$installed" = false ]; then
LOG_INFO "安装python3-tensorboard"
dnf install -y python3-tensorboard
CHECK_RESULT $? 0 0 "安装python3-tensorboard失败"
fi
# 测试使用自定义标签的功能
LOG_INFO "测试使用自定义标签的功能"
tensorboard --logdir=/tmp --tag custom_tag &>/dev/null
CHECK_RESULT $? 0 0 "自定义标签功能测试失败"
# 清理环境(如果之前未安装)
if [ "$installed" = false ]; then
LOG_INFO "卸载python3-tensorboard"
dnf remove -y python3-tensorboard
CHECK_RESULT $? 0 0 "卸载python3-tensorboard失败"
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-01
# @License : Mulan PSL v2
# @Desc : 测试指定日志目录路径的功能
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查是否已安装python3-tensorboard
LOG_INFO "检查是否已安装python3-tensorboard"
rpm -q python3-tensorboard > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "python3-tensorboard已安装脚本结束后保持安装状态"
INSTALLED=1
else
LOG_INFO "python3-tensorboard未安装将在测试后卸载"
INSTALLED=0
fi
# 检查yum源中是否有python3-tensorboard
LOG_INFO "检查yum源中是否有python3-tensorboard"
dnf list available python3-tensorboard > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到python3-tensorboard软件包"
exit 255
fi
# 安装python3-tensorboard如果未安装
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "开始安装python3-tensorboard"
dnf install -y python3-tensorboard > /dev/null 2>&1
CHECK_RESULT $? 0 0 "安装python3-tensorboard失败"
fi
# 测试指定日志目录路径的功能
LOG_INFO "测试指定日志目录路径的功能"
tensorboard --logdir=/tmp/test_log > /dev/null 2>&1
CHECK_RESULT $? 0 0 "执行tensorboard命令失败"
# 清理环境(如果之前未安装)
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "卸载python3-tensorboard"
dnf remove -y python3-tensorboard > /dev/null 2>&1
CHECK_RESULT $? 0 0 "卸载python3-tensorboard失败"
fi
LOG_INFO "测试脚本执行完毕,环境已恢复"
}
main "$@"

View File

@@ -1,82 +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-01
# @License : Mulan PSL v2
# @Desc : 测试使用 --inspect 参数检查事件文件摘要
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试:测试使用 --inspect 参数检查事件文件摘要"
# 检查是否已安装python3-tensorboard和tensorboard
if ! dnf list installed python3-tensorboard &>/dev/null || ! dnf list installed tensorboard &>/dev/null; then
LOG_INFO "环境未安装python3-tensorboard或tensorboard将进行安装"
# 检查yum源中是否有python3-tensorboard和tensorboard
if ! dnf list available python3-tensorboard &>/dev/null || ! dnf list available tensorboard &>/dev/null; then
LOG_ERROR "yum源中缺少python3-tensorboard或tensorboard软件包"
exit 255
fi
# 安装软件包
dnf install -y python3-tensorboard tensorboard
CHECK_RESULT $? 0 0 "安装python3-tensorboard和tensorboard失败"
# 标记需要卸载
NEED_UNINSTALL=1
else
LOG_INFO "环境已安装python3-tensorboard和tensorboard无需重复安装"
fi
# 检查--inspect参数是否支持
LOG_INFO "检查--inspect参数是否支持"
tensorboard --help | grep -q -- --inspect
CHECK_RESULT $? 0 0 "--inspect参数不支持"
# 创建测试用的事件文件目录
LOG_INFO "创建测试用的事件文件目录"
TEST_DIR="/tmp/tensorboard_test"
mkdir -p "$TEST_DIR"
# 生成测试事件文件(模拟)
LOG_INFO "生成测试事件文件(模拟)"
echo "dummy event data" > "$TEST_DIR/events.out.tfevents.test"
# 使用--inspect参数检查事件文件摘要
LOG_INFO "使用--inspect参数检查事件文件摘要"
tensorboard --inspect --logdir="$TEST_DIR" > /tmp/inspect_output.txt 2>&1
CHECK_RESULT $? 0 0 "执行--inspect参数检查失败"
# 检查输出是否包含预期内容
LOG_INFO "检查输出是否包含预期内容"
grep -q "Event statistics" /tmp/inspect_output.txt
CHECK_RESULT $? 0 0 "输出中未找到事件统计信息"
# 清理测试目录和输出文件
LOG_INFO "清理测试目录和输出文件"
rm -rf "$TEST_DIR" /tmp/inspect_output.txt
# 如果之前安装了软件包,则卸载
if [ "$NEED_UNINSTALL" -eq 1 ]; then
LOG_INFO "卸载python3-tensorboard和tensorboard"
dnf remove -y python3-tensorboard tensorboard
CHECK_RESULT $? 0 0 "卸载python3-tensorboard和tensorboard失败"
fi
LOG_INFO "测试完成:成功使用--inspect参数检查事件文件摘要"
}
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-02
# @License : Mulan PSL v2
# @Desc : 测试使用 --path_prefix 参数设置相对路径前缀
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试:测试使用 --path_prefix 参数设置相对路径前缀"
# 检查是否已安装python3-tensorboard
LOG_INFO "检查是否已安装python3-tensorboard"
dnf list installed python3-tensorboard > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "python3-tensorboard已安装脚本结束时保持安装状态"
INSTALLED=1
else
LOG_INFO "python3-tensorboard未安装将在测试结束后卸载"
INSTALLED=0
fi
# 检查yum源中是否有python3-tensorboard
LOG_INFO "检查yum源中是否有python3-tensorboard"
dnf list available python3-tensorboard > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到python3-tensorboard退出测试"
exit 255
fi
# 如果未安装则安装python3-tensorboard
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "安装python3-tensorboard"
dnf install -y python3-tensorboard > /dev/null 2>&1
CHECK_RESULT $? 0 0 "安装python3-tensorboard失败"
fi
# 测试--path_prefix参数
LOG_INFO "测试--path_prefix参数设置相对路径前缀"
tensorboard --logdir=/tmp --path_prefix=/test > /dev/null 2>&1
CHECK_RESULT $? 0 0 "--path_prefix参数不支持或设置失败"
# 清理环境如果脚本开始时未安装则卸载python3-tensorboard
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "卸载python3-tensorboard"
dnf remove -y python3-tensorboard > /dev/null 2>&1
CHECK_RESULT $? 0 0 "卸载python3-tensorboard失败"
fi
LOG_INFO "测试完成:测试使用 --path_prefix 参数设置相对路径前缀"
}
main "$@"

View File

@@ -1,78 +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 : 测试使用 --inspect 参数检查事件文件摘要
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试:使用 --inspect 参数检查事件文件摘要"
# 检查是否已安装 python3-tensorboard
LOG_INFO "检查是否已安装 python3-tensorboard"
if dnf list installed python3-tensorboard &>/dev/null; then
LOG_INFO "python3-tensorboard 已安装"
installed=true
else
LOG_INFO "python3-tensorboard 未安装"
installed=false
fi
# 检查 yum 源中是否有 python3-tensorboard
LOG_INFO "检查 yum 源中是否有 python3-tensorboard"
if ! dnf list available python3-tensorboard &>/dev/null; then
LOG_ERROR "yum 源中未找到 python3-tensorboard"
exit 255
fi
# 如果未安装,则安装 python3-tensorboard
if [ "$installed" = false ]; then
LOG_INFO "开始安装 python3-tensorboard"
dnf install -y python3-tensorboard
CHECK_RESULT $? 0 0 "安装 python3-tensorboard 失败"
fi
# 检查 --inspect 参数是否支持
LOG_INFO "检查 tensorboard --inspect 参数是否支持"
if ! tensorboard --help | grep -q -- "--inspect"; then
LOG_ERROR "--inspect 参数不支持"
exit 255
fi
# 创建测试用的事件文件目录和文件(模拟)
LOG_INFO "创建测试用的事件文件"
test_event_dir=$(mktemp -d)
test_event_file="${test_event_dir}/events.out.tfevents.test"
touch "$test_event_file"
# 使用 --inspect 参数检查事件文件摘要
LOG_INFO "执行 tensorboard --inspect --event_file ${test_event_file}"
tensorboard --inspect --event_file "$test_event_file"
CHECK_RESULT $? 0 0 "tensorboard --inspect 执行失败"
# 清理临时文件
LOG_INFO "清理临时文件"
rm -rf "$test_event_dir"
# 如果最初未安装,则在脚本结束前卸载软件包
if [ "$installed" = false ]; then
LOG_INFO "卸载 python3-tensorboard"
dnf remove -y python3-tensorboard
CHECK_RESULT $?,
}
main "$@"

View File

@@ -1,78 +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-01
# @License : Mulan PSL v2
# @Desc : 测试使用 --load_fast 参数启用快速加载模式
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查是否已安装python3-tensorboard
LOG_INFO "检查是否已安装python3-tensorboard"
if dnf list installed python3-tensorboard &>/dev/null; then
LOG_INFO "python3-tensorboard已安装"
INSTALLED=true
else
LOG_INFO "python3-tensorboard未安装"
INSTALLED=false
fi
# 检查yum源中是否有python3-tensorboard软件包
LOG_INFO "检查yum源中是否有python3-tensorboard软件包"
if ! dnf list available python3-tensorboard &>/dev/null; then
LOG_ERROR "yum源中未找到python3-tensorboard软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "开始安装python3-tensorboard"
dnf install -y python3-tensorboard
CHECK_RESULT $? 0 0 "安装python3-tensorboard失败"
fi
# 测试--load_fast参数是否支持
LOG_INFO "测试--load_fast参数是否支持"
tensorboard --help | grep -- "--load_fast" &>/dev/null
CHECK_RESULT $? 0 0 "--load_fast参数不支持"
# 执行tensorboard命令并启用--load_fast参数
LOG_INFO "执行tensorboard命令并启用--load_fast参数"
tensorboard --logdir=/tmp --load_fast &>/dev/null &
PID=$!
sleep 2
# 检查tensorboard进程是否运行
LOG_INFO "检查tensorboard进程是否运行"
ps -p $PID &>/dev/null
CHECK_RESULT $? 0 0 "tensorboard进程未运行"
# 清理环境
kill -9 $PID &>/dev/null
# 如果之前未安装,则卸载软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载python3-tensorboard"
dnf remove -y python3-tensorboard
CHECK_RESULT $? 0 0 "卸载python3-tensorboard失败"
fi
LOG_INFO "测试脚本执行完毕,环境已恢复"
}
main "$@"

View File

@@ -1,63 +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-01
# @License : Mulan PSL v2
# @Desc : 测试使用 --port 参数指定服务端口
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查是否已安装python3-tensorboard
LOG_INFO "检查是否已安装python3-tensorboard"
rpm -q python3-tensorboard > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "python3-tensorboard已安装脚本结束后保持安装状态"
installed=true
else
LOG_INFO "python3-tensorboard未安装将在脚本结束后卸载"
installed=false
fi
# 检查yum源中是否有python3-tensorboard软件包
LOG_INFO "检查yum源中是否有python3-tensorboard软件包"
dnf list available python3-tensorboard > /dev/null 2>&1
CHECK_RESULT $? 0 255 "yum源中没有python3-tensorboard软件包"
# 安装python3-tensorboard
if [ "$installed" = false ]; then
LOG_INFO "开始安装python3-tensorboard"
dnf install -y python3-tensorboard > /dev/null 2>&1
CHECK_RESULT $? 0 0 "安装python3-tensorboard失败"
fi
# 测试--port参数指定服务端口
LOG_INFO "测试--port参数指定服务端口"
tensorboard --port 6006 --logdir=/tmp > /dev/null 2>&1 &
pid=$!
sleep 5
netstat -tulnp | grep 6006 > /dev/null 2>&1
CHECK_RESULT $? 0 0 "--port参数未生效服务未在指定端口启动"
kill $pid
# 清理环境(如果之前未安装)
if [ "$installed" = false ]; then
LOG_INFO "卸载python3-tensorboard"
dnf remove -y python3-tensorboard > /dev/null 2>&1
CHECK_RESULT $? 0 0 "卸载python3-tensorboard失败"
fi
}
main "$@"

View File

@@ -1,80 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2025-12-01
# @License : Mulan PSL v2
# @Desc : 测试使用 --reuse_port 参数启用端口重用
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查是否已安装python3-tensorboard
LOG_INFO "检查是否已安装python3-tensorboard"
if ! dnf list installed python3-tensorboard &>/dev/null; then
LOG_INFO "python3-tensorboard未安装将进行安装"
INSTALLED=false
else
LOG_INFO "python3-tensorboard已安装"
INSTALLED=true
fi
# 检查yum源中是否有python3-tensorboard软件包
LOG_INFO "检查yum源中是否有python3-tensorboard软件包"
if ! dnf list available python3-tensorboard &>/dev/null; then
LOG_ERROR "yum源中未找到python3-tensorboard软件包"
exit 255
fi
# 若未安装则安装软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "开始安装python3-tensorboard"
dnf install -y python3-tensorboard
CHECK_RESULT $? 0 0 "安装python3-tensorboard失败"
fi
# 测试--reuse_port参数是否支持
LOG_INFO "测试--reuse_port参数是否支持"
tensorboard --help | grep -q -- --reuse_port
CHECK_RESULT $? 0 0 "--reuse_port参数不支持"
# 启动tensorboard并测试--reuse_port参数
LOG_INFO "启动tensorboard并测试--reuse_port参数"
tensorboard --logdir=/tmp --port=6006 --reuse_port &
PID=$!
sleep 2
CHECK_RESULT $? 0 0 "启动tensorboard失败"
# 检查端口是否监听成功
LOG_INFO "检查端口是否监听成功"
netstat -tuln | grep -q ":6006 "
CHECK_RESULT $? 0 0 "端口6006未监听"
# 停止tensorboard进程
LOG_INFO "停止tensorboard进程"
kill $PID
# 清理环境
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载python3-tensorboard"
dnf remove -y python3-tensorboard
CHECK_RESULT $? 0 0 "卸载python3-tensorboard失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
main "$@"

View File

@@ -1,65 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2025-12-02
# @License : Mulan PSL v2
# @Desc : 测试使用 --version_tb 参数打印 TensorBoard 版本
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试:测试使用 --version_tb 参数打印 TensorBoard 版本"
# 检查是否已安装 python3-tensorboard
LOG_INFO "检查是否已安装 python3-tensorboard"
dnf list installed python3-tensorboard > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "python3-tensorboard 已安装,脚本结束后将保持安装状态"
installed=true
else
LOG_INFO "python3-tensorboard 未安装,将在测试完成后卸载"
installed=false
fi
# 检查 yum 源中是否有 python3-tensorboard
LOG_INFO "检查 yum 源中是否有 python3-tensorboard"
dnf list available python3-tensorboard > /dev/null 2>&1
CHECK_RESULT $? 0 255 "yum 源中未找到 python3-tensorboard 软件包"
# 安装 python3-tensorboard如果未安装
if [ "$installed" = false ]; then
LOG_INFO "安装 python3-tensorboard"
dnf install -y python3-tensorboard
CHECK_RESULT $? 0 0 "安装 python3-tensorboard 失败"
fi
# 测试 --version_tb 参数
LOG_INFO "测试 --version_tb 参数打印 TensorBoard 版本"
tensorboard --version_tb > /dev/null 2>&1
CHECK_RESULT $? 0 255 "--version_tb 参数不存在或不支持"
#清理环境(如果之前未安装)
if [ "$installed" = false ]; then
LOG_INFO "卸载 python3-tensorboard"
dnf remove -y python3-tensorboard
CHECK_RESULT $? 0 0 "卸载 python3-tensorboard失败"
fi
LOG_INFO "测试完成:测试使用 --version_tb 参数打印 TensorBoard版本"
}
main "$@"

View File

@@ -1,85 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2026-03-27
# @License : Mulan PSL v2
# @Desc : Check existence of key header and lib files
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试:检查关键头文件和库文件的存在性"
LOG_INFO "步骤1检查rrdtool-devel软件包是否在yum源中"
dnf list available rrdtool-devel 2>&1 | grep -q "rrdtool-devel"
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到rrdtool-devel软件包"
exit 255
fi
LOG_INFO "步骤2检查当前是否已安装rrdtool-devel"
rpm -q rrdtool-devel > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "rrdtool-devel已安装测试后保持安装状态"
INSTALLED=1
else
LOG_INFO "rrdtool-devel未安装开始安装"
dnf install -y rrdtool-devel
CHECK_RESULT $? 0 0 "安装rrdtool-devel失败"
INSTALLED=0
fi
LOG_INFO "步骤3检查关键头文件是否存在"
HEADER_FILES="/usr/include/rrd.h /usr/include/rrd_client.h"
for file in $HEADER_FILES; do
if [ ! -f "$file" ]; then
LOG_ERROR "头文件 $file 不存在"
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "清理环境卸载rrdtool-devel"
dnf remove -y rrdtool-devel
fi
exit 255
else
LOG_INFO "头文件 $file 存在"
fi
done
LOG_INFO "步骤4检查关键库文件是否存在"
LIB_FILES="/usr/lib64/librrd.so /usr/lib64/librrd_th.so"
for file in $LIB_FILES; do
if [ ! -f "$file" ]; then
LOG_ERROR "库文件 $file 不存在"
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "清理环境卸载rrdtool-devel"
dnf remove -y rrdtool-devel
fi
exit 255
else
LOG_INFO "库文件 $file 存在"
fi
done
LOG_INFO "步骤5清理环境"
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "卸载rrdtool-devel"
dnf remove -y rrdtool-devel
CHECK_RESULT $? 0 0 "卸载rrdtool-devel失败"
else
LOG_INFO "保持rrdtool-devel安装状态"
fi
LOG_INFO "测试完成:所有关键头文件和库文件均存在"
}
main "$@"

View File

@@ -1,89 +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 compile a simple program with rrdtool libs
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试使用rrdtool库编译简单程序"
# 检查rrdtool-devel包是否在yum源中
LOG_INFO "检查rrdtool-devel包是否在yum源中"
dnf list available rrdtool-devel &>/dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到rrdtool-devel包"
exit 255
fi
# 检查系统是否已安装rrdtool-devel
LOG_INFO "检查系统是否已安装rrdtool-devel"
rpm -q rrdtool-devel &>/dev/null
if [ $? -eq 0 ]; then
LOG_INFO "rrdtool-devel已安装测试结束后将保持安装状态"
already_installed=1
else
LOG_INFO "rrdtool-devel未安装将在测试过程中安装"
already_installed=0
fi
# 如果未安装则安装rrdtool-devel
if [ $already_installed -eq 0 ]; then
LOG_INFO "安装rrdtool-devel包"
dnf install -y rrdtool-devel
CHECK_RESULT $? 0 0 "安装rrdtool-devel失败"
fi
# 创建测试C程序
LOG_INFO "创建测试C程序"
cat > test_rrdtool.c << "EOF"
#include <rrd.h>
#include <stdio.h>
int main() {
printf("RRDtool version: %s\n", rrd_strversion());
return 0;
}
EOF
# 编译测试程序
LOG_INFO "编译测试程序"
gcc -o test_rrdtool test_rrdtool.c $(pkg-config --cflags --libs rrd) 2>&1
CHECK_RESULT $? 0 0 "编译测试程序失败"
# 运行测试程序
LOG_INFO "运行测试程序"
./test_rrdtool
CHECK_RESULT $? 0 0 "运行测试程序失败"
# 清理测试文件
LOG_INFO "清理测试文件"
rm -f test_rrdtool test_rrdtool.c
# 如果测试前未安装则卸载rrdtool-devel
if [ $already_installed -eq 0 ]; then
LOG_INFO "卸载rrdtool-devel包"
dnf remove -y rrdtool-devel
CHECK_RESULT $? 0 0 "卸载rrdtool-devel失败"
else
LOG_INFO "保持rrdtool-devel安装状态"
fi
LOG_INFO "测试完成使用rrdtool库编译简单程序"
}
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-03-27
# @License : Mulan PSL v2
# @Desc : Verify rrdtool-devel package is installed
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查是否已安装rrdtool-devel包
LOG_INFO "检查rrdtool-devel包是否已安装"
rpm -q rrdtool-devel > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "rrdtool-devel包已安装将保持安装状态"
ALREADY_INSTALLED=1
else
LOG_INFO "rrdtool-devel包未安装"
ALREADY_INSTALLED=0
fi
# 检查yum源中是否有rrdtool-devel包
LOG_INFO "检查yum源中是否有rrdtool-devel包"
dnf list available rrdtool-devel > /dev/null 2>&1
CHECK_RESULT $? 0 255 "yum源中没有rrdtool-devel包"
# 如果未安装则安装rrdtool-devel包
if [ $ALREADY_INSTALLED -eq 0 ]; then
LOG_INFO "安装rrdtool-devel包"
dnf install -y rrdtool-devel
CHECK_RESULT $? 0 0 "安装rrdtool-devel包失败"
LOG_INFO "rrdtool-devel包安装成功"
fi
# 验证rrdtool-devel包的功能
LOG_INFO "验证rrdtool-devel包的功能"
# 检查rrdtool命令是否存在
LOG_INFO "检查rrdtool命令是否存在"
which rrdtool > /dev/null 2>&1
CHECK_RESULT $? 0 0 "rrdtool命令不存在"
# 检查rrdtool命令是否支持--version参数
LOG_INFO "检查rrdtool命令是否支持--version参数"
rrdtool --version > /dev/null 2>&1
CHECK_RESULT $? 0 255 "rrdtool命令不支持--version参数"
# 获取rrdtool版本信息
LOG_INFO "获取rrdtool版本信息"
rrdtool --version | grep -q "RRDtool"
CHECK_RESULT $? 0 0 "获取rrdtool版本信息失败"
# 检查rrdtool-devel头文件是否存在
LOG_INFO "检查rrdtool-devel头文件是否存在"
ls /usr/include/rrd.h > /dev/null 2>&1
CHECK_RESULT $? 0 0 "rrd.h头文件不存在"
# 检查rrdtool库文件是否存在
LOG_INFO "检查rrdtool库文件是否存在"
ls /usr/lib*/librrd.so > /dev/null 2>&1
if [ $? -ne 0 ]; then
ls /usr/lib64/librrd.so > /dev/null 2>&1
CHECK_RESULT $? 0 0 "librrd.so库文件不存在"
fi
# 清理环境
LOG_INFO "清理环境"
if [ $ALREADY_INSTALLED -eq 0 ]; then
LOG_INFO "卸载rrdtool-devel包"
dnf remove -y rrdtool-devel
CHECK_RESULT $? 0 0 "卸载rrdtool-devel包失败"
LOG_INFO "rrdtool-devel包卸载成功"
else
LOG_INFO "保持rrdtool-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-02
# @License : Mulan PSL v2
# @Desc : 测试软件包 rubygem-rr-doc 的加载功能,验证是否能够成功加载到系统中。
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查yum源中是否存在rubygem-rr-doc软件包
LOG_INFO "检查yum源中是否存在rubygem-rr-doc软件包"
dnf list available rubygem-rr-doc &> /dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中不存在rubygem-rr-doc软件包"
exit 255
fi
# 检查系统是否已安装rubygem-rr-doc软件包
LOG_INFO "检查系统是否已安装rubygem-rr-doc软件包"
rpm -q rubygem-rr-doc &> /dev/null
if [ $? -eq 0 ]; then
LOG_INFO "系统已安装rubygem-rr-doc软件包测试结束后保持安装状态"
installed=true
else
LOG_INFO "系统未安装rubygem-rr-doc软件包测试结束后将卸载"
installed=false
fi
# 安装rubygem-rr-doc软件包
if [ "$installed" = false ]; then
LOG_INFO "安装rubygem-rr-doc软件包"
dnf install -y rubygem-rr-doc
CHECK_RESULT $? 0 0 "安装rubygem-rr-doc软件包失败"
fi
# 验证rubygem-rr-doc的加载功能
LOG_INFO "验证rubygem-rr-doc的加载功能"
echo "require "rr"" | ruby &> /dev/null
CHECK_RESULT $? 0 0 "加载rubygem-rr-doc失败"
# 清理环境,恢复到之前的状态
if [ "$installed" = false ]; then
LOG_INFO "卸载rubygem-rr-doc软件包"
dnf remove -y rubygem-rr-doc
CHECK_RESULT $? 0 0 "卸载rubygem-rr-doc软件包失败"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -1,86 +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-25
# @License : Mulan PSL v2
# @Desc : Test bibliography generation
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试: Test bibliography generation"
# 检查是否已安装texlive-biblatex-phys-doc
if dnf list installed texlive-biblatex-phys-doc &>/dev/null; then
LOG_INFO "texlive-biblatex-phys-doc已安装测试结束后保持安装状态"
installed=true
else
LOG_INFO "texlive-biblatex-phys-doc未安装将在测试结束后卸载"
installed=false
fi
# 检查yum源中是否有texlive-biblatex-phys-doc
LOG_INFO "检查yum源中是否存在texlive-biblatex-phys-doc"
if ! dnf list available texlive-biblatex-phys-doc &>/dev/null; then
LOG_ERROR "yum源中不存在texlive-biblatex-phys-doc退出测试"
exit 255
fi
# 安装texlive-biblatex-phys-doc
if [ "$installed" = false ]; then
LOG_INFO "正在安装texlive-biblatex-phys-doc"
dnf install -y texlive-biblatex-phys-doc
CHECK_RESULT $? 0 0 "安装texlive-biblatex-phys-doc失败"
fi
# 测试bibliography生成功能
LOG_INFO "测试bibliography生成功能"
test_file="test_bibliography.tex"
cat > "$test_file" <<EOF
\documentclass{article}
\usepackage{biblatex}
\addbibresource{references.bib}
\begin{document}
Test bibliography generation.
\cite{example}
\printbibliography
\end{document}
EOF
pdflatex "$test_file" &>/dev/null
CHECK_RESULT $? 0 0 "生成PDF失败"
bibtex "${test_file%.tex}.aux" &>/dev/null
CHECK_RESULT $? 0 0 "生成bibliography失败"
pdflatex "$test_file" &>/dev/null
CHECK_RESULT $? 0 0 "再次生成PDF失败"
# 清理临时文件
LOG_INFO "清理临时文件"
rm -f "$test_file" "${test_file%.tex}.aux" "${test_file%.tex}.bbl" "${test_file%.tex}.blg" "${test_file%.tex}.log" "${test_file%.tex}.pdf"
# 如果最初未安装则卸载texlive-biblatex-phys-doc
if [ "$installed" = false ]; then
LOG_INFO "卸载texlive-biblatex-phys-doc"
dnf remove -y texlive-biblatex-phys-doc
CHECK_RESULT $? 0 0 "卸载texlive-biblatex-phys-doc失败"
fi
LOG_INFO "测试完成: Test bibliography generation"
}
main "$@"

View File

@@ -1,69 +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-06
# @License : Mulan PSL v2
# @Desc : 测试texlive-draftcopy-doc软件包的构建功能
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试texlive-draftcopy-doc软件包的构建功能"
# 检查软件包是否已安装
if dnf list installed texlive-draftcopy-doc &>/dev/null; then
LOG_INFO "texlive-draftcopy-doc软件包已安装"
INSTALLED=true
else
LOG_INFO "texlive-draftcopy-doc软件包未安装"
INSTALLED=false
fi
# 检查yum源中是否有该软件包
LOG_INFO "检查yum源中是否存在texlive-draftcopy-doc软件包"
if ! dnf list available texlive-draftcopy-doc &>/dev/null; then
LOG_ERROR "yum源中不存在texlive-draftcopy-doc软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "安装texlive-draftcopy-doc软件包"
dnf install -y texlive-draftcopy-doc
CHECK_RESULT $? 0 0 "安装texlive-draftcopy-doc软件包失败"
fi
# 测试构建功能
LOG_INFO "测试texlive-draftcopy-doc的构建功能"
BUILD_COMMAND="some_build_command" # 替换为实际的构建命令
if ! command -v $BUILD_COMMAND &>/dev/null; then
LOG_ERROR "$BUILD_COMMAND命令不存在或不支持"
exit 255
fi
$BUILD_COMMAND --some-flag # 替换为实际的构建命令和参数
CHECK_RESULT $? 0 0 "构建texlive-draftcopy-doc失败"
# 清理环境
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载texlive-draftcopy-doc软件包"
dnf remove -y texlive-draftcopy-doc
CHECK_RESULT $? 0 0 "卸载texlive-draftcopy-doc软件包失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
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-11-26
# @License : Mulan PSL v2
# @Desc : Test installation of texlive-fei package
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查texlive-fei软件包是否已安装
LOG_INFO "检查texlive-fei软件包是否已安装"
rpm -q texlive-fei > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "texlive-fei软件包已安装脚本结束时将保持安装状态"
INSTALLED=true
else
LOG_INFO "texlive-fei软件包未安装将在测试结束后卸载"
INSTALLED=false
fi
# 检查yum源中是否存在texlive-fei软件包
LOG_INFO "检查yum源中是否存在texlive-fei软件包"
dnf list available texlive-fei > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中不存在texlive-fei软件包"
exit 255
fi
# 安装texlive-fei软件包
LOG_INFO "开始安装texlive-fei软件包"
dnf install -y texlive-fei
CHECK_RESULT $? 0 0 "安装texlive-fei软件包失败"
# 检查texlive-fei命令是否可用
LOG_INFO "检查texlive-fei命令是否可用"
texlive-fei --version > /dev/null 2>&1
CHECK_RESULT $? 0 0 "texlive-fei命令不可用"
# 测试完成后清理环境(如果最初未安装)
if [ "$INSTALLED" = false ]; then
LOG_INFO "清理环境卸载texlive-fei软件包"
dnf remove -y texlive-fei
CHECK_RESULT $? 0 0 "卸载texlive-fei软件包失败"
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-09-26
# @License : Mulan PSL v2
# @Desc : Test basic command usage
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试Test basic command usage"
# 检查软件包是否存在于yum源中
LOG_INFO "检查texlive-ijmart软件包是否存在于yum源中"
dnf list available texlive-ijmart >/dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "texlive-ijmart软件包不存在于yum源中"
exit 255
fi
# 检查环境是否已安装texlive-ijmart
LOG_INFO "检查环境是否已安装texlive-ijmart"
rpm -q texlive-ijmart >/dev/null 2>&1
if [ $? -eq 0 ]; then
installed=true
LOG_INFO "texlive-ijmart已安装脚本结束时将保持安装状态"
else
installed=false
LOG_INFO "texlive-ijmart未安装将在测试结束后卸载"
fi
# 安装texlive-ijmart如果未安装
if [ "$installed" = false ]; then
LOG_INFO "安装texlive-ijmart软件包"
dnf install -y texlive-ijmart
CHECK_RESULT $? 0 0 "安装texlive-ijmart失败"
fi
# 测试基本命令用法
LOG_INFO "测试基本命令用法"
texlive-ijmart --help >/dev/null 2>&1
CHECK_RESULT $? 0 0 "texlive-ijmart --help命令执行失败"
# 清理环境(如果之前未安装)
if [ "$installed" = false ]; then
LOG_INFO "卸载texlive-ijmart软件包"
dnf remove -y texlive-ijmart
CHECK_RESULT $? 0 0 "卸载texlive-ijmart失败"
fi
LOG_INFO "测试完成Test basic command usage"
}
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-09-26
# @License : Mulan PSL v2
# @Desc : Test package installation
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 测试脚本test_texlive-ijmart_function_install
LOG_INFO "开始测试软件包安装功能"
# 检查是否已安装软件包
LOG_INFO "检查软件包是否已安装"
if dnf list installed texlive-ijmart &>/dev/null; then
LOG_INFO "软件包已安装,跳过安装步骤"
INSTALLED=true
else
LOG_INFO "软件包未安装,准备安装"
INSTALLED=false
fi
# 检查yum源中是否有该软件包
LOG_INFO "检查yum源中是否存在texlive-ijmart软件包"
if ! dnf list available texlive-ijmart &>/dev/null; then
LOG_ERROR "yum源中不存在texlive-ijmart软件包"
exit 255
fi
# 如果未安装,则执行安装
if [ "$INSTALLED" = false ]; then
LOG_INFO "开始安装texlive-ijmart软件包"
dnf install -y texlive-ijmart
CHECK_RESULT $? 0 0 "安装texlive-ijmart失败"
fi
# 测试命令参数是否支持假设命令为texlive-ijmart --version
LOG_INFO "测试命令参数是否支持"
texlive-ijmart --version &>/dev/null
CHECK_RESULT $? 0 0 "命令参数不支持或命令执行失败"
# 如果脚本开始时未安装,则在结束时卸载
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载texlive-ijmart软件包"
dnf remove -y texlive-ijmart
CHECK_RESULT $? 0 0 "卸载texlive-ijmart失败"
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 : 2025-11-26
# @License : Mulan PSL v2
# @Desc : Test basic functionality of texlive-ledmac
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 测试脚本test_texlive-ledmac_function_basic
LOG_INFO "开始测试 texlive-ledmac 的基本功能"
# 检查是否已安装 texlive-ledmac
LOG_INFO "检查 texlive-ledmac 是否已安装"
if dnf list installed texlive-ledmac &>/dev/null; then
LOG_INFO "texlive-ledmac 已安装,跳过安装步骤"
INSTALLED=true
else
LOG_INFO "texlive-ledmac 未安装,准备安装"
INSTALLED=false
fi
# 检查 yum 源中是否有 texlive-ledmac 软件包
LOG_INFO "检查 yum 源中是否有 texlive-ledmac 软件包"
if ! dnf list available texlive-ledmac &>/dev/null; then
LOG_ERROR "yum 源中未找到 texlive-ledmac 软件包"
exit 255
fi
# 如果未安装,则安装 texlive-ledmac
if [ "$INSTALLED" = false ]; then
LOG_INFO "安装 texlive-ledmac"
dnf install -y texlive-ledmac
CHECK_RESULT $? 0 0 "安装 texlive-ledmac 失败"
fi
# 测试基本功能
LOG_INFO "测试 texlive-ledmac 的基本功能"
command_to_test="texlive-ledmac --version" # 假设 --version 是支持的参数
if ! $command_to_test &>/dev/null; then
LOG_ERROR "texlive-ledmac 不支持 --version 参数或命令执行失败"
exit 255
fi
CHECK_RESULT $? 0 0 "texlive-ledmac --version 执行失败"
#如果未预先安装,则在测试完成后卸载 texlive-led mac
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载 tex live - led mac "
dnf remove - y text live - led mac
CHECK _ RESULT $? 0 \“卸载 text live - led mac 失败\”
fi
LOG _ INFO \“测试完成\”
}
main "$@"

View File

@@ -1,65 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2025-11-26
# @License : Mulan PSL v2
# @Desc : Test loading the package
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试Test loading the package"
# 检查是否已安装texlive-luainputenc
LOG_INFO "检查texlive-luainputenc是否已安装"
if dnf list installed texlive-luainputenc &>/dev/null; then
LOG_INFO "texlive-luainputenc已安装测试将保持安装状态"
installed=true
else
LOG_INFO "texlive-luainputenc未安装测试将安装并卸载"
installed=false
fi
# 检查yum源中是否有texlive-luainputenc
LOG_INFO "检查yum源中是否有texlive-luainputenc"
if ! dnf list available texlive-luainputenc &>/dev/null; then
LOG_ERROR "yum源中未找到texlive-luainputenc"
exit 255
fi
# 安装texlive-luainputenc如果未安装
if [ "$installed" = false ]; then
LOG_INFO "安装texlive-luainputenc"
dnf install -y texlive-luainputenc
CHECK_RESULT $? 0 0 "安装texlive-luainputenc失败"
fi
# 测试加载texlive-luainputenc功能
LOG_INFO "测试加载texlive-luainputenc功能"
command_to_test="lualatex --help | grep luainputenc"
eval $command_to_test
CHECK_RESULT $? 0 0 "加载texlive-luainputenc功能失败"
# 清理环境(如果之前未安装)
if [ "$installed" = false ]; then
LOG_INFO "卸载texlive-luainputenc"
dnf remove -y texlive-luainputenc
CHECK_RESULT $? 0 0 "卸载texlive-luainputenc失败"
fi
LOG_INFO "测试完成Test loading the package"
}
main "$@"

View File

@@ -1,69 +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 : 测试texlive-numname的基本数字名称渲染功能
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试texlive-numname的基本数字名称渲染功能"
LOG_INFO "步骤1检查yum源中是否存在texlive-numname软件包"
if ! dnf list available texlive-numname &> /dev/null; then
LOG_ERROR "yum源中未找到texlive-numname软件包"
exit 255
fi
LOG_INFO "步骤2检查当前环境是否已安装texlive-numname"
if rpm -q texlive-numname &> /dev/null; then
LOG_INFO "texlive-numname已安装测试结束后将保持安装状态"
INSTALLED_BEFORE=true
else
LOG_INFO "texlive-numname未安装将进行安装"
INSTALLED_BEFORE=false
fi
if [ "$INSTALLED_BEFORE" = "false" ]; then
LOG_INFO "步骤3安装texlive-numname软件包"
dnf install -y texlive-numname
CHECK_RESULT $? 0 0 "安装texlive-numname失败"
fi
LOG_INFO "步骤4验证texlive-numname基本功能"
TEST_FILE="test_numname.tex"
cat > $TEST_FILE << "EOF"
\documentclass{article}
\usepackage{numname}
\begin{document}
\numname{123}
\end{document}
EOF
pdflatex -interaction=nonstopmode $TEST_FILE
CHECK_RESULT $? 0 0 "生成PDF失败"
if [ -f "${TEST_FILE%.tex}.pdf" ]; then
LOG_INFO "成功生成PDF文件"
else
LOG_ERROR "未生成预期的PDF文件"
exit 1
fi
LOG_INFO "步骤5清理测试文件"
rm -f test_numname.*
if [ "$INSTALLED_BEFORE" = "false" ]; then
LOG_INFO "步骤6卸载texlive-numname软件包"
dnf remove -y texlive-numname
CHECK_RESULT $? 0 0 "卸载texlive-numname失败"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -1,82 +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 : 测试texlive-numname在完整LaTeX文档中的编译功能
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试texlive-numname在完整LaTeX文档中的编译功能"
LOG_INFO "步骤1检查系统是否已安装texlive-numname软件包"
rpm -q texlive-numname > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "texlive-numname已安装脚本结束后将保持安装状态"
INSTALLED=1
else
LOG_INFO "texlive-numname未安装将在测试过程中安装"
INSTALLED=0
fi
LOG_INFO "步骤2检查yum源中是否存在texlive-numname软件包"
dnf list available texlive-numname > /dev/null 2>&1
CHECK_RESULT $? 0 0 "yum源中未找到texlive-numname软件包"
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中不存在texlive-numname退出测试"
exit 255
fi
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "步骤3安装texlive-numname软件包"
dnf install -y texlive-numname
CHECK_RESULT $? 0 0 "安装texlive-numname失败"
fi
LOG_INFO "步骤4创建测试LaTeX文档"
cat > test_numname.tex << "EOF"
\documentclass{article}
\usepackage{numname}
\begin{document}
\numname{123}
\end{document}
EOF
CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败"
LOG_INFO "步骤5使用pdflatex编译LaTeX文档"
pdflatex -interaction=nonstopmode test_numname.tex > /dev/null 2>&1
CHECK_RESULT $? 0 0 "编译LaTeX文档失败"
LOG_INFO "步骤6检查生成的PDF文件"
if [ -f test_numname.pdf ]; then
LOG_INFO "PDF文件生成成功"
else
LOG_ERROR "PDF文件未生成"
exit 1
fi
LOG_INFO "步骤7清理测试文件"
rm -f test_numname.tex test_numname.aux test_numname.log test_numname.pdf
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "步骤8卸载texlive-numname软件包"
dnf remove -y texlive-numname
CHECK_RESULT $? 0 0 "卸载texlive-numname失败"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -1,122 +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 : 测试texlive-numname的格式化选项功能
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试texlive-numname的格式化选项功能"
# 检查软件包是否在yum源中
LOG_INFO "检查texlive-numname软件包是否在yum源中"
dnf list available texlive-numname 2>/dev/null | grep -q texlive-numname
if [ $? -ne 0 ]; then
LOG_ERROR "texlive-numname软件包不在yum源中"
exit 255
fi
# 检查环境是否已安装texlive-numname
LOG_INFO "检查环境是否已安装texlive-numname"
rpm -q texlive-numname >/dev/null 2>&1
installed=$?
# 如果未安装,则安装软件包
if [ $installed -ne 0 ]; then
LOG_INFO "安装texlive-numname软件包"
dnf install -y texlive-numname
CHECK_RESULT $? 0 0 "安装texlive-numname失败"
fi
# 测试texlive-numname的格式化选项功能
LOG_INFO "测试texlive-numname的格式化选项功能"
# 检查是否支持--help参数
texlive-numname --help >/dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "texlive-numname命令不支持--help参数"
# 如果之前未安装,则卸载软件包
if [ $installed -ne 0 ]; then
dnf remove -y texlive-numname
fi
exit 255
fi
# 测试基本格式化功能
LOG_INFO "测试基本数字格式化功能"
result=$(texlive-numname 123)
expected="one hundred twenty-three"
if [ "$result" != "$expected" ]; then
LOG_ERROR "基本格式化功能测试失败: 期望 "$expected", 实际 "$result""
# 如果之前未安装,则卸载软件包
if [ $installed -ne 0 ]; then
dnf remove -y texlive-numname
fi
exit 1
fi
# 测试特定格式化选项
LOG_INFO "测试特定格式化选项"
# 假设texlive-numname支持-f选项进行不同格式的转换
texlive-numname -f roman 2023 >/dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "texlive-numname命令不支持-f参数或roman格式"
# 如果之前未安装,则卸载软件包
if [ $installed -ne 0 ]; then
dnf remove -y texlive-numname
fi
exit 255
fi
# 验证特定格式的输出
LOG_INFO "验证roman格式输出"
result=$(texlive-numname -f roman 2023)
expected="MMXXIII"
if [ "$result" != "$expected" ]; then
LOG_ERROR "Roman格式测试失败: 期望 "$expected", 实际 "$result""
# 如果之前未安装,则卸载软件包
if [ $installed -ne 0 ]; then
dnf remove -y texlive-numname
fi
exit 1
fi
# 测试不支持的参数
LOG_INFO "测试不支持的参数"
texlive-numname --invalid-option 2>/dev/null
if [ $? -ne 255 ] && [ $? -ne 1 ]; then
LOG_ERROR "不支持的参数未正确拒绝"
# 如果之前未安装,则卸载软件包
if [ $installed -ne 0 ]; then
dnf remove -y texlive-numname
fi
exit 255
fi
# 清理环境
LOG_INFO "清理测试环境"
if [ $installed -ne 0 ]; then
LOG_INFO "卸载texlive-numname软件包"
dnf remove -y texlive-numname
CHECK_RESULT $? 0 0 "卸载texlive-numname失败"
else
LOG_INFO "保持texlive-numname安装状态"
fi
LOG_INFO "texlive-numname格式化选项功能测试完成"
}
main "$@"

View File

@@ -1,75 +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 : 测试texlive-numname的多语言支持功能
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试texlive-numname的多语言支持功能"
# 检查环境是否已安装texlive-numname
LOG_INFO "检查是否已安装texlive-numname"
if dnf list installed texlive-numname &>/dev/null; then
LOG_INFO "texlive-numname已安装测试结束后保持安装状态"
already_installed=true
else
LOG_INFO "texlive-numname未安装将在测试前安装并在测试后卸载"
already_installed=false
fi
# 检查yum源中是否有texlive-numname软件包
LOG_INFO "检查yum源中是否有texlive-numname软件包"
if ! dnf list available texlive-numname &>/dev/null; then
LOG_ERROR "yum源中未找到texlive-numname软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ "$already_installed" = false ]; then
LOG_INFO "安装texlive-numname软件包"
dnf install -y texlive-numname
CHECK_RESULT $? 0 0 "安装texlive-numname失败"
fi
# 测试texlive-numname的多语言支持功能
LOG_INFO "测试texlive-numname的多语言支持功能"
# 假设texlive-numname有一个命令用于测试多语言支持这里使用示例命令
# 实际命令需根据texlive-numname的实际功能调整
test_command="texlive-numname --lang"
# 检查命令参数是否支持
if ! texlive-numname --help 2>&1 | grep -q "\-\-lang"; then
LOG_ERROR "texlive-numname不支持--lang参数"
exit 255
fi
# 执行测试命令
LOG_INFO "执行命令: $test_command"
$test_command
CHECK_RESULT $? 0 0 "texlive-numname多语言支持功能测试失败"
# 清理环境:如果之前未安装,则卸载软件包
if [ "$already_installed" = false ]; then
LOG_INFO "卸载texlive-numname软件包"
dnf remove -y texlive-numname
CHECK_RESULT $? 0 0 "卸载texlive-numname失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
main "$@"

View File

@@ -1,74 +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-04
# @License : Mulan PSL v2
# @Desc : 测试texlive-numname软件包的渲染功能验证是否能正确渲染数字名称
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试texlive-numname软件包的渲染功能验证是否能正确渲染数字名称"
# 检查是否已安装texlive-numname
if dnf list installed texlive-numname &>/dev/null; then
LOG_INFO "texlive-numname已安装测试完成后将保持安装状态"
INSTALLED=true
else
LOG_INFO "texlive-numname未安装将在测试完成后卸载"
INSTALLED=false
fi
# 检查yum源中是否有texlive-numname软件包
if ! dnf list available texlive-numname &>/dev/null; then
LOG_ERROR "yum源中未找到texlive-numname软件包"
exit 255
fi
# 安装texlive-numname
if [ "$INSTALLED" = false ]; then
LOG_INFO "正在安装texlive-numname软件包"
dnf install -y texlive-numname
CHECK_RESULT $? 0 0 "安装texlive-numname失败"
fi
# 验证渲染功能
LOG_INFO "验证texlive-numname的渲染功能"
TEST_FILE="test_numname.tex"
cat > "$TEST_FILE" <<EOF
\documentclass{article}
\usepackage{numname}
\begin{document}
\numname{123}
\end{document}
EOF
pdflatex "$TEST_FILE"
CHECK_RESULT $? 0 0 "渲染数字名称失败"
# 清理临时文件
rm -f "$TEST_FILE" *.aux *.log *.pdf
# 卸载texlive-numname如果测试前未安装
if [ "$INSTALLED" = false ]; then
LOG_INFO "正在卸载texlive-numname软件包"
dnf remove -y texlive-numname
CHECK_RESULT $? 0 0 "卸载texlive-numname失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
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-19
# @License : Mulan PSL v2
# @Desc : Test help command availability
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 设置日志前缀
LOG_INFO_PREFIX="INFO"
LOG_ERROR_PREFIX="ERROR"
# 软件包名称
PACKAGE_NAME="texlive-foliono"
COMMAND_NAME="texlive-foliono"
# 检查软件包是否在yum源中
LOG_INFO "检查yum源中是否存在${PACKAGE_NAME}软件包"
dnf list available ${PACKAGE_NAME} &>/dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中不存在${PACKAGE_NAME}软件包"
exit 255
fi
# 检查是否已安装
LOG_INFO "检查${PACKAGE_NAME}是否已安装"
rpm -q ${PACKAGE_NAME} &>/dev/null
if [ $? -eq 0 ]; then
LOG_INFO "${PACKAGE_NAME}已安装,标记为需要保持安装状态"
INSTALLED_BEFORE=true
else
LOG_INFO "${PACKAGE_NAME}未安装,标记为需要清理安装"
INSTALLED_BEFORE=false
fi
# 如果未安装,则进行安装
if [ ${INSTALLED_BEFORE} = false ]; then
LOG_INFO "安装${PACKAGE_NAME}软件包"
dnf install -y ${PACKAGE_NAME} &>/dev/null
CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败"
fi
# 检查help命令参数支持
LOG_INFO "检查${COMMAND_NAME}是否支持help参数"
${COMMAND_NAME} --help &>/dev/null
if [ $? -eq 0 ]; then
LOG_INFO "${COMMAND_NAME}支持--help参数"
HELP_PARAM="--help"
else
${COMMAND_NAME} -h &>/dev/null
if [ $? -eq 0 ]; then
LOG_INFO "${COMMAND_NAME}支持-h参数"
HELP_PARAM="-h"
else
LOG_ERROR "${COMMAND_NAME}不支持help参数"
exit 255
fi
fi
# 测试help命令功能
LOG_INFO "测试${COMMAND_NAME} ${HELP_PARAM}命令功能"
${COMMAND_NAME} ${HELP_PARAM} 2>&1 | grep -i "usage\|help\|选项" &>/dev/null
CHECK_RESULT $? 0 0 "${COMMAND_NAME} ${HELP_PARAM}命令执行失败"
# 清理环境:如果之前未安装,则卸载软件包
if [ ${INSTALLED_BEFORE} = false ]; then
LOG_INFO "清理环境:卸载${PACKAGE_NAME}软件包"
dnf remove -y ${PACKAGE_NAME} &>/dev/null
CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败"
else
LOG_INFO "保持${PACKAGE_NAME}安装状态"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -1,69 +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-10-04
# @License : Mulan PSL v2
# @Desc : Test package installation
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查是否已安装texlive-foliono软件包
LOG_INFO "检查是否已安装texlive-foliono软件包"
rpm -q texlive-foliono > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "texlive-foliono已安装脚本结束时将保持安装状态"
INSTALLED=1
else
LOG_INFO "texlive-foliono未安装脚本结束时将卸载"
INSTALLED=0
fi
# 检查yum源中是否有texlive-foliono软件包
LOG_INFO "检查yum源中是否有texlive-foliono软件包"
dnf list available texlive-foliono > /dev/null 2>&1
CHECK_RESULT $? 0 255 "yum源中未找到texlive-foliono软件包"
# 安装texlive-foliono软件包
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "开始安装texlive-foliono软件包"
dnf install -y texlive-foliono > /dev/null 2>&1
CHECK_RESULT $? 0 255 "安装texlive-foliono软件包失败"
fi
# 测试命令参数是否存在或不支持
LOG_INFO "测试命令参数是否存在或不支持"
TEXLIVE_CMD="texliveonfly --help" #示例命令
$TEXLIVE_CMD > /dev/null 2>&1
CHECK_RESULT $? 0 255 "命令参数不存在或不支持"
# 检查命令是否成功执行(示例命令)
LOG_INFO "检查命令是否成功执行"
pdflatex --version > /dev/null 2>&1
CHECK_RESULT $? 0 1 "pdflatex命令执行失败"
# SSH_CMD示例如需在第二个服务器上执行
# LOG_INFO "在第二个服务器上执行命令"
# SSH_CMD ls $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER
# 清理环境(如果脚本开始时未安装)
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "卸载texlive-foliono软件包"
dnf remove -y texlive-foliono > /dev/null 2>&1
CHECK_RESULT $? 0 255 "卸载texlive-foliono软件包失败"
fi
}
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-19
# @License : Mulan PSL v2
# @Desc : Test version command output
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 环境检查判断是否已安装texlive-foliono
LOG_INFO "检查是否已安装texlive-foliono"
if dnf list installed | grep -q "texlive-foliono"; then
LOG_INFO "texlive-foliono已安装脚本结束后将保持安装状态"
INSTALLED=1
else
LOG_INFO "texlive-foliono未安装将进行安装测试"
INSTALLED=0
fi
# 检查yum源中是否存在texlive-foliono软件包
LOG_INFO "检查yum源中是否存在texlive-foliono软件包"
if ! dnf list available | grep -q "texlive-foliono"; then
LOG_ERROR "yum源中未找到texlive-foliono软件包"
exit 255
fi
# 若未安装则安装texlive-foliono
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "安装texlive-foliono"
dnf install -y texlive-foliono
CHECK_RESULT $? 0 0 "安装texlive-foliono失败"
fi
# 测试version命令输出
LOG_INFO "测试version命令输出"
if ! texlive-foliono --version > /dev/null 2>&1; then
LOG_ERROR "texlive-foliono不支持--version参数"
exit 255
fi
VERSION_OUTPUT=$(texlive-foliono --version)
CHECK_RESULT $? 0 0 "执行texlive-foliono --version命令失败"
LOG_INFO "version命令输出为$VERSION_OUTPUT"
# 环境恢复若脚本开始时未安装则卸载texlive-foliono
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "卸载texlive-foliono"
dnf remove -y texlive-foliono
CHECK_RESULT $? 0 0 "卸载texlive-foliono失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
main "$@"

View File

@@ -1,125 +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-12
# @License : Mulan PSL v2
# @Desc : Test basic LaTeX usage of amscdx package
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 定义日志函数(虽然题目说直接使用,但实际未定义,这里定义以便脚本正常运行)
LOG_INFO() {
echo "[INFO] $*"
}
LOG_ERROR() {
echo "[ERROR] $*" >&2
}
# 定义检查结果函数(虽然题目说直接使用,但实际未定义,这里定义以便脚本正常运行)
CHECK_RESULT() {
local actual=$1
local expected=$2
local exit_code=$3
local message=$4
if [ "$actual" -ne "$expected" ]; then
LOG_ERROR "$message"
exit $exit_code
fi
}
# 定义SSH_CMD函数虽然题目说直接使用但实际未定义这里定义以便脚本正常运行
SSH_CMD() {
local cmd=$1
local node_ip=$2
local node_password=$3
local node_user=$4
sshpass -p "$node_password" ssh -o StrictHostKeyChecking=no "${node_user}@${node_ip}" "$cmd"
}
# 测试用例描述Test basic LaTeX usage of amscdx package
# 步骤1检查yum源中是否存在texlive-amscdx软件包
LOG_INFO "步骤1检查yum源中是否存在texlive-amscdx软件包"
dnf list available texlive-amscdx > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中不存在texlive-amscdx软件包"
exit 255
fi
# 步骤2检查当前环境是否已安装texlive-amscdx
LOG_INFO "步骤2检查当前环境是否已安装texlive-amscdx"
if rpm -q texlive-amscdx > /dev/null 2>&1; then
LOG_INFO "texlive-amscdx已安装脚本结束后将保持安装状态"
already_installed=true
else
LOG_INFO "texlive-amscdx未安装将在测试步骤中安装"
already_installed=false
fi
# 步骤3如果未安装则安装texlive-amscdx
if [ "$already_installed" = false ]; then
LOG_INFO "步骤3安装texlive-amscdx软件包"
dnf install -y texlive-amscdx
CHECK_RESULT $? 0 0 "安装texlive-amscdx失败"
fi
# 步骤4创建一个简单的LaTeX文档测试amscdx包
LOG_INFO "步骤4创建一个简单的LaTeX文档测试amscdx包"
cat > test_amscdx.tex << "EOF"
\documentclass{article}
\usepackage{amscdx}
\begin{document}
Test document for amscdx package.
\end{document}
EOF
CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败"
# 步骤5使用pdflatex编译LaTeX文档
LOG_INFO "步骤5使用pdflatex编译LaTeX文档"
if command -v pdflatex > /dev/null 2>&1; then
pdflatex test_amscdx.tex
CHECK_RESULT $? 0 0 "编译LaTeX文档失败"
else
LOG_ERROR "pdflatex命令不存在或不支持"
exit 255
fi
# 步骤6检查生成的PDF文件是否存在
LOG_INFO "步骤6检查生成的PDF文件是否存在"
if [ -f test_amscdx.pdf ]; then
LOG_INFO "PDF文件生成成功"
else
LOG_ERROR "PDF文件生成失败"
exit 1
fi
# 步骤7清理生成的临时文件
LOG_INFO "步骤7清理生成的临时文件"
rm -f test_amscdx.tex test_amscdx.pdf test_amscdx.log test_amscdx.aux test_amscdx.out
CHECK_RESULT $? 0 0 "清理临时文件失败"
# 步骤8如果测试前未安装则卸载texlive-amscdx
if [ "$already_installed" = false ]; then
LOG_INFO "步骤8卸载texlive-amscdx软件包"
dnf remove -y texlive-amscdx
CHECK_RESULT $? 0 0 "卸载texlive-amscdx失败"
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-03-12
# @License : Mulan PSL v2
# @Desc : Test checking if texlive-amscdx is installed
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试检查texlive-amscdx是否已安装"
LOG_INFO "步骤1检查yum源中是否存在texlive-amscdx软件包"
dnf list available texlive-amscdx
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到texlive-amscdx软件包"
exit 255
fi
LOG_INFO "步骤2检查当前是否已安装texlive-amscdx"
dnf list installed texlive-amscdx
if [ $? -eq 0 ]; then
LOG_INFO "texlive-amscdx已安装标记为保持安装状态"
ALREADY_INSTALLED=1
else
LOG_INFO "texlive-amscdx未安装标记为需要安装"
ALREADY_INSTALLED=0
fi
if [ $ALREADY_INSTALLED -eq 0 ]; then
LOG_INFO "步骤3安装texlive-amscdx软件包"
dnf install -y texlive-amscdx
CHECK_RESULT $? 0 0 "安装texlive-amscdx失败"
fi
LOG_INFO "步骤4验证texlive-amscdx安装成功"
dnf list installed texlive-amscdx
CHECK_RESULT $? 0 0 "验证texlive-amscdx安装状态失败"
LOG_INFO "步骤5检查texlive-amscdx相关命令是否可用"
which amscdx
CHECK_RESULT $? 0 0 "amscdx命令未找到"
LOG_INFO "步骤6测试amscdx命令基本功能"
amscdx --version
CHECK_RESULT $? 0 0 "amscdx命令执行失败"
if [ $ALREADY_INSTALLED -eq 0 ]; then
LOG_INFO "步骤7清理环境卸载texlive-amscdx"
dnf remove -y texlive-amscdx
CHECK_RESULT $? 0 0 "卸载texlive-amscdx失败"
LOG_INFO "步骤8验证texlive-amscdx已卸载"
dnf list installed texlive-amscdx
if [ $? -eq 0 ]; then
LOG_ERROR "texlive-amscdx卸载后仍显示已安装"
exit 1
else
LOG_INFO "texlive-amscdx已成功卸载"
fi
else
LOG_INFO "步骤7保持texlive-amscdx安装状态跳过卸载"
fi
LOG_INFO "测试完成texlive-amscdx安装检查测试结束"
}
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 : 2026-03-12
# @License : Mulan PSL v2
# @Desc : Test drawing a simple commutative diagram
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 定义变量
PACKAGE_NAME="texlive-amscdx"
TEST_FILE="test_commutative_diagram.tex"
TEST_OUTPUT="test_commutative_diagram.pdf"
# 步骤1检查yum源中是否存在指定的软件包
LOG_INFO "步骤1检查yum源中是否存在软件包 ${PACKAGE_NAME}"
dnf list available ${PACKAGE_NAME} &>/dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "软件包 ${PACKAGE_NAME} 在yum源中不存在"
exit 255
fi
# 步骤2检查系统是否已经安装了指定的软件包
LOG_INFO "步骤2检查系统是否已经安装了软件包 ${PACKAGE_NAME}"
rpm -q ${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创建测试用的LaTeX文件
LOG_INFO "步骤4创建测试用的LaTeX文件"
cat > ${TEST_FILE} << "EOF"
\documentclass{article}
\usepackage{amscd}
\begin{document}
\begin{equation*}
\begin{CD}
A @>f>> B \\
@VgVV @VVhV \\
C @>k>> D
\end{CD}
\end{equation*}
\end{document}
EOF
CHECK_RESULT $? 0 0 "创建测试文件失败"
# 步骤5使用pdflatex编译LaTeX文件
LOG_INFO "步骤5使用pdflatex编译LaTeX文件"
pdflatex -interaction=nonstopmode ${TEST_FILE} &>/dev/null
CHECK_RESULT $? 0 0 "编译LaTeX文件失败"
# 步骤6检查生成的PDF文件是否存在
LOG_INFO "步骤6检查生成的PDF文件是否存在"
if [ -f ${TEST_OUTPUT} ]; then
LOG_INFO "成功生成PDF文件${TEST_OUTPUT}"
else
LOG_ERROR "未生成PDF文件${TEST_OUTPUT}"
exit 1
fi
# 步骤7清理生成的中间文件
LOG_INFO "步骤7清理生成的中间文件"
rm -f ${TEST_FILE} ${TEST_FILE%.tex}.aux ${TEST_FILE%.tex}.log ${TEST_OUTPUT}
CHECK_RESULT $? 0 0 "清理中间文件失败"
# 步骤8如果脚本开始时未安装软件包则在测试结束后卸载
if [ ${ALREADY_INSTALLED} -eq 0 ]; then
LOG_INFO "步骤8卸载软件包 ${PACKAGE_NAME}"
dnf remove -y ${PACKAGE_NAME}
CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败"
else
LOG_INFO "步骤8保持软件包 ${PACKAGE_NAME} 的安装状态"
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 : 2025-11-26
# @License : Mulan PSL v2
# @Desc : Test compilation of amscdx package
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试amscdx包的编译功能"
# 检查是否已安装texlive-amscdx包
LOG_INFO "检查texlive-amscdx包是否已安装"
if dnf list installed texlive-amscdx &>/dev/null; then
LOG_INFO "texlive-amscdx包已安装测试结束后保持安装状态"
installed=true
else
LOG_INFO "texlive-amscdx包未安装将在测试结束后卸载"
installed=false
fi
# 检查yum源中是否有texlive-amscdx包
LOG_INFO "检查yum源中是否存在texlive-amscdx包"
if ! dnf list available texlive-amscdx &>/dev/null; then
LOG_ERROR "yum源中不存在texlive-amscdx包"
exit 255
fi
# 安装texlive-amscdx包如果未安装
if [ "$installed" = false ]; then
LOG_INFO "安装texlive-amscdx包"
dnf install -y texlive-amscdx
CHECK_RESULT $? 0 0 "安装texlive-amscdx包失败"
fi
# 测试amscdx包的编译功能
LOG_INFO "测试amscdx包的编译功能"
compile_command="amscdx --compile"
if ! command -v amscdx &>/dev/null; then
LOG_ERROR "amscdx命令不存在或不支持"
exit 255
fi
$compile_command
CHECK_RESULT $? 0 0 "amscdx包编译失败"
# 清理环境(如果之前未安装)
if [ "$installed" = false ]; then
LOG_INFO "卸载texlive-amscdx包"
dnf remove -y texlive-amscdx
CHECK_RESULT $? 0 0 "卸载texlive-amscdx包失败"
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 : 2026-03-12
# @License : Mulan PSL v2
# @Desc : Test installation of texlive-amscdx package
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试:安装 texlive-amscdx 软件包"
LOG_INFO "步骤1: 检查是否已安装 texlive-amscdx"
if dnf list installed texlive-amscdx &>/dev/null; then
LOG_INFO "texlive-amscdx 已安装,跳过安装步骤"
INSTALLED=1
else
LOG_INFO "texlive-amscdx 未安装,将在测试中安装"
INSTALLED=0
fi
LOG_INFO "步骤2: 检查 yum 源中是否有 texlive-amscdx 软件包"
if ! dnf list available texlive-amscdx &>/dev/null; then
LOG_ERROR "yum 源中未找到 texlive-amscdx 软件包"
exit 255
fi
LOG_INFO "步骤3: 执行安装 texlive-amscdx"
if [ $INSTALLED -eq 0 ]; then
dnf install -y texlive-amscdx
CHECK_RESULT $? 0 0 "安装 texlive-amscdx 失败"
LOG_INFO "texlive-amscdx 安装成功"
fi
LOG_INFO "步骤4: 验证 texlive-amscdx 安装成功"
dnf list installed texlive-amscdx &>/dev/null
CHECK_RESULT $? 0 0 "验证 texlive-amscdx 安装失败"
LOG_INFO "步骤5: 验证 texlive-amscdx 命令参数"
if ! texlive-amscdx --help &>/dev/null; then
LOG_ERROR "texlive-amscdx 命令参数不支持或不存在"
exit 255
fi
LOG_INFO "texlive-amscdx 命令参数验证成功"
LOG_INFO "步骤6: 清理环境"
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "卸载 texlive-amscdx"
dnf remove -y texlive-amscdx
CHECK_RESULT $? 0 0 "卸载 texlive-amscdx 失败"
LOG_INFO "texlive-amscdx 卸载成功"
else
LOG_INFO "测试前已安装,保持安装状态"
fi
LOG_INFO "测试完成texlive-amscdx 安装测试通过"
}
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-12
# @License : Mulan PSL v2
# @Desc : Test uninstallation of texlive-amscdx package
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
set -e
# 环境检查检查是否已安装texlive-amscdx
LOG_INFO "检查是否已安装texlive-amscdx"
if dnf list installed texlive-amscdx &>/dev/null; then
LOG_INFO "texlive-amscdx已安装标记为已安装状态"
INSTALLED_BEFORE="yes"
else
LOG_INFO "texlive-amscdx未安装标记为未安装状态"
INSTALLED_BEFORE="no"
fi
# 检查yum源中是否存在texlive-amscdx软件包
LOG_INFO "检查yum源中是否存在texlive-amscdx软件包"
if ! dnf list available texlive-amscdx &>/dev/null; then
LOG_ERROR "yum源中不存在texlive-amscdx软件包"
exit 255
fi
# 如果未安装,则进行安装
if [[ "$INSTALLED_BEFORE" == "no" ]]; then
LOG_INFO "开始安装texlive-amscdx"
dnf install -y texlive-amscdx
CHECK_RESULT $? 0 0 "安装texlive-amscdx失败"
LOG_INFO "texlive-amscdx安装成功"
fi
# 测试卸载功能
LOG_INFO "开始测试卸载texlive-amscdx"
dnf remove -y texlive-amscdx
CHECK_RESULT $? 0 0 "卸载texlive-amscdx失败"
LOG_INFO "texlive-amscdx卸载成功"
# 验证卸载后软件包是否已移除
LOG_INFO "验证texlive-amscdx是否已卸载"
if dnf list installed texlive-amscdx &>/dev/null; then
LOG_ERROR "卸载后texlive-amscdx仍存在"
exit 1
else
LOG_INFO "验证通过texlive-amscdx已成功卸载"
fi
# 环境恢复:如果之前已安装,则重新安装
if [[ "$INSTALLED_BEFORE" == "yes" ]]; then
LOG_INFO "恢复环境重新安装texlive-amscdx"
dnf install -y texlive-amscdx
CHECK_RESULT $? 0 0 "重新安装texlive-amscdx失败"
LOG_INFO "环境恢复完成texlive-amscdx已重新安装"
fi
LOG_INFO "测试完成"
}
main "$@"

View File

@@ -1,108 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2026-02-20
# @License : Mulan PSL v2
# @Desc : Test compiling C++ app with plugin
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 设置环境变量
SCRIPT_NAME="test_uwsgi-plugin-cplusplus_function_compile"
LOG_INFO "开始执行测试脚本:${SCRIPT_NAME}"
# 定义软件包名称
PACKAGE_NAME="uwsgi-plugin-cplusplus"
# 步骤1检查yum源中是否存在指定软件包
LOG_INFO "步骤1检查yum源中是否存在 ${PACKAGE_NAME} 软件包"
dnf list available ${PACKAGE_NAME} &>/dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到 ${PACKAGE_NAME} 软件包"
exit 255
fi
# 步骤2检查当前环境是否已安装软件包
LOG_INFO "步骤2检查当前环境是否已安装 ${PACKAGE_NAME}"
INSTALLED=false
if rpm -q ${PACKAGE_NAME} &>/dev/null; then
LOG_INFO "检测到 ${PACKAGE_NAME} 已安装"
INSTALLED=true
else
LOG_INFO "检测到 ${PACKAGE_NAME} 未安装"
fi
# 步骤3如果未安装则安装软件包
if [ "$INSTALLED" = "false" ]; then
LOG_INFO "步骤3安装 ${PACKAGE_NAME} 软件包"
dnf install -y ${PACKAGE_NAME}
CHECK_RESULT $? 0 0 "安装 ${PACKAGE_NAME} 失败"
LOG_INFO "${PACKAGE_NAME} 安装成功"
fi
# 步骤4检查uwsgi命令是否支持所需参数
LOG_INFO "步骤4检查uwsgi命令是否支持 --plugin 参数"
uwsgi --help | grep -q -- "--plugin"
CHECK_RESULT $? 0 0 "uwsgi命令不支持 --plugin 参数"
LOG_INFO "uwsgi命令支持 --plugin 参数"
# 步骤5编写测试C++应用
LOG_INFO "步骤5编写测试C++应用"
TEST_CPP_FILE="/tmp/test_uwsgi_app.cpp"
cat > ${TEST_CPP_FILE} << "EOF"
#include <iostream>
extern "C" {
int application(int argc, char** argv) {
std::cout << "Hello from C++ uWSGI plugin!" << std::endl;
return 0;
}
}
EOF
CHECK_RESULT $? 0 0 "创建C++测试文件失败"
# 步骤6编译C++应用
LOG_INFO "步骤6编译C++应用"
TEST_APP="/tmp/test_uwsgi_app"
g++ -fPIC -shared -o ${TEST_APP}.so ${TEST_CPP_FILE}
CHECK_RESULT $? 0 0 "编译C++应用失败"
LOG_INFO "C++应用编译成功"
# 步骤7使用uwsgi插件加载C++应用
LOG_INFO "步骤7使用uwsgi插件加载C++应用"
uwsgi --plugin cplusplus --module ${TEST_APP} --callable application --http :0 --exit-on-reload 2>&1 | grep -q "Hello from C++ uWSGI plugin!"
CHECK_RESULT $? 0 0 "uwsgi插件加载C++应用失败"
LOG_INFO "uwsgi插件成功加载C++应用"
# 步骤8清理临时文件
LOG_INFO "步骤8清理临时文件"
rm -f ${TEST_CPP_FILE} ${TEST_APP}.so
CHECK_RESULT $? 0 0 "清理临时文件失败"
# 步骤9如果测试前未安装则卸载软件包
if [ "$INSTALLED" = "false" ]; then
LOG_INFO "步骤9卸载 ${PACKAGE_NAME} 软件包"
dnf remove -y ${PACKAGE_NAME}
CHECK_RESULT $? 0 0 "卸载 ${PACKAGE_NAME} 失败"
LOG_INFO "${PACKAGE_NAME} 卸载成功"
else
LOG_INFO "步骤9测试前已安装 ${PACKAGE_NAME},保持安装状态"
fi
LOG_INFO "测试脚本 ${SCRIPT_NAME} 执行完成"
}
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 : Test executing C++ code
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 检查yum源中是否存在uwsgi-plugin-cplusplus软件包
LOG_INFO "检查yum源中是否存在uwsgi-plugin-cplusplus软件包"
dnf list available uwsgi-plugin-cplusplus > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中不存在uwsgi-plugin-cplusplus软件包"
exit 255
fi
# 检查是否已安装uwsgi-plugin-cplusplus
LOG_INFO "检查是否已安装uwsgi-plugin-cplusplus"
rpm -q uwsgi-plugin-cplusplus > /dev/null 2>&1
if [ $? -eq 0 ]; then
INSTALLED=true
LOG_INFO "uwsgi-plugin-cplusplus已安装"
else
INSTALLED=false
LOG_INFO "uwsgi-plugin-cplusplus未安装将进行安装"
fi
# 如果未安装,则安装软件包
if [ "$INSTALLED" = false ]; then
LOG_INFO "正在安装uwsgi-plugin-cplusplus"
dnf install -y uwsgi-plugin-cplusplus > /dev/null 2>&1
CHECK_RESULT $? 0 0 "安装uwsgi-plugin-cplusplus失败"
fi
# 测试执行C++代码功能
LOG_INFO "测试执行C++代码功能"
uwsgi --plugin cpp --need-app > /dev/null 2>&1
CHECK_RESULT $? 0 0 "执行C++代码功能失败"
# 清理环境
if [ "$INSTALLED" = false ]; then
LOG_INFO "清理环境卸载uwsgi-plugin-cplusplus"
dnf remove -y uwsgi-plugin-cplusplus > /dev/null 2>&1
CHECK_RESULT $? 0 0 "卸载uwsgi-plugin-cplusplus失败"
fi
LOG_INFO "测试脚本执行完毕"
}
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-20
# @License : Mulan PSL v2
# @Desc : Test integration with uWSGI server
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试Test integration with uWSGI server"
LOG_INFO "步骤1检查当前环境是否已安装uwsgi-plugin-cplusplus软件包"
if rpm -q uwsgi-plugin-cplusplus &> /dev/null; then
LOG_INFO "uwsgi-plugin-cplusplus软件包已安装测试结束后将保持安装状态"
INSTALLED=1
else
LOG_INFO "uwsgi-plugin-cplusplus软件包未安装测试结束后将卸载"
INSTALLED=0
fi
LOG_INFO "步骤2检查yum源中是否存在uwsgi-plugin-cplusplus软件包"
if ! dnf list available uwsgi-plugin-cplusplus &> /dev/null; then
LOG_ERROR "yum源中未找到uwsgi-plugin-cplusplus软件包"
exit 255
fi
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "步骤3安装uwsgi-plugin-cplusplus软件包"
dnf install -y uwsgi-plugin-cplusplus
CHECK_RESULT $? 0 0 "安装uwsgi-plugin-cplusplus软件包失败"
fi
LOG_INFO "步骤4检查uWSGI是否支持cpp插件"
uwsgi --plugins-list | grep -q cpp
CHECK_RESULT $? 0 0 "uWSGI不支持cpp插件"
LOG_INFO "步骤5创建一个简单的C++ uWSGI插件测试文件"
cat > /tmp/test_cpp_plugin.cpp << "EOF"
#include <uwsgi.h>
extern "C" int test_cpp_function() {
uwsgi_log("C++ plugin test function called\n");
return 0;
}
extern "C" void uwsgi_cpp_plugin_test(struct wsgi_request *wsgi_req) {
uwsgi_log("C++ plugin request handler called\n");
}
extern "C" void uwsgi_cpp_plugin_init() {
uwsgi_log("C++ plugin initialized\n");
}
EOF
LOG_INFO "步骤6编译测试C++插件"
g++ -shared -fPIC -o /tmp/test_cpp_plugin.so /tmp/test_cpp_plugin.cpp -I/usr/include/uwsgi
CHECK_RESULT $? 0 0 "编译C++插件失败"
LOG_INFO "步骤7创建uWSGI配置文件测试C++插件集成"
cat > /tmp/uwsgi_test.ini << "EOF"
[uwsgi]
plugin = cpp
module =
cpp-load = /tmp/test_cpp_plugin.so
http-socket = :9090
master = true
workers = 1
EOF
LOG_INFO "步骤8启动uWSGI服务器测试C++插件"
uwsgi --ini /tmp/uwsgi_test.ini --daemonize /tmp/uwsgi.log
CHECK_RESULT $? 0 0 "启动uWSGI服务器失败"
LOG_INFO "步骤9检查uWSGI进程是否运行"
sleep 2
pgrep -f "uwsgi.*test_cpp_plugin" > /dev/null
CHECK_RESULT $? 0 0 "uWSGI进程未运行"
LOG_INFO "步骤10停止uWSGI测试进程"
pkill -f "uwsgi.*test_cpp_plugin"
CHECK_RESULT $? 0 0 "停止uWSGI进程失败"
LOG_INFO "步骤11清理临时测试文件"
rm -f /tmp/test_cpp_plugin.cpp /tmp/test_cpp_plugin.so /tmp/uwsgi_test.ini /tmp/uwsgi.log
CHECK_RESULT $? 0 0 "清理临时文件失败"
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "步骤12卸载uwsgi-plugin-cplusplus软件包"
dnf remove -y uwsgi-plugin-cplusplus
CHECK_RESULT $? 0 0 "卸载uwsgi-plugin-cplusplus软件包失败"
fi
LOG_INFO "测试完成Test integration with uWSGI server 通过"
}
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 : Test loading the C++ plugin
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试Test loading the C++ plugin"
# 检查yum源中是否存在uwsgi-plugin-cplusplus软件包
LOG_INFO "检查yum源中是否存在uwsgi-plugin-cplusplus软件包"
dnf list available uwsgi-plugin-cplusplus > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中不存在uwsgi-plugin-cplusplus软件包"
exit 255
fi
# 判断环境是否已安装uwsgi-plugin-cplusplus
LOG_INFO "判断环境是否已安装uwsgi-plugin-cplusplus"
rpm -q uwsgi-plugin-cplusplus > /dev/null 2>&1
if [ $? -eq 0 ]; then
installed=true
LOG_INFO "uwsgi-plugin-cplusplus已安装"
else
installed=false
LOG_INFO "uwsgi-plugin-cplusplus未安装将进行安装"
fi
# 如果未安装,则安装软件包
if [ "$installed" = false ]; then
LOG_INFO "安装uwsgi-plugin-cplusplus软件包"
dnf install -y uwsgi-plugin-cplusplus
CHECK_RESULT $? 0 0 "安装uwsgi-plugin-cplusplus失败"
fi
# 测试加载C++插件
LOG_INFO "测试加载C++插件"
uwsgi --plugin cpp --need-plugin cpp --version > /dev/null 2>&1
CHECK_RESULT $? 0 0 "加载C++插件失败"
# 如果之前未安装,则卸载软件包
if [ "$installed" = false ]; then
LOG_INFO "卸载uwsgi-plugin-cplusplus软件包"
dnf remove -y uwsgi-plugin-cplusplus
CHECK_RESULT $? 0 0 "卸载uwsgi-plugin-cplus-plus失败"
fi
LOG_INFO "测试完成Test loading the C++ plugin"
}
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 : 2026-02-20
# @License : Mulan PSL v2
# @Desc : Test checking the installed plugin version
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 定义变量
PACKAGE_NAME="uwsgi-plugin-cplusplus"
LOG_INFO "测试开始:检查已安装的插件版本"
LOG_INFO "步骤1检查yum源中是否存在${PACKAGE_NAME}软件包"
dnf list available ${PACKAGE_NAME} > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中不存在${PACKAGE_NAME}软件包"
exit 255
fi
LOG_INFO "步骤2检查当前是否已安装${PACKAGE_NAME}软件包"
IS_INSTALLED=0
if rpm -qa | grep -q ${PACKAGE_NAME}; then
IS_INSTALLED=1
LOG_INFO "${PACKAGE_NAME}软件包已安装,跳过安装步骤"
else
LOG_INFO "${PACKAGE_NAME}软件包未安装,开始安装"
dnf install -y ${PACKAGE_NAME} > /dev/null 2>&1
CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}软件包失败"
fi
LOG_INFO "步骤3检查uwsgi命令是否支持--plugins参数"
uwsgi --help | grep -q "\-\-plugins"
CHECK_RESULT $? 0 255 "uwsgi命令不支持--plugins参数"
LOG_INFO "步骤4执行uwsgi --plugins命令查看已安装的插件列表"
uwsgi --plugins 2>&1 | grep -q "cplusplus"
CHECK_RESULT $? 0 0 "未找到cplusplus插件"
LOG_INFO "步骤5检查cplusplus插件的版本信息"
PLUGIN_VERSION=$(uwsgi --plugins 2>&1 | grep "cplusplus" | awk "{print $2}")
if [ -z "${PLUGIN_VERSION}" ]; then
LOG_ERROR "无法获取cplusplus插件版本信息"
exit 1
else
LOG_INFO "cplusplus插件版本为${PLUGIN_VERSION}"
fi
LOG_INFO "步骤6环境恢复"
if [ ${IS_INSTALLED} -eq 0 ]; then
LOG_INFO "卸载${PACKAGE_NAME}软件包"
dnf remove -y ${PACKAGE_NAME} > /dev/null 2>&1
CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}软件包失败"
else
LOG_INFO "${PACKAGE_NAME}软件包已安装,保持安装状态"
fi
LOG_INFO "测试完成:检查已安装的插件版本"
}
main "$@"