Merge branch 'pkg' of http://10.30.190.190:54866/redrsoe2100/os-autotest into pkg
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/appstream/appstream-compose",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_appstream-compose_function_basic",
|
||||
"desc": "Test basic functionality of appstream-compose"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -33,10 +33,6 @@
|
||||
{
|
||||
"name": "test_cscope_cscope_upper_r",
|
||||
"desc": "递归目录查找文件"
|
||||
},
|
||||
{
|
||||
"name": "test_cscope_cscope-indexer_no_args",
|
||||
"desc": "测试不带任何参数运行cscope-indexer命令"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -21,18 +21,6 @@
|
||||
{
|
||||
"name": "test_ibus-libs_function_remove_package",
|
||||
"desc": "验证能够成功卸载 ibus-libs 软件包。"
|
||||
},
|
||||
{
|
||||
"name": "test_ibus-libs_function_list_provided",
|
||||
"desc": "列出 ibus-libs 软件包提供的库文件列表。"
|
||||
},
|
||||
{
|
||||
"name": "test_ibus-libs_function_check_dependencies",
|
||||
"desc": "验证 ibus-libs 软件包的运行时依赖是否满足。"
|
||||
},
|
||||
{
|
||||
"name": "test_ibus-libs_function_basic_usage",
|
||||
"desc": "验证一个简单程序能否成功链接并使用 ibus-libs 的核心库。"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -11,85 +11,6 @@
|
||||
"name": "test_liburing-devel_uninstall",
|
||||
"desc": "测试liburing-devel软件包的卸载功能",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_liburing-devel_upgrade",
|
||||
"desc": "测试liburing-devel软件包的升级功能",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_liburing-devel_downgrade",
|
||||
"desc": "测试liburing-devel软件包的降级功能",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_liburing-devel_rollback",
|
||||
"desc": "测试liburing-devel软件包的回滚功能",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_liburing-devel_service_start",
|
||||
"desc": "测试liburing-devel软件包提供的服务的启动功能",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_liburing-devel_service_stop",
|
||||
"desc": "测试liburing-devel软件包提供的服务的停止功能",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_liburing-devel_service_restart",
|
||||
"desc": "测试liburing-devel软件包提供的服务的重启功能",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_liburing-devel_service_status",
|
||||
"desc": "测试liburing-devel软件包提供的服务的状态查询功能",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_liburing-devel_service_log",
|
||||
"desc": "测试liburing-devel软件包提供的服务的日志查看功能",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_liburing-devel_service_config",
|
||||
"desc": "测试liburing-devel软件包提供的服务的配置功能",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_liburing-devel_service_reload",
|
||||
"desc": "测试liburing-devel软件包提供的服务的重新加载配置功能",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_liburing-devel_service_enable",
|
||||
"desc": "测试liburing-devel软件包提供的服务的开机自启功能",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_liburing-devel_service_disable",
|
||||
"desc": "测试liburing-devel软件包提供的服务的开机自启禁用功能",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_liburing-devel_reinstall",
|
||||
"desc": "测试liburing-devel软件包的重新安装功能",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_liburing-devel_service_restore",
|
||||
"desc": "测试liburing-devel软件包提供的服务的配置恢复功能",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_liburing-devel_service_failover",
|
||||
"desc": "测试liburing-devel软件包提供的服务的故障转移功能",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_liburing-devel_function_basic",
|
||||
"desc": "测试liburing-devel基础功能"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -7,21 +7,9 @@
|
||||
"desc": "测试python3-portend软件包的安装功能",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_python3-portend_function_install",
|
||||
"desc": "测试python3-portend软件包的基本安装功能"
|
||||
},
|
||||
{
|
||||
"name": "test_python3-portend_function_uninstall",
|
||||
"desc": "测试python3-portend软件包的卸载功能"
|
||||
},
|
||||
{
|
||||
"name": "test_python3-portend_function_check_port",
|
||||
"desc": "测试portend库检查端口占用状态的功能"
|
||||
},
|
||||
{
|
||||
"name": "test_python3-portend_function_wait_for_port",
|
||||
"desc": "测试portend库等待端口可用的功能"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-g/texlive-dowith",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_texlive-dowith_function_install",
|
||||
"desc": "Test installation of texlive-dowith"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -13,10 +13,6 @@
|
||||
{
|
||||
"name": "test_texlive-ipaex-type1-doc_function_check",
|
||||
"desc": "Check if package is installed"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-ipaex-type1-doc_function_doc_exist",
|
||||
"desc": "Verify documentation files exist"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,26 +2,6 @@
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-m/texlive-ku-template",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_texlive-ku-template_function_basic",
|
||||
"desc": "Test basic template functionality"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-ku-template_function_install",
|
||||
"desc": "Test installation of the texlive-ku-template package"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-ku-template_function_uninstall",
|
||||
"desc": "Test uninstallation of the texlive-ku-template package"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-ku-template_function_check_installed",
|
||||
"desc": "Test verification that the package is installed"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-ku-template_function_generate_doc",
|
||||
"desc": "Test generating a document using the template"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-ku-template_function_list_files",
|
||||
"desc": "Test listing files provided by the package"
|
||||
|
||||
@@ -9,18 +9,6 @@
|
||||
{
|
||||
"name": "test_texlive-langsci-doc_function_uninstall",
|
||||
"desc": "Test package uninstallation"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-langsci-doc_function_version",
|
||||
"desc": "Test package version query"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-langsci-doc_function_doc_access",
|
||||
"desc": "Test documentation access"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-langsci-doc_function_dep_check",
|
||||
"desc": "Test dependency check"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,10 +2,6 @@
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-u/texlive-roboto",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_texlive-roboto_function_font",
|
||||
"desc": "Test the Roboto font rendering in LaTeX documents"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-roboto_function_install",
|
||||
"desc": "Test the installation of the texlive-roboto package"
|
||||
@@ -14,17 +10,9 @@
|
||||
"name": "test_texlive-roboto_function_uninstall",
|
||||
"desc": "Test the uninstallation of the texlive-roboto package"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-roboto_function_latex_use",
|
||||
"desc": "Test using Roboto font in a basic LaTeX document"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-roboto_function_font_avail",
|
||||
"desc": "Test if Roboto font files are available in TeX system"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-roboto_function_pdf_output",
|
||||
"desc": "Test generating a PDF with Roboto font and verify rendering"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-12-03
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test basic functionality of appstream-compose
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 测试脚本:test_appstream-compose_function_basic
|
||||
|
||||
LOG_INFO "开始测试:Test basic functionality of appstream-compose"
|
||||
|
||||
# 检查是否已安装appstream-compose
|
||||
if ! dnf list installed appstream-compose &>/dev/null; then
|
||||
LOG_INFO "环境未安装appstream-compose,将进行安装"
|
||||
# 检查yum源中是否有appstream-compose
|
||||
if ! dnf list available appstream-compose &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到appstream-compose软件包"
|
||||
exit 255
|
||||
fi
|
||||
# 安装appstream-compose
|
||||
dnf install -y appstream-compose
|
||||
CHECK_RESULT $? 0 0 "安装appstream-compose失败"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "环境已安装appstream-compose,跳过安装步骤"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 测试基本功能
|
||||
LOG_INFO "测试appstream-compose基本功能"
|
||||
appstream-compose --help &>/dev/null
|
||||
CHECK_RESULT $? 0 0 "appstream-compose --help命令执行失败"
|
||||
|
||||
# 测试不支持的参数
|
||||
LOG_INFO "测试不支持的参数"
|
||||
appstream-compose --invalid-arg &>/dev/null
|
||||
CHECK_RESULT $? 255 255 "appstream-compose不支持--invalid-arg参数"
|
||||
|
||||
# 清理环境
|
||||
if [ "$INSTALLED" = true ]; then
|
||||
LOG_INFO "卸载appstream-compose"
|
||||
dnf remove -y appstream-compose
|
||||
CHECK_RESULT $? 0 0 "卸载appstream-compose失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:Test basic functionality of appstream-compose"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,50 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-03-26
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试不带任何参数运行cscope-indexer命令
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试不带任何参数运行cscope-indexer命令"
|
||||
LOG_INFO "检查cscope-indexer命令是否已安装"
|
||||
which cscope-indexer > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_INFO "cscope-indexer未安装,将进行安装"
|
||||
LOG_INFO "检查yum源中是否存在cscope软件包"
|
||||
dnf list available cscope 2>/dev/null | grep -q cscope
|
||||
CHECK_RESULT $? 0 255 "yum源中未找到cscope软件包"
|
||||
LOG_INFO "安装cscope软件包"
|
||||
dnf install -y cscope
|
||||
CHECK_RESULT $? 0 0 "安装cscope软件包失败"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "cscope-indexer已安装"
|
||||
INSTALLED=0
|
||||
fi
|
||||
LOG_INFO "执行不带任何参数的cscope-indexer命令"
|
||||
cscope-indexer
|
||||
CHECK_RESULT $? 0 0 "不带参数运行cscope-indexer命令失败"
|
||||
if [ $INSTALLED -eq 1 ]; then
|
||||
LOG_INFO "清理环境,卸载cscope软件包"
|
||||
dnf remove -y cscope
|
||||
CHECK_RESULT $? 0 0 "卸载cscope软件包失败"
|
||||
fi
|
||||
LOG_INFO "测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-18
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 验证一个简单程序能否成功链接并使用 ibus-libs 的核心库。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 检查是否已安装ibus-libs
|
||||
LOG_INFO "检查ibus-libs是否已安装"
|
||||
rpm -q ibus-libs > /dev/null 2>&1
|
||||
ibus_installed=$?
|
||||
|
||||
# 记录初始安装状态
|
||||
initial_installed=$ibus_installed
|
||||
|
||||
# 检查yum源中是否有ibus-libs软件包
|
||||
LOG_INFO "检查yum源中是否有ibus-libs软件包"
|
||||
dnf list available ibus-libs > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中没有ibus-libs软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装ibus-libs
|
||||
if [ $ibus_installed -ne 0 ]; then
|
||||
LOG_INFO "安装ibus-libs软件包"
|
||||
dnf install -y ibus-libs
|
||||
CHECK_RESULT $? 0 0 "安装ibus-libs失败"
|
||||
fi
|
||||
|
||||
# 验证ibus-libs核心库文件是否存在
|
||||
LOG_INFO "验证ibus-libs核心库文件是否存在"
|
||||
ldconfig -p | grep libibus-1 > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "ibus-libs核心库文件不存在"
|
||||
|
||||
# 创建一个简单的测试程序来链接ibus库
|
||||
LOG_INFO "创建测试程序验证链接ibus库"
|
||||
cat > test_ibus.c << "EOF"
|
||||
#include <ibus.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
printf("IBus version: %s\n", ibus_get_version());
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
|
||||
# 编译测试程序
|
||||
LOG_INFO "编译测试程序"
|
||||
gcc test_ibus.c -o test_ibus_program $(pkg-config --cflags --libs ibus-1.0) 2>&1
|
||||
CHECK_RESULT $? 0 0 "编译测试程序失败"
|
||||
|
||||
# 运行测试程序
|
||||
LOG_INFO "运行测试程序验证功能"
|
||||
./test_ibus_program
|
||||
CHECK_RESULT $? 0 0 "运行测试程序失败"
|
||||
|
||||
# 清理测试文件
|
||||
LOG_INFO "清理测试文件"
|
||||
rm -f test_ibus.c test_ibus_program
|
||||
|
||||
# 根据初始状态恢复环境
|
||||
if [ $initial_installed -ne 0 ]; then
|
||||
LOG_INFO "卸载ibus-libs软件包"
|
||||
dnf remove -y ibus-libs
|
||||
CHECK_RESULT $? 0 0 "卸载ibus-libs失败"
|
||||
else
|
||||
LOG_INFO "保持ibus-libs安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "ibus-libs基本功能测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,58 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-03-18
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 验证 ibus-libs 软件包的运行时依赖是否满足。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试 ibus-libs 软件包的运行时依赖是否满足"
|
||||
LOG_INFO "步骤1: 检查当前环境是否已安装 ibus-libs 软件包"
|
||||
rpm -q ibus-libs > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "ibus-libs 软件包已安装,测试结束后将保持安装状态"
|
||||
INSTALLED_BEFORE=1
|
||||
else
|
||||
LOG_INFO "ibus-libs 软件包未安装,将在测试步骤中安装,并在测试结束后卸载"
|
||||
INSTALLED_BEFORE=0
|
||||
fi
|
||||
LOG_INFO "步骤2: 检查 yum 源中是否存在 ibus-libs 软件包"
|
||||
dnf list available ibus-libs > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 255 "yum 源中不存在 ibus-libs 软件包"
|
||||
LOG_INFO "步骤3: 安装 ibus-libs 软件包"
|
||||
if [ $INSTALLED_BEFORE -eq 0 ]; then
|
||||
dnf install -y ibus-libs > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装 ibus-libs 软件包失败"
|
||||
fi
|
||||
LOG_INFO "步骤4: 检查 ibus-libs 软件包的运行时依赖"
|
||||
rpm -qR ibus-libs > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "查询 ibus-libs 运行时依赖失败"
|
||||
LOG_INFO "步骤5: 验证 ibus-libs 软件包的基本功能"
|
||||
ldd /usr/lib64/libibus-1.0.so > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "ibus-libs 动态库依赖检查失败"
|
||||
LOG_INFO "步骤6: 清理测试环境,恢复到之前的状态"
|
||||
if [ $INSTALLED_BEFORE -eq 0 ]; then
|
||||
LOG_INFO "卸载在测试中安装的 ibus-libs 软件包"
|
||||
dnf remove -y ibus-libs > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载 ibus-libs 软件包失败"
|
||||
else
|
||||
LOG_INFO "测试前已安装 ibus-libs,保持安装状态"
|
||||
fi
|
||||
LOG_INFO "测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,83 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-03-18
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 列出 ibus-libs 软件包提供的库文件列表。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试:列出 ibus-libs 软件包提供的库文件列表。"
|
||||
|
||||
# 检查是否已安装 ibus-libs
|
||||
LOG_INFO "检查 ibus-libs 是否已安装。"
|
||||
rpm -q ibus-libs > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "ibus-libs 已安装,记录当前状态。"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "ibus-libs 未安装,将在测试过程中安装。"
|
||||
INSTALLED=0
|
||||
fi
|
||||
|
||||
# 检查 yum 源中是否有 ibus-libs 软件包
|
||||
LOG_INFO "检查 yum 源中是否有 ibus-libs 软件包。"
|
||||
dnf list available ibus-libs > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum 源中未找到 ibus-libs 软件包。"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装 ibus-libs
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "安装 ibus-libs 软件包。"
|
||||
dnf install -y ibus-libs
|
||||
CHECK_RESULT $? 0 0 "安装 ibus-libs 失败。"
|
||||
fi
|
||||
|
||||
# 列出 ibus-libs 提供的库文件列表
|
||||
LOG_INFO "执行命令列出 ibus-libs 提供的库文件列表。"
|
||||
rpm -ql ibus-libs | grep "\.so$" > /tmp/ibus_libs_list.txt
|
||||
CHECK_RESULT $? 0 0 "列出 ibus-libs 库文件失败。"
|
||||
|
||||
# 检查是否列出了库文件
|
||||
LOG_INFO "检查是否列出了库文件。"
|
||||
if [ -s /tmp/ibus_libs_list.txt ]; then
|
||||
LOG_INFO "成功列出 ibus-libs 提供的库文件。"
|
||||
cat /tmp/ibus_libs_list.txt
|
||||
else
|
||||
LOG_ERROR "未找到 ibus-libs 提供的库文件。"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 清理临时文件
|
||||
LOG_INFO "清理临时文件。"
|
||||
rm -f /tmp/ibus_libs_list.txt
|
||||
|
||||
# 如果测试前未安装,则卸载 ibus-libs
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "卸载 ibus-libs 软件包。"
|
||||
dnf remove -y ibus-libs
|
||||
CHECK_RESULT $? 0 0 "卸载 ibus-libs 失败。"
|
||||
LOG_INFO "环境已恢复至测试前状态。"
|
||||
else
|
||||
LOG_INFO "保持 ibus-libs 安装状态。"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成。"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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 : 2025-06-16
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试liburing-devel软件包的降级功能
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
|
||||
# 检查yum源中是否存在liburing-devel软件包
|
||||
LOG_INFO "检查yum源中是否存在liburing-devel软件包"
|
||||
dnf list available liburing-devel > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中不存在liburing-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 检查当前是否已安装liburing-devel软件包
|
||||
LOG_INFO "检查当前是否已安装liburing-devel软件包"
|
||||
rpm -q liburing-devel > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "当前已安装liburing-devel软件包,脚本结束后将保持安装状态"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "当前未安装liburing-devel软件包,脚本结束后将卸载该软件包"
|
||||
INSTALLED=0
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装liburing-devel软件包作为测试步骤
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "开始安装liburing-devel软件包"
|
||||
dnf install -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装liburing-devel软件包失败"
|
||||
fi
|
||||
|
||||
# 获取当前安装的liburing-devel版本
|
||||
LOG_INFO "获取当前安装的liburing-devel版本"
|
||||
CURRENT_VERSION=$(rpm -q --queryformat '%{VERSION}-%{RELEASE}' liburing-devel)
|
||||
LOG_INFO "当前安装的版本为: $CURRENT_VERSION"
|
||||
|
||||
# 检查是否有更低版本的liburing-devel可用
|
||||
LOG_INFO "检查是否有更低版本的liburing-devel可用"
|
||||
LOWER_VERSION=$(dnf list --showduplicates liburing-devel | awk '{print $2}' | grep -v "$CURRENT_VERSION" | sort -V | head -n 1)
|
||||
if [ -z "$LOWER_VERSION" ]; then
|
||||
LOG_ERROR "没有找到更低版本的liburing-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 降级到更低版本的liburing-devel
|
||||
LOG_INFO "开始降级到更低版本的liburing-devel: $LOWER_VERSION"
|
||||
dnf downgrade -y liburing-devel-$LOWER_VERSION > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "降级liburing-devel软件包失败"
|
||||
|
||||
# 验证降级后的版本是否正确
|
||||
LOG_INFO "验证降级后的版本是否正确"
|
||||
NEW_VERSION=$(rpm -q --queryformat '%{VERSION}-%{RELEASE}' liburing-devel)
|
||||
if [ "$NEW_VERSION" != "$LOWER_VERSION" ]; then
|
||||
LOG_ERROR "降级后的版本与预期不符,预期: $LOWER_VERSION, 实际: $NEW_VERSION"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 恢复到原始版本(如果需要)
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "恢复到原始版本: $CURRENT_VERSION"
|
||||
dnf upgrade -y liburing-devel-$CURRENT_VERSION > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "恢复到原始版本失败"
|
||||
|
||||
# 卸载liburing-devel软件包(如果最初未安装)
|
||||
LOG_INFO "卸载liburing-devel软件包"
|
||||
dnf remove -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载liburing-devel软件包失败"
|
||||
else
|
||||
LOG_INFO "保持当前安装状态,无需恢复或卸载"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-13
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试liburing-devel基础功能
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查liburing-devel软件包是否在yum源中
|
||||
LOG_INFO "检查yum源中是否存在liburing-devel软件包"
|
||||
dnf list available liburing-devel >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到liburing-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 检查环境是否已安装liburing-devel
|
||||
LOG_INFO "检查环境中是否已安装liburing-devel"
|
||||
rpm -q liburing-devel >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "环境中已安装liburing-devel,脚本结束后将保持安装状态"
|
||||
installed=true
|
||||
else
|
||||
installed=false
|
||||
LOG_INFO "环境中未安装liburing-devel,将在测试步骤中安装"
|
||||
fi
|
||||
|
||||
# 若未安装,则安装liburing-devel
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "安装liburing-devel软件包"
|
||||
dnf install -y liburing-devel
|
||||
CHECK_RESULT $? 0 0 "安装liburing-devel失败"
|
||||
fi
|
||||
|
||||
# 测试liburing-devel基础功能
|
||||
LOG_INFO "测试liburing-devel基础功能"
|
||||
|
||||
# 示例:检查liburing-devel提供的头文件是否存在
|
||||
LOG_INFO "检查/usr/include/liburing.h是否存在"
|
||||
[ -f /usr/include/liburing.h ]
|
||||
CHECK_RESULT $? 0 0 "/usr/include/liburing.h不存在"
|
||||
|
||||
# 示例:检查io_uring相关命令是否可用(假设存在io_uring_cmd命令)
|
||||
LOG_INFO "检查io_uring_cmd命令是否可用"
|
||||
command -v io_uring_cmd >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "io_uring_cmd命令不存在或不支持"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 示例:执行io_uring_cmd命令并检查结果
|
||||
LOG_INFO "执行io_ring_cmd --version"
|
||||
io_uring_cmd --version >/dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "io_uring_cmd --version执行失败"
|
||||
|
||||
# 若脚本开始时未安装liburig-devel,则在结束时卸载
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载liburing-devel软件包以恢复环境"
|
||||
dnf remove -y liburig-devl
|
||||
CHECK_RESULT $? 0 0 "卸载liburig-devle失败"
|
||||
fi
|
||||
|
||||
LOG_INFO “测试脚本执行完毕”
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-06-16
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试liburing-devel软件包的重新安装功能
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查liburing-devel软件包是否已安装
|
||||
LOG_INFO "检查liburing-devel软件包是否已安装"
|
||||
rpm -q liburing-devel > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "liburing-devel软件包已安装,脚本结束时将保持安装状态"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "liburing-devel软件包未安装,将在测试结束后卸载"
|
||||
INSTALLED=0
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在liburing-devel软件包
|
||||
LOG_INFO "检查yum源中是否存在liburing-devel软件包"
|
||||
dnf list available liburing-devel > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到liburing-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装liburing-devel软件包
|
||||
LOG_INFO "开始安装liburing-devel软件包"
|
||||
dnf install -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装liburing-devel软件包失败"
|
||||
|
||||
# 验证安装是否成功
|
||||
LOG_INFO "验证liburing-devel软件包是否安装成功"
|
||||
rpm -q liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "验证liburing-devel软件包安装失败"
|
||||
|
||||
# 重新安装liburing-devel软件包(测试重新安装功能)
|
||||
LOG_INFO "开始重新安装liburing-devel软件包"
|
||||
dnf reinstall -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "重新安装liburing-devel软件包失败"
|
||||
|
||||
# 验证重新安装是否成功
|
||||
LOG_INFO "验证重新安装后的liburing-devel软件包状态"
|
||||
rpm -q liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "验证重新安装后的liburing-devel软件包状态失败"
|
||||
|
||||
# 清理环境:如果脚本开始时未安装,则卸载软件包
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "清理环境:卸载liburing-devel软件包"
|
||||
dnf remove -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载liburing-devel软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-06-16
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试liburing-devel软件包的回滚功能
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试liburing-devel软件包的回滚功能"
|
||||
|
||||
# 检查yum源中是否存在liburing-devel软件包
|
||||
LOG_INFO "检查yum源中是否存在liburing-devel软件包"
|
||||
dnf list available liburing-devel > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中不存在liburing-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 检查是否已安装liburing-devel软件包
|
||||
LOG_INFO "检查是否已安装liburing-devel软件包"
|
||||
rpm -q liburing-devel > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "liburing-devel软件包已安装,测试结束后保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "liburing-devel软件包未安装,测试结束后将卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装liburing-devel软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "安装liburing-devel软件包"
|
||||
dnf install -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装liburing-devel软件包失败"
|
||||
fi
|
||||
|
||||
# 测试回滚功能(假设回滚命令为dnf history rollback)
|
||||
LOG_INFO "测试回滚功能"
|
||||
dnf history rollback last > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "回滚liburing-devel软件包失败"
|
||||
|
||||
# 如果最初未安装,则在测试结束后卸载liburing-devel软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载liburing-devel软件包"
|
||||
dnf remove -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载liburing-devel软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-06-16
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试liburing-devel软件包提供的服务的配置功能
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
LOG_INFO "开始测试liburing-devel软件包提供的服务的配置功能"
|
||||
|
||||
# 检查yum源中是否存在liburing-devel软件包
|
||||
LOG_INFO "检查yum源中是否存在liburing-devel软件包"
|
||||
dnf list available liburing-devel &> /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到liburing-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 检查是否已安装liburing-devel
|
||||
LOG_INFO "检查是否已安装liburing-devel"
|
||||
rpm -q liburing-devel &> /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "liburing-devel已安装,跳过安装步骤"
|
||||
installed=true
|
||||
else
|
||||
LOG_INFO "liburing-devel未安装,开始安装"
|
||||
dnf install -y liburing-devel
|
||||
CHECK_RESULT $? 0 0 "安装liburing-devel失败"
|
||||
installed=false
|
||||
fi
|
||||
|
||||
# 测试服务的配置功能
|
||||
LOG_INFO "测试服务的配置功能"
|
||||
# 假设服务配置命令为configure_liburing,这里仅为示例,实际需替换为真实命令
|
||||
configure_liburing --check-config &> /dev/null
|
||||
CHECK_RESULT $? 0 0 "服务配置功能测试失败"
|
||||
|
||||
# 清理环境
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载liburing-devel软件包"
|
||||
dnf remove -y liburing-devel
|
||||
CHECK_RESULT $? 0 0 "卸载liburing-devel失败"
|
||||
else
|
||||
LOG_INFO "保持liburing-devel的安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,83 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-06-16
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试liburing-devel软件包提供的服务的开机自启禁用功能
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查liburing-devel软件包是否已安装
|
||||
LOG_INFO "检查liburing-devel软件包是否已安装"
|
||||
rpm -q liburing-devel > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "liburing-devel软件包已安装,脚本结束时将保持安装状态"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "liburing-devel软件包未安装,将在测试结束后卸载"
|
||||
INSTALLED=0
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在liburing-devel软件包
|
||||
LOG_INFO "检查yum源中是否存在liburing-devel软件包"
|
||||
dnf list available liburing-devel > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到liburing-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装liburing-devel软件包
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "开始安装liburing-devel软件包"
|
||||
dnf install -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装liburing-devel软件包失败"
|
||||
fi
|
||||
|
||||
# 检查服务是否支持开机自启禁用功能
|
||||
LOG_INFO "检查服务是否支持开机自启禁用功能"
|
||||
systemctl list-unit-files | grep -q liburing.service > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "服务不支持开机自启禁用功能"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 禁用服务的开机自启功能
|
||||
LOG_INFO "禁用服务的开机自启功能"
|
||||
systemctl disable liburing.service > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "禁用服务的开机自启功能失败"
|
||||
|
||||
# 验证服务是否已禁用开机自启
|
||||
LOG_INFO "验证服务是否已禁用开机自启"
|
||||
systemctl is-enabled liburing.service | grep -q disabled > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "服务未成功禁用开机自启"
|
||||
|
||||
# 恢复服务的开机自启功能(仅用于测试环境恢复)
|
||||
LOG_INFO "恢复服务的开机自启功能"
|
||||
systemctl enable liburing.service > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "恢复服务的开机自启功能失败"
|
||||
|
||||
# 如果脚本开始时未安装,则卸载liburing-devel软件包
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "卸载liburing-devel软件包"
|
||||
dnf remove -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载liburing-devel软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-06-16
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试liburing-devel软件包提供的服务的开机自启功能
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
|
||||
# 检查liburing-devel软件包是否已安装
|
||||
LOG_INFO "检查liburing-devel软件包是否已安装"
|
||||
rpm -q liburing-devel > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "liburing-devel软件包已安装,脚本结束时将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "liburing-devel软件包未安装,将在测试完成后卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在liburing-devel软件包
|
||||
LOG_INFO "检查yum源中是否存在liburing-devel软件包"
|
||||
dnf list available liburing-devel > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到liburing-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装liburing-devel软件包
|
||||
if ! $INSTALLED; then
|
||||
LOG_INFO "开始安装liburing-devel软件包"
|
||||
dnf install -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装liburing-devel软件包失败"
|
||||
fi
|
||||
|
||||
# 检查服务是否支持开机自启功能
|
||||
LOG_INFO "检查服务是否支持开机自启功能"
|
||||
systemctl enable liburing.service > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "服务不支持开机自启功能"
|
||||
|
||||
# 测试服务开机自启功能是否正常
|
||||
LOG_INFO "测试服务开机自启功能是否正常"
|
||||
systemctl is-enabled liburing.service > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "服务开机自启功能异常"
|
||||
|
||||
# 清理环境:如果脚本开始时未安装,则卸载liburing-devel软件包
|
||||
if ! $INSTALLED; then
|
||||
LOG_INFO "清理环境:卸载liburing-devel软件包"
|
||||
dnf remove -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载liburing-devel软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-06-16
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试liburing-devel软件包提供的服务的故障转移功能
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
|
||||
# 检查是否已安装liburing-devel软件包
|
||||
LOG_INFO "检查是否已安装liburing-devel软件包"
|
||||
if dnf list installed liburing-devel &> /dev/null; then
|
||||
LOG_INFO "liburing-devel软件包已安装,脚本结束后将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "liburing-devel软件包未安装,将在测试结束后卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在liburing-devel软件包
|
||||
LOG_INFO "检查yum源中是否存在liburing-devel软件包"
|
||||
if ! dnf list available liburing-devel &> /dev/null; then
|
||||
LOG_ERROR "yum源中未找到liburing-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装liburing-devel软件包(如果未安装)
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "开始安装liburing-devel软件包"
|
||||
dnf install -y liburing-devel
|
||||
CHECK_RESULT $? 0 0 "安装liburing-devel软件包失败"
|
||||
fi
|
||||
|
||||
# 测试服务的故障转移功能
|
||||
LOG_INFO "测试liburing-devel软件包提供的服务的故障转移功能"
|
||||
# 假设服务名为liburing-service(需根据实际服务名调整)
|
||||
systemctl start liburing-service &> /dev/null
|
||||
CHECK_RESULT $? 0 0 "启动liburing-service服务失败"
|
||||
|
||||
# 模拟故障转移场景(需根据实际服务逻辑调整)
|
||||
LOG_INFO "模拟故障转移场景"
|
||||
systemctl stop liburing-service &> /dev/null
|
||||
CHECK_RESULT $? 0 0 "停止liburing-service服务失败"
|
||||
|
||||
# 检查服务是否自动恢复(需根据实际服务逻辑调整)
|
||||
LOG_INFO "检查服务是否自动恢复"
|
||||
sleep 5 # 等待可能的恢复时间
|
||||
systemctl is-active liburing-service &> /dev/null
|
||||
CHECK_RESULT $? 0 0 "服务未自动恢复"
|
||||
|
||||
# 清理环境:卸载软件包(如果脚本开始时未安装)
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载liburing-devel软件包"
|
||||
dnf remove -y liburing-devel
|
||||
CHECK_RESULT $? 0 0 "卸载liburing-devel软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复初始状态"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-06-16
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试liburing-devel软件包提供的服务的日志查看功能
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查liburing-devel软件包是否已安装
|
||||
LOG_INFO "检查liburing-devel软件包是否已安装"
|
||||
rpm -q liburing-devel > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "liburing-devel软件包已安装,脚本结束时将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "liburing-devel软件包未安装,将在测试结束后卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在liburing-devel软件包
|
||||
LOG_INFO "检查yum源中是否存在liburing-devel软件包"
|
||||
dnf list available liburing-devel > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到liburing-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装liburing-devel软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "开始安装liburing-devel软件包"
|
||||
dnf install -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装liburing-devel软件包失败"
|
||||
fi
|
||||
|
||||
# 测试日志查看功能
|
||||
LOG_INFO "测试liburing-devel软件包的日志查看功能"
|
||||
journalctl --unit=liburing > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "查看liburing服务日志失败"
|
||||
|
||||
# 如果之前未安装,则卸载liburing-devel软件包以恢复环境
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载liburing-devel软件包以恢复环境"
|
||||
dnf remove -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载liburing-devel软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-06-16
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试liburing-devel软件包提供的服务的重新加载配置功能
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查liburing-devel软件包是否已安装
|
||||
LOG_INFO "检查liburing-devel软件包是否已安装"
|
||||
rpm -q liburing-devel > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "liburing-devel软件包已安装,脚本结束时将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "liburing-devel软件包未安装,将在测试步骤中安装"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在liburing-devel软件包
|
||||
LOG_INFO "检查yum源中是否存在liburing-devel软件包"
|
||||
dnf list available liburing-devel > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到liburing-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装liburing-devel软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "开始安装liburing-devel软件包"
|
||||
dnf install -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装liburing-devel软件包失败"
|
||||
fi
|
||||
|
||||
# 测试服务的重新加载配置功能
|
||||
LOG_INFO "测试服务的重新加载配置功能"
|
||||
systemctl reload liburing.service > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "重新加载liburing服务配置失败"
|
||||
|
||||
# 清理环境:如果脚本开始时未安装,则卸载liburing-devel软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "清理环境:卸载liburing-devel软件包"
|
||||
dnf remove -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载liburing-devel软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试脚本执行完成"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,67 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-06-16
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试liburing-devel软件包提供的服务的重启功能
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
|
||||
# 检查liburing-devel软件包是否已安装
|
||||
LOG_INFO "检查liburing-devel软件包是否已安装"
|
||||
rpm -q liburing-devel > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "liburing-devel软件包已安装,脚本结束时将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "liburing-devel软件包未安装,将在测试结束后卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在liburing-devel软件包
|
||||
LOG_INFO "检查yum源中是否存在liburing-devel软件包"
|
||||
dnf list available liburing-devel > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到liburing-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装liburing-devel软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "开始安装liburing-devel软件包"
|
||||
dnf install -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装liburing-devel软件包失败"
|
||||
fi
|
||||
|
||||
# 测试服务的重启功能
|
||||
LOG_INFO "测试liburing-devel提供的服务的重启功能"
|
||||
systemctl restart liburing.service > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "重启liburing服务失败"
|
||||
|
||||
# 清理环境:如果脚本开始时未安装,则卸载软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "清理环境:卸载liburing-devel软件包"
|
||||
dnf remove -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载liburing-devel软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,90 +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-06-16
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试liburing-devel软件包提供的服务的配置恢复功能
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
|
||||
# 检查环境是否已安装liburing-devel
|
||||
LOG_INFO "检查是否已安装liburing-devel软件包..."
|
||||
rpm -q liburing-devel > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "liburing-devel软件包已安装,脚本结束时将保持安装状态。"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "liburing-devel软件包未安装,将在测试完成后卸载。"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在liburing-devel软件包
|
||||
LOG_INFO "检查yum源中是否存在liburing-devel软件包..."
|
||||
dnf list available liburing-devel > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到liburing-devel软件包,退出测试。"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "开始安装liburing-devel软件包..."
|
||||
dnf install -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装liburing-devel软件包失败"
|
||||
fi
|
||||
|
||||
# 测试服务的配置恢复功能
|
||||
LOG_INFO "测试liburing-devel服务配置恢复功能..."
|
||||
# 假设服务名为liburing-service(需根据实际服务名调整)
|
||||
systemctl restart liburing-service > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "重启liburing-service服务失败"
|
||||
|
||||
systemctl status liburing-service > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "检查liburing-service服务状态失败"
|
||||
|
||||
LOG_INFO "模拟配置恢复操作..."
|
||||
# 假设配置文件路径为/etc/liburing/config.conf(需根据实际路径调整)
|
||||
cp /etc/liburing/config.conf /etc/liburing/config.conf.bak > /dev/null 2>&1
|
||||
echo "test_config=1" >> /etc/liburing/config.conf
|
||||
|
||||
systemctl restart liburing-service > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "重启服务以应用新配置失败"
|
||||
|
||||
# 恢复原始配置并验证服务状态
|
||||
LOG_INFO "恢复原始配置并验证服务状态..."
|
||||
mv /etc/liburing/config.conf.bak /etc/liburing/config.conf > /dev/null 2>&1
|
||||
systemctl restart liburing-service > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "恢复配置后重启服务失败"
|
||||
|
||||
systemctl status liburing-service > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "恢复配置后检查服务状态失败"
|
||||
|
||||
LOG_INFO "liburying-devel服务配置恢复功能测试通过。"
|
||||
|
||||
# 清理环境:如果脚本开始时未安装,则卸载软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载liburying-devel软件包..."
|
||||
dnf remove -y liburying-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载liburying-devel软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复。"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-06-16
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试liburing-devel软件包提供的服务的启动功能
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查liburing-devel软件包是否已安装
|
||||
LOG_INFO "检查liburing-devel软件包是否已安装"
|
||||
rpm -q liburing-devel > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "liburing-devel软件包已安装,脚本结束时将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "liburing-devel软件包未安装,将在测试结束后卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在liburing-devel软件包
|
||||
LOG_INFO "检查yum源中是否存在liburing-devel软件包"
|
||||
dnf list available liburing-devel > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到liburing-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装liburing-devel软件包(如果未安装)
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "正在安装liburing-devel软件包"
|
||||
dnf install -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装liburing-devel软件包失败"
|
||||
fi
|
||||
|
||||
# 测试服务启动功能
|
||||
LOG_INFO "测试liburing-devel提供的服务启动功能"
|
||||
systemctl start liburing-service > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "启动liburing-service服务失败"
|
||||
|
||||
# 检查服务状态
|
||||
LOG_INFO "检查liburing-service服务状态"
|
||||
systemctl is-active liburing-service > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "liburing-service服务未正常运行"
|
||||
|
||||
# 停止服务以清理环境
|
||||
LOG_INFO "停止liburing-service服务"
|
||||
systemctl stop liburing-service > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "停止liburing-service服务失败"
|
||||
|
||||
# 卸载软件包(如果之前未安装)
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "正在卸载liburing-devel软件包"
|
||||
dnf remove -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载liburing-devel软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-06-16
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试liburing-devel软件包提供的服务的状态查询功能
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查liburing-devel软件包是否已安装
|
||||
LOG_INFO "检查liburing-devel软件包是否已安装"
|
||||
rpm -q liburing-devel > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "liburing-devel软件包已安装,跳过安装步骤"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "liburing-devel软件包未安装,准备安装"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在liburing-devel软件包
|
||||
LOG_INFO "检查yum源中是否存在liburing-devel软件包"
|
||||
dnf list available liburing-devel > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到liburing-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装liburing-devel软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "开始安装liburing-devel软件包"
|
||||
dnf install -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装liburing-devel软件包失败"
|
||||
fi
|
||||
|
||||
# 测试服务状态查询功能
|
||||
LOG_INFO "测试liburing-devel提供的服务状态查询功能"
|
||||
systemctl status liburing.service > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "查询liburing服务状态失败"
|
||||
|
||||
# 清理环境:如果脚本开始时未安装,则卸载软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "清理环境:卸载liburing-devel软件包"
|
||||
dnf remove -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载liburing-devel软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,67 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-06-16
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试liburing-devel软件包提供的服务的停止功能
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
|
||||
# 检查liburing-devel软件包是否已安装
|
||||
LOG_INFO "检查liburing-devel软件包是否已安装"
|
||||
rpm -q liburing-devel > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "liburing-devel软件包已安装,脚本结束后将保持安装状态"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "liburing-devel软件包未安装,将在测试步骤中安装"
|
||||
INSTALLED=0
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在liburing-devel软件包
|
||||
LOG_INFO "检查yum源中是否存在liburing-devel软件包"
|
||||
dnf list available liburing-devel > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到liburing-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装liburing-devel软件包
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "开始安装liburing-devel软件包"
|
||||
dnf install -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装liburing-devel软件包失败"
|
||||
fi
|
||||
|
||||
# 测试服务的停止功能
|
||||
LOG_INFO "测试liburing-devel提供的服务的停止功能"
|
||||
systemctl stop liburing.service > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "停止liburing服务失败"
|
||||
|
||||
# 清理环境:如果脚本开始时未安装,则卸载软件包
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "清理环境:卸载liburing-devel软件包"
|
||||
dnf remove -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载liburing-devel软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-06-16
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试liburing-devel软件包的升级功能
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
LOG_INFO "开始测试 liburing-devel 软件包的升级功能"
|
||||
|
||||
# 检查是否已安装 liburing-devel
|
||||
LOG_INFO "检查系统中是否已安装 liburing-devel"
|
||||
dnf list installed liburing-devel > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "liburing-devel 已安装,脚本结束后将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "liburing-devel 未安装,将在测试完成后卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查 yum 源中是否存在 liburing-devel 软件包
|
||||
LOG_INFO "检查 yum 源中是否存在 liburing-devel 软件包"
|
||||
dnf list available liburing-devel > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum 源中未找到 liburing-devel 软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装 liburing-devel
|
||||
LOG_INFO "安装 liburing-devel"
|
||||
dnf install -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装 liburing-devel 失败"
|
||||
|
||||
# 检查升级功能
|
||||
LOG_INFO "测试升级功能"
|
||||
dnf upgrade -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "升级 liburing-devel 失败"
|
||||
|
||||
# 清理环境
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载 liburing-devel"
|
||||
dnf remove -y liburing-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载 liburing-devel 失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,103 +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-24
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试portend库检查端口占用状态的功能
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试portend库检查端口占用状态的功能"
|
||||
|
||||
# 检查是否已安装python3-portend包
|
||||
LOG_INFO "检查是否已安装python3-portend包"
|
||||
if rpm -q python3-portend &> /dev/null; then
|
||||
LOG_INFO "python3-portend已安装,测试结束后将保持安装状态"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "python3-portend未安装,将在测试步骤中安装"
|
||||
INSTALLED=0
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有python3-portend包
|
||||
LOG_INFO "检查yum源中是否有python3-portend包"
|
||||
if ! dnf list available python3-portend &> /dev/null; then
|
||||
LOG_ERROR "yum源中未找到python3-portend包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装则安装python3-portend
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "安装python3-portend包"
|
||||
dnf install -y python3-portend
|
||||
CHECK_RESULT $? 0 0 "安装python3-portend失败"
|
||||
fi
|
||||
|
||||
# 测试portend库检查端口占用状态的功能
|
||||
LOG_INFO "测试portend库检查端口占用状态的功能"
|
||||
|
||||
# 使用python3测试portend库的check_port功能
|
||||
LOG_INFO "使用python3测试portend库的check_port功能"
|
||||
python3 << "EOF"
|
||||
import portend
|
||||
import socket
|
||||
|
||||
# 创建一个临时socket占用端口
|
||||
test_port = 9999
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
try:
|
||||
sock.bind(("localhost", test_port))
|
||||
sock.listen(1)
|
||||
|
||||
# 测试端口是否被占用
|
||||
try:
|
||||
portend.occupied("localhost", test_port)
|
||||
print("ERROR: 端口占用检查失败,应该检测到端口被占用")
|
||||
exit(1)
|
||||
except portend.Timeout:
|
||||
print("SUCCESS: 正确检测到端口被占用")
|
||||
|
||||
# 释放端口
|
||||
sock.close()
|
||||
|
||||
# 测试端口是否空闲
|
||||
try:
|
||||
portend.free("localhost", test_port)
|
||||
print("SUCCESS: 正确检测到端口空闲")
|
||||
except portend.Timeout:
|
||||
print("ERROR: 端口空闲检查失败,应该检测到端口空闲")
|
||||
exit(1)
|
||||
|
||||
except Exception as e:
|
||||
print(f"ERROR: 测试过程中发生错误: {e}")
|
||||
exit(1)
|
||||
EOF
|
||||
CHECK_RESULT $? 0 0 "portend库检查端口占用状态功能测试失败"
|
||||
|
||||
# 清理环境
|
||||
LOG_INFO "清理测试环境"
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "卸载测试过程中安装的python3-portend包"
|
||||
dnf remove -y python3-portend
|
||||
CHECK_RESULT $? 0 0 "卸载python3-portend失败"
|
||||
else
|
||||
LOG_INFO "保持python3-portend包的安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-02-24
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试python3-portend软件包的基本安装功能
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 检查是否已经安装了python3-portend软件包
|
||||
LOG_INFO "检查python3-portend软件包是否已安装"
|
||||
rpm -q python3-portend > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "python3-portend软件包已安装,脚本结束后将保持安装状态"
|
||||
already_installed=1
|
||||
else
|
||||
LOG_INFO "python3-portend软件包未安装,将在测试过程中安装"
|
||||
already_installed=0
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有python3-portend软件包
|
||||
LOG_INFO "检查yum源中是否有python3-portend软件包"
|
||||
dnf list available python3-portend > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中没有python3-portend软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装python3-portend软件包
|
||||
if [ $already_installed -eq 0 ]; then
|
||||
LOG_INFO "安装python3-portend软件包"
|
||||
dnf install -y python3-portend
|
||||
CHECK_RESULT $? 0 0 "安装python3-portend软件包失败"
|
||||
fi
|
||||
|
||||
# 验证python3-portend软件包是否安装成功
|
||||
LOG_INFO "验证python3-portend软件包是否安装成功"
|
||||
rpm -q python3-portend > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "python3-portend软件包安装验证失败"
|
||||
|
||||
# 测试python3-portend软件包的基本功能
|
||||
LOG_INFO "测试python3-portend软件包的基本功能"
|
||||
python3 -c "import portend; print(portend.__version__)" > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "python3-portend软件包基本功能测试失败"
|
||||
|
||||
# 清理环境:如果之前未安装,则卸载python3-portend软件包
|
||||
if [ $already_installed -eq 0 ]; then
|
||||
LOG_INFO "卸载python3-portend软件包"
|
||||
dnf remove -y python3-portend
|
||||
CHECK_RESULT $? 0 0 "卸载python3-portend软件包失败"
|
||||
|
||||
# 验证python3-portend软件包是否已卸载
|
||||
LOG_INFO "验证python3-portend软件包是否已卸载"
|
||||
rpm -q python3-portend > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_ERROR "python3-portend软件包卸载失败"
|
||||
exit 1
|
||||
else
|
||||
LOG_INFO "python3-portend软件包已成功卸载"
|
||||
fi
|
||||
else
|
||||
LOG_INFO "保持python3-portend软件包的安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "python3-portend软件包基本安装功能测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,198 +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-24
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试portend库等待端口可用的功能
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 定义变量
|
||||
PYTHON3_PORTEND_PKG="python3-portend"
|
||||
TEST_PORT=8888
|
||||
TEST_TIMEOUT=5
|
||||
NODE2_IPV4=""
|
||||
NODE2_PASSWORD=""
|
||||
NODE2_USER=""
|
||||
|
||||
# 步骤1: 检查yum源中是否存在python3-portend软件包
|
||||
LOG_INFO "步骤1: 检查yum源中是否存在$PYTHON3_PORTEND_PKG软件包"
|
||||
dnf list available $PYTHON3_PORTEND_PKG > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到$PYTHON3_PORTEND_PKG软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 步骤2: 检查是否已安装python3-portend
|
||||
LOG_INFO "步骤2: 检查是否已安装$PYTHON3_PORTEND_PKG"
|
||||
IS_INSTALLED=0
|
||||
rpm -q $PYTHON3_PORTEND_PKG > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "$PYTHON3_PORTEND_PKG已安装"
|
||||
IS_INSTALLED=1
|
||||
else
|
||||
LOG_INFO "$PYTHON3_PORTEND_PKG未安装"
|
||||
IS_INSTALLED=0
|
||||
fi
|
||||
|
||||
# 步骤3: 如果未安装,则安装python3-portend
|
||||
if [ $IS_INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "步骤3: 安装$PYTHON3_PORTEND_PKG"
|
||||
dnf install -y $PYTHON3_PORTEND_PKG
|
||||
CHECK_RESULT $? 0 0 "安装$PYTHON3_PORTEND_PKG失败"
|
||||
fi
|
||||
|
||||
# 步骤4: 检查wait_for_port命令是否存在
|
||||
LOG_INFO "步骤4: 检查wait_for_port命令是否存在"
|
||||
python3 -c "import portend; print(dir(portend))" 2>/dev/null | grep -q wait_for_port
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "wait_for_port命令不存在或不支持"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 步骤5: 测试wait_for_port功能 - 端口未监听情况
|
||||
LOG_INFO "步骤5: 测试wait_for_port功能 - 端口未监听情况"
|
||||
timeout $TEST_TIMEOUT python3 -c "
|
||||
import portend
|
||||
import socket
|
||||
try:
|
||||
portend.wait_for_port("localhost", $TEST_PORT, timeout=$TEST_TIMEOUT)
|
||||
except portend.Timeout:
|
||||
print("SUCCESS: 端口未监听,等待超时符合预期")
|
||||
except Exception as e:
|
||||
print(f"FAILURE: 发生异常: {e}")
|
||||
exit(1)
|
||||
" > /tmp/port_test.log 2>&1
|
||||
|
||||
if grep -q "SUCCESS" /tmp/port_test.log; then
|
||||
LOG_INFO "端口未监听测试通过"
|
||||
else
|
||||
LOG_ERROR "端口未监听测试失败"
|
||||
cat /tmp/port_test.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 步骤6: 测试wait_for_port功能 - 端口已监听情况
|
||||
LOG_INFO "步骤6: 测试wait_for_port功能 - 端口已监听情况"
|
||||
|
||||
# 启动临时服务监听端口
|
||||
python3 -m http.server $TEST_PORT > /dev/null 2>&1 &
|
||||
SERVER_PID=$!
|
||||
sleep 2
|
||||
|
||||
python3 -c "
|
||||
import portend
|
||||
try:
|
||||
portend.wait_for_port("localhost", $TEST_PORT, timeout=2)
|
||||
print("SUCCESS: 端口已监听,等待成功")
|
||||
except Exception as e:
|
||||
print(f"FAILURE: 发生异常: {e}")
|
||||
exit(1)
|
||||
" > /tmp/port_test2.log 2>&1
|
||||
|
||||
# 停止临时服务
|
||||
kill $SERVER_PID 2>/dev/null
|
||||
wait $SERVER_PID 2>/dev/null
|
||||
|
||||
if grep -q "SUCCESS" /tmp/port_test2.log; then
|
||||
LOG_INFO "端口已监听测试通过"
|
||||
else
|
||||
LOG_ERROR "端口已监听测试失败"
|
||||
cat /tmp/port_test2.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 步骤7: 测试wait_for_port参数验证
|
||||
LOG_INFO "步骤7: 测试wait_for_port参数验证"
|
||||
|
||||
# 测试无效主机名
|
||||
python3 -c "
|
||||
import portend
|
||||
try:
|
||||
portend.wait_for_port("invalid_hostname_xyz", 80, timeout=1)
|
||||
except socket.gaierror:
|
||||
print("SUCCESS: 无效主机名测试通过")
|
||||
except Exception as e:
|
||||
print(f"FAILURE: 无效主机名测试失败: {e}")
|
||||
exit(1)
|
||||
" > /tmp/port_test3.log 2>&1
|
||||
|
||||
if grep -q "SUCCESS" /tmp/port_test3.log; then
|
||||
LOG_INFO "无效主机名参数测试通过"
|
||||
else
|
||||
LOG_ERROR "无效主机名参数测试失败"
|
||||
cat /tmp/port_test3.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 步骤8: 多节点测试(如果配置了第二个节点)
|
||||
if [ -n "$NODE2_IPV4" ] && [ -n "$NODE2_USER" ] && [ -n "$NODE2_PASSWORD" ]; then
|
||||
LOG_INFO "步骤8: 在第二个节点上测试wait_for_port功能"
|
||||
|
||||
# 在第二个节点上安装python3-portend
|
||||
SSH_CMD "dnf install -y $PYTHON3_PORTEND_PKG" $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER
|
||||
CHECK_RESULT $? 0 0 "在节点2上安装$PYTHON3_PORTEND_PKG失败"
|
||||
|
||||
# 在第二个节点上启动服务
|
||||
SSH_CMD "python3 -m http.server $TEST_PORT > /dev/null 2>&1 & echo \$!" $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER > /tmp/node2_pid
|
||||
NODE2_PID=$(cat /tmp/node2_pid)
|
||||
sleep 2
|
||||
|
||||
# 在本地测试连接第二个节点的端口
|
||||
python3 -c "
|
||||
import portend
|
||||
try:
|
||||
portend.wait_for_port("$NODE2_IPV4", $TEST_PORT, timeout=3)
|
||||
print("SUCCESS: 跨节点端口等待测试通过")
|
||||
except Exception as e:
|
||||
print(f"FAILURE: 跨节点端口等待测试失败: {e}")
|
||||
exit(1)
|
||||
" > /tmp/port_test4.log 2>&1
|
||||
|
||||
# 停止第二个节点上的服务
|
||||
SSH_CMD "kill $NODE2_PID 2>/dev/null" $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER
|
||||
|
||||
if grep -q "SUCCESS" /tmp/port_test4.log; then
|
||||
LOG_INFO "跨节点端口等待测试通过"
|
||||
else
|
||||
LOG_ERROR "跨节点端口等待测试失败"
|
||||
cat /tmp/port_test4.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 卸载第二个节点上的软件包
|
||||
SSH_CMD "dnf remove -y $PYTHON3_PORTEND_PKG" $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER
|
||||
fi
|
||||
|
||||
# 步骤9: 环境清理
|
||||
LOG_INFO "步骤9: 环境清理"
|
||||
|
||||
# 清理临时文件
|
||||
rm -f /tmp/port_test*.log /tmp/node2_pid 2>/dev/null
|
||||
|
||||
# 如果测试前未安装,则卸载软件包
|
||||
if [ $IS_INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "卸载$PYTHON3_PORTEND_PKG软件包"
|
||||
dnf remove -y $PYTHON3_PORTEND_PKG
|
||||
CHECK_RESULT $? 0 0 "卸载$PYTHON3_PORTEND_PKG失败"
|
||||
else
|
||||
LOG_INFO "保持$PYTHON3_PORTEND_PKG安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:portend库等待端口可用功能测试通过"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-03
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test installation of texlive-dowith
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 测试脚本:test_texlive-dowith_function_install
|
||||
|
||||
LOG_INFO "开始测试:Test installation of texlive-dowith"
|
||||
|
||||
# 检查是否已安装texlive-dowith
|
||||
if dnf list installed texlive-dowith &>/dev/null; then
|
||||
LOG_INFO "texlive-dowith已安装,测试将保持安装状态"
|
||||
installed=true
|
||||
else
|
||||
LOG_INFO "texlive-dowith未安装,测试将执行安装步骤"
|
||||
installed=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有texlive-dowith软件包
|
||||
LOG_INFO "检查yum源中是否存在texlive-dowith软件包"
|
||||
if ! dnf list available texlive-dowith &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到texlive-dowith软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则执行安装
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "开始安装texlive-dowith"
|
||||
dnf install -y texlive-dowith
|
||||
CHECK_RESULT $? 0 0 "安装texlive-dowith失败"
|
||||
fi
|
||||
|
||||
# 测试命令参数是否支持(假设命令为texlive-dowith --version)
|
||||
LOG_INFO "测试texlive-dowith命令参数支持情况"
|
||||
texlive-dowith --version &>/dev/null
|
||||
CHECK_RESULT $? 0 0 "texlive-dowith命令参数不支持"
|
||||
|
||||
# 如果之前未安装,则在测试完成后卸载
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "测试完成,卸载texlive-dowith"
|
||||
dnf remove -y texlive-dowith
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-dowith失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:Test installation of texlive-dowith"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-08
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Verify documentation files exist
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 定义测试的软件包名称
|
||||
PACKAGE_NAME="texlive-ipaex-type1-doc"
|
||||
|
||||
# 步骤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
|
||||
LOG_INFO "yum源中存在${PACKAGE_NAME}软件包"
|
||||
|
||||
# 步骤2: 检查当前环境是否已安装软件包
|
||||
LOG_INFO "步骤2: 检查当前环境是否已安装${PACKAGE_NAME}"
|
||||
rpm -q ${PACKAGE_NAME} &>/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "${PACKAGE_NAME}已安装,标记为已安装状态"
|
||||
INSTALLED="true"
|
||||
else
|
||||
LOG_INFO "${PACKAGE_NAME}未安装,标记为未安装状态"
|
||||
INSTALLED="false"
|
||||
fi
|
||||
|
||||
# 步骤3: 如果未安装,则安装软件包作为测试步骤
|
||||
if [ "${INSTALLED}" = "false" ]; then
|
||||
LOG_INFO "步骤3: 安装${PACKAGE_NAME}软件包"
|
||||
dnf install -y ${PACKAGE_NAME}
|
||||
CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败"
|
||||
LOG_INFO "成功安装${PACKAGE_NAME}软件包"
|
||||
fi
|
||||
|
||||
# 步骤4: 验证文档文件是否存在
|
||||
LOG_INFO "步骤4: 验证${PACKAGE_NAME}的文档文件是否存在"
|
||||
# 获取软件包安装的文件列表,筛选出文档文件(通常位于/usr/share/doc目录下)
|
||||
rpm -ql ${PACKAGE_NAME} | grep -E "^/usr/share/doc" | head -5 > /tmp/doc_files.txt
|
||||
if [ -s /tmp/doc_files.txt ]; then
|
||||
LOG_INFO "找到以下文档文件:"
|
||||
cat /tmp/doc_files.txt | while read file; do
|
||||
if [ -f "$file" ]; then
|
||||
LOG_INFO "文件存在: $file"
|
||||
else
|
||||
LOG_ERROR "文件不存在: $file"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
CHECK_RESULT $? 0 0 "文档文件验证失败"
|
||||
else
|
||||
LOG_ERROR "未找到任何文档文件"
|
||||
exit 1
|
||||
fi
|
||||
LOG_INFO "文档文件验证成功"
|
||||
|
||||
# 步骤5: 环境恢复
|
||||
LOG_INFO "步骤5: 恢复测试环境"
|
||||
if [ "${INSTALLED}" = "false" ]; then
|
||||
LOG_INFO "卸载${PACKAGE_NAME}软件包"
|
||||
dnf remove -y ${PACKAGE_NAME}
|
||||
CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败"
|
||||
LOG_INFO "成功卸载${PACKAGE_NAME}软件包"
|
||||
else
|
||||
LOG_INFO "测试前已安装${PACKAGE_NAME},保持安装状态"
|
||||
fi
|
||||
|
||||
# 清理临时文件
|
||||
rm -f /tmp/doc_files.txt
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-11-26
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test basic template functionality
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 测试脚本:test_texlive-ku-template_function_basic
|
||||
|
||||
LOG_INFO "开始测试:Test basic template functionality"
|
||||
|
||||
# 检查是否已安装软件包
|
||||
LOG_INFO "检查环境是否已安装软件包"
|
||||
if dnf list installed texlive-ku-template &>/dev/null; then
|
||||
LOG_INFO "环境已安装软件包,测试结束后将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "环境未安装软件包,测试结束后将卸载软件包"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有该软件包
|
||||
LOG_INFO "检查yum源中是否有texlive-ku-template软件包"
|
||||
if ! dnf list available texlive-ku-template &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到texlive-ku-template软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "安装texlive-ku-template软件包"
|
||||
dnf install -y texlive-ku-template
|
||||
CHECK_RESULT $? 0 0 "安装texlive-ku-template失败"
|
||||
fi
|
||||
|
||||
# 测试基本功能
|
||||
LOG_INFO "测试基本功能"
|
||||
texlive-ku-template --version
|
||||
CHECK_RESULT $? 0 0 "获取texlive-ku-template版本失败"
|
||||
|
||||
# 测试不支持参数的情况
|
||||
LOG_INFO "测试不支持参数的情况"
|
||||
texlive-ku-template --invalid-arg &>/dev/null
|
||||
if [ $? -ne 255 ]; then
|
||||
LOG_ERROR "不支持参数时未返回预期退出码255"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 清理环境
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载texlive-ku-template软件包"
|
||||
dnf remove -y texlive-ku-template
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-ku-template失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:Test basic template functionality"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,94 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-04-01
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test verification that the package is installed
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 定义颜色和日志函数
|
||||
LOG_INFO() {
|
||||
echo -e "\033[32m[INFO]\033[0m $1"
|
||||
}
|
||||
LOG_ERROR() {
|
||||
echo -e "\033[31m[ERROR]\033[0m $1"
|
||||
}
|
||||
|
||||
# 定义软件包名称
|
||||
PACKAGE_NAME="texlive-ku-template"
|
||||
|
||||
# 步骤1:检查软件包是否在yum源中
|
||||
LOG_INFO "步骤1:检查软件包是否在yum源中"
|
||||
dnf list available $PACKAGE_NAME &>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中"
|
||||
exit 255
|
||||
fi
|
||||
LOG_INFO "软件包 $PACKAGE_NAME 在yum源中"
|
||||
|
||||
# 步骤2:检查当前是否已安装软件包
|
||||
LOG_INFO "步骤2:检查当前是否已安装软件包"
|
||||
dnf list installed $PACKAGE_NAME &>/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "软件包 $PACKAGE_NAME 已安装"
|
||||
ALREADY_INSTALLED=1
|
||||
else
|
||||
LOG_INFO "软件包 $PACKAGE_NAME 未安装"
|
||||
ALREADY_INSTALLED=0
|
||||
fi
|
||||
|
||||
# 步骤3:如果未安装,则安装软件包
|
||||
if [ $ALREADY_INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME"
|
||||
dnf install -y $PACKAGE_NAME
|
||||
CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败"
|
||||
LOG_INFO "软件包 $PACKAGE_NAME 安装成功"
|
||||
fi
|
||||
|
||||
# 步骤4:验证软件包安装
|
||||
LOG_INFO "步骤4:验证软件包安装"
|
||||
dnf list installed $PACKAGE_NAME &>/dev/null
|
||||
CHECK_RESULT $? 0 0 "验证软件包 $PACKAGE_NAME 安装失败"
|
||||
LOG_INFO "软件包 $PACKAGE_NAME 验证安装成功"
|
||||
|
||||
# 步骤5:执行功能测试
|
||||
LOG_INFO "步骤5:执行功能测试"
|
||||
# 这里可以添加针对软件包的具体功能测试命令
|
||||
# 例如:检查某个命令是否存在或执行某个命令
|
||||
# 假设我们检查软件包提供的某个命令是否存在
|
||||
# 这里以检查是否存在 "ku-template" 命令为例(实际命令可能需要调整)
|
||||
if command -v ku-template &>/dev/null; then
|
||||
LOG_INFO "软件包 $PACKAGE_NAME 提供的命令存在"
|
||||
else
|
||||
LOG_INFO "软件包 $PACKAGE_NAME 未提供特定命令,跳过命令检查"
|
||||
fi
|
||||
|
||||
# 步骤6:清理环境
|
||||
LOG_INFO "步骤6:清理环境"
|
||||
if [ $ALREADY_INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "卸载软件包 $PACKAGE_NAME"
|
||||
dnf remove -y $PACKAGE_NAME
|
||||
CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败"
|
||||
LOG_INFO "软件包 $PACKAGE_NAME 卸载成功"
|
||||
else
|
||||
LOG_INFO "软件包 $PACKAGE_NAME 在脚本执行前已安装,保持安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:验证软件包 $PACKAGE_NAME 安装功能"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-01
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test generating a document using the template
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "测试开始:Test generating a document using the template"
|
||||
|
||||
# 检查是否已安装texlive-ku-template
|
||||
LOG_INFO "步骤1:检查texlive-ku-template是否已安装"
|
||||
rpm -q texlive-ku-template > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-ku-template已安装"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "texlive-ku-template未安装"
|
||||
INSTALLED=0
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有texlive-ku-template软件包
|
||||
LOG_INFO "步骤2:检查yum源中是否有texlive-ku-template软件包"
|
||||
dnf list available texlive-ku-template > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "yum源中不存在texlive-ku-template软件包"
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中不存在texlive-ku-template软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "步骤3:安装texlive-ku-template软件包"
|
||||
dnf install -y texlive-ku-template
|
||||
CHECK_RESULT $? 0 0 "安装texlive-ku-template失败"
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "安装texlive-ku-template失败"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# 检查命令参数是否支持
|
||||
LOG_INFO "步骤4:检查命令参数是否支持"
|
||||
command -v latex > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "latex命令不存在"
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "latex命令不存在或不支持"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 生成文档
|
||||
LOG_INFO "步骤5:使用模板生成文档"
|
||||
cat > test_document.tex << "EOF"
|
||||
\documentclass{ku-template}
|
||||
\begin{document}
|
||||
This is a test document generated using ku-template.
|
||||
\end{document}
|
||||
EOF
|
||||
CHECK_RESULT $? 0 0 "创建测试文档失败"
|
||||
|
||||
# 编译文档
|
||||
LOG_INFO "步骤6:编译文档"
|
||||
pdflatex test_document.tex > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "编译文档失败"
|
||||
|
||||
# 检查生成的PDF文件是否存在
|
||||
LOG_INFO "步骤7:检查生成的PDF文件是否存在"
|
||||
[ -f test_document.pdf ]
|
||||
CHECK_RESULT $? 0 0 "PDF文件未生成"
|
||||
|
||||
# 清理生成的文件
|
||||
LOG_INFO "步骤8:清理生成的文件"
|
||||
rm -f test_document.tex test_document.pdf test_document.log test_document.aux test_document.out
|
||||
|
||||
# 如果脚本开始前未安装,则在结束时卸载软件包
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "步骤9:卸载texlive-ku-template软件包"
|
||||
dnf remove -y texlive-ku-template
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-ku-template失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试结束:Test generating a document using the template"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-01
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test installation of the texlive-ku-template package
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试:Test installation of the texlive-ku-template package"
|
||||
|
||||
# 检查是否已安装texlive-ku-template
|
||||
LOG_INFO "检查texlive-ku-template是否已安装"
|
||||
dnf list installed texlive-ku-template > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-ku-template已安装,测试结束时将保持安装状态"
|
||||
ALREADY_INSTALLED=1
|
||||
else
|
||||
LOG_INFO "texlive-ku-template未安装,将执行安装测试"
|
||||
ALREADY_INSTALLED=0
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在texlive-ku-template软件包
|
||||
LOG_INFO "检查yum源中是否存在texlive-ku-template软件包"
|
||||
dnf list available texlive-ku-template > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到texlive-ku-template软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则执行安装
|
||||
if [ $ALREADY_INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "开始安装texlive-ku-template"
|
||||
dnf install -y texlive-ku-template
|
||||
CHECK_RESULT $? 0 0 "安装texlive-ku-template失败"
|
||||
LOG_INFO "texlive-ku-template安装成功"
|
||||
fi
|
||||
|
||||
# 验证安装是否成功
|
||||
LOG_INFO "验证texlive-ku-template安装是否成功"
|
||||
rpm -q texlive-ku-template > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "验证texlive-ku-template安装失败"
|
||||
|
||||
# 测试软件包功能(示例:检查是否包含特定文件)
|
||||
LOG_INFO "测试texlive-ku-template功能:检查是否包含模板文件"
|
||||
rpm -ql texlive-ku-template | grep -q "\.tex$"
|
||||
CHECK_RESULT $? 0 0 "texlive-ku-template未包含预期的.tex模板文件"
|
||||
|
||||
# 清理环境:如果测试前未安装,则卸载软件包
|
||||
if [ $ALREADY_INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "清理环境:卸载texlive-ku-template"
|
||||
dnf remove -y texlive-ku-template
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-ku-template失败"
|
||||
LOG_INFO "texlive-ku-template卸载成功"
|
||||
else
|
||||
LOG_INFO "测试前已安装texlive-ku-template,保持安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:Test installation of the texlive-ku-template package"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-04-01
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test uninstallation of the texlive-ku-template package
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
PACKAGE_NAME="texlive-ku-template"
|
||||
LOG_INFO "开始测试软件包 ${PACKAGE_NAME} 的卸载功能"
|
||||
LOG_INFO "步骤1:检查yum源中是否存在 ${PACKAGE_NAME} 软件包"
|
||||
dnf list available ${PACKAGE_NAME} 2>/dev/null | grep -q ${PACKAGE_NAME}
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到软件包 ${PACKAGE_NAME}"
|
||||
exit 255
|
||||
fi
|
||||
LOG_INFO "软件包 ${PACKAGE_NAME} 在yum源中存在"
|
||||
LOG_INFO "步骤2:检查当前环境是否已安装 ${PACKAGE_NAME}"
|
||||
rpm -q ${PACKAGE_NAME} >/dev/null 2>&1
|
||||
ALREADY_INSTALLED=$?
|
||||
if [ ${ALREADY_INSTALLED} -eq 0 ]; then
|
||||
LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,测试后保持安装状态"
|
||||
NEED_CLEANUP=0
|
||||
else
|
||||
LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,将执行安装作为测试步骤"
|
||||
NEED_CLEANUP=1
|
||||
LOG_INFO "步骤3:安装软件包 ${PACKAGE_NAME}"
|
||||
dnf install -y ${PACKAGE_NAME}
|
||||
CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败"
|
||||
LOG_INFO "软件包 ${PACKAGE_NAME} 安装成功"
|
||||
fi
|
||||
LOG_INFO "步骤4:卸载软件包 ${PACKAGE_NAME}"
|
||||
dnf remove -y ${PACKAGE_NAME}
|
||||
CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败"
|
||||
LOG_INFO "软件包 ${PACKAGE_NAME} 卸载成功"
|
||||
LOG_INFO "步骤5:验证软件包 ${PACKAGE_NAME} 已卸载"
|
||||
rpm -q ${PACKAGE_NAME} >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_ERROR "软件包 ${PACKAGE_NAME} 卸载后仍可查询到"
|
||||
exit 1
|
||||
else
|
||||
LOG_INFO "软件包 ${PACKAGE_NAME} 已成功卸载"
|
||||
fi
|
||||
if [ ${NEED_CLEANUP} -eq 1 ]; then
|
||||
LOG_INFO "步骤6:清理环境,重新安装软件包 ${PACKAGE_NAME} 以恢复原状"
|
||||
dnf install -y ${PACKAGE_NAME}
|
||||
CHECK_RESULT $? 0 0 "重新安装软件包 ${PACKAGE_NAME} 失败"
|
||||
LOG_INFO "环境已恢复,软件包 ${PACKAGE_NAME} 已安装"
|
||||
else
|
||||
LOG_INFO "步骤6:恢复环境,重新安装软件包 ${PACKAGE_NAME}"
|
||||
dnf install -y ${PACKAGE_NAME}
|
||||
CHECK_RESULT $? 0 0 "重新安装软件包 ${PACKAGE_NAME} 失败"
|
||||
LOG_INFO "环境已恢复,软件包 ${PACKAGE_NAME} 已安装"
|
||||
fi
|
||||
LOG_INFO "测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-31
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test dependency check
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 测试依赖检查功能
|
||||
LOG_INFO "开始测试依赖检查功能"
|
||||
|
||||
# 检查是否已经安装了texlive-langsci-doc软件包
|
||||
LOG_INFO "步骤1:检查texlive-langsci-doc是否已安装"
|
||||
if dnf list installed texlive-langsci-doc &>/dev/null; then
|
||||
LOG_INFO "texlive-langsci-doc已安装,测试结束后将保持安装状态"
|
||||
already_installed=true
|
||||
else
|
||||
LOG_INFO "texlive-langsci-doc未安装,将在测试过程中安装"
|
||||
already_installed=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有该软件包
|
||||
LOG_INFO "步骤2:检查yum源中是否有texlive-langsci-doc软件包"
|
||||
dnf list available texlive-langsci-doc &>/dev/null
|
||||
CHECK_RESULT $? 0 0 "yum源中未找到texlive-langsci-doc软件包"
|
||||
|
||||
# 安装软件包(如果未安装)
|
||||
if [ "$already_installed" = false ]; then
|
||||
LOG_INFO "步骤3:安装texlive-langsci-doc软件包"
|
||||
dnf install -y texlive-langsci-doc
|
||||
CHECK_RESULT $? 0 0 "安装texlive-langsci-doc失败"
|
||||
fi
|
||||
|
||||
# 测试依赖检查功能
|
||||
LOG_INFO "步骤4:执行依赖检查命令"
|
||||
# 这里假设依赖检查命令是检查texlive-langsci-doc的依赖
|
||||
# 实际命令需要根据具体测试需求调整
|
||||
if command -v rpm &>/dev/null; then
|
||||
rpm -qR texlive-langsci-doc
|
||||
CHECK_RESULT $? 0 0 "依赖检查失败"
|
||||
else
|
||||
LOG_ERROR "rpm命令不存在"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 测试命令参数检查
|
||||
LOG_INFO "步骤5:测试无效参数处理"
|
||||
# 假设依赖检查命令不支持--invalid-option参数
|
||||
# 实际命令和参数需要根据具体测试需求调整
|
||||
rpm --invalid-option &>/dev/null
|
||||
if [ $? -eq 255 ] || [ $? -eq 1 ]; then
|
||||
LOG_INFO "无效参数被正确拒绝"
|
||||
else
|
||||
LOG_ERROR "无效参数未被正确处理"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 清理环境(如果测试前未安装)
|
||||
if [ "$already_installed" = false ]; then
|
||||
LOG_INFO "步骤6:卸载测试安装的软件包"
|
||||
dnf remove -y texlive-langsci-doc
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-langsci-doc失败"
|
||||
|
||||
# 验证卸载是否成功
|
||||
dnf list installed texlive-langsci-doc &>/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_ERROR "卸载后软件包仍然存在"
|
||||
exit 1
|
||||
else
|
||||
LOG_INFO "软件包已成功卸载"
|
||||
fi
|
||||
else
|
||||
LOG_INFO "步骤6:测试前已安装,保持安装状态不卸载"
|
||||
fi
|
||||
|
||||
LOG_INFO "依赖检查功能测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-31
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test documentation access
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试:Test documentation access"
|
||||
LOG_INFO "步骤1:检查系统中是否已安装texlive-langsci-doc软件包"
|
||||
rpm -q texlive-langsci-doc
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-langsci-doc已安装,标记为安装状态"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "texlive-langsci-doc未安装,标记为未安装状态"
|
||||
INSTALLED=0
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤2:检查yum源中是否存在texlive-langsci-doc软件包"
|
||||
dnf list available texlive-langsci-doc
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到texlive-langsci-doc软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤3:如果未安装,则安装texlive-langsci-doc软件包"
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
dnf install -y texlive-langsci-doc
|
||||
CHECK_RESULT $? 0 0 "安装texlive-langsci-doc失败"
|
||||
LOG_INFO "安装texlive-langsci-doc成功"
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤4:测试texlive-langsci-doc文档访问功能"
|
||||
if command -v texdoc >/dev/null 2>&1; then
|
||||
LOG_INFO "使用texdoc命令访问texlive-langsci-doc文档"
|
||||
texdoc langsci
|
||||
CHECK_RESULT $? 0 0 "使用texdoc访问texlive-langsci-doc文档失败"
|
||||
LOG_INFO "texdoc访问texlive-langsci-doc文档成功"
|
||||
else
|
||||
LOG_ERROR "系统中未找到texdoc命令"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤5:清理环境,恢复原始状态"
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "卸载测试安装的texlive-langsci-doc软件包"
|
||||
dnf remove -y texlive-langsci-doc
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-langsci-doc失败"
|
||||
LOG_INFO "卸载texlive-langsci-doc成功"
|
||||
else
|
||||
LOG_INFO "系统原本已安装texlive-langsci-doc,保持安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:Test documentation access"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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 : 2026-03-31
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test package version query
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试:Test package version query"
|
||||
LOG_INFO "步骤1:检查是否已安装texlive-langsci-doc软件包"
|
||||
rpm -q texlive-langsci-doc
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-langsci-doc已安装,测试结束后将保持安装状态"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "texlive-langsci-doc未安装,将在测试过程中安装并在测试结束后卸载"
|
||||
INSTALLED=0
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤2:检查yum源中是否有texlive-langsci-doc软件包"
|
||||
dnf list available texlive-langsci-doc
|
||||
CHECK_RESULT $? 0 0 "yum源中未找到texlive-langsci-doc软件包"
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到texlive-langsci-doc软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "步骤3:安装texlive-langsci-doc软件包"
|
||||
dnf install -y texlive-langsci-doc
|
||||
CHECK_RESULT $? 0 0 "安装texlive-langsci-doc软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤4:测试查询texlive-langsci-doc软件包版本"
|
||||
rpm -q --queryformat "%{VERSION}-%{RELEASE}\n" texlive-langsci-doc
|
||||
CHECK_RESULT $? 0 0 "查询texlive-langsci-doc软件包版本失败"
|
||||
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "步骤5:卸载texlive-langsci-doc软件包"
|
||||
dnf remove -y texlive-langsci-doc
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-langsci-doc软件包失败"
|
||||
LOG_INFO "环境已恢复,texlive-langsci-doc软件包已卸载"
|
||||
else
|
||||
LOG_INFO "环境已恢复,保持texlive-langsci-doc软件包安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:Test package version query"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-11-26
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test the Roboto font rendering in LaTeX documents
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查是否已安装texlive-roboto字体包
|
||||
LOG_INFO "检查是否已安装texlive-roboto字体包"
|
||||
rpm -q texlive-roboto > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-roboto字体包已安装"
|
||||
installed=true
|
||||
else
|
||||
LOG_INFO "texlive-roboto字体包未安装"
|
||||
installed=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在texlive-roboto字体包
|
||||
LOG_INFO "检查yum源中是否存在texlive-roboto字体包"
|
||||
dnf list available texlive-roboto > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中不存在texlive-roboto字体包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 若未安装则安装texlive-roboto字体包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "开始安装texlive-roboto字体包"
|
||||
dnf install -y texlive-roboto > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装texlive-roboto字体包失败"
|
||||
LOG_INFO "texlive-roboto字体包安装成功"
|
||||
fi
|
||||
|
||||
# 测试Roboto字体的渲染功能
|
||||
LOG_INFO "测试Roboto字体的渲染功能"
|
||||
cat > test_roboto.tex << EOF
|
||||
\documentclass{article}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage{roboto}
|
||||
\begin{document}
|
||||
\fontfamily{Roboto-LF}\selectfont
|
||||
This is a test document using Roboto font.
|
||||
\end{document}
|
||||
EOF
|
||||
|
||||
pdflatex test_roboto.tex > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "Roboto字体渲染测试失败"
|
||||
|
||||
# 清理生成的临时文件
|
||||
LOG_INFO "清理生成的临时文件"
|
||||
rm -f test_roboto.tex test_roboto.log test_robotype.aux test_robotest.pdf > /dev/null 2>&1
|
||||
|
||||
# 若脚本开始时未安装,则在结束时卸载软件包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载texlive-roboto字体包"
|
||||
dnf remove -y texlive-robotype > /dev/null type2>&type1
|
||||
CHECK_RESULT $? type0 type0 "卸载texlivetype-robototype字体type失败type"
|
||||
fi
|
||||
|
||||
LOG_INFOtype"测试完成type,环境已恢复type"type
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,104 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-02-23
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test using Roboto font in a basic LaTeX document
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 定义颜色代码(用于日志输出)
|
||||
RED="\033[0;31m"
|
||||
GREEN="\033[0;32m"
|
||||
NC="\033[0m"
|
||||
|
||||
# 定义日志函数
|
||||
LOG_INFO() {
|
||||
echo -e "${GREEN}[INFO]${NC} $1"
|
||||
}
|
||||
|
||||
LOG_ERROR() {
|
||||
echo -e "${RED}[ERROR]${NC} $1"
|
||||
}
|
||||
|
||||
# 定义软件包名称
|
||||
PACKAGE_NAME="texlive-roboto"
|
||||
|
||||
# 步骤1:检查软件包是否在yum源中
|
||||
LOG_INFO "步骤1:检查软件包是否在yum源中"
|
||||
if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then
|
||||
LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 步骤2:检查环境是否已安装软件包
|
||||
LOG_INFO "步骤2:检查环境是否已安装软件包"
|
||||
if rpm -q "$PACKAGE_NAME" &>/dev/null; then
|
||||
LOG_INFO "软件包 $PACKAGE_NAME 已安装"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "软件包 $PACKAGE_NAME 未安装"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 步骤3:如果未安装,则安装软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME"
|
||||
dnf install -y "$PACKAGE_NAME"
|
||||
CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败"
|
||||
fi
|
||||
|
||||
# 步骤4:测试使用Roboto字体在基本LaTeX文档中
|
||||
LOG_INFO "步骤4:测试使用Roboto字体在基本LaTeX文档中"
|
||||
|
||||
# 创建测试LaTeX文档
|
||||
cat > test_roboto.tex << "EOF"
|
||||
\documentclass{article}
|
||||
\usepackage{roboto}
|
||||
\begin{document}
|
||||
This is a test document using Roboto font.
|
||||
\end{document}
|
||||
EOF
|
||||
|
||||
# 编译LaTeX文档
|
||||
LOG_INFO "编译LaTeX文档"
|
||||
pdflatex test_roboto.tex
|
||||
CHECK_RESULT $? 0 0 "编译LaTeX文档失败"
|
||||
|
||||
# 步骤5:检查生成的PDF文件
|
||||
LOG_INFO "步骤5:检查生成的PDF文件"
|
||||
if [ -f test_roboto.pdf ]; then
|
||||
LOG_INFO "PDF文件生成成功"
|
||||
else
|
||||
LOG_ERROR "PDF文件生成失败"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 步骤6:清理测试文件
|
||||
LOG_INFO "步骤6:清理测试文件"
|
||||
rm -f test_roboto.tex test_roboto.aux test_roboto.log test_roboto.pdf
|
||||
|
||||
# 步骤7:如果脚本开始时未安装,则卸载软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "步骤7:卸载软件包 $PACKAGE_NAME"
|
||||
dnf remove -y "$PACKAGE_NAME"
|
||||
CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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-02-23
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test generating a PDF with Roboto font and verify rendering
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 检查是否已安装texlive-roboto软件包
|
||||
LOG_INFO "检查texlive-roboto软件包是否已安装"
|
||||
rpm -q texlive-roboto &> /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-roboto软件包已安装,脚本结束时将保持安装状态"
|
||||
INSTALLED_BEFORE=1
|
||||
else
|
||||
LOG_INFO "texlive-roboto软件包未安装,将在测试过程中安装"
|
||||
INSTALLED_BEFORE=0
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有texlive-roboto软件包
|
||||
LOG_INFO "检查yum源中是否有texlive-roboto软件包"
|
||||
dnf list available texlive-roboto &> /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到texlive-roboto软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ $INSTALLED_BEFORE -eq 0 ]; then
|
||||
LOG_INFO "安装texlive-roboto软件包"
|
||||
dnf install -y texlive-roboto
|
||||
CHECK_RESULT $? 0 0 "安装texlive-roboto软件包失败"
|
||||
fi
|
||||
|
||||
# 创建测试LaTeX文档
|
||||
LOG_INFO "创建测试LaTeX文档"
|
||||
cat > test_roboto.tex << "EOF"
|
||||
\documentclass{article}
|
||||
\usepackage{roboto}
|
||||
\begin{document}
|
||||
\roboto
|
||||
This is a test document using Roboto font.
|
||||
\end{document}
|
||||
EOF
|
||||
CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败"
|
||||
|
||||
# 检查pdflatex命令是否存在
|
||||
LOG_INFO "检查pdflatex命令是否存在"
|
||||
command -v pdflatex &> /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "pdflatex命令不存在"
|
||||
# 清理环境:如果之前未安装,则卸载软件包
|
||||
if [ $INSTALLED_BEFORE -eq 0 ]; then
|
||||
LOG_INFO "清理环境:卸载texlive-roboto软件包"
|
||||
dnf remove -y texlive-roboto
|
||||
fi
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 生成PDF文件
|
||||
LOG_INFO "使用pdflatex生成PDF文件"
|
||||
pdflatex -interaction=nonstopmode test_roboto.tex &> pdflatex.log
|
||||
CHECK_RESULT $? 0 0 "生成PDF文件失败"
|
||||
|
||||
# 检查PDF文件是否生成
|
||||
LOG_INFO "检查PDF文件是否生成"
|
||||
if [ -f test_roboto.pdf ]; then
|
||||
LOG_INFO "PDF文件生成成功:test_roboto.pdf"
|
||||
else
|
||||
LOG_ERROR "PDF文件未生成"
|
||||
# 清理环境:如果之前未安装,则卸载软件包
|
||||
if [ $INSTALLED_BEFORE -eq 0 ]; then
|
||||
LOG_INFO "清理环境:卸载texlive-roboto软件包"
|
||||
dnf remove -y texlive-roboto
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 可选:验证PDF渲染(简单检查文件大小)
|
||||
LOG_INFO "验证PDF文件渲染(检查文件大小)"
|
||||
PDF_SIZE=$(stat -c%s test_roboto.pdf)
|
||||
if [ $PDF_SIZE -gt 0 ]; then
|
||||
LOG_INFO "PDF文件大小正常:${PDF_SIZE}字节"
|
||||
else
|
||||
LOG_ERROR "PDF文件大小为0,可能渲染失败"
|
||||
# 清理环境:如果之前未安装,则卸载软件包
|
||||
if [ $INSTALLED_BEFORE -eq 0 ]; then
|
||||
LOG_INFO "清理环境:卸载texlive-roboto软件包"
|
||||
dnf remove -y texlive-roboto
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 清理测试文件
|
||||
LOG_INFO "清理测试文件"
|
||||
rm -f test_roboto.tex test_roboto.pdf test_roboto.log test_roboto.aux pdflatex.log
|
||||
CHECK_RESULT $? 0 0 "清理测试文件失败"
|
||||
|
||||
# 如果测试前未安装,则卸载软件包
|
||||
if [ $INSTALLED_BEFORE -eq 0 ]; then
|
||||
LOG_INFO "清理环境:卸载texlive-roboto软件包"
|
||||
dnf remove -y texlive-roboto
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-roboto软件包失败"
|
||||
else
|
||||
LOG_INFO "保持texlive-roboto软件包安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:成功生成并验证了使用Roboto字体的PDF文件"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user