diff --git a/suite2cases/function_test/pkg_test/ant-contrib/ant-contrib-help.json b/suite2cases/function_test/pkg_test/ant-contrib/ant-contrib-help.json index 4943e96f7e9..68016f1a450 100644 --- a/suite2cases/function_test/pkg_test/ant-contrib/ant-contrib-help.json +++ b/suite2cases/function_test/pkg_test/ant-contrib/ant-contrib-help.json @@ -7,41 +7,9 @@ "desc": "测试 ant-contrib-help 软件包的安装功能,确保软件包可以正常安装。", "machine num": 1 }, - { - "name": "test_ant-contrib-help_function_basic", - "desc": "测试 ant-contrib-help 软件包的基本功能,确保核心功能可用。" - }, - { - "name": "test_ant-contrib-help_function_usage", - "desc": "测试 ant-contrib-help 软件包的使用说明功能,验证帮助文档是否正确。" - }, - { - "name": "test_ant-contrib-help_function_cli", - "desc": "测试 ant-contrib-help 软件包的命令行接口功能,确保命令行参数解析正常。" - }, - { - "name": "test_ant-contrib-help_function_install", - "desc": "测试软件包ant-contrib-help的安装功能,确保可以通过包管理器成功安装。" - }, - { - "name": "test_ant-contrib-help_function_uninstall", - "desc": "测试软件包ant-contrib-help的卸载功能,确保可以干净地移除软件包及其相关文件。" - }, { "name": "test_ant-contrib-help_function_version", "desc": "测试获取软件包版本信息的功能,验证版本号输出正确。" - }, - { - "name": "test_ant-contrib-help_function_help_cmd", - "desc": "测试软件包提供的命令行帮助功能,验证执行帮助命令能正确显示用法信息。" - }, - { - "name": "test_ant-contrib-help_function_basic_usage", - "desc": "测试软件包的一个最基本、最常用的核心功能,确保其主要目的能够实现。" - }, - { - "name": "test_ant-contrib-help_function_config", - "desc": "测试软件包的配置文件读取或生成功能,确保配置机制工作正常。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/dpkg/dpkg-help.json b/suite2cases/function_test/pkg_test/dpkg/dpkg-help.json index 4e1c47744b9..e95074ea57d 100644 --- a/suite2cases/function_test/pkg_test/dpkg/dpkg-help.json +++ b/suite2cases/function_test/pkg_test/dpkg/dpkg-help.json @@ -6,25 +6,9 @@ "name": "test_dpkg-help_function_basic", "desc": "Test basic functionality of dpkg-help" }, - { - "name": "test_dpkg-help_function_install", - "desc": "Test installation of dpkg-help package" - }, - { - "name": "test_dpkg-help_function_uninstall", - "desc": "Test removal of dpkg-help package" - }, { "name": "test_dpkg-help_function_usage", "desc": "Test basic usage of dpkg-help command" - }, - { - "name": "test_dpkg-help_function_help", - "desc": "Test dpkg-help help option" - }, - { - "name": "test_dpkg-help_function_installed", - "desc": "Test if dpkg-help is installed" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/fence-agents/fence-agents-docker.json b/suite2cases/function_test/pkg_test/fence-agents/fence-agents-docker.json index 7395bfe474c..0ae390fa7c6 100644 --- a/suite2cases/function_test/pkg_test/fence-agents/fence-agents-docker.json +++ b/suite2cases/function_test/pkg_test/fence-agents/fence-agents-docker.json @@ -2,10 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/fence-agents/fence-agents-docker", "machine num": 1, "cases": [ - { - "name": "test_fence-agents-docker_function_start", - "desc": "Test the start functionality of fence-agents-docker" - }, { "name": "test_fence-agents-docker_function_install", "desc": "Test the installation of fence-agents-docker package" @@ -13,18 +9,6 @@ { "name": "test_fence-agents-docker_function_uninstall", "desc": "Test the uninstallation of fence-agents-docker package" - }, - { - "name": "test_fence-agents-docker_function_check_installed", - "desc": "Test if fence-agents-docker package is installed" - }, - { - "name": "test_fence-agents-docker_function_list_agents", - "desc": "Test listing available docker fence agents" - }, - { - "name": "test_fence-agents-docker_function_agent_help", - "desc": "Test help output of a docker fence agent" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/festival/festival-devel.json b/suite2cases/function_test/pkg_test/festival/festival-devel.json index 418116e36e2..fcbe09439c6 100644 --- a/suite2cases/function_test/pkg_test/festival/festival-devel.json +++ b/suite2cases/function_test/pkg_test/festival/festival-devel.json @@ -6,10 +6,6 @@ "name": "test_festival-devel_install", "desc": "测试festival-devel软件包的安装功能", "machine num": 1 - }, - { - "name": "test_festival-devel_function_build", - "desc": "测试festival-devel软件包的构建功能" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/glassfish-jaxb/glassfish-jaxb-parent.json b/suite2cases/function_test/pkg_test/glassfish-jaxb/glassfish-jaxb-parent.json index 0517261777d..02fe7c70939 100644 --- a/suite2cases/function_test/pkg_test/glassfish-jaxb/glassfish-jaxb-parent.json +++ b/suite2cases/function_test/pkg_test/glassfish-jaxb/glassfish-jaxb-parent.json @@ -5,26 +5,6 @@ { "name": "test_glassfish-jaxb-parent_function_install", "desc": "Test package installation" - }, - { - "name": "test_glassfish-jaxb-parent_function_validate", - "desc": "Test XML validation" - }, - { - "name": "test_glassfish-jaxb-parent_function_bind", - "desc": "Test Java-XML binding" - }, - { - "name": "test_glassfish-jaxb-parent_function_generate", - "desc": "Test code generation" - }, - { - "name": "test_glassfish-jaxb-parent_function_unmarshal", - "desc": "Test XML unmarshalling" - }, - { - "name": "test_glassfish-jaxb-parent_function_marshal", - "desc": "Test XML marshalling" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/jetbrains-annotations/jetbrains-annotations-help.json b/suite2cases/function_test/pkg_test/jetbrains-annotations/jetbrains-annotations-help.json index 71efe4af6f9..c8bf492b64d 100644 --- a/suite2cases/function_test/pkg_test/jetbrains-annotations/jetbrains-annotations-help.json +++ b/suite2cases/function_test/pkg_test/jetbrains-annotations/jetbrains-annotations-help.json @@ -2,18 +2,10 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/jetbrains-annotations/jetbrains-annotations-help", "machine num": 1, "cases": [ - { - "name": "test_jetbrains-annotations-help_function_install", - "desc": "Test package installation" - }, { "name": "test_jetbrains-annotations-help_function_uninstall", "desc": "Test package uninstallation" }, - { - "name": "test_jetbrains-annotations-help_function_usage", - "desc": "Test basic usage" - }, { "name": "test_jetbrains-annotations-help_function_validate", "desc": "Test annotation validation" diff --git a/suite2cases/function_test/pkg_test/kronosnet/libknet1-plugins-all.json b/suite2cases/function_test/pkg_test/kronosnet/libknet1-plugins-all.json deleted file mode 100644 index 4086acb0e66..00000000000 --- a/suite2cases/function_test/pkg_test/kronosnet/libknet1-plugins-all.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/kronosnet/libknet1-plugins-all", - "machine num": 1, - "cases": [ - { - "name": "test_libknet1-plugins-all_function_load", - "desc": "Test the loading of plugins" - }, - { - "name": "test_libknet1-plugins-all_function_plugin_verify", - "desc": "Verify plugin integrity" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/perl-ExtUtils-LibBuilder/perl-ExtUtils-LibBuilder-help.json b/suite2cases/function_test/pkg_test/perl-ExtUtils-LibBuilder/perl-ExtUtils-LibBuilder-help.json index 67f5a248924..57e7ceb4bcf 100644 --- a/suite2cases/function_test/pkg_test/perl-ExtUtils-LibBuilder/perl-ExtUtils-LibBuilder-help.json +++ b/suite2cases/function_test/pkg_test/perl-ExtUtils-LibBuilder/perl-ExtUtils-LibBuilder-help.json @@ -2,21 +2,9 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/perl-ExtUtils-LibBuilder/perl-ExtUtils-LibBuilder-help", "machine num": 1, "cases": [ - { - "name": "test_perl-ExtUtils-LibBuilder-help_function_install", - "desc": "测试通过包管理器安装软件包" - }, { "name": "test_perl-ExtUtils-LibBuilder-help_function_check", "desc": "测试验证软件包是否成功安装" - }, - { - "name": "test_perl-ExtUtils-LibBuilder-help_function_usage", - "desc": "测试显示软件包提供的帮助信息" - }, - { - "name": "test_perl-ExtUtils-LibBuilder-help_function_uninstall", - "desc": "测试通过包管理器卸载软件包" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-configshell/python3-configshell.json b/suite2cases/function_test/pkg_test/python-configshell/python3-configshell.json index 0500021b8cd..17443a38322 100644 --- a/suite2cases/function_test/pkg_test/python-configshell/python3-configshell.json +++ b/suite2cases/function_test/pkg_test/python-configshell/python3-configshell.json @@ -9,18 +9,6 @@ { "name": "test_python3-configshell_function_parse", "desc": "Test command parsing" - }, - { - "name": "test_python3-configshell_function_execute", - "desc": "Test command execution" - }, - { - "name": "test_python3-configshell_function_help", - "desc": "Test help command output" - }, - { - "name": "test_python3-configshell_function_config", - "desc": "Test configuration handling" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-jupyter-sphinx/python-jupyter-sphinx-help.json b/suite2cases/function_test/pkg_test/python-jupyter-sphinx/python-jupyter-sphinx-help.json deleted file mode 100644 index 84e187049af..00000000000 --- a/suite2cases/function_test/pkg_test/python-jupyter-sphinx/python-jupyter-sphinx-help.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/python-jupyter-sphinx/python-jupyter-sphinx-help", - "machine num": 1, - "cases": [ - { - "name": "test_python-jupyter-sphinx-help_function_install", - "desc": "Test installation of the package" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-jupyter-sphinx/python3-jupyter-sphinx.json b/suite2cases/function_test/pkg_test/python-jupyter-sphinx/python3-jupyter-sphinx.json index 12bd82f1c15..31b77c7fdc5 100644 --- a/suite2cases/function_test/pkg_test/python-jupyter-sphinx/python3-jupyter-sphinx.json +++ b/suite2cases/function_test/pkg_test/python-jupyter-sphinx/python3-jupyter-sphinx.json @@ -11,10 +11,6 @@ "name": "test_python3-jupyter-sphinx_upgrade", "desc": "测试 python3-jupyter-sphinx 软件包的升级功能,确保软件包可以正常升级。", "machine num": 1 - }, - { - "name": "test_python3-jupyter-sphinx_function_render", - "desc": "测试 python3-jupyter-sphinx 软件包的渲染功能,确保文档可以正常渲染。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/sshj/sshj.json b/suite2cases/function_test/pkg_test/sshj/sshj.json index d2d243d326f..cbc1a4f2df2 100644 --- a/suite2cases/function_test/pkg_test/sshj/sshj.json +++ b/suite2cases/function_test/pkg_test/sshj/sshj.json @@ -10,33 +10,9 @@ "name": "test_sshj_function_install", "desc": "Test SSHj library installation and availability in the classpath" }, - { - "name": "test_sshj_function_basic_conn", - "desc": "Test establishing a basic SSH connection to a server" - }, - { - "name": "test_sshj_function_exec_cmd", - "desc": "Test executing a command on a remote server via SSH" - }, - { - "name": "test_sshj_function_file_transfer", - "desc": "Test uploading and downloading files using SFTP" - }, { "name": "test_sshj_function_key_auth", "desc": "Test SSH authentication using private key" - }, - { - "name": "test_sshj_function_session_channel", - "desc": "Test opening and using interactive shell channels" - }, - { - "name": "test_sshj_function_conn_timeout", - "desc": "Test SSH connection timeout behavior" - }, - { - "name": "test_sshj_function_version", - "desc": "Test retrieving and verifying the SSHj library version" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-a/texlive-armtex.json b/suite2cases/function_test/pkg_test/texlive-split-a/texlive-armtex.json deleted file mode 100644 index 0023a59bc6f..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-a/texlive-armtex.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-a/texlive-armtex", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-armtex_function_install", - "desc": "Test installation of texlive-armtex" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fundus-calligra-doc.json b/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fundus-calligra-doc.json index a244e139e8c..d076c64aecc 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fundus-calligra-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-i/texlive-fundus-calligra-doc.json @@ -13,14 +13,6 @@ { "name": "test_texlive-fundus-calligra-doc_function_version", "desc": "Test package version info" - }, - { - "name": "test_texlive-fundus-calligra-doc_function_doc_exist", - "desc": "Test documentation files existence" - }, - { - "name": "test_texlive-fundus-calligra-doc_function_doc_content", - "desc": "Test documentation content sanity" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-n/texlive-luaintro-doc.json b/suite2cases/function_test/pkg_test/texlive-split-n/texlive-luaintro-doc.json index ee2e176e0c0..3e6719812d1 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-n/texlive-luaintro-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-n/texlive-luaintro-doc.json @@ -26,21 +26,6 @@ "name": "test_texlive-luaintro-doc_rollback", "desc": "测试 texlive-luaintro-doc 软件包的回滚功能,验证是否能够正确回滚到之前的版本。", "machine num": 1 - }, - { - "name": "test_texlive-luaintro-doc_reinstall", - "desc": "测试 texlive-luaintro-doc 软件包的重新安装功能,验证是否能够正确重新安装到系统中。", - "machine num": 1 - }, - { - "name": "test_texlive-luaintro-doc_documentation", - "desc": "测试 texlive-luaintro-doc 软件包的文档功能,验证文档是否正确安装并可访问。", - "machine num": 1 - }, - { - "name": "test_texlive-luaintro-doc_verify_documentation", - "desc": "测试 texlive-luaintro-doc 软件包的文档验证功能,验证文档内容是否正确且完整。", - "machine num": 1 } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-p/texlive-modref.json b/suite2cases/function_test/pkg_test/texlive-split-p/texlive-modref.json index f8b540db4e7..f4443c8c91f 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-p/texlive-modref.json +++ b/suite2cases/function_test/pkg_test/texlive-split-p/texlive-modref.json @@ -9,18 +9,6 @@ { "name": "test_texlive-modref_function_uninstall", "desc": "Test package removal" - }, - { - "name": "test_texlive-modref_function_version", - "desc": "Check package version info" - }, - { - "name": "test_texlive-modref_function_basic_usage", - "desc": "Test basic LaTeX command usage" - }, - { - "name": "test_texlive-modref_function_file_list", - "desc": "Verify installed files list" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-r/texlive-pawpict.json b/suite2cases/function_test/pkg_test/texlive-split-r/texlive-pawpict.json deleted file mode 100644 index 8fb92504947..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-r/texlive-pawpict.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-r/texlive-pawpict", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-pawpict_function_basic", - "desc": "Test basic functionality of texlive-pawpict" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-u/texlive-sclang-prettifier-doc.json b/suite2cases/function_test/pkg_test/texlive-split-u/texlive-sclang-prettifier-doc.json deleted file mode 100644 index fb8b1fc59f7..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-u/texlive-sclang-prettifier-doc.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-u/texlive-sclang-prettifier-doc", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-sclang-prettifier-doc_function_basic", - "desc": "Verify basic doc functionality" - }, - { - "name": "test_texlive-sclang-prettifier-doc_function_install", - "desc": "Verify the package can be installed successfully" - }, - { - "name": "test_texlive-sclang-prettifier-doc_function_uninstall", - "desc": "Verify the package can be cleanly uninstalled" - }, - { - "name": "test_texlive-sclang-prettifier-doc_function_check_installed", - "desc": "Verify the package is correctly reported as installed" - }, - { - "name": "test_texlive-sclang-prettifier-doc_function_doc_files_exist", - "desc": "Verify core documentation files are present after installation" - }, - { - "name": "test_texlive-sclang-prettifier-doc_function_doc_content", - "desc": "Verify documentation contains key usage examples and API reference" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-v/texlive-silence.json b/suite2cases/function_test/pkg_test/texlive-split-v/texlive-silence.json index da430e5c46c..0c2cdf9631d 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-v/texlive-silence.json +++ b/suite2cases/function_test/pkg_test/texlive-split-v/texlive-silence.json @@ -18,14 +18,6 @@ { "name": "test_texlive-silence_function_check_installed", "desc": "测试检查texlive-silence软件包是否已正确安装,验证其核心文件存在且可访问" - }, - { - "name": "test_texlive-silence_function_suppress_warnings", - "desc": "测试texlive-silence包的核心功能:在LaTeX文档中抑制特定警告信息,验证警告被正确过滤" - }, - { - "name": "test_texlive-silence_function_verbatim_filters", - "desc": "测试texlive-silence包对特定verbatim环境或命令的输出过滤功能,验证其过滤规则生效" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-v/texlive-simpler-wick.json b/suite2cases/function_test/pkg_test/texlive-split-v/texlive-simpler-wick.json deleted file mode 100644 index cf297bcfbe1..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-v/texlive-simpler-wick.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-v/texlive-simpler-wick", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-simpler-wick_function_basic", - "desc": "Test basic command usage" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-w/texlive-texlogos.json b/suite2cases/function_test/pkg_test/texlive-split-w/texlive-texlogos.json deleted file mode 100644 index 243f8a77f36..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-w/texlive-texlogos.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-w/texlive-texlogos", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-texlogos_function_font", - "desc": "Test font rendering functionality" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-x/texlive-txgreeks.json b/suite2cases/function_test/pkg_test/texlive-split-x/texlive-txgreeks.json deleted file mode 100644 index 57a0afdca5b..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-x/texlive-txgreeks.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-x/texlive-txgreeks", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-txgreeks_function_install", - "desc": "Test installation of texlive-txgreeks" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/uriparser/uriparser-help.json b/suite2cases/function_test/pkg_test/uriparser/uriparser-help.json deleted file mode 100644 index af4f42a8ed9..00000000000 --- a/suite2cases/function_test/pkg_test/uriparser/uriparser-help.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/uriparser/uriparser-help", - "machine num": 1, - "cases": [ - { - "name": "test_uriparser-help_function_parse", - "desc": "Test URI parsing functionality" - }, - { - "name": "test_uriparser-help_function_normalize", - "desc": "Test URI normalization functionality" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_basic.sh b/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_basic.sh deleted file mode 100644 index b46efe68e66..00000000000 --- a/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_basic.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-09 -# @License : Mulan PSL v2 -# @Desc : 测试 ant-contrib-help 软件包的基本功能,确保核心功能可用。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装ant-contrib-help软件包 - LOG_INFO "检查ant-contrib-help软件包是否已安装..." - rpm -q ant-contrib-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "ant-contrib-help软件包已安装,脚本结束时将保持安装状态。" - INSTALLED=true - else - LOG_INFO "ant-contrib-help软件包未安装,将在测试完成后卸载。" - INSTALLED=false - fi - - # 检查yum源中是否存在ant-contrib-help软件包 - LOG_INFO "检查yum源中是否存在ant-contrib-help软件包..." - dnf list available ant-contrib-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到ant-contrib-help软件包,退出码255。" - exit 255 - fi - - # 安装ant-contrib-help软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装ant-contrib-help软件包..." - dnf install -y ant-contrib-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装ant-contrib-help软件包失败" - fi - - # 测试ant-contrib-help的基本功能 - LOG_INFO "测试ant-contrib-help的基本功能..." - ant-contrib-help --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ant-contrib-help基本功能测试失败" - - # 清理环境(如果脚本开始时未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载ant-contrib-help软件包..." - dnf remove -y ant-contrib-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载ant-contrib-help软件包失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复。" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_basic_usage.sh b/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_basic_usage.sh deleted file mode 100644 index 7cf26f5aaad..00000000000 --- a/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_basic_usage.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-26 -# @License : Mulan PSL v2 -# @Desc : 测试软件包的一个最基本、最常用的核心功能,确保其主要目的能够实现。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试 ant-contrib 软件包的基本帮助功能" - - LOG_INFO "步骤1: 检查 ant-contrib 软件包是否已在系统中安装" - if dnf list installed ant-contrib &>/dev/null; then - LOG_INFO "ant-contrib 软件包已安装,测试结束后将保持安装状态" - already_installed=true - else - LOG_INFO "ant-contrib 软件包未安装" - already_installed=false - fi - - LOG_INFO "步骤2: 检查 yum 源中是否存在 ant-contrib 软件包" - if ! dnf list available ant-contrib &>/dev/null; then - LOG_ERROR "yum 源中未找到 ant-contrib 软件包" - exit 255 - fi - - if [ "$already_installed" = false ]; then - LOG_INFO "步骤3: 安装 ant-contrib 软件包" - dnf install -y ant-contrib - CHECK_RESULT $? 0 0 "安装 ant-contrib 软件包失败" - fi - - LOG_INFO "步骤4: 测试 ant-contrib 核心命令的基本帮助功能" - LOG_INFO "执行 "ant-contrib -help" 命令" - ant-contrib -help - CHECK_RESULT $? 0 0 "执行 ant-contrib -help 命令失败" - - LOG_INFO "步骤5: 检查帮助输出是否包含预期关键词" - help_output=$(ant-contrib -help 2>&1) - if echo "$help_output" | grep -q "Usage\|用法\|帮助"; then - LOG_INFO "帮助信息输出正常,包含预期关键词" - else - LOG_ERROR "帮助信息输出异常,未找到预期关键词" - CHECK_RESULT 1 0 0 "帮助信息内容检查失败" - fi - - LOG_INFO "步骤6: 测试不支持的参数" - LOG_INFO "尝试使用不存在的参数 "--nonexistent"" - if ant-contrib --nonexistent &>/dev/null; then - LOG_ERROR "不支持的参数未按预期报错" - exit 255 - else - LOG_INFO "不支持的参数正确处理,命令执行失败为预期行为" - fi - - LOG_INFO "步骤7: 环境清理" - if [ "$already_installed" = false ]; then - LOG_INFO "卸载测试安装的 ant-contrib 软件包" - dnf remove -y ant-contrib - CHECK_RESULT $? 0 0 "卸载 ant-contrib 软件包失败" - LOG_INFO "已恢复测试前状态" - else - LOG_INFO "保持 ant-contrib 软件包的安装状态" - fi - - LOG_INFO "ant-contrib 基本帮助功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_cli.sh b/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_cli.sh deleted file mode 100644 index 55b4595dbc7..00000000000 --- a/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_cli.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 : 2025-12-09 -# @License : Mulan PSL v2 -# @Desc : 测试 ant-contrib-help 软件包的命令行接口功能,确保命令行参数解析正常。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查ant-contrib-help软件包是否已安装 - LOG_INFO "检查ant-contrib-help软件包是否已安装" - rpm -q ant-contrib-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "ant-contrib-help软件包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "ant-contrib-help软件包未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在ant-contrib-help软件包 - LOG_INFO "检查yum源中是否存在ant-contrib-help软件包" - dnf list available ant-contrib-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在ant-contrib-help软件包" - exit 255 - fi - - # 安装ant-contrib-help软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装ant-contrib-help软件包" - dnf install -y ant-contrib-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装ant-contrib-help软件包失败" - fi - - # 测试命令行接口功能 - LOG_INFO "测试ant-contrib-help命令行接口功能" - ant-contrib-help --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ant-contrib-help --help命令执行失败" - - # 测试不支持的参数(预期失败) - LOG_INFO "测试不支持的参数(预期失败)" - ant-contrib-help --invalid-arg > /dev/null 2>&1 - if [ $? -ne 255 ]; then - LOG_ERROR "不支持的参数未返回退出码255" - exit 255 - fi - - # 清理环境(如果最初未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载ant-contrib-help软件包" - dnf remove -y ant-contrib-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载ant-contrib-help软件包失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_config.sh b/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_config.sh deleted file mode 100644 index 1a9eab6bd8a..00000000000 --- a/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_config.sh +++ /dev/null @@ -1,115 +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 : 测试软件包的配置文件读取或生成功能,确保配置机制工作正常。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试软件包配置文件读取或生成功能 - - LOG_INFO "1. 检查是否已安装 ant-contrib 软件包" - rpm -q ant-contrib > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "ant-contrib 已安装,标记为已安装状态" - INSTALLED="true" - else - LOG_INFO "ant-contrib 未安装,标记为未安装状态" - INSTALLED="false" - fi - - LOG_INFO "2. 检查 yum 源中是否有 ant-contrib 软件包" - dnf list available ant-contrib > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 ant-contrib 软件包" - exit 255 - fi - - LOG_INFO "3. 如果未安装,则安装 ant-contrib 软件包" - if [ "$INSTALLED" = "false" ]; then - dnf install -y ant-contrib - CHECK_RESULT $? 0 0 "安装 ant-contrib 失败" - LOG_INFO "ant-contrib 安装成功" - fi - - LOG_INFO "4. 检查 ant-contrib 是否支持 --help 参数" - ant-contrib --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "ant-contrib 不支持 --help 参数" - # 如果是未安装状态,需要卸载 - if [ "$INSTALLED" = "false" ]; then - dnf remove -y ant-contrib - fi - exit 255 - fi - - LOG_INFO "5. 测试配置文件读取功能" - # 假设 ant-contrib 有一个配置文件读取功能 - # 这里使用一个示例命令来模拟配置文件读取 - CONFIG_FILE="/etc/ant-contrib/ant-contrib.properties" - if [ -f "$CONFIG_FILE" ]; then - LOG_INFO "找到配置文件 $CONFIG_FILE,测试读取" - cat "$CONFIG_FILE" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "读取配置文件失败" - else - LOG_INFO "配置文件不存在,测试生成默认配置" - # 模拟生成默认配置文件的命令 - ant-contrib --generate-config > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "生成默认配置文件失败" - # 检查生成的文件是否存在 - if [ -f "$CONFIG_FILE" ]; then - LOG_INFO "成功生成配置文件" - else - LOG_ERROR "生成配置文件失败" - CHECK_RESULT 1 0 0 "配置文件生成验证失败" - fi - fi - - LOG_INFO "6. 测试配置参数验证" - # 测试一个有效的配置参数 - ant-contrib --config-validate > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "配置参数验证失败" - - LOG_INFO "7. 测试无效参数处理" - # 测试一个不支持的参数,应该失败 - ant-contrib --invalid-parameter > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "无效参数正确处理,返回码为 255" - CHECK_RESULT 0 0 0 "无效参数处理失败" - else - LOG_ERROR "无效参数未正确处理" - # 如果是未安装状态,需要卸载 - if [ "$INSTALLED" = "false" ]; then - dnf remove -y ant-contrib - fi - exit 255 - fi - - LOG_INFO "8. 清理测试环境" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载测试安装的 ant-contrib 软件包" - dnf remove -y ant-contrib - CHECK_RESULT $? 0 0 "卸载 ant-contrib 失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "保持 ant-contrib 安装状态" - fi - - LOG_INFO "9. 测试完成,所有配置功能验证通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_help_cmd.sh b/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_help_cmd.sh deleted file mode 100644 index 5cf647e82f0..00000000000 --- a/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_help_cmd.sh +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-26 -# @License : Mulan PSL v2 -# @Desc : 测试软件包提供的命令行帮助功能,验证执行帮助命令能正确显示用法信息。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $1" - } - - LOG_ERROR() { - echo "[ERROR] $1" - } - - # 定义检查结果函数 - CHECK_RESULT() { - local actual=$1 - local expect=$2 - local code=$3 - local msg=$4 - if [ $actual -ne $expect ]; then - LOG_ERROR "$msg" - exit $code - fi - } - - # 定义SSH命令函数(仅作占位符,实际使用时需确保已定义) - SSH_CMD() { - # 模拟SSH命令执行 - local cmd=$1 - local node_ip=$2 - local node_password=$3 - local node_user=$4 - LOG_INFO "在节点 $node_ip 上执行命令: $cmd" - # 此处仅为示例,实际应实现SSH连接和执行 - sshpass -p "$node_password" ssh -o StrictHostKeyChecking=no "$node_user@$node_ip" "$cmd" - } - - # 定义软件包名称和命令 - PACKAGE_NAME="ant-contrib" - COMMAND_NAME="ant-contrib" - HELP_CMD="--help" - - # 检查软件包是否已安装 - LOG_INFO "检查是否已安装 $PACKAGE_NAME 软件包" - if rpm -q $PACKAGE_NAME &> /dev/null; then - LOG_INFO "$PACKAGE_NAME 已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "$PACKAGE_NAME 未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有 $PACKAGE_NAME 软件包" - if ! dnf list available $PACKAGE_NAME &> /dev/null; then - LOG_ERROR "yum源中未找到 $PACKAGE_NAME 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 $PACKAGE_NAME 软件包" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - - # 检查命令是否存在 - LOG_INFO "检查命令 $COMMAND_NAME 是否存在" - if ! command -v $COMMAND_NAME &> /dev/null; then - LOG_ERROR "命令 $COMMAND_NAME 不存在" - exit 255 - fi - - # 检查帮助参数是否支持 - LOG_INFO "检查命令 $COMMAND_NAME 是否支持帮助参数 $HELP_CMD" - if ! $COMMAND_NAME $HELP_CMD &> /dev/null; then - LOG_ERROR "命令 $COMMAND_NAME 不支持参数 $HELP_CMD" - exit 255 - fi - - # 执行帮助命令并验证输出 - LOG_INFO "执行命令 $COMMAND_NAME $HELP_CMD 并验证输出" - OUTPUT=$($COMMAND_NAME $HELP_CMD 2>&1) - CHECK_RESULT $? 0 0 "执行帮助命令失败" - if echo "$OUTPUT" | grep -q "用法\|用法信息\|帮助"; then - LOG_INFO "帮助命令输出包含用法信息,测试通过" - else - LOG_ERROR "帮助命令输出未包含用法信息" - exit 1 - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 $PACKAGE_NAME 软件包" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败" - LOG_INFO "环境已恢复到测试前的状态" - else - LOG_INFO "保持 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_install.sh b/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_install.sh deleted file mode 100644 index 5817d6050fd..00000000000 --- a/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_install.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 : 2026-03-26 -# @License : Mulan PSL v2 -# @Desc : 测试软件包ant-contrib-help的安装功能,确保可以通过包管理器成功安装。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试ant-contrib-help软件包的安装功能" - LOG_INFO "步骤1: 检查ant-contrib-help软件包是否已在yum源中" - dnf list available ant-contrib-help &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到ant-contrib-help软件包" - exit 255 - fi - - LOG_INFO "步骤2: 检查ant-contrib-help软件包是否已安装" - rpm -q ant-contrib-help &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "ant-contrib-help软件包已安装,测试将保持安装状态" - INSTALLED=true - else - LOG_INFO "ant-contrib-help软件包未安装,将执行安装测试" - INSTALLED=false - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3: 使用dnf安装ant-contrib-help软件包" - dnf install -y ant-contrib-help - CHECK_RESULT $? 0 0 "安装ant-contrib-help软件包失败" - fi - - LOG_INFO "步骤4: 验证ant-contrib-help软件包安装成功" - rpm -q ant-contrib-help - CHECK_RESULT $? 0 0 "验证ant-contrib-help软件包安装状态失败" - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤5: 清理环境,卸载测试安装的ant-contrib-help软件包" - dnf remove -y ant-contrib-help - CHECK_RESULT $? 0 0 "卸载ant-contrib-help软件包失败" - LOG_INFO "环境已恢复,ant-contrib-help软件包已卸载" - else - LOG_INFO "环境保持原有安装状态,无需清理" - fi - - LOG_INFO "ant-contrib-help软件包安装功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_uninstall.sh b/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_uninstall.sh deleted file mode 100644 index df0e98c7117..00000000000 --- a/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_uninstall.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 : 2026-03-26 -# @License : Mulan PSL v2 -# @Desc : 测试软件包ant-contrib-help的卸载功能,确保可以干净地移除软件包及其相关文件。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试ant-contrib-help软件包的卸载功能" - - LOG_INFO "步骤1: 检查系统中是否已安装ant-contrib-help软件包" - if dnf list installed ant-contrib-help &>/dev/null; then - LOG_INFO "检测到ant-contrib-help已安装,测试将验证卸载功能" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "检测到ant-contrib-help未安装,测试将先安装再卸载" - INSTALLED_BEFORE_TEST=false - fi - - LOG_INFO "步骤2: 检查yum源中是否存在ant-contrib-help软件包" - if ! dnf list available ant-contrib-help &>/dev/null; then - LOG_ERROR "yum源中未找到ant-contrib-help软件包" - exit 255 - fi - - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤3: 安装ant-contrib-help软件包" - dnf install -y ant-contrib-help - CHECK_RESULT $? 0 0 "安装ant-contrib-help软件包失败" - fi - - LOG_INFO "步骤4: 执行卸载命令,测试卸载功能" - dnf remove -y ant-contrib-help - CHECK_RESULT $? 0 0 "卸载ant-contrib-help软件包失败" - - LOG_INFO "步骤5: 验证软件包是否已成功卸载" - if dnf list installed ant-contrib-help &>/dev/null; then - LOG_ERROR "卸载后,ant-contrib-help软件包仍显示为已安装状态" - exit 1 - else - LOG_INFO "ant-contrib-help软件包已成功卸载" - fi - - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤6: 环境恢复 - 由于测试前未安装,无需重新安装" - else - LOG_INFO "步骤6: 环境恢复 - 重新安装ant-contrib-help软件包以恢复原始状态" - dnf install -y ant-contrib-help - CHECK_RESULT $? 0 0 "重新安装ant-contrib-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_usage.sh b/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_usage.sh deleted file mode 100644 index d70bd8e0633..00000000000 --- a/testcases/function_test/pkg_test/ant-contrib/ant-contrib-help/test_ant-contrib-help_function_usage.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-12-09 -# @License : Mulan PSL v2 -# @Desc : 测试 ant-contrib-help 软件包的使用说明功能,验证帮助文档是否正确。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 ant-contrib-help 软件包的使用说明功能,验证帮助文档是否正确。" - - LOG_INFO "步骤1:检查环境是否已安装 ant-contrib-help 软件包" - if dnf list installed ant-contrib-help &>/dev/null; then - LOG_INFO "环境已安装 ant-contrib-help 软件包,测试结束后将保持安装状态" - installed=true - else - LOG_INFO "环境未安装 ant-contrib-help 软件包,测试结束后将卸载" - installed=false - fi - - LOG_INFO "步骤2:检查 yum 源中是否存在 ant-contrib-help 软件包" - if ! dnf list available ant-contrib-help &>/dev/null; then - LOG_ERROR "yum 源中不存在 ant-contrib-help 软件包" - exit 255 - fi - - if [ "$installed" = false ]; then - LOG_INFO "步骤3:安装 ant-contrib-help 软件包" - dnf install -y ant-contrib-help - CHECK_RESULT $? 0 0 "安装 ant-contrib-help 软件包失败" - fi - - LOG_INFO "步骤4:验证 ant-contrib-help 命令的帮助文档功能" - ant-contrib-help --help &>/dev/null - CHECK_RESULT $? 0 0 "ant-contrib-help 命令的帮助文档功能验证失败" - - if [ "$installed" = false ]; then - LOG_INFO "步骤5:卸载 ant-contrib-help 软件包以恢复环境" - dnf remove -y ant-contrib-help - CHECK_RESULT $? 0 0 "卸载 ant-contrib-help 软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复初始状态" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dpkg/dpkg-help/test_dpkg-help_function_help.sh b/testcases/function_test/pkg_test/dpkg/dpkg-help/test_dpkg-help_function_help.sh deleted file mode 100644 index f11950a3547..00000000000 --- a/testcases/function_test/pkg_test/dpkg/dpkg-help/test_dpkg-help_function_help.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 : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Test dpkg-help help option -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 dpkg-help 的 help 选项功能" - - # 步骤1:检查系统中是否已安装 dpkg-help 软件包 - LOG_INFO "检查 dpkg-help 是否已安装" - if dnf list installed dpkg-help > /dev/null 2>&1; then - LOG_INFO "dpkg-help 已安装,将保持安装状态" - already_installed=true - else - LOG_INFO "dpkg-help 未安装,将在测试中安装" - already_installed=false - fi - - # 步骤2:检查 yum 源中是否有 dpkg-help 软件包 - LOG_INFO "检查 yum 源中是否有 dpkg-help 软件包" - if ! dnf list available dpkg-help > /dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 dpkg-help 软件包" - exit 255 - fi - - # 步骤3:如果未安装,则安装 dpkg-help - if [ "$already_installed" = false ]; then - LOG_INFO "安装 dpkg-help 软件包" - dnf install -y dpkg-help - CHECK_RESULT $? 0 0 "安装 dpkg-help 失败" - fi - - # 步骤4:测试 dpkg-help 的 help 选项 - LOG_INFO "测试 dpkg-help 的 help 选项" - dpkg-help --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "dpkg-help --help 执行失败" - - # 步骤5:测试不支持的参数 - LOG_INFO "测试不支持的参数" - dpkg-help --invalid-option > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "dpkg-help 不支持该参数" - exit 255 - fi - - # 步骤6:清理环境,如果测试前未安装则卸载 dpkg-help - if [ "$already_installed" = false ]; then - LOG_INFO "卸载 dpkg-help 软件包" - dnf remove -y dpkg-help - CHECK_RESULT $? 0 0 "卸载 dpkg-help 失败" - fi - - LOG_INFO "测试 dpkg-help 的 help 选项功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dpkg/dpkg-help/test_dpkg-help_function_install.sh b/testcases/function_test/pkg_test/dpkg/dpkg-help/test_dpkg-help_function_install.sh deleted file mode 100644 index 880a4d636ad..00000000000 --- a/testcases/function_test/pkg_test/dpkg/dpkg-help/test_dpkg-help_function_install.sh +++ /dev/null @@ -1,101 +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 installation of dpkg-help package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试dpkg-help软件包安装功能 - LOG_INFO "开始测试dpkg-help软件包安装功能" - - # 定义软件包名称 - PACKAGE_NAME="dpkg-help" - - # 步骤1:检查yum源中是否存在dpkg-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 "yum源中存在${PACKAGE_NAME}软件包" - - # 步骤2:检查dpkg-help软件包是否已经安装 - LOG_INFO "步骤2:检查${PACKAGE_NAME}软件包是否已经安装" - rpm -q ${PACKAGE_NAME} &>/dev/null - IS_INSTALLED=$? - - # 记录初始安装状态 - if [ ${IS_INSTALLED} -eq 0 ]; then - LOG_INFO "${PACKAGE_NAME}软件包已安装" - INITIAL_STATE="installed" - else - LOG_INFO "${PACKAGE_NAME}软件包未安装" - INITIAL_STATE="not_installed" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ ${IS_INSTALLED} -ne 0 ]; then - LOG_INFO "步骤3:安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}软件包失败" - LOG_INFO "${PACKAGE_NAME}软件包安装成功" - fi - - # 步骤4:验证软件包安装成功 - LOG_INFO "步骤4:验证${PACKAGE_NAME}软件包安装成功" - rpm -q ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "${PACKAGE_NAME}软件包未正确安装" - - # 步骤5:测试dpkg-help命令的基本功能 - LOG_INFO "步骤5:测试dpkg-help命令的基本功能" - dpkg-help --help &>/dev/null - CHECK_RESULT $? 0 0 "dpkg-help命令执行失败" - - # 步骤6:测试dpkg-help命令的特定参数(示例) - LOG_INFO "步骤6:测试dpkg-help命令的特定参数" - dpkg-help --version &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "dpkg-help命令不支持--version参数" - exit 255 - fi - LOG_INFO "dpkg-help命令支持--version参数" - - # 步骤7:清理环境,恢复到初始状态 - LOG_INFO "步骤7:清理环境,恢复到初始状态" - if [ "${INITIAL_STATE}" = "not_installed" ]; then - LOG_INFO "卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}软件包失败" - LOG_INFO "${PACKAGE_NAME}软件包卸载成功" - - # 验证软件包已卸载 - rpm -q ${PACKAGE_NAME} &>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "${PACKAGE_NAME}软件包卸载失败" - exit 1 - fi - LOG_INFO "环境已恢复到未安装状态" - else - LOG_INFO "保持${PACKAGE_NAME}软件包安装状态" - fi - - LOG_INFO "测试dpkg-help软件包安装功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dpkg/dpkg-help/test_dpkg-help_function_installed.sh b/testcases/function_test/pkg_test/dpkg/dpkg-help/test_dpkg-help_function_installed.sh deleted file mode 100644 index 165744e328f..00000000000 --- a/testcases/function_test/pkg_test/dpkg/dpkg-help/test_dpkg-help_function_installed.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-15 -# @License : Mulan PSL v2 -# @Desc : Test if dpkg-help is installed -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试dpkg-help是否安装 - LOG_INFO "开始测试dpkg-help是否已安装" - - # 定义软件包名称 - PACKAGE_NAME="dpkg-help" - LOG_INFO "检查软件包: ${PACKAGE_NAME}" - - # 检查是否已安装 - LOG_INFO "检查${PACKAGE_NAME}是否已安装" - if dnf list installed "${PACKAGE_NAME}" >/dev/null 2>&1; then - LOG_INFO "${PACKAGE_NAME}已安装,测试期间保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "${PACKAGE_NAME}未安装,将在测试期间安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有${PACKAGE_NAME}软件包" - if ! dnf list available "${PACKAGE_NAME}" >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "${ALREADY_INSTALLED}" -eq 0 ]; then - LOG_INFO "开始安装${PACKAGE_NAME}" - dnf install -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败" - LOG_INFO "${PACKAGE_NAME}安装成功" - fi - - # 测试dpkg-help命令 - LOG_INFO "测试dpkg-help命令" - dpkg-help --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "dpkg-help命令执行失败" - - # 测试dpkg-help的具体功能 - LOG_INFO "测试dpkg-help显示帮助信息" - dpkg-help | grep -q "Usage\|用法" - CHECK_RESULT $? 0 0 "dpkg-help未显示预期的帮助信息" - - # 测试不支持的参数 - LOG_INFO "测试dpkg-help不支持无效参数" - dpkg-help --invalid-param >/dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "无效参数正确处理,返回255" - # 继续执行,这是预期行为 - else - # 如果命令执行成功或返回其他错误码,检查是否为成功 - CHECK_RESULT $? 0 1 "无效参数处理不符合预期" - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "${ALREADY_INSTALLED}" -eq 0 ]; then - LOG_INFO "清理环境:卸载${PACKAGE_NAME}" - dnf remove -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败" - LOG_INFO "环境清理完成" - else - LOG_INFO "测试前${PACKAGE_NAME}已安装,保持安装状态" - fi - - LOG_INFO "测试完成:dpkg-help功能正常" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/dpkg/dpkg-help/test_dpkg-help_function_uninstall.sh b/testcases/function_test/pkg_test/dpkg/dpkg-help/test_dpkg-help_function_uninstall.sh deleted file mode 100644 index f7941ae3a43..00000000000 --- a/testcases/function_test/pkg_test/dpkg/dpkg-help/test_dpkg-help_function_uninstall.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Test removal of dpkg-help package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色输出(可选,如果LOG_INFO/LOG_ERROR需要) - LOG_INFO() { - echo -e "\033[32m[INFO]\033[0m $*" - } - - LOG_ERROR() { - echo -e "\033[31m[ERROR]\033[0m $*" - } - - # 定义软件包名称 - PACKAGE_NAME="dpkg-help" - - # 步骤1:检查yum源中是否存在dpkg-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 - - # 步骤2:检查当前环境是否已安装dpkg-help - LOG_INFO "步骤2:检查当前环境是否已安装$PACKAGE_NAME" - rpm -q "$PACKAGE_NAME" &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "$PACKAGE_NAME已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "$PACKAGE_NAME未安装,将在测试过程中安装并最终卸载" - INSTALLED_BEFORE=false - fi - - # 步骤3:安装dpkg-help软件包(如果未安装) - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3:安装$PACKAGE_NAME软件包" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装$PACKAGE_NAME失败" - LOG_INFO "$PACKAGE_NAME安装成功" - fi - - # 步骤4:验证dpkg-help命令是否存在 - LOG_INFO "步骤4:验证dpkg-help命令是否存在" - command -v dpkg-help &>/dev/null - CHECK_RESULT $? 0 0 "dpkg-help命令不存在" - - # 步骤5:测试dpkg-help命令基本功能 - LOG_INFO "步骤5:测试dpkg-help命令基本功能" - dpkg-help --help &>/dev/null - CHECK_RESULT $? 0 0 "dpkg-help --help执行失败" - - # 步骤6:测试不支持的参数 - LOG_INFO "步骤6:测试不支持的参数(例如--invalid-param)" - dpkg-help --invalid-param &>/dev/null - if [ $? -ne 255 ] && [ $? -ne 1 ]; then - LOG_ERROR "dpkg-help不支持--invalid-param参数,但未按预期退出" - exit 255 - fi - LOG_INFO "dpkg-help对不支持参数处理正确" - - # 步骤7:清理环境(如果测试前未安装,则卸载) - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤7:卸载$PACKAGE_NAME软件包" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载$PACKAGE_NAME失败" - LOG_INFO "$PACKAGE_NAME卸载成功,环境已恢复" - else - LOG_INFO "步骤7:测试前已安装$PACKAGE_NAME,保持安装状态" - fi - - LOG_INFO "测试完成:dpkg-help软件包卸载测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/fence-agents/fence-agents-docker/test_fence-agents-docker_function_agent_help.sh b/testcases/function_test/pkg_test/fence-agents/fence-agents-docker/test_fence-agents-docker_function_agent_help.sh deleted file mode 100644 index 5799bd1891c..00000000000 --- a/testcases/function_test/pkg_test/fence-agents/fence-agents-docker/test_fence-agents-docker_function_agent_help.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-04-04 -# @License : Mulan PSL v2 -# @Desc : Test help output of a docker fence agent -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test help output of a docker fence agent" - - # 定义软件包名称 - PACKAGE_NAME="fence-agents-docker" - - # 步骤1: 检查yum源中是否存在指定软件包 - LOG_INFO "步骤1: 检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available "$PACKAGE_NAME" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - - # 步骤2: 检查是否已经安装软件包 - LOG_INFO "步骤2: 检查是否已经安装软件包 $PACKAGE_NAME" - rpm -q "$PACKAGE_NAME" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已经安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试步骤中安装" - INSTALLED_BEFORE=0 - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤3: 安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4: 测试fence_agent_docker的帮助输出 - LOG_INFO "步骤4: 测试fence_agent_docker的帮助输出" - fence_agent_docker --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行 fence_agent_docker --help 失败" - - # 步骤5: 检查帮助输出是否包含关键信息 - LOG_INFO "步骤5: 检查帮助输出是否包含关键信息" - fence_agent_docker --help 2>&1 | grep -q "Usage:" - CHECK_RESULT $? 0 0 "帮助输出中未找到 "Usage:" 信息" - - # 步骤6: 如果之前未安装,则卸载软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤6: 卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - fi - - LOG_INFO "测试完成:Test help output of a docker fence agent" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/fence-agents/fence-agents-docker/test_fence-agents-docker_function_check_installed.sh b/testcases/function_test/pkg_test/fence-agents/fence-agents-docker/test_fence-agents-docker_function_check_installed.sh deleted file mode 100644 index 073947b9438..00000000000 --- a/testcases/function_test/pkg_test/fence-agents/fence-agents-docker/test_fence-agents-docker_function_check_installed.sh +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-04 -# @License : Mulan PSL v2 -# @Desc : Test if fence-agents-docker package is installed -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试fence-agents-docker软件包是否安装 - LOG_INFO "开始测试fence-agents-docker软件包安装功能" - - # 检查是否已安装fence-agents-docker - LOG_INFO "步骤1:检查当前环境中fence-agents-docker软件包是否已安装" - if rpm -q fence-agents-docker &>/dev/null; then - LOG_INFO "fence-agents-docker软件包已安装,标记为保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "fence-agents-docker软件包未安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "步骤2:检查yum源中是否有fence-agents-docker软件包" - if ! dnf list available fence-agents-docker &>/dev/null; then - LOG_ERROR "yum源中未找到fence-agents-docker软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装fence-agents-docker软件包" - dnf install -y fence-agents-docker - CHECK_RESULT $? 0 0 "安装fence-agents-docker软件包失败" - LOG_INFO "fence-agents-docker软件包安装成功" - fi - - # 验证软件包是否已正确安装 - LOG_INFO "步骤4:验证fence-agents-docker软件包是否已正确安装" - rpm -q fence-agents-docker - CHECK_RESULT $? 0 0 "验证fence-agents-docker软件包安装失败" - - # 检查fence命令是否可用 - LOG_INFO "步骤5:检查fence命令是否可用" - if ! command -v fence &>/dev/null; then - LOG_ERROR "fence命令不存在" - exit 255 - fi - - # 测试fence命令的基本功能 - LOG_INFO "步骤6:测试fence命令的基本功能" - fence --help - CHECK_RESULT $? 0 0 "fence命令执行失败" - - # 检查fence_docker代理是否可用 - LOG_INFO "步骤7:检查fence_docker代理是否可用" - if ! fence --list | grep -q docker; then - LOG_ERROR "fence_docker代理不存在或不支持" - exit 255 - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤8:清理测试环境,卸载fence-agents-docker软件包" - dnf remove -y fence-agents-docker - CHECK_RESULT $? 0 0 "卸载fence-agents-docker软件包失败" - LOG_INFO "fence-agents-docker软件包已成功卸载" - else - LOG_INFO "步骤8:保持fence-agents-docker软件包安装状态,无需卸载" - fi - - # 最终验证环境状态 - LOG_INFO "步骤9:验证环境状态" - if [ $ALREADY_INSTALLED -eq 0 ]; then - if rpm -q fence-agents-docker &>/dev/null; then - LOG_ERROR "环境清理失败,fence-agents-docker软件包仍存在" - exit 1 - else - LOG_INFO "环境已成功恢复到测试前状态" - fi - else - if ! rpm -q fence-agents-docker &>/dev/null; then - LOG_ERROR "环境被意外修改,fence-agents-docker软件包丢失" - exit 1 - else - LOG_INFO "环境保持测试前安装状态" - fi - fi - - LOG_INFO "fence-agents-docker软件包安装功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/fence-agents/fence-agents-docker/test_fence-agents-docker_function_list_agents.sh b/testcases/function_test/pkg_test/fence-agents/fence-agents-docker/test_fence-agents-docker_function_list_agents.sh deleted file mode 100644 index 23a0affab95..00000000000 --- a/testcases/function_test/pkg_test/fence-agents/fence-agents-docker/test_fence-agents-docker_function_list_agents.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 : 2026-04-04 -# @License : Mulan PSL v2 -# @Desc : Test listing available docker fence agents -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:列出可用的docker fence代理" - - # 检查是否已安装fence-agents-docker - LOG_INFO "步骤1:检查fence-agents-docker是否已安装" - if rpm -q fence-agents-docker &>/dev/null; then - LOG_INFO "fence-agents-docker已安装,标记为已存在安装" - INSTALLED_BEFORE_TEST=1 - else - LOG_INFO "fence-agents-docker未安装,标记为未安装" - INSTALLED_BEFORE_TEST=0 - fi - - # 检查yum源中是否有fence-agents-docker包 - LOG_INFO "步骤2:检查yum源中是否有fence-agents-docker软件包" - if ! dnf list available fence-agents-docker &>/dev/null; then - LOG_ERROR "yum源中没有fence-agents-docker软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then - LOG_INFO "步骤3:安装fence-agents-docker软件包" - dnf install -y fence-agents-docker - CHECK_RESULT $? 0 0 "安装fence-agents-docker失败" - fi - - # 测试列出可用的docker fence代理 - LOG_INFO "步骤4:执行fence_agent_metadata命令列出可用的docker fence代理" - if ! command -v fence_agent_metadata &>/dev/null; then - LOG_ERROR "fence_agent_metadata命令不存在" - exit 255 - fi - - # 检查fence_agent_metadata命令是否支持--list-agents参数 - LOG_INFO "步骤5:检查fence_agent_metadata命令是否支持--list-agents参数" - if ! fence_agent_metadata --help 2>&1 | grep -q "\-\-list\-agents"; then - LOG_ERROR "fence_agent_metadata命令不支持--list-agents参数" - exit 255 - fi - - # 执行命令列出代理 - LOG_INFO "步骤6:执行fence_agent_metadata --list-agents命令" - fence_agent_metadata --list-agents - CHECK_RESULT $? 0 0 "列出docker fence代理失败" - - # 环境恢复:如果测试前未安装,则卸载软件包 - if [ $INSTALLED_BEFORE_TEST -eq 0 ]; then - LOG_INFO "步骤7:卸载fence-agents-docker软件包" - dnf remove -y fence-agents-docker - CHECK_RESULT $? 0 0 "卸载fence-agents-docker失败" - else - LOG_INFO "步骤7:测试前已安装fence-agents-docker,保持安装状态" - fi - - LOG_INFO "测试完成:成功列出可用的docker fence代理" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/fence-agents/fence-agents-docker/test_fence-agents-docker_function_start.sh b/testcases/function_test/pkg_test/fence-agents/fence-agents-docker/test_fence-agents-docker_function_start.sh deleted file mode 100644 index 47af7011402..00000000000 --- a/testcases/function_test/pkg_test/fence-agents/fence-agents-docker/test_fence-agents-docker_function_start.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-10 -# @License : Mulan PSL v2 -# @Desc : Test the start functionality of fence-agents-docker -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 fence-agents-docker 的 start 功能" - - # 检查是否已安装 fence-agents-docker - LOG_INFO "检查 fence-agents-docker 是否已安装" - if dnf list installed fence-agents-docker &>/dev/null; then - LOG_INFO "fence-agents-docker 已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "fence-agents-docker 未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 fence-agents-docker - LOG_INFO "检查 yum 源中是否有 fence-agents-docker" - if ! dnf list available fence-agents-docker &>/dev/null; then - LOG_ERROR "yum 源中未找到 fence-agents-docker,退出测试" - exit 255 - fi - - # 如果未安装,则安装 fence-agents-docker - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 fence-agents-docker" - dnf install -y fence-agents-docker - CHECK_RESULT $? 0 0 "安装 fence-agents-docker 失败" - fi - - # 测试 start 功能 - LOG_INFO "测试 fence_agents_docker 的 start 功能" - fence_agents_docker start --help &>/dev/null - CHECK_RESULT $? 0 0 "fence_agents_docker start 命令不支持或参数错误" - - # 执行具体的 start 命令(示例) - LOG_INFO "执行具体的 start 命令" - fence_agents_docker start --container=test_container --action=reboot - CHECK_RESULT $? 0 0 "执行 fence_agents_docker start 命令失败" - - # SSH_CMD示例(如需在第二个节点执行命令) - # LOG_INFO "在第二个节点上执行命令" - # SSH_CMD ls $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER - - # 清理环境:如果脚本开始时未安装 fence-agents-docker,则卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 fence-agents-docker" - dnf remove -y fence-agents-docker - CHECK_RESULT $? 0 0 "卸载 fence-agents-docker 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/festival/festival-devel/test_festival-devel_function_build.sh b/testcases/function_test/pkg_test/festival/festival-devel/test_festival-devel_function_build.sh deleted file mode 100644 index 69f5099215b..00000000000 --- a/testcases/function_test/pkg_test/festival/festival-devel/test_festival-devel_function_build.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 : 测试festival-devel软件包的构建功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试festival-devel软件包的构建功能 - - LOG_INFO "开始测试festival-devel软件包的构建功能" - - # 检查festival-devel软件包是否已安装 - if dnf list installed festival-devel &>/dev/null; then - LOG_INFO "festival-devel软件包已安装,测试结束后将保持安装状态" - installed=true - else - LOG_INFO "festival-devel软件包未安装,测试结束后将卸载" - installed=false - fi - - # 检查yum源中是否存在festival-devel软件包 - LOG_INFO "检查yum源中是否存在festival-devel软件包" - if ! dnf list available festival-devel &>/dev/null; then - LOG_ERROR "yum源中未找到festival-devel软件包" - exit 255 - fi - - # 安装festival-devel软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装festival-devel软件包" - dnf install -y festival-devel - CHECK_RESULT $? 0 0 "安装festival-devel软件包失败" - fi - - # 测试festival-devel的构建功能 - LOG_INFO "测试festival-devel的构建功能" - festival --build - CHECK_RESULT $? 0 0 "festival-devel构建功能测试失败" - - # 清理环境:如果之前未安装,则卸载festival-devel - if [ "$installed" = false ]; then - LOG_INFO "卸载festival-devel软件包" - dnf remove -y festival-devel - CHECK_RESULT $? 0 0 "卸载festival-devel软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/glassfish-jaxb/glassfish-jaxb-parent/test_glassfish-jaxb-parent_function_bind.sh b/testcases/function_test/pkg_test/glassfish-jaxb/glassfish-jaxb-parent/test_glassfish-jaxb-parent_function_bind.sh deleted file mode 100644 index 5861afe654f..00000000000 --- a/testcases/function_test/pkg_test/glassfish-jaxb/glassfish-jaxb-parent/test_glassfish-jaxb-parent_function_bind.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 : Test Java-XML binding -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在glassfish-jaxb-parent软件包 - LOG_INFO "检查yum源中是否存在glassfish-jaxb-parent软件包" - dnf list available glassfish-jaxb-parent >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到glassfish-jaxb-parent软件包" - exit 255 - fi - - # 检查是否已安装glassfish-jaxb-parent - LOG_INFO "检查是否已安装glassfish-jaxb-parent" - rpm -q glassfish-jaxb-parent >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "glassfish-jaxb-parent已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "glassfish-jaxb-parent未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 若未安装,则安装glassfish-jaxb-parent - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装glassfish-jaxb-parent" - dnf install -y glassfish-jaxb-parent >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装glassfish-jaxb-parent失败" - fi - - # 测试Java-XML绑定功能 - LOG_INFO "测试Java-XML绑定功能" - jaxb_command="java -jar /usr/share/java/glassfish-jaxb-parent/jaxb-xjc.jar -version" - eval $jaxb_command >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "Java-XML绑定功能测试失败" - - # 若脚本开始时未安装,则在结束时卸载glassfish-jaxb-parent - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载glassfish-jaxb-parent" - dnf remove -y glassfish-jaxb-parent >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载glassfish-jaxb-parent失败" - fi - - LOG_INFO "测试脚本执行完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/glassfish-jaxb/glassfish-jaxb-parent/test_glassfish-jaxb-parent_function_generate.sh b/testcases/function_test/pkg_test/glassfish-jaxb/glassfish-jaxb-parent/test_glassfish-jaxb-parent_function_generate.sh deleted file mode 100644 index ad839cdcf35..00000000000 --- a/testcases/function_test/pkg_test/glassfish-jaxb/glassfish-jaxb-parent/test_glassfish-jaxb-parent_function_generate.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 : Test code generation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试代码生成功能" - - # 检查软件包是否已安装 - LOG_INFO "检查glassfish-jaxb-parent软件包是否已安装" - if dnf list installed glassfish-jaxb-parent &>/dev/null; then - LOG_INFO "glassfish-jaxb-parent软件包已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "glassfish-jaxb-parent软件包未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有glassfish-jaxb-parent软件包 - LOG_INFO "检查yum源中是否有glassfish-jaxb-parent软件包" - if ! dnf list available glassfish-jaxb-parent &>/dev/null; then - LOG_ERROR "yum源中未找到glassfish-jaxb-parent软件包" - exit 255 - fi - - # 安装glassfish-jaxb-parent软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装glassfish-jaxb-parent软件包" - dnf install -y glassfish-jaxb-parent - CHECK_RESULT $? 0 0 "安装glassfish-jaxb-parent软件包失败" - fi - - # 测试代码生成功能 - LOG_INFO "测试代码生成功能" - generate_command="glassfish-jaxb-parent generate" - $generate_command - CHECK_RESULT $? 0 0 "代码生成功能测试失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载glassfish-jaxb-parent软件包" - dnf remove -y glassfish-jaxb-parent - CHECK_RESULT $? 0 0 "卸载glassfish-jaxb-parent软件包失败" - fi - - LOG_INFO "测试代码生成功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/glassfish-jaxb/glassfish-jaxb-parent/test_glassfish-jaxb-parent_function_marshal.sh b/testcases/function_test/pkg_test/glassfish-jaxb/glassfish-jaxb-parent/test_glassfish-jaxb-parent_function_marshal.sh deleted file mode 100644 index dfc21915a21..00000000000 --- a/testcases/function_test/pkg_test/glassfish-jaxb/glassfish-jaxb-parent/test_glassfish-jaxb-parent_function_marshal.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 : Test XML marshalling -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test XML marshalling" - - # 检查是否已安装glassfish-jaxb-parent - LOG_INFO "检查glassfish-jaxb-parent是否已安装" - if dnf list installed glassfish-jaxb-parent &> /dev/null; then - LOG_INFO "glassfish-jaxb-parent已安装" - INSTALLED=true - else - LOG_INFO "glassfish-jaxb-parent未安装" - INSTALLED=false - fi - - # 检查yum源中是否有glassfish-jaxb-parent软件包 - LOG_INFO "检查yum源中是否有glassfish-jaxb-parent软件包" - if ! dnf list available glassfish-jaxb-parent &> /dev/null; then - LOG_ERROR "yum源中未找到glassfish-jaxb-parent软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装glassfish-jaxb-parent" - dnf install -y glassfish-jaxb-parent - CHECK_RESULT $? 0 0 "安装glassfish-jaxb-parent失败" - fi - - # 测试XML marshalling功能 - LOG_INFO "测试XML marshalling功能" - java -jar /usr/share/glassfish-jaxb-parent/bin/xjc.jar -version - CHECK_RESULT $? 0 0 "XML marshalling测试失败" - - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载glassfish-jaxb-parent" - dnf remove -y glassfish-jaxb-parent - CHECK_RESULT $? 0 0 "卸载glassfish-jaxb-parent失败" - fi - - LOG_INFO "测试完成:Test XML marshalling" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/glassfish-jaxb/glassfish-jaxb-parent/test_glassfish-jaxb-parent_function_unmarshal.sh b/testcases/function_test/pkg_test/glassfish-jaxb/glassfish-jaxb-parent/test_glassfish-jaxb-parent_function_unmarshal.sh deleted file mode 100644 index 542dde13d43..00000000000 --- a/testcases/function_test/pkg_test/glassfish-jaxb/glassfish-jaxb-parent/test_glassfish-jaxb-parent_function_unmarshal.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 : 2025-12-02 -# @License : Mulan PSL v2 -# @Desc : Test XML unmarshalling -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test XML unmarshalling" - - # 检查环境是否已安装 glassfish-jaxb-parent - LOG_INFO "检查 glassfish-jaxb-parent 是否已安装" - if dnf list installed glassfish-jaxb-parent &>/dev/null; then - LOG_INFO "glassfish-jaxb-parent 已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "glassfish-jaxb-parent 未安装,将在测试步骤中安装并在脚本结束前卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否存在 glassfish-jaxb-parent - LOG_INFO "检查 yum 源中是否存在 glassfish-jaxb-parent" - if ! dnf list available glassfish-jaxb-parent &>/dev/null; then - LOG_ERROR "yum 源中未找到 glassfish-jaxb-parent,退出测试" - exit 255 - fi - - # 如果未安装,则安装 glassfish-jaxb-parent - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 glassfish-jaxb-parent" - dnf install -y glassfish-jaxb-parent - CHECK_RESULT $? 0 0 "安装 glassfish-jaxb-parent 失败" - fi - - # 测试 XML unmarshalling 功能 - LOG_INFO "测试 XML unmarshalling 功能" - TEST_XML="value" - echo "$TEST_XML" > test.xml - jaxb-unmarshaller test.xml - CHECK_RESULT $? 0 0 "XML unmarshalling 测试失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.xml - - # 如果脚本开始时未安装 glassfish-jaxb-parent,则在脚本结束前卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 glassfish-jaxb-parent" - dnf remove -y glassfish-jaxb-parent - CHECK_RESULT $? 0 0 "卸载 glassfish-jaxb-parent 失败" - fi - - LOG_INFO "测试完成:Test XML unmarshalling" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/glassfish-jaxb/glassfish-jaxb-parent/test_glassfish-jaxb-parent_function_validate.sh b/testcases/function_test/pkg_test/glassfish-jaxb/glassfish-jaxb-parent/test_glassfish-jaxb-parent_function_validate.sh deleted file mode 100644 index ebc44ba5679..00000000000 --- a/testcases/function_test/pkg_test/glassfish-jaxb/glassfish-jaxb-parent/test_glassfish-jaxb-parent_function_validate.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 : Test XML validation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试:Test XML validation" - - # 检查软件包是否已安装 - LOG_INFO "检查glassfish-jaxb-parent软件包是否已安装" - if dnf list installed glassfish-jaxb-parent &>/dev/null; then - LOG_INFO "glassfish-jaxb-parent已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "glassfish-jaxb-parent未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有glassfish-jaxb-parent软件包 - LOG_INFO "检查yum源中是否有glassfish-jaxb-parent软件包" - if ! dnf list available glassfish-jaxb-parent &>/dev/null; then - LOG_ERROR "yum源中未找到glassfish-jaxb-parent软件包" - exit 255 - fi - - # 安装glassfish-jaxb-parent软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装glassfish-jaxb-parent软件包" - dnf install -y glassfish-jaxb-parent - CHECK_RESULT $? 0 0 "安装glassfish-jaxb-parent软件包失败" - fi - - # 测试XML验证功能 - LOG_INFO "测试XML验证功能" - xml_validation_cmd="jaxb-validate somefile.xml" - if ! command -v jaxb-validate &>/dev/null; then - LOG_ERROR "命令jaxb-validate不存在或不支持" - exit 255 - fi - - $xml_validation_cmd - CHECK_RESULT $? 0 0 "XML验证失败" - - # 清理环境(如果最初未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载glassfish-jaxb-parent软件包" - dnf remove -y glassfish-jaxb-parent - CHECK_RESULT $? 0 0 "卸载glassfish-jaxb-parent软件包失败" - fi - - LOG_INFO "测试完成:Test XML validation" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/jetbrains-annotations/jetbrains-annotations-help/test_jetbrains-annotations-help_function_install.sh b/testcases/function_test/pkg_test/jetbrains-annotations/jetbrains-annotations-help/test_jetbrains-annotations-help_function_install.sh deleted file mode 100644 index bc76fe9a6a1..00000000000 --- a/testcases/function_test/pkg_test/jetbrains-annotations/jetbrains-annotations-help/test_jetbrains-annotations-help_function_install.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-10-20 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试软件包安装功能" - - # 检查是否已安装jetbrains-annotations-help-function - if dnf list installed jetbrains-annotations-help-function &>/dev/null; then - LOG_INFO "jetbrains-annotations-help-function 已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "jetbrains-annotations-help-function 未安装,开始安装" - INSTALLED=false - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在jetbrains-annotations-help-function" - if ! dnf list available jetbrains-annotations-help-function &>/dev/null; then - LOG_ERROR "yum源中未找到jetbrains-annotations-help-function" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装jetbrains-annotations-help-function" - dnf install -y jetbrains-annotations-help-function - CHECK_RESULT $? 0 0 "安装jetbrains-annotations-help-function失败" - fi - - # 测试软件包功能(示例命令) - LOG_INFO "测试jetbrains-annotations-help-function功能" - jetbrains-annotations-help-function --version - CHECK_RESULT $? 0 0 "jetbrains-annotations-help-function功能测试失败" - - # 卸载软件包(如果脚本开始时未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载jetbrains-annotations-help-function" - dnf remove -y jetbrains-annotations-help-function - CHECK_RESULT $? 0 0 "卸载jetbrains-annotations-help-function失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/jetbrains-annotations/jetbrains-annotations-help/test_jetbrains-annotations-help_function_usage.sh b/testcases/function_test/pkg_test/jetbrains-annotations/jetbrains-annotations-help/test_jetbrains-annotations-help_function_usage.sh deleted file mode 100644 index 9687253a3a5..00000000000 --- a/testcases/function_test/pkg_test/jetbrains-annotations/jetbrains-annotations-help/test_jetbrains-annotations-help_function_usage.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-10-20 -# @License : Mulan PSL v2 -# @Desc : Test basic usage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_jetbrains-annotations-help_function_usage - - LOG_INFO "开始测试:Test basic usage" - - # 检查是否已安装jetbrains-annotations-help包 - LOG_INFO "检查jetbrains-annotations-help是否已安装" - if dnf list installed jetbrains-annotations-help &>/dev/null; then - LOG_INFO "jetbrains-annotations-help已安装,测试完成后保持安装状态" - INSTALLED=true - else - LOG_INFO "jetbrains-annotations-help未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有jetbrains-annotations-help包 - LOG_INFO "检查yum源中是否存在jetbrains-annotations-help包" - if ! dnf list available jetbrains-annotations-help &>/dev/null; then - LOG_ERROR "yum源中未找到jetbrains-annotations-help包" - exit 255 - fi - - # 安装jetbrains-annotations-help包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装jetbrains-annotations-help包" - dnf install -y jetbrains-annotations-help - CHECK_RESULT $? 0 0 "安装jetbrains-annotations-help失败" - fi - - # 测试jetbrains-annotations-help命令的基本用法 - LOG_INFO "测试jetbrains-annotations-help命令的基本用法" - output=$(jetbrains-annotations-help --help) - CHECK_RESULT $? 0 0 "执行jetbrains-annotations-help --help失败" - - # 检查输出是否包含帮助信息 - LOG_INFO "检查输出是否包含帮助信息" - if [[ "$output" != *"Usage"* ]]; then - LOG_ERROR "输出不包含帮助信息" - exit 255 - fi - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载jetbrains-annotations-help包" - dnf remove -y jetbrains-annotations-help - CHECK_RESULT $? 0 0 "卸载jetbrains-annotations-help失败" - fi - - LOG_INFO "测试完成:Test basic usage" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/kronosnet/libknet1-plugins-all/test_libknet1-plugins-all_function_load.sh b/testcases/function_test/pkg_test/kronosnet/libknet1-plugins-all/test_libknet1-plugins-all_function_load.sh deleted file mode 100644 index a38dd591b27..00000000000 --- a/testcases/function_test/pkg_test/kronosnet/libknet1-plugins-all/test_libknet1-plugins-all_function_load.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-28 -# @License : Mulan PSL v2 -# @Desc : Test the loading of plugins -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试插件加载功能" - - # 检查软件包是否已安装 - LOG_INFO "检查libknet1-plugins-all软件包是否已安装" - if rpm -q libknet1-plugins-all &>/dev/null; then - LOG_INFO "libknet1-plugins-all已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "libknet1-plugins-all未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在libknet1-plugins-all软件包" - if ! dnf list available libknet1-plugins-all &>/dev/null; then - LOG_ERROR "yum源中不存在libknet1-plugins-all软件包" - exit 255 - fi - - # 安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "正在安装libknet1-plugins-all软件包" - dnf install -y libknet1-plugins-all - CHECK_RESULT $? 0 0 "安装libknet1-plugins-all失败" - fi - - # 测试插件加载功能 - LOG_INFO "测试插件加载功能" - plugin_output=$(knet_plugins list) - CHECK_RESULT $? 0 0 "插件加载失败" - LOG_INFO "插件加载成功,输出结果: $plugin_output" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "正在卸载libknet1-plugins-all软件包" - dnf remove -y libknet1-plugins-all - CHECK_RESULT $? 0 0 "卸载libknet1-plugins-all失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/kronosnet/libknet1-plugins-all/test_libknet1-plugins-all_function_plugin_verify.sh b/testcases/function_test/pkg_test/kronosnet/libknet1-plugins-all/test_libknet1-plugins-all_function_plugin_verify.sh deleted file mode 100644 index e52e735905b..00000000000 --- a/testcases/function_test/pkg_test/kronosnet/libknet1-plugins-all/test_libknet1-plugins-all_function_plugin_verify.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-09 -# @License : Mulan PSL v2 -# @Desc : Verify plugin integrity -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Verify plugin integrity" - - # 检查yum源中是否存在libknet1-plugins-all软件包 - LOG_INFO "步骤1:检查yum源中是否存在libknet1-plugins-all软件包" - dnf list available libknet1-plugins-all > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到libknet1-plugins-all软件包" - exit 255 - fi - - # 检查是否已安装libknet1-plugins-all - LOG_INFO "步骤2:检查是否已安装libknet1-plugins-all" - rpm -q libknet1-plugins-all > /dev/null 2>&1 - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "libknet1-plugins-all已安装" - else - installed=false - LOG_INFO "libknet1-plugins-all未安装,将进行安装" - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "步骤3:安装libknet1-plugins-all软件包" - dnf install -y libknet1-plugins-all > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装libknet1-plugins-all失败" - fi - - # 验证插件完整性 - LOG_INFO "步骤4:验证插件完整性" - knet_plugins_verify_output=$(knet_plugins_verify 2>&1) - CHECK_RESULT $? 0 0 "插件完整性验证失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "步骤5:卸载libknet1-plugins-all软件包" - dnf remove -y libknet1-plugins-all > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载libknet1-plugins-all失败" - fi - - LOG_INFO "测试完成:Verify plugin integrity" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/perl-ExtUtils-LibBuilder/perl-ExtUtils-LibBuilder-help/test_perl-ExtUtils-LibBuilder-help_function_usage.sh b/testcases/function_test/pkg_test/perl-ExtUtils-LibBuilder/perl-ExtUtils-LibBuilder-help/test_perl-ExtUtils-LibBuilder-help_function_usage.sh deleted file mode 100644 index 787932b57a3..00000000000 --- a/testcases/function_test/pkg_test/perl-ExtUtils-LibBuilder/perl-ExtUtils-LibBuilder-help/test_perl-ExtUtils-LibBuilder-help_function_usage.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-21 -# @License : Mulan PSL v2 -# @Desc : 测试显示软件包提供的帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试显示软件包提供的帮助信息" - - # 定义软件包名称 - PACKAGE_NAME="perl-ExtUtils-LibBuilder" - - # 检查环境是否已安装指定软件包 - LOG_INFO "检查环境是否已安装 $PACKAGE_NAME" - if dnf list installed "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "$PACKAGE_NAME 已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "$PACKAGE_NAME 未安装,将在测试步骤中安装并在脚本结束前卸载" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有 $PACKAGE_NAME" - if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "yum源中未找到 $PACKAGE_NAME 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - - # 测试显示软件包提供的帮助信息 - LOG_INFO "测试显示 $PACKAGE_NAME 提供的帮助信息" - # 假设软件包提供了一个名为 extutils-libbuilder 的命令 - COMMAND="extutils-libbuilder" - if ! command -v "$COMMAND" &>/dev/null; then - LOG_ERROR "$COMMAND 命令不存在" - # 清理环境:如果之前未安装,则卸载 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "清理环境:卸载 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - fi - exit 255 - fi - - # 检查命令是否支持 --help 参数 - LOG_INFO "检查 $COMMAND 是否支持 --help 参数" - if ! "$COMMAND" --help &>/dev/null; then - LOG_ERROR "$COMMAND 不支持 --help 参数" - # 清理环境:如果之前未安装,则卸载 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "清理环境:卸载 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - fi - exit 255 - fi - - # 执行命令并检查结果 - LOG_INFO "执行 $COMMAND --help 命令" - "$COMMAND" --help - CHECK_RESULT $? 0 0 "执行 $COMMAND --help 失败" - - # 清理环境:如果之前未安装,则卸载 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "清理环境:卸载 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败" - fi - - LOG_INFO "测试完成:成功测试显示软件包提供的帮助信息" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-configshell/python3-configshell/test_python3-configshell_function_config.sh b/testcases/function_test/pkg_test/python-configshell/python3-configshell/test_python3-configshell_function_config.sh deleted file mode 100644 index 9148b5787f5..00000000000 --- a/testcases/function_test/pkg_test/python-configshell/python3-configshell/test_python3-configshell_function_config.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-07 -# @License : Mulan PSL v2 -# @Desc : Test configuration handling -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装python3-configshell - LOG_INFO "检查是否已安装python3-configshell" - if dnf list installed python3-configshell &> /dev/null; then - LOG_INFO "python3-configshell已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-configshell未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python3-configshell软件包 - LOG_INFO "检查yum源中是否有python3-configshell软件包" - if ! dnf list available python3-configshell &> /dev/null; then - LOG_ERROR "yum源中未找到python3-configshell软件包" - exit 255 - fi - - # 如果未安装,则安装python3-configshell - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装python3-configshell" - dnf install -y python3-configshell - CHECK_RESULT $? 0 0 "安装python3-configshell失败" - fi - - # 测试配置处理功能 - LOG_INFO "测试配置处理功能" - python3-configshell --version &> /dev/null - CHECK_RESULT $? 0 0 "获取python3-configshell版本失败" - - # 测试不支持的参数 - LOG_INFO "测试不支持的参数" - python3-configshell --invalid-arg &> /dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "不支持的参数未正确退出" - exit 255 - fi - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-configshell" - dnf remove -y python3-configshell &> /dev/null || { - LOG_ERROR "卸载python3-configshell失败" - exit 1 - } - else - LOG_INFO "保持已安装的python3-configshell状态" - fi - - LOG_INFO "测试完成,环境已恢复" - exit 0 -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-configshell/python3-configshell/test_python3-configshell_function_execute.sh b/testcases/function_test/pkg_test/python-configshell/python3-configshell/test_python3-configshell_function_execute.sh deleted file mode 100644 index 756614f696b..00000000000 --- a/testcases/function_test/pkg_test/python-configshell/python3-configshell/test_python3-configshell_function_execute.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-07 -# @License : Mulan PSL v2 -# @Desc : Test command execution -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试命令执行功能" - - # 检查是否已安装python3-configshell - if dnf list installed python3-configshell &>/dev/null; then - LOG_INFO "python3-configshell 已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-configshell 未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有python3-configshell包 - LOG_INFO "检查yum源中是否存在python3-configshell包" - if ! dnf list available python3-configshell &>/dev/null; then - LOG_ERROR "yum源中未找到python3-configshell包" - exit 255 - fi - - # 安装python3-configshell(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装python3-configshell" - dnf install -y python3-configshell - CHECK_RESULT $? 0 0 "安装python3-configshell失败" - fi - - # 测试命令执行 - LOG_INFO "测试命令执行" - output=$(python3-configshell --version) - CHECK_RESULT $? 0 0 "执行python3-configshell --version失败" - - # 检查命令参数是否支持 - LOG_INFO "检查不支持的参数" - output=$(python3-configshell --invalid-arg 2>&1) - if [ $? -ne 255 ]; then - LOG_ERROR "不支持的参数未正确退出" - exit 255 - fi - - # SSH_CMD示例(如果需要) - # LOG_INFO "在第二个节点上执行命令" - # SSH_CMD ls $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-configshell以恢复环境" - dnf remove -y python3-configshell - CHECK_RESULT $? 0 0 "卸载python3-configshell失败" - fi - - LOG_INFO "测试命令执行功能完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-configshell/python3-configshell/test_python3-configshell_function_help.sh b/testcases/function_test/pkg_test/python-configshell/python3-configshell/test_python3-configshell_function_help.sh deleted file mode 100644 index 1e936bf2116..00000000000 --- a/testcases/function_test/pkg_test/python-configshell/python3-configshell/test_python3-configshell_function_help.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-07 -# @License : Mulan PSL v2 -# @Desc : Test help command output -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查python3-config是否存在 - LOG_INFO "检查python3-config命令是否存在" - command -v python3-config >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-config已安装" - installed=true - else - LOG_INFO "python3-config未安装,将进行安装测试" - installed=false - fi - - # 检查yum源中是否有python3-devel包 - LOG_INFO "检查yum源中是否有python3-devel包" - dnf list available python3-devel >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-devel包" - exit 255 - fi - - # 如果未安装,则安装python3-devel - if [ "$installed" = false ]; then - LOG_INFO "安装python3-devel包" - dnf install -y python3-devel >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装python3-devel失败" - fi - - # 测试help命令输出 - LOG_INFO "测试python3-config --help命令输出" - python3-config --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "python3-config --help命令执行失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-devel包" - dnf remove -y python3-devel >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载python3-devel失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-jupyter-sphinx/python-jupyter-sphinx-help/test_python-jupyter-sphinx-help_function_install.sh b/testcases/function_test/pkg_test/python-jupyter-sphinx/python-jupyter-sphinx-help/test_python-jupyter-sphinx-help_function_install.sh deleted file mode 100644 index 8d1da3b264d..00000000000 --- a/testcases/function_test/pkg_test/python-jupyter-sphinx/python-jupyter-sphinx-help/test_python-jupyter-sphinx-help_function_install.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-03 -# @License : Mulan PSL v2 -# @Desc : Test installation of the package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在指定的软件包 - check_package_availability() { - dnf list available "$1" &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $1 在yum源中不存在" - exit 255 - fi - } - - # 检查命令参数是否支持 - check_command_option() { - if ! "$@" --help &> /dev/null; then - LOG_ERROR "命令 $1 不支持指定的参数" - exit 255 - fi - } - - # 检查环境是否已安装指定软件包 - check_installed() { - if rpm -q "$1" &> /dev/null; then - LOG_INFO "软件包 $1 已安装" - return 0 - else - LOG_INFO "软件包 $1 未安装" - return 1 - fi - } - - # 主测试函数 - test_python_jupyter_sphinx_help_function_install() { - PACKAGE="python-jupyter-sphinx-help" - - # 步骤1:检查软件包是否已在环境中安装 - LOG_INFO "步骤1:检查环境是否已安装 $PACKAGE" - if check_installed "$PACKAGE"; then - INSTALLED=true - else - INSTALLED=false - fi - - # 步骤2:检查yum源中是否存在该软件包 - LOG_INFO "步骤2:检查yum源中是否存在 $PACKAGE" - check_package_availability "$PACKAGE" - - # 如果未安装,则执行安装步骤 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装 $PACKAGE" - dnf install -y "$PACKAGE" - CHECK_RESULT $? 0 0 "安装 $PACKAGE 失败" - - # 步骤4:验证安装后的功能 - LOG_INFO "步骤4:验证 $PACKAGE 功能" - jupyter --help &> /dev/null - CHECK_RESULT $? 0 0 "jupyter 命令执行失败" - - # 步骤5:卸载软件包 - LOG_INFO "步骤5:卸载 $PACKAGE" - dnf remove -y "$PACKAGE" - CHECK_RESULT $? 0 0 "卸载 $PACKAGE 失败" - - #清理残留文件 - LOG_INFO “清理残留文件” - rm -rf ~/.jupyter - CHECK_RESULT $? 0 0 “清理残留文件失败” - else - # 如果已安装,则跳过安装和卸载步骤,仅验证功能 - LOG_INFO “$PACKAGE 已安装,跳过安装步骤” - - #验证功能 - LOG_INFO “验证 $PACKAGE 功能” - jupyter --help &> /dev/null - CHECK_RESULT \$? 00“jupyter命令执行失败” - fi - } - - #执行测试用例 - test_python_jupyter_sphinx_help_function_install - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-jupyter-sphinx/python3-jupyter-sphinx/test_python3-jupyter-sphinx_function_render.sh b/testcases/function_test/pkg_test/python-jupyter-sphinx/python3-jupyter-sphinx/test_python3-jupyter-sphinx_function_render.sh deleted file mode 100644 index d1c4090dbe8..00000000000 --- a/testcases/function_test/pkg_test/python-jupyter-sphinx/python3-jupyter-sphinx/test_python3-jupyter-sphinx_function_render.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-10 -# @License : Mulan PSL v2 -# @Desc : 测试 python3-jupyter-sphinx 软件包的渲染功能,确保文档可以正常渲染。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 python3-jupyter-sphinx 软件包的渲染功能" - - # 检查环境是否已安装 python3-jupyter-sphinx - LOG_INFO "检查是否已安装 python3-jupyter-sphinx" - dnf list installed python3-jupyter-sphinx > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-jupyter-sphinx 已安装,跳过安装步骤" - installed=true - else - LOG_INFO "python3-jupyter-sphinx 未安装,准备安装" - installed=false - fi - - # 检查 yum 源中是否有 python3-jupyter-sphinx - LOG_INFO "检查 yum 源中是否有 python3-jupyter-sphinx" - dnf list available python3-jupyter-sphinx > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 python3-jupyter-sphinx 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装 python3-jupyter-sphinx" - dnf install -y python3-jupyter-sphinx - CHECK_RESULT $? 0 0 "安装 python3-jupyter-sphinx 失败" - fi - - # 测试渲染功能 - LOG_INFO "测试 python3-jupyter-sphinx 的渲染功能" - jupyter-nbconvert --to html --execute /usr/share/doc/python3-jupyter-sphinx/examples/example.ipynb > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "文档渲染失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载 python3-jupyter-sphinx" - dnf remove -y python3-jupyter-sphinx - CHECK_RESULT $? 0 0 "卸载 python3-jupyter-sphinx 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sshj/sshj/test_sshj_function_basic_conn.sh b/testcases/function_test/pkg_test/sshj/sshj/test_sshj_function_basic_conn.sh deleted file mode 100644 index 5426990ab85..00000000000 --- a/testcases/function_test/pkg_test/sshj/sshj/test_sshj_function_basic_conn.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 establishing a basic SSH connection to a server -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装ssh客户端软件包 - LOG_INFO "检查是否已安装ssh客户端软件包" - rpm -q openssh-clients > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "ssh客户端已安装,测试结束后将保持安装状态" - already_installed=true - else - LOG_INFO "ssh客户端未安装,将在测试中安装" - already_installed=false - fi - - # 检查yum源中是否有openssh-clients软件包 - LOG_INFO "检查yum源中是否有openssh-clients软件包" - dnf list available openssh-clients > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到openssh-clients软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到openssh-clients软件包" - exit 255 - fi - - # 如果未安装,则安装openssh-clients - if [ "$already_installed" = false ]; then - LOG_INFO "安装openssh-clients软件包" - dnf install -y openssh-clients - CHECK_RESULT $? 0 0 "安装openssh-clients失败" - fi - - # 检查ssh命令是否支持基本连接参数 - LOG_INFO "检查ssh命令参数支持情况" - ssh -V > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ssh命令不存在或不支持" - - # 测试基本的SSH连接 - LOG_INFO "测试建立基本的SSH连接到服务器" - if [ -z "$NODE2_IPV4" ] || [ -z "$NODE2_USER" ] || [ -z "$NODE2_PASSWORD" ]; then - LOG_ERROR "未设置远程服务器连接信息" - exit 1 - fi - - # 使用SSH_CMD执行简单的命令测试连接 - LOG_INFO "尝试通过SSH连接到远程服务器" - SSH_CMD "echo "SSH连接测试成功"" $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER - CHECK_RESULT $? 0 0 "SSH连接测试失败" - - LOG_INFO "SSH基本连接测试成功" - - # 环境清理 - LOG_INFO "清理测试环境" - if [ "$already_installed" = false ]; then - LOG_INFO "卸载测试安装的openssh-clients软件包" - dnf remove -y openssh-clients - CHECK_RESULT $? 0 0 "卸载openssh-clients失败" - else - LOG_INFO "保持openssh-clients软件包安装状态" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sshj/sshj/test_sshj_function_conn_timeout.sh b/testcases/function_test/pkg_test/sshj/sshj/test_sshj_function_conn_timeout.sh deleted file mode 100644 index be3f8f04832..00000000000 --- a/testcases/function_test/pkg_test/sshj/sshj/test_sshj_function_conn_timeout.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-04-05 -# @License : Mulan PSL v2 -# @Desc : Test SSH connection timeout behavior -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "测试SSH连接超时行为" - - LOG_INFO "步骤1: 检查软件包是否在yum源中" - if ! dnf list available openssh-server &>/dev/null; then - LOG_ERROR "软件包openssh-server不在yum源中" - exit 255 - fi - - LOG_INFO "步骤2: 检查当前环境是否已安装openssh-server" - if rpm -q openssh-server &>/dev/null; then - LOG_INFO "openssh-server已安装,测试结束后保持安装状态" - ALREADY_INSTALLED=true - else - LOG_INFO "openssh-server未安装,将在测试中安装" - ALREADY_INSTALLED=false - fi - - if [ "$ALREADY_INSTALLED" = "false" ]; then - LOG_INFO "步骤3: 安装openssh-server" - dnf install -y openssh-server - CHECK_RESULT $? 0 0 "安装openssh-server失败" - fi - - LOG_INFO "步骤4: 启动sshd服务" - systemctl start sshd - CHECK_RESULT $? 0 0 "启动sshd服务失败" - - LOG_INFO "步骤5: 检查ssh命令是否支持ConnectTimeout参数" - if ! ssh -o ConnectTimeout=1 2>&1 | grep -q "usage:"; then - LOG_ERROR "ssh命令不支持ConnectTimeout参数" - exit 255 - fi - - LOG_INFO "步骤6: 测试SSH连接超时行为" - ssh -o ConnectTimeout=1 -o PasswordAuthentication=no localhost 2>&1 | grep -q "Connection timed out" - CHECK_RESULT $? 0 0 "SSH连接超时行为不符合预期" - - LOG_INFO "步骤7: 清理测试环境" - if [ "$ALREADY_INSTALLED" = "false" ]; then - LOG_INFO "卸载测试安装的openssh-server" - dnf remove -y openssh-server - CHECK_RESULT $? 0 0 "卸载openssh-server失败" - else - LOG_INFO "保持openssh-server安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sshj/sshj/test_sshj_function_exec_cmd.sh b/testcases/function_test/pkg_test/sshj/sshj/test_sshj_function_exec_cmd.sh deleted file mode 100644 index 70e0242db90..00000000000 --- a/testcases/function_test/pkg_test/sshj/sshj/test_sshj_function_exec_cmd.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 : 2026-04-05 -# @License : Mulan PSL v2 -# @Desc : Test executing a command on a remote server via SSH -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:通过SSH在远程服务器上执行命令" - - # 定义软件包名称 - PACKAGE_NAME="openssh-clients" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在软件包:$PACKAGE_NAME" - dnf list available $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - - # 检查环境是否已安装软件包 - LOG_INFO "检查环境是否已安装软件包:$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 - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装软件包:$PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 检查SSH命令参数是否存在或不支持 - LOG_INFO "检查SSH命令参数" - ssh -V > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "SSH命令不存在或不支持" - - # 定义远程服务器信息(示例变量,实际使用时需根据环境设置) - NODE2_IPV4="192.168.1.100" - NODE2_PASSWORD="password" - NODE2_USER="root" - - # 通过SSH在远程服务器上执行命令 - LOG_INFO "通过SSH在远程服务器上执行命令:ls" - SSH_CMD ls $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER - CHECK_RESULT $? 0 0 "在远程服务器上执行命令失败" - - # 环境恢复:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载软件包:$PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "测试前软件包已安装,保持安装状态" - fi - - LOG_INFO "测试完成:通过SSH在远程服务器上执行命令" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sshj/sshj/test_sshj_function_file_transfer.sh b/testcases/function_test/pkg_test/sshj/sshj/test_sshj_function_file_transfer.sh deleted file mode 100644 index 3732e556fec..00000000000 --- a/testcases/function_test/pkg_test/sshj/sshj/test_sshj_function_file_transfer.sh +++ /dev/null @@ -1,101 +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 uploading and downloading files using SFTP -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试SFTP文件上传下载功能" - - LOG_INFO "检查是否已安装openssh-clients包" - if rpm -q openssh-clients &> /dev/null; then - LOG_INFO "openssh-clients已安装,测试后将保持安装状态" - already_installed=true - else - LOG_INFO "openssh-clients未安装,将在测试中安装" - already_installed=false - fi - - LOG_INFO "检查yum源中是否有openssh-clients包" - if ! dnf list openssh-clients &> /dev/null; then - LOG_ERROR "yum源中未找到openssh-clients包" - exit 255 - fi - - if [ "$already_installed" = "false" ]; then - LOG_INFO "安装openssh-clients包" - dnf install -y openssh-clients - CHECK_RESULT $? 0 0 "安装openssh-clients失败" - fi - - LOG_INFO "检查sftp命令是否存在" - if ! command -v sftp &> /dev/null; then - LOG_ERROR "sftp命令不存在" - exit 255 - fi - - LOG_INFO "检查sftp命令是否支持-b参数" - sftp -h 2>&1 | grep -q "\-b" || { - LOG_ERROR "sftp命令不支持-b参数" - exit 255 - } - - LOG_INFO "创建测试目录和文件" - test_dir="/tmp/sftp_test_$$" - mkdir -p "$test_dir" - echo "test content" > "$test_dir/local_test.txt" - - LOG_INFO "测试SFTP上传文件到远程服务器" - upload_script="$test_dir/upload.txt" - echo "put $test_dir/local_test.txt remote_test.txt" > "$upload_script" - - SSH_CMD "mkdir -p /tmp/sftp_test" "$NODE2_IPV4" "$NODE2_PASSWORD" "$NODE2_USER" - sftp -b "$upload_script" "$NODE2_USER@$NODE2_IPV4:/tmp/sftp_test" - CHECK_RESULT $? 0 0 "SFTP上传文件失败" - - LOG_INFO "测试SFTP从远程服务器下载文件" - download_script="$test_dir/download.txt" - echo "get /tmp/sftp_test/remote_test.txt $test_dir/downloaded_test.txt" > "$download_script" - sftp -b "$download_script" "$NODE2_USER@$NODE2_IPV4" - CHECK_RESULT $? 0 0 "SFTP下载文件失败" - - LOG_INFO "验证下载的文件内容" - downloaded_file="$test_dir/downloaded_test.txt" - if [ -f "$downloaded_file" ] && [ "$(cat "$downloaded_file")" = "test content" ]; then - LOG_INFO "文件内容验证成功" - else - LOG_ERROR "下载的文件内容不正确" - exit 1 - fi - - LOG_INFO "清理测试环境" - SSH_CMD "rm -rf /tmp/sftp_test" "$NODE2_IPV4" "$NODE2_PASSWORD" "$NODE2_USER" - rm -rf "$test_dir" - - if [ "$already_installed" = "false" ]; then - LOG_INFO "卸载测试安装的openssh-clients包" - dnf remove -y openssh-clients - CHECK_RESULT $? 0 0 "卸载openssh-clients失败" - fi - - LOG_INFO "SFTP文件上传下载测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sshj/sshj/test_sshj_function_session_channel.sh b/testcases/function_test/pkg_test/sshj/sshj/test_sshj_function_session_channel.sh deleted file mode 100644 index 701d8991e54..00000000000 --- a/testcases/function_test/pkg_test/sshj/sshj/test_sshj_function_session_channel.sh +++ /dev/null @@ -1,130 +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 opening and using interactive shell channels -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装openssh-server和openssh-clients - LOG_INFO "检查是否已安装openssh-server和openssh-clients" - rpm -q openssh-server openssh-clients > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "openssh-server和openssh-clients已安装,标记为已安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "openssh-server和openssh-clients未安装,标记为未安装状态" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否有openssh-server和openssh-clients软件包 - LOG_INFO "检查yum源中是否有openssh-server和openssh-clients软件包" - dnf list available openssh-server openssh-clients > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到openssh-server或openssh-clients软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ ${INSTALLED_FLAG} -eq 0 ]; then - LOG_INFO "开始安装openssh-server和openssh-clients" - dnf install -y openssh-server openssh-clients - CHECK_RESULT $? 0 0 "安装openssh-server和openssh-clients失败" - LOG_INFO "openssh-server和openssh-clients安装成功" - fi - - # 启动sshd服务 - LOG_INFO "启动sshd服务" - systemctl start sshd - CHECK_RESULT $? 0 0 "启动sshd服务失败" - LOG_INFO "sshd服务启动成功" - - # 检查sshd服务状态 - LOG_INFO "检查sshd服务状态" - systemctl status sshd | grep "active (running)" - CHECK_RESULT $? 0 0 "sshd服务未正常运行" - LOG_INFO "sshd服务正常运行" - - # 生成SSH密钥对(如果不存在) - LOG_INFO "生成SSH密钥对(如果不存在)" - if [ ! -f ~/.ssh/id_rsa ]; then - ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa - CHECK_RESULT $? 0 0 "生成SSH密钥对失败" - LOG_INFO "SSH密钥对生成成功" - else - LOG_INFO "SSH密钥对已存在,跳过生成" - fi - - # 将公钥添加到authorized_keys - LOG_INFO "将公钥添加到authorized_keys" - cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys - CHECK_RESULT $? 0 0 "将公钥添加到authorized_keys失败" - chmod 600 ~/.ssh/authorized_keys - CHECK_RESULT $? 0 0 "设置authorized_keys权限失败" - LOG_INFO "公钥已添加到authorized_keys" - - # 测试本地SSH连接 - LOG_INFO "测试本地SSH连接" - ssh -o StrictHostKeyChecking=no -o PasswordAuthentication=no localhost "echo "SSH连接测试成功"" - CHECK_RESULT $? 0 0 "本地SSH连接测试失败" - LOG_INFO "本地SSH连接测试成功" - - # 测试打开和使用交互式shell通道 - LOG_INFO "测试打开和使用交互式shell通道" - ssh -o StrictHostKeyChecking=no -o PasswordAuthentication=no localhost << "EOF" - echo "交互式shell通道测试开始" - whoami - pwd - ls -la - echo "交互式shell通道测试结束" - EOF - CHECK_RESULT $? 0 0 "打开和使用交互式shell通道测试失败" - LOG_INFO "打开和使用交互式shell通道测试成功" - - # 如果第二个服务器信息存在,则在第二个服务器上执行命令 - if [ -n "${NODE2_IPV4}" ] && [ -n "${NODE2_PASSWORD}" ] && [ -n "${NODE2_USER}" ]; then - LOG_INFO "在第二个服务器上测试SSH连接" - SSH_CMD "echo "在第二个服务器上执行命令测试"" ${NODE2_IPV4} ${NODE2_PASSWORD} ${NODE2_USER} - CHECK_RESULT $? 0 0 "在第二个服务器上执行命令测试失败" - LOG_INFO "在第二个服务器上执行命令测试成功" - else - LOG_INFO "未提供第二个服务器信息,跳过在第二个服务器上的测试" - fi - - # 清理环境 - LOG_INFO "开始清理测试环境" - - # 停止sshd服务 - LOG_INFO "停止sshd服务" - systemctl stop sshd - CHECK_RESULT $? 0 0 "停止sshd服务失败" - LOG_INFO "sshd服务已停止" - - # 如果测试前未安装,则卸载软件包 - if [ ${INSTALLED_FLAG} -eq 0 ]; then - LOG_INFO "卸载openssh-server和openssh-clients" - dnf remove -y openssh-server openssh-clients - CHECK_RESULT $? 0 0 "卸载openssh-server和openssh-clients失败" - LOG_INFO "openssh-server和openssh-clients卸载成功" - else - LOG_INFO "测试前已安装openssh-server和openssh-clients,保持安装状态" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sshj/sshj/test_sshj_function_version.sh b/testcases/function_test/pkg_test/sshj/sshj/test_sshj_function_version.sh deleted file mode 100644 index 451d2e5c1da..00000000000 --- a/testcases/function_test/pkg_test/sshj/sshj/test_sshj_function_version.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 : 2026-04-05 -# @License : Mulan PSL v2 -# @Desc : Test retrieving and verifying the SSHj library version -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:获取并验证SSHj库版本" - LOG_INFO "步骤1:检查SSHj软件包是否在yum源中可用" - dnf list available sshj 2>/dev/null | grep -q sshj - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到sshj软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查当前环境是否已安装sshj" - rpm -q sshj > /dev/null 2>&1 - installed=$? - - if [ $installed -ne 0 ]; then - LOG_INFO "环境未安装sshj,将进行安装" - dnf install -y sshj - CHECK_RESULT $? 0 0 "安装sshj失败" - need_uninstall=1 - else - LOG_INFO "环境已安装sshj,将保持安装状态" - need_uninstall=0 - fi - - LOG_INFO "步骤3:测试获取SSHj版本命令" - if ! command -v sshj > /dev/null 2>&1; then - LOG_ERROR "sshj命令不存在或不支持" - if [ $need_uninstall -eq 1 ]; then - dnf remove -y sshj - fi - exit 255 - fi - - LOG_INFO "步骤4:执行sshj版本查询命令" - sshj --version - CHECK_RESULT $? 0 0 "执行sshj --version命令失败" - - LOG_INFO "步骤5:验证版本输出格式" - version_output=$(sshj --version 2>&1) - echo "$version_output" | grep -q -E "[0-9]+\.[0-9]+\.[0-9]+" - CHECK_RESULT $? 0 0 "版本号格式不符合预期" - - LOG_INFO "步骤6:环境清理" - if [ $need_uninstall -eq 1 ]; then - LOG_INFO "卸载测试安装的sshj软件包" - dnf remove -y sshj - CHECK_RESULT $? 0 0 "卸载sshj失败" - else - LOG_INFO "保持sshj安装状态,无需卸载" - fi - - LOG_INFO "测试完成:成功获取并验证SSHj库版本" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-a/texlive-armtex/test_texlive-armtex_function_install.sh b/testcases/function_test/pkg_test/texlive-split-a/texlive-armtex/test_texlive-armtex_function_install.sh deleted file mode 100644 index b6c6422bab5..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-a/texlive-armtex/test_texlive-armtex_function_install.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-11-25 -# @License : Mulan PSL v2 -# @Desc : Test installation of texlive-armtex -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-armtex - LOG_INFO "检查是否已安装texlive-armtex" - rpm -q texlive-armtex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-armtex已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "texlive-armtex未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有texlive-armtex软件包 - LOG_INFO "检查yum源中是否有texlive-armtex软件包" - dnf list available texlive-armtex > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到texlive-armtex软件包" - - # 安装texlive-armtex - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-armtex" - dnf install -y texlive-armtex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-armtex失败" - fi - - # 测试命令参数是否存在或不支持 - LOG_INFO "测试命令参数是否存在或不支持" - tex --help | grep "armtex" > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "命令参数不支持或不存在" - - # 执行测试命令 - LOG_INFO "执行测试命令" - tex --armtex test.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行测试命令失败" - - # 清理环境(如果之前未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-armtex" - dnf remove -y texlive-armtex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-armtek失败" - - # 再次检查是否卸载成功 - rpm -q texlive-armtex > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "卸载后仍检测到texlive-armtek存在" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-n/texlive-luaintro-doc/test_texlive-luaintro-doc_documentation.sh b/testcases/function_test/pkg_test/texlive-split-n/texlive-luaintro-doc/test_texlive-luaintro-doc_documentation.sh deleted file mode 100644 index 3c45df918d4..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-n/texlive-luaintro-doc/test_texlive-luaintro-doc_documentation.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-07-03 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-luaintro-doc 软件包的文档功能,验证文档是否正确安装并可访问。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-luaintro-doc - LOG_INFO "检查是否已安装texlive-luaintro-doc" - rpm -q texlive-luaintro-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-luaintro-doc已安装" - INSTALLED=1 - else - LOG_INFO "texlive-luaintro-doc未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-luaintro-doc - LOG_INFO "检查yum源中是否有texlive-luaintro-doc" - dnf list available texlive-luaintro-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中无texlive-luaintro-doc软件包" - - # 若未安装则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-luaintro-doc" - dnf install -y texlive-luaintro-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 1 "安装texlive-luaintro-doc失败" - fi - - # 验证文档是否正确安装并可访问 - LOG_INFO "验证文档是否正确安装并可访问" - ls /usr/share/doc/texlive-luaintro-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 1 "文档目录不存在" - - # 检查文档内容是否可访问 - LOG_INFO "检查文档内容是否可访问" - cat /usr/share/doc/texlive-luaintro-doc/README > /dev/null 2>&1 - CHECK_RESULT $? 0 1 "文档内容不可访问" - - # 若脚本开始时未安装则卸载软件包以恢复环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-luaintro-doc以恢复环境" - dnf remove -y texlive-luaintro-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 1 "卸载texlive-luaintro-doc失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-n/texlive-luaintro-doc/test_texlive-luaintro-doc_reinstall.sh b/testcases/function_test/pkg_test/texlive-split-n/texlive-luaintro-doc/test_texlive-luaintro-doc_reinstall.sh deleted file mode 100644 index 873b580bcc7..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-n/texlive-luaintro-doc/test_texlive-luaintro-doc_reinstall.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 : 2025-07-02 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-luaintro-doc 软件包的重新安装功能,验证是否能够正确重新安装到系统中。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在texlive-luaintro-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-luaintro-doc软件包..." - dnf list available texlive-luaintro-doc &>/dev/null - CHECK_RESULT $? 0 255 "yum源中不存在texlive-luaintro-doc软件包" - - # 检查是否已安装texlive-luaintro-doc - LOG_INFO "检查是否已安装texlive-luaintro-doc..." - rpm -q texlive-luaintro-doc &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-luaintro-doc已安装,脚本结束时保持安装状态" - installed=true - else - LOG_INFO "texlive-luaintro-doc未安装,将在测试后卸载" - installed=false - fi - - # 安装texlive-luaintro-doc(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-luaintro-doc..." - dnf install -y texlive-luaintro-doc - CHECK_RESULT $? 0 0 "安装texlive-luaintro-doc失败" - fi - - # 重新安装texlive-luaintro-doc - LOG_INFO "重新安装texlive-luaintro-doc..." - dnf reinstall -y texlive-luaintro-doc - CHECK_RESULT $? 0 0 "重新安装texlive-luaintro-doc失败" - - # 验证重新安装后的软件包状态 - LOG_INFO "验证重新安装后的软件包状态..." - rpm -q texlive-luaintro-doc &>/dev/null - CHECK_RESULT $? 0 0 "重新安装后未找到texlive-luaintro-doc" - - # 清理环境(如果最初未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-luaintro-doc..." - dnf remove -y texlive-luaintro-doc - CHECK_RESULT $? 0 0 "卸载texlive-luaintro-doc失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-n/texlive-luaintro-doc/test_texlive-luaintro-doc_verify_documentation.sh b/testcases/function_test/pkg_test/texlive-split-n/texlive-luaintro-doc/test_texlive-luaintro-doc_verify_documentation.sh deleted file mode 100644 index 86b86dd974b..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-n/texlive-luaintro-doc/test_texlive-luaintro-doc_verify_documentation.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-07-03 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-luaintro-doc 软件包的文档验证功能,验证文档内容是否正确且完整。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-luaintro-doc软件包 - LOG_INFO "检查是否已安装texlive-luaintro-doc软件包" - rpm -q texlive-luaintro-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-luaintro-doc已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-luaintro-doc未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-luaintro-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-luaintro-doc软件包" - dnf list available texlive-luaintro-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-luaintro-doc软件包" - - # 安装texlive-luaintro-doc软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-luaintro-doc软件包" - dnf install -y texlive-luaintro-doc - CHECK_RESULT $? 0 0 "安装texlive-luaintro-doc失败" - fi - - # 验证文档内容是否正确且完整 - LOG_INFO "验证texlive-luaintro-doc文档内容是否正确且完整" - DOC_PATH=$(rpm -ql texlive-luaintro-doc | grep -m1 "README") - if [ -z "$DOC_PATH" ]; then - LOG_ERROR "未找到texlive-luaintro-doc的文档文件" - exit 255 - fi - - # 检查文档内容是否包含预期关键词(示例) - LOG_INFO "检查文档内容是否包含预期关键词" - grep -q "Lua" "$DOC_PATH" - CHECK_RESULT $? 0 255 "文档内容不包含预期关键词" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-luaintro-doc软件包以恢复环境" - dnf remove -y texlive-luaintro-doc - CHECK_RESULT $? 0 0 "卸载texlive-luaintro-doc失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-modref/test_texlive-modref_function_basic_usage.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-modref/test_texlive-modref_function_basic_usage.sh deleted file mode 100644 index 7240de586d4..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-modref/test_texlive-modref_function_basic_usage.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-19 -# @License : Mulan PSL v2 -# @Desc : Test basic LaTeX command usage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 设置环境变量 - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - - # 测试软件包名称 - PACKAGE_NAME="texlive" - LOG_INFO "测试开始:Test basic LaTeX command usage" - - # 步骤1:检查yum源中是否存在texlive软件包 - LOG_INFO "步骤1:检查yum源中是否存在${PACKAGE_NAME}软件包" - if ! dnf list available ${PACKAGE_NAME} &>/dev/null; then - LOG_ERROR "yum源中不存在${PACKAGE_NAME}软件包" - exit 255 - fi - - # 步骤2:检查是否已安装texlive - LOG_INFO "步骤2:检查是否已安装${PACKAGE_NAME}" - INSTALLED=false - if rpm -q ${PACKAGE_NAME} &>/dev/null; then - LOG_INFO "${PACKAGE_NAME}已安装" - INSTALLED=true - else - LOG_INFO "${PACKAGE_NAME}未安装" - fi - - # 步骤3:如果未安装,则安装texlive - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败" - fi - - # 步骤4:测试基本LaTeX命令用法 - LOG_INFO "步骤4:测试基本LaTeX命令用法" - # 检查latex命令是否存在 - if ! command -v latex &>/dev/null; then - LOG_ERROR "latex命令不存在或不支持" - exit 255 - fi - - # 创建一个简单的LaTeX测试文件 - TEST_FILE="test_latex.tex" - cat > ${TEST_FILE} << "EOF" - \documentclass{article} - \begin{document} - Hello, LaTeX! - \end{document} - EOF - - # 使用latex命令编译测试文件 - LOG_INFO "使用latex命令编译测试文件" - latex ${TEST_FILE} - CHECK_RESULT $? 0 0 "latex命令执行失败" - - # 步骤5:检查生成的DVI文件是否存在 - LOG_INFO "步骤5:检查生成的DVI文件" - if [ -f "test_latex.dvi" ]; then - LOG_INFO "DVI文件生成成功" - else - LOG_ERROR "DVI文件未生成" - exit 1 - fi - - # 步骤6:清理生成的临时文件 - LOG_INFO "步骤6:清理生成的临时文件" - rm -f test_latex.* ${TEST_FILE} - - # 步骤7:如果测试前未安装,则卸载texlive - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤7:卸载${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败" - fi - - LOG_INFO "测试完成:Test basic LaTeX command usage" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-modref/test_texlive-modref_function_file_list.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-modref/test_texlive-modref_function_file_list.sh deleted file mode 100644 index ee1b76dbae2..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-modref/test_texlive-modref_function_file_list.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 : 2026-02-19 -# @License : Mulan PSL v2 -# @Desc : Verify installed files list -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:验证已安装的文件列表" - - # 步骤1:检查是否已经安装了texlive-modref软件包 - LOG_INFO "步骤1:检查texlive-modref软件包是否已经安装" - dnf list installed | grep -q "texlive-modref" - if [ $? -eq 0 ]; then - LOG_INFO "texlive-modref已经安装,测试结束将保持安装状态" - already_installed=1 - else - LOG_INFO "texlive-modref未安装,将在测试步骤中安装" - already_installed=0 - fi - - # 步骤2:检查yum源中是否有texlive-modref软件包 - LOG_INFO "步骤2:检查yum源中是否有texlive-modref软件包" - dnf list available texlive-modref 2>/dev/null | grep -q "texlive-modref" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-modref软件包" - exit 255 - fi - - # 步骤3:如果未安装,则安装texlive-modref软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-modref软件包" - dnf install -y texlive-modref - CHECK_RESULT $? 0 0 "安装texlive-modref失败" - fi - - # 步骤4:验证已安装的文件列表 - LOG_INFO "步骤4:验证已安装的文件列表" - rpm -ql texlive-modref > /tmp/texlive-modref-files.txt - CHECK_RESULT $? 0 0 "获取texlive-modref文件列表失败" - - # 步骤5:检查文件列表是否非空 - LOG_INFO "步骤5:检查文件列表是否非空" - if [ -s /tmp/texlive-modref-files.txt ]; then - LOG_INFO "文件列表非空,测试通过" - else - LOG_ERROR "文件列表为空,测试失败" - exit 1 - fi - - # 步骤6:清理环境 - LOG_INFO "步骤6:清理环境" - rm -f /tmp/texlive-modref-files.txt - - # 步骤7:如果测试前未安装,则卸载texlive-modref软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤7:卸载texlive-modref软件包" - dnf remove -y texlive-modref - CHECK_RESULT $? 0 0 "卸载texlive-modref失败" - fi - - LOG_INFO "测试完成:验证已安装的文件列表" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-p/texlive-modref/test_texlive-modref_function_version.sh b/testcases/function_test/pkg_test/texlive-split-p/texlive-modref/test_texlive-modref_function_version.sh deleted file mode 100644 index 975e521a085..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-p/texlive-modref/test_texlive-modref_function_version.sh +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-19 -# @License : Mulan PSL v2 -# @Desc : Check package version info -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 设置环境变量 - LOG_INFO() { - echo "INFO: $1" - } - - LOG_ERROR() { - echo "ERROR: $1" - } - - # 检查软件包是否在yum源中 - check_package_in_repo() { - local package_name="$1" - dnf list available "$package_name" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $package_name 不在yum源中" - exit 255 - fi - LOG_INFO "软件包 $package_name 存在于yum源中" - } - - # 检查命令参数是否支持 - check_command_option() { - local command="$1" - local option="$2" - if ! $command --help 2>&1 | grep -q "$option"; then - LOG_ERROR "命令 $command 不支持参数 $option" - exit 255 - fi - LOG_INFO "命令 $command 支持参数 $option" - } - - # 主测试函数 - test_package_version_info() { - local package_name="texlive-modref" - local installed=false - - # 步骤1:检查环境是否已安装指定软件包 - LOG_INFO "检查环境是否已安装 $package_name" - if rpm -q $package_name &>/dev/null; then - LOG_INFO "环境已安装 $package_name" - installed=true - else - LOG_INFO "环境未安装 $package_name" - fi - - # 步骤2:检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有 $package_name" - check_package_in_repo "$package_name" - - # 步骤3:如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装 $package_name" - dnf install -y "$package_name" - CHECK_RESULT $? 0 0 "安装 $package_name 失败" - fi - - # 步骤4:检查命令参数是否支持 - LOG_INFO "检查命令参数是否支持" - check_command_option "rpm" "-q" - - # 步骤5:执行命令获取版本信息 - LOG_INFO "获取 $package_name 的版本信息" - rpm -q "$package_name" - CHECK_RESULT $? 0 0 "获取 $package_name 版本信息失败" - - # 步骤6:如果之前未安装,则在测试结束后卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载 $package_name" - dnf remove -y "$package_name" - CHECK_RESULT $? 0 0 "卸载 $package_name 失败" - else - LOG_INFO "保持 $package_name 的安装状态" - fi - - LOG_INFO "测试完成" - } - - # 执行测试 - test_package_version_info -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-r/texlive-pawpict/test_texlive-pawpict_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-r/texlive-pawpict/test_texlive-pawpict_function_basic.sh deleted file mode 100644 index 45d12176306..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-r/texlive-pawpict/test_texlive-pawpict_function_basic.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-11-26 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality of texlive-pawpict -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-pawpict 的基本功能" - - # 检查是否已安装 texlive-pawpict - LOG_INFO "检查 texlive-pawpict 是否已安装" - if dnf list installed texlive-pawpict &> /dev/null; then - LOG_INFO "texlive-pawpict 已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "texlive-pawpict 未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-pawpict - LOG_INFO "检查 yum 源中是否有 texlive-pawpict" - if ! dnf list available texlive-pawpict &> /dev/null; then - LOG_ERROR "yum 源中未找到 texlive-pawpict" - exit 255 - fi - - # 如果未安装,则安装 texlive-pawpict - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 texlive-pawpict" - dnf install -y texlive-pawpict - CHECK_RESULT $? 0 0 "安装 texlive-pawpict 失败" - fi - - # 测试 texlive-pawpict 的基本功能 - LOG_INFO "测试 texlive-pawpict 的基本功能" - texlive-pawpict --version - CHECK_RESULT $? 0 0 "texlive-pawpict --version 执行失败" - - # 测试不支持的参数 - LOG_INFO "测试 texlive-pawpict 不支持的参数" - texlive-pawpict --invalid-arg &> /dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "不支持的参数未返回退出码 255" - exit 255 - fi - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-pawpict" - dnf remove -y texlive-pawpict - CHECK_RESULT $? 0 0 "卸载 texlive-pawpict 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-u/texlive-sclang-prettifier-doc/test_texlive-sclang-prettifier-doc_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-u/texlive-sclang-prettifier-doc/test_texlive-sclang-prettifier-doc_function_basic.sh deleted file mode 100644 index f89ded2141c..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-u/texlive-sclang-prettifier-doc/test_texlive-sclang-prettifier-doc_function_basic.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-11-26 -# @License : Mulan PSL v2 -# @Desc : Verify basic doc functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Verify basic doc functionality" - - # 检查软件包是否已安装 - LOG_INFO "检查软件包texlive-sclang-prettifier-doc是否已安装" - if dnf list installed texlive-sclang-prettifier-doc &>/dev/null; then - LOG_INFO "软件包texlive-sclang-prettifier-doc已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包texlive-sclang-prettifier-doc未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-sclang-prettifier-doc软件包" - if ! dnf list available texlive-sclang-prettifier-doc &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-sclang-prettifier-doc软件包" - exit 255 - fi - - # 安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-sclang-prettifier-doc软件包" - dnf install -y texlive-sclang-prettifier-doc - CHECK_RESULT $? 0 0 "安装texlive-sclang-prettifier-doc失败" - fi - - # 测试基本文档功能 - LOG_INFO "测试texlive-sclang-prettifier-doc的基本文档功能" - if ! command -v sclang-prettifier &>/dev/null; then - LOG_ERROR "sclang-prettifier命令不存在或不支持" - exit 255 - fi - - # 执行命令并检查结果 - LOG_INFO "执行sclang-prettifier --help命令" - sclang-prettifier --help - CHECK_RESULT $? 0 0 "执行sclang-prettifier --help失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-sclang-prettifier-doc软件包" - dnf remove -y texlive-sclang-prettifier-doc - CHECK_RESULT $? 0 0 "卸载texlive-sclang-prettifier-doc失败" - fi - - LOG_INFO "测试完成:Verify basic doc functionality" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-v/texlive-silence/test_texlive-silence_function_suppress_warnings.sh b/testcases/function_test/pkg_test/texlive-split-v/texlive-silence/test_texlive-silence_function_suppress_warnings.sh deleted file mode 100644 index b98ac997cd6..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-v/texlive-silence/test_texlive-silence_function_suppress_warnings.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 : 2026-03-16 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-silence包的核心功能:在LaTeX文档中抑制特定警告信息,验证警告被正确过滤 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-silence包的核心功能:抑制LaTeX文档中的特定警告信息" - LOG_INFO "步骤1:检查texlive-silence软件包是否在yum源中" - if ! dnf list available texlive-silence 2>/dev/null | grep -q texlive-silence; then - LOG_ERROR "yum源中未找到texlive-silence软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查当前环境是否已安装texlive-silence" - if rpm -q texlive-silence >/dev/null 2>&1; then - LOG_INFO "texlive-silence已安装,测试完成后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "texlive-silence未安装,将在测试过程中安装" - INSTALLED_BEFORE_TEST=false - fi - - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "步骤3:安装texlive-silence软件包" - dnf install -y texlive-silence - CHECK_RESULT $? 0 0 "安装texlive-silence失败" - fi - - LOG_INFO "步骤4:创建一个测试LaTeX文档" - cat > test_warning.tex << "EOF" - \documentclass{article} - \usepackage{silence} - \WarningFilter{latex}{Overfull} - \begin{document} - This is a test document to check if warnings are suppressed. - \newpage - \newpage - \newpage - \newpage - \newpage - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败" - - LOG_INFO "步骤5:编译LaTeX文档,检查警告是否被抑制" - pdflatex -interaction=nonstopmode test_warning.tex > output.log 2>&1 - CHECK_RESULT $? 0 0 "编译LaTeX文档失败" - - LOG_INFO "步骤6:检查输出日志中是否包含被抑制的警告信息" - if grep -q "Overfull" output.log; then - LOG_ERROR "警告信息未被正确抑制" - CHECK_RESULT 1 0 0 "警告抑制功能测试失败" - else - LOG_INFO "警告信息已被正确抑制" - CHECK_RESULT 0 0 0 "警告抑制功能测试成功" - fi - - LOG_INFO "步骤7:清理测试文件" - rm -f test_warning.tex output.log test_warning.aux test_warning.log test_warning.pdf - - if [ "$INSTALLED_BEFORE_TEST" = "false" ]; then - LOG_INFO "步骤8:卸载texlive-silence软件包" - dnf remove -y texlive-silence - CHECK_RESULT $? 0 0 "卸载texlive-silence失败" - else - LOG_INFO "步骤8:测试前已安装texlive-silence,保持安装状态" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-v/texlive-silence/test_texlive-silence_function_verbatim_filters.sh b/testcases/function_test/pkg_test/texlive-split-v/texlive-silence/test_texlive-silence_function_verbatim_filters.sh deleted file mode 100644 index eda4fd93973..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-v/texlive-silence/test_texlive-silence_function_verbatim_filters.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 : 2026-03-16 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-silence包对特定verbatim环境或命令的输出过滤功能,验证其过滤规则生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-silence包对特定verbatim环境或命令的输出过滤功能" - - LOG_INFO "步骤1:检查texlive-silence软件包是否在yum源中" - if ! dnf list available texlive-silence 2>/dev/null | grep -q texlive-silence; then - LOG_ERROR "texlive-silence软件包不在yum源中" - exit 255 - fi - - LOG_INFO "步骤2:检查当前是否已安装texlive-silence软件包" - if rpm -q texlive-silence >/dev/null 2>&1; then - LOG_INFO "texlive-silence软件包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-silence软件包未安装,将进行安装" - INSTALLED=false - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装texlive-silence软件包" - dnf install -y texlive-silence - CHECK_RESULT $? 0 0 "安装texlive-silence软件包失败" - fi - - LOG_INFO "步骤4:验证texlive-silence包对verbatim环境的过滤功能" - cat > test_verbatim.tex << "EOF" - \documentclass{article} - \usepackage{silence} - \WarningFilter{latex}{Command} - \begin{document} - \begin{verbatim} - This is a verbatim environment. - \end{verbatim} - \end{document} - EOF - pdflatex -interaction=nonstopmode test_verbatim.tex > output.log 2>&1 - CHECK_RESULT $? 0 0 "编译LaTeX文档失败" - - LOG_INFO "步骤5:检查输出日志中是否过滤了特定警告" - if grep -q "Command" output.log; then - LOG_ERROR "过滤规则未生效,日志中仍包含特定警告" - CHECK_RESULT 1 0 0 "过滤规则未生效" - else - LOG_INFO "过滤规则生效,特定警告已被过滤" - CHECK_RESULT 0 0 0 "过滤规则生效" - fi - - LOG_INFO "步骤6:清理临时文件" - rm -f test_verbatim.tex output.log test_verbatim.aux test_verbatim.log test_verbatim.pdf - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤7:卸载texlive-silence软件包" - dnf remove -y texlive-silence - CHECK_RESULT $? 0 0 "卸载texlive-silence软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-v/texlive-simpler-wick/test_texlive-simpler-wick_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-v/texlive-simpler-wick/test_texlive-simpler-wick_function_basic.sh deleted file mode 100644 index 7c54db626b9..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-v/texlive-simpler-wick/test_texlive-simpler-wick_function_basic.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-10-03 -# @License : Mulan PSL v2 -# @Desc : Test basic command usage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-simpler-wick - LOG_INFO "检查是否已安装texlive-simpler-wick" - rpm -q texlive-simpler-wick > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-simpler-wick已安装,测试后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-simpler-wick未安装,测试后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-simpler-wick软件包 - LOG_INFO "检查yum源中是否有texlive-simpler-wick软件包" - dnf list available texlive-simpler-wick > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到texlive-simpler-wick软件包" - - # 安装texlive-simpler-wick - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-simpler-wick" - dnf install -y texlive-simpler-wick - CHECK_RESULT $? 0 0 "安装texlive-simpler-wick失败" - fi - - # 测试基本命令用法 - LOG_INFO "测试基本命令用法" - texlive-simpler-wick --help > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "texlive-simpler-wick命令不支持--help参数" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-simpler-wick" - dnf remove -y texlive-simpler-wick - CHECK_RESULT $? 0 0 "卸载texlive-simpler-wick失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-w/texlive-texlogos/test_texlive-texlogos_function_font.sh b/testcases/function_test/pkg_test/texlive-split-w/texlive-texlogos/test_texlive-texlogos_function_font.sh deleted file mode 100644 index deb4d6f6d9a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-w/texlive-texlogos/test_texlive-texlogos_function_font.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-26 -# @License : Mulan PSL v2 -# @Desc : Test font rendering functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试字体渲染功能" - - # 检查是否已安装texlive-texlogos - if dnf list installed texlive-texlogos &>/dev/null; then - LOG_INFO "texlive-texlogos已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-texlogos未安装,测试完成后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-texlogos - if ! dnf list available texlive-texlogos &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-texlogos软件包" - exit 255 - fi - - # 安装texlive-texlogos - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装texlive-texlogos" - dnf install -y texlive-texlogos - CHECK_RESULT $? 0 0 "安装texlive-texlogos失败" - fi - - # 测试字体渲染功能 - LOG_INFO "测试字体渲染功能" - test_command="some_rendering_command --test-font" # 替换为实际的测试命令和参数 - if ! command -v some_rendering_command &>/dev/null; then - LOG_ERROR "命令some_rendering_command不存在或不支持" - exit 255 - fi - - $test_command - CHECK_RESULT $? 0 0 "字体渲染功能测试失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载texlive-texlogos" - dnf remove -y texlive-texlogos - CHECK_RESULT $? 0 0 "卸载texlive- -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-x/texlive-txgreeks/test_texlive-txgreeks_function_install.sh b/testcases/function_test/pkg_test/texlive-split-x/texlive-txgreeks/test_texlive-txgreeks_function_install.sh deleted file mode 100644 index d886e18e0f9..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-x/texlive-txgreeks/test_texlive-txgreeks_function_install.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 : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test installation of texlive-txgreeks -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-txgreeks是否已安装 - LOG_INFO "检查texlive-txgreeks是否已安装" - if dnf list installed texlive-txgreeks &>/dev/null; then - LOG_INFO "texlive-txgreeks已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-txgreeks未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-txgreeks软件包 - LOG_INFO "检查yum源中是否有texlive-txgreeks软件包" - if ! dnf list available texlive-txgreeks &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-txgreeks软件包" - exit 255 - fi - - # 安装texlive-txgreeks软件包 - LOG_INFO "开始安装texlive-txgreeks软件包" - dnf install -y texlive-txgreeks - CHECK_RESULT $? 0 0 "安装texlive-txgreeks失败" - - # 验证texlive-txgreeks功能 - LOG_INFO "验证texlive-txgreeks功能" - command_to_test="txgreeks --version" - if ! command -v txgreeks &>/dev/null; then - LOG_ERROR "txgreeks命令不存在或不支持" - exit 255 - fi - - eval "$command_to_test" - CHECK_RESULT $? 0 0 "执行txgreeks命令失败" - - # 根据初始状态决定是否卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-txgreeks软件包" - dnf remove -y texlive-txgreeks - CHECK_RESULT $? 0 0 "卸载texlive-txgreeks失败" - else - LOG_INFO "保持texlive-txgreeks安装状态" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/uriparser/uriparser-help/test_uriparser-help_function_normalize.sh b/testcases/function_test/pkg_test/uriparser/uriparser-help/test_uriparser-help_function_normalize.sh deleted file mode 100644 index 54ae3b80539..00000000000 --- a/testcases/function_test/pkg_test/uriparser/uriparser-help/test_uriparser-help_function_normalize.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-13 -# @License : Mulan PSL v2 -# @Desc : Test URI normalization functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查uriparser软件包是否已安装 - LOG_INFO "检查uriparser软件包是否已安装" - if rpm -q uriparser >/dev/null 2>&1; then - LOG_INFO "uriparser软件包已安装" - INSTALLED=true - else - LOG_INFO "uriparser软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否有uriparser软件包 - LOG_INFO "检查yum源中是否有uriparser软件包" - if ! dnf list available uriparser >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到uriparser软件包" - exit 255 - fi - - # 如果未安装,则安装uriparser软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装uriparser软件包" - dnf install -y uriparser - CHECK_RESULT $? 0 0 "安装uriparser软件包失败" - fi - - # 测试URI标准化功能 - LOG_INFO "测试URI标准化功能" - TEST_URI="http://example.com/path/to/resource?query=value" - EXPECTED_RESULT="http://example.com/path/to/resource?query=value" - ACTUAL_RESULT=$(uriparser-normalize "$TEST_URI" 2>/dev/null) - CHECK_RESULT $? 0 0 "uriparser-normalize命令执行失败" - if [ "$ACTUAL_RESULT" != "$EXPECTED_RESULT" ]; then - LOG_ERROR "URI标准化功能测试失败: 预期结果[$EXPECTED_RESULT], 实际结果[$ACTUAL_RESULT]" - exit 1 - else - LOG_INFO "URI标准化功能测试成功: 结果[$ACTUAL_RESULT]" - fi - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载uriparser软件包" - dnf remove -y uriparser - CHECK_RESULT $? 0 0 "卸载uriparser软件包失败" - fi - - LOG_INFO "测试脚本执行完成" - exit 0 - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/uriparser/uriparser-help/test_uriparser-help_function_parse.sh b/testcases/function_test/pkg_test/uriparser/uriparser-help/test_uriparser-help_function_parse.sh deleted file mode 100644 index 71301eaa336..00000000000 --- a/testcases/function_test/pkg_test/uriparser/uriparser-help/test_uriparser-help_function_parse.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 : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : Test URI parsing functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查uriparser软件包是否已安装 - if ! rpm -q uriparser >/dev/null 2>&1; then - LOG_INFO "uriparser软件包未安装,开始安装..." - # 检查yum源中是否有uriparser软件包 - if ! dnf list available uriparser >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到uriparser软件包" - exit 255 - fi - dnf install -y uriparser - CHECK_RESULT $? 0 0 "安装uriparser软件包失败" - INSTALLED=1 - else - LOG_INFO "uriparser软件包已安装" - INSTALLED=0 - fi - - # 测试URI解析功能 - LOG_INFO "开始测试URI解析功能..." - TEST_URI="http://example.com/path?query=value" - EXPECTED_RESULT="http://example.com/path?query=value" - - # 使用uriparse命令解析URI - ACTUAL_RESULT=$(uriparse "$TEST_URI") - CHECK_RESULT $? 0 0 "执行uriparse命令失败" - - # 检查解析结果是否符合预期 - if [ "$ACTUAL_RESULT" != "$EXPECTED_RESULT" ]; then - LOG_ERROR "URI解析结果不符合预期" - exit 1 - else - LOG_INFO "URI解析结果符合预期" - fi - - # 清理环境 - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "清理环境,卸载uriparser软件包..." - dnf remove -y uriparser >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载uriparser软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file