Merge branch 'pkg' of http://10.30.190.190:54866/redrsoe2100/os-autotest into pkg
This commit is contained in:
@@ -6,15 +6,6 @@
|
||||
"name": "test_auto-service_uninstall",
|
||||
"desc": "测试auto-service软件包的卸载功能,验证卸载过程是否成功完成。",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_auto-service_dependency_check",
|
||||
"desc": "测试auto-service软件包的依赖检查功能,验证安装前是否能正确检查并满足所有依赖条件。",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_auto-service_function_install",
|
||||
"desc": "测试auto-service软件包的安装功能,验证安装过程是否成功完成。"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -13,14 +13,6 @@
|
||||
{
|
||||
"name": "test_ibus-table-chinese-wu_function_uninstall",
|
||||
"desc": "测试软件包 ibus-table-chinese-wu 可以通过系统包管理器成功卸载。"
|
||||
},
|
||||
{
|
||||
"name": "test_ibus-table-chinese-wu_function_input_method",
|
||||
"desc": "测试安装后,吴语输入法引擎能被ibus正确识别并出现在可用输入法列表中。"
|
||||
},
|
||||
{
|
||||
"name": "test_ibus-table-chinese-wu_function_basic_input",
|
||||
"desc": "测试选择吴语输入法后,能够进行基本的汉字输入。"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,30 +2,6 @@
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/lodash/nodejs-lodash-isfunction",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_nodejs-lodash-isfunction_function_install",
|
||||
"desc": "测试通过包管理器(如npm)安装nodejs-lodash-isfunction软件包的功能。"
|
||||
},
|
||||
{
|
||||
"name": "test_nodejs-lodash-isfunction_function_require",
|
||||
"desc": "测试在Node.js环境中通过require语句成功引入lodash.isfunction模块。"
|
||||
},
|
||||
{
|
||||
"name": "test_nodejs-lodash-isfunction_function_basic",
|
||||
"desc": "测试lodash.isfunction函数对普通函数、箭头函数、生成器函数等返回true。"
|
||||
},
|
||||
{
|
||||
"name": "test_nodejs-lodash-isfunction_function_nonfunc",
|
||||
"desc": "测试lodash.isfunction函数对非函数类型(如对象、字符串、数字)返回false。"
|
||||
},
|
||||
{
|
||||
"name": "test_nodejs-lodash-isfunction_function_async",
|
||||
"desc": "测试lodash.isfunction函数对异步函数(async function)返回true。"
|
||||
},
|
||||
{
|
||||
"name": "test_nodejs-lodash-isfunction_function_class",
|
||||
"desc": "测试lodash.isfunction函数对ES6类构造函数返回true。"
|
||||
},
|
||||
{
|
||||
"name": "test_nodejs-lodash-isfunction_function_uninstall",
|
||||
"desc": "测试通过包管理器(如npm)卸载nodejs-lodash-isfunction软件包的功能。"
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/python-rfc3986-validator/python3-rfc3986-validator",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_python3-rfc3986-validator_function_validate",
|
||||
"desc": "Test URI validation functionality"
|
||||
},
|
||||
{
|
||||
"name": "test_python3-rfc3986-validator_function_install",
|
||||
"desc": "Test package installation"
|
||||
@@ -13,14 +9,6 @@
|
||||
{
|
||||
"name": "test_python3-rfc3986-validator_function_uninstall",
|
||||
"desc": "Test package removal"
|
||||
},
|
||||
{
|
||||
"name": "test_python3-rfc3986-validator_function_import",
|
||||
"desc": "Test module import"
|
||||
},
|
||||
{
|
||||
"name": "test_python3-rfc3986-validator_function_normalize",
|
||||
"desc": "Test URI normalization"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -14,38 +14,14 @@
|
||||
"name": "test_qt5-qtdeclarative-devel_qmlcachegen__v",
|
||||
"desc": "测试 qmlcachegen 的 -v 参数,显示版本信息"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmlcachegen__filter_resource_file",
|
||||
"desc": "测试 qmlcachegen 的 --filter-resource-file 参数,过滤资源文件中的 QML/JS 文件"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmlcachegen__resource_file_mapping",
|
||||
"desc": "测试 qmlcachegen 的 --resource-file-mapping 参数,指定资源文件的映射路径"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmlcachegen__resource",
|
||||
"desc": "测试 qmlcachegen 的 --resource 参数,指定可能包含编译文件的 Qt 资源文件"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmlcachegen__resource_path",
|
||||
"desc": "测试 qmlcachegen 的 --resource-path 参数,指定与编译文件对应的 Qt 资源文件路径"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmlcachegen__o",
|
||||
"desc": "测试 qmlcachegen 的 -o 参数,指定输出文件名"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmlcachegen_qml_file",
|
||||
"desc": "测试 qmlcachegen 的 QML 源文件参数,生成缓存"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmleasing__upper_v",
|
||||
"desc": "测试qmleasing命令的V参数功能"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmlimportscanner__help",
|
||||
"desc": "测试 qmlimportscanner 命令的 --help 参数是否有效"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmllint__h",
|
||||
"desc": "测试qmllint的帮助选项"
|
||||
@@ -58,105 +34,13 @@
|
||||
"name": "test_qt5-qtdeclarative-devel_qmllint__v",
|
||||
"desc": "测试qmllint的版本信息选项"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmllint__s",
|
||||
"desc": "测试qmllint的静默模式选项"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmllint__upper_u",
|
||||
"desc": "测试qmllint的未限定标识符检查选项"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmllint__upper_i",
|
||||
"desc": "测试qmllint的指定qmltypes文件目录选项"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmllint__i",
|
||||
"desc": "测试qmllint的包含指定qmltypes文件选项"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmlplugindump-qt5__v",
|
||||
"desc": "测试 qmlplugindump-qt5 命令的 -v 参数"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmlplugindump-qt5__upper_v",
|
||||
"desc": "测试 qmlplugindump-qt5 命令的 -V 参数"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmlscene__v",
|
||||
"desc": "测试 qmlscene 命令的 -v 参数,用于显示版本信息"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmltestrunner_upper_v",
|
||||
"desc": "测试 qmltestrunner 的 -V 参数功能"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmltime__v",
|
||||
"desc": "测试 qmltime 命令的 -v 参数"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmltyperegistrar__h",
|
||||
"desc": "测试帮助选项"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmltyperegistrar__help_all",
|
||||
"desc": "测试包含Qt特定选项的帮助"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmltyperegistrar__v",
|
||||
"desc": "测试版本信息选项"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmltyperegistrar__o_file",
|
||||
"desc": "测试输出到指定文件选项"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmltyperegistrar__private_includes",
|
||||
"desc": "测试包含私有头文件选项"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmltyperegistrar__import_name_module_name",
|
||||
"desc": "测试模块名称选项"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmltyperegistrar__major_version_major_version",
|
||||
"desc": "测试主版本号选项"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmltyperegistrar__minor_version_minor_version",
|
||||
"desc": "测试次版本号选项"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmltyperegistrar__generate_qmltypes_qmltypes_file",
|
||||
"desc": "测试生成qmltypes文件选项"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmltyperegistrar__foreign_types_foreign_types",
|
||||
"desc": "测试外部类型文件选项"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_qmltyperegistrar__dependencies_dependencies_json",
|
||||
"desc": "测试依赖项JSON文件选项"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_function_qmlcache",
|
||||
"desc": "测试 qmlcachegen 的基本缓存生成功能"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_function_qmllint_check",
|
||||
"desc": "测试 qmllint 的基本语法检查功能"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_function_qmlscene_run",
|
||||
"desc": "测试 qmlscene 运行 QML 文件的功能"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_function_qmltypereg",
|
||||
"desc": "测试 qmltyperegistrar 的类型注册功能"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtdeclarative-devel_function_qmlimportscan",
|
||||
"desc": "测试 qmlimportscanner 的依赖扫描功能"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,29 +2,9 @@
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/saxon/saxon-demo",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_saxon-demo_function_basic",
|
||||
"desc": "Test basic functionality of saxon-demo"
|
||||
},
|
||||
{
|
||||
"name": "test_saxon-demo_function_install",
|
||||
"desc": "Test if the saxon-demo package can be successfully installed."
|
||||
},
|
||||
{
|
||||
"name": "test_saxon-demo_function_uninstall",
|
||||
"desc": "Test if the saxon-demo package can be cleanly uninstalled."
|
||||
},
|
||||
{
|
||||
"name": "test_saxon-demo_function_version",
|
||||
"desc": "Test the ability to query the installed version of the saxon-demo package."
|
||||
},
|
||||
{
|
||||
"name": "test_saxon-demo_function_help",
|
||||
"desc": "Test if the saxon-demo command-line tool provides help information."
|
||||
},
|
||||
{
|
||||
"name": "test_saxon-demo_function_transform",
|
||||
"desc": "Test basic XSLT transformation using saxon-demo."
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -5,22 +5,6 @@
|
||||
{
|
||||
"name": "test_texlive-avremu-doc_function_install",
|
||||
"desc": "Test installation of texlive-avremu-doc package"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-avremu-doc_function_verify_installed",
|
||||
"desc": "Verify texlive-avremu-doc package is installed in system"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-avremu-doc_function_check_doc_files",
|
||||
"desc": "Check existence of main documentation files"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-avremu-doc_function_verify_content",
|
||||
"desc": "Verify documentation contains key sections and information"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-avremu-doc_function_package_removal",
|
||||
"desc": "Test removal of texlive-avremu-doc package"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-b/texlive-babel-icelandic",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_texlive-babel-icelandic_function_lang",
|
||||
"desc": "Test Icelandic language support"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,10 +2,6 @@
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-o/texlive-makeplot-doc",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_texlive-makeplot-doc_function_basic",
|
||||
"desc": "Test basic functionality of texlive-makeplot-doc"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-makeplot-doc_function_install",
|
||||
"desc": "Test installation of texlive-makeplot-doc package"
|
||||
@@ -17,14 +13,6 @@
|
||||
{
|
||||
"name": "test_texlive-makeplot-doc_function_doc_exists",
|
||||
"desc": "Test if documentation files are present after installation"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-makeplot_doc_function_manpage",
|
||||
"desc": "Test if manpage exists and is readable"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-makeplot_doc_function_info",
|
||||
"desc": "Test if info documentation exists and is accessible"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-3d-doc",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_texlive-pst-3d-doc_function_doc",
|
||||
"desc": "Verify the documentation files are installed correctly"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-v/texlive-sslides",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_texlive-sslides_function_basic",
|
||||
"desc": "Test basic functionality of texlive-sslides"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-x/texlive-bxjatoucs",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_texlive-bxjatoucs_function_install",
|
||||
"desc": "Test package installation"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-bxjatoucs_function_uninstall",
|
||||
"desc": "Test package removal"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-bxjatoucs_function_version",
|
||||
"desc": "Check package version info"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-bxjatoucs_function_usage",
|
||||
"desc": "Verify basic usage in document"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -14,10 +14,6 @@
|
||||
"name": "test_yasm_yasm__license",
|
||||
"desc": "测试 yasm 命令的 --license 参数,显示许可证信息"
|
||||
},
|
||||
{
|
||||
"name": "test_yasm_yasm__r_help",
|
||||
"desc": "测试 yasm 命令的 -r help 参数,列出支持的预处理器"
|
||||
},
|
||||
{
|
||||
"name": "test_yasm_yasm__f_help",
|
||||
"desc": "测试 yasm 命令的 -f help 参数,列出支持的对象格式"
|
||||
|
||||
@@ -1,61 +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-20
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试auto-service软件包的依赖检查功能,验证安装前是否能正确检查并满足所有依赖条件。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试auto-service软件包的依赖检查功能"
|
||||
|
||||
# 检查是否已经安装auto-service
|
||||
if dnf list installed auto-service &> /dev/null; then
|
||||
LOG_INFO "auto-service已安装,测试结束后将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "auto-service未安装,测试结束后将卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在auto-service软件包
|
||||
LOG_INFO "检查yum源中是否存在auto-service软件包"
|
||||
if ! dnf list available auto-service &> /dev/null; then
|
||||
LOG_ERROR "yum源中未找到auto-service软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装auto-service软件包并检查依赖
|
||||
LOG_INFO "尝试安装auto-service软件包以检查依赖"
|
||||
dnf install -y auto-service
|
||||
CHECK_RESULT $? 0 0 "安装auto-service失败"
|
||||
|
||||
# 验证依赖是否满足
|
||||
LOG_INFO "验证依赖是否满足"
|
||||
rpm -qR auto-service > /dev/null
|
||||
CHECK_RESULT $? 0 0 "依赖检查失败"
|
||||
|
||||
# 清理环境:如果测试前未安装,则卸载软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载auto-service软件包以恢复环境"
|
||||
dnf remove -y auto-service
|
||||
CHECK_RESULT $? 0 0 "卸载auto-service失败"
|
||||
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-03
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试auto-service软件包的安装功能,验证安装过程是否成功完成。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试auto-service软件包的安装功能"
|
||||
|
||||
# 检查是否已安装auto-service
|
||||
LOG_INFO "检查是否已安装auto-service"
|
||||
if dnf list installed auto-service &>/dev/null; then
|
||||
LOG_INFO "auto-service已安装,脚本结束时保持安装状态"
|
||||
installed=true
|
||||
else
|
||||
LOG_INFO "auto-service未安装,将在测试结束后卸载"
|
||||
installed=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有auto-service软件包
|
||||
LOG_INFO "检查yum源中是否有auto-service软件包"
|
||||
if ! dnf list available auto-service &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到auto-service软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装auto-service软件包
|
||||
LOG_INFO "开始安装auto-service软件包"
|
||||
dnf install -y auto-service
|
||||
CHECK_RESULT $? 0 0 "安装auto-service软件包失败"
|
||||
|
||||
# 验证安装是否成功
|
||||
LOG_INFO "验证auto-service是否成功安装"
|
||||
if ! dnf list installed auto-service &>/dev/null; then
|
||||
LOG_ERROR "auto-service未成功安装"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 执行测试命令(假设测试命令为检查服务状态)
|
||||
LOG_INFO "执行测试命令:检查auto-service服务状态"
|
||||
systemctl status auto-service
|
||||
CHECK_RESULT $? 0 0 "检查auto-service服务状态失败"
|
||||
|
||||
# 环境恢复
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载auto-service软件包以恢复环境"
|
||||
dnf remove -y auto-service
|
||||
CHECK_RESULT $? 0 0 "卸载auto-service软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,90 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-03-16
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试选择吴语输入法后,能够进行基本的汉字输入。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 检查是否已经安装了ibus-table-chinese-wubi软件包
|
||||
LOG_INFO "检查是否已安装ibus-table-chinese-wubi软件包"
|
||||
if rpm -q ibus-table-chinese-wubi &> /dev/null; then
|
||||
LOG_INFO "ibus-table-chinese-wubi已安装,脚本结束时将保持安装状态"
|
||||
ALREADY_INSTALLED=1
|
||||
else
|
||||
LOG_INFO "ibus-table-chinese-wubi未安装,将在测试过程中安装并在结束时卸载"
|
||||
ALREADY_INSTALLED=0
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有ibus-table-chinese-wubi软件包
|
||||
LOG_INFO "检查yum源中是否有ibus-table-chinese-wubi软件包"
|
||||
if ! dnf list available ibus-table-chinese-wubi &> /dev/null; then
|
||||
LOG_ERROR "yum源中没有ibus-table-chinese-wubi软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装ibus-table-chinese-wubi软件包
|
||||
if [ $ALREADY_INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "安装ibus-table-chinese-wubi软件包"
|
||||
dnf install -y ibus-table-chinese-wubi
|
||||
CHECK_RESULT $? 0 0 "安装ibus-table-chinese-wubi软件包失败"
|
||||
fi
|
||||
|
||||
# 检查ibus-table-chinese-wubi软件包是否安装成功
|
||||
LOG_INFO "检查ibus-table-chinese-wubi软件包是否安装成功"
|
||||
rpm -q ibus-table-chinese-wubi
|
||||
CHECK_RESULT $? 0 0 "ibus-table-chinese-wubi软件包未安装成功"
|
||||
|
||||
# 检查是否支持吴语输入法
|
||||
LOG_INFO "检查是否支持吴语输入法"
|
||||
if ! ibus list-engine | grep -q "wubi"; then
|
||||
LOG_ERROR "不支持吴语输入法"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 启动ibus-daemon
|
||||
LOG_INFO "启动ibus-daemon"
|
||||
ibus-daemon -d -x
|
||||
CHECK_RESULT $? 0 0 "启动ibus-daemon失败"
|
||||
|
||||
# 设置输入法为吴语输入法
|
||||
LOG_INFO "设置输入法为吴语输入法"
|
||||
ibus engine wubi
|
||||
CHECK_RESULT $? 0 0 "设置吴语输入法失败"
|
||||
|
||||
# 测试基本的汉字输入
|
||||
LOG_INFO "测试基本的汉字输入"
|
||||
echo "测试输入"你好"" | ibus engine wubi
|
||||
CHECK_RESULT $? 0 0 "吴语输入法基本输入测试失败"
|
||||
|
||||
# 清理环境,恢复之前的状态
|
||||
LOG_INFO "清理环境,恢复之前的状态"
|
||||
if [ $ALREADY_INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "卸载ibus-table-chinese-wubi软件包"
|
||||
dnf remove -y ibus-table-chinese-wubi
|
||||
CHECK_RESULT $? 0 0 "卸载ibus-table-chinese-wubi软件包失败"
|
||||
fi
|
||||
|
||||
# 停止ibus-daemon
|
||||
LOG_INFO "停止ibus-daemon"
|
||||
pkill ibus-daemon
|
||||
CHECK_RESULT $? 0 0 "停止ibus-daemon失败"
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,79 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-03-16
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试安装后,吴语输入法引擎能被ibus正确识别并出现在可用输入法列表中。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 环境检查:检查是否已安装ibus-table-chinese-wu软件包
|
||||
LOG_INFO "检查是否已安装ibus-table-chinese-wu软件包"
|
||||
rpm -q ibus-table-chinese-wu > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "ibus-table-chinese-wu已安装,测试结束后将保持安装状态"
|
||||
INSTALLED="true"
|
||||
else
|
||||
LOG_INFO "ibus-table-chinese-wu未安装,将在测试过程中安装"
|
||||
INSTALLED="false"
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在ibus-table-chinese-wu软件包
|
||||
LOG_INFO "检查yum源中是否存在ibus-table-chinese-wu软件包"
|
||||
dnf list available ibus-table-chinese-wu > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中不存在ibus-table-chinese-wu软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装ibus-table-chinese-wu软件包
|
||||
if [ "$INSTALLED" = "false" ]; then
|
||||
LOG_INFO "安装ibus-table-chinese-wu软件包"
|
||||
dnf install -y ibus-table-chinese-wu > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装ibus-table-chinese-wu软件包失败"
|
||||
fi
|
||||
|
||||
# 检查ibus-table-chinese-wu输入法引擎是否被ibus正确识别
|
||||
LOG_INFO "检查ibus-table-chinese-wu输入法引擎是否被ibus正确识别"
|
||||
ibus engine-list > /tmp/ibus_engine_list.txt 2>&1
|
||||
CHECK_RESULT $? 0 0 "执行ibus engine-list命令失败"
|
||||
|
||||
# 检查ibus-table-chinese-wu是否出现在可用输入法列表中
|
||||
LOG_INFO "检查ibus-table-chinese-wu是否出现在可用输入法列表中"
|
||||
grep -i "wu" /tmp/ibus_engine_list.txt > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "ibus-table-chinese-wu输入法引擎已被ibus正确识别并出现在可用输入法列表中"
|
||||
else
|
||||
LOG_ERROR "ibus-table-chinese-wu输入法引擎未被ibus正确识别或未出现在可用输入法列表中"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 环境恢复:如果测试前未安装,则卸载ibus-table-chinese-wu软件包
|
||||
if [ "$INSTALLED" = "false" ]; then
|
||||
LOG_INFO "卸载ibus-table-chinese-wu软件包"
|
||||
dnf remove -y ibus-table-chinese-wu > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载ibus-table-chinese-wu软件包失败"
|
||||
fi
|
||||
|
||||
# 清理临时文件
|
||||
LOG_INFO "清理临时文件"
|
||||
rm -f /tmp/ibus_engine_list.txt
|
||||
CHECK_RESULT $? 0 0 "清理临时文件失败"
|
||||
|
||||
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-24
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试lodash.isfunction函数对异步函数(async function)返回true。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试lodash.isfunction函数对异步函数(async function)返回true"
|
||||
|
||||
# 检查环境是否已安装nodejs和lodash
|
||||
LOG_INFO "检查是否已安装nodejs和lodash"
|
||||
if dnf list installed nodejs > /dev/null 2>&1 && npm list lodash > /dev/null 2>&1; then
|
||||
LOG_INFO "nodejs和lodash已安装,测试结束后保持安装状态"
|
||||
installed_before=true
|
||||
else
|
||||
LOG_INFO "nodejs和lodash未安装,将在测试前安装"
|
||||
installed_before=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有nodejs软件包
|
||||
LOG_INFO "检查yum源中是否有nodejs软件包"
|
||||
if ! dnf list available nodejs > /dev/null 2>&1; then
|
||||
LOG_ERROR "yum源中未找到nodejs软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装nodejs和lodash(如果未安装)
|
||||
if [ "$installed_before" = false ]; then
|
||||
LOG_INFO "安装nodejs"
|
||||
dnf install -y nodejs
|
||||
CHECK_RESULT $? 0 0 "安装nodejs失败"
|
||||
|
||||
LOG_INFO "安装lodash"
|
||||
npm install -g lodash
|
||||
CHECK_RESULT $? 0 0 "安装lodash失败"
|
||||
fi
|
||||
|
||||
# 创建测试脚本
|
||||
LOG_INFO "创建测试脚本"
|
||||
cat > test_async_function.js << "EOF"
|
||||
const _ = require("lodash");
|
||||
|
||||
async function asyncFunc() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
const result = _.isFunction(asyncFunc);
|
||||
console.log(result ? "true" : "false");
|
||||
EOF
|
||||
|
||||
# 执行测试
|
||||
LOG_INFO "执行测试脚本"
|
||||
node test_async_function.js > test_result.txt
|
||||
CHECK_RESULT $? 0 0 "执行测试脚本失败"
|
||||
|
||||
# 检查测试结果
|
||||
LOG_INFO "检查测试结果"
|
||||
result=$(cat test_result.txt)
|
||||
expected="true"
|
||||
CHECK_RESULT "$result" "$expected" 0 "lodash.isfunction对异步函数返回${result},期望${expected}"
|
||||
|
||||
# 清理临时文件
|
||||
LOG_INFO "清理临时文件"
|
||||
rm -f test_async_function.js test_result.txt
|
||||
|
||||
# 如果测试前未安装,则卸载软件包
|
||||
if [ "$installed_before" = false ]; then
|
||||
LOG_INFO "卸载lodash"
|
||||
npm uninstall -g lodash
|
||||
CHECK_RESULT $? 0 0 "卸载lodash失败"
|
||||
|
||||
LOG_INFO "卸载nodejs"
|
||||
dnf remove -y nodejs
|
||||
CHECK_RESULT $? 0 0 "卸载nodejs失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,91 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-03-24
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试lodash.isfunction函数对普通函数、箭头函数、生成器函数等返回true。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
PACKAGE_NAME="nodejs"
|
||||
LOG_INFO "检查yum源中是否存在${PACKAGE_NAME}软件包"
|
||||
if ! dnf list available ${PACKAGE_NAME} &>/dev/null; then
|
||||
LOG_ERROR "yum源中不存在${PACKAGE_NAME}软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
LOG_INFO "检查nodejs是否已经安装"
|
||||
if ! command -v node &>/dev/null; then
|
||||
LOG_INFO "nodejs未安装,将进行安装"
|
||||
dnf install -y ${PACKAGE_NAME}
|
||||
CHECK_RESULT $? 0 0 "安装nodejs失败"
|
||||
INSTALLED_BY_SCRIPT=1
|
||||
else
|
||||
LOG_INFO "nodejs已安装,脚本结束后将保持安装状态"
|
||||
INSTALLED_BY_SCRIPT=0
|
||||
fi
|
||||
|
||||
LOG_INFO "创建测试lodash.isfunction函数的Node.js脚本"
|
||||
cat > test_isfunction.js << "EOF"
|
||||
const _ = require("lodash");
|
||||
|
||||
function regularFunc() {}
|
||||
const arrowFunc = () => {};
|
||||
function* generatorFunc() {}
|
||||
|
||||
const results = [
|
||||
_.isFunction(regularFunc),
|
||||
_.isFunction(arrowFunc),
|
||||
_.isFunction(generatorFunc)
|
||||
];
|
||||
|
||||
const allTrue = results.every(r => r === true);
|
||||
console.log(allTrue ? "PASS" : "FAIL");
|
||||
EOF
|
||||
|
||||
LOG_INFO "检查lodash模块是否已安装"
|
||||
if ! npm list lodash &>/dev/null; then
|
||||
LOG_INFO "安装lodash模块"
|
||||
npm install lodash
|
||||
CHECK_RESULT $? 0 0 "安装lodash模块失败"
|
||||
NPM_INSTALLED=1
|
||||
else
|
||||
LOG_INFO "lodash模块已安装"
|
||||
NPM_INSTALLED=0
|
||||
fi
|
||||
|
||||
LOG_INFO "执行Node.js脚本测试lodash.isfunction函数"
|
||||
node test_isfunction.js | grep -q "PASS"
|
||||
CHECK_RESULT $? 0 0 "lodash.isfunction函数测试失败"
|
||||
|
||||
LOG_INFO "清理临时文件"
|
||||
rm -f test_isfunction.js
|
||||
|
||||
if [ "${NPM_INSTALLED:-0}" -eq 1 ]; then
|
||||
LOG_INFO "卸载测试安装的lodash模块"
|
||||
npm uninstall lodash
|
||||
fi
|
||||
|
||||
if [ "${INSTALLED_BY_SCRIPT:-0}" -eq 1 ]; then
|
||||
LOG_INFO "卸载测试安装的nodejs软件包"
|
||||
dnf remove -y ${PACKAGE_NAME}
|
||||
CHECK_RESULT $? 0 0 "卸载nodejs失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,123 +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-24
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试lodash.isfunction函数对ES6类构造函数返回true。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 定义变量
|
||||
PACKAGE_NAME="nodejs-lodash-isfunction"
|
||||
TEST_SCRIPT="test_isfunction.js"
|
||||
|
||||
# 步骤1:检查软件包是否在yum源中
|
||||
LOG_INFO "步骤1:检查软件包是否在yum源中"
|
||||
dnf list available $PACKAGE_NAME &>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 步骤2:检查环境是否已安装
|
||||
LOG_INFO "步骤2:检查环境是否已安装"
|
||||
rpm -q $PACKAGE_NAME &>/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "软件包 $PACKAGE_NAME 已安装,标记为已安装状态"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "软件包 $PACKAGE_NAME 未安装,标记为未安装状态"
|
||||
INSTALLED=0
|
||||
fi
|
||||
|
||||
# 步骤3:如果未安装,则安装软件包
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME"
|
||||
dnf install -y $PACKAGE_NAME
|
||||
CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败"
|
||||
fi
|
||||
|
||||
# 步骤4:创建测试脚本
|
||||
LOG_INFO "步骤4:创建测试脚本"
|
||||
cat > $TEST_SCRIPT << "EOF"
|
||||
const _ = require("lodash");
|
||||
|
||||
// 测试ES6类构造函数
|
||||
class TestClass {
|
||||
constructor() {
|
||||
this.name = "test";
|
||||
}
|
||||
}
|
||||
|
||||
// 测试普通函数
|
||||
function testFunction() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
// 测试非函数类型
|
||||
const testObject = { name: "test" };
|
||||
const testArray = [1, 2, 3];
|
||||
const testString = "test";
|
||||
const testNumber = 123;
|
||||
const testBoolean = true;
|
||||
const testNull = null;
|
||||
const testUndefined = undefined;
|
||||
|
||||
console.log("测试ES6类构造函数:", _.isFunction(TestClass)); // 应返回true
|
||||
console.log("测试普通函数:", _.isFunction(testFunction)); // 应返回true
|
||||
console.log("测试对象:", _.isFunction(testObject)); // 应返回false
|
||||
console.log("测试数组:", _.isFunction(testArray)); // 应返回false
|
||||
console.log("测试字符串:", _.isFunction(testString)); // 应返回false
|
||||
console.log("测试数字:", _.isFunction(testNumber)); // 应返回false
|
||||
console.log("测试布尔值:", _.isFunction(testBoolean)); // 应返回false
|
||||
console.log("测试null:", _.isFunction(testNull)); // 应返回false
|
||||
console.log("测试undefined:", _.isFunction(testUndefined)); // 应返回false
|
||||
|
||||
// 验证主要测试点
|
||||
if (_.isFunction(TestClass) === true) {
|
||||
console.log("SUCCESS: lodash.isfunction函数对ES6类构造函数返回true");
|
||||
process.exit(0);
|
||||
} else {
|
||||
console.log("FAIL: lodash.isfunction函数对ES6类构造函数未返回true");
|
||||
process.exit(1);
|
||||
}
|
||||
EOF
|
||||
|
||||
CHECK_RESULT $? 0 0 "创建测试脚本失败"
|
||||
|
||||
# 步骤5:执行测试脚本
|
||||
LOG_INFO "步骤5:执行测试脚本"
|
||||
node $TEST_SCRIPT
|
||||
CHECK_RESULT $? 0 0 "测试脚本执行失败,lodash.isfunction函数对ES6类构造函数未返回true"
|
||||
|
||||
# 步骤6:清理测试文件
|
||||
LOG_INFO "步骤6:清理测试文件"
|
||||
rm -f $TEST_SCRIPT
|
||||
CHECK_RESULT $? 0 0 "清理测试文件失败"
|
||||
|
||||
# 步骤7:如果之前未安装,则卸载软件包
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "步骤7:卸载软件包 $PACKAGE_NAME"
|
||||
dnf remove -y $PACKAGE_NAME
|
||||
CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败"
|
||||
else
|
||||
LOG_INFO "步骤7:保持软件包 $PACKAGE_NAME 的安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成"
|
||||
}
|
||||
|
||||
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 : 2026-03-24
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试通过包管理器(如npm)安装nodejs-lodash-isfunction软件包的功能。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 检查是否已安装nodejs-lodash-isfunction
|
||||
LOG_INFO "检查是否已安装nodejs-lodash-isfunction软件包"
|
||||
if dnf list installed nodejs-lodash-isfunction &>/dev/null; then
|
||||
LOG_INFO "nodejs-lodash-isfunction已安装,脚本结束后将保持安装状态"
|
||||
INSTALLED_BEFORE=true
|
||||
else
|
||||
LOG_INFO "nodejs-lodash-isfunction未安装"
|
||||
INSTALLED_BEFORE=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在该软件包
|
||||
LOG_INFO "检查yum源中是否存在nodejs-lodash-isfunction软件包"
|
||||
if ! dnf list available nodejs-lodash-isfunction &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到nodejs-lodash-isfunction软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装软件包
|
||||
LOG_INFO "安装nodejs-lodash-isfunction软件包"
|
||||
dnf install -y nodejs-lodash-isfunction
|
||||
CHECK_RESULT $? 0 0 "安装nodejs-lodash-isfunction软件包失败"
|
||||
|
||||
# 验证安装是否成功
|
||||
LOG_INFO "验证nodejs-lodash-isfunction软件包是否安装成功"
|
||||
dnf list installed nodejs-lodash-isfunction &>/dev/null
|
||||
CHECK_RESULT $? 0 0 "nodejs-lodash-isfunction软件包未正确安装"
|
||||
|
||||
# 测试软件包功能
|
||||
LOG_INFO "测试nodejs-lodash-isfunction软件包功能"
|
||||
node -e "const isFunction = require("lodash.isfunction"); console.log(isFunction(function(){}))" | grep -q "true"
|
||||
CHECK_RESULT $? 0 0 "nodejs-lodash-isfunction软件包功能测试失败"
|
||||
|
||||
# 清理环境
|
||||
if [ "$INSTALLED_BEFORE" = false ]; then
|
||||
LOG_INFO "清理环境:卸载nodejs-lodash-isfunction软件包"
|
||||
dnf remove -y nodejs-lodash-isfunction
|
||||
CHECK_RESULT $? 0 0 "卸载nodejs-lodash-isfunction软件包失败"
|
||||
LOG_INFO "环境已恢复到测试前状态"
|
||||
else
|
||||
LOG_INFO "测试前已安装nodejs-lodash-isfunction,保持安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试通过包管理器安装nodejs-lodash-isfunction软件包的功能完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,127 +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-24
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试lodash.isfunction函数对非函数类型(如对象、字符串、数字)返回false。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 检查是否以root用户运行
|
||||
if [ $(id -u) -ne 0 ]; then
|
||||
LOG_ERROR "本脚本需要root权限执行"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 定义软件包名称
|
||||
PACKAGE_NAME="nodejs-lodash-isfunction"
|
||||
TEST_FUNCTION="lodash.isfunction"
|
||||
|
||||
LOG_INFO "开始测试:测试lodash.isfunction函数对非函数类型(如对象、字符串、数字)返回false"
|
||||
|
||||
# 步骤1:检查yum源中是否存在指定软件包
|
||||
LOG_INFO "步骤1:检查yum源中是否存在${PACKAGE_NAME}软件包"
|
||||
dnf list available ${PACKAGE_NAME} > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包"
|
||||
exit 255
|
||||
fi
|
||||
LOG_INFO "yum源中存在${PACKAGE_NAME}软件包"
|
||||
|
||||
# 步骤2:检查当前是否已安装软件包
|
||||
LOG_INFO "步骤2:检查当前是否已安装${PACKAGE_NAME}软件包"
|
||||
INSTALLED=false
|
||||
rpm -q ${PACKAGE_NAME} > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "${PACKAGE_NAME}软件包已安装"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "${PACKAGE_NAME}软件包未安装"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 步骤3:如果未安装,则安装软件包
|
||||
if [ "$INSTALLED" = "false" ]; then
|
||||
LOG_INFO "步骤3:安装${PACKAGE_NAME}软件包"
|
||||
dnf install -y ${PACKAGE_NAME} > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}软件包失败"
|
||||
LOG_INFO "成功安装${PACKAGE_NAME}软件包"
|
||||
else
|
||||
LOG_INFO "步骤3:跳过安装,软件包已存在"
|
||||
fi
|
||||
|
||||
# 步骤4:验证lodash.isfunction命令是否存在
|
||||
LOG_INFO "步骤4:验证${TEST_FUNCTION}命令是否存在"
|
||||
type ${TEST_FUNCTION} > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "${TEST_FUNCTION}命令不存在"
|
||||
# 清理环境:如果之前未安装,则卸载软件包
|
||||
if [ "$INSTALLED" = "false" ]; then
|
||||
LOG_INFO "清理环境:卸载${PACKAGE_NAME}软件包"
|
||||
dnf remove -y ${PACKAGE_NAME} > /dev/null 2>&1
|
||||
fi
|
||||
exit 255
|
||||
fi
|
||||
LOG_INFO "${TEST_FUNCTION}命令存在"
|
||||
|
||||
# 步骤5:测试非函数类型参数
|
||||
LOG_INFO "步骤5:测试lodash.isfunction函数对非函数类型返回false"
|
||||
|
||||
# 测试对象类型
|
||||
LOG_INFO "测试对象类型:{}"
|
||||
${TEST_FUNCTION} {} 2>/dev/null
|
||||
CHECK_RESULT $? 1 0 "对象类型测试失败,预期返回false"
|
||||
|
||||
# 测试字符串类型
|
||||
LOG_INFO "测试字符串类型:"test""
|
||||
${TEST_FUNCTION} "test" 2>/dev/null
|
||||
CHECK_RESULT $? 1 0 "字符串类型测试失败,预期返回false"
|
||||
|
||||
# 测试数字类型
|
||||
LOG_INFO "测试数字类型:123"
|
||||
${TEST_FUNCTION} 123 2>/dev/null
|
||||
CHECK_RESULT $? 1 0 "数字类型测试失败,预期返回false"
|
||||
|
||||
# 测试数组类型
|
||||
LOG_INFO "测试数组类型:[1,2,3]"
|
||||
${TEST_FUNCTION} [1,2,3] 2>/dev/null
|
||||
CHECK_RESULT $? 1 0 "数组类型测试失败,预期返回false"
|
||||
|
||||
# 测试null值
|
||||
LOG_INFO "测试null值"
|
||||
${TEST_FUNCTION} null 2>/dev/null
|
||||
CHECK_RESULT $? 1 0 "null值测试失败,预期返回false"
|
||||
|
||||
# 测试undefined值
|
||||
LOG_INFO "测试undefined值"
|
||||
${TEST_FUNCTION} undefined 2>/dev/null
|
||||
CHECK_RESULT $? 1 0 "undefined值测试失败,预期返回false"
|
||||
|
||||
# 步骤6:清理环境
|
||||
LOG_INFO "步骤6:清理测试环境"
|
||||
if [ "$INSTALLED" = "false" ]; then
|
||||
LOG_INFO "卸载${PACKAGE_NAME}软件包"
|
||||
dnf remove -y ${PACKAGE_NAME} > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}软件包失败"
|
||||
LOG_INFO "成功卸载${PACKAGE_NAME}软件包"
|
||||
else
|
||||
LOG_INFO "保持${PACKAGE_NAME}软件包安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:所有非函数类型参数测试通过,lodash.isfunction函数均返回false"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,167 +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-24
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试在Node.js环境中通过require语句成功引入lodash.isfunction模块。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 测试Node.js环境中通过require语句成功引入lodash.isfunction模块
|
||||
|
||||
LOG_INFO "步骤1:检查dnf源中是否存在nodejs和npm软件包"
|
||||
dnf list available nodejs 2>/dev/null | grep -q nodejs
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到nodejs软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
dnf list available npm 2>/dev/null | grep -q npm
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到npm软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤2:检查系统是否已安装nodejs和npm"
|
||||
node_installed=0
|
||||
npm_installed=0
|
||||
which node >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
node_installed=1
|
||||
LOG_INFO "nodejs已安装"
|
||||
fi
|
||||
|
||||
which npm >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
npm_installed=1
|
||||
LOG_INFO "npm已安装"
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤3:如果未安装则安装nodejs和npm"
|
||||
if [ $node_installed -eq 0 ] || [ $npm_installed -eq 0 ]; then
|
||||
dnf install -y nodejs npm
|
||||
CHECK_RESULT $? 0 0 "安装nodejs和npm失败"
|
||||
|
||||
# 标记为测试过程中安装的软件
|
||||
test_installed=1
|
||||
else
|
||||
test_installed=0
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤4:检查nodejs和npm版本"
|
||||
node --version
|
||||
CHECK_RESULT $? 0 0 "nodejs命令执行失败"
|
||||
npm --version
|
||||
CHECK_RESULT $? 0 0 "npm命令执行失败"
|
||||
|
||||
LOG_INFO "步骤5:创建测试目录"
|
||||
test_dir="/tmp/test_nodejs_lodash_$(date +%s)"
|
||||
mkdir -p "$test_dir"
|
||||
CHECK_RESULT $? 0 0 "创建测试目录失败"
|
||||
|
||||
cd "$test_dir" || exit 1
|
||||
|
||||
LOG_INFO "步骤6:初始化npm项目"
|
||||
npm init -y
|
||||
CHECK_RESULT $? 0 0 "npm初始化失败"
|
||||
|
||||
LOG_INFO "步骤7:安装lodash.isfunction模块"
|
||||
npm install lodash.isfunction
|
||||
CHECK_RESULT $? 0 0 "安装lodash.isfunction模块失败"
|
||||
|
||||
LOG_INFO "步骤8:创建测试JavaScript文件"
|
||||
cat > test_require.js << "EOF"
|
||||
const isFunction = require("lodash.isfunction");
|
||||
|
||||
// 测试不同类型的值
|
||||
const func = function() {};
|
||||
const arrowFunc = () => {};
|
||||
const asyncFunc = async function() {};
|
||||
const obj = { key: "value" };
|
||||
const str = "hello";
|
||||
const num = 123;
|
||||
const bool = true;
|
||||
const arr = [1, 2, 3];
|
||||
const nullVal = null;
|
||||
const undefinedVal = undefined;
|
||||
|
||||
console.log("测试函数类型:");
|
||||
console.log("普通函数:", isFunction(func));
|
||||
console.log("箭头函数:", isFunction(arrowFunc));
|
||||
console.log("异步函数:", isFunction(asyncFunc));
|
||||
|
||||
console.log("\n测试非函数类型:");
|
||||
console.log("对象:", isFunction(obj));
|
||||
console.log("字符串:", isFunction(str));
|
||||
console.log("数字:", isFunction(num));
|
||||
console.log("布尔值:", isFunction(bool));
|
||||
console.log("数组:", isFunction(arr));
|
||||
console.log("null:", isFunction(nullVal));
|
||||
console.log("undefined:", isFunction(undefinedVal));
|
||||
|
||||
// 验证结果
|
||||
const testResults = [
|
||||
isFunction(func) === true,
|
||||
isFunction(arrowFunc) === true,
|
||||
isFunction(asyncFunc) === true,
|
||||
isFunction(obj) === false,
|
||||
isFunction(str) === false,
|
||||
isFunction(num) === false,
|
||||
isFunction(bool) === false,
|
||||
isFunction(arr) === false,
|
||||
isFunction(nullVal) === false,
|
||||
isFunction(undefinedVal) === false
|
||||
];
|
||||
|
||||
const allPassed = testResults.every(result => result === true);
|
||||
if (allPassed) {
|
||||
console.log("\n所有测试通过: lodash.isfunction模块功能正常");
|
||||
process.exit(0);
|
||||
} else {
|
||||
console.log("\n测试失败: lodash.isfunction模块功能异常");
|
||||
process.exit(1);
|
||||
}
|
||||
EOF
|
||||
|
||||
CHECK_RESULT $? 0 0 "创建测试JavaScript文件失败"
|
||||
|
||||
LOG_INFO "步骤9:执行Node.js测试脚本"
|
||||
node test_require.js
|
||||
CHECK_RESULT $? 0 0 "Node.js测试脚本执行失败或测试未通过"
|
||||
|
||||
LOG_INFO "步骤10:清理测试目录"
|
||||
cd /tmp || exit 1
|
||||
rm -rf "$test_dir"
|
||||
CHECK_RESULT $? 0 0 "清理测试目录失败"
|
||||
|
||||
LOG_INFO "步骤11:根据初始状态恢复环境"
|
||||
if [ $test_installed -eq 1 ]; then
|
||||
LOG_INFO "卸载测试过程中安装的nodejs和npm"
|
||||
dnf remove -y nodejs npm
|
||||
CHECK_RESULT $? 0 0 "卸载nodejs和npm失败"
|
||||
|
||||
# 如果之前已经安装了nodejs和npm,重新安装
|
||||
if [ $node_installed -eq 1 ] && [ $npm_installed -eq 1 ]; then
|
||||
LOG_INFO "重新安装原有的nodejs和npm"
|
||||
dnf install -y nodejs npm
|
||||
CHECK_RESULT $? 0 0 "重新安装nodejs和npm失败"
|
||||
fi
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:Node.js环境中通过require语句成功引入lodash.isfunction模块"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,76 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-02-28
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test module import
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
set -e
|
||||
|
||||
LOG_INFO "开始测试:Test module import"
|
||||
|
||||
LOG_INFO "步骤1:检查系统是否已安装python3-rfc3986-validator软件包"
|
||||
if rpm -q python3-rfc3986-validator &>/dev/null; then
|
||||
LOG_INFO "python3-rfc3986-validator已安装,测试后将保持安装状态"
|
||||
already_installed=true
|
||||
else
|
||||
LOG_INFO "python3-rfc3986-validator未安装,将在测试后卸载"
|
||||
already_installed=false
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤2:检查yum源中是否存在python3-rfc3986-validator软件包"
|
||||
if ! dnf list python3-rfc3986-validator &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到python3-rfc3986-validator软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
if [ "$already_installed" = "false" ]; then
|
||||
LOG_INFO "步骤3:安装python3-rfc3986-validator软件包"
|
||||
dnf install -y python3-rfc3986-validator
|
||||
CHECK_RESULT $? 0 0 "安装python3-rfc3986-validator失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤4:验证python3-rfc3986-validator模块导入"
|
||||
python3 -c "import rfc3986_validator"
|
||||
CHECK_RESULT $? 0 0 "导入rfc3986_validator模块失败"
|
||||
|
||||
LOG_INFO "步骤5:验证模块功能"
|
||||
python3 -c "
|
||||
import rfc3986_validator
|
||||
if not hasattr(rfc3986_validator, "validate_url"):
|
||||
print("模块缺少validate_url函数")
|
||||
exit(1)
|
||||
if not hasattr(rfc3986_validator, "validate_email"):
|
||||
print("模块缺少validate_email函数")
|
||||
exit(1)
|
||||
print("模块功能检查通过")
|
||||
"
|
||||
CHECK_RESULT $? 0 0 "模块功能检查失败"
|
||||
|
||||
if [ "$already_installed" = "false" ]; then
|
||||
LOG_INFO "步骤6:卸载python3-rfc3986-validator软件包"
|
||||
dnf remove -y python3-rfc3986-validator
|
||||
CHECK_RESULT $? 0 0 "卸载python3-rfc3986-validator失败"
|
||||
else
|
||||
LOG_INFO "步骤6:保持python3-rfc3986-validator软件包安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:Test module import"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,98 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-02-28
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test URI normalization
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
set -e
|
||||
|
||||
LOG_INFO "开始测试:Test URI normalization"
|
||||
|
||||
LOG_INFO "步骤1:检查python3-rfc3986-validator软件包是否在yum源中"
|
||||
if ! dnf list available python3-rfc3986-validator 2>/dev/null | grep -q python3-rfc3986-validator; then
|
||||
LOG_ERROR "yum源中未找到python3-rfc3986-validator软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤2:检查当前环境是否已安装python3-rfc3986-validator"
|
||||
if rpm -q python3-rfc3986-validator >/dev/null 2>&1; then
|
||||
installed=true
|
||||
LOG_INFO "检测到python3-rfc3986-validator已安装,测试结束后将保持安装状态"
|
||||
else
|
||||
installed=false
|
||||
LOG_INFO "未安装python3-rfc3986-validator,将在测试过程中安装"
|
||||
fi
|
||||
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "步骤3:安装python3-rfc3986-validator软件包"
|
||||
dnf install -y python3-rfc3986-validator
|
||||
CHECK_RESULT $? 0 0 "安装python3-rfc3986-validator失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤4:验证rfc3986_validator模块是否可用"
|
||||
python3 -c "import rfc3986_validator; print("rfc3986_validator模块导入成功")" 2>&1
|
||||
CHECK_RESULT $? 0 0 "rfc3986_validator模块导入失败"
|
||||
|
||||
LOG_INFO "步骤5:测试URI normalization功能"
|
||||
cat > /tmp/test_uri_normalization.py << "EOF"
|
||||
import rfc3986_validator
|
||||
|
||||
test_cases = [
|
||||
("http://example.com/", "http://example.com/"),
|
||||
("HTTP://EXAMPLE.COM/", "http://example.com/"),
|
||||
("http://example.com:80/", "http://example.com/"),
|
||||
("http://example.com/%7Euser", "http://example.com/~user"),
|
||||
("http://example.com/./a/../b", "http://example.com/b"),
|
||||
]
|
||||
|
||||
all_passed = True
|
||||
for uri, expected in test_cases:
|
||||
normalized = rfc3986_validator.normalize_uri(uri)
|
||||
if normalized == expected:
|
||||
print(f"PASS: {uri} -> {normalized}")
|
||||
else:
|
||||
print(f"FAIL: {uri} -> {normalized} (expected: {expected})")
|
||||
all_passed = False
|
||||
|
||||
if all_passed:
|
||||
print("所有URI normalization测试用例通过")
|
||||
exit(0)
|
||||
else:
|
||||
print("部分URI normalization测试用例失败")
|
||||
exit(1)
|
||||
EOF
|
||||
|
||||
python3 /tmp/test_uri_normalization.py
|
||||
CHECK_RESULT $? 0 0 "URI normalization功能测试失败"
|
||||
|
||||
LOG_INFO "步骤6:清理临时文件"
|
||||
rm -f /tmp/test_uri_normalization.py
|
||||
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "步骤7:卸载测试安装的python3-rfc3986-validator软件包"
|
||||
dnf remove -y python3-rfc3986-validator
|
||||
CHECK_RESULT $? 0 0 "卸载python3-rfc3986-validator失败"
|
||||
else
|
||||
LOG_INFO "步骤7:保持原有python3-rfc3986-validator安装状态,无需卸载"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:Test URI normalization"
|
||||
}
|
||||
|
||||
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-02
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test URI validation functionality
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查是否已安装python3-rfc3986-validator软件包
|
||||
LOG_INFO "检查是否已安装python3-rfc3986-validator软件包"
|
||||
rpm -q python3-rfc3986-validator > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "python3-rfc3986-validator已安装,脚本结束时将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "python3-rfc3986-validator未安装,将在测试结束后卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在python3-rfc3986-validator软件包
|
||||
LOG_INFO "检查yum源中是否存在python3-rfc3986-validator软件包"
|
||||
dnf list available python3-rfc3986-validator > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到python3-rfc3986-validator软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装python3-rfc3986-validator软件包(如果未安装)
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "正在安装python3-rfc3986-validator软件包"
|
||||
dnf install -y python3-rfc3986-validator > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装python3-rfc3986-validator失败"
|
||||
fi
|
||||
|
||||
# 测试URI验证功能
|
||||
LOG_INFO "测试URI验证功能"
|
||||
validate-uri "https://www.example.com" > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "URI验证功能测试失败"
|
||||
|
||||
# 清理环境(如果之前未安装)
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "正在卸载python3-rfc3986-validator软件包"
|
||||
dnf remove -y python3-rfc3986-validator > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载python3-rfc3986-validator失败"
|
||||
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 : 2025-12-13
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试 qmlscene 运行 QML 文件的功能
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查是否已安装qt5-qtdeclarative-devel软件包
|
||||
LOG_INFO "检查是否已安装qt5-qtdeclarative-devel软件包"
|
||||
rpm -q qt5-qtdeclarative-devel > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "qt5-qtdeclarative-devel已安装,脚本结束时将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "qt5-qtdeclarative-devel未安装,将在测试完成后卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有qt5-qtdeclarative-devel软件包
|
||||
LOG_INFO "检查yum源中是否有qt5-qtdeclarative-devel软件包"
|
||||
dnf list available qt5-qtdeclarative-devel > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到qt5-qtdeclarative-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装qt5-qtdeclarative-devel软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "正在安装qt5-qtdeclarative-devel软件包"
|
||||
dnf install -y qt5-qtdeclarative-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装qt5-qtdeclarative-devel失败"
|
||||
fi
|
||||
|
||||
# 检查qmlscene命令是否存在
|
||||
LOG_INFO "检查qmlscene命令是否存在"
|
||||
command -v qmlscene > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "qmlscene命令不存在"
|
||||
|
||||
# 创建测试QML文件
|
||||
LOG_INFO "创建测试QML文件"
|
||||
cat > test.qml << EOF
|
||||
import QtQuick 2.0
|
||||
Rectangle {
|
||||
width: 100
|
||||
height: 100
|
||||
color: "red"
|
||||
}
|
||||
EOF
|
||||
|
||||
# 使用qmlscene运行QML文件
|
||||
LOG_INFO "使用qmlscene运行QML文件"
|
||||
qmlscene test.qml > /dev/null 2>&1 &
|
||||
CHECK_RESULT $? 0 0 "qmlscene运行QML文件失败"
|
||||
|
||||
# 等待一段时间确保程序启动后退出后台进程
|
||||
sleep 3
|
||||
|
||||
#清理环境:删除测试QML文件
|
||||
LOG_INFO "清理环境:删除测试QML文件"
|
||||
rm -f test.qml
|
||||
|
||||
# 如果测试前未安装qt5-qtdeclarative-devel,则卸载
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "正在卸载qt5-qtdeclarative-devel软件包"
|
||||
dnf remove -y qt5-qtdeclarative-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? ,,,"卸载qt,-,失败"
|
||||
fi
|
||||
|
||||
exit ,,,
|
||||
}
|
||||
|
||||
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-13
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试 qmltyperegistrar 的类型注册功能
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查是否已安装qt5-qtdeclarative-devel软件包
|
||||
LOG_INFO "检查qt5-qtdeclarative-devel软件包是否已安装"
|
||||
rpm -q qt5-qtdeclarative-devel > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "qt5-qtdeclarative-devel软件包已安装,脚本结束后将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "qt5-qtdeclarative-devel软件包未安装,脚本结束后将卸载软件包"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在qt5-qtdeclarative-devel软件包
|
||||
LOG_INFO "检查yum源中是否存在qt5-qtdeclarative-devel软件包"
|
||||
dnf list available qt5-qtdeclarative-devel > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到qt5-qtdeclarative-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 若未安装则安装软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "开始安装qt5-qtdeclarative-devel软件包"
|
||||
dnf install -y qt5-qtdeclarative-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装qt5-qtdeclarative-devel软件包失败"
|
||||
fi
|
||||
|
||||
# 测试qmltyperegistrar的类型注册功能
|
||||
LOG_INFO "测试qmltyperegistrar的类型注册功能"
|
||||
qmltyperegistrar --help > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "qmltyperegistrar命令不存在或不支持"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 模拟类型注册测试(具体测试逻辑根据实际需求补充)
|
||||
LOG_INFO "执行qmltyperegistrar类型注册测试"
|
||||
qmltyperegistrar --version > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "qmltyperegistrar类型注册测试失败"
|
||||
|
||||
# 环境恢复:若脚本开始时未安装软件包,则卸载
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载qt5-qtdeclarative-devel软件包"
|
||||
dnf remove -y qt5-qtdeclarative-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载qt5-qtdeclarative-devel软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试脚本执行完毕,环境已恢复"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,83 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-12-13
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试 qmlcachegen 的 QML 源文件参数,生成缓存
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试 qmlcachegen 的 QML 源文件参数,生成缓存"
|
||||
|
||||
# 检查是否已安装 qt5-qtdeclarative-devel 包
|
||||
LOG_INFO "检查是否已安装 qt5-qtdeclarative-devel 包"
|
||||
if ! dnf list installed qt5-qtdeclarative-devel &>/dev/null; then
|
||||
LOG_INFO "qt5-qtdeclarative-devel 未安装,准备安装"
|
||||
# 检查 yum 源中是否有该软件包
|
||||
if ! dnf list available qt5-qtdeclarative-devel &>/dev/null; then
|
||||
LOG_ERROR "yum 源中未找到 qt5-qtdeclarative-devel 包"
|
||||
exit 255
|
||||
fi
|
||||
# 安装软件包
|
||||
dnf install -y qt5-qtdeclarative-devel
|
||||
CHECK_RESULT $? 0 0 "安装 qt5-qtdeclarative-devel 失败"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "qt5-qtdeclarative-devel 已安装"
|
||||
INSTALLED=0
|
||||
fi
|
||||
|
||||
# 测试 qmlcachegen 命令
|
||||
LOG_INFO "测试 qmlcachegen 命令的 QML 源文件参数"
|
||||
if ! command -v qmlcachegen &>/dev/null; then
|
||||
LOG_ERROR "qmlcachegen 命令不存在"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 创建测试 QML 文件
|
||||
LOG_INFO "创建测试 QML 文件"
|
||||
TEST_QML_FILE="test.qml"
|
||||
cat > "$TEST_QML_FILE" <<EOF
|
||||
import QtQuick 2.0
|
||||
Item {}
|
||||
EOF
|
||||
CHECK_RESULT $? 0 0 "创建测试 QML 文件失败"
|
||||
|
||||
# 使用 qmlcachegen 生成缓存
|
||||
LOG_INFO "使用 qmlcachegen生成缓存"
|
||||
qmlcachegen "$TEST_QML_FILE" --output test.qmlc
|
||||
CHECK_RESULT $? 0 0 "qmlcachegen生成缓存失败"
|
||||
|
||||
# 检查生成的缓存文件是否存在
|
||||
LOG_INFO "检查生成的缓存文件是否存在"
|
||||
[ -f "test.qmlc" ]
|
||||
CHECK_RESULT $? 0 0 "缓存文件未生成"
|
||||
|
||||
#清理测试文件
|
||||
LOG_INFO "清理测试文件"
|
||||
rm -f "$TEST_QML_FILE" "test.qmlc"
|
||||
|
||||
# 如果脚本开始时安装了软件包,则卸载
|
||||
if [ "$INSTALLED" -eq 1 ]; then
|
||||
LOG_INFO "卸载 qt5-qtdeclarative-devel"
|
||||
dnf remove -y qt5-qtdeclarative-devel
|
||||
CHECK_RESULT $? 0 0 "卸载 qt5-qtdeclarative-devel失败"
|
||||
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-12-13
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试qmleasing命令的V参数功能
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试qmleasing命令的V参数功能"
|
||||
|
||||
# 检查软件包是否已安装
|
||||
LOG_INFO "检查qt5-qtdeclarative-devel软件包是否已安装"
|
||||
if rpm -q qt5-qtdeclarative-devel &>/dev/null; then
|
||||
LOG_INFO "qt5-qtdeclarative-devel已安装,测试结束后将保持安装状态"
|
||||
already_installed=true
|
||||
else
|
||||
LOG_INFO "qt5-qtdeclarative-devel未安装,测试结束后将卸载"
|
||||
already_installed=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在软件包
|
||||
LOG_INFO "检查yum源中是否存在qt5-qtdeclarative-devel软件包"
|
||||
if ! dnf list available qt5-qtdeclarative-devel &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到qt5-qtdeclarative-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ "$already_installed" = false ]; then
|
||||
LOG_INFO "正在安装qt5-qtdeclarative-devel软件包"
|
||||
dnf install -y qt5-qtdeclarative-devel
|
||||
CHECK_RESULT $? 0 0 "安装qt5-qtdeclarative-devel失败"
|
||||
fi
|
||||
|
||||
# 测试qmleasing命令的V参数功能
|
||||
LOG_INFO "测试qmleasing命令的V参数功能"
|
||||
qmleasing -V
|
||||
CHECK_RESULT $? 0 0 "qmleasing命令的V参数功能测试失败"
|
||||
|
||||
# 清理环境:如果测试前未安装,则卸载软件包
|
||||
if [ "$already_installed" = false ]; then
|
||||
LOG_INFO "正在卸载qt5-qtdeclarative-devel软件包"
|
||||
dnf remove -y qt5-qtdeclarative-devel
|
||||
CHECK_RESULT $? 0 0 "卸载qt5-qtdeclarative-devel失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试qmleasing命令的V参数功能完成"
|
||||
}
|
||||
|
||||
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-12-13
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试qmllint的包含指定qmltypes文件选项
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试qmllint的包含指定qmltypes文件选项"
|
||||
|
||||
# 检查软件包是否已安装
|
||||
LOG_INFO "检查qt5-qtdeclarative-devel软件包是否已安装"
|
||||
if rpm -q qt5-qtdeclarative-devel &>/dev/null; then
|
||||
LOG_INFO "qt5-qtdeclarative-devel软件包已安装"
|
||||
installed=true
|
||||
else
|
||||
LOG_INFO "qt5-qtdeclarative-devel软件包未安装"
|
||||
installed=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有该软件包
|
||||
LOG_INFO "检查yum源中是否有qt5-qtdeclarative-devel软件包"
|
||||
if ! dnf list available qt5-qtdeclarative-devel &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到qt5-qtdeclarative-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "开始安装qt5-qtdeclarative-devel软件包"
|
||||
dnf install -y qt5-qtdeclarative-devel
|
||||
CHECK_RESULT $? 0 0 "安装qt5-qtdeclarative-devel失败"
|
||||
fi
|
||||
|
||||
# 测试qmllint的包含指定qmltypes文件选项
|
||||
LOG_INFO "测试qmllint的包含指定qmltypes文件选项"
|
||||
qmllint --help | grep -q "\-\-qmltypes"
|
||||
CHECK_RESULT $? 0 0 "qmllint不支持--qmltypes选项"
|
||||
|
||||
LOG_INFO "创建测试用的qmltypes文件"
|
||||
echo "dummy content" > test.qmltypes
|
||||
|
||||
LOG_INFO "执行qmllint命令"
|
||||
qmllint --qmltypes test.qmltypes test.qml &>/dev/null
|
||||
CHECK_RESULT $? 0 0 "qmllint执行失败"
|
||||
|
||||
# 清理测试文件
|
||||
LOG_INFO "清理测试文件"
|
||||
rm -f test.qmltypes
|
||||
|
||||
# 如果之前未安装,则卸载软件包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载qt5-qtdeclarative-devel软件包"
|
||||
dnf remove -y qt5-qtdeclarative-devel
|
||||
CHECK_RESULT $? 0 0 "卸载qt5-qtdeclarative-devel失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,70 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-12-13
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试qmllint的静默模式选项
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查是否已安装qt5-qtdeclarative-devel软件包
|
||||
LOG_INFO "检查qt5-qtdeclarative-devel软件包是否已安装"
|
||||
rpm -q qt5-qtdeclarative-devel > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "qt5-qtdeclarative-devel软件包已安装"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "qt5-qtdeclarative-devel软件包未安装"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有qt5-qtdeclarative-devel软件包
|
||||
LOG_INFO "检查yum源中是否有qt5-qtdeclarative-devel软件包"
|
||||
dnf list available qt5-qtdeclarative-devel > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到qt5-qtdeclarative-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "开始安装qt5-qtdeclarative-devel软件包"
|
||||
dnf install -y qt5-qtdeclarative-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装qt5-qtdeclarative-devel软件包失败"
|
||||
fi
|
||||
|
||||
# 测试qmllint的静默模式选项
|
||||
LOG_INFO "测试qmllint的静默模式选项"
|
||||
qmllint --help | grep -q "\-\-silent"
|
||||
CHECK_RESULT $? 0 0 "qmllint不支持静默模式选项"
|
||||
|
||||
LOG_INFO "执行qmllint静默模式测试"
|
||||
qmllint --silent test.qml > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "qmllint静默模式测试失败"
|
||||
|
||||
# 清理环境:如果脚本开始时未安装,则卸载软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载qt5-qtdeclarative-devel软件包"
|
||||
dnf remove -y qt5-qtdeclarative-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载qt5-qtdeclarative-devel软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试脚本执行完毕,环境已恢复"
|
||||
|
||||
}
|
||||
|
||||
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 : 2025-12-13
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试qmllint的指定qmltypes文件目录选项
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查yum源中是否存在qt5-qtdeclarative-devel软件包
|
||||
LOG_INFO "检查yum源中是否存在qt5-qtdeclarative-devel软件包..."
|
||||
if ! dnf list available qt5-qtdeclarative-devel &> /dev/null; then
|
||||
LOG_ERROR "yum源中未找到qt5-qtdeclarative-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 检查是否已安装qt5-qtdeclarative-devel
|
||||
LOG_INFO "检查是否已安装qt5-qtdeclarative-devel..."
|
||||
if rpm -q qt5-qtdeclarative-devel &> /dev/null; then
|
||||
installed=true
|
||||
LOG_INFO "qt5-qtdeclarative-devel已安装"
|
||||
else
|
||||
installed=false
|
||||
LOG_INFO "qt5-qtdeclarative-devel未安装,将进行安装"
|
||||
fi
|
||||
|
||||
# 若未安装,则安装软件包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "安装qt5-qtdeclarative-devel..."
|
||||
dnf install -y qt5-qtdeclarative-devel
|
||||
CHECK_RESULT $? 0 0 "安装qt5-qtdeclarative-devel失败"
|
||||
fi
|
||||
|
||||
# 检查qmllint命令是否支持--qmltypes-dir参数
|
||||
LOG_INFO "检查qmllint命令是否支持--qmltypes-dir参数..."
|
||||
if ! qmllint --help | grep -q -- "--qmltypes-dir"; then
|
||||
LOG_ERROR "qmllint命令不支持--qmltypes-dir参数"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 创建测试用的临时目录和文件
|
||||
LOG_INFO "创建测试用的临时目录和文件..."
|
||||
temp_dir=$(mktemp -d)
|
||||
test_qml_file="$temp_dir/test.qml"
|
||||
test_qmltypes_dir="$temp_dir/qmltypes"
|
||||
|
||||
mkdir -p "$test_qmltypes_dir"
|
||||
echo "import QtQuick 2.0; Item {}" > "$test_qml_file"
|
||||
echo "dummy content" > "$test_qmltypes_dir/dummy.qmltypes"
|
||||
|
||||
# 执行qmllint命令测试--qmltypes-dir参数
|
||||
LOG_INFO "执行qmllint命令测试--qmltypes-dir参数..."
|
||||
qmllint --qmltypes-dir "$test_qmltypes_dir" "$test_qml_file"
|
||||
CHECK_RESULT $? 0 0 "qmllint命令执行失败"
|
||||
|
||||
# 清理临时文件
|
||||
LOG_INFO "清理临时文件..."
|
||||
rm -rf "$temp_dir"
|
||||
|
||||
# 若脚本开始时未安装qt5-qtdeclarative-devel,则卸载
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载qt5-qtdeclarative-devel..."
|
||||
dnf remove -y qt5-qtdeclarative-devel
|
||||
CHECK_RESULT $? 0 0 "卸载qt5-qtdeclarative-devel失败"
|
||||
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-12-13
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试qmllint的未限定标识符检查选项
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查yum源中是否存在qt5-qtdeclarative-devel软件包
|
||||
LOG_INFO "检查yum源中是否存在qt5-qtdeclarative-devel软件包"
|
||||
dnf list available qt5-qtdeclarative-devel > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到qt5-qtdeclarative-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 检查qmllint命令是否支持--upper-u参数
|
||||
LOG_INFO "检查qmllint命令是否支持--upper-u参数"
|
||||
qmllint --help | grep -q "\-\-upper\-u"
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "qmllint命令不支持--upper-u参数"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 检查环境是否已安装qt5-qtdeclarative-devel软件包
|
||||
LOG_INFO "检查环境是否已安装qt5-qtdeclarative-devel软件包"
|
||||
rpm -q qt5-qtdeclarative-devel > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "环境已安装qt5-qtdeclarative-devel软件包,测试结束后保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "环境未安装qt5-qtdeclarative-devel软件包,测试结束后将卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "安装qt5-qtdeclarative-devel软件包"
|
||||
dnf install -y qt5-qtdeclarative-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装qt5-qtdeclarative-devel失败"
|
||||
fi
|
||||
|
||||
# 测试qmllint的未限定标识符检查选项
|
||||
LOG_INFO "测试qmllint的未限定标识符检查选项"
|
||||
qmllint --upper-u test.qml > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "qmllint --upper-u执行失败"
|
||||
|
||||
# 清理环境:如果之前未安装,则卸载软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载qt5-qtdeclarative-devel软件包"
|
||||
dnf remove -y qt5-qtdeclarative-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载qt5-qtdeclarative-devel失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,66 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-12-13
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试 qmlscene 命令的 -v 参数,用于显示版本信息
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试 qmlscene 命令的 -v 参数,用于显示版本信息"
|
||||
|
||||
# 检查是否已安装 qt5-qtdeclarative-devel 软件包
|
||||
LOG_INFO "检查 qt5-qtdeclarative-devel 软件包是否已安装"
|
||||
if ! dnf list installed qt5-qtdeclarative-devel &>/dev/null; then
|
||||
LOG_INFO "qt5-qtdeclarative-devel 软件包未安装,准备安装"
|
||||
# 检查 yum 源中是否有该软件包
|
||||
if ! dnf list available qt5-qtdeclarative-devel &>/dev/null; then
|
||||
LOG_ERROR "yum 源中未找到 qt5-qtdeclarative-devel 软件包"
|
||||
exit 255
|
||||
fi
|
||||
# 安装软件包
|
||||
dnf install -y qt5-qtdeclarative-devel
|
||||
CHECK_RESULT $? 0 0 "安装 qt5-qtdeclarative-devel 软件包失败"
|
||||
# 标记为需要卸载
|
||||
NEED_UNINSTALL=1
|
||||
else
|
||||
LOG_INFO "qt5-qtdeclarative-devel 软件包已安装"
|
||||
NEED_UNINSTALL=0
|
||||
fi
|
||||
|
||||
# 测试 qmlscene -v 命令
|
||||
LOG_INFO "测试 qmlscene -v 命令"
|
||||
qmlscene -v &>/dev/null
|
||||
CHECK_RESULT $? 0 0 "qmlscene -v 命令执行失败"
|
||||
|
||||
# 检查 -v 参数是否支持
|
||||
LOG_INFO "检查 qmlscene -v 参数是否支持"
|
||||
if ! qmlscene -h | grep -q "\-v"; then
|
||||
LOG_ERROR "qmlscene 命令不支持 -v 参数"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 清理环境:如果之前未安装,则卸载软件包
|
||||
if [ "$NEED_UNINSTALL" -eq 1 ]; then
|
||||
LOG_INFO "卸载 qt5-qtdeclarative-devel 软件包"
|
||||
dnf remove -y qt5-qtdeclarative-devel
|
||||
CHECK_RESULT $? 0 0 "卸载 qt5-qtdeclarative-devel 失败"
|
||||
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-12-13
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试 qmltestrunner 的 -V 参数功能
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查yum源中是否存在qt5-qtdeclarative-devel软件包
|
||||
LOG_INFO "检查yum源中是否存在qt5-qtdeclarative-devel软件包..."
|
||||
if ! dnf list available qt5-qtdeclarative-devel &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到qt5-qtdeclarative-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 检查是否已安装qt5-qtdeclarative-devel
|
||||
LOG_INFO "检查是否已安装qt5-qtdeclarative-devel..."
|
||||
if rpm -q qt5-qtdeclarative-devel &>/dev/null; then
|
||||
installed=true
|
||||
LOG_INFO "qt5-qtdeclarative-devel已安装,脚本结束后将保持安装状态"
|
||||
else
|
||||
installed=false
|
||||
LOG_INFO "qt5-qtdeclarative-devel未安装,脚本结束后将卸载"
|
||||
fi
|
||||
|
||||
# 若未安装,则安装软件包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "安装qt5-qtdeclarative-devel..."
|
||||
dnf install -y qt5-qtdeclarative-devel
|
||||
CHECK_RESULT $? 0 0 "安装qt5-qtdeclarative-devel失败"
|
||||
fi
|
||||
|
||||
# 检查qmltestrunner命令是否存在
|
||||
LOG_INFO "检查qmltestrunner命令是否存在..."
|
||||
if ! command -v qmltestrunner &>/dev/null; then
|
||||
LOG_ERROR "qmltestrunner命令不存在"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 测试qmltestrunner的-V参数功能
|
||||
LOG_INFO "测试qmltestrunner的-V参数功能..."
|
||||
qmltestrunner -V
|
||||
CHECK_RESULT $? 0 0 "qmltestrunner的-V参数功能测试失败"
|
||||
|
||||
# 环境恢复:若脚本开始时未安装,则卸载软件包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载qt5-qtdeclarative-devel..."
|
||||
dnf remove -y qt5-qtdeclarative-devel
|
||||
CHECK_RESULT $? 0 0 "卸载qt5-qtdeclarative-devel失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试脚本执行完毕"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,70 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-12-13
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试 qmltime 命令的 -v 参数
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查是否已安装qt5-qtdeclarative-devel软件包
|
||||
LOG_INFO "检查qt5-qtdeclarative-devel软件包是否已安装"
|
||||
if rpm -q qt5-qtdeclarative-devel &>/dev/null; then
|
||||
LOG_INFO "qt5-qtdeclarative-devel软件包已安装,测试完成后将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "qt5-qtdeclarative-devel软件包未安装,将在测试完成后卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有该软件包
|
||||
LOG_INFO "检查yum源中是否有qt5-qtdeclarative-devel软件包"
|
||||
if ! dnf list available qt5-qtdeclarative-devel &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到qt5-qtdeclarative-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "开始安装qt5-qtdeclarative-devel软件包"
|
||||
dnf install -y qt5-qtdeclarative-devel
|
||||
CHECK_RESULT $? 0 0 "安装qt5-qtdeclarative-devel软件包失败"
|
||||
fi
|
||||
|
||||
# 测试qmltime命令的-v参数
|
||||
LOG_INFO "测试qmltime命令的-v参数"
|
||||
if ! qmltime -v &>/dev/null; then
|
||||
LOG_ERROR "qmltime命令不支持-v参数"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 检查命令执行结果
|
||||
qmltime -v > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "qmltime命令执行失败"
|
||||
|
||||
# 清理环境:如果之前未安装,则卸载软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载qt5-qtdeclarative-devel软件包"
|
||||
dnf remove -y qt5-qtdeclarative-devel
|
||||
CHECK_RESULT $? 0 0 "卸载qt5-qtdeclarative-devel软件包失败"
|
||||
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-12-13
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试帮助选项
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试帮助选项"
|
||||
|
||||
# 检查是否已安装qt5-qtdeclarative-devel_qmltyperegistrar
|
||||
LOG_INFO "检查是否已安装qt5-qtdeclarative-devel_qmltyperegistrar"
|
||||
if rpm -q qt5-qtdeclarative-devel_qmltyperegistrar &>/dev/null; then
|
||||
LOG_INFO "qt5-qtdeclarative-devel_qmltyperegistrar已安装"
|
||||
installed=true
|
||||
else
|
||||
LOG_INFO "qt5-qtdeclarative-devel_qmltyperegistrar未安装"
|
||||
installed=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有该软件包
|
||||
LOG_INFO "检查yum源中是否有qt5-qtdeclarative-devel_qmltyperegistrar"
|
||||
if ! dnf list available qt5-qtdeclarative-devel_qmltyperegistrar &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到qt5-qtdeclarative-devel_qmltyperegistrar"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "安装qt5-qtdeclarative-devel_qmltyperegistrar"
|
||||
dnf install -y qt5-qtdeclarative-devel_qmltyperegistrar
|
||||
CHECK_RESULT $? 0 0 "安装qt5-qtdeclarative-devel_qmltyperegistrar失败"
|
||||
fi
|
||||
|
||||
# 测试帮助选项
|
||||
LOG_INFO "测试帮助选项"
|
||||
qmltyperegistrar --help
|
||||
CHECK_RESULT $? 0 0 "qmltyperegistrar --help执行失败"
|
||||
|
||||
# 清理环境
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载qt5-qtdeclarative-devel_qmltyperegistrar"
|
||||
dnf remove -y qt5-qtdeclarative-devel_qmltyperegistrar
|
||||
CHECK_RESULT $? 0 0 "卸载qt5-qtdeclarative-devel_qmltyperegistrar失败"
|
||||
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-12-13
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试版本信息选项
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查qt5-qtdeclarative-devel_qmltyperegistrar是否已安装
|
||||
LOG_INFO "检查qt5-qtdeclarative-devel_qmltyperegistrar是否已安装"
|
||||
if rpm -q qt5-qtdeclarative-devel_qmltyperegistrar &>/dev/null; then
|
||||
LOG_INFO "qt5-qtdeclarative-devel_qmltyperegistrar已安装"
|
||||
installed=true
|
||||
else
|
||||
LOG_INFO "qt5-qtdeclarative-devel_qmltyperegistrar未安装"
|
||||
installed=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在qt5-qtdeclarative-devel_qmltyperegistrar
|
||||
LOG_INFO "检查yum源中是否存在qt5-qtdeclarative-devel_qmltyperegistrar"
|
||||
if ! dnf list available qt5-qtdeclarative-devel_qmltyperegistrar &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到qt5-qtdeclarative-devel_qmltyperegistrar"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装qt5-qtdeclarative-devel_qmltyperegistrar
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "安装qt5-qtdeclarative-devel_qmltyperegistrar"
|
||||
dnf install -y qt5-qtdeclarative-devel_qmltyperegistrar
|
||||
CHECK_RESULT $? 0 0 "安装失败"
|
||||
fi
|
||||
|
||||
# 测试版本信息选项
|
||||
LOG_INFO "测试版本信息选项"
|
||||
qmltyperegistrar --version &>/dev/null
|
||||
CHECK_RESULT $? 0 0 "--version选项不支持"
|
||||
|
||||
# 清理环境
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载qt5-qtdeclarative-devel_qmltyperegistrar"
|
||||
dnf remove -y qt5-qtdeclarative-devel_qmltyperegistrar
|
||||
CHECK_RESULT $? 0 0 "卸载失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成"
|
||||
|
||||
}
|
||||
|
||||
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-11
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test basic functionality of saxon-demo
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试 saxon-demo 的基本功能"
|
||||
|
||||
# 检查 saxon-demo 是否已安装
|
||||
if dnf list installed saxon-demo &>/dev/null; then
|
||||
LOG_INFO "saxon-demo 已安装,测试完成后将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "saxon-demo 未安装,测试完成后将卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查 yum 源中是否有 saxon-demo 软件包
|
||||
LOG_INFO "检查 yum 源中是否存在 saxon-demo"
|
||||
if ! dnf list available saxon-demo &>/dev/null; then
|
||||
LOG_ERROR "yum 源中未找到 saxon-demo 软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装 saxon-demo
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "正在安装 saxon-demo"
|
||||
dnf install -y saxon-demo
|
||||
CHECK_RESULT $? 0 0 "安装 saxon-demo 失败"
|
||||
fi
|
||||
|
||||
# 测试 saxon-demo 的基本功能
|
||||
LOG_INFO "测试 saxon-demo 的基本功能"
|
||||
saxon-demo --version
|
||||
CHECK_RESULT $? 0 0 "获取 saxon-demo 版本失败"
|
||||
|
||||
# 测试不支持的参数
|
||||
LOG_INFO "测试 saxon-demo 不支持的参数"
|
||||
saxon-demo --invalid-arg &>/dev/null
|
||||
CHECK_RESULT $? 255 255 "saxon-demo 不支持 --invalid-arg 参数"
|
||||
|
||||
# 如果之前未安装,则卸载 saxon-demo
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "正在卸载 saxon-demo"
|
||||
dnf remove -y saxon-demo
|
||||
CHECK_RESULT $? 0-0-0-0-0-0-0-0-0-0-"卸载 saxon-demon失败"
|
||||
fi
|
||||
|
||||
LOG_INFO"saxondemo基本功能测试完成"
|
||||
}
|
||||
|
||||
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 : 2026-02-24
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test if the saxon-demo command-line tool provides help information.
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "测试开始:验证saxon-demo命令行工具是否提供帮助信息"
|
||||
|
||||
# 检查环境是否已安装saxon-demo
|
||||
LOG_INFO "步骤1:检查saxon-demo是否已安装"
|
||||
if dnf list installed saxon-demo &> /dev/null; then
|
||||
LOG_INFO "saxon-demo已安装,跳过安装步骤"
|
||||
INSTALLED="true"
|
||||
else
|
||||
LOG_INFO "saxon-demo未安装,将在测试过程中安装"
|
||||
INSTALLED="false"
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有saxon-demo软件包
|
||||
LOG_INFO "步骤2:检查yum源中是否有saxon-demo软件包"
|
||||
if ! dnf list available saxon-demo &> /dev/null; then
|
||||
LOG_ERROR "yum源中未找到saxon-demo软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装saxon-demo
|
||||
if [ "$INSTALLED" = "false" ]; then
|
||||
LOG_INFO "步骤3:安装saxon-demo软件包"
|
||||
dnf install -y saxon-demo
|
||||
CHECK_RESULT $? 0 0 "安装saxon-demo失败"
|
||||
fi
|
||||
|
||||
# 测试saxon-demo命令是否提供帮助信息
|
||||
LOG_INFO "步骤4:执行saxon-demo --help命令"
|
||||
saxon-demo --help &> /dev/null
|
||||
CHECK_RESULT $? 0 0 "saxon-demo --help命令执行失败,可能不支持--help参数"
|
||||
|
||||
# 检查帮助信息中是否包含特定关键字(例如"usage"或"help")
|
||||
LOG_INFO "步骤5:验证帮助信息内容"
|
||||
saxon-demo --help 2>&1 | grep -q -E "usage|help"
|
||||
CHECK_RESULT $? 0 0 "帮助信息中未找到"usage"或"help"关键字"
|
||||
|
||||
# 环境恢复:如果测试前未安装,则卸载saxon-demo
|
||||
if [ "$INSTALLED" = "false" ]; then
|
||||
LOG_INFO "步骤6:卸载saxon-demo软件包"
|
||||
dnf remove -y saxon-demo
|
||||
CHECK_RESULT $? 0 0 "卸载saxon-demo失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:saxon-demo命令行工具提供帮助信息"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,79 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-02-24
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test if the saxon-demo package can be successfully installed.
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
set -e
|
||||
|
||||
LOG_INFO "开始测试saxon-demo软件包安装功能"
|
||||
|
||||
# 检查软件包是否已在yum源中
|
||||
LOG_INFO "步骤1: 检查saxon-demo软件包是否在yum源中"
|
||||
dnf list available saxon-demo 2>/dev/null | grep -q saxon-demo
|
||||
CHECK_RESULT $? 0 0 "yum源中未找到saxon-demo软件包"
|
||||
|
||||
# 检查当前环境是否已安装
|
||||
LOG_INFO "步骤2: 检查当前环境是否已安装saxon-demo"
|
||||
if rpm -q saxon-demo &>/dev/null; then
|
||||
LOG_INFO "saxon-demo已安装,将保持安装状态"
|
||||
INSTALLED_BEFORE=true
|
||||
else
|
||||
LOG_INFO "saxon-demo未安装,将进行安装测试"
|
||||
INSTALLED_BEFORE=false
|
||||
fi
|
||||
|
||||
# 执行安装测试
|
||||
if [ "$INSTALLED_BEFORE" = "false" ]; then
|
||||
LOG_INFO "步骤3: 安装saxon-demo软件包"
|
||||
dnf install -y saxon-demo
|
||||
CHECK_RESULT $? 0 0 "安装saxon-demo软件包失败"
|
||||
|
||||
LOG_INFO "步骤4: 验证saxon-demo软件包安装成功"
|
||||
rpm -q saxon-demo
|
||||
CHECK_RESULT $? 0 0 "验证saxon-demo安装状态失败"
|
||||
fi
|
||||
|
||||
# 测试软件包基本功能
|
||||
LOG_INFO "步骤5: 测试saxon-demo基本功能"
|
||||
if command -v saxon-demo &>/dev/null; then
|
||||
saxon-demo --help
|
||||
CHECK_RESULT $? 0 0 "执行saxon-demo --help失败"
|
||||
else
|
||||
LOG_INFO "saxon-demo命令不存在,跳过功能测试"
|
||||
fi
|
||||
|
||||
# 环境清理
|
||||
LOG_INFO "步骤6: 清理测试环境"
|
||||
if [ "$INSTALLED_BEFORE" = "false" ]; then
|
||||
LOG_INFO "卸载测试安装的saxon-demo软件包"
|
||||
dnf remove -y saxon-demo
|
||||
CHECK_RESULT $? 0 0 "卸载saxon-demo软件包失败"
|
||||
|
||||
LOG_INFO "验证saxon-demo已成功卸载"
|
||||
rpm -q saxon-demo
|
||||
CHECK_RESULT $? 0 1 "saxon-demo卸载不彻底"
|
||||
else
|
||||
LOG_INFO "保持saxon-demo安装状态,无需卸载"
|
||||
fi
|
||||
|
||||
LOG_INFO "saxon-demo软件包安装功能测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,119 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-02-24
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test basic XSLT transformation using saxon-demo.
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试:Test basic XSLT transformation using saxon-demo."
|
||||
LOG_INFO "步骤1: 检查saxon-demo软件包是否在yum源中"
|
||||
dnf list available saxon-demo >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到saxon-demo软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤2: 检查saxon-demo是否已安装"
|
||||
rpm -q saxon-demo >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "saxon-demo已安装,跳过安装步骤"
|
||||
INSTALLED="true"
|
||||
else
|
||||
LOG_INFO "saxon-demo未安装,开始安装"
|
||||
dnf install -y saxon-demo
|
||||
CHECK_RESULT $? 0 0 "安装saxon-demo失败"
|
||||
INSTALLED="false"
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤3: 验证saxon-demo命令是否存在"
|
||||
command -v saxon-demo >/dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "saxon-demo命令不存在"
|
||||
|
||||
LOG_INFO "步骤4: 准备测试用的XML和XSLT文件"
|
||||
cat > test_input.xml << "EOF"
|
||||
<?xml version="1.0"?>
|
||||
<catalog>
|
||||
<book id="bk101">
|
||||
<author>Gambardella, Matthew</author>
|
||||
<title>XML Developer"s Guide</title>
|
||||
<genre>Computer</genre>
|
||||
<price>44.95</price>
|
||||
<publish_date>2000-10-01</publish_date>
|
||||
<description>An in-depth look at creating applications with XML.</description>
|
||||
</book>
|
||||
</catalog>
|
||||
EOF
|
||||
|
||||
cat > test_transform.xsl << "EOF"
|
||||
<?xml version="1.0"?>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:template match="/">
|
||||
<html>
|
||||
<body>
|
||||
<h2>My Book Collection</h2>
|
||||
<table border="1">
|
||||
<tr bgcolor="#9acd32">
|
||||
<th>Title</th>
|
||||
<th>Author</th>
|
||||
</tr>
|
||||
<xsl:for-each select="catalog/book">
|
||||
<tr>
|
||||
<td><xsl:value-of select="title"/></td>
|
||||
<td><xsl:value-of select="author"/></td>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
EOF
|
||||
|
||||
LOG_INFO "步骤5: 执行XSLT转换"
|
||||
saxon-demo -s:test_input.xml -xsl:test_transform.xsl -o:test_output.html
|
||||
CHECK_RESULT $? 0 0 "执行XSLT转换失败"
|
||||
|
||||
LOG_INFO "步骤6: 检查转换结果"
|
||||
if [ -f test_output.html ]; then
|
||||
if grep -q "My Book Collection" test_output.html && grep -q "XML Developer"s Guide" test_output.html; then
|
||||
LOG_INFO "XSLT转换成功,输出文件包含预期内容"
|
||||
else
|
||||
LOG_ERROR "XSLT转换输出文件内容不符合预期"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
LOG_ERROR "未生成输出文件test_output.html"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤7: 清理测试文件"
|
||||
rm -f test_input.xml test_transform.xsl test_output.html
|
||||
|
||||
LOG_INFO "步骤8: 环境恢复"
|
||||
if [ "$INSTALLED" = "false" ]; then
|
||||
LOG_INFO "卸载saxon-demo软件包"
|
||||
dnf remove -y saxon-demo
|
||||
CHECK_RESULT $? 0 0 "卸载saxon-demo失败"
|
||||
else
|
||||
LOG_INFO "保持saxon-demo安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,81 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-02-24
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test the ability to query the installed version of the saxon-demo package.
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试saxon-demo软件包版本查询功能"
|
||||
|
||||
LOG_INFO "检查saxon-demo软件包是否已在yum源中"
|
||||
dnf list available saxon-demo 2>/dev/null | grep -q saxon-demo
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到saxon-demo软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
LOG_INFO "检查saxon-demo软件包是否已安装"
|
||||
rpm -q saxon-demo >/dev/null 2>&1
|
||||
INSTALLED=$?
|
||||
|
||||
if [ $INSTALLED -ne 0 ]; then
|
||||
LOG_INFO "saxon-demo软件包未安装,开始安装"
|
||||
dnf install -y saxon-demo
|
||||
CHECK_RESULT $? 0 0 "安装saxon-demo软件包失败"
|
||||
|
||||
LOG_INFO "验证saxon-demo软件包安装成功"
|
||||
rpm -q saxon-demo >/dev/null
|
||||
CHECK_RESULT $? 0 0 "验证saxon-demo软件包安装失败"
|
||||
else
|
||||
LOG_INFO "saxon-demo软件包已安装,跳过安装步骤"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试查询saxon-demo软件包版本"
|
||||
rpm -q saxon-demo --queryformat "%{VERSION}-%{RELEASE}\n"
|
||||
CHECK_RESULT $? 0 0 "查询saxon-demo软件包版本失败"
|
||||
|
||||
LOG_INFO "获取saxon-demo软件包版本信息"
|
||||
VERSION=$(rpm -q saxon-demo --queryformat "%{VERSION}-%{RELEASE}\n")
|
||||
CHECK_RESULT $? 0 0 "获取saxon-demo软件包版本信息失败"
|
||||
|
||||
LOG_INFO "验证版本信息格式"
|
||||
echo "$VERSION" | grep -qE "^[0-9]+\.[0-9]+(\.[0-9]+)?-[0-9]+\."
|
||||
CHECK_RESULT $? 0 0 "版本信息格式不正确"
|
||||
|
||||
LOG_INFO "打印saxon-demo软件包版本:$VERSION"
|
||||
|
||||
if [ $INSTALLED -ne 0 ]; then
|
||||
LOG_INFO "清理环境:卸载saxon-demo软件包"
|
||||
dnf remove -y saxon-demo
|
||||
CHECK_RESULT $? 0 0 "卸载saxon-demo软件包失败"
|
||||
|
||||
LOG_INFO "验证saxon-demo软件包已卸载"
|
||||
rpm -q saxon-demo >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_ERROR "saxon-demo软件包卸载失败"
|
||||
exit 1
|
||||
fi
|
||||
LOG_INFO "环境清理完成"
|
||||
else
|
||||
LOG_INFO "测试前已安装saxon-demo软件包,保持安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "saxon-demo软件包版本查询功能测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,60 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-03-18
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Check existence of main documentation files
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试:检查主文档文件是否存在"
|
||||
LOG_INFO "步骤1:检查texlive-avremu-doc软件包是否在yum源中"
|
||||
dnf list available texlive-avremu-doc > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "texlive-avremu-doc软件包不在yum源中"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤2:检查系统是否已安装texlive-avremu-doc软件包"
|
||||
rpm -q texlive-avremu-doc > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-avremu-doc软件包已安装,测试结束后将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "texlive-avremu-doc软件包未安装,将在测试结束后卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "步骤3:安装texlive-avremu-doc软件包"
|
||||
dnf install -y texlive-avremu-doc > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装texlive-avremu-doc软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤4:检查主文档文件是否存在"
|
||||
rpm -ql texlive-avremu-doc | grep -E "\.pdf$|\.html$|\.txt$" > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "主文档文件不存在"
|
||||
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "步骤5:卸载texlive-avremu-doc软件包"
|
||||
dnf remove -y texlive-avremu-doc > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-avremu-doc软件包失败"
|
||||
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-18
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test removal of texlive-avremu-doc package
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 检查是否以root用户运行
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
LOG_ERROR "请使用root用户运行此脚本"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 定义软件包名称
|
||||
PACKAGE_NAME="texlive-avremu-doc"
|
||||
|
||||
# 步骤1: 检查yum源中是否存在指定的软件包
|
||||
LOG_INFO "步骤1: 检查yum源中是否存在 ${PACKAGE_NAME} 软件包"
|
||||
dnf list available ${PACKAGE_NAME} &>/dev/null
|
||||
if [[ $? -ne 0 ]]; then
|
||||
LOG_ERROR "yum源中未找到 ${PACKAGE_NAME} 软件包"
|
||||
exit 255
|
||||
fi
|
||||
CHECK_RESULT $? 0 0 "检查yum源中软件包失败"
|
||||
|
||||
# 步骤2: 检查当前是否已安装该软件包
|
||||
LOG_INFO "步骤2: 检查当前是否已安装 ${PACKAGE_NAME} 软件包"
|
||||
rpm -q ${PACKAGE_NAME} &>/dev/null
|
||||
INSTALLED=$?
|
||||
|
||||
# 步骤3: 如果未安装,则安装软件包
|
||||
if [[ ${INSTALLED} -ne 0 ]]; then
|
||||
LOG_INFO "步骤3: 安装 ${PACKAGE_NAME} 软件包"
|
||||
dnf install -y ${PACKAGE_NAME}
|
||||
CHECK_RESULT $? 0 0 "安装软件包失败"
|
||||
NEW_INSTALL=1
|
||||
else
|
||||
LOG_INFO "步骤3: ${PACKAGE_NAME} 软件包已安装,跳过安装步骤"
|
||||
NEW_INSTALL=0
|
||||
fi
|
||||
|
||||
# 步骤4: 验证软件包是否成功安装
|
||||
LOG_INFO "步骤4: 验证 ${PACKAGE_NAME} 软件包是否成功安装"
|
||||
rpm -q ${PACKAGE_NAME} &>/dev/null
|
||||
CHECK_RESULT $? 0 0 "软件包安装后验证失败"
|
||||
|
||||
# 步骤5: 测试软件包卸载功能
|
||||
LOG_INFO "步骤5: 测试卸载 ${PACKAGE_NAME} 软件包"
|
||||
dnf remove -y ${PACKAGE_NAME}
|
||||
CHECK_RESULT $? 0 0 "卸载软件包失败"
|
||||
|
||||
# 步骤6: 验证软件包是否成功卸载
|
||||
LOG_INFO "步骤6: 验证 ${PACKAGE_NAME} 软件包是否成功卸载"
|
||||
rpm -q ${PACKAGE_NAME} &>/dev/null
|
||||
CHECK_RESULT $? 1 0 "软件包卸载后验证失败"
|
||||
|
||||
# 步骤7: 环境恢复
|
||||
LOG_INFO "步骤7: 环境恢复"
|
||||
if [[ ${NEW_INSTALL} -eq 1 ]]; then
|
||||
# 如果是新安装的,卸载后不需要重新安装
|
||||
LOG_INFO "新安装的软件包已卸载,环境已恢复"
|
||||
else
|
||||
# 如果是之前已安装的,需要重新安装以恢复原状
|
||||
LOG_INFO "重新安装 ${PACKAGE_NAME} 软件包以恢复环境"
|
||||
dnf install -y ${PACKAGE_NAME}
|
||||
CHECK_RESULT $? 0 0 "重新安装软件包失败"
|
||||
LOG_INFO "环境已恢复到初始状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成: ${PACKAGE_NAME} 软件包卸载功能测试通过"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,100 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-03-18
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Verify documentation contains key sections and information
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试:验证文档包含关键部分和信息"
|
||||
|
||||
# 检查软件包是否在yum源中
|
||||
LOG_INFO "检查软件包texlive-avremu-doc是否在yum源中"
|
||||
dnf list available texlive-avremu-doc 2>/dev/null | grep -q texlive-avremu-doc
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "软件包texlive-avremu-doc不在yum源中"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 检查是否已安装
|
||||
LOG_INFO "检查是否已安装texlive-avremu-doc"
|
||||
rpm -q texlive-avremu-doc >/dev/null 2>&1
|
||||
INSTALLED=$?
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "软件包已安装,测试结束后将保持安装状态"
|
||||
INSTALLED_BEFORE=1
|
||||
else
|
||||
LOG_INFO "软件包未安装,将进行安装"
|
||||
INSTALLED_BEFORE=0
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ $INSTALLED_BEFORE -eq 0 ]; then
|
||||
LOG_INFO "安装texlive-avremu-doc"
|
||||
dnf install -y texlive-avremu-doc
|
||||
CHECK_RESULT $? 0 0 "安装软件包失败"
|
||||
fi
|
||||
|
||||
# 验证文档包含关键部分和信息
|
||||
LOG_INFO "验证文档包含关键部分和信息"
|
||||
# 假设文档路径为/usr/share/doc/texlive-avremu-doc/
|
||||
DOC_PATH="/usr/share/doc/texlive-avremu-doc/"
|
||||
if [ -d "$DOC_PATH" ]; then
|
||||
LOG_INFO "检查文档目录是否存在关键文件"
|
||||
# 检查README文件
|
||||
if [ -f "${DOC_PATH}README" ]; then
|
||||
LOG_INFO "找到README文件"
|
||||
grep -q "avremu" "${DOC_PATH}README"
|
||||
CHECK_RESULT $? 0 0 "README文件中未找到关键信息"
|
||||
else
|
||||
LOG_ERROR "未找到README文件"
|
||||
CHECK_RESULT 1 0 0 "README文件缺失"
|
||||
fi
|
||||
|
||||
# 检查许可证文件
|
||||
if [ -f "${DOC_PATH}COPYING" ] || [ -f "${DOC_PATH}LICENSE" ]; then
|
||||
LOG_INFO "找到许可证文件"
|
||||
else
|
||||
LOG_ERROR "未找到许可证文件"
|
||||
CHECK_RESULT 1 0 0 "许可证文件缺失"
|
||||
fi
|
||||
|
||||
# 检查变更日志
|
||||
if [ -f "${DOC_PATH}ChangeLog" ] || [ -f "${DOC_PATH}CHANGES" ]; then
|
||||
LOG_INFO "找到变更日志文件"
|
||||
else
|
||||
LOG_ERROR "未找到变更日志文件"
|
||||
CHECK_RESULT 1 0 0 "变更日志文件缺失"
|
||||
fi
|
||||
else
|
||||
LOG_ERROR "文档目录不存在"
|
||||
CHECK_RESULT 1 0 0 "文档目录缺失"
|
||||
fi
|
||||
|
||||
# 清理环境:如果之前未安装,则卸载软件包
|
||||
if [ $INSTALLED_BEFORE -eq 0 ]; then
|
||||
LOG_INFO "卸载texlive-avremu-doc"
|
||||
dnf remove -y texlive-avremu-doc
|
||||
CHECK_RESULT $? 0 0 "卸载软件包失败"
|
||||
else
|
||||
LOG_INFO "保持软件包安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,91 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-03-18
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Verify texlive-avremu-doc package is installed in system
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试:验证 texlive-avremu-doc 软件包是否已安装"
|
||||
|
||||
# 检查软件包是否已在系统中安装
|
||||
LOG_INFO "检查 texlive-avremu-doc 是否已安装"
|
||||
rpm -q texlive-avremu-doc
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-avremu-doc 已安装,测试将保持安装状态"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "texlive-avremu-doc 未安装,将在测试中安装"
|
||||
INSTALLED=0
|
||||
fi
|
||||
|
||||
# 检查 yum 源中是否有该软件包
|
||||
LOG_INFO "检查 yum 源中是否有 texlive-avremu-doc"
|
||||
dnf list available texlive-avremu-doc
|
||||
CHECK_RESULT $? 0 0 "yum 源中未找到 texlive-avremu-doc 软件包"
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum 源中未找到 texlive-avremu-doc 软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "安装 texlive-avremu-doc"
|
||||
dnf install -y texlive-avremu-doc
|
||||
CHECK_RESULT $? 0 0 "安装 texlive-avremu-doc 失败"
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "安装 texlive-avremu-doc 失败"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# 验证软件包是否成功安装
|
||||
LOG_INFO "验证 texlive-avremu-doc 是否安装成功"
|
||||
rpm -q texlive-avremu-doc
|
||||
CHECK_RESULT $? 0 0 "texlive-avremu-doc 未成功安装"
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "texlive-avremu-doc 未成功安装"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 验证软件包的功能
|
||||
LOG_INFO "验证 texlive-avremu-doc 功能"
|
||||
# 这里可以添加具体功能验证步骤,例如检查文档文件是否存在
|
||||
if [ -d "/usr/share/doc/texlive-avremu-doc" ]; then
|
||||
LOG_INFO "texlive-avremu-doc 文档目录存在"
|
||||
else
|
||||
LOG_ERROR "texlive-avremu-doc 文档目录不存在"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 清理环境:如果测试前未安装,则卸载软件包
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "清理环境:卸载 texlive-avremu-doc"
|
||||
dnf remove -y texlive-avremu-doc
|
||||
CHECK_RESULT $? 0 0 "卸载 texlive-avremu-doc 失败"
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "卸载 texlive-avremu-doc 失败"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
LOG_INFO "保持 texlive-avremu-doc 安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:texlive-avremu-doc 软件包安装验证成功"
|
||||
}
|
||||
|
||||
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-11-25
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test Icelandic language support
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
LOG_INFO "开始测试冰岛语支持功能"
|
||||
|
||||
# 检查是否已安装texlive-babel-icelandic
|
||||
dnf list installed texlive-babel-icelandic > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-babel-icelandic已安装,测试后将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "texlive-babel-icelandic未安装,将在测试后卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有texlive-babel-icelandic
|
||||
LOG_INFO "检查yum源中是否存在texlive-babel-icelandic"
|
||||
dnf list available texlive-babel-icelandic > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到texlive-babel-icelandic"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装texlive-babel-icelandic(如果未安装)
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "正在安装texlive-babel-icelandic"
|
||||
dnf install -y texlive-babel-icelandic
|
||||
CHECK_RESULT $? 0 0 "安装texlive-babel-icelandic失败"
|
||||
fi
|
||||
|
||||
# 测试冰岛语支持功能
|
||||
LOG_INFO "测试冰岛语支持功能"
|
||||
TEST_COMMAND="texlua $(kpsewhich --progname=test --format=tex babel-icelandic.lua)"
|
||||
eval $TEST_COMMAND > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "冰岛语支持功能测试失败"
|
||||
|
||||
# 清理环境(如果之前未安装)
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "正在卸载texlive-babel-icelandic"
|
||||
dnf remove -y texlive-babel-icelandic
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-babel-
|
||||
}
|
||||
|
||||
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-11-26
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test basic functionality of texlive-makeplot-doc
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 测试脚本:test_texlive-makeplot-doc_function_basic
|
||||
|
||||
LOG_INFO "开始测试 texlive-makeplot-doc 的基本功能"
|
||||
|
||||
# 检查软件包是否已安装
|
||||
LOG_INFO "检查 texlive-makeplot-doc 是否已安装"
|
||||
dnf list installed texlive-makeplot-doc > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-makeplot-doc 已安装,测试结束后将保持安装状态"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "texlive-makeplot-doc 未安装,将在测试结束后卸载"
|
||||
INSTALLED=0
|
||||
fi
|
||||
|
||||
# 检查 yum 源中是否有 texlive-makeplot-doc
|
||||
LOG_INFO "检查 yum 源中是否有 texlive-makeplot-doc"
|
||||
dnf list available texlive-makeplot-doc > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum 源中未找到 texlive-makeplot-doc"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装 texlive-makeplot-doc
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "安装 texlive-makeplot-doc"
|
||||
dnf install -y texlive-makeplot-doc > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装 texlive-makeplot-doc 失败"
|
||||
fi
|
||||
|
||||
# 测试基本功能
|
||||
LOG_INFO "测试 texlive-makeplot-doc 的基本功能"
|
||||
texlive-makeplot-doc --help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "texlive-makeplot-doc --help 命令执行失败"
|
||||
|
||||
# 清理环境
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "卸载 texlive-makeplot-doc"
|
||||
dnf remove -y texlive-makeplot-doc > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载 texlive-makeplot-doc 失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,118 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-03-31
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test if info documentation exists and is accessible
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 检查texlive-makeplot文档是否存在并可访问的测试脚本
|
||||
LOG_INFO "开始测试:检查texlive-makeplot文档是否存在并可访问"
|
||||
|
||||
# 定义软件包名称
|
||||
PACKAGE_NAME="texlive-makeplot"
|
||||
PACKAGE_DOC_NAME="texlive-makeplot-doc"
|
||||
|
||||
# 步骤1:检查软件包是否已在yum源中
|
||||
LOG_INFO "步骤1:检查软件包是否在yum源中"
|
||||
dnf list available ${PACKAGE_NAME} &>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "软件包 ${PACKAGE_NAME} 不在yum源中"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
dnf list available ${PACKAGE_DOC_NAME} &>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "软件包 ${PACKAGE_DOC_NAME} 不在yum源中"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 步骤2:检查系统是否已安装该软件包
|
||||
LOG_INFO "步骤2:检查系统是否已安装软件包"
|
||||
INSTALLED=false
|
||||
if rpm -q ${PACKAGE_NAME} &>/dev/null && rpm -q ${PACKAGE_DOC_NAME} &>/dev/null; then
|
||||
LOG_INFO "软件包已安装,测试结束后将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "软件包未安装,将进行安装测试"
|
||||
fi
|
||||
|
||||
# 步骤3:如果未安装,则安装软件包
|
||||
if [ "$INSTALLED" = "false" ]; then
|
||||
LOG_INFO "步骤3:安装软件包"
|
||||
dnf install -y ${PACKAGE_NAME} ${PACKAGE_DOC_NAME}
|
||||
CHECK_RESULT $? 0 0 "安装软件包失败"
|
||||
fi
|
||||
|
||||
# 步骤4:检查info文档是否存在
|
||||
LOG_INFO "步骤4:检查info文档是否存在"
|
||||
info_file_path="/usr/share/info/makeplot.info"
|
||||
if [ -f "$info_file_path" ]; then
|
||||
LOG_INFO "找到info文档:$info_file_path"
|
||||
else
|
||||
LOG_ERROR "未找到info文档:$info_file_path"
|
||||
CHECK_RESULT 1 0 0 "info文档不存在"
|
||||
fi
|
||||
|
||||
# 步骤5:检查info文档是否可访问
|
||||
LOG_INFO "步骤5:检查info文档是否可访问"
|
||||
if [ -r "$info_file_path" ]; then
|
||||
LOG_INFO "info文档可读"
|
||||
else
|
||||
LOG_ERROR "info文档不可读"
|
||||
CHECK_RESULT 1 0 0 "info文档不可访问"
|
||||
fi
|
||||
|
||||
# 步骤6:使用info命令测试文档可访问性
|
||||
LOG_INFO "步骤6:使用info命令测试文档可访问性"
|
||||
info --version &>/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
info makeplot --output=/dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "info命令无法访问makeplot文档"
|
||||
LOG_INFO "info命令可以成功访问makeplot文档"
|
||||
else
|
||||
LOG_INFO "info命令不可用,跳过info命令测试"
|
||||
fi
|
||||
|
||||
# 步骤7:检查文档内容是否完整
|
||||
LOG_INFO "步骤7:检查文档内容是否完整"
|
||||
if [ -s "$info_file_path" ]; then
|
||||
LOG_INFO "info文档内容非空"
|
||||
# 检查文档是否包含关键内容
|
||||
grep -q "makeplot" "$info_file_path"
|
||||
CHECK_RESULT $? 0 0 "info文档中未找到"makeplot"相关内容"
|
||||
LOG_INFO "info文档包含"makeplot"相关内容"
|
||||
else
|
||||
LOG_ERROR "info文档为空"
|
||||
CHECK_RESULT 1 0 0 "info文档内容为空"
|
||||
fi
|
||||
|
||||
# 步骤8:清理环境
|
||||
LOG_INFO "步骤8:清理测试环境"
|
||||
if [ "$INSTALLED" = "false" ]; then
|
||||
LOG_INFO "卸载测试安装的软件包"
|
||||
dnf remove -y ${PACKAGE_NAME} ${PACKAGE_DOC_NAME}
|
||||
CHECK_RESULT $? 0 0 "卸载软件包失败"
|
||||
LOG_INFO "软件包已成功卸载"
|
||||
else
|
||||
LOG_INFO "保持软件包安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:texlive-makeplot文档存在并可访问"
|
||||
}
|
||||
|
||||
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 : 2026-03-31
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test if manpage exists and is readable
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "测试开始:检查texlive-makeplot文档功能的手册页是否存在且可读"
|
||||
|
||||
# 定义软件包名称
|
||||
PACKAGE_NAME="texlive-makeplot"
|
||||
|
||||
# 检查软件包是否已在yum源中
|
||||
LOG_INFO "检查yum源中是否存在软件包:$PACKAGE_NAME"
|
||||
if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then
|
||||
LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 检查软件包是否已安装
|
||||
LOG_INFO "检查软件包是否已安装:$PACKAGE_NAME"
|
||||
if rpm -q "$PACKAGE_NAME" &>/dev/null; then
|
||||
LOG_INFO "软件包 $PACKAGE_NAME 已安装,将保持安装状态"
|
||||
INSTALLED_BEFORE=true
|
||||
else
|
||||
LOG_INFO "软件包 $PACKAGE_NAME 未安装,将进行安装"
|
||||
INSTALLED_BEFORE=false
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ "$INSTALLED_BEFORE" = false ]; then
|
||||
LOG_INFO "安装软件包:$PACKAGE_NAME"
|
||||
dnf install -y "$PACKAGE_NAME"
|
||||
CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败"
|
||||
fi
|
||||
|
||||
# 检查手册页是否存在且可读
|
||||
LOG_INFO "检查手册页是否存在且可读"
|
||||
if man -w texlive-makeplot &>/dev/null; then
|
||||
LOG_INFO "手册页存在,尝试读取"
|
||||
man texlive-makeplot > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "手册页不可读"
|
||||
else
|
||||
LOG_ERROR "手册页不存在"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 环境恢复:如果之前未安装,则卸载软件包
|
||||
if [ "$INSTALLED_BEFORE" = false ]; then
|
||||
LOG_INFO "卸载软件包:$PACKAGE_NAME"
|
||||
dnf remove -y "$PACKAGE_NAME"
|
||||
CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败"
|
||||
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 : Verify the documentation files are installed correctly
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试:Verify the documentation files are installed correctly"
|
||||
|
||||
# 检查是否已安装texlive-pst-3d-doc
|
||||
LOG_INFO "检查是否已安装texlive-pst-3d-doc"
|
||||
dnf list installed texlive-pst-3d-doc > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-pst-3d-doc已安装,跳过安装步骤"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "texlive-pst-3d-doc未安装,准备安装"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有texlive-pst-3d-doc软件包
|
||||
LOG_INFO "检查yum源中是否有texlive-pst-3d-doc软件包"
|
||||
dnf list available texlive-pst-3d-doc > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 255 "yum源中未找到texlive-pst-3d-doc软件包"
|
||||
|
||||
# 安装texlive-pst-3d-doc
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "安装texlive-pst-3d-doc"
|
||||
dnf install -y texlive-pst-3d-doc
|
||||
CHECK_RESULT $? 0 0 "安装texlive-pst-3d-doc失败"
|
||||
fi
|
||||
|
||||
# 验证文档文件是否正确安装
|
||||
LOG_INFO "验证文档文件是否正确安装"
|
||||
ls /usr/share/doc/texlive-pst-3d-doc > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "文档文件未正确安装"
|
||||
|
||||
# 清理环境(如果之前未安装)
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载texlive-pst-3d-doc"
|
||||
dnf remove -y texlive-pst-3d-doc
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-pst-3d-doc失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:Verify the documentation files are installed correctly"
|
||||
}
|
||||
|
||||
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-11-26
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test basic functionality of texlive-sslides
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试 texlive-sslides 的基本功能"
|
||||
|
||||
# 检查是否已安装 texlive-sslides
|
||||
LOG_INFO "检查 texlive-sslides 是否已安装"
|
||||
if dnf list installed texlive-sslides &>/dev/null; then
|
||||
LOG_INFO "texlive-sslides 已安装,测试结束后保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "texlive-sslides 未安装,将在测试结束后卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查 yum 源中是否有 texlive-sslides
|
||||
LOG_INFO "检查 yum 源中是否有 texlive-sslides"
|
||||
if ! dnf list available texlive-sslides &>/dev/null; then
|
||||
LOG_ERROR "yum 源中未找到 texlive-sslides,退出测试"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装 texlive-sslides
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "安装 texlive-sslides"
|
||||
dnf install -y texlive-sslides
|
||||
CHECK_RESULT $? 0 0 "安装 texlive-ssliles 失败"
|
||||
fi
|
||||
|
||||
# 测试基本功能
|
||||
LOG_INFO "测试 texlive-ssliles 基本功能"
|
||||
texlive-ssliles --version
|
||||
CHECK_RESULT $? 0 0 "texlive-ssliles --version 执行失败"
|
||||
|
||||
# 清理环境
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载 texlive-ssliles"
|
||||
dnf remove -y texlive-ssliles
|
||||
CHECK_RESULT $? 0 0 "卸载 texlive-ssliles 失败"
|
||||
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-11-26
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test package installation
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查是否已安装texlive-bxjatoucs软件包
|
||||
LOG_INFO "检查texlive-bxjatoucs是否已安装"
|
||||
rpm -q texlive-bxjatoucs > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-bxjatoucs已安装,脚本结束后将保持安装状态"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "texlive-bxjatoucs未安装,脚本结束后将卸载"
|
||||
INSTALLED=0
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在texlive-bxjatoucs软件包
|
||||
LOG_INFO "检查yum源中是否存在texlive-bxjatoucs软件包"
|
||||
dnf list available texlive-bxjatoucs > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中不存在texlive-bxjatoucs软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装texlive-bxjatoucs软件包
|
||||
LOG_INFO "安装texlive-bxjatoucs软件包"
|
||||
dnf install -y texlive-bxjatoucs > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装texlive-bxjatoucs失败"
|
||||
|
||||
# 验证安装是否成功
|
||||
LOG_INFO "验证texlive-bxjatoucs是否安装成功"
|
||||
rpm -q texlive-bxjatoucs > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "验证texlive-bxjatoucs安装失败"
|
||||
|
||||
# 测试命令功能(假设命令为bxjatoucs --version)
|
||||
LOG_INFO "测试bxjatoucs命令功能"
|
||||
bxjatoucs --version > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "bxjatoucs命令执行失败"
|
||||
|
||||
# 清理环境:如果脚本开始时未安装,则卸载软件包
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "卸载texlive-bxjatoucstexlive- bxj at ouc s软 件 包"
|
||||
dnf remove -y texlive- bxj at ouc s > / dev/ null 2>&1
|
||||
CHECK_ RESULT $? 0 0 \“卸载 texlive- bxj at ouc s失败\”
|
||||
fi
|
||||
|
||||
LOG_ INFO \“测试完成\”
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,81 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-02-21
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test package removal
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试:软件包卸载功能测试"
|
||||
|
||||
# 检查是否已安装texlive-bxjatoucs
|
||||
LOG_INFO "步骤1:检查texlive-bxjatoucs是否已安装"
|
||||
if rpm -q texlive-bxjatoucs &>/dev/null; then
|
||||
LOG_INFO "texlive-bxjatoucs已安装,测试结束后保持安装状态"
|
||||
INSTALLED_BEFORE=true
|
||||
else
|
||||
LOG_INFO "texlive-bxjatoucs未安装,将在测试前安装"
|
||||
INSTALLED_BEFORE=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在texlive-bxjatoucs
|
||||
LOG_INFO "步骤2:检查yum源中是否存在texlive-bxjatoucs包"
|
||||
if ! dnf list available texlive-bxjatoucs &>/dev/null; then
|
||||
LOG_ERROR "yum源中不存在texlive-bxjatoucs包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ "$INSTALLED_BEFORE" = false ]; then
|
||||
LOG_INFO "步骤3:安装texlive-bxjatoucs"
|
||||
dnf install -y texlive-bxjatoucs
|
||||
CHECK_RESULT $? 0 0 "安装texlive-bxjatoucs失败"
|
||||
fi
|
||||
|
||||
# 验证软件包已安装
|
||||
LOG_INFO "步骤4:验证texlive-bxjatoucs安装成功"
|
||||
rpm -q texlive-bxjatoucs
|
||||
CHECK_RESULT $? 0 0 "texlive-bxjatoucs未正确安装"
|
||||
|
||||
# 测试卸载功能
|
||||
LOG_INFO "步骤5:测试卸载texlive-bxjatoucs"
|
||||
dnf remove -y texlive-bxjatoucs
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-bxjatoucs失败"
|
||||
|
||||
# 验证软件包已卸载
|
||||
LOG_INFO "步骤6:验证texlive-bxjatoucs已卸载"
|
||||
if rpm -q texlive-bxjatoucs &>/dev/null; then
|
||||
LOG_ERROR "texlive-bxjatoucs卸载后仍然存在"
|
||||
exit 1
|
||||
else
|
||||
LOG_INFO "texlive-bxjatoucs已成功卸载"
|
||||
fi
|
||||
|
||||
# 环境恢复
|
||||
LOG_INFO "步骤7:恢复测试环境"
|
||||
if [ "$INSTALLED_BEFORE" = true ]; then
|
||||
LOG_INFO "重新安装texlive-bxjatoucs以恢复原始状态"
|
||||
dnf install -y texlive-bxjatoucs
|
||||
CHECK_RESULT $? 0 0 "重新安装texlive-bxjatoucs失败"
|
||||
else
|
||||
LOG_INFO "测试前未安装,无需重新安装"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:软件包卸载功能测试通过"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,92 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-02-21
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Verify basic usage in document
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 检查是否已安装texlive-bxjatoucs
|
||||
LOG_INFO "检查是否已安装texlive-bxjatoucs"
|
||||
rpm -q texlive-bxjatoucs
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-bxjatoucs已安装,测试结束后保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "texlive-bxjatoucs未安装,将在测试结束后卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有texlive-bxjatoucs软件包
|
||||
LOG_INFO "检查yum源中是否有texlive-bxjatoucs软件包"
|
||||
dnf list available texlive-bxjatoucs
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到texlive-bxjatoucs软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "安装texlive-bxjatoucs软件包"
|
||||
dnf install -y texlive-bxjatoucs
|
||||
CHECK_RESULT $? 0 0 "安装texlive-bxjatoucs失败"
|
||||
fi
|
||||
|
||||
# 测试基本功能使用
|
||||
LOG_INFO "测试texlive-bxjatoucs基本功能使用"
|
||||
# 假设texlive-bxjatoucs提供了一个命令或功能,这里以示例命令为例
|
||||
# 实际应根据texlive-bxjatoucs的实际命令替换下面的示例命令
|
||||
texlive-bxjatoucs --help
|
||||
CHECK_RESULT $? 0 0 "texlive-bxjatoucs基本功能测试失败"
|
||||
|
||||
# 测试指定命令参数是否存在或不支持
|
||||
LOG_INFO "测试texlive-bxjatoucs指定命令参数"
|
||||
# 假设--version是一个支持的参数
|
||||
texlive-bxjatoucs --version
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "texlive-bxjatoucs不支持--version参数或参数不存在"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 测试不支持或无效的参数
|
||||
LOG_INFO "测试texlive-bxjatoucs无效参数"
|
||||
texlive-bxjatoucs --invalid-param
|
||||
if [ $? -ne 255 ]; then
|
||||
LOG_ERROR "无效参数处理不符合预期"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 在多服务器环境中测试(如果适用)
|
||||
LOG_INFO "在多服务器环境中测试texlive-bxjatoucs功能"
|
||||
# 假设需要在第二个服务器上执行命令
|
||||
SSH_CMD "rpm -q texlive-bxjatoucs" $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER
|
||||
CHECK_RESULT $? 0 0 "在第二个服务器上检查texlive-bxjatoucs失败"
|
||||
|
||||
# 清理环境,恢复到之前的状态
|
||||
LOG_INFO "清理测试环境"
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载texlive-bxjatoucs软件包"
|
||||
dnf remove -y texlive-bxjatoucs
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-bxjatoucs失败"
|
||||
else
|
||||
LOG_INFO "测试开始时已安装texlive-bxjatoucs,保持安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,67 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2026-02-21
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Check package version info
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试:检查软件包版本信息"
|
||||
LOG_INFO "步骤1:检查环境是否已安装指定软件包"
|
||||
rpm -q texlive-bxjatoucs
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "环境已安装texlive-bxjatoucs,测试后保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "环境未安装texlive-bxjatoucs,将在测试中安装"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤2:检查yum源中是否存在texlive-bxjatoucs软件包"
|
||||
dnf list available texlive-bxjatoucs
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到texlive-bxjatoucs软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
if [ "$INSTALLED" = "false" ]; then
|
||||
LOG_INFO "步骤3:安装texlive-bxjatoucs软件包"
|
||||
dnf install -y texlive-bxjatoucs
|
||||
CHECK_RESULT $? 0 0 "安装texlive-bxjatoucs失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤4:检查texlive-bxjatoucs版本信息"
|
||||
rpm -qi texlive-bxjatoucs
|
||||
CHECK_RESULT $? 0 0 "获取texlive-bxjatoucs版本信息失败"
|
||||
|
||||
LOG_INFO "步骤5:检查texlive-bxjatoucs命令是否可用"
|
||||
which texlive-bxjatoucs
|
||||
CHECK_RESULT $? 0 0 "texlive-bxjatoucs命令不可用"
|
||||
|
||||
LOG_INFO "步骤6:清理测试环境"
|
||||
if [ "$INSTALLED" = "false" ]; then
|
||||
LOG_INFO "卸载测试安装的texlive-bxjatoucs软件包"
|
||||
dnf remove -y texlive-bxjatoucs
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-bxjatoucs失败"
|
||||
else
|
||||
LOG_INFO "测试前已安装texlive-bxjatoucs,保持安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:软件包版本信息检查通过"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,58 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-12-10
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试 yasm 命令的 -r help 参数,列出支持的预处理器
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试 yasm 命令的 -r help 参数,列出支持的预处理器"
|
||||
|
||||
# 检查 yasm 是否已安装
|
||||
LOG_INFO "检查 yasm 是否已安装"
|
||||
if ! dnf list installed yasm &> /dev/null; then
|
||||
LOG_INFO "yasm 未安装,将进行安装"
|
||||
# 检查 yum 源中是否有 yasm
|
||||
if ! dnf list available yasm &> /dev/null; then
|
||||
LOG_ERROR "yum 源中未找到 yasm 软件包"
|
||||
exit 255
|
||||
fi
|
||||
# 安装 yasm
|
||||
dnf install -y yasm
|
||||
CHECK_RESULT $? 0 0 "安装 yasm 失败"
|
||||
# 标记为需要卸载
|
||||
NEED_UNINSTALL=1
|
||||
else
|
||||
LOG_INFO "yasm 已安装"
|
||||
fi
|
||||
|
||||
# 测试 -r help 参数
|
||||
LOG_INFO "测试 yasm 命令的 -r help 参数"
|
||||
yasm -r help &> /dev/null
|
||||
CHECK_RESULT $? 0 0 "yasm -r help 参数不支持或执行失败"
|
||||
|
||||
# 清理环境
|
||||
if [[ $NEED_UNINSTALL -eq 1 ]]; then
|
||||
LOG_INFO "卸载 yasm"
|
||||
dnf remove -y yasm
|
||||
CHECK_RESULT $?-0-0"卸载 yas m失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user