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/container-exception-logger/container-exception-logger-help",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_container-exception-logger-help_function_log",
|
||||
"desc": "Test logging functionality"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -6,10 +6,6 @@
|
||||
"name": "test_dblatex-help_uninstall",
|
||||
"desc": "测试dblatex-help软件包的卸载功能,验证是否能够正确卸载",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_dblatex-help_function_install",
|
||||
"desc": "测试dblatex-help软件包的安装功能,验证是否能够正确安装"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/linux-sgx/libsgx-ra-uefi",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_libsgx-ra-uefi_function_init",
|
||||
"desc": "Test initialization of libsgx-ra-uefi"
|
||||
},
|
||||
{
|
||||
"name": "test_libsgx-ra-uefi_function_verify",
|
||||
"desc": "Test verification of libsgx-ra-uefi"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/maven2/maven-model",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_maven-model_function_deps",
|
||||
"desc": "Test dependency resolution"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,11 +2,6 @@
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/python-htmlmin2/python-htmlmin2-help",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_python-htmlmin2-help_install",
|
||||
"desc": "测试python-htmlmin2-help软件包的安装功能,验证安装过程是否成功",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_python-htmlmin2-help_uninstall",
|
||||
"desc": "测试python-htmlmin2-help软件包的卸载功能,验证卸载过程是否成功",
|
||||
@@ -17,79 +12,10 @@
|
||||
"desc": "测试python-htmlmin2-help软件包的升级功能,验证升级过程是否成功",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_python-htmlmin2-help_downgrade",
|
||||
"desc": "测试python-htmlmin2-help软件包的降级功能,验证降级过程是否成功",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_python-htmlmin2-help_rollback",
|
||||
"desc": "测试python-htmlmin2-help软件包的回滚功能,验证回滚过程是否成功",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_python-htmlmin2-help_service_start",
|
||||
"desc": "测试python-htmlmin2-help软件包的服务启动功能,验证服务是否能正常启动",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_python-htmlmin2-help_service_stop",
|
||||
"desc": "测试python-htmlmin2-help软件包的服务停止功能,验证服务是否能正常停止",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_python-htmlmin2-help_service_restart",
|
||||
"desc": "测试python-htmlmin2-help软件包的服务重启功能,验证服务是否能正常重启",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_python-htmlmin2-help_service_status",
|
||||
"desc": "测试python-htmlmin2-help软件包的服务状态查询功能,验证服务状态是否能正常查询",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_python-htmlmin2-help_service_config",
|
||||
"desc": "测试python-htmlmin2-help软件包的服务配置功能,验证服务配置是否能正常修改和生效",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_python-htmlmin2-help_service_log",
|
||||
"desc": "测试python-htmlmin2-help软件包的服务日志查看功能,验证服务日志是否能正常查看",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_python-htmlmin2-help_service_reload",
|
||||
"desc": "测试python-htmlmin2-help软件包的服务重载功能,验证服务配置重载是否能正常生效",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_python-htmlmin2-help_downgrade_rollback",
|
||||
"desc": "测试python-htmlmin2-help软件包的降级回滚功能,验证降级后是否能成功回滚到之前的版本",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_python-htmlmin2-help_service_autostart",
|
||||
"desc": "测试python-htmlmin2-help软件包的服务自启动功能,验证服务是否能随系统启动而自动启动",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_python-htmlmin2-help_service_failover",
|
||||
"desc": "测试python-htmlmin2-help软件包的服务故障转移功能,验证服务在异常终止后是否能自动恢复",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_python-htmlmin2-help_service_log_rotate",
|
||||
"desc": "测试python-htmlmin2-help软件包的服务日志轮转功能,验证日志轮转是否能正常执行",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_python-htmlmin2-help_service_health_check",
|
||||
"desc": "测试python-htmlmin2-help软件包的服务健康检查功能,验证服务健康状态是否能正常检查",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_python-htmlmin2-help_function_minify",
|
||||
"desc": "Test the minification functionality of python-htmlmin2-help"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/python-importlab/python-importlab-help",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_python-importlab-help_function_basic",
|
||||
"desc": "Basic functionality test"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -6,10 +6,6 @@
|
||||
"name": "test_python-jaraco-classes-help_install",
|
||||
"desc": "测试python-jaraco-classes-help软件包的安装功能,验证安装过程是否成功。",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_python-jaraco-classes-help_function_init",
|
||||
"desc": "测试python-jaraco-classes-help软件包的初始化功能,验证是否能够正确初始化。"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/python-xcffib/python3-xcffib",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_python3-xcffib_function_conn",
|
||||
"desc": "Test connection to X server"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -5,18 +5,6 @@
|
||||
{
|
||||
"name": "test_texlive-babel-friulan-doc_function_install",
|
||||
"desc": "Test package installation"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-babel-friulan-doc_function_check_installed",
|
||||
"desc": "Check if the package is installed on the system"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-babel-friulan-doc_function_verify_files",
|
||||
"desc": "Verify the existence of core documentation files"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-babel-friulan-doc_function_usage_example",
|
||||
"desc": "Test a basic LaTeX usage example with the package"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,25 +2,9 @@
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-b/texlive-baskervillef",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_texlive-baskervillef_function_usage",
|
||||
"desc": "Test basic usage"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-baskervillef_function_install",
|
||||
"desc": "Test installation of texlive-baskervillef package"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-baskervillef_function_font_available",
|
||||
"desc": "Test if BaskervilleF font is available in TeX"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-baskervillef_function_basic_doc",
|
||||
"desc": "Test compiling a basic document with BaskervilleF"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-baskervillef_function_uninstall",
|
||||
"desc": "Test removal of texlive-baskervillef package"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,18 +2,10 @@
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-d/texlive-cascadilla",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_texlive-cascadilla_function_fonts",
|
||||
"desc": "Test the font rendering functionality of texlive-cascadilla"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-cascadilla_function_install",
|
||||
"desc": "Test the installation process of texlive-cascadilla package"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-cascadilla_function_usage",
|
||||
"desc": "Test the basic usage of texlive-cascadilla in a LaTeX document"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-cascadilla_function_uninstall",
|
||||
"desc": "Test the uninstallation process of texlive-cascadilla package"
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-i/texlive-fouridx",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_texlive-fouridx_function_basic",
|
||||
"desc": "Test basic functionality of texlive-fouridx"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-fouridx_function_install",
|
||||
"desc": "Test installation of texlive-fouridx package"
|
||||
@@ -13,14 +9,6 @@
|
||||
{
|
||||
"name": "test_texlive-fouridx_function_uninstall",
|
||||
"desc": "Test uninstallation of texlive-fouridx package"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-fouridx_function_check",
|
||||
"desc": "Test checking if texlive-fouridx is installed"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-fouridx_function_usage",
|
||||
"desc": "Test basic LaTeX document compilation with fouridx"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -22,11 +22,6 @@
|
||||
"desc": "测试 texlive-properties-doc 软件包的降级功能,验证降级过程是否成功完成。",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-properties-doc_rollback",
|
||||
"desc": "测试 texlive-properties-doc 软件包的回滚功能,验证回滚过程是否成功完成。",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-properties-doc_reinstall",
|
||||
"desc": "测试 texlive-properties-doc 软件包的重新安装功能,验证重新安装过程是否成功完成。",
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-x/texlive-hvarabic",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_texlive-hvarabic_function_arabic",
|
||||
"desc": "Test Arabic text rendering"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,10 +2,6 @@
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-x/texlive-todo",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_texlive-todo_function_basic",
|
||||
"desc": "Test basic functionality of texlive-todo package"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-todo_function_install",
|
||||
"desc": "Test installation of texlive-todo package via package manager"
|
||||
@@ -13,22 +9,6 @@
|
||||
{
|
||||
"name": "test_texlive-todo_function_uninstall",
|
||||
"desc": "Test removal of texlive-todo package via package manager"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-todo_function_check_installed",
|
||||
"desc": "Verify texlive-todo package is installed on the system"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-todo_function_basic_usage",
|
||||
"desc": "Test basic LaTeX document compilation with todo package"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-todo_function_todo_list",
|
||||
"desc": "Test generation of a todo list in the compiled document"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-todo_function_margin_todo",
|
||||
"desc": "Test placement of todo notes in the document margin"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -11,10 +11,6 @@
|
||||
"name": "test_texlive-uspatent_remove",
|
||||
"desc": "测试 texlive-uspatent 软件包的卸载功能,验证是否能够完全移除。"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-uspatent_version",
|
||||
"desc": "测试 texlive-uspatent 软件包的版本查询功能,验证能否正确获取版本信息。"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-uspatent_doc",
|
||||
"desc": "测试 texlive-uspatent 软件包的文档是否存在,验证文档是否随软件包安装。"
|
||||
@@ -22,10 +18,6 @@
|
||||
{
|
||||
"name": "test_texlive-uspatent_texmf",
|
||||
"desc": "测试 texlive-uspatent 宏包文件是否被正确安装到 TeX 系统路径中。"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-uspatent_compile",
|
||||
"desc": "测试使用 texlive-uspatent 宏包编译一个简单的包含该宏包命令的 TeX 文档,验证其基本功能是否正常。"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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-12-11
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test logging functionality
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查环境是否已安装指定软件包
|
||||
LOG_INFO "检查环境是否已安装container-exception-logger-help_function_log软件包"
|
||||
if dnf list installed container-exception-logger-help_function_log &>/dev/null; then
|
||||
LOG_INFO "环境已安装container-exception-logger-help_function_log软件包"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "环境未安装container-exception-logger-help_function_log软件包"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在该软件包
|
||||
LOG_INFO "检查yum源中是否存在container-exception-logger-help_function_log软件包"
|
||||
if ! dnf list available container-exception-logger-help_function_log &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到container-exception-logger-help_function_log软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "开始安装container-exception-logger-help_function_log软件包"
|
||||
dnf install -y container-exception-logger-help_function_log
|
||||
CHECK_RESULT $? 0 0 "安装container-exception-logger-help_function_log失败"
|
||||
fi
|
||||
|
||||
# 测试日志功能
|
||||
LOG_INFO "测试日志功能"
|
||||
container-exception-logger-help_function_log --test-logging
|
||||
CHECK_RESULT $? 0 0 "日志功能测试失败"
|
||||
|
||||
# 检查参数支持情况
|
||||
LOG_INFO "检查不支持的参数"
|
||||
container-exception-logger-help_function_log --invalid-param &>/dev/null
|
||||
if [ $? -ne 255 ]; then
|
||||
LOG_ERROR "未正确处理不支持的参数"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 清理环境:如果脚本开始时未安装,则卸载软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载container-exception-logger-help_function_log软件包"
|
||||
dnf remove -y container-exception-logger-help_function_log
|
||||
CHECK_RESULT $? 0 0 "卸载container-exception-logger-help_function_log失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,69 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-12-11
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试dblatex-help软件包的安装功能,验证是否能够正确安装
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 测试dblatex-help软件包的安装功能
|
||||
LOG_INFO "开始测试dblatex-help软件包的安装功能"
|
||||
|
||||
# 检查是否已安装dblatex-help
|
||||
if rpm -q dblatex-help &>/dev/null; then
|
||||
LOG_INFO "dblatex-help已安装,测试前状态为已安装"
|
||||
installed_before_test=true
|
||||
else
|
||||
LOG_INFO "dblatex-help未安装,测试前状态为未安装"
|
||||
installed_before_test=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有dblatex-help软件包
|
||||
LOG_INFO "检查yum源中是否存在dblatex-help软件包"
|
||||
if ! dnf list available dblatex-help &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到dblatex-help软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装dblatex-help软件包
|
||||
LOG_INFO "开始安装dblatex-help软件包"
|
||||
dnf install -y dblatex-help
|
||||
CHECK_RESULT $? 0 0 "安装dblatex-help软件包失败"
|
||||
|
||||
# 验证是否成功安装
|
||||
LOG_INFO "验证dblatex-help是否安装成功"
|
||||
rpm -q dblatex-help &>/dev/null
|
||||
CHECK_RESULT $? 0 0 "验证dblatex-help安装失败"
|
||||
|
||||
# 检查命令参数支持情况(假设命令为dblatex-help --help)
|
||||
LOG_INFO "检查dblatex-help命令参数支持情况"
|
||||
dblatex-help --help &>/dev/null
|
||||
CHECK_RESULT $? 0 0 "dblatex-help命令参数不支持或不存在"
|
||||
|
||||
# 清理环境:如果测试前未安装,则卸载
|
||||
if [ "$installed_before_test" = false ]; then
|
||||
LOG_INFO "清理环境:卸载dblatex-help软件包"
|
||||
dnf remove -y dblatex-help
|
||||
CHECK_RESULT $? 0 0 "卸载dblatex-help软件包失败"
|
||||
else
|
||||
LOG_INFO "测试前已安装,保持安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,62 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-11-28
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test initialization of libsgx-ra-uefi
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查yum源中是否存在libsgx-ra-uefi软件包
|
||||
LOG_INFO "检查yum源中是否存在libsgx-ra-uefi软件包"
|
||||
dnf list available libsgx-ra-uefi > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到libsgx-ra-uefi软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 检查是否已安装libsgx-ra-uefi
|
||||
LOG_INFO "检查是否已安装libsgx-ra-uefi"
|
||||
rpm -q libsgx-ra-uefi > /dev/null 2>&1
|
||||
installed=$?
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ $installed -ne 0 ]; then
|
||||
LOG_INFO "安装libsgx-ra-uefi软件包"
|
||||
dnf install -y libsgx-ra-uefi
|
||||
CHECK_RESULT $? 0 0 "安装libsgx-ra-uefi失败"
|
||||
fi
|
||||
|
||||
# 测试初始化功能
|
||||
LOG_INFO "测试libsgx-ra-uefi的初始化功能"
|
||||
libsgx-ra-uefi init
|
||||
CHECK_RESULT $? 0 0 "libsgx-ra-uefi初始化失败"
|
||||
|
||||
# 如果最初未安装,则在测试完成后卸载软件包
|
||||
if [ $installed -ne 0 ]; then
|
||||
LOG_INFO "卸载libsgx-ra-uefi软件包"
|
||||
dnf remove -y libsgx-ra-uefi
|
||||
CHECK_RESULT $? 0 0 "卸载libsgx-ra-uefi失败"
|
||||
else
|
||||
LOG_INFO "保持libsgx-ra-uefi的安装状态"
|
||||
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-12-09
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test verification of libsgx-ra-uefi
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# Test verification of libsgx-ra-uefi
|
||||
|
||||
LOG_INFO "开始测试 libsgx-ra-uefi 功能验证"
|
||||
|
||||
# 检查是否已安装 libsgx-ra-uefi
|
||||
LOG_INFO "检查 libsgx-ra-uefi 是否已安装"
|
||||
if dnf list installed libsgx-ra-uefi &> /dev/null; then
|
||||
LOG_INFO "libsgx-ra-uefi 已安装,测试结束后将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "libsgx-ra-uefi 未安装,测试结束后将卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查 yum 源中是否有 libsgx-ra-uefi 软件包
|
||||
LOG_INFO "检查 yum 源中是否存在 libsgx-ra-uefi"
|
||||
if ! dnf list available libsgx-ra-uefi &> /dev/null; then
|
||||
LOG_ERROR "yum 源中未找到 libsgx-ra-uefi 软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装 libsgx-ra-uefi(如果未安装)
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "安装 libsgx-ra-uefi"
|
||||
dnf install -y libsgx-ra-uefi
|
||||
CHECK_RESULT $? 0 0 "安装 libsgx-ra-uefi 失败"
|
||||
fi
|
||||
|
||||
# 验证 libsgx-ra-uefi 功能
|
||||
LOG_INFO "验证 libsgx-ra-uefi 功能"
|
||||
libsgx-ra-uefi --version
|
||||
CHECK_RESULT $? 0 0 "libsgx-ra-uefi 功能验证失败"
|
||||
|
||||
# 清理环境(如果测试前未安装)
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载 libsgx-ra-uefi"
|
||||
dnf remove -y libsgx-ra-uefi
|
||||
CHECK_RESULT $? 0 0 "卸载 libsgx-ra-uefi 失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "libsgx-ra-uefi 功能验证测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,105 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-12-06
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test dependency resolution
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查软件包是否在yum源中
|
||||
check_package_in_repo() {
|
||||
local package_name=$1
|
||||
dnf list available "$package_name" &> /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "软件包 $package_name 不在yum源中"
|
||||
exit 255
|
||||
fi
|
||||
}
|
||||
|
||||
# 检查命令参数是否支持
|
||||
check_command_option() {
|
||||
local command=$1
|
||||
local option=$2
|
||||
$command --help | grep -q "$option"
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "命令 $command 不支持参数 $option"
|
||||
exit 255
|
||||
fi
|
||||
}
|
||||
|
||||
# 检查环境是否已安装
|
||||
check_installed() {
|
||||
rpm -q maven-model &> /dev/null
|
||||
return $?
|
||||
}
|
||||
|
||||
# 安装软件包
|
||||
install_package() {
|
||||
LOG_INFO "开始安装 maven-model"
|
||||
dnf install -y maven-model &> /dev/null
|
||||
CHECK_RESULT $? 0 0 "安装 maven-model 失败"
|
||||
}
|
||||
|
||||
# 卸载软件包
|
||||
uninstall_package() {
|
||||
LOG_INFO "开始卸载 maven-model"
|
||||
dnf remove -y maven-model &> /dev/null
|
||||
CHECK_RESULT $? 0 0 "卸载 maven-model 失败"
|
||||
}
|
||||
|
||||
# 测试依赖解析
|
||||
test_dependency_resolution() {
|
||||
LOG_INFO "测试依赖解析功能"
|
||||
mvn dependency:resolve &> /dev/null
|
||||
CHECK_RESULT $? 0 0 "依赖解析失败"
|
||||
}
|
||||
|
||||
# 主函数
|
||||
main() {
|
||||
LOG_INFO "开始测试脚本 test_maven-model_function_deps"
|
||||
|
||||
# 检查软件包是否在yum源中并安装
|
||||
check_package_in_repo "maven-model"
|
||||
|
||||
# 检查环境是否已安装
|
||||
if check_installed; then
|
||||
LOG_INFO "maven-model已安装,跳过安装步骤"
|
||||
installed_before_test=true
|
||||
else
|
||||
installed_before_test=false
|
||||
install_package
|
||||
fi
|
||||
|
||||
# 测试依赖解析功能
|
||||
test_dependency_resolution
|
||||
|
||||
#恢复环境
|
||||
if [ "$installed_before_test" = false ]; then
|
||||
uninstall_package
|
||||
else
|
||||
LOG_INFO "保持maven-model的安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试脚本 test_maven-model_function_deps执行完成"
|
||||
}
|
||||
|
||||
main
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,88 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-07-05
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试python-htmlmin2-help软件包的降级功能,验证降级过程是否成功
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试python-htmlmin2-help软件包的降级功能"
|
||||
|
||||
# 检查软件包是否存在于yum源中
|
||||
LOG_INFO "检查yum源中是否存在python-htmlmin2-help软件包"
|
||||
dnf list available python-htmlmin2-help > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中不存在python-htmlmin2-help软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 检查当前是否已安装python-htmlmin2-help
|
||||
LOG_INFO "检查当前是否已安装python-htmlmin2-help"
|
||||
rpm -q python-htmlmin2-help > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
installed=true
|
||||
LOG_INFO "python-htmlmin2-help已安装,脚本结束后将保持安装状态"
|
||||
else
|
||||
installed=false
|
||||
LOG_INFO "python-htmlmin2-help未安装,脚本结束后将卸载软件包"
|
||||
fi
|
||||
|
||||
# 获取当前安装的版本
|
||||
current_version=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" python-htmlmin2-help 2>/dev/null)
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "当前安装的python-htmlmin2-help版本为: $current_version"
|
||||
else
|
||||
LOG_INFO "未安装python-htmlmin2-help,将进行安装测试"
|
||||
fi
|
||||
|
||||
# 安装指定版本的python-htmlmin2-help
|
||||
LOG_INFO "尝试降级python-htmlmin2-help软件包"
|
||||
dnf downgrade -y python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "降级python-htmlmin2-help失败"
|
||||
|
||||
# 验证降级后的版本
|
||||
new_version=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" python-htmlmin2-help)
|
||||
LOG_INFO "降级后的python-htmlmin2-help版本为: $new_version"
|
||||
|
||||
# 验证降级是否成功
|
||||
if [ "$current_version" != "$new_version" ]; then
|
||||
LOG_INFO "降级成功,版本从 $current_version 降级到 $new_version"
|
||||
else
|
||||
LOG_ERROR "降级失败,版本未发生变化"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 清理环境:如果脚本开始时未安装,则卸载软件包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "清理环境:卸载python-htmlmin2-help软件包"
|
||||
dnf remove -y python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载python-htmlmin2-help失败"
|
||||
|
||||
# 验证卸载是否成功
|
||||
rpm -q python-htmlmin2-help > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_ERROR "卸载python-htmlmin2-help失败"
|
||||
exit 1
|
||||
else
|
||||
LOG_INFO "卸载python-html min22help成功"
|
||||
fi
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
}
|
||||
|
||||
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-07-05
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试python-htmlmin2-help软件包的降级回滚功能,验证降级后是否能成功回滚到之前的版本
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查python-htmlmin2-help软件包是否已安装
|
||||
LOG_INFO "检查python-htmlmin2-help软件包是否已安装"
|
||||
rpm -q python-htmlmin2-help > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "python-htmlmin2-help软件包已安装,脚本结束时将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "python-htmlmin2-help软件包未安装,将在测试结束后卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在python-htmlmin2-help软件包
|
||||
LOG_INFO "检查yum源中是否存在python-htmlmin2-help软件包"
|
||||
dnf list available python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 255 "yum源中不存在python-htmlmin2-help软件包"
|
||||
|
||||
# 获取当前安装的python-htmlmin2-help版本
|
||||
LOG_INFO "获取当前安装的python-htmlmin2-help版本"
|
||||
CURRENT_VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" python-htmlmin2-help 2>/dev/null)
|
||||
if [ $? -ne 0 ]; then
|
||||
CURRENT_VERSION="未安装"
|
||||
fi
|
||||
LOG_INFO "当前python-htmlmin2-help版本: $CURRENT_VERSION"
|
||||
|
||||
# 安装指定版本的python-htmlmin2-help用于降级测试
|
||||
LOG_INFO "安装指定版本的python-htmlmin2-help用于降级测试"
|
||||
dnf install -y python-htmlmin2-help-<指定版本>
|
||||
CHECK_RESULT $? 0 255 "安装指定版本的python-htmlmin2-help失败"
|
||||
|
||||
# 验证降级后的版本是否正确
|
||||
LOG_INFO "验证降级后的版本是否正确"
|
||||
INSTALLED_VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" python-htmlmin2-help)
|
||||
CHECK_RESULT $? 0 0 "获取降级后的版本失败"
|
||||
[ "$INSTALLED_VERSION" == "<指定版本>" ]
|
||||
CHECK_RESULT $? 0 0 "降级后的版本不正确"
|
||||
|
||||
# 执行回滚操作
|
||||
LOG_INFO "执行回滚操作"
|
||||
dnf history undo last -y > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "回滚操作失败"
|
||||
|
||||
# 验证回滚后的版本是否恢复为原始版本
|
||||
LOG_INFO "验证回滚后的版本是否恢复为原始版本"
|
||||
ROLLBACK_VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" python-htmlmin2-help)
|
||||
CHECK_RESULT $? 0 0 "获取回滚后的版本失败"
|
||||
[ "$ROLLBACK_VERSION" == "$CURRENT_VERSION" ]
|
||||
CHECK_RESULT $? 0 0 "回滚后的版本与原始版本不一致"
|
||||
|
||||
# 清理环境:如果脚本开始时未安装,则卸载软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "清理环境:卸载python-htmlmin2-help软件包"
|
||||
dnf remove -y python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $?10. 测试脚本结束需要注意清理环境,恢复到之前的状态;
|
||||
11.
|
||||
}
|
||||
|
||||
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-12-07
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test the minification functionality of python-htmlmin2-help
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试python-htmlmin2-help的minify功能"
|
||||
|
||||
# 检查是否已安装python-htmlmin2-help
|
||||
LOG_INFO "检查是否已安装python-htmlmin2-help"
|
||||
dnf list installed python-htmlmin2-help > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "python-htmlmin2-help已安装,脚本结束时将保持安装状态"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "python-htmlmin2-help未安装,将在测试结束后卸载"
|
||||
INSTALLED=0
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有python-htmlmin2-help软件包
|
||||
LOG_INFO "检查yum源中是否有python-htmlmin2-help软件包"
|
||||
dnf list available python-htmlmin2-help > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到python-htmlmin2-help软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装python-htmlmin2-help(如果未安装)
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "安装python-htmlmin2-help软件包"
|
||||
dnf install -y python-htmlmin2-help
|
||||
CHECK_RESULT $? 0 0 "安装python-htmlmin2-help失败"
|
||||
fi
|
||||
|
||||
# 测试minify功能
|
||||
LOG_INFO "测试minify功能"
|
||||
html_content="<div> <p>Test</p> </div>"
|
||||
minified_content=$(python -m htmlmin "$html_content" --minify)
|
||||
CHECK_RESULT $? 0 0 "minify功能执行失败"
|
||||
|
||||
# 验证输出结果
|
||||
expected_content="<div><p>Test</p></div>"
|
||||
if [ "$minified_content" != "$expected_content" ]; then
|
||||
LOG_ERROR "输出结果与预期不符:$expected_content != $actual_content"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 清理环境(如果之前未安装)
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "卸载python-htmlmin2-help软件包"
|
||||
dnf remove -y python-htmlmin2-help
|
||||
CHECK_RESULT $? 0 0 "卸载python-htmlmin2-help失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,62 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-07-05
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试python-htmlmin2-help软件包的安装功能,验证安装过程是否成功
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 检查python-htmlmin2-help软件包是否已安装
|
||||
LOG_INFO "检查python-htmlmin2-help软件包是否已安装"
|
||||
rpm -q python-htmlmin2-help > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "python-htmlmin2-help软件包已安装,脚本结束后保持安装状态"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "python-htmlmin2-help软件包未安装,将在脚本结束前卸载"
|
||||
INSTALLED=0
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在python-htmlmin2-help软件包
|
||||
LOG_INFO "检查yum源中是否存在python-htmlmin2-help软件包"
|
||||
dnf list available python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 255 "yum源中不存在python-htmlmin2-help软件包"
|
||||
|
||||
# 安装python-htmlmin2-help软件包
|
||||
LOG_INFO "安装python-htmlmin2-help软件包"
|
||||
dnf install -y python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装python-htmlmin2-help软件包失败"
|
||||
|
||||
# 验证安装是否成功
|
||||
LOG_INFO "验证python-htmlmin2-help软件包是否安装成功"
|
||||
rpm -q python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "python-htmlmin2-help软件包安装未成功"
|
||||
|
||||
# 测试--help参数是否支持
|
||||
LOG_INFO "测试--help参数是否支持"
|
||||
python3 -m htmlmin --help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 255 "--help参数不支持或不存在"
|
||||
|
||||
# 清理环境:如果脚本开始时未安装,则卸载软件包
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "清理环境:卸载python-htmlmin2-help软件包"
|
||||
dnf remove -y python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载python-htmlmin2-help软件包失败"
|
||||
fi
|
||||
}
|
||||
|
||||
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-07-05
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试python-htmlmin2-help软件包的回滚功能,验证回滚过程是否成功
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查python-htmlmin2-help软件包是否已安装
|
||||
LOG_INFO "检查python-htmlmin2-help软件包是否已安装"
|
||||
rpm -q python-htmlmin2-help > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "python-htmlmin2-help软件包已安装,脚本结束时将保持安装状态"
|
||||
installed=true
|
||||
else
|
||||
LOG_INFO "python-htmlmin2-help软件包未安装,将在测试结束后卸载"
|
||||
installed=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在python-htmlmin2-help软件包
|
||||
LOG_INFO "检查yum源中是否存在python-htmlmin2-help软件包"
|
||||
dnf list available python-htmlmin2-help > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中不存在python-htmlmin2-help软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装python-htmlmin2-help软件包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "开始安装python-htmlmin2-help软件包"
|
||||
dnf install -y python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装python-htmlmin2-help软件包失败"
|
||||
fi
|
||||
|
||||
# 验证回滚功能是否支持--help参数
|
||||
LOG_INFO "验证回滚功能是否支持--help参数"
|
||||
python-htmlmin2-help --help > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "回滚功能不支持--help参数或参数不存在"
|
||||
# 恢复环境
|
||||
if [ "$installed" = false ]; then
|
||||
dnf remove -y python-htmlmin2-help > /dev/null 2>&1
|
||||
fi
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 执行回滚操作并验证结果
|
||||
LOG_INFO "执行回滚操作并验证结果"
|
||||
python-htmlmin2-help --rollback > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "回滚操作失败"
|
||||
|
||||
# 清理环境
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "清理环境,卸载python-htmlmin2-help软件包"
|
||||
dnf remove -y python-htmlmin2-help > /dev/null 2>&1
|
||||
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-07-05
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试python-htmlmin2-help软件包的服务自启动功能,验证服务是否能随系统启动而自动启动
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查yum源中是否存在python-htmlmin2-help软件包
|
||||
LOG_INFO "检查yum源中是否存在python-htmlmin2-help软件包"
|
||||
dnf list available python-htmlmin2-help > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中不存在python-htmlmin2-help软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 检查是否已安装python-htmlmin2-help软件包
|
||||
LOG_INFO "检查是否已安装python-htmlmin2-help软件包"
|
||||
rpm -q python-htmlmin2-help > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
installed=true
|
||||
LOG_INFO "python-htmlmin2-help软件包已安装"
|
||||
else
|
||||
installed=false
|
||||
LOG_INFO "python-htmlmin2-help软件包未安装,将进行安装"
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "安装python-htmlmin2-help软件包"
|
||||
dnf install -y python-htmlmin2-help
|
||||
CHECK_RESULT $? 0 0 "安装python-htmlmin2-help软件包失败"
|
||||
fi
|
||||
|
||||
# 检查服务是否已启用自启动
|
||||
LOG_INFO "检查服务是否已启用自启动"
|
||||
systemctl is-enabled python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "服务未启用自启动"
|
||||
|
||||
# 模拟系统重启并验证服务自启动
|
||||
LOG_INFO "模拟系统重启并验证服务自启动"
|
||||
systemctl restart python-htmlmin2-help
|
||||
CHECK_RESULT $? 0 0 "重启服务失败"
|
||||
|
||||
systemctl is-active python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "服务未自动启动"
|
||||
|
||||
# 恢复环境
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载python-htmlmin2-help软件包"
|
||||
dnf remove -y python-htmlmin2-help
|
||||
CHECK_RESULT $? 0 0 "卸载python-htmlmin2-help软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,97 +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-07-05
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试python-htmlmin2-help软件包的服务配置功能,验证服务配置是否能正常修改和生效
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 检查python-htmlmin2-help软件包是否已安装
|
||||
LOG_INFO "检查python-htmlmin2-help软件包是否已安装"
|
||||
rpm -q python-htmlmin2-help > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "python-htmlmin2-help软件包已安装,脚本结束时将保持安装状态"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "python-htmlmin2-help软件包未安装,将在测试结束后卸载"
|
||||
INSTALLED=0
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在python-htmlmin2-help软件包
|
||||
LOG_INFO "检查yum源中是否存在python-htmlmin2-help软件包"
|
||||
dnf list available python-htmlmin2-help > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中不存在python-htmlmin2-help软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装python-htmlmin2-help软件包
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "安装python-htmlmin2-help软件包"
|
||||
dnf install -y python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装python-htmlmin2-help软件包失败"
|
||||
fi
|
||||
|
||||
# 验证服务配置功能
|
||||
LOG_INFO "验证服务配置功能"
|
||||
# 假设服务配置文件为/etc/python-htmlmin2-help/config.ini
|
||||
CONFIG_FILE="/etc/python-htmlmin2-help/config.ini"
|
||||
if [ ! -f "$CONFIG_FILE" ]; then
|
||||
LOG_ERROR "服务配置文件不存在或不支持"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 备份原始配置文件
|
||||
LOG_INFO "备份原始配置文件"
|
||||
cp "$CONFIG_FILE" "${CONFIG_FILE}.bak"
|
||||
|
||||
# 修改服务配置
|
||||
LOG_INFO "修改服务配置"
|
||||
sed -i "s/^key=.*/key=new_value/" "$CONFIG_FILE"
|
||||
CHECK_RESULT $? 0 0 "修改服务配置失败"
|
||||
|
||||
# 重启服务使配置生效(假设服务名为python-htmlmin2-help)
|
||||
LOG_INFO "重启服务使配置生效"
|
||||
systemctl restart python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "重启服务失败"
|
||||
|
||||
# 验证配置是否生效
|
||||
LOG_INFO "验证配置是否生效"
|
||||
grep "key=new_value" "$CONFIG_FILE" > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "配置未生效"
|
||||
|
||||
#恢复原始配置文件
|
||||
LOG_INFO "恢复原始配置文件"
|
||||
mv "${CONFIG_FILE}.bak" "$CONFIG_FILE"
|
||||
|
||||
# 重启服务恢复原始状态(假设服务名为python-htmlmin2-help)
|
||||
LOG_INFO "重启服务恢复原始状态"
|
||||
systemctl restart python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "重启服务失败"
|
||||
|
||||
# 卸载python-htmlmin2-help软件包(如果之前未安装)
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "卸载python-htmlmin2-help软件包"
|
||||
dnf remove -y python-htmlmin3help > /dev/null
|
||||
CHECK_RESULT $?
|
||||
|
||||
fi
|
||||
|
||||
LOG INFO “测试完成”
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,73 +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-07-05
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试python-htmlmin2-help软件包的服务故障转移功能,验证服务在异常终止后是否能自动恢复
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试python-htmlmin2-help软件包的服务故障转移功能"
|
||||
|
||||
# 检查是否已安装python-htmlmin2-help
|
||||
LOG_INFO "检查是否已安装python-htmlmin2-help"
|
||||
dnf list installed python-htmlmin2-help > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "python-htmlmin2-help已安装,跳过安装步骤"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "python-htmlmin2-help未安装,准备安装"
|
||||
INSTALLED=0
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有python-htmlmin2-help
|
||||
LOG_INFO "检查yum源中是否有python-htmlmin2-help"
|
||||
dnf list available python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "yum源中未找到python-htmlmin2-help软件包"
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到python-htmlmin2-help软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装python-htmlmin2-help(如果未安装)
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "开始安装python-htmlmin2-help"
|
||||
dnf install -y python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装python-htmlmin2-help失败"
|
||||
fi
|
||||
|
||||
# 验证服务故障转移功能
|
||||
LOG_INFO "验证服务故障转移功能"
|
||||
systemctl start python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "启动python-htmlmin2-help服务失败"
|
||||
|
||||
LOG_INFO "模拟服务异常终止"
|
||||
systemctl stop python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "停止python-htmlmin2-help服务失败"
|
||||
|
||||
LOG_INFO "检查服务是否自动恢复"
|
||||
sleep 5 #等待服务恢复时间
|
||||
|
||||
systemctl status python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "python-htmlmin2-help服务未自动恢复"
|
||||
|
||||
# 清理环境(如果脚本开始时未安装)
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "卸载python-htmlmin2-help以恢复环境"
|
||||
dnf remove -y python-htmlmin2-help > /dev/null
|
||||
}
|
||||
|
||||
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-07-05
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试python-htmlmin2-help软件包的服务健康检查功能,验证服务健康状态是否能正常检查
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试python-htmlmin2-help软件包的服务健康检查功能"
|
||||
|
||||
# 检查yum源中是否存在python-htmlmin2-help软件包
|
||||
LOG_INFO "检查yum源中是否存在python-htmlmin2-help软件包"
|
||||
dnf list available python-htmlmin2-help > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中不存在python-htmlmin2-help软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 检查是否已安装python-htmlmin2-help
|
||||
LOG_INFO "检查是否已安装python-htmlmin2-help"
|
||||
rpm -q python-htmlmin2-help > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
installed=true
|
||||
LOG_INFO "python-htmlmin2-help已安装"
|
||||
else
|
||||
installed=false
|
||||
LOG_INFO "python-htmlmin2-help未安装,将进行安装"
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "安装python-htmlmin2-help软件包"
|
||||
dnf install -y python-htmlmin2-help
|
||||
CHECK_RESULT $? 0 0 "安装python-htmlmin2-help失败"
|
||||
fi
|
||||
|
||||
# 测试服务健康检查功能
|
||||
LOG_INFO "测试服务健康检查功能"
|
||||
python-htmlmin2-help --health-check
|
||||
CHECK_RESULT $? 0 0 "服务健康检查失败"
|
||||
|
||||
# 如果之前未安装,则卸载软件包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载python-htmlmin2-help软件包"
|
||||
dnf remove -y python-htmlmin2-help
|
||||
CHECK_RESULT $? 0 0 "卸载python-htmlmin2-help失败"
|
||||
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-07-05
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试python-htmlmin2-help软件包的服务日志轮转功能,验证日志轮转是否能正常执行
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查python-htmlmin2-help软件包是否已安装
|
||||
LOG_INFO "检查python-htmlmin2-help软件包是否已安装"
|
||||
rpm -q python-htmlmin2-help
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "python-htmlmin2-help软件包已安装"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "python-htmlmin2-help软件包未安装"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在python-htmlmin2-help软件包
|
||||
LOG_INFO "检查yum源中是否存在python-htmlmin2-help软件包"
|
||||
dnf list available python-htmlmin2-help
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中不存在python-htmlmin2-help软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "开始安装python-htmlmin2-help软件包"
|
||||
dnf install -y python-htmlmin2-help
|
||||
CHECK_RESULT $? 0 0 "安装python-htmlmin2-help软件包失败"
|
||||
fi
|
||||
|
||||
# 验证日志轮转功能是否正常
|
||||
LOG_INFO "验证日志轮转功能是否正常"
|
||||
logrotate /etc/logrotate.d/python-htmlmin2-help
|
||||
CHECK_RESULT $? 0 0 "日志轮转功能执行失败"
|
||||
|
||||
# 如果脚本开始时未安装,则在结束时卸载软件包以恢复环境
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载python-htmlmin2-help软件包以恢复环境"
|
||||
dnf remove -y python-htmlmin2-help
|
||||
CHECK_RESULT $? 0 0 "卸载python-htmlmin2-help软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试脚本执行完毕,环境已恢复"
|
||||
|
||||
}
|
||||
|
||||
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 : 2025-07-05
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试python-htmlmin2-help软件包的服务重载功能,验证服务配置重载是否能正常生效
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试python-htmlmin2-help软件包的服务重载功能"
|
||||
|
||||
# 检查软件包是否已安装
|
||||
LOG_INFO "检查python-htmlmin2-help软件包是否已安装"
|
||||
if ! dnf list installed python-htmlmin2-help &>/dev/null; then
|
||||
LOG_INFO "python-htmlmin2-help未安装,准备安装"
|
||||
# 检查yum源中是否有该软件包
|
||||
if ! dnf list available python-htmlmin2-help &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到python-htmlmin2-help软件包"
|
||||
exit 255
|
||||
fi
|
||||
# 安装软件包
|
||||
dnf install -y python-htmlmin2-help
|
||||
CHECK_RESULT $? 0 0 "安装python-htmlmin2-help失败"
|
||||
# 标记需要卸载
|
||||
UNINSTALL=1
|
||||
else
|
||||
LOG_INFO "python-htmlmin2-help已安装"
|
||||
UNINSTALL=0
|
||||
fi
|
||||
|
||||
# 测试服务重载功能
|
||||
LOG_INFO "测试服务重载功能"
|
||||
systemctl reload python-htmlmin2-help.service
|
||||
CHECK_RESULT $? 0 0 "服务重载失败"
|
||||
|
||||
# 验证服务状态
|
||||
LOG_INFO "验证服务状态"
|
||||
systemctl status python-htmlmin2-help.service | grep -q "active (running)"
|
||||
CHECK_RESULT $? 0 0 "服务未正常运行"
|
||||
|
||||
# 清理环境
|
||||
if [ $UNINSTALL -eq 1 ]; then
|
||||
LOG_INFO "卸载python-htmlmin2-help软件包"
|
||||
dnf remove -y python-htmlmin2-help
|
||||
CHECK_RESULT $? 0 0 "卸载python-htmlmin2-help失败"
|
||||
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-07-05
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试python-htmlmin2-help软件包的服务重启功能,验证服务是否能正常重启
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查软件包是否已安装
|
||||
check_package_installed() {
|
||||
rpm -q "$1" >/dev/null 2>&1
|
||||
return $?
|
||||
}
|
||||
|
||||
# 检查yum源中是否存在软件包
|
||||
check_package_in_repo() {
|
||||
dnf list available "$1" >/dev/null 2>&1
|
||||
return $?
|
||||
}
|
||||
|
||||
# 安装软件包
|
||||
install_package() {
|
||||
LOG_INFO "开始安装软件包: $1"
|
||||
dnf install -y "$1"
|
||||
CHECK_RESULT $? 0 0 "安装软件包失败"
|
||||
}
|
||||
|
||||
# 卸载软件包
|
||||
uninstall_package() {
|
||||
LOG_INFO "开始卸载软件包: $1"
|
||||
dnf remove -y "$1"
|
||||
CHECK_RESULT $? 0 0 "卸载软件包失败"
|
||||
}
|
||||
|
||||
# 检查服务重启功能
|
||||
test_service_restart() {
|
||||
LOG_INFO "测试服务重启功能"
|
||||
systemctl restart python-htmlmin2-help
|
||||
CHECK_RESULT $? 0 0 "服务重启失败"
|
||||
systemctl status python-htmlmin2-help
|
||||
CHECK_RESULT $? 0 0 "服务状态检查失败"
|
||||
}
|
||||
|
||||
# 主函数
|
||||
main() {
|
||||
local package_name="python-htmlmin2-help"
|
||||
local installed=false
|
||||
|
||||
# 检查软件包是否已安装
|
||||
if check_package_installed "$package_name"; then
|
||||
LOG_INFO "软件包已安装"
|
||||
installed=true
|
||||
else
|
||||
LOG_INFO "软件包未安装,检查yum源中是否存在"
|
||||
if ! check_package_in_repo "$package_name"; then
|
||||
LOG_ERROR "yum源中不存在软件包: $package_name"
|
||||
exit 255
|
||||
fi
|
||||
install_package "$package_name"
|
||||
installed=false
|
||||
fi
|
||||
|
||||
# 测试服务重启功能
|
||||
test_service_restart
|
||||
|
||||
# 恢复环境:如果脚本开始时未安装,则卸载软件包
|
||||
if ! $installed; then
|
||||
uninstall_package "$package_name"
|
||||
CHECK_RESULT $? 0 0 "卸载软件包失败"
|
||||
LOG_INFO "环境已恢复"
|
||||
else
|
||||
LOG_INFO "环境保持原状"
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,71 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-07-05
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试python-htmlmin2-help软件包的服务启动功能,验证服务是否能正常启动
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 检查python-htmlmin2-help软件包是否在yum源中
|
||||
LOG_INFO "检查python-htmlmin2-help软件包是否在yum源中"
|
||||
dnf list available python-htmlmin2-help > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到python-htmlmin2-help软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 检查是否已安装python-htmlmin2-help
|
||||
LOG_INFO "检查是否已安装python-htmlmin2-help"
|
||||
rpm -q python-htmlmin2-help > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
installed=true
|
||||
LOG_INFO "python-htmlmin2-help已安装"
|
||||
else
|
||||
installed=false
|
||||
LOG_INFO "python-htmlmin2-help未安装,将进行安装"
|
||||
fi
|
||||
|
||||
# 若未安装,则安装软件包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "安装python-htmlmin2-help软件包"
|
||||
dnf install -y python-htmlmin2-help
|
||||
CHECK_RESULT $? 0 0 "安装python-htmlmin2-help失败"
|
||||
fi
|
||||
|
||||
# 验证服务启动功能
|
||||
LOG_INFO "验证python-htmlmin2-help服务启动功能"
|
||||
systemctl start python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "启动python-htmlmin2-help服务失败"
|
||||
|
||||
# 检查服务状态是否为active (running)
|
||||
LOG_INFO "检查python-htmlmin2-help服务状态"
|
||||
systemctl is-active python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "python-htmlmin2-help服务未正常运行"
|
||||
|
||||
# 停止服务
|
||||
LOG_INFO "停止python-htmlmin2-help服务"
|
||||
systemctl stop python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "停止python-htmlmin2-help服务失败"
|
||||
|
||||
# 若脚本开始时未安装,则卸载软件包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载python-htmlmin2-help软件包"
|
||||
dnf remove -y python-htmlmin2-help
|
||||
CHECK_RESULT $? 0 0 "卸载python-htmlmin
|
||||
}
|
||||
|
||||
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-07-05
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试python-htmlmin2-help软件包的服务状态查询功能,验证服务状态是否能正常查询
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试python-htmlmin2-help软件包的服务状态查询功能"
|
||||
|
||||
# 检查软件包是否在yum源中
|
||||
LOG_INFO "检查yum源中是否存在python-htmlmin2-help软件包"
|
||||
dnf list available python-htmlmin2-help &>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中不存在python-htmlmin2-help软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 检查是否已安装软件包
|
||||
LOG_INFO "检查是否已安装python-htmlmin2-help软件包"
|
||||
rpm -q python-htmlmin2-help &>/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
installed=true
|
||||
LOG_INFO "python-htmlmin2-help软件包已安装"
|
||||
else
|
||||
installed=false
|
||||
LOG_INFO "python-htmlmin2-help软件包未安装,将进行安装"
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "安装python-htmlmin2-help软件包"
|
||||
dnf install -y python-htmlmin2-help
|
||||
CHECK_RESULT $? 0 0 "安装python-htmlmin2-help软件包失败"
|
||||
fi
|
||||
|
||||
# 测试服务状态查询功能
|
||||
LOG_INFO "测试python-htmlmin2-help服务状态查询功能"
|
||||
systemctl status python-htmlmin2-help &>/dev/null
|
||||
CHECK_RESULT $? 0 0 "查询python-htmlmin2-help服务状态失败"
|
||||
|
||||
# 清理环境:如果脚本开始时未安装,则卸载软件包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载python-htmlmin2-help软件包"
|
||||
dnf remove -y python-htmlmin2-help
|
||||
CHECK_RESULT $? 0 0 "卸载python-htmlmin2-help软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,71 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-07-05
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试python-htmlmin2-help软件包的服务停止功能,验证服务是否能正常停止
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查python-htmlmin2-help软件包是否已安装
|
||||
LOG_INFO "检查python-htmlmin2-help软件包是否已安装"
|
||||
rpm -q python-htmlmin2-help > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "python-htmlmin2-help软件包已安装"
|
||||
installed=true
|
||||
else
|
||||
LOG_INFO "python-htmlmin2-help软件包未安装"
|
||||
installed=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在python-htmlmin2-help软件包
|
||||
LOG_INFO "检查yum源中是否存在python-htmlmin2-help软件包"
|
||||
dnf list available python-htmlmin2-help > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中不存在python-htmlmin2-help软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "安装python-htmlmin2-help软件包"
|
||||
dnf install -y python-htmlmin2-help
|
||||
CHECK_RESULT $? 0 0 "安装python-htmlmin2-help软件包失败"
|
||||
fi
|
||||
|
||||
# 验证服务停止功能
|
||||
LOG_INFO "验证python-htmlmin2-help服务停止功能"
|
||||
systemctl stop python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "停止python-htmlmin2-help服务失败"
|
||||
|
||||
# 检查服务状态是否为停止
|
||||
LOG_INFO "检查python-htmlmin2-help服务状态是否为停止"
|
||||
systemctl is-active python-htmlmin2-help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 3 0 "python-htmlmin2-help服务未停止"
|
||||
|
||||
# 如果脚本开始时未安装,则卸载软件包以恢复环境
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载python-htmlmin2-help软件包以恢复环境"
|
||||
dnf remove -y python-htmlmin2-help
|
||||
CHECK_RESULT $? 0 0 "卸载python-htmlmin2-help软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,73 +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-09
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Basic functionality test
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 测试脚本:test_python-importlab-help_function_basic
|
||||
# 测试用例描述:Basic functionality test
|
||||
|
||||
LOG_INFO "开始执行测试脚本:Basic functionality test"
|
||||
|
||||
# 检查是否已安装python-importlab
|
||||
LOG_INFO "检查是否已安装python-importlab"
|
||||
dnf list installed python-importlab > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "python-importlab已安装,测试结束后将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "python-importlab未安装,将在测试结束后卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有python-importlab
|
||||
LOG_INFO "检查yum源中是否有python-importlab"
|
||||
dnf list available python-importlab > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到python-importlab,退出测试"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装python-importlab
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "开始安装python-importlab"
|
||||
dnf install -y python-importlab > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装python-importlab失败"
|
||||
LOG_INFO "python-importlab安装成功"
|
||||
fi
|
||||
|
||||
# 测试python-importlab的帮助功能
|
||||
LOG_INFO "测试python-importlab的帮助功能"
|
||||
python -m importlab --help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "python-importlab帮助功能测试失败"
|
||||
|
||||
# 清理环境:如果测试前未安装,则卸载python-importlab
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "清理环境:卸载python-importlab"
|
||||
dnf remove -y python-importlab > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载python-importlab失败"
|
||||
LOG_INFO "python-importlab卸载成功"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试脚本执行完成:Basic functionality test"
|
||||
|
||||
}
|
||||
|
||||
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 : 2025-12-07
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试python-jaraco-classes-help软件包的初始化功能,验证是否能够正确初始化。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试python-jaraco-classes-help软件包的初始化功能,验证是否能够正确初始化。"
|
||||
|
||||
# 检查软件包是否已安装
|
||||
LOG_INFO "检查python-jaraco-classes-help软件包是否已安装"
|
||||
if dnf list installed python-jaraco-classes-help &>/dev/null; then
|
||||
LOG_INFO "python-jaraco-classes-help软件包已安装,测试完成后将保持安装状态"
|
||||
installed=true
|
||||
else
|
||||
LOG_INFO "python-jaraco-classes-help软件包未安装,将在测试完成后卸载"
|
||||
installed=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有该软件包
|
||||
LOG_INFO "检查yum源中是否有python-jaraco-classes-help软件包"
|
||||
if ! dnf list available python-jaraco-classes-help &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到python-jaraco-classes-help软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装软件包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "安装python-jaraco-classes-help软件包"
|
||||
dnf install -y python-jaraco-classes-help
|
||||
CHECK_RESULT $? 0 0 "安装python-jaraco-classes-help软件包失败"
|
||||
fi
|
||||
|
||||
# 验证初始化功能
|
||||
LOG_INFO "验证python-jaraco-classes-help软件包的初始化功能"
|
||||
python -c "import jaraco.classes.help" &>/dev/null
|
||||
CHECK_RESULT $? 0 0 "python-jaraco-classes-help软件包初始化失败"
|
||||
|
||||
# 清理环境
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载python-jaraco-classes-help软件包"
|
||||
dnf remove -y python-jaraco-classes-help
|
||||
CHECK_RESULT $? 0 0 "卸载python-jaraco-classes-help软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试python-jaraco-classes-help软件包的初始化功能完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,68 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-12-08
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test connection to X server
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试:Test connection to X server"
|
||||
|
||||
# 检查是否已安装python3-xcffib
|
||||
LOG_INFO "检查是否已安装python3-xcffib"
|
||||
dnf list installed python3-xcffib > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "python3-xcffib已安装,脚本结束后将保持安装状态"
|
||||
installed=true
|
||||
else
|
||||
LOG_INFO "python3-xcffib未安装,将在测试结束后卸载"
|
||||
installed=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有python3-xcffib
|
||||
LOG_INFO "检查yum源中是否有python3-xcffib"
|
||||
dnf list available python3-xcffib > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到python3-xcffib,退出测试"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 若未安装则安装python3-xcffib
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "开始安装python3-xcffib"
|
||||
dnf install -y python3-xcffib > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装python3-xcffib失败"
|
||||
LOG_INFO "python3-xcffib安装成功"
|
||||
fi
|
||||
|
||||
# 测试连接X server功能
|
||||
LOG_INFO "测试连接X server功能"
|
||||
xset -q > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "连接X server失败"
|
||||
|
||||
# 清理环境:若之前未安装则卸载python3-xcffib
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "清理环境:卸载python3-xcffib"
|
||||
dnf remove -y python3-xcffib > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载python3-xcffib失败"
|
||||
LOG_INFO "python3-xcffib卸载成功"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:Test connection to X server"
|
||||
}
|
||||
|
||||
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 : 2026-03-05
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test compiling a basic document with BaskervilleF
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
set -e
|
||||
|
||||
LOG_INFO "开始测试:使用BaskervilleF编译基本文档"
|
||||
|
||||
# 检查是否已安装texlive-baskervillef
|
||||
if rpm -q texlive-baskervillef &>/dev/null; then
|
||||
LOG_INFO "环境已安装texlive-baskervillef,测试结束后将保持安装状态"
|
||||
INSTALLED_BEFORE=true
|
||||
else
|
||||
LOG_INFO "环境未安装texlive-baskervillef,将在测试前安装,测试后卸载"
|
||||
INSTALLED_BEFORE=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有texlive-baskervillef包
|
||||
LOG_INFO "检查yum源中是否存在texlive-baskervillef软件包"
|
||||
if ! dnf list available texlive-baskervillef &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到texlive-baskervillef软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ "$INSTALLED_BEFORE" = false ]; then
|
||||
LOG_INFO "安装texlive-baskervillef软件包"
|
||||
dnf install -y texlive-baskervillef
|
||||
CHECK_RESULT $? 0 0 "安装texlive-baskervillef失败"
|
||||
fi
|
||||
|
||||
# 创建测试用的基本LaTeX文档
|
||||
LOG_INFO "创建测试用的基本LaTeX文档"
|
||||
cat > test_baskervillef.tex << "EOF"
|
||||
\documentclass{article}
|
||||
\usepackage{baskervillef}
|
||||
\begin{document}
|
||||
This is a test document using BaskervilleF font.
|
||||
\end{document}
|
||||
EOF
|
||||
CHECK_RESULT $? 0 0 "创建测试文档失败"
|
||||
|
||||
# 使用pdflatex编译文档
|
||||
LOG_INFO "使用pdflatex编译文档"
|
||||
pdflatex -interaction=nonstopmode test_baskervillef.tex
|
||||
CHECK_RESULT $? 0 0 "使用BaskervilleF编译基本文档失败"
|
||||
|
||||
# 检查是否生成了PDF文件
|
||||
LOG_INFO "检查是否生成了PDF文件"
|
||||
if [ -f "test_baskervillef.pdf" ]; then
|
||||
LOG_INFO "PDF文件生成成功"
|
||||
else
|
||||
LOG_ERROR "PDF文件未生成"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 清理测试文件
|
||||
LOG_INFO "清理测试文件"
|
||||
rm -f test_baskervillef.tex test_baskervillef.pdf test_baskervillef.log test_baskervillef.aux test_baskervillef.out
|
||||
CHECK_RESULT $? 0 0 "清理测试文件失败"
|
||||
|
||||
# 如果测试前未安装,则卸载软件包
|
||||
if [ "$INSTALLED_BEFORE" = false ]; then
|
||||
LOG_INFO "卸载texlive-baskervillef软件包"
|
||||
dnf remove -y texlive-baskervillef
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-baskervillef失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:使用BaskervilleF编译基本文档成功"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,71 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-03-05
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test if BaskervilleF font is available in TeX
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 判断是否已经安装texlive-baskervillef字体包
|
||||
LOG_INFO "检查是否已安装texlive-baskervillef字体包"
|
||||
rpm -q texlive-baskervillef &>/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-baskervillef已安装,脚本结束时将保持安装状态"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "texlive-baskervillef未安装,将在测试中安装并在结束前卸载"
|
||||
INSTALLED=0
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有texlive-baskervillef软件包
|
||||
LOG_INFO "检查yum源中是否有texlive-baskervillef软件包"
|
||||
dnf list available texlive-baskervillef &>/dev/null
|
||||
CHECK_RESULT $? 0 0 "yum源中没有texlive-baskervillef软件包"
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中没有texlive-baskervillef软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装texlive-baskervillef
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "安装texlive-baskervillef字体包"
|
||||
dnf install -y texlive-baskervillef
|
||||
CHECK_RESULT $? 0 0 "安装texlive-baskervillef失败"
|
||||
fi
|
||||
|
||||
# 检查BaskervilleF字体是否可用
|
||||
LOG_INFO "检查BaskervilleF字体是否在TeX中可用"
|
||||
if command -v kpsewhich &>/dev/null; then
|
||||
kpsewhich BaskervilleF.pfb
|
||||
CHECK_RESULT $? 0 0 "BaskervilleF字体在TeX中不可用"
|
||||
else
|
||||
LOG_INFO "使用fc-list检查BaskervilleF字体"
|
||||
fc-list | grep -i BaskervilleF
|
||||
CHECK_RESULT $? 0 0 "BaskervilleF字体在系统中不可用"
|
||||
fi
|
||||
|
||||
# 清理环境:如果测试前未安装,则卸载texlive-baskervillef
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "卸载texlive-baskervillef字体包"
|
||||
dnf remove -y texlive-baskervillef
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-baskervillef失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,84 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-03-05
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test removal of texlive-baskervillef package
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
set -e
|
||||
|
||||
# 步骤1:检查yum源中是否存在texlive-baskervillef软件包
|
||||
LOG_INFO "检查yum源中是否存在texlive-baskervillef软件包"
|
||||
dnf list available texlive-baskervillef > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中不存在texlive-baskervillef软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 步骤2:检查当前系统是否已安装texlive-baskervillef
|
||||
LOG_INFO "检查当前系统是否已安装texlive-baskervillef"
|
||||
if rpm -q texlive-baskervillef > /dev/null 2>&1; then
|
||||
INSTALLED=true
|
||||
LOG_INFO "texlive-baskervillef已安装,脚本结束时将保持安装状态"
|
||||
else
|
||||
INSTALLED=false
|
||||
LOG_INFO "texlive-baskervillef未安装,将进行安装测试"
|
||||
fi
|
||||
|
||||
# 步骤3:如果未安装,则安装texlive-baskervillef
|
||||
if [ "$INSTALLED" = "false" ]; then
|
||||
LOG_INFO "安装texlive-baskervillef软件包"
|
||||
dnf install -y texlive-baskervillef
|
||||
CHECK_RESULT $? 0 0 "安装texlive-baskervillef失败"
|
||||
fi
|
||||
|
||||
# 步骤4:验证安装是否成功
|
||||
LOG_INFO "验证texlive-baskervillef安装是否成功"
|
||||
rpm -q texlive-baskervillef > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "texlive-baskervillef安装验证失败"
|
||||
|
||||
# 步骤5:执行卸载测试
|
||||
LOG_INFO "执行texlive-baskervillef卸载测试"
|
||||
dnf remove -y texlive-baskervillef
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-baskervillef失败"
|
||||
|
||||
# 步骤6:验证卸载是否成功
|
||||
LOG_INFO "验证texlive-baskervillef是否已卸载"
|
||||
rpm -q texlive-baskervillef > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_ERROR "texlive-baskervillef卸载验证失败"
|
||||
exit 1
|
||||
else
|
||||
LOG_INFO "texlive-baskervillef卸载验证成功"
|
||||
fi
|
||||
|
||||
# 步骤7:环境恢复
|
||||
LOG_INFO "恢复测试环境"
|
||||
if [ "$INSTALLED" = "true" ]; then
|
||||
LOG_INFO "重新安装texlive-baskervillef以恢复原状态"
|
||||
dnf install -y texlive-baskervillef
|
||||
CHECK_RESULT $? 0 0 "重新安装texlive-baskervillef失败"
|
||||
LOG_INFO "环境已恢复到初始安装状态"
|
||||
else
|
||||
LOG_INFO "环境已保持未安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试脚本执行完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,63 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-09-17
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test basic usage
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试: Test basic usage"
|
||||
|
||||
# 检查是否已安装texlive-baskervillef
|
||||
LOG_INFO "检查是否已安装texlive-baskervillef"
|
||||
dnf list installed texlive-baskervillef &> /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-baskervillef已安装,测试将保持安装状态"
|
||||
installed=true
|
||||
else
|
||||
LOG_INFO "texlive-baskervillef未安装,测试将进行安装"
|
||||
installed=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有texlive-baskervillef
|
||||
LOG_INFO "检查yum源中是否有texlive-baskervillef"
|
||||
dnf list available texlive-baskervillef &> /dev/null
|
||||
CHECK_RESULT $? 0 255 "yum源中未找到texlive-baskervillef"
|
||||
|
||||
# 如果未安装,则安装texlive-baskervillef
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "安装texlive-baskervillef"
|
||||
dnf install -y texlive-baskervillef
|
||||
CHECK_RESULT $? 0 0 "安装texlive-baskervillef失败"
|
||||
fi
|
||||
|
||||
# 测试texlive-baskervillef的基本功能
|
||||
LOG_INFO "测试texlive-baskervillef的基本功能"
|
||||
texdoc --list texlive-baskervillef &> /dev/null
|
||||
CHECK_RESULT $? 0 255 "texdoc命令不支持或参数错误"
|
||||
|
||||
# 如果之前未安装,则在测试完成后卸载texlive-baskervillef
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载texlive-baskervillef"
|
||||
dnf remove -y texlive-baskervillef
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-baskervillef失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成: Test basic usage"
|
||||
}
|
||||
|
||||
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 : 2025-11-26
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test the font rendering functionality of texlive-cascadilla
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查texlive-cascadilla软件包是否已安装
|
||||
LOG_INFO "检查texlive-cascadilla软件包是否已安装"
|
||||
rpm -q texlive-cascadilla > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-cascadilla软件包已安装"
|
||||
installed=true
|
||||
else
|
||||
LOG_INFO "texlive-cascadilla软件包未安装"
|
||||
installed=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在texlive-cascadilla软件包
|
||||
LOG_INFO "检查yum源中是否存在texlive-cascadilla软件包"
|
||||
dnf list available texlive-cascadilla > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中不存在texlive-cascadilla软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装texlive-cascadilla软件包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "安装texlive-cascadilla软件包"
|
||||
dnf install -y texlive-cascadilla
|
||||
CHECK_RESULT $? 0 0 "安装texlive-cascadilla软件包失败"
|
||||
fi
|
||||
|
||||
# 测试字体渲染功能
|
||||
LOG_INFO "测试texlive-cascadilla字体渲染功能"
|
||||
echo "\documentclass{article}
|
||||
\usepackage{cascadilla}
|
||||
\begin{document}
|
||||
Test cascadilla font rendering.
|
||||
\end{document}" > test_font.tex
|
||||
pdflatex test_font.tex > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "字体渲染功能测试失败"
|
||||
|
||||
# 清理临时文件
|
||||
LOG_INFO "清理临时文件"
|
||||
rm -f test_font.tex test_font.aux test_font.log test_font.pdf
|
||||
|
||||
# 如果脚本开始时未安装,则卸载texlive-cascadilla软件包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载texlive-cascadilla软件包"
|
||||
dnf remove -y texlive-cascadilla
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-cascadilla软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试脚本执行完毕,环境已恢复"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,88 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-03-04
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test the basic usage of texlive-cascadilla in a LaTeX document
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 环境检查:检查texlive-cascadilla是否已安装
|
||||
LOG_INFO "检查texlive-cascadilla是否已安装"
|
||||
rpm -q texlive-cascadilla
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-cascadilla已安装,测试结束后将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "texlive-cascadilla未安装,将在测试过程中安装"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有texlive-cascadilla软件包
|
||||
LOG_INFO "检查yum源中是否有texlive-cascadilla软件包"
|
||||
dnf list available texlive-cascadilla > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到texlive-cascadilla软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装texlive-cascadilla
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "安装texlive-cascadilla"
|
||||
dnf install -y texlive-cascadilla
|
||||
CHECK_RESULT $? 0 0 "安装texlive-cascadilla失败"
|
||||
fi
|
||||
|
||||
# 创建测试LaTeX文档
|
||||
LOG_INFO "创建测试LaTeX文档"
|
||||
cat > test_cascadilla.tex << "EOF"
|
||||
\documentclass{article}
|
||||
\usepackage{cascadilla}
|
||||
\begin{document}
|
||||
This is a test document using the cascadilla package.
|
||||
\end{document}
|
||||
EOF
|
||||
CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败"
|
||||
|
||||
# 使用pdflatex编译LaTeX文档
|
||||
LOG_INFO "使用pdflatex编译LaTeX文档"
|
||||
pdflatex test_cascadilla.tex > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "pdflatex编译失败"
|
||||
|
||||
# 检查生成的PDF文件是否存在
|
||||
LOG_INFO "检查生成的PDF文件是否存在"
|
||||
if [ -f test_cascadilla.pdf ]; then
|
||||
LOG_INFO "PDF文件生成成功"
|
||||
else
|
||||
LOG_ERROR "PDF文件未生成"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 清理生成的中间文件
|
||||
LOG_INFO "清理生成的中间文件"
|
||||
rm -f test_cascadilla.aux test_cascadilla.log test_cascadilla.out test_cascadilla.tex
|
||||
|
||||
# 如果测试前未安装,则卸载texlive-cascadilla
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载texlive-cascadilla"
|
||||
dnf remove -y texlive-cascadilla
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-cascadilla失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,62 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-11-26
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test basic functionality of texlive-fouridx
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 检查是否已安装texlive-fouridx
|
||||
LOG_INFO "检查是否已安装texlive-fouridx"
|
||||
rpm -q texlive-fouridx > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-fouridx已安装,脚本结束时将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "texlive-fouridx未安装,将在测试结束后卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有texlive-fouridx软件包
|
||||
LOG_INFO "检查yum源中是否有texlive-fouridx软件包"
|
||||
dnf list available texlive-fouridx > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到texlive-fouridx软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装texlive-fouridx软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "安装texlive-fouridx软件包"
|
||||
dnf install -y texlive-fouridx
|
||||
CHECK_RESULT $? 0 0 "安装texlive-fouridx失败"
|
||||
fi
|
||||
|
||||
# 测试texlive-fouridx基本功能
|
||||
LOG_INFO "测试texlive-fouridx基本功能"
|
||||
texdoc fouridx > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "执行texdoc fouridx失败"
|
||||
|
||||
# 清理环境:如果之前未安装,则卸载texlive-fouridx
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载texlive-fouridx软件包"
|
||||
dnf remove -y texlive-fouridx
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-fouridx失败"
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,63 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-02-28
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test checking if texlive-fouridx is installed
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试:检查texlive-fouridx是否安装"
|
||||
LOG_INFO "步骤1:检查yum源中是否存在texlive-fouridx软件包"
|
||||
if ! dnf list available texlive-fouridx &>/dev/null; then
|
||||
LOG_ERROR "yum源中不存在texlive-fouridx软件包"
|
||||
exit 255
|
||||
fi
|
||||
LOG_INFO "步骤2:检查系统是否已经安装了texlive-fouridx"
|
||||
if rpm -q texlive-fouridx &>/dev/null; then
|
||||
LOG_INFO "texlive-fouridx已安装,标记为已安装状态"
|
||||
ALREADY_INSTALLED=1
|
||||
else
|
||||
LOG_INFO "texlive-fouridx未安装,标记为未安装状态"
|
||||
ALREADY_INSTALLED=0
|
||||
fi
|
||||
if [ $ALREADY_INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "步骤3:安装texlive-fouridx软件包"
|
||||
dnf install -y texlive-fouridx
|
||||
CHECK_RESULT $? 0 0 "安装texlive-fouridx失败"
|
||||
LOG_INFO "texlive-fouridx安装成功"
|
||||
fi
|
||||
LOG_INFO "步骤4:验证texlive-fouridx命令是否可用"
|
||||
if ! command -v fouridx &>/dev/null; then
|
||||
LOG_ERROR "fouridx命令不存在或不支持"
|
||||
exit 255
|
||||
fi
|
||||
LOG_INFO "步骤5:执行基本的fouridx命令检查"
|
||||
fouridx --version
|
||||
CHECK_RESULT $? 0 0 "执行fouridx命令失败"
|
||||
LOG_INFO "fouridx命令执行成功"
|
||||
if [ $ALREADY_INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "步骤6:卸载texlive-fouridx软件包"
|
||||
dnf remove -y texlive-fouridx
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-fouridx失败"
|
||||
LOG_INFO "texlive-fouridx卸载成功,环境已恢复"
|
||||
else
|
||||
LOG_INFO "步骤6:测试前已安装texlive-fouridx,保持安装状态,不进行卸载"
|
||||
fi
|
||||
LOG_INFO "测试完成:texlive-fouridx功能检查通过"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,85 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-02-28
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test basic LaTeX document compilation with fouridx
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试: 基本LaTeX文档编译与fouridx功能"
|
||||
|
||||
LOG_INFO "步骤1: 检查环境中是否已安装texlive-fouridx软件包"
|
||||
if dnf list installed texlive-fouridx &> /dev/null; then
|
||||
LOG_INFO "texlive-fouridx已安装,测试后将保持安装状态"
|
||||
INSTALLED_ALREADY=1
|
||||
else
|
||||
LOG_INFO "texlive-fouridx未安装,将在测试中安装并在结束后卸载"
|
||||
INSTALLED_ALREADY=0
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤2: 检查yum源中是否存在texlive-fouridx软件包"
|
||||
if ! dnf list available texlive-fouridx &> /dev/null; then
|
||||
LOG_ERROR "yum源中未找到texlive-fouridx软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
if [ $INSTALLED_ALREADY -eq 0 ]; then
|
||||
LOG_INFO "步骤3: 安装texlive-fouridx软件包"
|
||||
dnf install -y texlive-fouridx
|
||||
CHECK_RESULT $? 0 0 "安装texlive-fouridx失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤4: 创建测试LaTeX文档"
|
||||
cat > test_fouridx.tex << "EOF"
|
||||
\documentclass{article}
|
||||
\usepackage{fouridx}
|
||||
\begin{document}
|
||||
This is a test document using fouridx: $\fouridx{1}{2}{3}{4}$
|
||||
\end{document}
|
||||
EOF
|
||||
CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败"
|
||||
|
||||
LOG_INFO "步骤5: 使用pdflatex编译LaTeX文档"
|
||||
if ! command -v pdflatex &> /dev/null; then
|
||||
LOG_ERROR "pdflatex命令不存在或不支持"
|
||||
exit 255
|
||||
fi
|
||||
pdflatex -interaction=nonstopmode test_fouridx.tex
|
||||
CHECK_RESULT $? 0 0 "编译LaTeX文档失败"
|
||||
|
||||
LOG_INFO "步骤6: 检查生成的PDF文件"
|
||||
if [ -f test_fouridx.pdf ]; then
|
||||
LOG_INFO "PDF文件生成成功: test_fouridx.pdf"
|
||||
else
|
||||
LOG_ERROR "PDF文件生成失败"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $INSTALLED_ALREADY -eq 0 ]; then
|
||||
LOG_INFO "步骤7: 卸载texlive-fouridx软件包"
|
||||
dnf remove -y texlive-fouridx
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-fouridx失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤8: 清理测试文件"
|
||||
rm -f test_fouridx.tex test_fouridx.pdf test_fouridx.aux test_fouridx.log test_fouridx.out
|
||||
CHECK_RESULT $? 0 0 "清理测试文件失败"
|
||||
|
||||
LOG_INFO "测试完成: 基本LaTeX文档编译与fouridx功能测试通过"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,68 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-06-27
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试 texlive-properties-doc 软件包的回滚功能,验证回滚过程是否成功完成。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试 texlive-properties-doc 软件包的回滚功能"
|
||||
|
||||
# 检查软件包是否已安装
|
||||
LOG_INFO "检查 texlive-properties-doc 是否已安装"
|
||||
dnf list installed texlive-properties-doc &> /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-properties-doc 已安装,跳过安装步骤"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "texlive-properties-doc 未安装,准备安装"
|
||||
INSTALLED=0
|
||||
fi
|
||||
|
||||
# 检查 yum 源中是否有该软件包
|
||||
LOG_INFO "检查 yum 源中是否有 texlive-properties-doc"
|
||||
dnf list available texlive-properties-doc &> /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum 源中未找到 texlive-properties-doc 软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "正在安装 texlive-properties-doc"
|
||||
dnf install -y texlive-properties-doc &> /dev/null
|
||||
CHECK_RESULT $? 0 0 "安装 texlive-properties-doc 失败"
|
||||
fi
|
||||
|
||||
# 测试回滚功能
|
||||
LOG_INFO "测试回滚 texlive-properties-doc"
|
||||
dnf history undo last -y &> /dev/null
|
||||
CHECK_RESULT $? 0 0 "回滚 texlive-properties-doc 失败"
|
||||
|
||||
# 清理环境
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "清理环境,卸载 texlive-properties-doc"
|
||||
dnf remove -y texlive-properties-doc &> /dev/null
|
||||
CHECK_RESULT $? 0 0 "卸载 texlive-properties-doc 失败"
|
||||
else
|
||||
LOG_INFO "保持环境,不卸载 texlive-properties-doc"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,73 +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 Arabic text rendering
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查是否已安装texlive-hvarabic软件包
|
||||
LOG_INFO "检查是否已安装texlive-hvarabic软件包"
|
||||
rpm -q texlive-hvarabic > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-hvarabic已安装,脚本结束时将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "texlive-hvarabic未安装,脚本结束时将卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有texlive-hvarabic软件包
|
||||
LOG_INFO "检查yum源中是否有texlive-hvarabic软件包"
|
||||
dnf list available texlive-hvarabic > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 255 "yum源中未找到texlive-hvarabic软件包"
|
||||
|
||||
# 安装texlive-hvarabic软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "开始安装texlive-hvarabic软件包"
|
||||
dnf install -y texlive-hvarabic > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装texlive-hvarabic失败"
|
||||
fi
|
||||
|
||||
# 测试阿拉伯文本渲染功能
|
||||
LOG_INFO "测试阿拉伯文本渲染功能"
|
||||
echo "\documentclass{article}
|
||||
\usepackage{hvarabic}
|
||||
\begin{document}
|
||||
\textarabic{مرحبا بالعالم}
|
||||
\end{document}" > test_arabic.tex
|
||||
|
||||
pdflatex test_arabic.tex > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "阿拉伯文本渲染失败"
|
||||
|
||||
# 清理生成的临时文件
|
||||
LOG_INFO "清理生成的临时文件"
|
||||
rm -f test_arabic.tex test_arabic.aux test_arabic.log test_arabic.pdf
|
||||
|
||||
# 如果脚本开始时未安装texlive-hvarabic,则卸载
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载texlive-hvarabic软件包"
|
||||
dnf remove -y texlive-hvarabic > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-hvarabic失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试脚本执行完成"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,63 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-11-26
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test basic functionality of texlive-todo package
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查texlive-todo软件包是否已安装
|
||||
LOG_INFO "检查texlive-todo软件包是否已安装"
|
||||
rpm -q texlive-todo > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-todo软件包已安装,脚本结束时将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "texlive-todo软件包未安装,将在测试结束后卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有texlive-todo软件包
|
||||
LOG_INFO "检查yum源中是否有texlive-todo软件包"
|
||||
dnf list available texlive-todo > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 255 "yum源中未找到texlive-todo软件包"
|
||||
|
||||
# 安装texlive-todo软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "安装texlive-todo软件包"
|
||||
dnf install -y texlive-todo
|
||||
CHECK_RESULT $? 0 0 "安装texlive-todo软件包失败"
|
||||
fi
|
||||
|
||||
# 测试texlive-todo基本功能
|
||||
LOG_INFO "测试texlive-todo基本功能"
|
||||
texdoc todo > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "texdoc todo命令执行失败"
|
||||
|
||||
# 清理环境:如果脚本开始时未安装texlive-todo,则卸载
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载texlive-todo软件包"
|
||||
dnf remove -y texlive-todo
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-todo软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试脚本执行完毕,环境已恢复"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,84 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-03-02
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test basic LaTeX document compilation with todo package
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试:Test basic LaTeX document compilation with todo package"
|
||||
|
||||
LOG_INFO "步骤1:检查环境中是否已安装 texlive 相关软件包"
|
||||
if dnf list installed texlive &>/dev/null; then
|
||||
LOG_INFO "texlive 已安装,跳过安装步骤"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "texlive 未安装,将在测试步骤中安装"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤2:检查 yum 源中是否存在 texlive-todo 软件包"
|
||||
if ! dnf list available texlive-todo &>/dev/null; then
|
||||
LOG_ERROR "yum 源中未找到 texlive-todo 软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤3:如果未安装,则安装 texlive-todo 软件包"
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
dnf install -y texlive-todo
|
||||
CHECK_RESULT $? 0 0 "安装 texlive-todo 失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤4:创建测试 LaTeX 文档,包含 todo 包的基本使用"
|
||||
cat > test_todo.tex << "EOF"
|
||||
\documentclass{article}
|
||||
\usepackage{todo}
|
||||
\begin{document}
|
||||
\listoftodos
|
||||
\section{Introduction}
|
||||
This is a test document for the todo package.
|
||||
\todo[inline]{This is an inline todo item.}
|
||||
\todo{This is a margin todo item.}
|
||||
\end{document}
|
||||
EOF
|
||||
CHECK_RESULT $? 0 0 "创建测试 LaTeX 文档失败"
|
||||
|
||||
LOG_INFO "步骤5:使用 pdflatex 编译 LaTeX 文档"
|
||||
pdflatex -interaction=nonstopmode test_todo.tex
|
||||
CHECK_RESULT $? 0 0 "编译 LaTeX 文档失败"
|
||||
|
||||
LOG_INFO "步骤6:检查是否生成了 PDF 文件"
|
||||
if [ -f "test_todo.pdf" ]; then
|
||||
LOG_INFO "PDF 文件生成成功"
|
||||
else
|
||||
LOG_ERROR "PDF 文件未生成"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤7:清理生成的临时文件"
|
||||
rm -f test_todo.aux test_todo.log test_todo.out test_todo.toc test_todo.pdf test_todo.tex
|
||||
|
||||
LOG_INFO "步骤8:如果测试前未安装,则卸载 texlive-todo 软件包"
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
dnf remove -y texlive-todo
|
||||
CHECK_RESULT $? 0 0 "卸载 texlive-todo 失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:Test basic LaTeX document compilation with todo package"
|
||||
}
|
||||
|
||||
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 : 2026-03-02
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Verify texlive-todo package is installed on the system
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "测试开始:验证系统是否已安装 texlive-todo 软件包"
|
||||
LOG_INFO "步骤1:检查当前系统是否已安装 texlive-todo"
|
||||
rpm -q texlive-todo > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-todo 已安装,测试将验证其存在性,并在结束后保持安装状态"
|
||||
INSTALLED_BEFORE_TEST=1
|
||||
else
|
||||
LOG_INFO "texlive-todo 未安装,将在测试过程中安装,并在测试结束后卸载"
|
||||
INSTALLED_BEFORE_TEST=0
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤2:检查 yum 源中是否存在 texlive-todo 软件包"
|
||||
dnf list available texlive-todo > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 255 "yum 源中未找到 texlive-todo 软件包"
|
||||
|
||||
if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then
|
||||
LOG_INFO "步骤3:安装 texlive-todo 软件包"
|
||||
dnf install -y texlive-todo
|
||||
CHECK_RESULT $? 0 0 "安装 texlive-todo 软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤4:验证 texlive-todo 软件包已正确安装"
|
||||
rpm -q texlive-todo > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "texlive-todo 软件包未正确安装"
|
||||
|
||||
LOG_INFO "步骤5:执行 texlive-todo 相关命令以验证其功能"
|
||||
# 假设 texlive-todo 提供了一个基础命令 "texlive-todo",这里检查其版本
|
||||
texlive-todo --version > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "texlive-todo 命令执行失败"
|
||||
|
||||
LOG_INFO "步骤6:清理测试环境"
|
||||
if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then
|
||||
LOG_INFO "卸载 texlive-todo 软件包"
|
||||
dnf remove -y texlive-todo
|
||||
CHECK_RESULT $? 0 0 "卸载 texlive-todo 软件包失败"
|
||||
else
|
||||
LOG_INFO "测试前已安装 texlive-todo,保持其安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试结束:texlive-todo 软件包安装验证完成"
|
||||
}
|
||||
|
||||
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-02
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test placement of todo notes in the document margin
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试:Test placement of todo notes in the document margin"
|
||||
LOG_INFO "检查是否已安装 texlive-todo 软件包"
|
||||
rpm -q texlive-todo
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "检测到 texlive-todo 已安装,测试结束后将保持安装状态"
|
||||
INSTALLED_BEFORE_TEST=1
|
||||
else
|
||||
LOG_INFO "检测到 texlive-todo 未安装,将在测试前安装,测试结束后卸载"
|
||||
INSTALLED_BEFORE_TEST=0
|
||||
fi
|
||||
|
||||
if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then
|
||||
LOG_INFO "检查 yum 源中是否存在 texlive-todo 软件包"
|
||||
dnf list available texlive-todo
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum 源中未找到 texlive-todo 软件包"
|
||||
exit 255
|
||||
fi
|
||||
LOG_INFO "安装 texlive-todo 软件包"
|
||||
dnf install -y texlive-todo
|
||||
CHECK_RESULT $? 0 0 "安装 texlive-todo 失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试 todo 注释在文档边距中的放置功能"
|
||||
TEX_FILE="test_todo_margin.tex"
|
||||
cat > $TEX_FILE << "EOF"
|
||||
\documentclass{article}
|
||||
\usepackage[textwidth=10cm]{geometry}
|
||||
\usepackage{todonotes}
|
||||
\begin{document}
|
||||
This is a test document.
|
||||
\todo[inline]{This is an inline todo note.}
|
||||
\todo[color=green!40]{This is a margin todo note.}
|
||||
\end{document}
|
||||
EOF
|
||||
|
||||
LOG_INFO "使用 pdflatex 编译 LaTeX 文档"
|
||||
pdflatex -interaction=nonstopmode $TEX_FILE
|
||||
CHECK_RESULT $? 0 0 "pdflatex 编译失败"
|
||||
|
||||
LOG_INFO "检查生成的 PDF 文件是否存在"
|
||||
if [ -f "${TEX_FILE%.tex}.pdf" ]; then
|
||||
LOG_INFO "PDF 文件生成成功,测试通过"
|
||||
else
|
||||
LOG_ERROR "PDF 文件未生成,测试失败"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LOG_INFO "清理测试生成的临时文件"
|
||||
rm -f ${TEX_FILE%.tex}.aux ${TEX_FILE%.tex}.log ${TEX_FILE%.tex}.out ${TEX_FILE%.tex}.pdf $TEX_FILE
|
||||
|
||||
if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then
|
||||
LOG_INFO "卸载 texlive-todo 软件包"
|
||||
dnf remove -y texlive-todo
|
||||
CHECK_RESULT $? 0 0 "卸载 texlive-todo 失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,149 +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-02
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test generation of a todo list in the compiled document
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 测试环境初始化检查
|
||||
LOG_INFO "开始测试:在编译文档中生成待办事项列表功能"
|
||||
|
||||
# 检查texlive相关软件包是否已安装
|
||||
LOG_INFO "步骤1:检查texlive-todo软件包是否已安装"
|
||||
rpm -q texlive-todo > /dev/null 2>&1
|
||||
texlive_installed=$?
|
||||
|
||||
# 如果未安装,检查yum源中是否有该软件包
|
||||
if [ $texlive_installed -ne 0 ]; then
|
||||
LOG_INFO "步骤2:检查yum源中是否有texlive-todo软件包"
|
||||
dnf list available texlive-todo > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到texlive-todo软件包"
|
||||
exit 255
|
||||
fi
|
||||
fi
|
||||
|
||||
# 创建测试目录
|
||||
LOG_INFO "步骤3:创建测试工作目录"
|
||||
test_dir="/tmp/test_texlive_todo_$(date +%s)"
|
||||
mkdir -p $test_dir
|
||||
CHECK_RESULT $? 0 0 "创建测试目录失败"
|
||||
|
||||
cd $test_dir
|
||||
|
||||
# 生成测试LaTeX文档
|
||||
LOG_INFO "步骤4:生成测试LaTeX文档"
|
||||
cat > test_todo.tex << "EOF"
|
||||
\documentclass{article}
|
||||
\usepackage{todo}
|
||||
\begin{document}
|
||||
\title{Test Todo List}
|
||||
\author{Test Author}
|
||||
\maketitle
|
||||
|
||||
\section{Test Section}
|
||||
This is a test document for todo list functionality.
|
||||
|
||||
\todo{First todo item}
|
||||
\todo[inline]{Second inline todo item}
|
||||
\todo[color=green]{Third colored todo item}
|
||||
|
||||
\listoftodos
|
||||
\end{document}
|
||||
EOF
|
||||
CHECK_RESULT $? 0 0 "生成测试LaTeX文档失败"
|
||||
|
||||
# 如果未安装texlive-todo,则安装
|
||||
if [ $texlive_installed -ne 0 ]; then
|
||||
LOG_INFO "步骤5:安装texlive-todo软件包"
|
||||
dnf install -y texlive-todo
|
||||
CHECK_RESULT $? 0 0 "安装texlive-todo软件包失败"
|
||||
fi
|
||||
|
||||
# 检查pdflatex命令是否可用
|
||||
LOG_INFO "步骤6:检查pdflatex命令是否可用"
|
||||
which pdflatex > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_INFO "步骤7:安装texlive-pdflatex软件包"
|
||||
dnf list available texlive-pdflatex > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到texlive-pdflatex软件包"
|
||||
# 清理环境
|
||||
cd /
|
||||
rm -rf $test_dir
|
||||
if [ $texlive_installed -ne 0 ]; then
|
||||
dnf remove -y texlive-todo
|
||||
fi
|
||||
exit 255
|
||||
fi
|
||||
dnf install -y texlive-pdflatex
|
||||
CHECK_RESULT $? 0 0 "安装texlive-pdflatex软件包失败"
|
||||
fi
|
||||
|
||||
# 编译LaTeX文档
|
||||
LOG_INFO "步骤8:编译LaTeX文档生成待办事项列表"
|
||||
pdflatex -interaction=nonstopmode test_todo.tex > compile.log 2>&1
|
||||
compile_result=$?
|
||||
|
||||
# 检查编译日志中是否有todo相关的错误
|
||||
if [ $compile_result -ne 0 ]; then
|
||||
LOG_ERROR "LaTeX文档编译失败"
|
||||
cat compile.log
|
||||
CHECK_RESULT 1 0 0 "LaTeX文档编译失败"
|
||||
fi
|
||||
|
||||
# 检查是否生成了待办事项列表
|
||||
LOG_INFO "步骤9:检查是否成功生成待办事项列表"
|
||||
if grep -q "List of Todos" test_todo.aux 2>/dev/null || grep -q "\\\@starttoc{tdo}" test_todo.aux 2>/dev/null; then
|
||||
LOG_INFO "待办事项列表生成成功"
|
||||
CHECK_RESULT 0 0 0 "待办事项列表生成失败"
|
||||
else
|
||||
# 检查输出PDF中是否包含todo内容
|
||||
if [ -f test_todo.pdf ]; then
|
||||
pdftotext test_todo.pdf test_todo.txt 2>/dev/null
|
||||
if grep -q -i "todo" test_todo.txt 2>/dev/null; then
|
||||
LOG_INFO "待办事项列表生成成功"
|
||||
CHECK_RESULT 0 0 0 "待办事项列表生成失败"
|
||||
else
|
||||
LOG_ERROR "待办事项列表未在输出文档中找到"
|
||||
CHECK_RESULT 1 0 0 "待办事项列表生成失败"
|
||||
fi
|
||||
else
|
||||
LOG_ERROR "未生成PDF输出文件"
|
||||
CHECK_RESULT 1 0 0 "待办事项列表生成失败"
|
||||
fi
|
||||
fi
|
||||
|
||||
# 清理测试文件
|
||||
LOG_INFO "步骤10:清理测试文件"
|
||||
cd /
|
||||
rm -rf $test_dir
|
||||
CHECK_RESULT $? 0 0 "清理测试文件失败"
|
||||
|
||||
# 如果测试前未安装texlive-todo,则在测试后卸载
|
||||
if [ $texlive_installed -ne 0 ]; then
|
||||
LOG_INFO "步骤11:卸载测试安装的软件包"
|
||||
dnf remove -y texlive-todo texlive-pdflatex 2>/dev/null
|
||||
# 不检查结果,因为可能其他测试依赖这些包
|
||||
LOG_INFO "测试环境已恢复"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:在编译文档中生成待办事项列表功能测试通过"
|
||||
}
|
||||
|
||||
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-03-19
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试使用 texlive-uspatent 宏包编译一个简单的包含该宏包命令的 TeX 文档,验证其基本功能是否正常。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试 texlive-uspatent 宏包编译功能"
|
||||
|
||||
# 检查软件包是否在yum源中
|
||||
LOG_INFO "检查 texlive-uspatent 宏包是否在yum源中"
|
||||
dnf list texlive-uspatent 2>/dev/null | grep -q texlive-uspatent
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到 texlive-uspatent 软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 检查环境是否已安装
|
||||
LOG_INFO "检查 texlive-uspatent 是否已安装"
|
||||
rpm -q texlive-uspatent > /dev/null 2>&1
|
||||
installed=$?
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ $installed -ne 0 ]; then
|
||||
LOG_INFO "安装 texlive-uspatent 软件包"
|
||||
dnf install -y texlive-uspatent
|
||||
CHECK_RESULT $? 0 0 "安装 texlive-uspatent 失败"
|
||||
fi
|
||||
|
||||
# 创建测试用的 TeX 文档
|
||||
LOG_INFO "创建测试用的 TeX 文档"
|
||||
cat > test_uspatent.tex << "EOF"
|
||||
\documentclass{article}
|
||||
\usepackage{uspatent}
|
||||
\begin{document}
|
||||
\title{Test Document}
|
||||
\author{Test Author}
|
||||
\maketitle
|
||||
This is a test document using the uspatent package.
|
||||
\end{document}
|
||||
EOF
|
||||
CHECK_RESULT $? 0 0 "创建 TeX 文档失败"
|
||||
|
||||
# 检查 pdflatex 命令是否可用
|
||||
LOG_INFO "检查 pdflatex 命令是否可用"
|
||||
command -v pdflatex > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "pdflatex 命令不存在或不支持"
|
||||
|
||||
# 使用 texlive-uspatent 宏包编译 TeX 文档
|
||||
LOG_INFO "使用 texlive-uspatent 宏包编译 TeX 文档"
|
||||
pdflatex -interaction=nonstopmode test_uspatent.tex > compile.log 2>&1
|
||||
CHECK_RESULT $? 0 0 "编译 TeX 文档失败"
|
||||
|
||||
# 检查生成的 PDF 文件是否存在
|
||||
LOG_INFO "检查生成的 PDF 文件是否存在"
|
||||
[ -f test_uspatent.pdf ]
|
||||
CHECK_RESULT $? 0 0 "未生成 PDF 文件"
|
||||
|
||||
# 清理生成的中间文件
|
||||
LOG_INFO "清理生成的中间文件"
|
||||
rm -f test_uspatent.aux test_uspatent.log test_uspatent.out compile.log
|
||||
|
||||
# 如果测试前未安装,则在测试后卸载软件包
|
||||
if [ $installed -ne 0 ]; then
|
||||
LOG_INFO "卸载 texlive-uspatent 软件包"
|
||||
dnf remove -y texlive-uspatent
|
||||
CHECK_RESULT $? 0 0 "卸载 texlive-uspatent 失败"
|
||||
else
|
||||
LOG_INFO "测试前已安装 texlive-uspatent,保持安装状态"
|
||||
fi
|
||||
|
||||
# 清理测试文件
|
||||
LOG_INFO "清理测试文件"
|
||||
rm -f test_uspatent.tex test_uspatent.pdf
|
||||
|
||||
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 : 2026-03-19
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试 texlive-uspatent 软件包的版本查询功能,验证能否正确获取版本信息。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 设置环境变量和日志函数(直接使用,无需定义)
|
||||
LOG_INFO() {
|
||||
echo "[INFO] $*"
|
||||
}
|
||||
LOG_ERROR() {
|
||||
echo "[ERROR] $*" >&2
|
||||
}
|
||||
|
||||
# 定义软件包名称
|
||||
PACKAGE_NAME="texlive-uspatent"
|
||||
|
||||
# 步骤1:检查yum源中是否存在texlive-uspatent软件包
|
||||
LOG_INFO "步骤1:检查yum源中是否存在$PACKAGE_NAME软件包"
|
||||
dnf list available "$PACKAGE_NAME" >/dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "yum源中未找到$PACKAGE_NAME软件包,退出"
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到$PACKAGE_NAME软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 步骤2:检查软件包是否已经安装
|
||||
LOG_INFO "步骤2:检查$PACKAGE_NAME软件包是否已经安装"
|
||||
if rpm -q "$PACKAGE_NAME" >/dev/null 2>&1; then
|
||||
LOG_INFO "$PACKAGE_NAME软件包已经安装,脚本结束后将保持安装状态"
|
||||
INSTALLED_BEFORE=true
|
||||
else
|
||||
LOG_INFO "$PACKAGE_NAME软件包未安装,将在测试步骤中安装"
|
||||
INSTALLED_BEFORE=false
|
||||
fi
|
||||
|
||||
# 步骤3:如果未安装,则安装软件包
|
||||
if [ "$INSTALLED_BEFORE" = false ]; then
|
||||
LOG_INFO "步骤3:安装$PACKAGE_NAME软件包"
|
||||
dnf install -y "$PACKAGE_NAME"
|
||||
CHECK_RESULT $? 0 0 "安装$PACKAGE_NAME软件包失败"
|
||||
fi
|
||||
|
||||
# 步骤4:测试texlive-uspatent软件包的版本查询功能
|
||||
LOG_INFO "步骤4:测试$PACKAGE_NAME软件包的版本查询功能"
|
||||
# 使用rpm命令查询版本信息
|
||||
VERSION_INFO=$(rpm -q "$PACKAGE_NAME" --queryformat "%{VERSION}-%{RELEASE}\n")
|
||||
CHECK_RESULT $? 0 0 "查询$PACKAGE_NAME版本信息失败"
|
||||
if [ -n "$VERSION_INFO" ]; then
|
||||
LOG_INFO "$PACKAGE_NAME版本信息:$VERSION_INFO"
|
||||
else
|
||||
LOG_ERROR "未能获取$PACKAGE_NAME版本信息"
|
||||
CHECK_RESULT 1 0 0 "获取版本信息失败"
|
||||
fi
|
||||
|
||||
# 步骤5:验证版本信息格式(简单验证)
|
||||
LOG_INFO "步骤5:验证版本信息格式"
|
||||
# 检查版本信息是否包含数字和点号(基本格式验证)
|
||||
if echo "$VERSION_INFO" | grep -qE "^[0-9]+(\.[0-9]+)*-[0-9]+"; then
|
||||
LOG_INFO "版本信息格式验证通过"
|
||||
else
|
||||
LOG_ERROR "版本信息格式不符合预期"
|
||||
CHECK_RESULT 1 0 0 "版本信息格式验证失败"
|
||||
fi
|
||||
|
||||
# 步骤6:环境清理
|
||||
LOG_INFO "步骤6:环境清理"
|
||||
if [ "$INSTALLED_BEFORE" = false ]; then
|
||||
LOG_INFO "卸载$PACKAGE_NAME软件包"
|
||||
dnf remove -y "$PACKAGE_NAME"
|
||||
CHECK_RESULT $? 0 0 "卸载$PACKAGE_NAME软件包失败"
|
||||
else
|
||||
LOG_INFO "$PACKAGE_NAME软件包在脚本执行前已安装,保持安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user