diff --git a/suite2cases/function_test/pkg_test/erlang/erlang-dialyzer.json b/suite2cases/function_test/pkg_test/erlang/erlang-dialyzer.json index 202d3319a98..93b0af7ebc3 100644 --- a/suite2cases/function_test/pkg_test/erlang/erlang-dialyzer.json +++ b/suite2cases/function_test/pkg_test/erlang/erlang-dialyzer.json @@ -2,94 +2,14 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/erlang/erlang-dialyzer", "machine num": 1, "cases": [ - { - "name": "test_erlang-dialyzer_dialyzer__add_to_plt", - "desc": "测试使用--add_to_plt参数将文件添加到PLT" - }, - { - "name": "test_erlang-dialyzer_dialyzer__apps", - "desc": "测试使用--apps参数指定应用程序进行分析" - }, - { - "name": "test_erlang-dialyzer_dialyzer__build_plt", - "desc": "测试使用--build_plt参数构建新的PLT" - }, - { - "name": "test_erlang-dialyzer_dialyzer__check_plt", - "desc": "测试使用--check_plt参数检查PLT的一致性" - }, - { - "name": "test_erlang-dialyzer_dialyzer__upper_d", - "desc": "测试使用-D参数定义宏" - }, - { - "name": "test_erlang-dialyzer_dialyzer__dump_callgraph", - "desc": "测试使用--dump_callgraph参数导出调用图" - }, - { - "name": "test_erlang-dialyzer_dialyzer__error_location", - "desc": "测试使用--error_location参数指定错误位置格式" - }, { "name": "test_erlang-dialyzer_dialyzer__fullpath", "desc": "测试使用--fullpath参数显示完整文件路径" }, - { - "name": "test_erlang-dialyzer_dialyzer__get_warnings", - "desc": "测试使用--get_warnings参数获取警告信息" - }, - { - "name": "test_erlang-dialyzer_dialyzer__gui", - "desc": "测试使用--gui参数启动GUI界面" - }, - { - "name": "test_erlang-dialyzer_typer__help", - "desc": "测试 typer 命令的 --help 参数" - }, - { - "name": "test_erlang-dialyzer_typer__version", - "desc": "测试 typer 命令的 --version 参数" - }, - { - "name": "test_erlang-dialyzer_typer__plt", - "desc": "测试 typer 命令的 --plt 参数" - }, { "name": "test_erlang-dialyzer_typer__edoc", "desc": "测试 typer 命令的 --edoc 参数" }, - { - "name": "test_erlang-dialyzer_typer__show", - "desc": "测试 typer 命令的 --show 参数" - }, - { - "name": "test_erlang-dialyzer_typer__show_exported", - "desc": "测试 typer 命令的 --show-exported 参数" - }, - { - "name": "test_erlang-dialyzer_typer__annotate", - "desc": "测试 typer 命令的 --annotate 参数" - }, - { - "name": "test_erlang-dialyzer_typer__annotate_inc_files", - "desc": "测试 typer 命令的 --annotate-inc-files 参数" - }, - { - "name": "test_erlang-dialyzer_typer__annotate_in_place", - "desc": "测试 typer 命令的 --annotate-in-place 参数" - }, - { - "name": "test_erlang-dialyzer_typer__Ddefine", - "desc": "测试 typer 命令的 -Ddefine 参数组合(自定义宏定义)" - }, - { - "name": "test_erlang-dialyzer-typer_-I", - "desc": "测试 typer 命令的 -I include_dir(包含目录)的参数组合" - }, - { - "name": "test_erlang-dialyzer_function_plt_update", - "desc": "测试使用--update_plt参数更新PLT" - }, { "name": "test_erlang-dialyzer_dialyzer__v", "desc": "测试 dialyzer 命令的版本信息输出" @@ -101,42 +21,6 @@ { "name": "test_erlang-dialyzer_dialyzer__q", "desc": "测试 dialyzer 命令的安静模式" - }, - { - "name": "test_erlang-dialyzer_dialyzer__src", - "desc": "测试 dialyzer 命令从 Erlang 源代码进行分析" - }, - { - "name": "test_erlang-dialyzer_dialyzer__o_outfile", - "desc": "测试 dialyzer 命令将分析结果输出到指定文件" - }, - { - "name": "test_erlang-dialyzer_dialyzer__raw", - "desc": "测试 dialyzer 命令输出原始分析结果" - }, - { - "name": "test_erlang-dialyzer_dialyzer__plt_info", - "desc": "测试 dialyzer 命令打印 plt 信息并退出" - }, - { - "name": "test_erlang-dialyzer_dialyzer__remove_from_plt", - "desc": "测试 dialyzer 命令从 plt 中移除指定文件的信息" - }, - { - "name": "test_erlang-dialyzer_typer__show-exported", - "desc": "测试 typer 命令的 --show-exported 参数" - }, - { - "name": "test_erlang-dialyzer_typer__annotate-inc-files", - "desc": "测试 typer 命令的 --annotate-inc-files 参数" - }, - { - "name": "test_erlang-dialyzer_typer__annotate-in-place", - "desc": "测试 typer 命令的 --annotate-in-place 参数" - }, - { - "name": "test_erlang-dialyzer_function_plt_remove", - "desc": "测试使用--remove_from_plt参数从PLT中移除文件" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/h2/h2-javadoc.json b/suite2cases/function_test/pkg_test/h2/h2-javadoc.json index 84ec2353c1d..6633b0d50a5 100644 --- a/suite2cases/function_test/pkg_test/h2/h2-javadoc.json +++ b/suite2cases/function_test/pkg_test/h2/h2-javadoc.json @@ -5,10 +5,6 @@ { "name": "test_h2-javadoc_function_install", "desc": "Test the installation of h2-javadoc package" - }, - { - "name": "test_h2-javadoc_function_search", - "desc": "Test the search functionality of h2-javadoc package" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/libwnck3/libwnck3-help.json b/suite2cases/function_test/pkg_test/libwnck3/libwnck3-help.json index 13ecaa611bd..699d031d947 100644 --- a/suite2cases/function_test/pkg_test/libwnck3/libwnck3-help.json +++ b/suite2cases/function_test/pkg_test/libwnck3/libwnck3-help.json @@ -9,26 +9,6 @@ { "name": "test_libwnck3-help_function_check_installed", "desc": "测试检查libwnck3-help软件包是否已安装,验证包管理器的查询功能。" - }, - { - "name": "test_libwnck3-help_function_install", - "desc": "测试libwnck3-help软件包的安装功能,验证能否通过包管理器成功安装。" - }, - { - "name": "test_libwnck3-help_function_usage", - "desc": "测试libwnck3-help软件包的基本使用功能,验证帮助文档是否正确显示。" - }, - { - "name": "test_libwnck3-help_function_version", - "desc": "测试libwnck3-help软件包的版本查询功能,验证能否正确获取软件包版本信息。" - }, - { - "name": "test_libwnck3-help_function_man_page", - "desc": "测试libwnck3-help软件包的man手册页功能,验证手册页是否存在且内容可访问。" - }, - { - "name": "test_libwnck3-help_function_info_page", - "desc": "测试libwnck3-help软件包的信息页功能,验证info文档是否存在且内容可访问。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/mstflint/mstflint-help.json b/suite2cases/function_test/pkg_test/mstflint/mstflint-help.json index f829117c648..96e9b1c7251 100644 --- a/suite2cases/function_test/pkg_test/mstflint/mstflint-help.json +++ b/suite2cases/function_test/pkg_test/mstflint/mstflint-help.json @@ -2,10 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/mstflint/mstflint-help", "machine num": 1, "cases": [ - { - "name": "test_mstflint-help_function_install", - "desc": "测试使用系统包管理器(如yum或apt)安装mstflint-help软件包是否成功。" - }, { "name": "test_mstflint-help_function_uninstall", "desc": "测试使用系统包管理器卸载mstflint-help软件包,并验证相关文件是否被移除。" @@ -14,10 +10,6 @@ "name": "test_mstflint-help_function_check_install", "desc": "测试使用包管理器查询命令(如rpm -q或dpkg -l)验证mstflint-help软件包是否已正确安装。" }, - { - "name": "test_mstflint-help_function_manpage", - "desc": "测试安装后,mstflint-help的手册页(man page)是否可以正常访问和显示。" - }, { "name": "test_mstflint-help_function_basic_usage", "desc": "测试运行mstflint-help命令,检查其是否能显示基本的帮助信息或版本号。" diff --git a/suite2cases/function_test/pkg_test/python-anyio/python3-anyio.json b/suite2cases/function_test/pkg_test/python-anyio/python3-anyio.json deleted file mode 100644 index 665eb14574d..00000000000 --- a/suite2cases/function_test/pkg_test/python-anyio/python3-anyio.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/python-anyio/python3-anyio", - "machine num": 1, - "cases": [ - { - "name": "test_python3-anyio_function_async", - "desc": "Test basic async functionality" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-pexpect/python3-pexpect.json b/suite2cases/function_test/pkg_test/python-pexpect/python3-pexpect.json index 3a513f6bf54..8b356ccba78 100644 --- a/suite2cases/function_test/pkg_test/python-pexpect/python3-pexpect.json +++ b/suite2cases/function_test/pkg_test/python-pexpect/python3-pexpect.json @@ -2,22 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/python-pexpect/python3-pexpect", "machine num": 1, "cases": [ - { - "name": "test_python3-pexpect_function_spawn", - "desc": "Test spawning a new process" - }, - { - "name": "test_python3-pexpect_function_expect", - "desc": "Test expect pattern matching" - }, - { - "name": "test_python3-pexpect_function_send", - "desc": "Test sending input to process" - }, - { - "name": "test_python3-pexpect_function_interact", - "desc": "Test interactive mode" - }, { "name": "test_python3-pexpect_function_timeout", "desc": "Test timeout handling" diff --git a/suite2cases/function_test/pkg_test/qt5-doc/qt5-qtquickcontrols2-doc.json b/suite2cases/function_test/pkg_test/qt5-doc/qt5-qtquickcontrols2-doc.json deleted file mode 100644 index 5f79ca04c41..00000000000 --- a/suite2cases/function_test/pkg_test/qt5-doc/qt5-qtquickcontrols2-doc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/qt5-doc/qt5-qtquickcontrols2-doc", - "machine num": 1, - "cases": [ - { - "name": "test_qt5-qtquickcontrols2-doc_function_doc_access", - "desc": "Verify access to documentation files" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-d/texlive-cantarell.json b/suite2cases/function_test/pkg_test/texlive-split-d/texlive-cantarell.json deleted file mode 100644 index 581190ac48a..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-d/texlive-cantarell.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-d/texlive-cantarell", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-cantarell_function_install", - "desc": "Test package installation" - }, - { - "name": "test_texlive-cantarell_function_verify_install", - "desc": "Verify package is installed" - }, - { - "name": "test_texlive-cantarell_function_remove", - "desc": "Test package removal" - }, - { - "name": "test_texlive-cantarell_function_font_list", - "desc": "List available Cantarell fonts" - }, - { - "name": "test_texlive-cantarell_function_doc_access", - "desc": "Access package documentation" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-j/texlive-graphics-cfg.json b/suite2cases/function_test/pkg_test/texlive-split-j/texlive-graphics-cfg.json index b7850a8ae86..6b85b90e588 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-j/texlive-graphics-cfg.json +++ b/suite2cases/function_test/pkg_test/texlive-split-j/texlive-graphics-cfg.json @@ -2,33 +2,9 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-j/texlive-graphics-cfg", "machine num": 1, "cases": [ - { - "name": "test_texlive-graphics-cfg_function_config", - "desc": "Test configuration file parsing" - }, { "name": "test_texlive-graphics-cfg_function_install", "desc": "Test package installation" - }, - { - "name": "test_texlive-graphics-cfg_function_uninstall", - "desc": "Test package removal" - }, - { - "name": "test_texlive-graphics-cfg_function_version", - "desc": "Test version query" - }, - { - "name": "test_texlive-graphics-cfg_function_file_list", - "desc": "Test installed file list" - }, - { - "name": "test_texlive-graphics-cfg_function_conf_exist", - "desc": "Test config file presence" - }, - { - "name": "test_texlive-graphics-cfg_function_help", - "desc": "Test help documentation" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-s/texlive-ptex-fonts.json b/suite2cases/function_test/pkg_test/texlive-split-s/texlive-ptex-fonts.json deleted file mode 100644 index ec177f02737..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-s/texlive-ptex-fonts.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-s/texlive-ptex-fonts", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-ptex-fonts_function_uninstall", - "desc": "Test package removal" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/ustr/ustr-help.json b/suite2cases/function_test/pkg_test/ustr/ustr-help.json index c8fba9721e0..35750f9e628 100644 --- a/suite2cases/function_test/pkg_test/ustr/ustr-help.json +++ b/suite2cases/function_test/pkg_test/ustr/ustr-help.json @@ -10,21 +10,9 @@ "name": "test_ustr-help_function_uninstall", "desc": "Test package uninstallation" }, - { - "name": "test_ustr-help_function_basic_usage", - "desc": "Test basic help functionality and command output" - }, { "name": "test_ustr-help_function_version_check", "desc": "Test displaying package version information" - }, - { - "name": "test_ustr-help_function_install_check", - "desc": "Test verification of package installation status" - }, - { - "name": "test_ustr-help_function_man_page", - "desc": "Test accessibility of manual page for the package" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer-typer_-I.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer-typer_-I.sh deleted file mode 100644 index 7b2b696b57c..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer-typer_-I.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : 测试 typer 命令的 -I include_dir(包含目录)的参数组合 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 typer 命令的 -I include_dir(包含目录)的参数组合" - - # 检查软件包是否已安装 - LOG_INFO "检查 erlang-dialyzer-typer 软件包是否已安装" - if ! dnf list installed erlang-dialyzer-typer &> /dev/null; then - LOG_INFO "软件包未安装,准备安装" - # 检查 yum 源中是否有该软件包 - if ! dnf list available erlang-dialyzer-typer &> /dev/null; then - LOG_ERROR "yum 源中未找到 erlang-dialyzer-typer 软件包" - exit 255 - fi - # 安装软件包 - dnf install -y erlang-dialyzer-typer - CHECK_RESULT $? 0 0 "安装 erlang-dialyzer-typer 软件包失败" - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "软件包已安装,无需重复安装" - fi - - # 测试 -I 参数 - LOG_INFO "测试 typer -I include_dir 参数" - TEST_DIR="/tmp/test_include_dir" - mkdir -p $TEST_DIR - CHECK_RESULT $? 0 0 "创建测试目录失败" - - # 执行 typer -I 命令 - LOG_INFO "执行 typer -I $TEST_DIR" - typer -I $TEST_DIR > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "typer -I include_dir 参数测试失败" - - # 清理测试目录 - rm -rf $TEST_DIR - CHECK_RESULT $? 0 0 "清理测试目录失败" - - # 如果之前安装了软件包,则卸载 - if [ "$NEED_UNINSTALL" -eq 1 ]; then - LOG_INFO "卸载 erlang-dialyzer-typer 软件包" - dnf remove -y erlang-dialyzer-typer - CHECK_RESULT $?, -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__add_to_plt.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__add_to_plt.sh deleted file mode 100644 index 3ca2637597b..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__add_to_plt.sh +++ /dev/null @@ -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 : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : 测试使用--add_to_plt参数将文件添加到PLT -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用--add_to_plt参数将文件添加到PLT" - - # 检查是否已安装erlang-dialyzer - LOG_INFO "检查erlang-dialyzer是否已安装" - if dnf list installed erlang-dialyzer &>/dev/null; then - LOG_INFO "erlang-dialyzer已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "erlang-dialyzer未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有erlang-dialyzer - LOG_INFO "检查yum源中是否有erlang-dialyzer" - if ! dnf list available erlang-dialyzer &>/dev/null; then - LOG_ERROR "yum源中未找到erlang-dialyzer软件包" - exit 255 - fi - - # 如果未安装,则安装erlang-dialyzer - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装erlang-dialyzer" - dnf install -y erlang-dialyzer - CHECK_RESULT $? 0 0 "安装erlang-dialyzer失败" - fi - - # 检查--add_to_plt参数是否支持 - LOG_INFO "检查dialyzer是否支持--add_to_plt参数" - if ! dialyzer --help | grep -q -- "--add_to_plt"; then - LOG_ERROR "dialyzer不支持--add_to_plt参数" - exit 255 - fi - - # 创建测试文件用于添加到PLT - LOG_INFO "创建测试文件test_file.erl用于添加到PLT" - echo "-module(test_file)." > test_file.erl - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用--add_to_plt参数将文件添加到PLT - LOG_INFO "使用--add_to_plt参数将test_file.erl添加到PLT" - dialyzer --add_to_plt test_file.erl - CHECK_RESULT $? 0 0 "添加文件到PLT失败" - - # 清理测试文件 - LOG_INFO "清理测试文件test_file.erl" - rm -f test_file.erl - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果脚本开始时未安装erlang-dialyzer,则在测试结束后卸载它 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载erlang-dialyzer" - dnf remove -y erlang-dialyzer - CHECK_RESULT $? 0 0 "卸载erlang-dialyzer失败" - fi - - LOG_INFO "测试完成:成功使用--add_to_plt参数将文件添加到PLT" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__apps.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__apps.sh deleted file mode 100644 index 5384b204256..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__apps.sh +++ /dev/null @@ -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-29 -# @License : Mulan PSL v2 -# @Desc : 测试使用--apps参数指定应用程序进行分析 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用--apps参数指定应用程序进行分析" - - # 检查是否已安装erlang-dialyzer - LOG_INFO "检查erlang-dialyzer是否已安装" - if dnf list installed erlang-dialyzer &>/dev/null; then - LOG_INFO "erlang-dialyzer已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "erlang-dialyzer未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有erlang-dialyzer软件包 - LOG_INFO "检查yum源中是否有erlang-dialyzer软件包" - if ! dnf list available erlang-dialyzer &>/dev/null; then - LOG_ERROR "yum源中未找到erlang-dialyzer软件包" - exit 255 - fi - - # 如果未安装,则安装erlang-dialyzer - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装erlang-dialyzer" - dnf install -y erlang-dialyzer - CHECK_RESULT $? 0 0 "安装erlang-dialyzer失败" - fi - - # 测试--apps参数是否存在或支持 - LOG_INFO "检查--apps参数是否支持" - dialyzer --help | grep -q -- "--apps" - CHECK_RESULT $? 0 0 "--apps参数不支持" - - # 执行测试命令 - LOG_INFO "执行dialyzer --apps参数测试" - dialyzer --apps kernel stdlib - CHECK_RESULT $? 0 0 "dialyzer --apps参数测试失败" - - # 清理环境:如果之前未安装,则卸载erlang-dialyzer - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载erlang-dialyzer" - dnf remove -y erlang-dialyzersudo - CHECK_RESULT $? 0 0 "卸载erlang-dialyzersudo失败" - fi - - LOG_INFO "测试完成:测试使用--apps参数指定应用程序进行分析" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__build_plt.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__build_plt.sh deleted file mode 100644 index 38f35ea2654..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__build_plt.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : 测试使用--build_plt参数构建新的PLT -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试:使用--build_plt参数构建新的PLT" - - # 检查是否已安装erlang-dialyzer - LOG_INFO "检查erlang-dialyzer是否已安装" - if dnf list installed erlang-dialyzer &> /dev/null; then - LOG_INFO "erlang-dialyzer已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "erlang-dialyzer未安装,准备安装" - INSTALLED=false - fi - - # 检查yum源中是否有erlang-dialyzer - LOG_INFO "检查yum源中是否有erlang-dialyzer" - if ! dnf list available erlang-dialyzer &> /dev/null; then - LOG_ERROR "yum源中未找到erlang-dialyzer软件包" - exit 255 - fi - - # 如果未安装,则安装erlang-dialyzer - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装erlang-dialyzer" - dnf install -y erlang-dialyzer - CHECK_RESULT $? 0 0 "安装erlang-dialyzer失败" - fi - - # 检查--build_plt参数是否支持 - LOG_INFO "检查dialyzer是否支持--build_plt参数" - if ! dialyzer --help | grep -q -- "--build_plt"; then - LOG_ERROR "dialyzer不支持--build_plt参数" - exit 255 - fi - - # 使用--build_plt参数构建PLT - LOG_INFO "使用--build_plt参数构建PLT" - dialyzer --build_plt - CHECK_RESULT $? 0 0 "构建PLT失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载erlang-dialyzer" - dnf remove -y erlang-dialyzer - CHECK_RESULT $? 0 0 "卸载erlang-dialyzer失败" - fi - - LOG_INFO "测试完成:使用--build_plt参数构建新的PLT" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__check_plt.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__check_plt.sh deleted file mode 100644 index 0fa4894c5a1..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__check_plt.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : 测试使用--check_plt参数检查PLT的一致性 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试使用--check_plt参数检查PLT的一致性" - - # 检查是否已安装erlang-dialyzer - if ! dnf list installed erlang-dialyzer &>/dev/null; then - LOG_INFO "erlang-dialyzer未安装,将进行安装" - # 检查yum源中是否有erlang-dialyzer - if ! dnf list available erlang-dialyzer &>/dev/null; then - LOG_ERROR "yum源中未找到erlang-dialyzer软件包" - exit 255 - fi - # 安装erlang-dialyzer - dnf install -y erlang-dialyzer - CHECK_RESULT $? 0 0 "安装erlang-dialyzer失败" - INSTALLED=true - else - LOG_INFO "erlang-dialyzer已安装,跳过安装步骤" - INSTALLED=false - fi - - # 检查--check_plt参数是否支持 - LOG_INFO "检查--check_plt参数是否支持" - dialyzer --help | grep -q -- "--check_plt" - CHECK_RESULT $? 0 255 "dialyzer不支持--check_plt参数" - - # 执行dialyzer --check_plt命令 - LOG_INFO "执行dialyzer --check_plt命令" - dialyzer --check_plt - CHECK_RESULT $? 0 0 "dialyzer --check_plt执行失败" - - # 清理环境,如果之前未安装则卸载erlang-dialyzer - if [ "$INSTALLED" = true ]; then - LOG_INFO "卸载erlang-dialyzer" - dnf remove -y erlang-dialyzer - CHECK_RESULT $? 0 0 "卸载erlang-dialyzer失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__dump_callgraph.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__dump_callgraph.sh deleted file mode 100644 index e57f8054487..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__dump_callgraph.sh +++ /dev/null @@ -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-11-29 -# @License : Mulan PSL v2 -# @Desc : 测试使用--dump_callgraph参数导出调用图 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用--dump_callgraph参数导出调用图" - - # 检查是否已安装erlang-dialyzer - LOG_INFO "检查erlang-dialyzer是否已安装" - if dnf list installed erlang-dialyzer &>/dev/null; then - LOG_INFO "erlang-dialyzer已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "erlang-dialyzer未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有erlang-dialyzer - LOG_INFO "检查yum源中是否有erlang-dialyzer" - if ! dnf list available erlang-dialyzer &>/dev/null; then - LOG_ERROR "yum源中未找到erlang-dialyzer软件包" - exit 255 - fi - - # 安装erlang-dialyzer(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装erlang-dialyzer" - dnf install -y erlang-dialyzer - CHECK_RESULT $? 0 0 "安装erlang-dialyzer失败" - fi - - # 检查--dump_callgraph参数是否支持 - LOG_INFO "检查--dump_callgraph参数是否支持" - if ! dialyzer --help | grep -q -- "--dump_callgraph"; then - LOG_ERROR "dialyzer不支持--dump_callgraph参数" - if [ "$INSTALLED" = false ]; then - dnf remove -y erlang-dialyzer - fi - exit 255 - fi - - # 执行dialyzer命令并导出调用图 - LOG_INFO "执行dialyzer命令并导出调用图" - dialyzer --dump_callgraph callgraph.out &>/dev/null - CHECK_RESULT $? 0 0 "导出调用图失败" - - # 检查callgraph.out文件是否存在 - LOG_INFO "检查callgraph.out文件是否存在" - if [ ! -f callgraph.out ]; then - LOG_ERROR "callgraph.out文件未生成" - if [ "$INSTALLED" = false ]; then - dnf remove -y erlang-dialyzer - fi - exit 1 - fi - - # 清理环境 - LOG_INFO "清理环境" - rm -f callgraph.out - - # 如果测试前未安装erlang-dialyzer,则卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载erlang-dialyzers" - dnf remove -y erlangs dialyzers - CHECK_RESULT $? 0 0 "卸载erlan gs dialyzers失败" - fi - - LOG_INF O “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__error_location.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__error_location.sh deleted file mode 100644 index 4f6c523370c..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__error_location.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : 测试使用--error_location参数指定错误位置格式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试:测试使用--error_location参数指定错误位置格式" - - # 检查是否已安装erlang-dialyzer - LOG_INFO "检查erlang-dialyzer是否已安装" - if dnf list installed erlang-dialyzer &>/dev/null; then - LOG_INFO "erlang-dialyzer已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "erlang-dialyzer未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有erlang-dialyzer - LOG_INFO "检查yum源中是否有erlang-dialyzer" - if ! dnf list available erlang-dialyzer &>/dev/null; then - LOG_ERROR "yum源中未找到erlang-dialyzer软件包" - exit 255 - fi - - # 安装erlang-dialyzer(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装erlang-dialyzer" - dnf install -y erlang-dialyzer - CHECK_RESULT $? 0 0 "安装erlang-dialyzer失败" - fi - - # 测试--error_location参数 - LOG_INFO "测试--error_location参数" - dialyzer --error_location format &>/dev/null - CHECK_RESULT $? 0 0 "--error_location参数不支持或执行失败" - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载erlang-dialyzer" - dnf remove -y erlang-dialyzer - CHECK_RESULT $? 0 0 "卸载erlang-dialyzer失败" - fi - - LOG_INFO "测试完成:测试使用--error_location参数指定错误位置格式" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__get_warnings.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__get_warnings.sh deleted file mode 100644 index 2d7122ee83e..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__get_warnings.sh +++ /dev/null @@ -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-29 -# @License : Mulan PSL v2 -# @Desc : 测试使用--get_warnings参数获取警告信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试使用--get_warnings参数获取警告信息" - - LOG_INFO "检查erlang-dialyzer软件包是否已安装" - if ! dnf list installed erlang-dialyzer &>/dev/null; then - LOG_INFO "erlang-dialyzer未安装,准备安装" - LOG_INFO "检查yum源中是否有erlang-dialyzer软件包" - if ! dnf list available erlang-dialyzer &>/dev/null; then - LOG_ERROR "yum源中未找到erlang-dialyzer软件包" - exit 255 - fi - LOG_INFO "安装erlang-dialyzer软件包" - dnf install -y erlang-dialyzer - CHECK_RESULT $? 0 0 "安装erlang-dialyzer失败" - INSTALLED=1 - else - LOG_INFO "erlang-dialyzer已安装,无需重复安装" - INSTALLED=0 - fi - - LOG_INFO "执行dialyzer --get_warnings命令获取警告信息" - dialyzer --get_warnings &>/tmp/dialyzer_output - CHECK_RESULT $? 0 0 "执行dialyzer --get_warnings失败" - - LOG_INFO "验证警告信息是否成功获取" - if [ -s /tmp/dialyzer_output ]; then - LOG_INFO "成功获取警告信息" - else - LOG_ERROR "未获取到警告信息" - exit 1 - fi - - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "清理环境,卸载erlang-dialyzer软件包" - dnf remove -y erlang-dialyzer - CHECK_RESULT $? 0 0 "卸载erlang-dialyzer失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__gui.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__gui.sh deleted file mode 100644 index 079633ed011..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__gui.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : 测试使用--gui参数启动GUI界面 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用--gui参数启动GUI界面" - - # 检查环境是否已安装erlang-dialyzer-dialyzer-gui - LOG_INFO "检查erlang-dialyzer-dialyzer-gui是否已安装" - if dnf list installed erlang-dialyzer-dialyzer-gui &>/dev/null; then - LOG_INFO "erlang-dialyzer-dialyzer-gui已安装" - installed=true - else - LOG_INFO "erlang-dialyzer-dialyzer-gui未安装" - installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有erlang-dialyzer-dialyzer-gui" - if ! dnf list available erlang-dialyzer-dialyzer-gui &>/dev/null; then - LOG_ERROR "yum源中未找到erlang-dialyzer-dialyzer-gui" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装erlang-dialyzer-dialyzer-gui" - dnf install -y erlang-dialyzer-dialyzer-gui - CHECK_RESULT $? 0 0 "安装erlang-dialyzer-dialyzer-gui失败" - fi - - # 测试--gui参数启动GUI界面 - LOG_INFO "测试--gui参数启动GUI界面" - dialyzer --gui - CHECK_RESULT $? 0 0 "使用--gui参数启动GUI界面失败" - - # 如果之前未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载erlang-dialyzer-dial -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__o_outfile.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__o_outfile.sh deleted file mode 100644 index 62d786b0915..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__o_outfile.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-02 -# @License : Mulan PSL v2 -# @Desc : 测试 dialyzer 命令将分析结果输出到指定文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 dialyzer 命令将分析结果输出到指定文件" - - # 检查是否已安装 erlang-dialyzer - if ! dnf list installed erlang-dialyzer &>/dev/null; then - LOG_INFO "环境未安装 erlang-dialyzer,将进行安装" - # 检查 yum 源中是否有 erlang-dialyzer - if ! dnf list available erlang-dialyzer &>/dev/null; then - LOG_ERROR "yum 源中未找到 erlang-dialyzer 软件包" - exit 255 - fi - # 安装 erlang-dialyzer - dnf install -y erlang-dialyzer - CHECK_RESULT $? 0 0 "安装 erlang-dialyzer 失败" - else - LOG_INFO "环境已安装 erlang-dialyzer,跳过安装步骤" - fi - - # 测试 dialyzer 命令将分析结果输出到指定文件 - LOG_INFO "执行 dialyzer --output_file test_output.txt 命令" - dialyzer --output_file test_output.txt - CHECK_RESULT $? 0 0 "dialyzer 命令执行失败" - - # 检查输出文件是否存在 - if [ ! -f test_output.txt ]; then - LOG_ERROR "未生成指定的输出文件 test_output.txt" - exit 1 - else - LOG_INFO "成功生成输出文件 test_output.txt" - fi - - # 清理环境 - if ! dnf list installed erlang-dialyzer &>/dev/null; then - LOG_INFO "清理环境,卸载 erlang-dialyzer" - dnf remove -y erlang-dialyzer - CHECK_RESULT $? 0 0 "卸载 erlang-dialyzer 失败" - else - LOG_INFO "环境保持原有状态,无需卸载 erlang-dialyzer" - fi - - LOG_INFO "测试 dialyzer 命令将分析结果输出到指定文件完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__plt_info.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__plt_info.sh deleted file mode 100644 index 26989c0041b..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__plt_info.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-02 -# @License : Mulan PSL v2 -# @Desc : 测试 dialyzer 命令打印 plt 信息并退出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装erlang-dialyzer - LOG_INFO "检查是否已安装erlang-dialyzer" - if ! dnf list installed erlang-dialyzer &>/dev/null; then - LOG_INFO "erlang-dialyzer未安装,将进行安装" - INSTALLED=false - else - LOG_INFO "erlang-dialyzer已安装" - INSTALLED=true - fi - - # 检查yum源中是否有erlang-dialyzer软件包 - LOG_INFO "检查yum源中是否有erlang-dialyzer软件包" - if ! dnf list available erlang-dialyzer &>/dev/null; then - LOG_ERROR "yum源中未找到erlang-dialyzer软件包" - exit 255 - fi - - # 如果未安装,则安装erlang-dialyzer - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装erlang-dialyzer" - dnf install -y erlang-dialyzer - CHECK_RESULT $? 0 0 "安装erlang-dialyzer失败" - fi - - # 测试dialyzer命令打印plt信息 - LOG_INFO "测试dialyzer命令打印plt信息" - dialyzer --plt_info > /tmp/plt_info.log 2>&1 - CHECK_RESULT $? 0 0 "dialyzer --plt_info执行失败" - - # 检查输出内容是否符合预期 - LOG_INFO "检查dialyzer --plt_info输出内容" - grep -q "PLT information" /tmp/plt_info.log - CHECK_RESULT $? 0 0 "dialyzer --plt_info输出不符合预期" - - # 清理临时文件 - rm -f /tmp/plt_info.log - - # 如果脚本开始时未安装erlang-dialyzer,则在结束时卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载erlang-dialyzer" - dnf remove -y erlang-dialyzers - CHECK_RESULT $? 0 0 "卸载erlang-dialyzers失败" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__raw.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__raw.sh deleted file mode 100644 index 6c0e342d72b..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__raw.sh +++ /dev/null @@ -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-02 -# @License : Mulan PSL v2 -# @Desc : 测试 dialyzer 命令输出原始分析结果 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 dialyzer 命令输出原始分析结果" - - # 检查是否已安装 erlang-dialyzer - LOG_INFO "检查 erlang-dialyzer 是否已安装" - if dnf list installed erlang-dialyzer &>/dev/null; then - LOG_INFO "erlang-dialyzer 已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "erlang-dialyzer 未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查 yum 源中是否有 erlang-dialyzer - LOG_INFO "检查 yum 源中是否有 erlang-dialyzer" - if ! dnf list available erlang-dialyzer &>/dev/null; then - LOG_ERROR "yum 源中未找到 erlang-dialyzer 软件包" - exit 255 - fi - - # 如果未安装,则安装 erlang-dialyzer - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 erlang-dialyzer" - dnf install -y erlang-dialyzer || { - LOG_ERROR "安装 erlang-dialyzer 失败" - exit $? - } - fi - - # 检查 dialyzer 命令是否支持 --raw 参数 - LOG_INFO "检查 dialyzer 命令是否支持 --raw 参数" - if ! dialyzer --help | grep -q -- "--raw"; then - LOG_ERROR "dialyzer 命令不支持 --raw 参数" - exit 255 - fi - - # 执行 dialyzer --raw 命令 - LOG_INFO "执行 dialyzer --raw 命令" - dialyzer --raw - CHECK_RESULT $? 0 0 "dialyzer --raw 命令执行失败" - - # 如果脚本开始时未安装 erlang-dialyzer,则在结束时卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 erlang-dialyzer" - dnf remove -y erlang-dialyzer || { - LOG_ERROR "卸载 erlang-dialyzer 失败" - exit $? - } - fi - - LOG_INFO "测试 dialyzer 命令输出原始分析结果完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__remove_from_plt.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__remove_from_plt.sh deleted file mode 100644 index d0e3b7abbd3..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__remove_from_plt.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-02 -# @License : Mulan PSL v2 -# @Desc : 测试 dialyzer 命令从 plt 中移除指定文件的信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_erlang-dialyzer_dialyzer__remove_from_plt - - LOG_INFO "开始测试 dialyzer 命令从 plt 中移除指定文件的信息" - - # 检查是否已安装 erlang-dialyzer - LOG_INFO "检查 erlang-dialyzer 是否已安装" - if ! dnf list installed erlang-dialyzer &> /dev/null; then - LOG_INFO "erlang-dialyzer 未安装,将进行安装" - INSTALLED=false - else - LOG_INFO "erlang-dialyzer 已安装" - INSTALLED=true - fi - - # 检查 yum 源中是否有 erlang-dialyzer - LOG_INFO "检查 yum 源中是否有 erlang-dialyzer" - if ! dnf list available erlang-dialyzer &> /dev/null; then - LOG_ERROR "yum 源中未找到 erlang-dialyzer,退出测试" - exit 255 - fi - - # 如果未安装,则安装 erlang-dialyzer - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 erlang-dialyzer" - dnf install -y erlang-dialyzer - CHECK_RESULT $? 0 0 "安装 erlang-dialyzer 失败" - fi - - # 检查 dialyzer 命令是否支持 --remove_from_plt 参数 - LOG_INFO "检查 dialyzer 命令是否支持 --remove_from_plt 参数" - if ! dialyzer --help | grep -q -- "--remove_from_plt"; then - LOG_ERROR "dialyzer 命令不支持 --remove_from_plt 参数,退出测试" - exit 255 - fi - - # 创建临时 plt 文件用于测试 - LOG_INFO "创建临时 plt 文件用于测试" - TMP_PLT=$(mktemp) - dialyzer --build_plt --output_plt "$TMP_PLT" &> /dev/null - CHECK_RESULT $? 0 0 "创建临时 plt 文件失败" - - # 添加测试文件到 plt - LOG_INFO "添加测试文件到 plt" - TEST_FILE=$(mktemp).beam - dialyzer --add_to_plt "$TEST_FILE" --plt "$TMP_PLT" &> /dev/null - CHECK_RESULT $? 0 0 "添加测试文件到 plt 失败" - - # 从 plt 中移除指定文件 - LOG_INFO "从 plt 中移除指定文件" - dialyzer --remove_from_plt "$TEST_FILE" --plt "$TMP_PLT" &> /dev/null - CHECK_RESULT $? 0 0 "从 plt 移除指定文件失败" - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f "$TMP_PLT" "$TEST_FILE" - - # 如果最初未安装,则卸载 erlang-dialyze r以恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO 卸载 er lang- dial yze r以恢复环境 - dnf remove -y era ng- dial yze r - CHECK _RESULT $? 0 0 卸载 era ng- dial yze r失败 - fi - - LOG _INFO 测试完成 -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__src.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__src.sh deleted file mode 100644 index ee4540300e3..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__src.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-02 -# @License : Mulan PSL v2 -# @Desc : 测试 dialyzer 命令从 Erlang 源代码进行分析 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装erlang-dialyzer - LOG_INFO "检查erlang-dialyzer是否已安装" - if dnf list installed erlang-dialyzer &>/dev/null; then - LOG_INFO "erlang-dialyzer已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "erlang-dialyzer未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有erlang-dialyzer软件包 - LOG_INFO "检查yum源中是否有erlang-dialyzer软件包" - if ! dnf list available erlang-dialyzer &>/dev/null; then - LOG_ERROR "yum源中未找到erlang-dialyzer软件包" - exit 255 - fi - - # 安装erlang-dialyzer(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装erlang-dialyzer" - dnf install -y erlang-dialyzer - CHECK_RESULT $? 0 0 "安装erlang-dialyzer失败" - fi - - # 测试dialyzer命令从Erlang源代码进行分析 - LOG_INFO "测试dialyzer命令从Erlang源代码进行分析" - dialyzer --src src/*.erl --no_native - CHECK_RESULT $? 0 0 "dialyzer命令执行失败" - - # 清理环境(如果脚本开始时未安装erlang-dialyzer) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载erlang-dialyzer" - dnf remove -y erlang-dialyzer - CHECK_RESULT $? 0 0 "卸载erlang-dialyzer失败" - fi - - LOG_INFO "测试脚本执行完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__upper_d.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__upper_d.sh deleted file mode 100644 index 220826dccea..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_dialyzer__upper_d.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : 测试使用-D参数定义宏 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装erlang-dialyzer - LOG_INFO "检查是否已安装erlang-dialyzer" - if dnf list installed erlang-dialyzer &>/dev/null; then - LOG_INFO "erlang-dialyzer已安装" - INSTALLED=true - else - LOG_INFO "erlang-dialyzer未安装" - INSTALLED=false - fi - - # 检查yum源中是否有erlang-dialyzer软件包 - LOG_INFO "检查yum源中是否有erlang-dialyzer软件包" - if ! dnf list available erlang-dialyzer &>/dev/null; then - LOG_ERROR "yum源中未找到erlang-dialyzer软件包" - exit 255 - fi - - # 如果未安装,则安装erlang-dialyzer - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装erlang-dialyzer" - dnf install -y erlang-dialyzer - CHECK_RESULT $? 0 0 "安装erlang-dialyzer失败" - fi - - # 测试使用-D参数定义宏 - LOG_INFO "测试使用-D参数定义宏" - dialyzer --help | grep -q -- "-D" - CHECK_RESULT $? 0 0 "-D参数不支持" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载erlang-dialyzer" - dnf remove -y erlang-dialyzer - CHECK_RESULT $? 0 0 "卸载erlang-dialyzer失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_function_plt_remove.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_function_plt_remove.sh deleted file mode 100644 index 5034e45b137..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_function_plt_remove.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-02 -# @License : Mulan PSL v2 -# @Desc : 测试使用--remove_from_plt参数从PLT中移除文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用--remove_from_plt参数从PLT中移除文件" - - # 检查是否已安装erlang-dialyzer - if ! dnf list installed erlang-dialyzer &>/dev/null; then - LOG_INFO "环境未安装erlang-dialyzer,将进行安装" - # 检查yum源中是否有erlang-dialyzer - if ! dnf list available erlang-dialyzer &>/dev/null; then - LOG_ERROR "yum源中未找到erlang-dialyzer软件包" - exit 255 - fi - # 安装erlang-dialyzer - dnf install -y erlang-dialyzer - CHECK_RESULT $? 0 0 "安装erlang-dialyzer失败" - INSTALLED=1 - else - LOG_INFO "环境已安装erlang-dialyzer,跳过安装步骤" - INSTALLED=0 - fi - - # 检查--remove_from_plt参数是否支持 - LOG_INFO "检查--remove_from_plt参数是否支持" - dialyzer --help | grep -- "--remove_from_plt" &>/dev/null - CHECK_RESULT $? 0 255 "dialyzer不支持--remove_from_plt参数" - - # 创建测试PLT文件 - LOG_INFO "创建测试PLT文件" - TEST_PLT="/tmp/test.plt" - dialyzer --build_plt --output_plt "$TEST_PLT" &>/dev/null - CHECK_RESULT $? 0 0 "创建PLT文件失败" - - # 从PLT中移除文件 - LOG_INFO "从PLT中移除文件" - dialyzer --remove_from_plt "$TEST_PLT" &>/dev/null - CHECK_RESULT $? 0 0 "从PLT中移除文件失败" - - # 清理测试PLT文件 - LOG_INFO "清理测试PLT文件" - rm -f "$TEST_PLT" - - # 如果脚本安装了软件包,则卸载 - if [ "$INSTALLED" -eq 1 ]; then - LOG_INFO "卸载erlang-dialyzer" - dnf remove -y erlang-dialyzer - CHECK_RESULT $? 0 0 "卸载erlang-dialyzer失败" - fi - - LOG_INFO "测试完成:成功测试使用--remove_from_plt参数从PLT中移除文件" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_function_plt_update.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_function_plt_update.sh deleted file mode 100644 index 7530d860ea6..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_function_plt_update.sh +++ /dev/null @@ -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-11-29 -# @License : Mulan PSL v2 -# @Desc : 测试使用--update_plt参数更新PLT -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装erlang-dialyzer - LOG_INFO "检查erlang-dialyzer是否已安装" - if ! dnf list installed erlang-dialyzer &> /dev/null; then - LOG_INFO "erlang-dialyzer未安装,开始安装" - # 检查yum源中是否有erlang-dialyzer - if ! dnf list available erlang-dialyzer &> /dev/null; then - LOG_ERROR "yum源中未找到erlang-dialyzer软件包" - exit 255 - fi - dnf install -y erlang-dialyzer - CHECK_RESULT $? 0 0 "安装erlang-dialyzer失败" - # 标记需要卸载 - UNINSTALL_NEEDED=1 - else - LOG_INFO "erlang-dialyzer已安装" - UNINSTALL_NEEDED=0 - fi - - # 测试--update_plt参数更新PLT - LOG_INFO "测试使用--update_plt参数更新PLT" - dialyzer --update_plt - CHECK_RESULT $? 0 0 "--update_plt参数更新PLT失败" - - # 清理环境 - if [ $UNINSTALL_NEEDED -eq 1 ]; then - LOG_INFO "卸载erlang-dialyzer" - dnf remove -y erlang-dialyzer - CHECK_RESULT $? 0 0 "卸载erlang-dialyzer失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__Ddefine.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__Ddefine.sh deleted file mode 100644 index 94595369401..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__Ddefine.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : 测试 typer 命令的 -Ddefine 参数组合(自定义宏定义) -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 typer 命令的 -Ddefine 参数组合(自定义宏定义)" - - # 检查是否已安装 erlang-dialyzer-typer 软件包 - LOG_INFO "检查 erlang-dialyzer-typer 是否已安装" - if dnf list installed erlang-dialyzer-typer &>/dev/null; then - LOG_INFO "erlang-dialyzer-typer 已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "erlang-dialyzer-typer 未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查 yum 源中是否有 erlang-dialyzer-typer 软件包 - LOG_INFO "检查 yum 源中是否有 erlang-dialyzer-typer 软件包" - if ! dnf list available erlang-dialyzer-typer &>/dev/null; then - LOG_ERROR "yum 源中未找到 erlang-dialyzer-typer 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 erlang-dialyzer-typer" - dnf install -y erlang-dialyzer-typer - CHECK_RESULT $? 0 0 "安装 erlang-dialyzer-typer 失败" - fi - - # 测试 typer 命令的 -Ddefine 参数组合 - LOG_INFO "测试 typer 命令的 -Ddefine 参数组合" - typer -Ddefine TEST_MACRO test_module.erl - CHECK_RESULT $? 0 0 "typer -Ddefine 参数组合执行失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载 erlang-dialyzer-typer" - dnf remove -y erlang-dialyzer-typer - CHECK_RESULT $? 0 0 "卸载 erlang-dialyzer-typer 失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__annotate-in-place.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__annotate-in-place.sh deleted file mode 100644 index b1d7aceaf15..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__annotate-in-place.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-02 -# @License : Mulan PSL v2 -# @Desc : 测试 typer 命令的 --annotate-in-place 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在erlang-dialyzer-typer软件包 - LOG_INFO "检查yum源中是否存在erlang-dialyzer-typer软件包" - dnf list available erlang-dialyzer-typer &> /dev/null - CHECK_RESULT $? 0 255 "yum源中不存在erlang-dialyzer-typer软件包" - - # 检查是否已安装erlang-dialyzer-typer - LOG_INFO "检查是否已安装erlang-dialyzer-typer" - if rpm -q erlang-dialyzer-typer &> /dev/null; then - LOG_INFO "erlang-dialyzer-typer已安装,脚本结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "erlang-dialyzer-typer未安装,将在测试后卸载" - INSTALLED=false - fi - - # 若未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装erlang-dialyzer-typer软件包" - dnf install -y erlang-dialyzer-typer - CHECK_RESULT $? 0 0 "安装erlang-dialyzer-typer失败" - fi - - # 测试typer命令的--annotate-in-place参数 - LOG_INFO "测试typer命令的--annotate-in-place参数" - TEST_FILE="test_file.erl" - cat > $TEST_FILE < ok. - EOF - - typer --annotate-in-place $TEST_FILE - CHECK_RESULT $? 0 255 "typer命令的--annotate-in-place参数不支持或执行失败" - - # 清理测试文件 - rm -f $TEST_FILE - - # 若脚本开始时未安装,则在结束时卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载erlang-dialyzer-typer软件包" - dnf remove -y erlang-dialyzer-typer - CHECK_RESULT $? 0 0 "卸载erlang-dialyzer-typer失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__annotate-inc-files.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__annotate-inc-files.sh deleted file mode 100644 index d111a9a42c4..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__annotate-inc-files.sh +++ /dev/null @@ -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 : 2025-12-02 -# @License : Mulan PSL v2 -# @Desc : 测试 typer 命令的 --annotate-inc-files 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 typer 命令的 --annotate-inc-files 参数" - - # 检查是否已安装 erlang-dialyzer 和 erlang-typer - LOG_INFO "检查 erlang-dialyzer 和 erlang-typer 是否已安装" - if ! dnf list installed erlang-dialyzer &>/dev/null || ! dnf list installed erlang-typer &>/dev/null; then - LOG_INFO "erlang-dialyzer 或 erlang-typer 未安装,将进行安装" - # 检查 yum 源中是否有软件包 - if ! dnf list available erlang-dialyzer &>/dev/null || ! dnf list available erlang-typer &>/dev/null; then - LOG_ERROR "yum 源中未找到 erlang-dialyzer 或 erlang-typer 软件包" - exit 255 - fi - # 安装软件包 - dnf install -y erlang-dialyzer erlang-typer - CHECK_RESULT $? 0 0 "安装 erlang-dialyzer 和 erlang-typer 失败" - # 标记需要卸载 - UNINSTALL=1 - else - LOG_INFO "erlang-dialyzer 和 erlang-typer 已安装,无需重复安装" - UNINSTALL=0 - fi - - # 测试 typer 命令的 --annotate-inc-files 参数 - LOG_INFO "测试 typer 命令的 --annotate-inc-files 参数" - typer --help | grep -q -- "--annotate-inc-files" - if [ $? -ne 0 ]; then - LOG_ERROR "typer 命令不支持 --annotate-inc-files 参数" - exit_cleanup 255 - fi - - # 创建一个测试文件 - LOG_INFO "创建测试文件 test.erl" - cat <test.erl - -module(test). - -export([foo/1]). - foo(X) -> X + X. - EOF - - #使用 typer 命令的 --annotate-inc-files参数进行测试 - LOG_INFO "执行 typer --annotate-inc-files test.erl" - typer --annotate-inc-files test.erl - CHECK_RESULT $? 0 0 "执行 typer --annotate-inc-files test.erl 失败" - - # 清理测试文件 - LOG_INFO "清理测试文件 test.erl" - rm -f test.erl - - #恢复环境 - if [ $UNINSTALL -eq 1 ]; then - LOG_INFO"卸载 erlan g-dialyz e r和 erlan g-typ e r " - dnf remove -y e rlan g-dialyz e r e rlan g-typ e r - CHECK_RESULT $ ? 0 0 “卸载 e rlan g-dialyz e r和e rlan g-type失败” - fi - - LOG_INFO“测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__annotate.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__annotate.sh deleted file mode 100644 index 5f86a054d49..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__annotate.sh +++ /dev/null @@ -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 : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : 测试 typer 命令的 --annotate 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 typer 命令的 --annotate 参数" - - # 检查是否已安装 erlang-dialyzer-typer 软件包 - LOG_INFO "检查 erlang-dialyzer-typer 是否已安装" - if dnf list installed erlang-dialyzer-typer &>/dev/null; then - LOG_INFO "erlang-dialyzer-typer 已安装,脚本结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "erlang-dialyzer-typer 未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 erlang-dialyzer-typer 软件包 - LOG_INFO "检查 yum 源中是否存在 erlang-dialyzer-typer 软件包" - if ! dnf list available erlang-dialyzer-typer &>/dev/null; then - LOG_ERROR "yum 源中未找到 erlang-dialyzer-typer 软件包" - exit 255 - fi - - # 安装 erlang-dialyzer-typer 软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 erlang-dialyzer-typer 软件包" - dnf install -y erlang-dialyzer-typer - CHECK_RESULT $? 0 0 "安装 erlang-dialyzer-typer 失败" - fi - - # 检查 typer --annotate 参数是否支持 - LOG_INFO "检查 typer --annotate 参数是否支持" - if ! typer --help | grep -q -- "--annotate"; then - LOG_ERROR "typer 命令不支持 --annotate 参数" - if [ "$INSTALLED" = false ]; then - dnf remove -y erlang-dialyzer-typer - CHECK_RESULT $? 0 0 "卸载 erlang-dialyzer-typer 失败" - fi - exit 255 - fi - - # 测试 typer --annotate 功能 - LOG_INFO 执行 typer --annotate 测试" - touch test_module.erl && echo "-module(test_module)." > test_module.erl - ty_per--anno_tate test_module.erl - CHECK_RESULT $? 0 0 "执行 ty_per--anno_tate 失败" - - # 清理临时文件 - rm -f test_module.erl - - # 恢复环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO 卸载之前临时安装的er_lang-dia_lyzer-_typ_er 软件包" - dnf remove -y era_ng-dia_lyzr-_typ_r - CHEcK_RESULT $? 0 0 "卸载 era_ng-dia_lyzr-_typ_r失败" - fi - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__annotate_in_place.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__annotate_in_place.sh deleted file mode 100644 index 4d803ea4e6a..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__annotate_in_place.sh +++ /dev/null @@ -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 : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : 测试 typer 命令的 --annotate-in-place 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装erlang-dialyzer和typer - LOG_INFO "检查是否已安装erlang-dialyzer和typer" - if ! dnf list installed erlang-dialyzer &> /dev/null || ! dnf list installed erlang-typer &> /dev/null; then - LOG_INFO "未安装erlang-dialyzer或erlang-typer,开始安装" - if ! dnf list available erlang-dialyzer &> /dev/null || ! dnf list available erlang-typer &> /dev/null; then - LOG_ERROR "yum源中未找到erlang-dialyzer或erlang-typer软件包" - exit 255 - fi - dnf install -y erlang-dialyzer erlang-typer - CHECK_RESULT $? 0 0 "安装erlang-dialyzer或erlang-typer失败" - INSTALLED=true - else - LOG_INFO "erlang-dialyzer和erlang-typer已安装" - INSTALLED=false - fi - - # 测试typer命令的--annotate-in-place参数 - LOG_INFO "测试typer命令的--annotate-in-place参数" - TEST_FILE="test_annotate.erl" - cat > $TEST_FILE < ok. - EOF - - # 检查--annotate-in-place参数是否存在 - LOG_INFO "检查--annotate-in-place参数是否支持" - if ! typer --help | grep -q -- "--annotate-in-place"; then - LOG_ERROR "--annotate-in-place参数不支持" - rm -f $TEST_FILE - if [ "$INSTALLED" = "true" ]; then - dnf remove -y erlang-dialyzer erlang-typer - CHECK_RESULT $? 0 0 "卸载erlang-dialyzer或erlang-typer失败" - fi - exit 255 - fi - - # 执行typer命令并检查结果 - LOG_INFO "执行typer命令" - typer --annotate-in-place $TEST_FILE - CHECK_RESULT $? 0 0 "typer命令执行失败" - - # 清理测试文件 - rm -f $TEST_FILE - - # 恢复环境(如果脚本安装了软件包则卸载) - if [ "$INSTALLED" = "true" ]; then - LOG_INFO "卸载erlang-dialyzer和erlang-typer" - dnf remove -y erlang-dialyzer erlang-typer - CHECK_RESULT $? 0 0 "卸载erlang-dialyzer或erlang-typer失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__annotate_inc_files.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__annotate_inc_files.sh deleted file mode 100644 index d59a1d7534c..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__annotate_inc_files.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : 测试 typer 命令的 --annotate-inc-files 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装erlang-dialyzer-typer软件包 - LOG_INFO "检查erlang-dialyzer-typer是否已安装" - if dnf list installed erlang-dialyzer-typer &>/dev/null; then - LOG_INFO "erlang-dialyzer-typer已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "erlang-dialyzer-typer未安装,准备安装" - INSTALLED=false - fi - - # 检查yum源中是否有erlang-dialyzer-typer软件包 - LOG_INFO "检查yum源中是否存在erlang-dialyzer-typer" - if ! dnf list available erlang-dialyzer-typer &>/dev/null; then - LOG_ERROR "yum源中未找到erlang-dialyzer-typer软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装erlang-dialyzer-typer" - dnf install -y erlang-dialyzer-typer - CHECK_RESULT $? 0 0 "安装erlang-dialyzer-typer失败" - fi - - # 测试typer命令的--annotate-inc-files参数 - LOG_INFO "测试typer命令的--annotate-inc-files参数" - if ! typer --help | grep -q -- "--annotate-inc-files"; then - LOG_ERROR "typer命令不支持--annotate-inc-files参数" - exit 255 - fi - - # 执行测试命令并检查结果 - LOG_INFO "执行测试命令" - touch test.erl # 创建测试文件 - CHECK_RESULT $? 0 0 "创建测试文件失败" - - LOG_INFO "运行typer --annotate-inc-files test.erl" - typer --annotate-inc-files test.erl - CHECK_RESULT $? 0 0 "执行typer命令失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.erl - CHECK_RESULT $? 0 0 "删除测试文件失败" - - # 如果脚本开始时未安装软件包,则在结束时卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载erlang-dialyzer-typer" - dnf remove -y erlang-dialyzer-typer - CHECK_RESULT $? 0 0 "卸载erlang-dialyzer-typer失败" - fi - - LOG_INFO "测试脚本执行完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__help.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__help.sh deleted file mode 100644 index c00e5fd5ad2..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__help.sh +++ /dev/null @@ -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-11-29 -# @License : Mulan PSL v2 -# @Desc : 测试 typer 命令的 --help 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 typer 命令的 --help 参数" - - # 检查环境是否已安装 erlang-dialyzer-typer 软件包 - LOG_INFO "检查 erlang-dialyzer-typer 是否已安装" - if ! dnf list installed erlang-dialyzer-typer &>/dev/null; then - LOG_INFO "erlang-dialyzer-typer 未安装,将进行安装" - # 检查 yum 源中是否有该软件包 - if ! dnf list available erlang-dialyzer-typer &>/dev/null; then - LOG_ERROR "yum 源中未找到 erlang-dialyzer-typer 软件包" - exit 255 - fi - # 安装软件包 - dnf install -y erlang-dialyzer-typer - CHECK_RESULT $? 0 0 "安装 erlang-dialyzer-typer 失败" - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "erlang-dialyzer-typer 已安装,无需重新安装" - fi - - # 测试 typer --help 参数 - LOG_INFO "测试 typer --help 参数" - typer --help &>/dev/null - CHECK_RESULT $? 0 0 "typer --help 执行失败" - - # 清理环境 - if [[ $NEED_UNINSTALL -eq 1 ]]; then - LOG_INFO "卸载 erlang-dialyzer-typer" - dnf remove -y erlang-dialyzer-typer - CHECK_RESULT $? 0 0 "卸载 erlang-dialyzer-typer 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__plt.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__plt.sh deleted file mode 100644 index c99813d4557..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__plt.sh +++ /dev/null @@ -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-29 -# @License : Mulan PSL v2 -# @Desc : 测试 typer 命令的 --plt 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 typer 命令的 --plt 参数" - - # 检查是否已安装 erlang-dialyzer-typer 软件包 - LOG_INFO "检查 erlang-dialyzer-typer 是否已安装" - if dnf list installed erlang-dialyzer-typer &>/dev/null; then - LOG_INFO "erlang-dialyzer-typer 已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "erlang-dialyzer-typer 未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 erlang-dialyzer-typer 软件包 - LOG_INFO "检查 yum 源中是否存在 erlang-dialyzer-typer" - if ! dnf list available erlang-dialyzer-typer &>/dev/null; then - LOG_ERROR "yum 源中未找到 erlang-dialyzer-typer 软件包" - exit 255 - fi - - # 安装 erlang-dialyzer-typer - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 erlang-dialyzer-typer" - dnf install -y erlang-dialyzer-typer &>/dev/null - CHECK_RESULT $? 0 0 "安装 erlang-dialyzer-typer 失败" - fi - - # 测试 typer 命令的 --plt 参数 - LOG_INFO "测试 typer 命令的 --plt 参数" - typer --plt &>/dev/null - CHECK_RESULT $? 0 0 "--plt 参数不支持或执行失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载 erlang-dialyzer-typer" - dnf remove -y erlang-dialyzer-typer &>/dev/null - CHECK_RESULT $? 0 0 "卸载 erlang-dialyzer-typer失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__show-exported.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__show-exported.sh deleted file mode 100644 index 908a17b41bf..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__show-exported.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-02 -# @License : Mulan PSL v2 -# @Desc : 测试 typer 命令的 --show-exported 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装erlang-dialyzer和typer - LOG_INFO "检查是否已安装erlang-dialyzer和typer" - if ! dnf list installed erlang-dialyzer &> /dev/null || ! dnf list installed erlang-typer &> /dev/null; then - LOG_INFO "未安装erlang-dialyzer或erlang-typer,将进行安装" - # 检查yum源中是否有erlang-dialyzer和erlang-typer - if ! dnf list available erlang-dialyzer &> /dev/null || ! dnf list available erlang-typer &> /dev/null; then - LOG_ERROR "yum源中未找到erlang-dialyzer或erlang-typer" - exit 255 - fi - # 安装软件包 - dnf install -y erlang-dialyzer erlang-typer - CHECK_RESULT $? 0 0 "安装erlang-dialyzer或erlang-typer失败" - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "已安装erlang-dialyzer和erlang-typer" - NEED_UNINSTALL=0 - fi - - # 测试typer命令的--show-exported参数 - LOG_INFO "测试typer命令的--show-exported参数" - typer --show-exported &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "typer命令不支持--show-exported参数" - # 恢复环境 - if [ $NEED_UNINSTALL -eq 1 ]; then - dnf remove -y erlang-dialyzer erlang-typer - CHECK_RESULT $? 0 0 "卸载erlang-dialyzer或erlang-typer失败" - fi - exit 255 - fi - - # 执行具体测试逻辑 - LOG_INFO "执行具体测试逻辑" - - # 清理环境 - if [ $NEED_UNINSTALL -eq 1 ]; then - LOG_INFO "卸载临时安装的软件包" - dnf remove -y erlang-dialyzer erlang-typer - CHECK_RESULT $? 0 0 "卸载erlang-dialyzer或erlang-typer失败" - fi - - LOG_INFO "测试完成" - exit 0 - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__show.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__show.sh deleted file mode 100644 index c77f6c9503f..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__show.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : 测试 typer 命令的 --show 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试脚本:test_erlang-dialyzer_typer__show - - LOG_INFO "开始测试 typer 命令的 --show 参数" - - # 检查是否已安装 erlang-dialyzer 和 erlang-typer - LOG_INFO "检查 erlang-dialyzer 和 erlang-typer 是否已安装" - if ! dnf list installed erlang-dialyzer &> /dev/null || ! dnf list installed erlang-typer &> /dev/null; then - LOG_INFO "未安装 erlang-dialyzer 或 erlang-typer,开始安装" - if ! dnf search erlang-dialyzer &> /dev/null || ! dnf search erlang-typer &> /dev/null; then - LOG_ERROR "yum 源中未找到 erlang-dialyzer 或 erlang-typer 软件包" - exit 255 - fi - dnf install -y erlang-dialyzer erlang-typer - CHECK_RESULT $? 0 0 "安装 erlang-dialyzer 或 erlang-typer 失败" - INSTALLED=true - else - LOG_INFO "erlang-dialyzer 和 erlang-typer 已安装" - INSTALLED=false - fi - - # 测试 typer --show 参数 - LOG_INFO "测试 typer --show 参数" - if ! typer --help | grep -q -- "--show"; then - LOG_ERROR "typer 命令不支持 --show 参数" - if [ "$INSTALLED" = false ]; then - dnf remove -y erlang-dialyzer erlang-typer - CHECK_RESULT $? 0 0 "卸载 erlang-dialyzer 或 erlang-typer 失败" - fi - exit 255 - fi - - typer --show - CHECK_RESULT $? 0 0 "执行 typer --show 失败" - - #清理环境 - if [ "$INSTALLED" = true ]; then - LOG_INFO "卸载临时安装的软件包" - dnf remove -y erlang-dialyzer erlang-typer - CHECK_RESULT $? - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__show_exported.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__show_exported.sh deleted file mode 100644 index 5e14f5790cd..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__show_exported.sh +++ /dev/null @@ -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-11-29 -# @License : Mulan PSL v2 -# @Desc : 测试 typer 命令的 --show-exported 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 typer 命令的 --show-exported 参数" - - # 检查是否已安装 erlang-dialyzer 和 erlang-typer - LOG_INFO "检查 erlang-dialyzer 和 erlang-typer 是否已安装" - if ! dnf list installed erlang-dialyzer &>/dev/null || ! dnf list installed erlang-typer &>/dev/null; then - LOG_INFO "erlang-dialyzer 或 erlang-typer 未安装,将进行安装" - # 检查 yum 源中是否有该软件包 - if ! dnf list available erlang-dialyzer &>/dev/null || ! dnf list available erlang-typer &>/dev/null; then - LOG_ERROR "yum 源中未找到 erlang-dialyzer 或 erlang-typer,退出测试" - exit 255 - fi - # 安装软件包 - dnf install -y erlang-dialyzer erlang-typer - CHECK_RESULT $? 0 0 "安装 erlang-dialyzer 或 erlang-typer 失败" - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "erlang-dialyzer 和 erlang-typer 已安装,无需重复安装" - NEED_UNINSTALL=0 - fi - - # 测试 typer 命令的 --show-exported 参数 - LOG_INFO "测试 typer --show-exported" - typer --show-exported &>/dev/null - CHECK_RESULT $? 0 0 "typer --show-exported 执行失败" - - # 清理环境 - if [ $NEED_UNINSTALL -eq 1 ]; then - LOG_INFO "卸载 erlang-dialyzer 和 erlang-typer" - dnf remove -y erlang-dialyzer erlang-typer - CHECK_RESULT $? 0 0 "卸载 erlang-dialyzer 或 erlang-typer失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__version.sh b/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__version.sh deleted file mode 100644 index 9b4cd01ccf5..00000000000 --- a/testcases/function_test/pkg_test/erlang/erlang-dialyzer/test_erlang-dialyzer_typer__version.sh +++ /dev/null @@ -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-29 -# @License : Mulan PSL v2 -# @Desc : 测试 typer 命令的 --version 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 typer 命令的 --version 参数" - - # 检查是否已安装 erlang-dialyzer 和 erlang-typer - LOG_INFO "检查 erlang-dialyzer 和 erlang-typer 是否已安装" - if ! dnf list installed erlang-dialyzer &>/dev/null || ! dnf list installed erlang-typer &>/dev/null; then - LOG_INFO "erlang-dialyzer 或 erlang-typer 未安装,开始安装" - # 检查 yum 源中是否有软件包 - if ! dnf list available erlang-dialyzer &>/dev/null || ! dnf list available erlang-typer &>/dev/null; then - LOG_ERROR "yum 源中未找到 erlang-dialyzer 或 erlang-typer 软件包" - exit 255 - fi - # 安装软件包 - dnf install -y erlang-dialyzer erlang-typer - CHECK_RESULT $? 0 0 "安装 erlang-dialyzer 或 erlang-typer 失败" - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "erlang-dialyzer 和 erlang-typer 已安装,无需重复安装" - NEED_UNINSTALL=0 - fi - - # 测试 typer 命令的 --version 参数 - LOG_INFO "测试 typer 命令的 --version 参数" - typer --version &>/dev/null - CHECK_RESULT $? 0 0 "typer 命令的 --version 参数不支持或执行失败" - - # 清理环境 - if [ "$NEED_UNINSTALL" -eq 1 ]; then - LOG_INFO "卸载临时安装的软件包" - dnf remove -y erlang-dialyzer erlang-typer - CHECK_RESULT $? -1 -1 "卸载软件包失败" # 允许卸载失败(如依赖问题) - fi - - LOG_INFO "测试完成,环境已恢复" - - exit $? - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/h2/h2-javadoc/test_h2-javadoc_function_search.sh b/testcases/function_test/pkg_test/h2/h2-javadoc/test_h2-javadoc_function_search.sh deleted file mode 100644 index e551a9a2a52..00000000000 --- a/testcases/function_test/pkg_test/h2/h2-javadoc/test_h2-javadoc_function_search.sh +++ /dev/null @@ -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 : Test the search functionality of h2-javadoc package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查h2-javadoc软件包是否已安装 - LOG_INFO "检查h2-javadoc软件包是否已安装" - if rpm -q h2-javadoc &>/dev/null; then - LOG_INFO "h2-javadoc软件包已安装" - installed=true - else - LOG_INFO "h2-javadoc软件包未安装" - installed=false - fi - - # 检查yum源中是否有h2-javadoc软件包 - LOG_INFO "检查yum源中是否有h2-javadoc软件包" - if ! dnf list available h2-javadoc &>/dev/null; then - LOG_ERROR "yum源中未找到h2-javadoc软件包" - exit 255 - fi - - # 如果未安装,则安装h2-javadoc软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装h2-javadoc软件包" - dnf install -y h2-javadoc - CHECK_RESULT $? 0 0 "安装h2-javadoc软件包失败" - fi - - # 测试h2-javadoc的搜索功能 - LOG_INFO "测试h2-javadoc的搜索功能" - javadoc -search h2-javadoc &>/dev/null - CHECK_RESULT $? 0 0 "h2-javadoc搜索功能测试失败" - - # 如果之前未安装,则卸载h2-javadoc软件包以恢复环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载h2-javadoc软件包以恢复环境" - dnf remove -y h2-javadoc - CHECK_RESULT $? 0 0 "卸载h2-javadoc软件包失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libwnck3/libwnck3-help/test_libwnck3-help_function_info_page.sh b/testcases/function_test/pkg_test/libwnck3/libwnck3-help/test_libwnck3-help_function_info_page.sh deleted file mode 100644 index 01bc210d1d1..00000000000 --- a/testcases/function_test/pkg_test/libwnck3/libwnck3-help/test_libwnck3-help_function_info_page.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-26 -# @License : Mulan PSL v2 -# @Desc : 测试libwnck3-help软件包的信息页功能,验证info文档是否存在且内容可访问。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境初始化检查 - LOG_INFO "开始测试libwnck3-help软件包的信息页功能" - - # 检查是否已安装libwnck3-help - LOG_INFO "检查libwnck3-help是否已安装" - rpm -q libwnck3-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到libwnck3-help已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "未检测到libwnck3-help安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有libwnck3-help软件包 - LOG_INFO "检查yum源中是否存在libwnck3-help软件包" - dnf list available libwnck3-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到libwnck3-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "开始安装libwnck3-help软件包" - dnf install -y libwnck3-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装libwnck3-help失败" - LOG_INFO "libwnck3-help安装成功" - fi - - # 检查info文档是否存在 - LOG_INFO "检查libwnck3-help的info文档是否存在" - info --where libwnck3 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "libwnck3-help info文档不存在" - - # 验证info文档内容可访问 - LOG_INFO "验证libwnck3-help info文档内容可访问" - info libwnck3 --output=/tmp/libwnck3-info-test.txt > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "无法访问libwnck3-help info文档内容" - - # 检查info文档是否有实际内容 - LOG_INFO "检查info文档是否有实际内容" - if [ -s /tmp/libwnck3-info-test.txt ]; then - LOG_INFO "info文档内容检查通过,文档非空" - # 检查是否包含关键词 - grep -q "Window Navigator Construction Kit" /tmp/libwnck3-info-test.txt - CHECK_RESULT $? 0 0 "info文档内容不符合预期" - else - LOG_ERROR "info文档内容为空" - rm -f /tmp/libwnck3-info-test.txt - exit 1 - fi - - # 清理临时文件 - rm -f /tmp/libwnck3-info-test.txt - LOG_INFO "临时文件清理完成" - - # 环境恢复 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "开始卸载libwnck3-help软件包" - dnf remove -y libwnck3-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载libwnck3-help失败" - LOG_INFO "libwnck3-help卸载成功,环境已恢复" - else - LOG_INFO "保持libwnck3-help安装状态,环境未改变" - fi - - LOG_INFO "libwnck3-help软件包信息页功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libwnck3/libwnck3-help/test_libwnck3-help_function_install.sh b/testcases/function_test/pkg_test/libwnck3/libwnck3-help/test_libwnck3-help_function_install.sh deleted file mode 100644 index 1676d9c3b48..00000000000 --- a/testcases/function_test/pkg_test/libwnck3/libwnck3-help/test_libwnck3-help_function_install.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-26 -# @License : Mulan PSL v2 -# @Desc : 测试libwnck3-help软件包的安装功能,验证能否通过包管理器成功安装。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试libwnck3-help软件包的安装功能" - LOG_INFO "步骤1:检查当前环境中是否已安装libwnck3-help软件包" - rpm -q libwnck3-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到libwnck3-help软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "未检测到libwnck3-help软件包,测试过程中将执行安装操作" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查yum源中是否存在libwnck3-help软件包" - dnf list available libwnck3-help > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到libwnck3-help软件包,测试退出" - - LOG_INFO "步骤3:执行安装libwnck3-help软件包" - if [ $INSTALLED -eq 0 ]; then - dnf install -y libwnck3-help - CHECK_RESULT $? 0 0 "安装libwnck3-help软件包失败" - LOG_INFO "libwnck3-help软件包安装成功" - fi - - LOG_INFO "步骤4:验证libwnck3-help软件包是否正常工作" - rpm -q libwnck3-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "libwnck3-help软件包未正确安装" - - LOG_INFO "步骤5:清理测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试过程中安装的libwnck3-help软件包" - dnf remove -y libwnck3-help - CHECK_RESULT $? 0 0 "卸载libwnck3-help软件包失败" - LOG_INFO "libwnck3-help软件包卸载成功,环境已恢复" - else - LOG_INFO "测试前已安装libwnck3-help软件包,保持安装状态不变" - fi - - LOG_INFO "测试libwnck3-help软件包的安装功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libwnck3/libwnck3-help/test_libwnck3-help_function_man_page.sh b/testcases/function_test/pkg_test/libwnck3/libwnck3-help/test_libwnck3-help_function_man_page.sh deleted file mode 100644 index 0d79e6095b0..00000000000 --- a/testcases/function_test/pkg_test/libwnck3/libwnck3-help/test_libwnck3-help_function_man_page.sh +++ /dev/null @@ -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 : 2026-03-26 -# @License : Mulan PSL v2 -# @Desc : 测试libwnck3-help软件包的man手册页功能,验证手册页是否存在且内容可访问。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查libwnck3-help软件包是否已安装 - LOG_INFO "检查libwnck3-help软件包是否已安装" - rpm -q libwnck3-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "libwnck3-help软件包已安装" - INSTALLED=1 - else - LOG_INFO "libwnck3-help软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在libwnck3-help软件包 - LOG_INFO "检查yum源中是否存在libwnck3-help软件包" - dnf list available libwnck3-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到libwnck3-help软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到libwnck3-help软件包,退出测试" - exit 255 - fi - - # 如果未安装,则安装libwnck3-help软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装libwnck3-help软件包" - dnf install -y libwnck3-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装libwnck3-help软件包失败" - fi - - # 检查man手册页是否存在 - LOG_INFO "检查libwnck3-help软件包的man手册页是否存在" - man -w libwnck3 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "libwnck3-help软件包的man手册页不存在" - - # 检查man手册页内容是否可访问 - LOG_INFO "检查libwnck3-help软件包的man手册页内容是否可访问" - man libwnck3 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "libwnck3-help软件包的man手册页内容不可访问" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载libwnck3-help软件包" - dnf remove -y libwnck3-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载libwnck3-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libwnck3/libwnck3-help/test_libwnck3-help_function_usage.sh b/testcases/function_test/pkg_test/libwnck3/libwnck3-help/test_libwnck3-help_function_usage.sh deleted file mode 100644 index 9eb6ee5cce4..00000000000 --- a/testcases/function_test/pkg_test/libwnck3/libwnck3-help/test_libwnck3-help_function_usage.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-26 -# @License : Mulan PSL v2 -# @Desc : 测试libwnck3-help软件包的基本使用功能,验证帮助文档是否正确显示。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查libwnck3-help软件包是否已安装 - LOG_INFO "检查libwnck3-help软件包是否已安装" - rpm -q libwnck3-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "libwnck3-help软件包已安装,记录安装状态" - PACKAGE_INSTALLED=true - else - LOG_INFO "libwnck3-help软件包未安装" - PACKAGE_INSTALLED=false - fi - - # 检查yum源中是否有libwnck3-help软件包 - LOG_INFO "检查yum源中是否有libwnck3-help软件包" - dnf list available libwnck3-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到libwnck3-help软件包" - exit 255 - fi - - # 如果软件包未安装,则安装它 - if [ "$PACKAGE_INSTALLED" = "false" ]; then - LOG_INFO "安装libwnck3-help软件包" - dnf install -y libwnck3-help - CHECK_RESULT $? 0 0 "安装libwnck3-help软件包失败" - fi - - # 测试libwnck3-help软件包的基本使用功能 - LOG_INFO "验证libwnck3-help命令是否存在" - which libwnck3-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "libwnck3-help命令不存在" - - # 检查libwnck3-help命令是否支持--help参数 - LOG_INFO "检查libwnck3-help命令是否支持--help参数" - libwnck3-help --help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "libwnck3-help命令支持--help参数" - PARAM_TO_TEST="--help" - elif libwnck3-help -h > /dev/null 2>&1; then - LOG_INFO "libwnck3-help命令支持-h参数" - PARAM_TO_TEST="-h" - else - LOG_ERROR "libwnck3-help命令不支持--help或-h参数" - exit 255 - fi - - # 执行libwnck3-help命令并验证输出 - LOG_INFO "执行libwnck3-help $PARAM_TO_TEST命令" - libwnck3-help $PARAM_TO_TEST > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "libwnck3-help $PARAM_TO_TEST命令执行失败" - - # 验证帮助文档是否正确显示 - LOG_INFO "验证帮助文档是否正确显示" - libwnck3-help $PARAM_TO_TEST | grep -i "usage\|help" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "帮助文档未正确显示" - - # 环境恢复 - LOG_INFO "恢复测试环境" - if [ "$PACKAGE_INSTALLED" = "false" ]; then - LOG_INFO "卸载libwnck3-help软件包" - dnf remove -y libwnck3-help - CHECK_RESULT $? 0 0 "卸载libwnck3-help软件包失败" - else - LOG_INFO "保持libwnck3-help软件包安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libwnck3/libwnck3-help/test_libwnck3-help_function_version.sh b/testcases/function_test/pkg_test/libwnck3/libwnck3-help/test_libwnck3-help_function_version.sh deleted file mode 100644 index 920b2ee6ca6..00000000000 --- a/testcases/function_test/pkg_test/libwnck3/libwnck3-help/test_libwnck3-help_function_version.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-26 -# @License : Mulan PSL v2 -# @Desc : 测试libwnck3-help软件包的版本查询功能,验证能否正确获取软件包版本信息。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - PACKAGE_NAME="libwnck3-help" - COMMAND="libwnck3-help" - VERSION_PARAM="--version" - - LOG_INFO "开始测试:测试libwnck3-help软件包的版本查询功能,验证能否正确获取软件包版本信息。" - - LOG_INFO "步骤1:检查yum源中是否存在软件包 $PACKAGE_NAME。" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到软件包 $PACKAGE_NAME。" - exit 255 - fi - - LOG_INFO "步骤2:检查系统是否已安装软件包 $PACKAGE_NAME。" - INSTALLED=0 - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装。" - INSTALLED=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将进行安装。" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败。" - fi - - LOG_INFO "步骤3:检查命令 $COMMAND 是否支持参数 $VERSION_PARAM。" - $COMMAND $VERSION_PARAM &>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "命令 $COMMAND 不支持参数 $VERSION_PARAM 或参数不存在。" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载测试安装的软件包 $PACKAGE_NAME。" - dnf remove -y $PACKAGE_NAME - fi - exit 255 - fi - - LOG_INFO "步骤4:执行命令 $COMMAND $VERSION_PARAM 获取版本信息。" - VERSION_OUTPUT=$($COMMAND $VERSION_PARAM 2>&1) - EXIT_CODE=$? - CHECK_RESULT $EXIT_CODE 0 0 "执行命令 $COMMAND $VERSION_PARAM 失败。" - - LOG_INFO "步骤5:验证版本信息输出是否有效。" - if [[ -z "$VERSION_OUTPUT" ]]; then - LOG_ERROR "命令 $COMMAND $VERSION_PARAM 未输出任何版本信息。" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载测试安装的软件包 $PACKAGE_NAME。" - dnf remove -y $PACKAGE_NAME - fi - exit 1 - else - LOG_INFO "版本信息输出为: $VERSION_OUTPUT" - fi - - LOG_INFO "步骤6:清理测试环境。" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的软件包 $PACKAGE_NAME。" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败。" - else - LOG_INFO "测试前软件包已安装,保持安装状态。" - fi - - LOG_INFO "测试完成:libwnck3-help版本查询功能测试通过。" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mstflint/mstflint-help/test_mstflint-help_function_install.sh b/testcases/function_test/pkg_test/mstflint/mstflint-help/test_mstflint-help_function_install.sh deleted file mode 100644 index 571cd0c9192..00000000000 --- a/testcases/function_test/pkg_test/mstflint/mstflint-help/test_mstflint-help_function_install.sh +++ /dev/null @@ -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 : 2026-03-19 -# @License : Mulan PSL v2 -# @Desc : 测试使用系统包管理器(如yum或apt)安装mstflint-help软件包是否成功。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义测试变量 - PACKAGE_NAME="mstflint-help" - LOG_INFO "1. 检查当前环境中是否已安装 $PACKAGE_NAME 软件包" - rpm -q $PACKAGE_NAME >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到 $PACKAGE_NAME 已安装,测试后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "检测到 $PACKAGE_NAME 未安装,测试后将卸载" - INSTALLED_BEFORE=false - fi - - LOG_INFO "2. 检查 yum 源中是否存在 $PACKAGE_NAME 软件包" - dnf list available $PACKAGE_NAME >/dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum 源中不存在 $PACKAGE_NAME 软件包" - - LOG_INFO "3. 安装 $PACKAGE_NAME 软件包" - if [ "$INSTALLED_BEFORE" = false ]; then - dnf install -y $PACKAGE_NAME >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - else - LOG_INFO "$PACKAGE_NAME 已安装,跳过安装步骤" - fi - - LOG_INFO "4. 验证安装是否成功" - rpm -q $PACKAGE_NAME >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "$PACKAGE_NAME 安装后验证失败" - - LOG_INFO "5. 测试 mstflint-help 命令的基本功能" - mstflint --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "mstflint --help 命令执行失败" - - LOG_INFO "6. 清理测试环境,恢复到之前的状态" - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载测试安装的 $PACKAGE_NAME 软件包" - dnf remove -y $PACKAGE_NAME >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败" - rpm -q $PACKAGE_NAME >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "卸载 $PACKAGE_NAME 后验证失败,软件包仍存在" - exit 1 - else - LOG_INFO "$PACKAGE_NAME 卸载成功" - fi - else - LOG_INFO "测试前 $PACKAGE_NAME 已安装,保持安装状态" - fi - - LOG_INFO "7. 测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mstflint/mstflint-help/test_mstflint-help_function_manpage.sh b/testcases/function_test/pkg_test/mstflint/mstflint-help/test_mstflint-help_function_manpage.sh deleted file mode 100644 index 1685648b4f5..00000000000 --- a/testcases/function_test/pkg_test/mstflint/mstflint-help/test_mstflint-help_function_manpage.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-19 -# @License : Mulan PSL v2 -# @Desc : 测试安装后,mstflint-help的手册页(man page)是否可以正常访问和显示。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装mstflint软件包 - LOG_INFO "检查是否已安装mstflint软件包" - rpm -q mstflint &>/dev/null - installed=$? - - # 如果未安装,则检查yum源中是否存在该软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "未安装mstflint,检查yum源中是否存在该软件包" - dnf list available mstflint &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到mstflint软件包" - exit 255 - fi - # 安装软件包 - LOG_INFO "安装mstflint软件包" - dnf install -y mstflint - CHECK_RESULT $? 0 0 "安装mstflint软件包失败" - fi - - # 测试mstflint-help命令的man page是否可以正常访问和显示 - LOG_INFO "测试mstflint-help命令的man page是否可以正常访问和显示" - man mstflint-help &>/dev/null - CHECK_RESULT $? 0 0 "无法访问mstflint-help的man page" - - # 详细显示man page内容,确保可以正常显示 - LOG_INFO "显示mstflint-help的man page内容" - man mstflint-help | head -20 - CHECK_RESULT $? 0 0 "无法显示mstflint-help的man page内容" - - # 环境恢复:如果脚本开始时未安装,则卸载软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "卸载mstflint软件包" - dnf remove -y mstflint - CHECK_RESULT $? 0 0 "卸载mstflint软件包失败" - else - LOG_INFO "脚本开始时已安装mstflint,保持安装状态" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-anyio/python3-anyio/test_python3-anyio_function_async.sh b/testcases/function_test/pkg_test/python-anyio/python3-anyio/test_python3-anyio_function_async.sh deleted file mode 100644 index 433699cb443..00000000000 --- a/testcases/function_test/pkg_test/python-anyio/python3-anyio/test_python3-anyio_function_async.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-07 -# @License : Mulan PSL v2 -# @Desc : Test basic async functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test basic async functionality" - - # 检查是否已安装python3-anyio - LOG_INFO "检查python3-anyio是否已安装" - if dnf list installed python3-anyio &>/dev/null; then - LOG_INFO "python3-anyio已安装,测试结束后将保持安装状态" - installed=true - else - LOG_INFO "python3-anyio未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有python3-anyio - LOG_INFO "检查yum源中是否有python3-anyio" - if ! dnf list available python3-anyio &>/dev/null; then - LOG_ERROR "yum源中未找到python3-anyio,退出测试" - exit 255 - fi - - # 安装python3-anyio(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "安装python3-anyio" - dnf install -y python3-anyio - CHECK_RESULT $? 0 0 "安装python3-anyio失败" - fi - - # 测试基本异步功能 - LOG_INFO "测试基本异步功能" - python3 -c "import anyio; async def test(): print("Async test passed"); await anyio.sleep(0); test()" - CHECK_RESULT $? 0 0 "基本异步功能测试失败" - - # 清理环境(如果测试前未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-anyio" - dnf remove -y python3-anyio - CHECK_RESULT $? 0 0 "卸载python3-anyio失败" - fi - - LOG_INFO "测试完成:Test basic async functionality" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pexpect/python3-pexpect/test_python3-pexpect_function_expect.sh b/testcases/function_test/pkg_test/python-pexpect/python3-pexpect/test_python3-pexpect_function_expect.sh deleted file mode 100644 index 5a5720be5da..00000000000 --- a/testcases/function_test/pkg_test/python-pexpect/python3-pexpect/test_python3-pexpect_function_expect.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-01 -# @License : Mulan PSL v2 -# @Desc : Test expect pattern matching -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-pexpect - LOG_INFO "检查是否已安装python3-pexpect" - rpm -q python3-pexpect > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-pexpect已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "python3-pexpect未安装,将在测试后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在python3-pexpect - LOG_INFO "检查yum源中是否存在python3-pexpect" - dnf list available python3-pexpect > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-pexpect软件包" - exit 255 - fi - - # 安装python3-pexpect - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装python3-pexpect" - dnf install -y python3-pexpect - CHECK_RESULT $? 0 0 "安装python3-pexpect失败" - fi - - # Test expect pattern matching - LOG_INFO "开始测试expect模式匹配" - expect << EOF - spawn python3 -c "import pexpect; child = pexpect.spawn("echo hello"); child.expect("hello")" - expect eof - EOF - CHECK_RESULT $? 0 0 "expect模式匹配测试失败" - - # 清理环境:如果之前未安装,则卸载python3-pexpect - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载python3-pexpect" - dnf remove -y python3-pexpect - CHECK_RESULT $? 0 0 "卸载python3-pexpect失败" - - # 再次确认卸载是否成功 - rpm -q python3-pexpect > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "python3-pexpect卸载后仍存在" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pexpect/python3-pexpect/test_python3-pexpect_function_interact.sh b/testcases/function_test/pkg_test/python-pexpect/python3-pexpect/test_python3-pexpect_function_interact.sh deleted file mode 100644 index bed47aa58e6..00000000000 --- a/testcases/function_test/pkg_test/python-pexpect/python3-pexpect/test_python3-pexpect_function_interact.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-01 -# @License : Mulan PSL v2 -# @Desc : Test interactive mode -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test interactive mode" - - # 检查是否已安装python3-pexpect - LOG_INFO "检查是否已安装python3-pexpect" - dnf list installed python3-pexpect >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-pexpect已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "python3-pexpect未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有python3-pexpect - LOG_INFO "检查yum源中是否有python3-pexpect" - dnf list available python3-pexpect >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-pexpect,退出测试" - exit 255 - fi - - # 安装python3-pexpect - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装python3-pexpect" - dnf install -y python3-pexpect - CHECK_RESULT $? 0 0 "安装python3-pexpect失败" - fi - - # 测试交互模式 - LOG_INFO "测试交互模式" - python3 -c "import pexpect; child = pexpect.spawn("ls"); child.expect(pexpect.EOF); print(child.before.decode())" - CHECK_RESULT $? 0 0 "交互模式测试失败" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载python3-pexpect" - dnf remove -y python3-pexpect - CHECK_RESULT $? 0 0 "卸载python3-pexpect失败" - fi - - LOG_INFO "测试完成:Test interactive mode" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pexpect/python3-pexpect/test_python3-pexpect_function_send.sh b/testcases/function_test/pkg_test/python-pexpect/python3-pexpect/test_python3-pexpect_function_send.sh deleted file mode 100644 index b848d4268b5..00000000000 --- a/testcases/function_test/pkg_test/python-pexpect/python3-pexpect/test_python3-pexpect_function_send.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-01 -# @License : Mulan PSL v2 -# @Desc : Test sending input to process -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试脚本:test_python3-pexpect_function_send - - # 步骤1:检查是否已安装python3-pexpect - LOG_INFO "检查是否已安装python3-pexpect" - dnf list installed python3-pexpect > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-pexpect已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-pexpect未安装,将在测试后卸载" - INSTALLED=false - fi - - # 步骤2:检查yum源中是否存在python3-pexpect - LOG_INFO "检查yum源中是否存在python3-pexpect" - dnf list available python3-pexpect > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-pexpect软件包" - exit 255 - fi - - # 步骤3:安装python3-pexpect(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装python3-pexpect" - dnf install -y python3-pexpect > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装python3-pexpect失败" - fi - - # 步骤4:测试发送输入到进程的功能 - LOG_INFO "测试发送输入到进程的功能" - expect << EOF > /dev/null 2>&1 - spawn python3 -c "import sys; print(sys.stdin.readline())" - expect "spawn" - send "test_input\n" - expect eof - EOF - CHECK_RESULT $? 0 0 "发送输入到进程失败" - - # 步骤5:清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载python3-pexpect" - dnf remove -y python3-pexpect > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载python3-pexpect失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-pexpect/python3-pexpect/test_python3-pexpect_function_spawn.sh b/testcases/function_test/pkg_test/python-pexpect/python3-pexpect/test_python3-pexpect_function_spawn.sh deleted file mode 100644 index 999cd1c486e..00000000000 --- a/testcases/function_test/pkg_test/python-pexpect/python3-pexpect/test_python3-pexpect_function_spawn.sh +++ /dev/null @@ -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-01 -# @License : Mulan PSL v2 -# @Desc : Test spawning a new process -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试:Test spawning a new process" - - # 检查是否已安装python3-pexpect - LOG_INFO "检查是否已安装python3-pexpect" - if ! dnf list installed python3-pexpect &>/dev/null; then - LOG_INFO "python3-pexpect未安装,开始安装" - if ! dnf list available python3-pexpect &>/dev/null; then - LOG_ERROR "yum源中未找到python3-pexpect软件包" - exit 255 - fi - dnf install -y python3-pexpect - CHECK_RESULT $? 0 0 "安装python3-pexpect失败" - INSTALLED=1 - else - LOG_INFO "python3-pexpect已安装" - INSTALLED=0 - fi - - # 测试spawn功能 - LOG_INFO "测试spawn功能" - python3 -c "import pexpect; child = pexpect.spawn("ls"); child.expect(pexpect.EOF)" - CHECK_RESULT $? 0 0 "spawn功能测试失败" - - # 清理环境 - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "清理环境,卸载python3-pexpect" - dnf remove -y python3-pexpect - CHECK_RESULT $? 0 0 "卸载python3-pexpect失败" - fi - - LOG_INFO "测试完成:Test spawning a new process" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt5-doc/qt5-qtquickcontrols2-doc/test_qt5-qtquickcontrols2-doc_function_doc_access.sh b/testcases/function_test/pkg_test/qt5-doc/qt5-qtquickcontrols2-doc/test_qt5-qtquickcontrols2-doc_function_doc_access.sh deleted file mode 100644 index d8c422b04ba..00000000000 --- a/testcases/function_test/pkg_test/qt5-doc/qt5-qtquickcontrols2-doc/test_qt5-qtquickcontrols2-doc_function_doc_access.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-02 -# @License : Mulan PSL v2 -# @Desc : Verify access to documentation files -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在qt5-qtquickcontrols2-doc软件包 - LOG_INFO "检查yum源中是否存在qt5-qtquickcontrols2-doc软件包" - dnf list available qt5-qtquickcontrols2-doc &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt5-qtquickcontrols2-doc软件包" - exit 255 - fi - - # 检查是否已安装qt5-qtquickcontrols2-doc - LOG_INFO "检查是否已安装qt5-qtquickcontrols2-doc" - rpm -q qt5-qtquickcontrols2-doc &>/dev/null - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "qt5-qtquickcontrols2-doc已安装,脚本结束后将保持安装状态" - else - installed=false - LOG_INFO "qt5-qtquickcontrols2-doc未安装,将在测试后卸载" - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装qt5-qtquickcontrols2-doc软件包" - dnf install -y qt5-qtquickcontrols2-doc - CHECK_RESULT $? 0 0 "安装qt5-qtquickcontrols2-doc失败" - fi - - # 验证文档文件访问 - LOG_INFO "验证文档文件访问" - doc_path=$(rpm -ql qt5-qtquickcontrols2-doc | head -n 1) - if [ -z "$doc_path" ]; then - LOG_ERROR "未找到文档文件路径" - exit 1 - fi - - LOG_INFO "访问文档文件: $doc_path" - cat "$doc_path" &>/dev/null - CHECK_RESULT $? 0 0 "访问文档文件失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载qt5-qtquickcontrols2-doc软件包" - dnf remove -y qt5-qtquickcontrols2-doc - CHECK_RESULT $? 0 0 "卸载qt5-qtquickcontrols2-doc失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-d/texlive-cantarell/test_texlive-cantarell_function_doc_access.sh b/testcases/function_test/pkg_test/texlive-split-d/texlive-cantarell/test_texlive-cantarell_function_doc_access.sh deleted file mode 100644 index b89179a203a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-d/texlive-cantarell/test_texlive-cantarell_function_doc_access.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-05 -# @License : Mulan PSL v2 -# @Desc : Access package documentation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装texlive-cantarell软件包 - LOG_INFO "检查是否已安装texlive-cantarell软件包" - rpm -q texlive-cantarell - if [ $? -eq 0 ]; then - LOG_INFO "texlive-cantarell软件包已安装" - INSTALLED=1 - else - LOG_INFO "texlive-cantarell软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-cantarell软件包 - LOG_INFO "检查yum源中是否有texlive-cantarell软件包" - dnf list available texlive-cantarell - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texlive-cantarell软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-cantarell软件包" - dnf install -y texlive-cantarell - CHECK_RESULT $? 0 0 "安装texlive-cantarell软件包失败" - LOG_INFO "texlive-cantarell软件包安装成功" - fi - - # 测试访问软件包文档 - LOG_INFO "测试访问texlive-cantarell软件包文档" - rpm -qd texlive-cantarell - CHECK_RESULT $? 0 0 "访问texlive-cantarell软件包文档失败" - - # 验证文档内容可读性 - LOG_INFO "验证文档内容可读性" - DOC_FILE=$(rpm -qd texlive-cantarell | head -1) - if [ -n "$DOC_FILE" ]; then - file "$DOC_FILE" - CHECK_RESULT $? 0 0 "文档文件类型检查失败" - - LOG_INFO "检查文档文件是否可读" - if [ -r "$DOC_FILE" ]; then - LOG_INFO "文档文件可读" - head -5 "$DOC_FILE" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "读取文档文件内容失败" - else - LOG_ERROR "文档文件不可读" - exit 1 - fi - else - LOG_ERROR "未找到文档文件" - exit 1 - fi - - LOG_INFO "texlive-cantarell软件包文档访问测试成功" - - # 环境清理 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境,卸载texlive-cantarell软件包" - dnf remove -y texlive-cantarell - CHECK_RESULT $? 0 0 "卸载texlive-cantarell软件包失败" - LOG_INFO "texlive-cantarell软件包卸载成功" - else - LOG_INFO "保持texlive-cantarell软件包安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-d/texlive-cantarell/test_texlive-cantarell_function_font_list.sh b/testcases/function_test/pkg_test/texlive-split-d/texlive-cantarell/test_texlive-cantarell_function_font_list.sh deleted file mode 100644 index f95b63a4bdb..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-d/texlive-cantarell/test_texlive-cantarell_function_font_list.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-05 -# @License : Mulan PSL v2 -# @Desc : List available Cantarell fonts -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:List available Cantarell fonts" - LOG_INFO "步骤1:检查texlive-cantarell-fonts软件包是否在yum源中" - if ! dnf list available texlive-cantarell-fonts &>/dev/null; then - LOG_ERROR "texlive-cantarell-fonts软件包不在yum源中" - exit 255 - fi - - LOG_INFO "步骤2:检查系统是否已安装texlive-cantarell-fonts" - if rpm -q texlive-cantarell-fonts &>/dev/null; then - LOG_INFO "texlive-cantarell-fonts已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texlive-cantarell-fonts未安装,将在测试结束后卸载" - INSTALLED_BEFORE=false - fi - - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3:安装texlive-cantarell-fonts软件包" - dnf install -y texlive-cantarell-fonts - CHECK_RESULT $? 0 0 "安装texlive-cantarell-fonts失败" - fi - - LOG_INFO "步骤4:检查fc-list命令是否支持列出Cantarell字体" - if ! fc-list --help | grep -q "family"; then - LOG_ERROR "fc-list命令不支持列出字体家族" - exit 255 - fi - - LOG_INFO "步骤5:执行fc-list命令列出可用的Cantarell字体" - fc-list | grep -i "cantarell" - CHECK_RESULT $? 0 0 "列出Cantarell字体失败" - - LOG_INFO "步骤6:清理测试环境" - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载texlive-cantarell-fonts软件包" - dnf remove -y texlive-cantarell-fonts - CHECK_RESULT $? 0 0 "卸载texlive-cantarell-fonts失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-d/texlive-cantarell/test_texlive-cantarell_function_install.sh b/testcases/function_test/pkg_test/texlive-split-d/texlive-cantarell/test_texlive-cantarell_function_install.sh deleted file mode 100644 index 5cf47e4dfa8..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-d/texlive-cantarell/test_texlive-cantarell_function_install.sh +++ /dev/null @@ -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-09-18 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试texlive-cantarell软件包安装功能" - - # 检查yum源中是否存在texlive-cantarell软件包 - LOG_INFO "检查yum源中是否存在texlive-cantarell软件包" - dnf list available texlive-cantarell > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-cantarell软件包" - - # 检查是否已安装texlive-cantarell - LOG_INFO "检查是否已安装texlive-cantarell" - if rpm -q texlive-cantarell > /dev/null 2>&1; then - LOG_INFO "texlive-cantarell已安装,跳过安装步骤" - installed=true - else - installed=false - LOG_INFO "texlive-cantarell未安装,开始安装" - dnf install -y texlive-cantarell - CHECK_RESULT $? 0 0 "安装texlive-cantarell失败" - fi - - # 验证安装结果 - LOG_INFO "验证texlive-cantarell是否成功安装" - rpm -q texlive-cantarell > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-cantarell未正确安装" - - # 清理环境:如果脚本开始时未安装,则卸载 - if [ "$installed" = false ]; then - LOG_INFO "清理环境:卸载texlive-cantarell" - dnf remove -y texlive-cantarell - CHECK_RESULT $? 0 0 "卸载texlive-cantarell失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-d/texlive-cantarell/test_texlive-cantarell_function_remove.sh b/testcases/function_test/pkg_test/texlive-split-d/texlive-cantarell/test_texlive-cantarell_function_remove.sh deleted file mode 100644 index 090d672f6e2..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-d/texlive-cantarell/test_texlive-cantarell_function_remove.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-05 -# @License : Mulan PSL v2 -# @Desc : Test package removal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:Test package removal" - - LOG_INFO "步骤1:检查texlive-cantarell软件包是否在yum源中" - if ! dnf list available texlive-cantarell &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-cantarell软件包" - exit 255 - fi - LOG_INFO "texlive-cantarell软件包在yum源中可用" - - LOG_INFO "步骤2:检查当前环境是否已安装texlive-cantarell" - if rpm -q texlive-cantarell &>/dev/null; then - LOG_INFO "当前环境已安装texlive-cantarell,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "当前环境未安装texlive-cantarell" - INSTALLED_BEFORE_TEST=false - fi - - LOG_INFO "步骤3:如果未安装,则安装texlive-cantarell软件包" - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - dnf install -y texlive-cantarell - CHECK_RESULT $? 0 0 "安装texlive-cantarell失败" - LOG_INFO "成功安装texlive-cantarell" - fi - - LOG_INFO "步骤4:验证软件包安装成功" - rpm -q texlive-cantarell - CHECK_RESULT $? 0 0 "验证texlive-cantarell安装状态失败" - - LOG_INFO "步骤5:执行卸载命令测试" - dnf remove -y texlive-cantarell - CHECK_RESULT $? 0 0 "卸载texlive-cantarell失败" - LOG_INFO "成功卸载texlive-cantarell" - - LOG_INFO "步骤6:验证软件包已卸载" - if rpm -q texlive-cantarell &>/dev/null; then - LOG_ERROR "卸载后texlive-cantarell仍然存在" - exit 1 - fi - LOG_INFO "验证通过:texlive-cantarell已成功卸载" - - LOG_INFO "步骤7:环境恢复" - if [ "$INSTALLED_BEFORE_TEST" = true ]; then - LOG_INFO "恢复原始安装状态:重新安装texlive-cantarell" - dnf install -y texlive-cantarell - CHECK_RESULT $? 0 0 "重新安装texlive-cantarell失败" - LOG_INFO "成功恢复texlive-cantarell安装状态" - else - LOG_INFO "原始状态为未安装,无需恢复" - fi - - LOG_INFO "步骤8:最终验证环境状态" - if [ "$INSTALLED_BEFORE_TEST" = true ]; then - rpm -q texlive-cantarell - CHECK_RESULT $? 0 0 "最终验证:texlive-cantarell应处于安装状态" - LOG_INFO "最终验证通过:环境已恢复到原始安装状态" - else - if rpm -q texlive-cantarell &>/dev/null; then - LOG_ERROR "最终验证失败:环境残留texlive-cantarell安装" - exit 1 - fi - LOG_INFO "最终验证通过:环境已恢复到原始未安装状态" - fi - - LOG_INFO "测试完成:Test package removal" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-d/texlive-cantarell/test_texlive-cantarell_function_verify_install.sh b/testcases/function_test/pkg_test/texlive-split-d/texlive-cantarell/test_texlive-cantarell_function_verify_install.sh deleted file mode 100644 index 4b7badf96d6..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-d/texlive-cantarell/test_texlive-cantarell_function_verify_install.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-05 -# @License : Mulan PSL v2 -# @Desc : Verify package is installed -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(根据要求直接使用,这里仅作占位符声明) - LOG_INFO() { - echo "[INFO] $*" - } - LOG_ERROR() { - echo "[ERROR] $*" - } - - # 定义检查结果函数(根据要求直接使用,这里仅作占位符声明) - CHECK_RESULT() { - if [ "$1" -eq "$2" ]; then - LOG_INFO "$4" - else - LOG_ERROR "$4" - exit "$3" - fi - } - - # 定义SSH_CMD函数(根据要求直接使用,这里仅作占位符声明) - SSH_CMD() { - # 此函数仅为占位符,实际测试中应实现SSH远程执行 - echo "SSH_CMD placeholder for: $*" - } - - # 软件包名称 - PACKAGE_NAME="texlive-cantarell" - - # 步骤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:检查当前环境是否已安装软件包 $PACKAGE_NAME" - if rpm -q "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - INSTALLED="true" - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - INSTALLED="false" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 成功" || exit $? - fi - - # 步骤4:验证软件包是否成功安装 - LOG_INFO "步骤4:验证软件包 $PACKAGE_NAME 是否成功安装" - rpm -q "$PACKAGE_NAME" &>/dev/null - CHECK_RESULT $? 0 0 "验证软件包 $PACKAGE_NAME 安装成功" - - # 步骤5:验证软件包功能(示例:检查相关文件是否存在) - LOG_INFO "步骤5:验证软件包 $PACKAGE_NAME 功能" - # 这里以检查字体文件为例,实际应根据软件包特性调整 - FONT_FILE="/usr/share/fonts/cantarell/Cantarell-Regular.otf" - if [ -f "$FONT_FILE" ]; then - LOG_INFO "字体文件 $FONT_FILE 存在,功能验证通过" - else - LOG_ERROR "字体文件 $FONT_FILE 不存在,功能验证失败" - exit 1 - fi - - # 步骤6:环境恢复(如果之前未安装,则卸载软件包) - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤6:卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 成功" - else - LOG_INFO "步骤6:保持软件包 $PACKAGE_NAME 安装状态" - fi - - LOG_INFO "测试完成:Verify package is installed" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-j/texlive-graphics-cfg/test_texlive-graphics-cfg_function_conf_exist.sh b/testcases/function_test/pkg_test/texlive-split-j/texlive-graphics-cfg/test_texlive-graphics-cfg_function_conf_exist.sh deleted file mode 100644 index 217879b87cf..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-j/texlive-graphics-cfg/test_texlive-graphics-cfg_function_conf_exist.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Test config file presence -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-graphics-cfg软件包 - LOG_INFO "检查是否已安装texlive-graphics-cfg软件包" - rpm -q texlive-graphics-cfg > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-graphics-cfg已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-graphics-cfg未安装,将在测试后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-graphics-cfg软件包" - dnf list available texlive-graphics-cfg > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texlive-graphics-cfg软件包" - exit 255 - fi - - # 如果未安装则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-graphics-cfg软件包" - dnf install -y texlive-graphics-cfg - CHECK_RESULT $? 0 0 "安装texlive-graphics-cfg失败" - fi - - # 测试配置文件是否存在 - LOG_INFO "测试配置文件是否存在" - rpm -ql texlive-graphics-cfg | grep -E "\.cfg$" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-graphics-cfg没有配置文件" - - # 获取配置文件列表 - LOG_INFO "获取配置文件列表" - CONFIG_FILES=$(rpm -ql texlive-graphics-cfg | grep -E "\.cfg$") - if [ -z "$CONFIG_FILES" ]; then - LOG_ERROR "未找到任何配置文件" - exit 255 - fi - - # 检查每个配置文件是否存在 - LOG_INFO "检查每个配置文件是否存在" - for config_file in $CONFIG_FILES; do - if [ ! -f "$config_file" ]; then - LOG_ERROR "配置文件不存在: $config_file" - exit 255 - fi - LOG_INFO "配置文件存在: $config_file" - done - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-graphics-cfg软件包" - dnf remove -y texlive-graphics-cfg - CHECK_RESULT $? 0 0 "卸载texlive-graphics-cfg失败" - else - LOG_INFO "保持texlive-graphics-cfg安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-j/texlive-graphics-cfg/test_texlive-graphics-cfg_function_config.sh b/testcases/function_test/pkg_test/texlive-split-j/texlive-graphics-cfg/test_texlive-graphics-cfg_function_config.sh deleted file mode 100644 index 9f4f59053f7..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-j/texlive-graphics-cfg/test_texlive-graphics-cfg_function_config.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test configuration file parsing -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查环境是否已安装texlive-graphics-cfg - LOG_INFO "检查是否已安装texlive-graphics-cfg" - rpm -q texlive-graphics-cfg > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-graphics-cfg已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-graphics-cfg未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-graphics-cfg软件包 - LOG_INFO "检查yum源中是否存在texlive-graphics-cfg" - dnf list available texlive-graphics-cfg > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-graphics-cfg软件包" - exit 255 - fi - - # 若未安装则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-graphics-cfg" - dnf install -y texlive-graphics-cfg - CHECK_RESULT $? 0 0 "安装texlive-graphics-cfg失败" - fi - - # 测试配置文件解析功能 - LOG_INFO "测试配置文件解析功能" - test_cmd="some_config_parsing_command" # 替换为实际命令 - $test_cmd - CHECK_RESULT $? 0 0 "配置文件解析失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-graphics-cfg" - dnf remove -y texlive-graphics-cfg - CHECK_RESULT $? 0 0 "卸载texlive-graphics-cfg失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-j/texlive-graphics-cfg/test_texlive-graphics-cfg_function_file_list.sh b/testcases/function_test/pkg_test/texlive-split-j/texlive-graphics-cfg/test_texlive-graphics-cfg_function_file_list.sh deleted file mode 100644 index 2ad28903347..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-j/texlive-graphics-cfg/test_texlive-graphics-cfg_function_file_list.sh +++ /dev/null @@ -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-15 -# @License : Mulan PSL v2 -# @Desc : Test installed file list -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:验证软件包安装后的文件列表" - LOG_INFO "步骤1:检查yum源中是否存在texlive-graphics-cfg软件包" - dnf list available texlive-graphics-cfg > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-graphics-cfg软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-graphics-cfg软件包,退出测试" - exit 255 - fi - - LOG_INFO "步骤2:检查系统是否已安装texlive-graphics-cfg软件包" - if rpm -q texlive-graphics-cfg > /dev/null 2>&1; then - LOG_INFO "系统已安装texlive-graphics-cfg软件包,跳过安装步骤" - already_installed=1 - else - LOG_INFO "系统未安装texlive-graphics-cfg软件包,开始安装" - dnf install -y texlive-graphics-cfg > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-graphics-cfg软件包失败" - already_installed=0 - fi - - LOG_INFO "步骤3:验证安装后的文件列表" - rpm -ql texlive-graphics-cfg > /tmp/texlive-graphics-cfg-files.txt - CHECK_RESULT $? 0 0 "获取texlive-graphics-cfg文件列表失败" - - LOG_INFO "步骤4:检查文件列表是否非空" - if [ -s /tmp/texlive-graphics-cfg-files.txt ]; then - LOG_INFO "texlive-graphics-cfg软件包安装后的文件列表非空,测试通过" - else - LOG_ERROR "texlive-graphics-cfg软件包安装后的文件列表为空,测试失败" - CHECK_RESULT 1 0 0 "文件列表为空" - fi - - LOG_INFO "步骤5:清理测试环境" - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载测试安装的texlive-graphics-cfg软件包" - dnf remove -y texlive-graphics-cfg > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-graphics-cfg软件包失败" - else - LOG_INFO "系统原本已安装texlive-graphics-cfg软件包,保持安装状态" - fi - - rm -f /tmp/texlive-graphics-cfg-files.txt - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-j/texlive-graphics-cfg/test_texlive-graphics-cfg_function_help.sh b/testcases/function_test/pkg_test/texlive-split-j/texlive-graphics-cfg/test_texlive-graphics-cfg_function_help.sh deleted file mode 100644 index 4826b1d25d8..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-j/texlive-graphics-cfg/test_texlive-graphics-cfg_function_help.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Test help documentation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-graphics-cfg - LOG_INFO "检查是否已安装texlive-graphics-cfg" - if rpm -q texlive-graphics-cfg &>/dev/null; then - LOG_INFO "texlive-graphics-cfg已安装,标记为已安装状态" - INSTALLED="true" - else - LOG_INFO "texlive-graphics-cfg未安装,标记为未安装状态" - INSTALLED="false" - fi - - # 检查yum源中是否存在texlive-graphics-cfg软件包 - LOG_INFO "检查yum源中是否存在texlive-graphics-cfg软件包" - if ! dnf list available texlive-graphics-cfg &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-graphics-cfg软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始安装texlive-graphics-cfg软件包" - dnf install -y texlive-graphics-cfg - CHECK_RESULT $? 0 0 "安装texlive-graphics-cfg失败" - LOG_INFO "texlive-graphics-cfg安装成功" - fi - - # 测试help文档功能 - LOG_INFO "测试texlive-graphics-cfg的help文档功能" - # 假设texlive-graphics-cfg的命令是texlive-graphics-cfg,这里使用--help参数 - texlive-graphics-cfg --help &>/dev/null - CHECK_RESULT $? 0 0 "执行texlive-graphics-cfg --help失败" - LOG_INFO "texlive-graphics-cfg --help执行成功" - - # 检查参数是否存在或不支持 - LOG_INFO "检查不支持的参数" - texlive-graphics-cfg --invalid-param &>/dev/null - if [ $? -eq 255 ]; then - LOG_INFO "参数检查正常,不支持参数时退出码为255" - else - LOG_ERROR "参数检查异常,不支持参数时退出码不为255" - exit 255 - fi - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始卸载texlive-graphics-cfg软件包" - dnf remove -y texlive-graphics-cfg - CHECK_RESULT $? 0 0 "卸载texlive-graphics-cfg失败" - LOG_INFO "texlive-graphics-cfg卸载成功" - else - LOG_INFO "保持texlive-graphics-cfg安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-j/texlive-graphics-cfg/test_texlive-graphics-cfg_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-j/texlive-graphics-cfg/test_texlive-graphics-cfg_function_uninstall.sh deleted file mode 100644 index 860ac10146d..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-j/texlive-graphics-cfg/test_texlive-graphics-cfg_function_uninstall.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Test package removal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:Test package removal - 测试包卸载功能" - - LOG_INFO "步骤1:检查texlive-graphics-cfg软件包是否在yum源中可用" - dnf list available texlive-graphics-cfg >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-graphics-cfg软件包在yum源中不存在" - exit 255 - fi - - LOG_INFO "步骤2:检查系统是否已经安装了texlive-graphics-cfg软件包" - rpm -q texlive-graphics-cfg >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-graphics-cfg软件包已经安装,标记为已安装状态" - PRE_INSTALLED=true - else - LOG_INFO "texlive-graphics-cfg软件包未安装,标记为未安装状态" - PRE_INSTALLED=false - fi - - LOG_INFO "步骤3:如果软件包未安装,则安装texlive-graphics-cfg软件包" - if [ "$PRE_INSTALLED" = "false" ]; then - LOG_INFO "正在安装texlive-graphics-cfg软件包..." - dnf install -y texlive-graphics-cfg - CHECK_RESULT $? 0 0 "安装texlive-graphics-cfg软件包失败" - LOG_INFO "texlive-graphics-cfg软件包安装成功" - fi - - LOG_INFO "步骤4:验证软件包安装成功" - rpm -q texlive-graphics-cfg >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证texlive-graphics-cfg软件包安装状态失败" - - LOG_INFO "步骤5:卸载texlive-graphics-cfg软件包" - dnf remove -y texlive-graphics-cfg - CHECK_RESULT $? 0 0 "卸载texlive-graphics-cfg软件包失败" - LOG_INFO "texlive-graphics-cfg软件包卸载成功" - - LOG_INFO "步骤6:验证软件包已卸载" - rpm -q texlive-graphics-cfg >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "texlive-graphics-cfg软件包卸载验证失败,软件包仍然存在" - exit 1 - else - LOG_INFO "texlive-graphics-cfg软件包卸载验证成功" - fi - - LOG_INFO "步骤7:环境恢复 - 如果测试前已安装,则重新安装软件包" - if [ "$PRE_INSTALLED" = "true" ]; then - LOG_INFO "恢复原始状态:重新安装texlive-graphics-cfg软件包..." - dnf install -y texlive-graphics-cfg - CHECK_RESULT $? 0 0 "恢复安装texlive-graphics-cfg软件包失败" - LOG_INFO "texlive-graphics-cfg软件包重新安装成功" - - LOG_INFO "验证恢复状态" - rpm -q texlive-graphics-cfg >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证恢复后的texlive-graphics-cfg软件包安装状态失败" - fi - - LOG_INFO "测试完成:Test package removal - 包卸载功能测试成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-j/texlive-graphics-cfg/test_texlive-graphics-cfg_function_version.sh b/testcases/function_test/pkg_test/texlive-split-j/texlive-graphics-cfg/test_texlive-graphics-cfg_function_version.sh deleted file mode 100644 index 4d6e35d32a8..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-j/texlive-graphics-cfg/test_texlive-graphics-cfg_function_version.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Test version query -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - PACKAGE_NAME="texlive-graphics-cfg" - COMMAND="texgraphicscfg" - EXPECTED_VERSION="" - - LOG_INFO "测试开始:测试软件包版本查询功能" - LOG_INFO "步骤1:检查软件包是否已在yum源中" - dnf list available "$PACKAGE_NAME" &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - LOG_INFO "软件包 $PACKAGE_NAME 在yum源中存在" - - LOG_INFO "步骤2:检查当前环境是否已安装 $PACKAGE_NAME" - rpm -q "$PACKAGE_NAME" &> /dev/null - if [ $? -eq 0 ]; then - INSTALLED="true" - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - else - INSTALLED="false" - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $PACKAGE_NAME 安装成功" - fi - - LOG_INFO "步骤4:检查 $COMMAND 命令是否支持 --version 参数" - $COMMAND --help 2>&1 | grep -q "\-\-version" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $COMMAND 不支持 --version 参数" - exit 255 - fi - LOG_INFO "命令 $COMMAND 支持 --version 参数" - - LOG_INFO "步骤5:执行 $COMMAND --version 命令查询版本" - VERSION_OUTPUT=$($COMMAND --version 2>&1) - CHECK_RESULT $? 0 0 "执行 $COMMAND --version 命令失败" - LOG_INFO "版本查询命令执行成功,输出为:$VERSION_OUTPUT" - - if [ -n "$EXPECTED_VERSION" ]; then - LOG_INFO "步骤6:检查版本号是否符合预期" - echo "$VERSION_OUTPUT" | grep -q "$EXPECTED_VERSION" - CHECK_RESULT $? 0 0 "版本号不符合预期,期望包含: $EXPECTED_VERSION,实际输出: $VERSION_OUTPUT" - LOG_INFO "版本号符合预期" - fi - - LOG_INFO "步骤7:清理测试环境" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载测试安装的软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $PACKAGE_NAME 卸载成功" - else - LOG_INFO "测试前已安装 $PACKAGE_NAME,保持安装状态" - fi - - LOG_INFO "测试完成:软件包版本查询功能测试结束" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-s/texlive-ptex-fonts/test_texlive-ptex-fonts_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-s/texlive-ptex-fonts/test_texlive-ptex-fonts_function_uninstall.sh deleted file mode 100644 index a7e04da0729..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-s/texlive-ptex-fonts/test_texlive-ptex-fonts_function_uninstall.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-10-02 -# @License : Mulan PSL v2 -# @Desc : Test package removal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test package removal" - - # 检查是否已安装texlive-ptex-fonts - LOG_INFO "检查是否已安装texlive-ptex-fonts" - dnf list installed texlive-ptex-fonts > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ptex-fonts已安装,测试前状态为已安装" - INSTALLED=1 - else - LOG_INFO "texlive-ptex-fonts未安装,测试前状态为未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-ptex-fonts软件包 - LOG_INFO "检查yum源中是否有texlive-ptex-fonts软件包" - dnf list available texlive-ptex-fonts > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-ptex-fonts软件包" - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-ptex-fonts软件包" - dnf install -y texlive-ptex-fonts - CHECK_RESULT $? 0 0 "安装texlive-ptex-fonts软件包失败" - fi - - # 测试卸载功能 - LOG_INFO "测试卸载texlive-ptex-fonts软件包" - dnf remove -y texlive-ptex-fonts - CHECK_RESULT $? 0 0 "卸载texlive-ptex-fonts软件包失败" - - # 如果测试前未安装,则重新安装以恢复环境;否则无需操作(因为测试前已安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "恢复环境:重新安装texlive-ptex-fonts软件包" - dnf install -y texlive-ptex-fonts - CHECK_RESULT $? 0 0 "恢复环境失败:重新安装texlive-ptex-fonts软件包失败" - else - LOG_INFO "环境恢复:保持原安装状态" - fi - - LOG_INFO "测试完成:Test package removal" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ustr/ustr-help/test_ustr-help_function_basic_usage.sh b/testcases/function_test/pkg_test/ustr/ustr-help/test_ustr-help_function_basic_usage.sh deleted file mode 100644 index 7815df30b2f..00000000000 --- a/testcases/function_test/pkg_test/ustr/ustr-help/test_ustr-help_function_basic_usage.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-05 -# @License : Mulan PSL v2 -# @Desc : Test basic help functionality and command output -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试基本帮助功能及命令输出 - LOG_INFO "开始测试基本帮助功能及命令输出" - - # 检查环境是否已安装 - LOG_INFO "检查测试环境是否已安装目标软件包" - if dnf list installed | grep -q "ustr-help-function"; then - LOG_INFO "目标软件包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "目标软件包未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否存在目标软件包" - if ! dnf search ustr-help-function 2>/dev/null | grep -q "ustr-help-function"; then - LOG_ERROR "yum源中未找到目标软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装目标软件包" - dnf install -y ustr-help-function - CHECK_RESULT $? 0 0 "软件包安装失败" - fi - - # 测试基本帮助功能 - LOG_INFO "测试基本帮助功能" - ustr-help-function --help - CHECK_RESULT $? 0 0 "帮助功能测试失败" - - # 测试命令输出 - LOG_INFO "测试命令输出" - OUTPUT=$(ustr-help-function version) - if [ -z "$OUTPUT" ]; then - LOG_ERROR "命令输出为空" - exit 1 - fi - CHECK_RESULT $? 0 0 "命令输出测试失败" - - # 测试不支持的参数 - LOG_INFO "测试不支持的参数" - ustr-help-function --invalid-param - if [ $? -ne 255 ]; then - LOG_ERROR "不支持的参数未正确退出" - exit 255 - fi - - # 清理环境 - LOG_INFO "清理测试环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y ustr-help-function - CHECK_RESULT $? 0 0 "软件包卸载失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ustr/ustr-help/test_ustr-help_function_install_check.sh b/testcases/function_test/pkg_test/ustr/ustr-help/test_ustr-help_function_install_check.sh deleted file mode 100644 index 8a8d64a97ff..00000000000 --- a/testcases/function_test/pkg_test/ustr/ustr-help/test_ustr-help_function_install_check.sh +++ /dev/null @@ -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-04-05 -# @License : Mulan PSL v2 -# @Desc : Test verification of package installation status -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试包安装状态验证 - LOG_INFO "开始测试:验证包安装状态" - - # 检查环境是否已安装目标软件包 - LOG_INFO "检查环境是否已安装目标软件包" - rpm -q ustr-help-function > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "目标软件包已安装,测试后保持安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "目标软件包未安装,将在测试后卸载" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否有目标软件包 - LOG_INFO "检查yum源中是否有目标软件包" - dnf list available ustr-help-function > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到目标软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "开始安装目标软件包" - dnf install -y ustr-help-function - CHECK_RESULT $? 0 0 "安装软件包失败" - LOG_INFO "软件包安装成功" - fi - - # 验证软件包安装状态 - LOG_INFO "验证软件包安装状态" - rpm -q ustr-help-function > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "软件包未正确安装" - - # 验证软件包命令功能 - LOG_INFO "验证软件包命令功能" - ustr-help-function --help > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "命令参数不支持" - exit 255 - fi - CHECK_RESULT $? 0 0 "软件包命令执行失败" - - # 验证软件包文件完整性 - LOG_INFO "验证软件包文件完整性" - rpm -V ustr-help-function - CHECK_RESULT $? 0 0 "软件包文件完整性验证失败" - - # 如果需要第二个服务器验证,则执行SSH命令 - if [ -n "$NODE2_IPV4" ] && [ -n "$NODE2_PASSWORD" ] && [ -n "$NODE2_USER" ]; then - LOG_INFO "在第二个服务器上验证软件包状态" - SSH_CMD "rpm -q ustr-help-function > /dev/null 2>&1" $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER - CHECK_RESULT $? 0 0 "第二个服务器上软件包状态验证失败" - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "清理环境:卸载测试安装的软件包" - dnf remove -y ustr-help-function - CHECK_RESULT $? 0 0 "卸载软件包失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "保持环境安装状态不变" - fi - - LOG_INFO "测试完成:包安装状态验证成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ustr/ustr-help/test_ustr-help_function_man_page.sh b/testcases/function_test/pkg_test/ustr/ustr-help/test_ustr-help_function_man_page.sh deleted file mode 100644 index ae58c2936bd..00000000000 --- a/testcases/function_test/pkg_test/ustr/ustr-help/test_ustr-help_function_man_page.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-05 -# @License : Mulan PSL v2 -# @Desc : Test accessibility of manual page for the package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称和命令 - PACKAGE_NAME="ustr" - COMMAND_NAME="ustr" - MAN_PAGE_SECTION="3" - - # 步骤1: 检查yum源中是否存在指定软件包 - LOG_INFO "步骤1: 检查yum源中是否存在${PACKAGE_NAME}软件包" - if ! dnf list available ${PACKAGE_NAME} &>/dev/null; then - LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - LOG_INFO "yum源中存在${PACKAGE_NAME}软件包" - - # 步骤2: 检查当前环境是否已安装软件包 - LOG_INFO "步骤2: 检查当前环境是否已安装${PACKAGE_NAME}软件包" - if rpm -q ${PACKAGE_NAME} &>/dev/null; then - INSTALLED="true" - LOG_INFO "${PACKAGE_NAME}软件包已安装" - else - INSTALLED="false" - LOG_INFO "${PACKAGE_NAME}软件包未安装" - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "步骤3: 安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}软件包失败" - LOG_INFO "安装${PACKAGE_NAME}软件包成功" - fi - - # 步骤4: 检查man命令是否支持指定参数 - LOG_INFO "步骤4: 检查man命令是否支持指定参数" - if ! man -w ${COMMAND_NAME}.${MAN_PAGE_SECTION} &>/dev/null; then - LOG_ERROR "man命令不支持${COMMAND_NAME}.${MAN_PAGE_SECTION}参数或手册页不存在" - exit 255 - fi - LOG_INFO "man命令支持${COMMAND_NAME}.${MAN_PAGE_SECTION}参数" - - # 步骤5: 执行man命令查看手册页 - LOG_INFO "步骤5: 执行man命令查看${COMMAND_NAME}手册页" - man ${COMMAND_NAME}.${MAN_PAGE_SECTION} - CHECK_RESULT $? 0 0 "查看${COMMAND_NAME}手册页失败" - LOG_INFO "查看${COMMAND_NAME}手册页成功" - - # 步骤6: 清理环境 - LOG_INFO "步骤6: 清理环境" - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}软件包失败" - LOG_INFO "卸载${PACKAGE_NAME}软件包成功" - else - LOG_INFO "${PACKAGE_NAME}软件包已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file