diff --git a/suite2cases/function_test/pkg_test/CharLS/CharLS-devel.json b/suite2cases/function_test/pkg_test/CharLS/CharLS-devel.json index 86c0c3b9119..18a8f8214e2 100644 --- a/suite2cases/function_test/pkg_test/CharLS/CharLS-devel.json +++ b/suite2cases/function_test/pkg_test/CharLS/CharLS-devel.json @@ -5,18 +5,6 @@ { "name": "test_CharLS-devel_function_install", "desc": "测试CharLS-devel开发包的安装功能,验证其是否可以通过包管理器成功安装。" - }, - { - "name": "test_CharLS-devel_function_check", - "desc": "测试检查CharLS-devel开发包是否已正确安装,验证其头文件和库文件的存在性。" - }, - { - "name": "test_CharLS-devel_function_usage", - "desc": "测试CharLS-devel的基本功能,编写一个简单的C/C++程序调用CharLS库进行JPEG-LS编解码。" - }, - { - "name": "test_CharLS-devel_function_uninstall", - "desc": "测试CharLS-devel开发包的卸载功能,验证其可以通过包管理器干净地移除。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/ganglia/ganglia-gmond.json b/suite2cases/function_test/pkg_test/ganglia/ganglia-gmond.json index 24d25e98746..3ec3a95fc6f 100644 --- a/suite2cases/function_test/pkg_test/ganglia/ganglia-gmond.json +++ b/suite2cases/function_test/pkg_test/ganglia/ganglia-gmond.json @@ -26,117 +26,21 @@ "name": "test_ganglia-gmond_gmetric_v", "desc": "测试 gmetric 命令的 -v 参数,指定指标值" }, - { - "name": "test_ganglia-gmond_gmetric_t", - "desc": "测试 gmetric 命令的 -t 参数,指定指标类型" - }, - { - "name": "test_ganglia-gmond_gmetric_u", - "desc": "测试 gmetric 命令的 -u 参数,指定指标单位" - }, { "name": "test_ganglia-gmond_gmetric_s", "desc": "测试 gmetric 命令的 -s 参数,指定指标斜率类型" }, - { - "name": "test_ganglia-gmond_gmetric_x", - "desc": "测试 gmetric 命令的 -x 参数,指定最大时间间隔" - }, { "name": "test_ganglia-gmond_gmetric_d", "desc": "测试 gmetric 命令的 -d 参数,指定指标生命周期" }, - { - "name": "test_ganglia-gmond_gmetric_upper_c", - "desc": "测试 gmetric 命令的 -C 参数,指定集群名称" - }, { "name": "test_ganglia-gmond_gmetric_upper_d", "desc": "测试 gmetric 命令的 -D 参数,指定指标描述" }, - { - "name": "test_ganglia-gmond_gmetric_upper_t", - "desc": "测试 gmetric 命令的 -T 参数,指定指标标题" - }, - { - "name": "test_ganglia-gmond_gstat_h", - "desc": "测试 gstat 命令的帮助选项" - }, - { - "name": "test_ganglia-gmond_gstat__upper_v", - "desc": "测试 gstat 命令的版本选项" - }, - { - "name": "test_ganglia-gmond_gstat_a", - "desc": "测试 gstat 命令的列出所有主机选项" - }, - { - "name": "test_ganglia-gmond_gstat_d", - "desc": "测试 gstat 命令的仅列出死机主机选项" - }, - { - "name": "test_ganglia-gmond_gstat_m", - "desc": "测试 gstat 命令的打印负载均衡的 mpifile 选项" - }, - { - "name": "test_ganglia-gmond_gstat__num_1", - "desc": "测试 gstat 命令的单行打印主机和信息选项" - }, - { - "name": "test_ganglia-gmond_gstat_l", - "desc": "测试 gstat 命令的仅打印主机列表选项" - }, - { - "name": "test_ganglia-gmond_gstat_n", - "desc": "测试 gstat 命令的打印数字地址选项" - }, - { - "name": "test_ganglia-gmond_gstat_i", - "desc": "测试 gstat 命令的指定 gmond ip 地址选项" - }, - { - "name": "test_ganglia-gmond_gstat_p", - "desc": "测试 gstat 命令的指定 gmond 端口选项" - }, - { - "name": "test_ganglia-gmond_function_start", - "desc": "测试 gmond 服务启动功能" - }, - { - "name": "test_ganglia-gmond_function_stop", - "desc": "测试 gmond 服务停止功能" - }, - { - "name": "test_ganglia-gmond_function_restart", - "desc": "测试 gmond 服务重启功能" - }, - { - "name": "test_ganglia-gmond_function_status", - "desc": "测试 gmond 服务状态查询功能" - }, - { - "name": "test_ganglia-gmond_function_conf_reload", - "desc": "测试 gmond 配置文件重载功能" - }, - { - "name": "test_ganglia-gmond_function_metric_push", - "desc": "测试指标推送功能" - }, - { - "name": "test_ganglia-gmond_function_metric_pull", - "desc": "测试指标拉取功能" - }, - { - "name": "test_ganglia-gmond_function_cluster_join", - "desc": "测试集群加入功能" - }, { "name": "test_ganglia-gmond_function_cluster_leave", "desc": "测试集群离开功能" - }, - { - "name": "test_ganglia-gmond_function_log_level", - "desc": "测试日志级别设置功能" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/hspell/hspell-devel.json b/suite2cases/function_test/pkg_test/hspell/hspell-devel.json index bf77e89d550..5ccc604fb7e 100644 --- a/suite2cases/function_test/pkg_test/hspell/hspell-devel.json +++ b/suite2cases/function_test/pkg_test/hspell/hspell-devel.json @@ -17,14 +17,6 @@ { "name": "test_hspell-devel_function_version", "desc": "Test checking the package version information" - }, - { - "name": "test_hspell-devel_function_help", - "desc": "Test the help or usage information of the command" - }, - { - "name": "test_hspell-devel_function_spellfile", - "desc": "Test the spelling of a text file" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/jboss-specs-parent/jboss-specs-parent.json b/suite2cases/function_test/pkg_test/jboss-specs-parent/jboss-specs-parent.json index 12b1331a9b4..5266dc3a7e2 100644 --- a/suite2cases/function_test/pkg_test/jboss-specs-parent/jboss-specs-parent.json +++ b/suite2cases/function_test/pkg_test/jboss-specs-parent/jboss-specs-parent.json @@ -30,10 +30,6 @@ "name": "test_jboss-specs-parent_function_uninstall", "desc": "测试jboss-specs-parent软件包的卸载功能,验证能否完全移除且不影响系统。" }, - { - "name": "test_jboss-specs-parent_function_upgrade", - "desc": "测试jboss-specs-parent软件包的升级功能,验证升级过程是否顺利。" - }, { "name": "test_jboss-specs-parent_function_integrity", "desc": "测试jboss-specs-parent软件包安装后文件的完整性和正确性。" diff --git a/suite2cases/function_test/pkg_test/jopt-simple/jopt-simple-help.json b/suite2cases/function_test/pkg_test/jopt-simple/jopt-simple-help.json index cd2acbfa713..00c5d671c6f 100644 --- a/suite2cases/function_test/pkg_test/jopt-simple/jopt-simple-help.json +++ b/suite2cases/function_test/pkg_test/jopt-simple/jopt-simple-help.json @@ -6,10 +6,6 @@ "name": "test_jopt-simple-help_service_stop", "desc": "测试 jopt-simple-help 服务的停止功能,确保服务可以正常停止。", "machine num": 1 - }, - { - "name": "test_jopt-simple-help_function_parse", - "desc": "测试 jopt-simple-help 的命令行参数解析功能,确保能正确解析输入参数。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/libbytesize/libbytesize-tools.json b/suite2cases/function_test/pkg_test/libbytesize/libbytesize-tools.json index 950b5d1a9fe..a33c13276d7 100644 --- a/suite2cases/function_test/pkg_test/libbytesize/libbytesize-tools.json +++ b/suite2cases/function_test/pkg_test/libbytesize/libbytesize-tools.json @@ -2,73 +2,13 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/libbytesize/libbytesize-tools", "machine num": 1, "cases": [ - { - "name": "test_libbytesize-tools_function_size", - "desc": "Test size conversion functionality" - }, - { - "name": "test_libbytesize-tools_bscalc__v", - "desc": "测试bscalc的-v参数,验证其版本信息输出功能" - }, { "name": "test_libbytesize-tools_bscalc__h", "desc": "测试bscalc的-h参数,验证其帮助信息输出功能" }, - { - "name": "test_libbytesize-tools_bscalc__upper_v", - "desc": "测试bscalc的-V参数,验证其详细模式输出功能" - }, - { - "name": "test_libbytesize-tools_bscalc_expression", - "desc": "测试bscalc计算表达式(如1KB+500B)的基本功能" - }, - { - "name": "test_libbytesize-tools_bscalc_expression__upper_v", - "desc": "测试bscalc在-V参数下计算表达式(如1KB+500B)的详细输出功能" - }, { "name": "test_libbytesize-tools_bscalc__v__h", "desc": "测试bscalc同时使用-v和-h参数的组合功能" - }, - { - "name": "test_libbytesize-tools_bscalc__upper_v__h", - "desc": "测试bscalc同时使用-V和-h参数的组合功能" - }, - { - "name": "test_libbytesize-tools_bscalc__v_expression", - "desc": "测试bscalc在-v参数下计算表达式的功能" - }, - { - "name": "test_libbytesize-tools_function_install", - "desc": "Test installation of libbytesize-tools package" - }, - { - "name": "test_libbytesize-tools_function_uninstall", - "desc": "Test uninstallation of libbytesize-tools package" - }, - { - "name": "test_libbytesize-tools_function_check_install", - "desc": "Check if libbytesize-tools is installed" - }, - { - "name": "test_libbytesize-tools_function_bscalc_basic", - "desc": "Test bscalc basic arithmetic operations" - }, - { - "name": "test_libbytesize-tools_function_unit_conversion", - "desc": "Test unit conversion (e.g., B, KB, MB)" - }, - { - "name": "test_libbytesize-tools_function_bscalc_format", - "desc": "Test bscalc output formatting options" - }, - { - "name": "test_libbytesize-tools_function_bscalc_pipe", - "desc": "Test bscalc with piped input" - }, - { - "name": "test_libbytesize-tools_function_bscalc_file", - "desc": "Test bscalc reading from a file" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/libssh2/libssh2-help.json b/suite2cases/function_test/pkg_test/libssh2/libssh2-help.json deleted file mode 100644 index 81a52fd0c8e..00000000000 --- a/suite2cases/function_test/pkg_test/libssh2/libssh2-help.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/libssh2/libssh2-help", - "machine num": 1, - "cases": [ - { - "name": "test_libssh2-help_function_info", - "desc": "测试libssh2-help软件包提供的版本、描述等信息" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/llvm-toolset/llvm-toolset-19-openmp-devel.json b/suite2cases/function_test/pkg_test/llvm-toolset/llvm-toolset-19-openmp-devel.json index 6486775248f..6b123f0f2f9 100644 --- a/suite2cases/function_test/pkg_test/llvm-toolset/llvm-toolset-19-openmp-devel.json +++ b/suite2cases/function_test/pkg_test/llvm-toolset/llvm-toolset-19-openmp-devel.json @@ -9,18 +9,6 @@ { "name": "test_llvm-toolset-19-openmp-devel_remove", "desc": "测试 llvm-toolset-19-openmp-devel 软件包能够通过系统包管理器成功卸载。" - }, - { - "name": "test_llvm-toolset-19-openmp-devel_lib", - "desc": "测试安装后关键的 OpenMP 库文件(如 libomp.so)是否存在于预期的系统路径中。" - }, - { - "name": "test_llvm-toolset-19-openmp-devel_header", - "desc": "测试安装后关键的 OpenMP 头文件(如 omp.h)是否存在于预期的系统路径中。" - }, - { - "name": "test_llvm-toolset-19-openmp-devel_compile", - "desc": "测试能否使用安装的 OpenMP 库和头文件成功编译一个简单的并行程序。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/lodash/nodejs-lodash-zipwith.json b/suite2cases/function_test/pkg_test/lodash/nodejs-lodash-zipwith.json index 658746981c8..41d5bdb07d1 100644 --- a/suite2cases/function_test/pkg_test/lodash/nodejs-lodash-zipwith.json +++ b/suite2cases/function_test/pkg_test/lodash/nodejs-lodash-zipwith.json @@ -6,18 +6,6 @@ "name": "test_nodejs-lodash-zipwith_function_install", "desc": "测试通过 npm 安装 lodash.zipwith 软件包" }, - { - "name": "test_nodejs-lodash-zipwith_function_require", - "desc": "测试在代码中成功引入 lodash.zipwith 模块" - }, - { - "name": "test_nodejs-lodash-zipwith_function_basic", - "desc": "测试 zipWith 函数对数组的基本合并功能" - }, - { - "name": "test_nodejs-lodash-zipwith_function_custom", - "desc": "测试 zipWith 函数使用自定义迭代器合并数组" - }, { "name": "test_nodejs-lodash-zipwith_function_uninstall", "desc": "测试通过 npm 卸载 lodash.zipwith 软件包" diff --git a/suite2cases/function_test/pkg_test/mybatis-generator/mybatis-generator-systests-mybatis3.json b/suite2cases/function_test/pkg_test/mybatis-generator/mybatis-generator-systests-mybatis3.json index 182d3e3265e..fce834cb9ff 100644 --- a/suite2cases/function_test/pkg_test/mybatis-generator/mybatis-generator-systests-mybatis3.json +++ b/suite2cases/function_test/pkg_test/mybatis-generator/mybatis-generator-systests-mybatis3.json @@ -6,42 +6,6 @@ "name": "test_mybatis-generator-systests-mybatis3_install", "desc": "测试软件包的安装功能,验证安装过程是否成功完成", "machine num": 1 - }, - { - "name": "test_mybatis-generator-systests-mybatis3_function_generate", - "desc": "测试代码生成功能,验证生成的代码是否符合预期" - }, - { - "name": "test_mybatis-generator-systests-mybatis3_function_config", - "desc": "测试配置文件解析功能,验证配置是否正确加载" - }, - { - "name": "test_mybatis-generator-systests-mybatis3_function_database", - "desc": "测试数据库连接功能,验证是否能成功连接数据库" - }, - { - "name": "test_mybatis-generator-systests-mybatis3_function_mapping", - "desc": "测试映射文件生成功能,验证映射文件是否正确生成" - }, - { - "name": "test_mybatis-generator-systests-mybatis3_function_uninstall", - "desc": "测试软件包的卸载功能,验证卸载过程是否干净彻底" - }, - { - "name": "test_mybatis-generator-systests-mybatis3_function_version", - "desc": "测试软件包版本查询功能,验证能正确输出版本信息" - }, - { - "name": "test_mybatis-generator-systests-mybatis3_function_help", - "desc": "测试软件包帮助文档功能,验证帮助信息能正常显示" - }, - { - "name": "test_mybatis-generator-systests-mybatis3_function_cli_basic", - "desc": "测试命令行基本运行,验证无参数或错误参数时的行为" - }, - { - "name": "test_mybatis-generator-systests-mybatis3_function_generate_custom", - "desc": "测试自定义模板生成代码,验证使用自定义模板能生成正确文件" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/nvml/nvml-help.json b/suite2cases/function_test/pkg_test/nvml/nvml-help.json index e0f081d45c4..fdc69d54bba 100644 --- a/suite2cases/function_test/pkg_test/nvml/nvml-help.json +++ b/suite2cases/function_test/pkg_test/nvml/nvml-help.json @@ -5,18 +5,6 @@ { "name": "test_nvml-help_install", "desc": "测试软件包nvml-help的安装功能" - }, - { - "name": "test_nvml-help_version", - "desc": "测试软件包nvml-help的版本查询功能" - }, - { - "name": "test_nvml-help_basic_usage", - "desc": "测试软件包nvml-help的基本帮助功能" - }, - { - "name": "test_nvml-help_uninstall", - "desc": "测试软件包nvml-help的卸载功能" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/proj/proj-help.json b/suite2cases/function_test/pkg_test/proj/proj-help.json index 38e98126b52..44a9c6edfb9 100644 --- a/suite2cases/function_test/pkg_test/proj/proj-help.json +++ b/suite2cases/function_test/pkg_test/proj/proj-help.json @@ -16,18 +16,6 @@ "name": "test_proj-help_upgrade", "desc": "测试 proj-help 软件包的升级功能,验证软件包是否可以正常升级到最新版本。", "machine num": 1 - }, - { - "name": "test_proj-help_function_config", - "desc": "测试 proj-help 软件包的配置功能,验证配置文件是否正确加载和应用。" - }, - { - "name": "test_proj-help_function_run", - "desc": "测试 proj-help 软件包的运行功能,验证主程序是否可以正常启动和执行。" - }, - { - "name": "test_proj-help_function_help", - "desc": "测试 proj-help 软件包的帮助功能,验证帮助命令是否可以正确显示使用说明。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-linecache2/python3-linecache2.json b/suite2cases/function_test/pkg_test/python-linecache2/python3-linecache2.json deleted file mode 100644 index 3bf52c61614..00000000000 --- a/suite2cases/function_test/pkg_test/python-linecache2/python3-linecache2.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/python-linecache2/python3-linecache2", - "machine num": 1, - "cases": [ - { - "name": "test_python3-linecache2_function_getline", - "desc": "Test the getline function to retrieve a specific line from a file" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-setuptools/python-setuptools-help.json b/suite2cases/function_test/pkg_test/python-setuptools/python-setuptools-help.json index 8ae76f3ea86..8622d641c36 100644 --- a/suite2cases/function_test/pkg_test/python-setuptools/python-setuptools-help.json +++ b/suite2cases/function_test/pkg_test/python-setuptools/python-setuptools-help.json @@ -2,14 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/python-setuptools/python-setuptools-help", "machine num": 1, "cases": [ - { - "name": "test_python-setuptools-help_function_import", - "desc": "测试能否成功导入python-setuptools-help模块" - }, - { - "name": "test_python-setuptools-help_function_help", - "desc": "测试获取setuptools帮助信息的功能" - }, { "name": "test_python-setuptools-help_function_install", "desc": "测试软件包的安装功能" @@ -17,22 +9,6 @@ { "name": "test_python-setuptools-help_function_uninstall", "desc": "测试软件包的卸载功能" - }, - { - "name": "test_python-setuptools-help_function_version", - "desc": "测试检查软件包版本的功能" - }, - { - "name": "test_python-setuptools-help_function_list", - "desc": "测试列出已安装包功能" - }, - { - "name": "test_python-setuptools-help_function_upgrade", - "desc": "测试软件包升级功能" - }, - { - "name": "test_python-setuptools-help_function_show", - "desc": "测试显示包详细信息功能" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-b/texlive-asciilist-doc.json b/suite2cases/function_test/pkg_test/texlive-split-b/texlive-asciilist-doc.json index ab409f4cbda..07130efa5da 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-b/texlive-asciilist-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-b/texlive-asciilist-doc.json @@ -5,22 +5,6 @@ { "name": "test_texlive-asciilist-doc_function_install", "desc": "Test package installation" - }, - { - "name": "test_texlive-asciilist-doc_function_query", - "desc": "Test query package info" - }, - { - "name": "test_texlive-asciilist-doc_function_remove", - "desc": "Test package removal" - }, - { - "name": "test_texlive-asciilist-doc_function_verify", - "desc": "Test package integrity" - }, - { - "name": "test_texlive-asciilist-doc_function_doc_exist", - "desc": "Test documentation files" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-f/texlive-curve-doc.json b/suite2cases/function_test/pkg_test/texlive-split-f/texlive-curve-doc.json index 99afdc54e79..958a7f9abbf 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-f/texlive-curve-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-f/texlive-curve-doc.json @@ -13,10 +13,6 @@ { "name": "test_texlive-curve-doc_function_verify_files", "desc": "Verify existence of key documentation files" - }, - { - "name": "test_texlive-curve-doc_function_view_manual", - "desc": "Check ability to view the main manual" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-f/texlive-cutwin.json b/suite2cases/function_test/pkg_test/texlive-split-f/texlive-cutwin.json deleted file mode 100644 index b20437496ee..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-f/texlive-cutwin.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-f/texlive-cutwin", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-cutwin_function_basic", - "desc": "Test basic functionality of texlive-cutwin package" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-o/texlive-mfnfss-doc.json b/suite2cases/function_test/pkg_test/texlive-split-o/texlive-mfnfss-doc.json index 0d155ac85eb..2f98a8946de 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-o/texlive-mfnfss-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-o/texlive-mfnfss-doc.json @@ -14,10 +14,6 @@ "name": "test_texlive-mfnfss-doc_function_list_files", "desc": "List documentation files" }, - { - "name": "test_texlive-mfnfss-doc_function_view_doc", - "desc": "View main documentation file" - }, { "name": "test_texlive-mfnfss-doc_function_remove", "desc": "Test package removal" diff --git a/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pst-abspos.json b/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pst-abspos.json deleted file mode 100644 index 83be00f1e07..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pst-abspos.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-abspos", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-pst-abspos_function_position", - "desc": "Test absolute positioning functionality" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-v/texlive-showhyphens-doc.json b/suite2cases/function_test/pkg_test/texlive-split-v/texlive-showhyphens-doc.json deleted file mode 100644 index af81b6d5924..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-v/texlive-showhyphens-doc.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-v/texlive-showhyphens-doc", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-showhyphens-doc_uninstall", - "desc": "Test package removal" - }, - { - "name": "test_texlive-showhyphens-doc_install", - "desc": "Test package installation" - }, - { - "name": "test_texlive-showhyphens-doc_doc_verify", - "desc": "Test documentation existence and basic format" - }, - { - "name": "test_texlive-showhyphens-doc_command_help", - "desc": "Test help information for showhyphens command" - }, - { - "name": "test_texlive-showhyphens-doc_basic_usage", - "desc": "Test basic hyphenation display functionality" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-x/texlive-tikz-3dplot-doc.json b/suite2cases/function_test/pkg_test/texlive-split-x/texlive-tikz-3dplot-doc.json index 6e4e8f7a02d..c07c3a319d9 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-x/texlive-tikz-3dplot-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-x/texlive-tikz-3dplot-doc.json @@ -7,10 +7,6 @@ "desc": "测试 texlive-tikz-3dplot-doc 软件包的安装功能,验证是否能够成功安装。", "machine num": 1 }, - { - "name": "test_texlive-tikz-3dplot-doc_function_install", - "desc": "测试 texlive-tikz-3dplot-doc 软件包的安装功能,验证是否能够通过包管理器成功安装。" - }, { "name": "test_texlive-tikz-3dplot-doc_function_uninstall", "desc": "测试 texlive-tikz-3dplot-doc 软件包的卸载功能,验证是否能够干净地卸载且无残留文件。" diff --git a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-shortmathj.json b/suite2cases/function_test/pkg_test/texlive-split-y/texlive-shortmathj.json deleted file mode 100644 index ad81f267d5c..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-shortmathj.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-y/texlive-shortmathj", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-shortmathj_function_install", - "desc": "test installation" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-ucsmonograph.json b/suite2cases/function_test/pkg_test/texlive-split-y/texlive-ucsmonograph.json index 9254e66439d..0c440bdddeb 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-ucsmonograph.json +++ b/suite2cases/function_test/pkg_test/texlive-split-y/texlive-ucsmonograph.json @@ -2,10 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-y/texlive-ucsmonograph", "machine num": 1, "cases": [ - { - "name": "test_texlive-ucsmonograph_function_basic", - "desc": "Basic functionality test for texlive-ucsmonograph" - }, { "name": "test_texlive-ucsmonograph_function_install", "desc": "Test the installation of the texlive-ucsmonograph package." @@ -17,14 +13,6 @@ { "name": "test_texlive-ucsmonograph_function_check_installed", "desc": "Verify that the texlive-ucsmonograph package is correctly installed and available." - }, - { - "name": "test_texlive-ucsmonograph_function_basic_compile", - "desc": "Test basic document compilation using the ucsmonograph document class." - }, - { - "name": "test_texlive-ucsmonograph_function_doc_available", - "desc": "Check if the package documentation is installed and accessible." } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-multicolrule.json b/suite2cases/function_test/pkg_test/texlive-split-z/texlive-multicolrule.json index afd3c9efc0c..5a2d5b8a20c 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-z/texlive-multicolrule.json +++ b/suite2cases/function_test/pkg_test/texlive-split-z/texlive-multicolrule.json @@ -13,30 +13,6 @@ { "name": "test_texlive-multicolrule_function_uninstall", "desc": "Test if the texlive-multicolrule package can be successfully uninstalled" - }, - { - "name": "test_texlive-multicolrule_function_check", - "desc": "Test if the texlive-multicolrule package is installed on the system" - }, - { - "name": "test_texlive-multicolrule_function_basic_rule", - "desc": "Test basic multicolumn rule drawing with default settings" - }, - { - "name": "test_texlive-multicolrule_function_rule_width", - "desc": "Test setting custom width for the multicolumn rule" - }, - { - "name": "test_texlive-multicolrule_function_rule_color", - "desc": "Test setting custom color for the multicolumn rule" - }, - { - "name": "test_texlive-multicolrule_function_rule_style", - "desc": "Test applying different line styles to the rule" - }, - { - "name": "test_texlive-multicolrule_function_rule_position", - "desc": "Test adjusting the position of the rule between columns" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/yecht/yecht-javadoc.json b/suite2cases/function_test/pkg_test/yecht/yecht-javadoc.json deleted file mode 100644 index c5bbd27556a..00000000000 --- a/suite2cases/function_test/pkg_test/yecht/yecht-javadoc.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/yecht/yecht-javadoc", - "machine num": 1, - "cases": [ - { - "name": "test_yecht-javadoc_function_generate", - "desc": "Test the generation of javadoc documentation" - }, - { - "name": "test_yecht-javadoc_function_validate", - "desc": "Test the validation of javadoc content" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/CharLS/CharLS-devel/test_CharLS-devel_function_check.sh b/testcases/function_test/pkg_test/CharLS/CharLS-devel/test_CharLS-devel_function_check.sh deleted file mode 100644 index 1e8b4255751..00000000000 --- a/testcases/function_test/pkg_test/CharLS/CharLS-devel/test_CharLS-devel_function_check.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-06 -# @License : Mulan PSL v2 -# @Desc : 测试检查CharLS-devel开发包是否已正确安装,验证其头文件和库文件的存在性。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试CharLS-devel开发包是否已正确安装,验证其头文件和库文件的存在性。" - - LOG_INFO "检查当前环境中是否已安装CharLS-devel软件包。" - if rpm -q CharLS-devel &> /dev/null; then - LOG_INFO "CharLS-devel已安装,脚本结束时将保持安装状态。" - INSTALLED=true - else - LOG_INFO "CharLS-devel未安装,将在测试步骤中安装,并在脚本结束前卸载。" - INSTALLED=false - fi - - LOG_INFO "检查yum源中是否存在CharLS-devel软件包。" - if ! dnf list available CharLS-devel &> /dev/null; then - LOG_ERROR "yum源中未找到CharLS-devel软件包,退出测试。" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装CharLS-devel软件包。" - dnf install -y CharLS-devel - CHECK_RESULT $? 0 0 "安装CharLS-devel软件包失败。" - fi - - LOG_INFO "验证CharLS-devel开发包的头文件是否存在。" - if [ -f /usr/include/CharLS/interface.h ]; then - LOG_INFO "头文件/usr/include/CharLS/interface.h存在。" - else - LOG_ERROR "头文件/usr/include/CharLS/interface.h不存在。" - exit 255 - fi - - LOG_INFO "验证CharLS-devel开发包的库文件是否存在。" - if [ -f /usr/lib64/libCharLS.so ]; then - LOG_INFO "库文件/usr/lib64/libCharLS.so存在。" - else - LOG_ERROR "库文件/usr/lib64/libCharLS.so不存在。" - exit 255 - fi - - LOG_INFO "测试通过,CharLS-devel开发包已正确安装。" - - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载CharLS-devel软件包,恢复环境。" - dnf remove -y CharLS-devel - CHECK_RESULT $? 0 0 "卸载CharLS-devel软件包失败。" - LOG_INFO "环境已恢复至测试前的状态。" - else - LOG_INFO "环境保持安装状态,无需卸载。" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/CharLS/CharLS-devel/test_CharLS-devel_function_uninstall.sh b/testcases/function_test/pkg_test/CharLS/CharLS-devel/test_CharLS-devel_function_uninstall.sh deleted file mode 100644 index 4cab77b44bc..00000000000 --- a/testcases/function_test/pkg_test/CharLS/CharLS-devel/test_CharLS-devel_function_uninstall.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-06 -# @License : Mulan PSL v2 -# @Desc : 测试CharLS-devel开发包的卸载功能,验证其可以通过包管理器干净地移除。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试CharLS-devel开发包的卸载功能" - - # 检查yum源中是否存在CharLS-devel包 - LOG_INFO "检查yum源中是否存在CharLS-devel软件包" - dnf list available CharLS-devel 2>&1 | grep -q "CharLS-devel" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到CharLS-devel软件包" - exit 255 - fi - LOG_INFO "yum源中存在CharLS-devel软件包" - - # 检查系统是否已经安装了CharLS-devel - LOG_INFO "检查系统是否已经安装了CharLS-devel" - rpm -q CharLS-devel > /dev/null 2>&1 - already_installed=$? - - if [ $already_installed -eq 0 ]; then - LOG_INFO "系统已安装CharLS-devel,测试后保持安装状态" - else - LOG_INFO "系统未安装CharLS-devel,将执行安装测试" - LOG_INFO "安装CharLS-devel软件包" - dnf install -y CharLS-devel - CHECK_RESULT $? 0 0 "安装CharLS-devel失败" - LOG_INFO "CharLS-devel安装成功" - fi - - # 验证CharLS-devel是否正常工作(可选步骤) - LOG_INFO "验证CharLS-devel开发包是否可用" - # 这里可以添加一些验证命令,例如检查头文件或库文件是否存在 - ls /usr/include/CharLS/ > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "CharLS-devel头文件不存在" - - # 执行卸载测试 - LOG_INFO "执行CharLS-devel卸载测试" - dnf remove -y CharLS-devel - CHECK_RESULT $? 0 0 "卸载CharLS-devel失败" - LOG_INFO "CharLS-devel卸载成功" - - # 验证卸载是否干净 - LOG_INFO "验证CharLS-devel是否被完全卸载" - rpm -q CharLS-devel > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "CharLS-devel未被完全卸载" - LOG_INFO "CharLS-devel已被完全卸载" - - # 环境恢复 - LOG_INFO "恢复测试环境" - if [ $already_installed -eq 0 ]; then - LOG_INFO "重新安装CharLS-devel以恢复原始状态" - dnf install -y CharLS-devel - CHECK_RESULT $? 0 0 "重新安装CharLS-devel失败" - LOG_INFO "环境已恢复到原始安装状态" - else - LOG_INFO "原始状态未安装CharLS-devel,无需恢复" - fi - - LOG_INFO "CharLS-devel卸载功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/CharLS/CharLS-devel/test_CharLS-devel_function_usage.sh b/testcases/function_test/pkg_test/CharLS/CharLS-devel/test_CharLS-devel_function_usage.sh deleted file mode 100644 index efee3023d27..00000000000 --- a/testcases/function_test/pkg_test/CharLS/CharLS-devel/test_CharLS-devel_function_usage.sh +++ /dev/null @@ -1,178 +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-06 -# @License : Mulan PSL v2 -# @Desc : 测试CharLS-devel的基本功能,编写一个简单的C/C++程序调用CharLS库进行JPEG-LS编解码。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试CharLS-devel的基本功能" - - # 检查yum源中是否存在CharLS-devel软件包 - LOG_INFO "检查yum源中是否存在CharLS-devel软件包" - if ! dnf list available CharLS-devel &>/dev/null; then - LOG_ERROR "yum源中未找到CharLS-devel软件包" - exit 255 - fi - - # 检查当前环境是否已安装CharLS-devel - LOG_INFO "检查当前环境是否已安装CharLS-devel" - if rpm -q CharLS-devel &>/dev/null; then - LOG_INFO "CharLS-devel已安装,将保持安装状态" - already_installed=true - else - LOG_INFO "CharLS-devel未安装,将在测试过程中安装" - already_installed=false - fi - - # 如果未安装,则安装CharLS-devel - if [ "$already_installed" = false ]; then - LOG_INFO "安装CharLS-devel软件包" - dnf install -y CharLS-devel - CHECK_RESULT $? 0 0 "安装CharLS-devel失败" - fi - - # 创建测试C程序 - LOG_INFO "创建测试C程序" - cat > test_charls.c << "EOF" - #include - #include - #include - - int main() { - // 初始化一个简单的图像数据 - const int width = 64; - const int height = 64; - const int components = 1; - const int bitsPerSample = 8; - const size_t imageSize = width * height * components; - - unsigned char* originalData = (unsigned char*)malloc(imageSize); - if (!originalData) { - printf("内存分配失败\n"); - return 1; - } - - // 填充测试数据 - for (size_t i = 0; i < imageSize; i++) { - originalData[i] = (unsigned char)(i % 256); - } - - // 计算编码缓冲区大小 - size_t encodedSize = 0; - JlsParameters params = {0}; - params.width = width; - params.height = height; - params.components = components; - params.bitsPerSample = bitsPerSample; - - CharlsApiResultType result = CharlsEncodeStreamHeader(¶ms, NULL, 0, &encodedSize); - if (result != CharlsApiResultType::OK) { - printf("计算编码缓冲区大小失败: %d\n", result); - free(originalData); - return 1; - } - - // 分配编码缓冲区 - unsigned char* encodedData = (unsigned char*)malloc(encodedSize); - if (!encodedData) { - printf("编码缓冲区分配失败\n"); - free(originalData); - return 1; - } - - // 编码图像 - result = CharlsEncodeStream(originalData, imageSize, ¶ms, encodedData, encodedSize, &encodedSize); - if (result != CharlsApiResultType::OK) { - printf("图像编码失败: %d\n", result); - free(originalData); - free(encodedData); - return 1; - } - - printf("编码成功,编码后大小: %zu bytes\n", encodedSize); - - // 解码图像 - unsigned char* decodedData = (unsigned char*)malloc(imageSize); - if (!decodedData) { - printf("解码缓冲区分配失败\n"); - free(originalData); - free(encodedData); - return 1; - } - - size_t decodedSize = imageSize; - result = CharlsDecodeStream(encodedData, encodedSize, decodedData, decodedSize, &decodedSize, ¶ms); - if (result != CharlsApiResultType::OK) { - printf("图像解码失败: %d\n", result); - free(originalData); - free(encodedData); - free(decodedData); - return 1; - } - - printf("解码成功,解码后大小: %zu bytes\n", decodedSize); - - // 验证编解码结果 - int success = 1; - for (size_t i = 0; i < imageSize; i++) { - if (originalData[i] != decodedData[i]) { - printf("编解码验证失败,位置 %zu: 原始=%d, 解码=%d\n", - i, originalData[i], decodedData[i]); - success = 0; - break; - } - } - - if (success) { - printf("编解码验证成功!\n"); - } - - // 清理内存 - free(originalData); - free(encodedData); - free(decodedData); - - return success ? 0 : 1; - } - EOF - - # 编译测试程序 - LOG_INFO "编译测试程序" - gcc test_charls.c -o test_charls -lCharLS - CHECK_RESULT $? 0 0 "编译测试程序失败" - - # 运行测试程序 - LOG_INFO "运行测试程序" - ./test_charls - CHECK_RESULT $? 0 0 "运行测试程序失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_charls.c test_charls - - # 如果测试开始时未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载CharLS-devel软件包" - dnf remove -y CharLS-devel - CHECK_RESULT $? 0 0 "卸载CharLS-devel失败" - fi - - LOG_INFO "CharLS-devel基本功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_cluster_join.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_cluster_join.sh deleted file mode 100644 index 10be971918b..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_cluster_join.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试集群加入功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装ganglia-gmond - if rpm -q ganglia-gmond &>/dev/null; then - LOG_INFO "ganglia-gmond已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "ganglia-gmond未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在ganglia-gmond软件包 - LOG_INFO "检查yum源中是否存在ganglia-gmond软件包" - if ! dnf list ganglia-gmond &>/dev/null; then - LOG_ERROR "yum源中未找到ganglia-gmond软件包" - exit 255 - fi - - # 安装ganglia-gmond软件包 - LOG_INFO "安装ganglia-gmond软件包" - dnf install -y ganglia-gmond - CHECK_RESULT $? 0 0 "安装ganglia-gmond失败" - - # 检查集群加入功能 - LOG_INFO "测试集群加入功能" - if ! gmond --help | grep -q "cluster"; then - LOG_ERROR "gmond命令不支持集群参数" - exit 255 - fi - - # 模拟集群加入操作 - LOG_INFO "执行集群加入操作" - gmond --cluster=test_cluster --debug=5 - CHECK_RESULT $? 0 0 "集群加入失败" - - # 如果需要第二个服务器执行命令,示例: - # LOG_INFO "在第二个服务器上执行命令" - # SSH_CMD ls $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER - - # 清理环境:如果之前未安装则卸载ganglia-gmond - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载ganglia-gmond软件包" - dnf remove -y ganglia-gmond - CHECK_RESULT $? 0 0 "卸载ganglia-gmond失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_conf_reload.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_conf_reload.sh deleted file mode 100644 index 172dca7f44f..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_conf_reload.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试 gmond 配置文件重载功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装 ganglia-gmond - LOG_INFO "检查 ganglia-gmond 是否已安装" - if dnf list installed ganglia-gmond &>/dev/null; then - LOG_INFO "ganglia-gmond 已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "ganglia-gmond 未安装,将进行安装" - INSTALLED=false - fi - - # 检查 yum 源中是否有 ganglia-gmond 软件包 - LOG_INFO "检查 yum 源中是否有 ganglia-gmond" - if ! dnf list available ganglia-gmond &>/dev/null; then - LOG_ERROR "yum 源中未找到 ganglia-gmond 软件包" - exit 255 - fi - - # 如果未安装,则安装 ganglia-gmond - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 ganglia-gmond" - dnf install -y ganglia-gmond - CHECK_RESULT $? 0 0 "安装 ganglia-gmond 失败" - fi - - # 启动 ganglia-gmond 服务 - LOG_INFO "启动 ganglia-gmond 服务" - systemctl start gmond - CHECK_RESULT $? 0 0 "启动 ganglia-gmond 服务失败" - - # 检查 ganglia-gmond 服务状态 - LOG_INFO "检查 ganglia-gmond 服务状态" - systemctl status gmond | grep -q "active (running)" - CHECK_RESULT $? 0 0 "ganglia-gmond 服务未正常运行" - - # 修改配置文件并重载 - LOG_INFO "修改配置文件并重载" - echo "# Test configuration" >> /etc/ganglia/gmond.conf - pkill -HUP gmond - CHECK_RESULT $? 0 0 "重载配置文件失败" - - # 验证配置文件是否生效(示例检查日志) - LOG_INFO "验证配置文件是否生效" - tail -n 10 /var/log/messages | grep -q "reloading configuration" - CHECK_RESULT $? 0 0 “配置文件重载未生效” - - #清理环境:如果脚本开始时未安装,则卸载 ganglia—gmond - if [ "$INSTALLED" = false ]; then - LOG_INFO “卸载 gangliia—gmmond” - dnf remove -y gangliia—gmmond - CHECK_RESULT $? 0 0 “卸载 gangliia—gmmond失败” - fi - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_log_level.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_log_level.sh deleted file mode 100644 index 8274521e69e..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_log_level.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试日志级别设置功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试日志级别设置功能 - - # 检查是否已安装ganglia-gmond - LOG_INFO "检查是否已安装ganglia-gmond" - if dnf list installed ganglia-gmond &>/dev/null; then - LOG_INFO "ganglia-gmond已安装,脚本结束时保持安装状态" - INSTALLED=true - else - LOG_INFO "ganglia-gmond未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有ganglia-gmond软件包 - LOG_INFO "检查yum源中是否有ganglia-gmond软件包" - if ! dnf list available ganglia-gmond &>/dev/null; then - LOG_ERROR "yum源中未找到ganglia-gmond软件包" - exit 255 - fi - - # 如果未安装,则安装ganglia-gmond - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装ganglia-gmond" - dnf install -y ganglia-gmond - CHECK_RESULT $? 0 0 "安装ganglia-gmond失败" - fi - - # 测试日志级别设置功能 - LOG_INFO "测试日志级别设置功能" - gmond --log_level=info &>/dev/null - CHECK_RESULT $? 0 0 "设置日志级别为info失败" - - gmond --log_level=debug &>/dev/null - CHECK_RESULT $? 0 0 "设置日志级别为debug失败" - - gmond --log_level=error &>/dev/null - CHECK_RESULT $? 0 0 "设置日志级别为error失败" - - # 测试不支持的日志级别 - LOG_INFO "测试不支持的日志级别" - gmond --log_level=invalid &>/dev/null - if [ $? -ne 0 ]; then - LOG_INFO "不支持无效的日志级别,测试通过" - else - LOG_ERROR "支持无效的日志级别,测试失败" - exit 255 - fi - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载ganglia-gmond" - dnf remove -y ganglia-gmond - CHECK_RESULT $? 0 0 "卸载ganglia-gmond失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_metric_pull.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_metric_pull.sh deleted file mode 100644 index 386ab5ad9db..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_metric_pull.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-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试指标拉取功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装ganglia-gmond - if rpm -q ganglia-gmond &>/dev/null; then - LOG_INFO "检测到ganglia-gmond已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "未检测到ganglia-gmond安装,脚本将进行安装测试并在结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在ganglia-gmond软件包 - LOG_INFO "检查yum源中是否存在ganglia-gmond软件包" - if ! dnf list available ganglia-gmond &>/dev/null; then - LOG_ERROR "yum源中未找到ganglia-gmond软件包" - exit 255 - fi - - # 安装ganglia-gmond - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装ganglia-gmond" - dnf install -y ganglia-gmond - CHECK_RESULT $? 0 0 "安装ganglia-gmond失败" - fi - - # 检查gmond命令是否支持--help参数 - LOG_INFO "检查gmond命令是否支持--help参数" - gmond --help &>/dev/null - CHECK_RESULT $? 0 255 "gmond命令不支持--help参数" - - # 测试指标拉取功能 - LOG_INFO "测试指标拉取功能" - gmetric --name="test_metric" --value="100" --type="uint32" --units="count" - CHECK_RESULT $? 0 0 "指标拉取功能测试失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载ganglia-gmond" - dnf remove -y ganglia-gmond - CHECK_RESULT $? 0 0 "卸载ganglia-gmond失败" - fi - - LOG_INFO "测试脚本执行完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_metric_push.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_metric_push.sh deleted file mode 100644 index 93a16cd2838..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_metric_push.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试指标推送功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试指标推送功能 - LOG_INFO "开始测试指标推送功能" - - # 检查是否已安装ganglia-gmond - if rpm -q ganglia-gmond &>/dev/null; then - LOG_INFO "ganglia-gmond已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "ganglia-gmond未安装,准备安装" - INSTALLED=false - fi - - # 检查yum源中是否有ganglia-gmond软件包 - LOG_INFO "检查yum源中是否存在ganglia-gmond软件包" - if ! dnf list ganglia-gmond &>/dev/null; then - LOG_ERROR "yum源中未找到ganglia-gmond软件包" - exit 255 - fi - - # 安装ganglia-gmond(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装ganglia-gmond" - dnf install -y ganglia-gmond || { - LOG_ERROR "安装ganglia-gmond失败" - exit 1 - } - fi - - # 检查gmond命令是否可用 - LOG_INFO "检查gmond命令是否可用" - if ! command -v gmond &>/dev/null; then - LOG_ERROR "gmond命令不存在或不支持" - exit 255 - fi - - # 测试指标推送功能 - LOG_INFO "测试指标推送功能" - gmond --check-config || { - LOG_ERROR "gmond配置检查失败" - if [ "$INSTALLED" = false ]; then dnf remove -y ganglia-gmond; fi - exit 1 - } - - CHECK_RESULT $? 0 0 "gmond配置检查失败" - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境,卸载ganglia-gmond" - dnf remove -y ganglia-gmond || { - LOG_ERROR "卸载ganglia-gmond失败" - exit 1 - } - fi - - LOG_INFO "测试指标推送功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_restart.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_restart.sh deleted file mode 100644 index 14db965766a..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_restart.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 gmond 服务重启功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已经安装ganglia-gmond - if dnf list installed ganglia-gmond &>/dev/null; then - LOG_INFO "ganglia-gmond已经安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "ganglia-gmond未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有ganglia-gmond软件包 - LOG_INFO "检查yum源中是否有ganglia-gmond软件包" - if ! dnf list available ganglia-gmond &>/dev/null; then - LOG_ERROR "yum源中没有找到ganglia-gmond软件包" - exit 255 - fi - - # 如果未安装,则安装ganglia-gmond - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装ganglia-gmond" - dnf install -y ganglia-gmond - CHECK_RESULT $? 0 0 "安装ganglia-gmond失败" - fi - - # 检查gmond服务是否存在 - LOG_INFO "检查gmond服务是否存在" - systemctl list-unit-files | grep -q gmond.service - CHECK_RESULT $? 0 0 "gmond服务不存在" - - # 重启gmond服务并检查状态 - LOG_INFO "重启gmond服务" - systemctl restart gmond.service - CHECK_RESULT $? 0 0 "重启gmond服务失败" - - LOG_INFO "检查gmond服务状态" - systemctl status gmond.service | grep -q "active (running)" - CHECK_RESULT $? 0 0 "gmond服务未正常运行" - - # 清理环境:如果脚本开始时未安装,则卸载ganglia-gmond - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载ganglia-gmond" - dnf remove -y ganglia-gmond - CHECK_RESULT $? 0 0 "卸载ganglia-gmond失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_start.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_start.sh deleted file mode 100644 index 30aa076abee..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_start.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试 gmond 服务启动功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试 gmond 服务启动功能 - - LOG_INFO "开始测试 gmond 服务启动功能" - - # 检查是否已安装 ganglia-gmond - LOG_INFO "检查 ganglia-gmond 是否已安装" - if dnf list installed ganglia-gmond &>/dev/null; then - LOG_INFO "ganglia-gmond 已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "ganglia-gmond 未安装,准备安装" - INSTALLED=false - fi - - # 检查 yum 源中是否有 ganglia-gmond - LOG_INFO "检查 yum 源中是否有 ganglia-gmond" - if ! dnf list available ganglia-gmond &>/dev/null; then - LOG_ERROR "yum 源中没有 ganglia-gmond 软件包" - exit 255 - fi - - # 如果未安装,则安装 ganglia-gmond - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 ganglia-gmond" - dnf install -y ganglia-gmond - CHECK_RESULT $? 0 0 "安装 ganglia-gmond 失败" - fi - - # 检查 gmond 服务是否支持 start 参数 - LOG_INFO "检查 gmond 服务是否支持 start 参数" - systemctl list-unit-files | grep -q "gmond.service" - CHECK_RESULT $? 0 0 "gmond.service 不存在或不支持" - - # 启动 gmond 服务 - LOG_INFO "启动 gmond 服务" - systemctl start gmond - CHECK_RESULT $? 0 0 "启动 gmond 服务失败" - - #检查 gmonnd运行状态 - LOG_INFO "检查gmonnd运行状态" - systemctl status gmond | grep -q "active (running)" - CHECK_RESULT $? 0 0 "gmond未正常运行" - - #停止gmonnd服务 - LOG_INFO"停止gmonnd服务" - systemctl stop gmonnd - CHECK_RESULT $? 0 0 "停止gmonnd失败" - - #恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO"卸载ganglia—gmonnd" - dnf remove -y ganglia—gmonnd - CHECK_RESULT $? 0 0"卸载ganglia—gmonnd失败" - fi - - LOG_INFO“测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_status.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_status.sh deleted file mode 100644 index 0bfc399feb4..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_status.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-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试 gmond 服务状态查询功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装ganglia-gmond - if rpm -q ganglia-gmond >/dev/null 2>&1; then - LOG_INFO "ganglia-gmond已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "ganglia-gmond未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有ganglia-gmond软件包 - LOG_INFO "检查yum源中是否有ganglia-gmond软件包" - if ! dnf list available ganglia-gmond >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到ganglia-gmond软件包" - exit 255 - fi - - # 安装ganglia-gmond - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装ganglia-gmond" - dnf install -y ganglia-gmond - CHECK_RESULT $? 0 0 "安装ganglia-gmond失败" - fi - - # 检查gmond服务状态查询功能 - LOG_INFO "测试gmond服务状态查询功能" - systemctl status gmond >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "gmond服务状态查询失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载ganglia-gmond" - dnf remove -y ganglia-gmond - CHECK_RESULT $? 0 0 "卸载ganglia-gmond失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_stop.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_stop.sh deleted file mode 100644 index fb2470f6cc0..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_function_stop.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 gmond 服务停止功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装ganglia-gmond - LOG_INFO "检查是否已安装ganglia-gmond" - if rpm -q ganglia-gmond &>/dev/null; then - LOG_INFO "ganglia-gmond已安装" - installed=true - else - LOG_INFO "ganglia-gmond未安装" - installed=false - fi - - # 检查yum源中是否有ganglia-gmond软件包 - LOG_INFO "检查yum源中是否有ganglia-gmond软件包" - if ! dnf list available ganglia-gmond &>/dev/null; then - LOG_ERROR "yum源中未找到ganglia-gmond软件包" - exit 255 - fi - - # 如果未安装,则安装ganglia-gmond - if [ "$installed" = false ]; then - LOG_INFO "安装ganglia-gmond" - dnf install -y ganglia-gmond - CHECK_RESULT $? 0 0 "安装ganglia-gmond失败" - fi - - # 检查gmond服务状态 - LOG_INFO "检查gmond服务状态" - systemctl status gmond - CHECK_RESULT $? 0 0 "gmond服务状态检查失败" - - # 停止gmond服务 - LOG_INFO "停止gmond服务" - systemctl stop gmond - CHECK_RESULT $? 0 0 "停止gmond服务失败" - - # 验证gmond服务是否已停止 - LOG_INFO "验证gmond服务是否已停止" - systemctl status gmond | grep -q inactive - CHECK_RESULT $? 0 0 "gmond服务未停止" - - # 恢复环境:如果脚本开始时未安装,则卸载ganglia-gmond;否则保持安装状态 - if [ "$installed" = false ]; then - LOG_INFO "卸载ganglia-gmond以恢复环境" - dnf remove -y ganglia-gmond - CHECK_RESULT $? 0 0 "卸载ganglia-gmon失败" - else - LOG_INFO "恢复gmon服务" - systemctl start gmond - CHECK_RESULT $? 0 0 "启动gmon服务失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gmetric_t.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gmetric_t.sh deleted file mode 100644 index 06e0fcb8bd8..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gmetric_t.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试 gmetric 命令的 -t 参数,指定指标类型 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 gmetric 命令的 -t 参数,指定指标类型" - - # 检查是否已安装 ganglia-gmond 软件包 - if ! dnf list installed ganglia-gmond &>/dev/null; then - LOG_INFO "环境未安装 ganglia-gmond,将进行安装" - # 检查 yum 源中是否有 ganglia-gmond 软件包 - if ! dnf list available ganglia-gmond &>/dev/null; then - LOG_ERROR "yum 源中未找到 ganglia-gmond 软件包" - exit 255 - fi - # 安装 ganglia-gmond - dnf install -y ganglia-gmond - CHECK_RESULT $? 0 0 "安装 ganglia-gmond 失败" - # 标记需要卸载 - UNINSTALL_GMOND=1 - else - LOG_INFO "环境已安装 ganglia-gmond,无需重新安装" - UNINSTALL_GMOND=0 - fi - - # 测试 gmetric 命令的 -t 参数 - LOG_INFO "测试 gmetric 命令的 -t 参数" - gmetric --help | grep -q -- "-t, --type" - CHECK_RESULT $? 0 0 "gmetric 命令不支持 -t 参数" - - # 测试指定指标类型 - LOG_INFO "测试指定指标类型为 string" - gmetric -n test_metric -v test_value -t string -u none -d 60 - CHECK_RESULT $? 0 0 "指定指标类型为 string 失败" - - LOG_INFO "测试指定指标类型为 int8" - gmetric -n test_metric -v 123 -t int8 -u none -d 60 - CHECK_RESULT $? 0 0 "指定指标类型为 int8 失败" - - LOG_INFO "测试指定指标类型为 uint8" - gmetric n test_metric v 123 t uint8 u none d 60 - CHECK_RESULT $? 0 0 “指定指标类型为 uint8 失败” - - LOG_INFO “测试指定不存在的指标类型” - gmetrci n test_metrci v test_value t invalid_type u none d 60 - CHECK_RESULT $? ! 0 “指定不存在的指标类型未报错” - - #清理环境 - if [ "$UNINSTALL_GMOND" -eq 1 ]; then - LOG_INFO “卸载ganglia-gmond” - dnf remove -y ganglia* - CHECK_RESULT $? 00“卸载ganglia-gmond失败” - fi - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gmetric_u.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gmetric_u.sh deleted file mode 100644 index 1bfcf6b6fcc..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gmetric_u.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-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试 gmetric 命令的 -u 参数,指定指标单位 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已经安装ganglia-gmond - if rpm -q ganglia-gmond &>/dev/null; then - LOG_INFO "环境已安装ganglia-gmond,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "环境未安装ganglia-gmond,脚本结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有ganglia-gmond软件包 - LOG_INFO "检查yum源中是否有ganglia-gmond软件包" - if ! dnf list ganglia-gmond &>/dev/null; then - LOG_ERROR "yum源中未找到ganglia-gmond软件包" - exit 255 - fi - - # 安装ganglia-gmond(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装ganglia-gmond" - dnf install -y ganglia-gmond - CHECK_RESULT $? 0 0 "安装ganglia-gmond失败" - fi - - # 测试gmetric命令的-u参数,指定指标单位 - LOG_INFO "测试gmetric命令的-u参数,指定指标单位" - gmetric --name=test_metric --value=100 --type=uint32 --units=KB -u - CHECK_RESULT $? 0 0 "gmetric命令执行失败" - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载ganglia-gmond" - dnf remove -y ganglia-gmond - CHECK_RESULT $? 0 0 "卸载ganglia-gmond失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gmetric_upper_c.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gmetric_upper_c.sh deleted file mode 100644 index 849f63aec1d..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gmetric_upper_c.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 gmetric 命令的 -C 参数,指定集群名称 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装ganglia-gmond软件包 - LOG_INFO "检查是否已安装ganglia-gmond软件包" - if rpm -q ganglia-gmond &>/dev/null; then - LOG_INFO "ganglia-gmond已安装" - INSTALLED=true - else - LOG_INFO "ganglia-gmond未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在ganglia-gmond软件包 - LOG_INFO "检查yum源中是否存在ganglia-gmond软件包" - if ! dnf list available ganglia-gmond &>/dev/null; then - LOG_ERROR "yum源中未找到ganglia-gmond软件包" - exit 255 - fi - - # 如果未安装,则安装ganglia-gmond - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装ganglia-gmond软件包" - dnf install -y ganglia-gmond || { - LOG_ERROR "安装ganglia-gmond失败" - exit 1 - } - fi - - # 测试gmetric命令的-C参数 - LOG_INFO "测试gmetric命令的-C参数,指定集群名称" - gmetric -C test_cluster || { - LOG_ERROR "gmetric命令执行失败" - if [ "$INSTALLED" = false ]; then - dnf remove -y ganglia-gmond - fi - exit 1 - } - - # 检查gmetric命令是否成功执行 - CHECK_RESULT $? 0 0 "gmetric命令执行失败" - - # 清理环境,恢复到之前的状态 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载ganglia-gmond软件包" - dnf remove -y ganglia-gmond || { - LOG_ERROR "卸载ganglia-gmond失败" - exit 1 - } - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gmetric_upper_t.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gmetric_upper_t.sh deleted file mode 100644 index 7ac89e823d4..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gmetric_upper_t.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试 gmetric 命令的 -T 参数,指定指标标题 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 gmetric 命令的 -T 参数,指定指标标题" - - # 检查是否已安装 ganglia-gmond 软件包 - LOG_INFO "检查 ganglia-gmond 是否已安装" - if ! dnf list installed ganglia-gmond &>/dev/null; then - LOG_INFO "ganglia-gmond 未安装,开始安装" - if ! dnf list available ganglia-gmond &>/dev/null; then - LOG_ERROR "yum源中未找到 ganglia-gmond 软件包" - exit 255 - fi - dnf install -y ganglia-gmond - CHECK_RESULT $? 0 0 "安装 ganglia-gmond 失败" - INSTALLED=true - else - LOG_INFO "ganglia-gmond 已安装" - INSTALLED=false - fi - - # 检查 gmetric 命令是否支持 -T 参数 - LOG_INFO "检查 gmetric 命令是否支持 -T 参数" - gmetric --help | grep -q -- "-T" - CHECK_RESULT $? 0 0 "gmetric 命令不支持 -T 参数" - - # 测试 gmetric -T 参数功能 - LOG_INFO "测试 gmetric -T 参数功能" - gmetric -n test_metric -v 100 -T "Test Metric Title" - CHECK_RESULT $? 0 0 "执行 gmetric -T 命令失败" - - # 清理环境,如果之前未安装则卸载软件包 - if [ "$INSTALLED" = true ]; then - LOG_INFO "卸载 ganglia-gmond" - dnf remove -y ganglia-gmond - CHECK_RESULT $?- -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gmetric_x.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gmetric_x.sh deleted file mode 100644 index 865074be473..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gmetric_x.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试 gmetric 命令的 -x 参数,指定最大时间间隔 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试 gmetric 命令的 -x 参数,指定最大时间间隔 - - LOG_INFO "开始测试 gmetric 命令的 -x 参数" - - # 检查是否已安装 ganglia-gmond 软件包 - if ! dnf list installed ganglia-gmond &>/dev/null; then - LOG_INFO "环境未安装 ganglia-gmond,将进行安装" - # 检查 yum 源中是否有 ganglia-gmond - if ! dnf list available ganglia-gmond &>/dev/null; then - LOG_ERROR "yum 源中未找到 ganglia-gmond 软件包" - exit 255 - fi - # 安装 ganglia-gmond - dnf install -y ganglia-gmond - CHECK_RESULT $? 0 0 "安装 ganglia-gmond 失败" - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "环境已安装 ganglia-gmond,无需重复安装" - fi - - # 检查 gmetric 命令是否存在 - if ! command -v gmetric &>/dev/null; then - LOG_ERROR "gmetric 命令不存在" - exit 255 - fi - - # 测试 gmetric -x 参数 - LOG_INFO "测试 gmetric -x 参数" - gmetric -x --max-interval=60 - CHECK_RESULT $? 0 0 "gmetric -x --max-interval=60 执行失败" - - #清理环境 - if [ "$NEED_UNINSTALL" == "1" ]; then - LOG_INFO "清理环境,卸载 ganglia-gmond" - dnf remove -y ganglia-gmond - CHECK_RESULT $?4 -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat__num_1.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat__num_1.sh deleted file mode 100644 index b374b79257f..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat__num_1.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 gstat 命令的单行打印主机和信息选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装ganglia-gmond和gstat - LOG_INFO "检查是否已安装ganglia-gmond和gstat" - if rpm -q ganglia-gmond gstat &>/dev/null; then - LOG_INFO "ganglia-gmond和gstat已安装" - installed=true - else - LOG_INFO "ganglia-gmond和gstat未安装" - installed=false - fi - - # 检查yum源中是否有ganglia-gmond和gstat软件包 - LOG_INFO "检查yum源中是否有ganglia-gmond和gstat软件包" - if ! dnf list ganglia-gmond gstat &>/dev/null; then - LOG_ERROR "yum源中未找到ganglia-gmond或gstat软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装ganglia-gmond和gstat软件包" - dnf install -y ganglia-gmond gstat - CHECK_RESULT $? 0 0 "安装ganglia-gmond和gstat失败" - fi - - # 测试gstat命令的单行打印主机和信息选项 - LOG_INFO "测试gstat命令的单行打印主机和信息选项" - output=$(gstat --all-hosts --single-line 2>&1) - CHECK_RESULT $? 0 0 "执行gstat命令失败" - - # 检查输出是否包含主机信息 - LOG_INFO "检查gstat命令输出是否包含主机信息" - if [[ "$output" == *"host"* ]]; then - LOG_INFO "gstat命令输出包含主机信息" - else - LOG_ERROR "gstat命令输出不包含主机信息" - exit 1 - fi - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载ganglia-gmond和gstat软件包" - dnf remove -y ganglia-gmond gstat - CHECK_RESULT $? 0 0 "卸载ganglia-gmond和gstat失败" - fi - - LOG_INFO "测试脚本执行完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat__upper_v.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat__upper_v.sh deleted file mode 100644 index f694a3c54b8..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat__upper_v.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试 gstat 命令的版本选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装ganglia-gmond和gstat - LOG_INFO "检查是否已安装ganglia-gmond和gstat" - if rpm -q ganglia-gmond gstat &>/dev/null; then - LOG_INFO "ganglia-gmond和gstat已安装" - installed=true - else - LOG_INFO "ganglia-gmond和gstat未安装" - installed=false - fi - - # 检查yum源中是否有ganglia-gmond和gstat软件包 - LOG_INFO "检查yum源中是否有ganglia-gmond和gstat软件包" - if ! dnf list available ganglia-gmond gstat &>/dev/null; then - LOG_ERROR "yum源中未找到ganglia-gmond或gstat软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装ganglia-gmond和gstat软件包" - dnf install -y ganglia-gmond gstat - CHECK_RESULT $? 0 0 "安装ganglia-gmond和gstat失败" - fi - - # 测试gstat命令的版本选项 - LOG_INFO "测试gstat命令的版本选项" - gstat --version &>/dev/null - CHECK_RESULT $? 0 0 "gstat命令不支持--version选项" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载ganglia-gmond和gstat软件包" - dnf remove -y ganglia-gmond gstat - CHECK_RESULT $? 0 0 "卸载ganglia-gmond和gstat失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_a.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_a.sh deleted file mode 100644 index dfba51d45ae..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_a.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试 gstat 命令的列出所有主机选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装ganglia-gmond和gstat - LOG_INFO "检查是否已安装ganglia-gmond和gstat" - if ! rpm -q ganglia-gmond gstat &> /dev/null; then - LOG_INFO "未安装ganglia-gmond和gstat,开始安装" - # 检查yum源中是否有ganglia-gmond和gstat - if ! dnf list ganglia-gmond gstat &> /dev/null; then - LOG_ERROR "yum源中未找到ganglia-gmond或gstat" - exit 255 - fi - # 安装软件包 - dnf install -y ganglia-gmond gstat - CHECK_RESULT $? 0 0 "安装ganglia-gmond和gstat失败" - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "ganglia-gmond和gstat已安装" - fi - - # 测试gstat命令的列出所有主机选项 - LOG_INFO "测试gstat命令的列出所有主机选项" - if ! gstat --help | grep -q "\-a"; then - LOG_ERROR "gstat命令不支持-a选项" - exit 255 - fi - - # 执行gstat -a命令并检查结果 - gstat -a - CHECK_RESULT $? 0 0 "执行gstat -a命令失败" - - # 清理环境 - if [ "$NEED_UNINSTALL" -eq 1 ]; then - LOG_INFO "卸载ganglia-gmond和gstat" - dnf remove -y ganglia-gmond gstat - CHECK_RESULT $? 0 0 "卸载ganglia-gmond和gstat失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_d.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_d.sh deleted file mode 100644 index 389a7d3e2cc..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_d.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 gstat 命令的仅列出死机主机选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在ganglia-gmond和ganglia-gmond-gstat包 - LOG_INFO "检查yum源中是否存在ganglia-gmond和ganglia-gmond-gstat包" - dnf list available ganglia-gmond ganglia-gmond-gstat >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到ganglia-gmond或ganglia-gmond-gstat包" - exit 255 - fi - - # 检查是否已安装ganglia-gmond和ganglia-gmond-gstat - LOG_INFO "检查是否已安装ganglia-gmond和ganglia-gmond-gstat" - rpm -q ganglia-gmond ganglia-gmond-gstat >/dev/null 2>&1 - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "ganglia-gmond和ganglia-gmond-gstat已安装" - else - installed=false - LOG_INFO "ganglia-gmond和ganglia-mond-gstat未安装,将进行安装" - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装ganglia-mond和ganalia-mond-stat包" - dnf install -y ganglia-mond ganaglia-mond-stat - CHECK_RESULT $? 0 0 "安装失败" - fi - - # 测试gstat命令的仅列出死机主机选项 - LOG_INFO "测试gstat命令的仅列出死机主机选项" - gstat -d >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "gstat -d命令执行失败" - - # 如果之前未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载ganalia-mond和ganalia-mond-stat包" - dnf remove -y ganaglia-mond ganaglia-mond-stat - CHECK_RESULT $? 0 0 "卸载失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_h.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_h.sh deleted file mode 100644 index c00c0731de3..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_h.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 gstat 命令的帮助选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在ganglia-gmond和gstat软件包 - LOG_INFO "检查yum源中是否存在ganglia-gmond和gstat软件包" - dnf list ganglia-gmond gstat >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到ganglia-gmond或gstat软件包" - exit 255 - fi - - # 检查是否已安装ganglia-gmond和gstat - LOG_INFO "检查是否已安装ganglia-gmond和gstat" - rpm -q ganglia-gmond gstat >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "ganglia-gmond和gstat已安装,测试完成后保持安装状态" - installed=true - else - LOG_INFO "ganglia-gmond和gstat未安装,测试完成后将卸载" - installed=false - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装ganglia-gmond和gstat软件包" - dnf install -y ganglia-gmond gstat - CHECK_RESULT $? 0 0 "安装ganglia-gmond和gstat失败" - fi - - # 测试gstat命令的帮助选项 - LOG_INFO "测试gstat命令的帮助选项" - gstat --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "gstat命令的帮助选项不支持或执行失败" - - # 如果最初未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载ganglia-gmond和gstat软件包" - dnf remove -y ganglia-gmond gstat - CHECK_RESULT $? 0 0 "卸载ganglia-gmond和gstat失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_i.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_i.sh deleted file mode 100644 index e724dcf82fb..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_i.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-08 -# @License : Mulan PSL v2 -# @Desc : 测试 gstat 命令的指定 gmond ip 地址选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装ganglia-gmond和ganglia-gstat - LOG_INFO "检查是否已安装ganglia-gmond和ganglia-gstat" - if rpm -q ganglia-gmond ganglia-gstat &>/dev/null; then - LOG_INFO "ganglia-gmond和ganglia-gstat已安装" - installed=true - else - LOG_INFO "ganglia-gmond和ganglia-gstat未安装" - installed=false - fi - - # 检查yum源中是否有ganglia-gmond和ganglia-gstat软件包 - LOG_INFO "检查yum源中是否有ganglia-gmond和ganglia-gstat软件包" - if ! dnf list available ganglia-gmond ganglia-gstat &>/dev/null; then - LOG_ERROR "yum源中未找到ganglia-gmond或ganglia-gstat软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装ganglia-gmond和ganglia-gstat" - dnf install -y ganglia-gmond ganglia-gstat || { - LOG_ERROR "安装ganglia-gmond或ganglia-gstat失败" - exit 1 - } - fi - - # 测试gstat命令的指定gmond ip地址选项 - LOG_INFO "测试gstat命令的指定gmond ip地址选项" - gstat -i 127.0.0.1 &>/dev/null - CHECK_RESULT $? 0 0 "gstat命令的指定gmond ip地址选项测试失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载ganglia-gmond和ganglia-gstat" - dnf remove -y ganglia-gmond ganglia-gstat || { - LOG_ERROR "卸载ganglia-gmond或ganglia- g stat失败" - exit 1 - } - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_l.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_l.sh deleted file mode 100644 index 9e375af29d6..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_l.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试 gstat 命令的仅打印主机列表选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装ganglia-gmond和gstat - LOG_INFO "检查是否已安装ganglia-gmond和gstat" - if rpm -q ganglia-gmond &> /dev/null && rpm -q gstat &> /dev/null; then - LOG_INFO "ganglia-gmond和gstat已安装" - INSTALLED=true - else - LOG_INFO "ganglia-gmond和gstat未安装" - INSTALLED=false - fi - - # 检查yum源中是否有ganglia-gmond和gstat软件包 - LOG_INFO "检查yum源中是否有ganglia-gmond和gstat软件包" - if ! dnf list available ganglia-gmond gstat &> /dev/null; then - LOG_ERROR "yum源中未找到ganglia-gmond或gstat软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装ganglia-gmond和gstat" - dnf install -y ganglia-gmond gstat - CHECK_RESULT $? 0 0 "安装ganglia-gmond和gstat失败" - fi - - # 测试gstat命令的仅打印主机列表选项 - LOG_INFO "测试gstat命令的仅打印主机列表选项" - if ! gstat --help | grep -q "\-l"; then - LOG_ERROR "gstat命令不支持-l选项" - exit 255 - fi - - gstat -l - CHECK_RESULT $? 0 0 "执行gstat -l命令失败" - - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载ganglia-gmond和gstat" - dnf remove -y ganglia-gmond gstat - CHECK_RESULT $? 0 0 "卸载ganglia-gmond和gstat失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_m.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_m.sh deleted file mode 100644 index 05888c7fd7c..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_m.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-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试 gstat 命令的打印负载均衡的 mpifile 选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装ganglia-gmond和gstat - LOG_INFO "检查是否已安装ganglia-gmond和gstat" - if rpm -q ganglia-gmond gstat &>/dev/null; then - LOG_INFO "ganglia-gmond和gstat已安装,保持安装状态" - installed=true - else - installed=false - fi - - # 检查yum源中是否存在ganglia-gmond和gstat - LOG_INFO "检查yum源中是否存在ganglia-gmond和gstat" - if ! dnf list available ganglia-gmond gstat &>/dev/null; then - LOG_ERROR "yum源中未找到ganglia-gmond或gstat软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装ganglia-gmond和gstat" - dnf install -y ganglia-gmond gstat - CHECK_RESULT $? 0 0 "安装ganglia-gmond和gstat失败" - fi - - # 测试gstat命令的mpifile选项 - LOG_INFO "测试gstat命令的mpifile选项" - output=$(gstat --mpifile 2>&1) - if [[ "$output" == *"unsupported option"* ]] || [[ "$output" == *"invalid option"* ]]; then - LOG_ERROR "gstat命令不支持mpifile选项" - exit 255 - else - CHECK_RESULT $? 0 0 "执行gstat --mpifile失败" - fi - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载ganglia-gmond和gstat" - dnf remove -y ganglia-gmond gstat - CHECK_RESULT $? 0 0 "卸载ganglia-gmond和gstat失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_n.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_n.sh deleted file mode 100644 index bf6aa056c6a..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_n.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试 gstat 命令的打印数字地址选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装ganglia-gmond和gstat - LOG_INFO "检查是否已安装ganglia-gmond和gstat" - if rpm -q ganglia-gmond &> /dev/null && rpm -q gstat &> /dev/null; then - LOG_INFO "ganglia-gmond和gstat已安装" - INSTALLED=true - else - LOG_INFO "ganglia-gmond和gstat未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在ganglia-gmond和gstat - LOG_INFO "检查yum源中是否存在ganglia-gmond和gstat" - if ! dnf list available ganglia-gmond gstat &> /dev/null; then - LOG_ERROR "yum源中不存在ganglia-gmond或gstat" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装ganglia-gmond和gstat" - dnf install -y ganglia-gmond gstat - CHECK_RESULT $? 0 0 "安装ganglia-gmond和gstat失败" - fi - - # 测试gstat命令的打印数字地址选项 - LOG_INFO "测试gstat命令的打印数字地址选项" - if ! gstat --help | grep -q "\-\-numeric"; then - LOG_ERROR "gstat命令不支持--numeric选项" - exit 255 - fi - - # 执行gstat命令并检查结果 - LOG_INFO "执行gstat --numeric命令" - gstat --numeric - CHECK_RESULT $? 0 0 "执行gstat --numeric命令失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载ganglia-gmond和gstat" - dnf remove -y ganglia-gmond gstat - CHECK_RESULT $? 0 0 "卸载ganglia-gmond和gstat失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_p.sh b/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_p.sh deleted file mode 100644 index 5e24bdd56f5..00000000000 --- a/testcases/function_test/pkg_test/ganglia/ganglia-gmond/test_ganglia-gmond_gstat_p.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试 gstat 命令的指定 gmond 端口选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装ganglia-gmond和gstat - LOG_INFO "检查是否已安装ganglia-gmond和gstat" - if rpm -q ganglia-gmond ganglia-gstat &>/dev/null; then - LOG_INFO "ganglia-gmond和gstat已安装" - installed=true - else - LOG_INFO "ganglia-gmond和gstat未安装" - installed=false - fi - - # 检查yum源中是否有ganglia-gmond和gstat软件包 - LOG_INFO "检查yum源中是否有ganglia-gmond和gstat软件包" - if ! dnf list available ganglia-gmond ganglia-gstat &>/dev/null; then - LOG_ERROR "yum源中未找到ganglia-gmond或gstat软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装ganglia-gmond和gstat软件包" - dnf install -y ganglia-gmond ganglia-gstat - CHECK_RESULT $? 0 0 "安装ganglia-gmond和gstat失败" - fi - - # 测试gstat命令的指定gmond端口选项 - LOG_INFO "测试gstat命令的指定gmond端口选项" - gstat -p 8649 localhost - CHECK_RESULT $? 0 0 "gstat命令执行失败" - - # 如果之前未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载ganglia-gmond和gstat软件包" - dnf remove -y ganglia-gmond ganglia-gstat - CHECK_RESULT $? 0 0 "卸载ganglia-gmond和gstat失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/hspell/hspell-devel/test_hspell-devel_function_help.sh b/testcases/function_test/pkg_test/hspell/hspell-devel/test_hspell-devel_function_help.sh deleted file mode 100644 index aadd95c3285..00000000000 --- a/testcases/function_test/pkg_test/hspell/hspell-devel/test_hspell-devel_function_help.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-04 -# @License : Mulan PSL v2 -# @Desc : Test the help or usage information of the command -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - PACKAGE_NAME="hspell-devel" - COMMAND="hspell" - EXPECTED_HELP_PATTERN="用法\|用法说明\|help\|--help\|-h" - - function check_package_availability() { - LOG_INFO "检查软件包 $PACKAGE_NAME 是否在yum源中" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - LOG_INFO "软件包 $PACKAGE_NAME 在yum源中可用" - } - - function check_command_option() { - LOG_INFO "检查命令 $COMMAND 是否支持帮助参数" - $COMMAND --help &>/dev/null || $COMMAND -h &>/dev/null || $COMMAND help &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $COMMAND 不支持标准的帮助参数(--help, -h, help)" - exit 255 - fi - LOG_INFO "命令 $COMMAND 支持帮助参数" - } - - function install_package() { - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - } - - function uninstall_package() { - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - } - - function test_help_info() { - LOG_INFO "测试命令 $COMMAND 的帮助信息" - $COMMAND --help 2>&1 | grep -q -E "$EXPECTED_HELP_PATTERN" - CHECK_RESULT $? 0 0 "命令 $COMMAND --help 未显示预期的帮助信息" - - $COMMAND -h 2>&1 | grep -q -E "$EXPECTED_HELP_PATTERN" - CHECK_RESULT $? 0 0 "命令 $COMMAND -h 未显示预期的帮助信息" - - LOG_INFO "命令 $COMMAND 帮助信息测试通过" - } - - function main() { - LOG_INFO "开始测试命令帮助信息" - - check_package_availability - check_command_option - - was_installed=false - rpm -q $PACKAGE_NAME &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已经安装" - was_installed=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将进行安装测试" - install_package - fi - - test_help_info - - if [ "$was_installed" = "false" ]; then - LOG_INFO "清理测试环境,卸载软件包" - uninstall_package - else - LOG_INFO "保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试完成" - } - - main "$@" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/hspell/hspell-devel/test_hspell-devel_function_spellfile.sh b/testcases/function_test/pkg_test/hspell/hspell-devel/test_hspell-devel_function_spellfile.sh deleted file mode 100644 index c36e7e809dd..00000000000 --- a/testcases/function_test/pkg_test/hspell/hspell-devel/test_hspell-devel_function_spellfile.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-04 -# @License : Mulan PSL v2 -# @Desc : Test the spelling of a text file -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试文本文件的拼写功能" - - LOG_INFO "步骤1:检查系统中是否已安装hspell-devel软件包" - if rpm -q hspell-devel &>/dev/null; then - LOG_INFO "hspell-devel软件包已安装,脚本结束时将保持安装状态" - already_installed=true - else - LOG_INFO "hspell-devel软件包未安装,将在测试过程中安装" - already_installed=false - fi - - LOG_INFO "步骤2:检查yum源中是否存在hspell-devel软件包" - if ! dnf list available hspell-devel &>/dev/null; then - LOG_ERROR "yum源中未找到hspell-devel软件包" - exit 255 - fi - - if [ "$already_installed" = false ]; then - LOG_INFO "步骤3:安装hspell-devel软件包" - dnf install -y hspell-devel - CHECK_RESULT $? 0 0 "安装hspell-devel软件包失败" - fi - - LOG_INFO "步骤4:检查hspell命令是否存在" - if ! command -v hspell &>/dev/null; then - LOG_ERROR "hspell命令不存在" - exit 255 - fi - - LOG_INFO "步骤5:创建测试文本文件" - test_file="test_spell.txt" - cat > "$test_file" << EOF - This is a test file with some spelling errors. - For example, the word "recieve" is misspelled. - Another example is "seperate". - EOF - CHECK_RESULT $? 0 0 "创建测试文本文件失败" - - LOG_INFO "步骤6:使用hspell检查文本文件的拼写" - hspell_output=$(hspell -c "$test_file" 2>&1) - hspell_exit_code=$? - - LOG_INFO "步骤7:验证hspell命令执行结果" - if [ $hspell_exit_code -eq 0 ]; then - LOG_INFO "hspell命令执行成功,输出如下:" - echo "$hspell_output" - else - LOG_ERROR "hspell命令执行失败,退出码:$hspell_exit_code" - exit $hspell_exit_code - fi - - LOG_INFO "步骤8:清理测试文件" - rm -f "$test_file" - CHECK_RESULT $? 0 0 "删除测试文本文件失败" - - if [ "$already_installed" = false ]; then - LOG_INFO "步骤9:卸载hspell-devel软件包" - dnf remove -y hspell-devel - CHECK_RESULT $? 0 0 "卸载hspell-devel软件包失败" - else - LOG_INFO "hspell-devel软件包在测试前已安装,保持安装状态" - fi - - LOG_INFO "测试完成:文本文件的拼写功能测试结束" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/jboss-specs-parent/jboss-specs-parent/test_jboss-specs-parent_function_upgrade.sh b/testcases/function_test/pkg_test/jboss-specs-parent/jboss-specs-parent/test_jboss-specs-parent_function_upgrade.sh deleted file mode 100644 index 3ca353a9757..00000000000 --- a/testcases/function_test/pkg_test/jboss-specs-parent/jboss-specs-parent/test_jboss-specs-parent_function_upgrade.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-07 -# @License : Mulan PSL v2 -# @Desc : 测试jboss-specs-parent软件包的升级功能,验证升级过程是否顺利。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - PACKAGE_NAME="jboss-specs-parent" - LOG_INFO "开始测试${PACKAGE_NAME}软件包的升级功能" - LOG_INFO "步骤1:检查当前环境中${PACKAGE_NAME}软件包是否已安装" - INSTALLED_STATUS=0 - if rpm -q ${PACKAGE_NAME} &> /dev/null; then - LOG_INFO "检测到${PACKAGE_NAME}软件包已安装,记录状态,脚本结束时将保持安装状态" - INSTALLED_STATUS=1 - CURRENT_VERSION=$(rpm -q --queryformat="%{VERSION}-%{RELEASE}" ${PACKAGE_NAME}) - LOG_INFO "当前已安装版本为:${CURRENT_VERSION}" - else - LOG_INFO "未检测到${PACKAGE_NAME}软件包安装" - fi - LOG_INFO "步骤2:检查yum源中是否存在${PACKAGE_NAME}软件包" - if ! dnf list available ${PACKAGE_NAME} &> /dev/null; then - LOG_ERROR "yum源中未找到软件包:${PACKAGE_NAME}" - exit 255 - fi - LOG_INFO "yum源中存在软件包:${PACKAGE_NAME}" - LOG_INFO "步骤3:执行软件包升级(或安装)操作" - dnf upgrade -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "升级${PACKAGE_NAME}软件包失败" - LOG_INFO "步骤4:验证升级后软件包已成功安装" - if rpm -q ${PACKAGE_NAME} &> /dev/null; then - NEW_VERSION=$(rpm -q --queryformat="%{VERSION}-%{RELEASE}" ${PACKAGE_NAME}) - LOG_INFO "升级后软件包已安装,版本为:${NEW_VERSION}" - if [[ ${INSTALLED_STATUS} -eq 1 ]]; then - LOG_INFO "升级前版本为:${CURRENT_VERSION},升级后版本为:${NEW_VERSION}" - if [[ "${CURRENT_VERSION}" != "${NEW_VERSION}" ]]; then - LOG_INFO "版本已更新,升级成功" - else - LOG_INFO "版本未变化,可能已是最新版本" - fi - fi - else - LOG_ERROR "升级操作后,${PACKAGE_NAME}软件包仍未安装" - exit 1 - fi - LOG_INFO "步骤5:环境清理与恢复" - if [[ ${INSTALLED_STATUS} -eq 0 ]]; then - LOG_INFO "测试前环境未安装${PACKAGE_NAME},执行卸载操作以恢复环境" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}软件包失败" - LOG_INFO "已成功卸载${PACKAGE_NAME}软件包,环境已恢复" - else - LOG_INFO "测试前环境已安装${PACKAGE_NAME},保持其安装状态,无需卸载" - fi - LOG_INFO "${PACKAGE_NAME}软件包升级功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/jopt-simple/jopt-simple-help/test_jopt-simple-help_function_parse.sh b/testcases/function_test/pkg_test/jopt-simple/jopt-simple-help/test_jopt-simple-help_function_parse.sh deleted file mode 100644 index f597b0e0568..00000000000 --- a/testcases/function_test/pkg_test/jopt-simple/jopt-simple-help/test_jopt-simple-help_function_parse.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : 测试 jopt-simple-help 的命令行参数解析功能,确保能正确解析输入参数。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装jopt-simple-help软件包 - LOG_INFO "检查jopt-simple-help软件包是否已安装" - if ! dnf list installed jopt-simple-help &>/dev/null; then - LOG_INFO "jopt-simple-help未安装,准备安装" - # 检查yum源中是否有该软件包 - if ! dnf list available jopt-simple-help &>/dev/null; then - LOG_ERROR "yum源中未找到jopt-simple-help软件包" - exit 255 - fi - # 安装软件包 - dnf install -y jopt-simple-help - CHECK_RESULT $? 0 0 "安装jopt-simple-help失败" - # 标记需要卸载 - UNINSTALL_NEEDED=1 - else - LOG_INFO "jopt-simple-help已安装,无需重复安装" - UNINSTALL_NEEDED=0 - fi - - # 测试jopt-simple-help的命令行参数解析功能 - LOG_INFO "测试jopt-simple-help的命令行参数解析功能" - # 测试支持的参数 - LOG_INFO "测试支持的参数" - jopt-simple-help --help - CHECK_RESULT $? 0 0 "jopt-simple-help --help执行失败" - - # 测试不支持的参数 - LOG_INFO "测试不支持的参数" - jopt-simple-help --invalid-param &>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "jopt-simple-help未正确处理不支持的参数" - exit 255 - fi - - # 清理环境 - if [ $UNINSTALL_NEEDED -eq 1 ]; then - LOG_INFO "卸载jopt-simple-help软件包" - dnf remove -y jopt-simple-help - CHECK_RESULT $? 0 0 "卸载jopt-simple-help失败" - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_bscalc__upper_v.sh b/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_bscalc__upper_v.sh deleted file mode 100644 index 6f870f2b732..00000000000 --- a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_bscalc__upper_v.sh +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-20 -# @License : Mulan PSL v2 -# @Desc : 测试bscalc的-V参数,验证其详细模式输出功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 初始化变量 - PACKAGE_NAME="libbytesize-tools" - COMMAND="bscalc" - EXPECTED_PARAM="-V" - LOG_INFO "开始测试 $COMMAND $EXPECTED_PARAM 参数功能" - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "步骤1:检查 $PACKAGE_NAME 是否在yum源中" - dnf list available "$PACKAGE_NAME" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "$PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 步骤2:检查是否已安装软件包 - LOG_INFO "步骤2:检查 $PACKAGE_NAME 是否已安装" - INSTALLED=false - rpm -q "$PACKAGE_NAME" &>/dev/null - if [ $? -eq 0 ]; then - INSTALLED=true - LOG_INFO "$PACKAGE_NAME 已安装,测试结束后保持安装状态" - else - LOG_INFO "$PACKAGE_NAME 未安装,将在测试过程中安装" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - - # 步骤4:验证命令是否存在 - LOG_INFO "步骤4:验证 $COMMAND 命令是否存在" - which "$COMMAND" &>/dev/null - CHECK_RESULT $? 0 0 "$COMMAND 命令不存在" - - # 步骤5:检查命令是否支持 -V 参数 - LOG_INFO "步骤5:检查 $COMMAND 是否支持 $EXPECTED_PARAM 参数" - $COMMAND --help 2>&1 | grep -q "\-V" - if [ $? -ne 0 ]; then - LOG_ERROR "$COMMAND 不支持 $EXPECTED_PARAM 参数" - exit 255 - fi - - # 步骤6:执行命令并验证详细模式输出 - LOG_INFO "步骤6:执行 $COMMAND $EXPECTED_PARAM 并验证输出" - OUTPUT=$($COMMAND $EXPECTED_PARAM 2>&1) - EXIT_CODE=$? - if [ $EXIT_CODE -eq 0 ]; then - if echo "$OUTPUT" | grep -q "detailed\|verbose\|版本\|详细"; then - LOG_INFO "$COMMAND $EXPECTED_PARAM 输出包含详细模式信息" - CHECK_RESULT 0 0 0 "$COMMAND $EXPECTED_PARAM 输出不符合预期" - else - LOG_ERROR "$COMMAND $EXPECTED_PARAM 输出不包含详细模式信息" - CHECK_RESULT 1 0 0 "$COMMAND $EXPECTED_PARAM 输出不符合预期" - fi - else - LOG_ERROR "$COMMAND $EXPECTED_PARAM 执行失败,退出码: $EXIT_CODE" - CHECK_RESULT $EXIT_CODE 0 0 "$COMMAND $EXPECTED_PARAM 执行失败" - fi - - # 步骤7:清理环境 - LOG_INFO "步骤7:清理测试环境" - 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 "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_bscalc__upper_v__h.sh b/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_bscalc__upper_v__h.sh deleted file mode 100644 index 6ba97cf57c3..00000000000 --- a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_bscalc__upper_v__h.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-20 -# @License : Mulan PSL v2 -# @Desc : 测试bscalc同时使用-V和-h参数的组合功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试bscalc同时使用-V和-h参数的组合功能 - - LOG_INFO "开始测试bscalc同时使用-V和-h参数的组合功能" - - # 检查软件包是否已安装 - LOG_INFO "检查libbytesize-tools软件包是否已安装" - rpm -q libbytesize-tools - if [ $? -eq 0 ]; then - LOG_INFO "libbytesize-tools软件包已安装,测试完成后将保持安装状态" - installed=true - else - LOG_INFO "libbytesize-tools软件包未安装,将在测试过程中安装" - installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有libbytesize-tools软件包" - dnf list available libbytesize-tools - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有libbytesize-tools软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装libbytesize-tools软件包" - dnf install -y libbytesize-tools - CHECK_RESULT $? 0 0 "安装libbytesize-tools软件包失败" - fi - - # 测试bscalc同时使用-V和-h参数 - LOG_INFO "测试bscalc同时使用-V和-h参数" - bscalc -V -h - result=$? - - # 检查命令执行结果 - if [ $result -eq 0 ]; then - LOG_INFO "bscalc同时使用-V和-h参数成功执行" - CHECK_RESULT $result 0 0 "bscalc同时使用-V和-h参数执行失败" - elif [ $result -eq 255 ]; then - LOG_ERROR "bscalc不支持同时使用-V和-h参数" - exit 255 - else - LOG_ERROR "bscalc命令执行失败,退出码: $result" - CHECK_RESULT $result 0 0 "bscalc命令执行失败" - fi - - # 清理环境 - LOG_INFO "清理测试环境" - - # 如果测试前未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载libbytesize-tools软件包" - dnf remove -y libbytesize-tools - CHECK_RESULT $? 0 0 "卸载libbytesize-tools软件包失败" - else - LOG_INFO "保持libbytesize-tools软件包安装状态" - fi - - LOG_INFO "测试bscalc同时使用-V和-h参数的组合功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_bscalc__v.sh b/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_bscalc__v.sh deleted file mode 100644 index 25a4c189517..00000000000 --- a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_bscalc__v.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-20 -# @License : Mulan PSL v2 -# @Desc : 测试bscalc的-v参数,验证其版本信息输出功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试bscalc的-v参数,验证其版本信息输出功能" - - # 检查软件包是否已安装 - LOG_INFO "检查libbytesize-tools软件包是否已安装" - rpm -q libbytesize-tools > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "libbytesize-tools软件包已安装,脚本结束将保持安装状态" - INSTALLED=1 - else - LOG_INFO "libbytesize-tools软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有libbytesize-tools软件包 - LOG_INFO "检查yum源中是否有libbytesize-tools软件包" - dnf list available libbytesize-tools > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到libbytesize-tools软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装libbytesize-tools软件包" - dnf install -y libbytesize-tools - CHECK_RESULT $? 0 0 "安装libbytesize-tools软件包失败" - fi - - # 测试bscalc的-v参数 - LOG_INFO "测试bscalc的-v参数,验证版本信息输出" - bscalc -v > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "bscalc命令不支持-v参数" - exit 255 - fi - - # 检查版本信息输出是否正常 - LOG_INFO "检查bscalc版本信息输出" - VERSION_OUTPUT=$(bscalc -v 2>&1) - CHECK_RESULT $? 0 0 "执行bscalc -v命令失败" - if [ -z "$VERSION_OUTPUT" ]; then - LOG_ERROR "bscalc -v未输出任何版本信息" - exit 1 - fi - LOG_INFO "bscalc版本信息: $VERSION_OUTPUT" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载libbytesize-tools软件包" - dnf remove -y libbytesize-tools - CHECK_RESULT $? 0 0 "卸载libbytesize-tools软件包失败" - else - LOG_INFO "保持libbytesize-tools软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_bscalc__v_expression.sh b/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_bscalc__v_expression.sh deleted file mode 100644 index 040a6f56670..00000000000 --- a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_bscalc__v_expression.sh +++ /dev/null @@ -1,135 +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-20 -# @License : Mulan PSL v2 -# @Desc : 测试bscalc在-v参数下计算表达式的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试bscalc在-v参数下计算表达式的功能 - - LOG_INFO "开始测试bscalc在-v参数下计算表达式的功能" - - # 检查环境是否已安装libbytesize-tools - LOG_INFO "检查libbytesize-tools是否已安装" - if dnf list installed libbytesize-tools >/dev/null 2>&1; then - LOG_INFO "libbytesize-tools已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "libbytesize-tools未安装,将在测试前安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有libbytesize-tools软件包 - LOG_INFO "检查yum源中是否有libbytesize-tools软件包" - if ! dnf list available libbytesize-tools >/dev/null 2>&1; then - LOG_ERROR "yum源中没有libbytesize-tools软件包" - exit 255 - fi - - # 如果未安装,则安装libbytesize-tools - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装libbytesize-tools软件包" - dnf install -y libbytesize-tools - CHECK_RESULT $? 0 0 "安装libbytesize-tools失败" - fi - - # 检查bscalc命令是否存在 - LOG_INFO "检查bscalc命令是否存在" - which bscalc >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "bscalc命令不存在" - - # 测试bscalc -v参数是否存在 - LOG_INFO "测试bscalc -v参数是否存在" - bscalc -v >/dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "bscalc不支持-v参数" - exit 255 - fi - - # 测试用例1:使用-v参数计算简单表达式 - LOG_INFO "测试用例1:使用-v参数计算简单表达式 "1 + 1"" - result=$(bscalc -v "1 + 1") - CHECK_RESULT $? 0 0 "bscalc -v "1 + 1"执行失败" - expected_result="2" - if [ "$result" = "$expected_result" ]; then - LOG_INFO "测试用例1通过:1 + 1 = $result" - else - LOG_ERROR "测试用例1失败:期望$expected_result,实际$result" - exit 1 - fi - - # 测试用例2:使用-v参数计算带单位的表达式 - LOG_INFO "测试用例2:使用-v参数计算带单位的表达式 "1KB + 1KB"" - result=$(bscalc -v "1KB + 1KB") - CHECK_RESULT $? 0 0 "bscalc -v "1KB + 1KB"执行失败" - expected_result="2.00 KiB" - if [ "$result" = "$expected_result" ]; then - LOG_INFO "测试用例2通过:1KB + 1KB = $result" - else - LOG_ERROR "测试用例2失败:期望$expected_result,实际$result" - exit 1 - fi - - # 测试用例3:使用-v参数计算复杂表达式 - LOG_INFO "测试用例3:使用-v参数计算复杂表达式 "1GB / 2"" - result=$(bscalc -v "1GB / 2") - CHECK_RESULT $? 0 0 "bscalc -v "1GB / 2"执行失败" - expected_result="512.00 MiB" - if [ "$result" = "$expected_result" ]; then - LOG_INFO "测试用例3通过:1GB / 2 = $result" - else - LOG_ERROR "测试用例3失败:期望$expected_result,实际$result" - exit 1 - fi - - # 测试用例4:使用-v参数计算混合单位表达式 - LOG_INFO "测试用例4:使用-v参数计算混合单位表达式 "1MB + 1024KB"" - result=$(bscalc -v "1MB + 1024KB") - CHECK_RESULT $? 0 0 "bscalc -v "1MB + 1024KB"执行失败" - expected_result="2.00 MiB" - if [ "$result" = "$expected_result" ]; then - LOG_INFO "测试用例4通过:1MB + 1024KB = $result" - else - LOG_ERROR "测试用例4失败:期望$expected_result,实际$result" - exit 1 - fi - - # 测试用例5:使用-v参数计算错误表达式(预期失败) - LOG_INFO "测试用例5:使用-v参数计算错误表达式 "1MB + invalid"" - bscalc -v "1MB + invalid" >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_INFO "测试用例5通过:错误表达式被正确拒绝" - else - LOG_ERROR "测试用例5失败:错误表达式未被正确拒绝" - exit 1 - fi - - # 清理环境 - LOG_INFO "清理测试环境" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载libbytesize-tools软件包" - dnf remove -y libbytesize-tools - CHECK_RESULT $? 0 0 "卸载libbytesize-tools失败" - else - LOG_INFO "保持libbytesize-tools安装状态" - fi - - LOG_INFO "所有测试用例执行完毕,测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_bscalc_expression.sh b/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_bscalc_expression.sh deleted file mode 100644 index c7255d3be9c..00000000000 --- a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_bscalc_expression.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-03-20 -# @License : Mulan PSL v2 -# @Desc : 测试bscalc计算表达式(如1KB+500B)的基本功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试bscalc计算表达式功能" - - # 检查bscalc命令是否已安装 - if command -v bscalc &> /dev/null; then - LOG_INFO "bscalc已安装,测试后将保持安装状态" - INSTALLED=true - else - LOG_INFO "bscalc未安装,将进行安装" - INSTALLED=false - fi - - # 检查yum源中是否有libbytesize-tools包 - LOG_INFO "检查yum源中是否有libbytesize-tools包" - if ! dnf list available libbytesize-tools &> /dev/null; then - LOG_ERROR "yum源中未找到libbytesize-tools包" - exit 255 - fi - - # 如果未安装则安装libbytesize-tools包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装libbytesize-tools包" - dnf install -y libbytesize-tools - CHECK_RESULT $? 0 0 "安装libbytesize-tools包失败" - fi - - # 测试bscalc基本表达式计算 - LOG_INFO "测试bscalc基本表达式计算:1KB+500B" - result=$(bscalc "1KB+500B" 2>&1) - CHECK_RESULT $? 0 0 "bscalc命令执行失败" - expected="1.5KB" - if [ "$result" = "$expected" ]; then - LOG_INFO "表达式计算结果正确:$result" - else - LOG_ERROR "表达式计算结果错误,预期:$expected,实际:$result" - exit 1 - fi - - # 测试无效参数 - LOG_INFO "测试bscalc无效参数" - bscalc --invalid-param &> /dev/null - if [ $? -eq 255 ]; then - LOG_INFO "无效参数处理正确" - else - LOG_ERROR "无效参数处理异常" - exit 255 - fi - - # 清理环境:如果测试前未安装则卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载libbytesize-tools包" - dnf remove -y libbytesize-tools - CHECK_RESULT $? 0 0 "卸载libbytesize-tools包失败" - fi - - LOG_INFO "bscalc计算表达式功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_bscalc_expression__upper_v.sh b/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_bscalc_expression__upper_v.sh deleted file mode 100644 index 0363f361908..00000000000 --- a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_bscalc_expression__upper_v.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-20 -# @License : Mulan PSL v2 -# @Desc : 测试bscalc在-V参数下计算表达式(如1KB+500B)的详细输出功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试bscalc在-V参数下计算表达式(如1KB+500B)的详细输出功能" - - # 检查是否已安装libbytesize-tools软件包 - if dnf list installed libbytesize-tools > /dev/null 2>&1; then - LOG_INFO "libbytesize-tools已安装,测试后将保持安装状态" - already_installed=true - else - LOG_INFO "libbytesize-tools未安装,将在测试前安装" - already_installed=false - fi - - # 检查yum源中是否有libbytesize-tools软件包 - LOG_INFO "检查yum源中是否有libbytesize-tools软件包" - if ! dnf list available libbytesize-tools > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到libbytesize-tools软件包" - exit 255 - fi - - # 如果未安装,则安装libbytesize-tools - if [ "$already_installed" = false ]; then - LOG_INFO "安装libbytesize-tools软件包" - dnf install -y libbytesize-tools - CHECK_RESULT $? 0 0 "安装libbytesize-tools失败" - fi - - # 测试bscalc命令是否存在 - LOG_INFO "检查bscalc命令是否存在" - command -v bscalc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "bscalc命令不存在" - - # 测试bscalc -V参数是否支持 - LOG_INFO "测试bscalc -V参数是否支持" - bscalc -V > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "bscalc不支持-V参数" - exit 255 - fi - - # 测试bscalc在-V参数下计算表达式1KB+500B的详细输出功能 - LOG_INFO "测试bscalc在-V参数下计算表达式1KB+500B的详细输出功能" - output=$(bscalc -V "1KB+500B") - CHECK_RESULT $? 0 0 "bscalc -V "1KB+500B"执行失败" - expected_output="1.5 KiB" - if echo "$output" | grep -q "$expected_output"; then - LOG_INFO "bscalc -V "1KB+500B"输出正确" - else - LOG_ERROR "bscalc -V "1KB+500B"输出错误,期望包含:$expected_output,实际输出:$output" - exit 1 - fi - - # 清理环境:如果测试前未安装,则卸载libbytesize-tools - if [ "$already_installed" = false ]; then - LOG_INFO "卸载libbytesize-tools软件包" - dnf remove -y libbytesize-tools - CHECK_RESULT $? 0 0 "卸载libbytesize-tools失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_bscalc_basic.sh b/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_bscalc_basic.sh deleted file mode 100644 index d0feddb1184..00000000000 --- a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_bscalc_basic.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-20 -# @License : Mulan PSL v2 -# @Desc : Test bscalc basic arithmetic operations -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查环境是否已安装libbytesize-tools - LOG_INFO "检查是否已安装libbytesize-tools" - rpm -q libbytesize-tools - if [ $? -eq 0 ]; then - LOG_INFO "libbytesize-tools已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "libbytesize-tools未安装,将在测试步骤中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有libbytesize-tools软件包 - LOG_INFO "检查yum源中是否有libbytesize-tools软件包" - dnf list available libbytesize-tools > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有libbytesize-tools软件包" - exit 255 - fi - - # 如果未安装,则安装libbytesize-tools - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装libbytesize-tools" - dnf install -y libbytesize-tools - CHECK_RESULT $? 0 0 "安装libbytesize-tools失败" - fi - - # 测试bscalc基本算术运算 - LOG_INFO "测试bscalc基本算术运算:加法" - bscalc "1KB + 1KB" - CHECK_RESULT $? 0 0 "bscalc加法运算失败" - - LOG_INFO "测试bscalc基本算术运算:减法" - bscalc "2KB - 1KB" - CHECK_RESULT $? 0 0 "bscalc减法运算失败" - - LOG_INFO "测试bscalc基本算术运算:乘法" - bscalc "2KB * 2" - CHECK_RESULT $? 0 0 "bscalc乘法运算失败" - - LOG_INFO "测试bscalc基本算术运算:除法" - bscalc "4KB / 2" - CHECK_RESULT $? 0 0 "bscalc除法运算失败" - - LOG_INFO "测试bscalc基本算术运算:复杂表达式" - bscalc "(1KB + 2KB) * 2 / 2" - CHECK_RESULT $? 0 0 "bscalc复杂表达式运算失败" - - # 测试不支持的参数 - LOG_INFO "测试bscalc不支持的参数" - bscalc --invalid-option 2>&1 | grep -q "unrecognized option" - CHECK_RESULT $? 0 0 "bscalc不支持参数测试失败" - - # 清理环境 - LOG_INFO "清理测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载libbytesize-tools" - dnf remove -y libbytesize-tools - CHECK_RESULT $? 0 0 "卸载libbytesize-tools失败" - else - LOG_INFO "保持libbytesize-tools安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_bscalc_file.sh b/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_bscalc_file.sh deleted file mode 100644 index 4ff7a4106a4..00000000000 --- a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_bscalc_file.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-20 -# @License : Mulan PSL v2 -# @Desc : Test bscalc reading from a file -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查bscalc命令是否存在,若不存在则安装libbytesize-tools软件包 - LOG_INFO "检查是否已安装libbytesize-tools软件包" - if ! command -v bscalc &> /dev/null; then - LOG_INFO "libbytesize-tools未安装,尝试安装" - # 检查yum源中是否有libbytesize-tools软件包 - if ! dnf list available libbytesize-tools &> /dev/null; then - LOG_ERROR "yum源中未找到libbytesize-tools软件包" - exit 255 - fi - # 安装软件包 - dnf install -y libbytesize-tools - CHECK_RESULT $? 0 0 "安装libbytesize-tools失败" - # 标记为测试过程中安装,需要在脚本结束前卸载 - INSTALLED_BY_SCRIPT=1 - else - LOG_INFO "libbytesize-tools已安装" - INSTALLED_BY_SCRIPT=0 - fi - - # 创建一个测试文件,包含一些数字和单位 - LOG_INFO "创建测试文件" - cat > /tmp/test_bscalc_input.txt << EOF - 10 KiB - 20 MiB - 30 GiB - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 测试bscalc从文件读取并计算总和 - LOG_INFO "测试bscalc从文件读取并计算总和" - bscalc --from-file /tmp/test_bscalc_input.txt sum - CHECK_RESULT $? 0 0 "bscalc从文件读取计算失败" - - # 测试bscalc从文件读取并计算平均值 - LOG_INFO "测试bscalc从文件读取并计算平均值" - bscalc --from-file /tmp/test_bscalc_input.txt avg - CHECK_RESULT $? 0 0 "bscalc从文件读取计算平均值失败" - - # 测试bscalc不支持的参数,应退出码为255 - LOG_INFO "测试bscalc不支持的参数,预期失败" - bscalc --unsupported-option 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "不支持的参数检查通过" - else - LOG_ERROR "不支持的参数检查失败" - exit 255 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f /tmp/test_bscalc_input.txt - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果软件包是测试过程中安装的,则卸载 - if [ $INSTALLED_BY_SCRIPT -eq 1 ]; then - LOG_INFO "卸载测试过程中安装的libbytesize-tools软件包" - dnf remove -y libbytesize-tools - CHECK_RESULT $? 0 0 "卸载libbytesize-tools失败" - else - LOG_INFO "保持libbytesize-tools安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_bscalc_format.sh b/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_bscalc_format.sh deleted file mode 100644 index 8e4cb88bf3a..00000000000 --- a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_bscalc_format.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-20 -# @License : Mulan PSL v2 -# @Desc : Test bscalc output formatting options -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:Test bscalc output formatting options - - LOG_INFO "步骤1: 检查yum源中是否存在libbytesize-tools软件包" - dnf list available libbytesize-tools 2>/dev/null | grep -q libbytesize-tools - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到libbytesize-tools软件包" - exit 255 - fi - LOG_INFO "yum源中存在libbytesize-tools软件包" - - LOG_INFO "步骤2: 检查环境是否已安装libbytesize-tools" - rpm -q libbytesize-tools >/dev/null 2>&1 - installed=$? - if [ $installed -eq 0 ]; then - LOG_INFO "环境已安装libbytesize-tools,测试结束后保持安装状态" - else - LOG_INFO "环境未安装libbytesize-tools,将安装软件包作为测试步骤" - fi - - if [ $installed -ne 0 ]; then - LOG_INFO "步骤3: 安装libbytesize-tools软件包" - dnf install -y libbytesize-tools - CHECK_RESULT $? 0 0 "安装libbytesize-tools失败" - LOG_INFO "安装libbytesize-tools成功" - fi - - LOG_INFO "步骤4: 验证bscalc命令是否存在" - which bscalc >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "bscalc命令不存在" - - LOG_INFO "步骤5: 测试bscalc基础功能(无格式选项)" - bscalc 1KiB + 1MiB - CHECK_RESULT $? 0 0 "bscalc基础功能测试失败" - - LOG_INFO "步骤6: 测试bscalc的--format=auto参数" - bscalc --format=auto 1KiB + 1MiB - CHECK_RESULT $? 0 0 "bscalc --format=auto参数测试失败" - - LOG_INFO "步骤7: 测试bscalc的--format=iec参数" - bscalc --format=iec 1024KiB + 1MiB - CHECK_RESULT $? 0 0 "bscalc --format=iec参数测试失败" - - LOG_INFO "步骤8: 测试bscalc的--format=si参数" - bscalc --format=si 1000KB + 1MB - CHECK_RESULT $? 0 0 "bscalc --format=si参数测试失败" - - LOG_INFO "步骤9: 测试bscalc的--format=bytes参数" - bscalc --format=bytes 1KiB + 1MiB - CHECK_RESULT $? 0 0 "bscalc --format=bytes参数测试失败" - - LOG_INFO "步骤10: 测试bscalc的不支持的格式参数" - bscalc --format=invalid 1KiB + 1MiB 2>/dev/null - if [ $? -eq 255 ] || [ $? -eq 1 ]; then - LOG_INFO "bscalc正确拒绝了不支持的格式参数" - else - LOG_ERROR "bscalc未正确处理不支持的格式参数" - exit 255 - fi - - LOG_INFO "步骤11: 测试bscalc的不存在的参数" - bscalc --nonexistent 1KiB + 1MiB 2>/dev/null - if [ $? -eq 255 ] || [ $? -eq 1 ]; then - LOG_INFO "bscalc正确拒绝了不存在的参数" - else - LOG_ERROR "bscalc未正确处理不存在的参数" - exit 255 - fi - - LOG_INFO "步骤12: 测试bscalc的--to-unit参数组合使用" - bscalc --format=iec --to-unit=MiB 2048KiB - CHECK_RESULT $? 0 0 "bscalc --to-unit参数测试失败" - - LOG_INFO "步骤13: 测试bscalc的--from-unit参数组合使用" - bscalc --format=si --from-unit=KB 2KB + 3KB - CHECK_RESULT $? 0 0 "bscalc --from-unit参数测试失败" - - LOG_INFO "步骤14: 测试bscalc的复杂表达式格式化" - bscalc --format=iec "(2MiB + 512KiB) / 2" - CHECK_RESULT $? 0 0 "bscalc复杂表达式格式化测试失败" - - if [ $installed -ne 0 ]; then - LOG_INFO "步骤15: 清理环境,卸载libbytesize-tools软件包" - dnf remove -y libbytesize-tools - CHECK_RESULT $? 0 0 "卸载libbytesize-tools失败" - LOG_INFO "卸载libbytesize-tools成功,环境已恢复" - else - LOG_INFO "步骤15: 环境保持安装状态,无需卸载" - fi - - LOG_INFO "测试完成:bscalc输出格式化选项测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_bscalc_pipe.sh b/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_bscalc_pipe.sh deleted file mode 100644 index 7be58dc6ff0..00000000000 --- a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_bscalc_pipe.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-20 -# @License : Mulan PSL v2 -# @Desc : Test bscalc with piped input -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test bscalc with piped input" - - # 定义软件包名称 - PACKAGE_NAME="libbytesize-tools" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在软件包: $PACKAGE_NAME" - if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "yum源中未找到软件包: $PACKAGE_NAME" - exit 255 - fi - - # 检查当前环境是否已安装软件包 - LOG_INFO "检查当前环境是否已安装软件包: $PACKAGE_NAME" - if rpm -q "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "软件包已安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包未安装,将在测试步骤中安装" - INSTALLED_BEFORE=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装软件包: $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试bscalc命令是否支持管道输入 - LOG_INFO "测试bscalc命令是否支持管道输入" - echo "1KB" | bscalc "2 * ." 2>/dev/null - CHECK_RESULT $? 0 0 "bscalc命令不支持管道输入或执行失败" - - # 测试bscalc命令通过管道输入进行单位转换 - LOG_INFO "测试bscalc命令通过管道输入进行单位转换" - result=$(echo "1024" | bscalc ". B -> KiB") - expected="1.00 KiB" - if [ "$result" = "$expected" ]; then - LOG_INFO "单位转换测试通过" - else - LOG_ERROR "单位转换测试失败: 期望 "$expected", 实际 "$result"" - exit 1 - fi - - # 测试bscalc命令通过管道输入进行数学运算 - LOG_INFO "测试bscalc命令通过管道输入进行数学运算" - result=$(echo "2" | bscalc ". * 512") - expected="1024" - if [ "$result" = "$expected" ]; then - LOG_INFO "数学运算测试通过" - else - LOG_ERROR "数学运算测试失败: 期望 "$expected", 实际 "$result"" - exit 1 - fi - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载软件包: $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成:Test bscalc with piped input" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_check_install.sh b/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_check_install.sh deleted file mode 100644 index 067528d75e6..00000000000 --- a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_check_install.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-20 -# @License : Mulan PSL v2 -# @Desc : Check if libbytesize-tools is installed -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境变量定义 - PACKAGE_NAME="libbytesize-tools" - INSTALLED_FLAG=0 - - # 步骤1:检查软件包是否已在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - 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} 在yum源中" - - # 步骤2:检查是否已安装 - LOG_INFO "步骤2:检查是否已安装" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装" - INSTALLED_FLAG=1 - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装" - fi - - # 步骤3:如果未安装则进行安装 - if [ ${INSTALLED_FLAG} -eq 0 ]; then - LOG_INFO "步骤3:安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 安装成功" - fi - - # 步骤4:验证软件包安装 - LOG_INFO "步骤4:验证软件包安装" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证软件包 ${PACKAGE_NAME} 安装失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 验证安装成功" - - # 步骤5:检查关键命令是否存在 - LOG_INFO "步骤5:检查关键命令是否存在" - command -v bs-size > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "bs-size 命令不存在" - LOG_INFO "bs-size 命令存在" - - # 步骤6:测试命令基本功能 - LOG_INFO "步骤6:测试命令基本功能" - bs-size --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "bs-size 命令帮助信息获取失败" - LOG_INFO "bs-size 命令基本功能正常" - - # 步骤7:测试命令参数 - LOG_INFO "步骤7:测试命令参数" - bs-size 1GB > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "bs-size 命令参数测试失败" - LOG_INFO "bs-size 命令参数测试成功" - - # 步骤8:测试无效参数(应失败) - LOG_INFO "步骤8:测试无效参数" - bs-size --invalid-param > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "无效参数处理正确(返回码255)" - else - LOG_ERROR "无效参数处理不正确" - exit 255 - fi - - # 步骤9:环境清理 - LOG_INFO "步骤9:环境清理" - if [ ${INSTALLED_FLAG} -eq 0 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 卸载成功" - else - LOG_INFO "保持原有安装状态,不卸载软件包" - fi - - # 步骤10:最终验证 - LOG_INFO "步骤10:最终验证" - if [ ${INSTALLED_FLAG} -eq 0 ]; then - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "环境清理失败,软件包 ${PACKAGE_NAME} 仍然存在" - exit 1 - else - LOG_INFO "环境清理成功,软件包 ${PACKAGE_NAME} 已卸载" - fi - else - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "软件包 ${PACKAGE_NAME} 安装状态异常" - LOG_INFO "环境保持原有安装状态正常" - fi - - LOG_INFO "测试完成:Check if libbytesize-tools is installed" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_install.sh b/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_install.sh deleted file mode 100644 index 1ac9b198fa9..00000000000 --- a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_install.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-03-20 -# @License : Mulan PSL v2 -# @Desc : Test installation of libbytesize-tools package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test installation of libbytesize-tools package" - - # 步骤1: 检查当前环境是否已经安装了 libbytesize-tools 软件包 - LOG_INFO "步骤1: 检查当前环境是否已经安装了 libbytesize-tools 软件包" - if rpm -q libbytesize-tools > /dev/null 2>&1; then - LOG_INFO "当前环境已经安装了 libbytesize-tools 软件包" - INSTALLED="true" - else - LOG_INFO "当前环境未安装 libbytesize-tools 软件包" - INSTALLED="false" - fi - - # 步骤2: 检查 yum 源中是否有 libbytesize-tools 软件包 - LOG_INFO "步骤2: 检查 yum 源中是否有 libbytesize-tools 软件包" - if ! dnf list available libbytesize-tools > /dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 libbytesize-tools 软件包" - exit 255 - fi - LOG_INFO "yum 源中存在 libbytesize-tools 软件包" - - # 步骤3: 如果环境未安装,则安装 libbytesize-tools 软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3: 安装 libbytesize-tools 软件包" - dnf install -y libbytesize-tools - CHECK_RESULT $? 0 0 "安装 libbytesize-tools 软件包失败" - LOG_INFO "成功安装 libbytesize-tools 软件包" - fi - - # 步骤4: 测试 libbytesize-tools 包中的命令(例如 bs-mountpoint)是否存在并支持基本参数 - LOG_INFO "步骤4: 测试 libbytesize-tools 包中的命令是否存在并支持基本参数" - if ! command -v bs-mountpoint > /dev/null 2>&1; then - LOG_ERROR "bs-mountpoint 命令不存在" - exit 255 - fi - - # 测试 bs-mountpoint 命令的 --help 参数是否存在 - LOG_INFO "测试 bs-mountpoint 命令的 --help 参数是否存在" - bs-mountpoint --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "bs-mountpoint 命令不支持 --help 参数" - - # 步骤5: 执行一个简单的 bs-mountpoint 命令,检查其功能是否正常 - LOG_INFO "步骤5: 执行一个简单的 bs-mountpoint 命令,检查其功能是否正常" - bs-mountpoint / > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "bs-mountpoint 命令执行失败" - - # 步骤6: 环境恢复 - LOG_INFO "步骤6: 环境恢复" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载 libbytesize-tools 软件包" - dnf remove -y libbytesize-tools - CHECK_RESULT $? 0 0 "卸载 libbytesize-tools 软件包失败" - LOG_INFO "成功卸载 libbytesize-tools 软件包" - else - LOG_INFO "环境已安装 libbytesize-tools 软件包,保持安装状态" - fi - - LOG_INFO "测试完成:Test installation of libbytesize-tools package" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_size.sh b/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_size.sh deleted file mode 100644 index 6b65c6fdbf3..00000000000 --- a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_size.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-25 -# @License : Mulan PSL v2 -# @Desc : Test size conversion functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 size conversion functionality" - - # 检查是否已安装 libbytesize-tools - if rpm -q libbytesize-tools > /dev/null 2>&1; then - LOG_INFO "libbytesize-tools 已安装,测试完成后将保持安装状态" - installed=true - else - LOG_INFO "libbytesize-tools 未安装,将在测试完成后卸载" - installed=false - fi - - # 检查 yum 源中是否有 libbytesize-tools 软件包 - LOG_INFO "检查 yum 源中是否存在 libbytesize-tools 软件包" - if ! dnf list available libbytesize-tools > /dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 libbytesize-tools 软件包" - exit 255 - fi - - # 安装 libbytesize-tools - if [ "$installed" = false ]; then - LOG_INFO "正在安装 libbytesize-tools" - dnf install -y libbytesize-tools - CHECK_RESULT $? 0 0 "安装 libbytesize-tools 失败" - fi - - # 测试 size conversion functionality - LOG_INFO "测试 size conversion 功能" - size_output=$(size --from=MiB --to=KiB 1) - expected_output="1024" - CHECK_RESULT $? 0 0 "size 命令执行失败" - [ "$size_output" = "$expected_output" ] - CHECK_RESULT $? 0 0 "size conversion 结果不符合预期" - - # 测试不支持的参数 - LOG_INFO "测试不支持的参数" - size --unsupported-option 2>/dev/null - CHECK_RESULT $? 255 0 "不支持的参数未返回预期退出码" - - # 清理环境(如果之前未安装) - if [ "$installed" = false ]; then - LOG_INFO "正在卸载 libbytesize-tools" - dnf remove -y libbytesize-tools - CHECK_RESULT $? 0 0 "卸载 libbytesize-tools失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_uninstall.sh b/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_uninstall.sh deleted file mode 100644 index 9abe917f697..00000000000 --- a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_uninstall.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-20 -# @License : Mulan PSL v2 -# @Desc : Test uninstallation of libbytesize-tools package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装libbytesize-tools软件包 - LOG_INFO "检查libbytesize-tools软件包是否已安装" - rpm -q libbytesize-tools > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "libbytesize-tools软件包已安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "libbytesize-tools软件包未安装,将在测试中安装并最终卸载" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否有libbytesize-tools软件包 - LOG_INFO "检查yum源中是否有libbytesize-tools软件包" - dnf list available libbytesize-tools > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有libbytesize-tools软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "安装libbytesize-tools软件包" - dnf install -y libbytesize-tools - CHECK_RESULT $? 0 0 "安装libbytesize-tools软件包失败" - fi - - # 测试卸载libbytesize-tools软件包 - LOG_INFO "测试卸载libbytesize-tools软件包" - dnf remove -y libbytesize-tools - CHECK_RESULT $? 0 0 "卸载libbytesize-tools软件包失败" - - # 验证软件包是否已卸载 - LOG_INFO "验证libbytesize-tools软件包是否已卸载" - rpm -q libbytesize-tools > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "libbytesize-tools软件包卸载失败" - exit 1 - else - LOG_INFO "libbytesize-tools软件包卸载成功" - fi - - # 如果之前已安装,则重新安装以恢复环境 - if [ $INSTALLED_BEFORE -eq 1 ]; then - LOG_INFO "恢复环境:重新安装libbytesize-tools软件包" - dnf install -y libbytesize-tools - CHECK_RESULT $? 0 0 "重新安装libbytesize-tools软件包失败" - fi - - # 最终环境检查 - LOG_INFO "最终环境检查" - if [ $INSTALLED_BEFORE -eq 1 ]; then - rpm -q libbytesize-tools > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "环境恢复失败,libbytesize-tools软件包未安装" - LOG_INFO "环境已恢复:libbytesize-tools软件包已安装" - else - rpm -q libbytesize-tools > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "环境清理失败,libbytesize-tools软件包未卸载" - exit 1 - else - LOG_INFO "环境已清理:libbytesize-tools软件包未安装" - fi - fi - - LOG_INFO "测试完成:libbytesize-tools软件包卸载功能正常" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_unit_conversion.sh b/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_unit_conversion.sh deleted file mode 100644 index a1ab8f19978..00000000000 --- a/testcases/function_test/pkg_test/libbytesize/libbytesize-tools/test_libbytesize-tools_function_unit_conversion.sh +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-20 -# @License : Mulan PSL v2 -# @Desc : Test unit conversion (e.g., B, KB, MB) -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装libbytesize-tools - LOG_INFO "检查是否已安装libbytesize-tools软件包" - rpm -q libbytesize-tools > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "libbytesize-tools已安装,标记为保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "libbytesize-tools未安装,标记为需要清理" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否有libbytesize-tools软件包 - LOG_INFO "检查yum源中是否有libbytesize-tools软件包" - dnf list available libbytesize-tools > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到libbytesize-tools软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到libbytesize-tools软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "开始安装libbytesize-tools软件包" - dnf install -y libbytesize-tools - CHECK_RESULT $? 0 0 "安装libbytesize-tools失败" - LOG_INFO "libbytesize-tools安装成功" - fi - - # 测试单位转换功能:从字节转换为KB - LOG_INFO "测试单位转换:将1024字节转换为KB" - result=$(bs-convert 1024B KB 2>&1) - if [ $? -ne 0 ]; then - if echo "$result" | grep -q "unsupported\|not found\|invalid"; then - LOG_ERROR "bs-convert命令不支持指定参数或参数无效" - exit 255 - else - LOG_ERROR "bs-convert命令执行失败" - CHECK_RESULT 1 0 0 "bs-convert命令执行失败" - fi - else - expected="1.00 KB" - if [ "$result" = "$expected" ]; then - LOG_INFO "单位转换测试通过:1024B = $result" - else - LOG_ERROR "单位转换测试失败:预期 "$expected",实际 "$result"" - CHECK_RESULT 1 0 0 "单位转换结果不符合预期" - fi - fi - - # 测试单位转换功能:从MB转换为字节 - LOG_INFO "测试单位转换:将2MB转换为字节" - result=$(bs-convert 2MB B 2>&1) - if [ $? -ne 0 ]; then - if echo "$result" | grep -q "unsupported\|not found\|invalid"; then - LOG_ERROR "bs-convert命令不支持指定参数或参数无效" - exit 255 - else - LOG_ERROR "bs-convert命令执行失败" - CHECK_RESULT 1 0 0 "bs-convert命令执行失败" - fi - else - expected="2000000.00 B" - if [ "$result" = "$expected" ]; then - LOG_INFO "单位转换测试通过:2MB = $result" - else - LOG_ERROR "单位转换测试失败:预期 "$expected",实际 "$result"" - CHECK_RESULT 1 0 0 "单位转换结果不符合预期" - fi - fi - - # 测试单位转换功能:从GB转换为MB - LOG_INFO "测试单位转换:将1.5GB转换为MB" - result=$(bs-convert 1.5GB MB 2>&1) - if [ $? -ne 0 ]; then - if echo "$result" | grep -q "unsupported\|not found\|invalid"; then - LOG_ERROR "bs-convert命令不支持指定参数或参数无效" - exit 255 - else - LOG_ERROR "bs-convert命令执行失败" - CHECK_RESULT 1 0 0 "bs-convert命令执行失败" - fi - else - expected="1500.00 MB" - if [ "$result" = "$expected" ]; then - LOG_INFO "单位转换测试通过:1.5GB = $result" - else - LOG_ERROR "单位转换测试失败:预期 "$expected",实际 "$result"" - CHECK_RESULT 1 0 0 "单位转换结果不符合预期" - fi - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "清理环境:卸载libbytesize-tools软件包" - dnf remove -y libbytesize-tools - CHECK_RESULT $? 0 0 "卸载libbytesize-tools失败" - LOG_INFO "环境清理完成" - else - LOG_INFO "测试前已安装libbytesize-tools,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libssh2/libssh2-help/test_libssh2-help_function_info.sh b/testcases/function_test/pkg_test/libssh2/libssh2-help/test_libssh2-help_function_info.sh deleted file mode 100644 index 63354ae7e33..00000000000 --- a/testcases/function_test/pkg_test/libssh2/libssh2-help/test_libssh2-help_function_info.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-12 -# @License : Mulan PSL v2 -# @Desc : 测试libssh2-help软件包提供的版本、描述等信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装libssh2-help - LOG_INFO "检查libssh2-help软件包是否已安装" - rpm -q libssh2-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "libssh2-help软件包已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "libssh2-help软件包未安装,将在测试步骤中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有libssh2-help软件包 - LOG_INFO "检查yum源中是否有libssh2-help软件包" - dnf list available libssh2-help > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中没有libssh2-help软件包" - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装libssh2-help软件包" - dnf install -y libssh2-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装libssh2-help软件包失败" - fi - - # 测试libssh2-help软件包提供的版本信息 - LOG_INFO "测试libssh2-help软件包提供的版本信息" - rpm -q --queryformat "%{VERSION}-%{RELEASE}\n" libssh2-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "获取libssh2-help软件包版本信息失败" - - # 测试libssh2-help软件包提供的描述信息 - LOG_INFO "测试libssh2-help软件包提供的描述信息" - rpm -q --queryformat "%{SUMMARY}\n" libssh2-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "获取libssh2-help软件包描述信息失败" - - # 测试libssh2-help软件包提供的帮助信息 - LOG_INFO "测试libssh2-help软件包提供的帮助信息" - libssh2-help --help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "libssh2-help命令支持--help参数" - else - LOG_INFO "libssh2-help命令不支持--help参数,尝试-h参数" - libssh2-help -h > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "libssh2-help命令不支持--help或-h参数" - fi - - # 测试libssh2-help软件包提供的版本信息参数 - LOG_INFO "测试libssh2-help软件包提供的版本信息参数" - libssh2-help --version > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "libssh2-help命令支持--version参数" - else - LOG_INFO "libssh2-help命令不支持--version参数,尝试-V参数" - libssh2-help -V > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "libssh2-help命令不支持--version或-V参数" - fi - - # 清理环境,恢复到之前的状态 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载libssh2-help软件包" - dnf remove -y libssh2-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载libssh2-help软件包失败" - else - LOG_INFO "libssh2-help软件包在脚本执行前已安装,保持安装状态" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/llvm-toolset/llvm-toolset-19-openmp-devel/test_llvm-toolset-19-openmp-devel_compile.sh b/testcases/function_test/pkg_test/llvm-toolset/llvm-toolset-19-openmp-devel/test_llvm-toolset-19-openmp-devel_compile.sh deleted file mode 100644 index 91f52d739d9..00000000000 --- a/testcases/function_test/pkg_test/llvm-toolset/llvm-toolset-19-openmp-devel/test_llvm-toolset-19-openmp-devel_compile.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-04-03 -# @License : Mulan PSL v2 -# @Desc : 测试能否使用安装的 OpenMP 库和头文件成功编译一个简单的并行程序。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装llvm-toolset-19-openmp-devel软件包 - LOG_INFO "检查是否已安装llvm-toolset-19-openmp-devel软件包" - rpm -q llvm-toolset-19-openmp-devel - if [ $? -eq 0 ]; then - LOG_INFO "llvm-toolset-19-openmp-devel软件包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "llvm-toolset-19-openmp-devel软件包未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查yum源中是否存在llvm-toolset-19-openmp-devel软件包 - LOG_INFO "检查yum源中是否存在llvm-toolset-19-openmp-devel软件包" - dnf list available llvm-toolset-19-openmp-devel - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到llvm-toolset-19-openmp-devel软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装llvm-toolset-19-openmp-devel软件包" - dnf install -y llvm-toolset-19-openmp-devel - CHECK_RESULT $? 0 0 "安装llvm-toolset-19-openmp-devel软件包失败" - fi - - # 创建测试用的简单并行程序源代码 - LOG_INFO "创建测试用的简单并行程序源代码" - cat > test_openmp.c << "EOF" - #include - #include - int main() { - #pragma omp parallel - { - int tid = omp_get_thread_num(); - printf("Hello from thread %d\n", tid); - } - return 0; - } - EOF - - # 检查clang命令是否存在 - LOG_INFO "检查clang命令是否存在" - which clang - if [ $? -ne 0 ]; then - LOG_ERROR "clang命令不存在或不支持" - exit 255 - fi - - # 检查clang是否支持-openmp参数 - LOG_INFO "检查clang是否支持-openmp参数" - clang --help | grep -q "\-openmp" - if [ $? -ne 0 ]; then - LOG_ERROR "clang不支持-openmp参数" - exit 255 - fi - - # 使用clang编译测试程序 - LOG_INFO "使用clang编译测试程序" - clang -fopenmp test_openmp.c -o test_openmp - CHECK_RESULT $? 0 0 "编译测试程序失败" - - # 运行编译后的程序 - LOG_INFO "运行编译后的程序" - ./test_openmp - CHECK_RESULT $? 0 0 "运行测试程序失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_openmp.c test_openmp - - # 如果测试前未安装软件包,则在测试结束后卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载llvm-toolset-19-openmp-devel软件包" - dnf remove -y llvm-toolset-19-openmp-devel - CHECK_RESULT $? 0 0 "卸载llvm-toolset-19-openmp-devel软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/llvm-toolset/llvm-toolset-19-openmp-devel/test_llvm-toolset-19-openmp-devel_header.sh b/testcases/function_test/pkg_test/llvm-toolset/llvm-toolset-19-openmp-devel/test_llvm-toolset-19-openmp-devel_header.sh deleted file mode 100644 index 0419444fdb9..00000000000 --- a/testcases/function_test/pkg_test/llvm-toolset/llvm-toolset-19-openmp-devel/test_llvm-toolset-19-openmp-devel_header.sh +++ /dev/null @@ -1,139 +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-03 -# @License : Mulan PSL v2 -# @Desc : 测试安装后关键的 OpenMP 头文件(如 omp.h)是否存在于预期的系统路径中。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - - # 定义检查结果函数 - CHECK_RESULT() { - local actual=$1 - local expect=$2 - local mode=$3 - local message=$4 - - if [ $mode -eq 0 ]; then - if [ $actual -ne $expect ]; then - LOG_ERROR "$message" - exit $actual - fi - else - if [ $actual -eq $expect ]; then - LOG_ERROR "$message" - exit 1 - fi - fi - } - - # 定义SSH命令函数 - SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=$4 - - sshpass -p "$password" ssh -o StrictHostKeyChecking=no "$user@$ip" "$cmd" - } - - # 定义软件包名称 - PACKAGE_NAME="llvm-toolset-19-openmp-devel" - - # 定义预期的头文件路径 - EXPECTED_HEADERS=( - "/usr/lib/gcc/x86_64-redhat-linux/19/include/omp.h" - "/usr/lib/gcc/x86_64-redhat-linux/19/include/ompt.h" - "/usr/lib/gcc/aarch64-redhat-linux/19/include/omp.h" - "/usr/lib/gcc/aarch64-redhat-linux/19/include/ompt.h" - ) - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - dnf list available "$PACKAGE_NAME" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 步骤2:检查是否已经安装 - LOG_INFO "步骤2:检查是否已经安装" - INSTALLED=false - rpm -q "$PACKAGE_NAME" &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已经安装" - INSTALLED=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:检查关键的OpenMP头文件是否存在 - LOG_INFO "步骤4:检查关键的OpenMP头文件是否存在" - HEADER_FOUND=false - for header in "${EXPECTED_HEADERS[@]}"; do - if [ -f "$header" ]; then - LOG_INFO "找到头文件: $header" - HEADER_FOUND=true - fi - done - - if [ "$HEADER_FOUND" = "false" ]; then - LOG_ERROR "未找到任何预期的OpenMP头文件" - exit 1 - fi - - # 步骤5:验证头文件内容(可选) - LOG_INFO "步骤5:验证omp.h头文件内容" - for header in "${EXPECTED_HEADERS[@]}"; do - if [ -f "$header" ]; then - grep -q "#ifndef __OMP_H" "$header" || grep -q "#ifndef _OMP_H" "$header" || grep -q "#pragma omp" "$header" - if [ $? -eq 0 ]; then - LOG_INFO "头文件 $header 包含有效的OpenMP内容" - break - fi - fi - done - - # 步骤6:清理环境(如果测试前未安装) - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤6:卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - LOG_INFO "环境已恢复到测试前的状态" - else - LOG_INFO "步骤6:保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试完成:所有预期的OpenMP头文件都存在" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/llvm-toolset/llvm-toolset-19-openmp-devel/test_llvm-toolset-19-openmp-devel_lib.sh b/testcases/function_test/pkg_test/llvm-toolset/llvm-toolset-19-openmp-devel/test_llvm-toolset-19-openmp-devel_lib.sh deleted file mode 100644 index fc61d6417d5..00000000000 --- a/testcases/function_test/pkg_test/llvm-toolset/llvm-toolset-19-openmp-devel/test_llvm-toolset-19-openmp-devel_lib.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 : 2026-04-03 -# @License : Mulan PSL v2 -# @Desc : 测试安装后关键的 OpenMP 库文件(如 libomp.so)是否存在于预期的系统路径中。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装llvm-toolset-19-openmp-devel软件包 - LOG_INFO "检查llvm-toolset-19-openmp-devel软件包是否已安装" - rpm -q llvm-toolset-19-openmp-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试前安装并在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在llvm-toolset-19-openmp-devel软件包 - LOG_INFO "检查yum源中是否存在llvm-toolset-19-openmp-devel软件包" - dnf list available llvm-toolset-19-openmp-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到llvm-toolset-19-openmp-devel软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装llvm-toolset-19-openmp-devel软件包" - dnf install -y llvm-toolset-19-openmp-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装llvm-toolset-19-openmp-devel软件包失败" - fi - - # 检查OpenMP库文件是否存在于预期的系统路径中 - LOG_INFO "检查OpenMP库文件是否存在于预期的系统路径中" - LIBOMP_PATH="/usr/lib64/libomp.so" - if [ -f "$LIBOMP_PATH" ]; then - LOG_INFO "找到OpenMP库文件:$LIBOMP_PATH" - else - LOG_ERROR "未找到OpenMP库文件:$LIBOMP_PATH" - if [ "$INSTALLED" = false ]; then - dnf remove -y llvm-toolset-19-openmp-devel > /dev/null 2>&1 - fi - exit 1 - fi - - # 验证库文件是否有效(可选步骤) - LOG_INFO "验证OpenMP库文件是否有效" - ldd "$LIBOMP_PATH" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "OpenMP库文件无效或无法加载" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载llvm-toolset-19-openmp-devel软件包" - dnf remove -y llvm-toolset-19-openmp-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载llvm-toolset-19-openmp-devel软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lodash/nodejs-lodash-zipwith/test_nodejs-lodash-zipwith_function_basic.sh b/testcases/function_test/pkg_test/lodash/nodejs-lodash-zipwith/test_nodejs-lodash-zipwith_function_basic.sh deleted file mode 100644 index e57f7956211..00000000000 --- a/testcases/function_test/pkg_test/lodash/nodejs-lodash-zipwith/test_nodejs-lodash-zipwith_function_basic.sh +++ /dev/null @@ -1,117 +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-03 -# @License : Mulan PSL v2 -# @Desc : 测试 zipWith 函数对数组的基本合并功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(实际环境中这些函数可能已定义,这里仅作演示用) - # 注意:实际环境中LOG_INFO、LOG_ERROR、CHECK_RESULT、SSH_CMD可能已预定义 - # 这里为了避免脚本执行错误,提供空定义(实际使用时会覆盖) - LOG_INFO() { echo "[INFO] $*"; } - LOG_ERROR() { echo "[ERROR] $*"; } - CHECK_RESULT() { - if [ "$1" -ne "$2" ]; then - LOG_ERROR "$4" - exit "$3" - fi - } - SSH_CMD() { "$@"; } - - # 测试脚本开始 - LOG_INFO "开始测试:测试 zipWith 函数对数组的基本合并功能" - - # 步骤1:检查是否已安装 nodejs-lodash 软件包 - LOG_INFO "步骤1:检查 nodejs-lodash 软件包是否已安装" - if rpm -q nodejs-lodash > /dev/null 2>&1; then - LOG_INFO "nodejs-lodash 已安装,标记为需要保持安装状态" - KEEP_INSTALLED=true - else - LOG_INFO "nodejs-lodash 未安装,标记为需要测试后卸载" - KEEP_INSTALLED=false - fi - - # 步骤2:检查 yum 源中是否存在 nodejs-lodash 软件包 - LOG_INFO "步骤2:检查 yum 源中是否存在 nodejs-lodash 软件包" - if ! dnf list available nodejs-lodash > /dev/null 2>&1; then - LOG_ERROR "yum 源中未找到 nodejs-lodash 软件包" - exit 255 - fi - - # 步骤3:如果未安装,则安装 nodejs-lodash 软件包 - if [ "$KEEP_INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装 nodejs-lodash 软件包" - dnf install -y nodejs-lodash - CHECK_RESULT $? 0 0 "安装 nodejs-lodash 软件包失败" - fi - - # 步骤4:创建测试 Node.js 脚本,测试 zipWith 函数基本功能 - LOG_INFO "步骤4:创建测试 Node.js 脚本,测试 zipWith 函数基本功能" - cat > test_zipwith.js << "EOF" - const _ = require("lodash"); - - // 测试 zipWith 函数对数组的基本合并功能 - function testZipWithBasic() { - // 定义两个数组和一个合并函数 - const array1 = [1, 2, 3]; - const array2 = [4, 5, 6]; - const sum = (a, b) => a + b; - - // 使用 zipWith 合并数组 - const result = _.zipWith(array1, array2, sum); - - // 预期结果 - const expected = [5, 7, 9]; - - // 检查结果 - if (JSON.stringify(result) === JSON.stringify(expected)) { - console.log("PASS: zipWith 函数基本合并功能测试通过"); - process.exit(0); - } else { - console.error("FAIL: zipWith 函数基本合并功能测试失败"); - console.error("预期结果:", expected); - console.error("实际结果:", result); - process.exit(1); - } - } - - testZipWithBasic(); - EOF - - # 步骤5:执行 Node.js 测试脚本 - LOG_INFO "步骤5:执行 Node.js 测试脚本" - node test_zipwith.js - CHECK_RESULT $? 0 1 "zipWith 函数基本合并功能测试失败" - - # 步骤6:清理测试文件 - LOG_INFO "步骤6:清理测试文件" - rm -f test_zipwith.js - - # 步骤7:如果测试前未安装,则卸载 nodejs-lodash 软件包 - if [ "$KEEP_INSTALLED" = "false" ]; then - LOG_INFO "步骤7:卸载 nodejs-lodash 软件包" - dnf remove -y nodejs-lodash - CHECK_RESULT $? 0 0 "卸载 nodejs-lodash 软件包失败" - else - LOG_INFO "步骤7:保持 nodejs-lodash 软件包安装状态" - fi - - LOG_INFO "测试完成:zipWith 函数对数组的基本合并功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lodash/nodejs-lodash-zipwith/test_nodejs-lodash-zipwith_function_custom.sh b/testcases/function_test/pkg_test/lodash/nodejs-lodash-zipwith/test_nodejs-lodash-zipwith_function_custom.sh deleted file mode 100644 index d1ae8a9e7dd..00000000000 --- a/testcases/function_test/pkg_test/lodash/nodejs-lodash-zipwith/test_nodejs-lodash-zipwith_function_custom.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-03 -# @License : Mulan PSL v2 -# @Desc : 测试 zipWith 函数使用自定义迭代器合并数组 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 zipWith 函数使用自定义迭代器合并数组" - - # 定义软件包名 - PACKAGE_NAME="nodejs-lodash" - LOG_INFO "检查软件包 ${PACKAGE_NAME} 是否在 yum 源中" - if ! dnf list available ${PACKAGE_NAME} &>/dev/null; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 不在 yum 源中" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查 ${PACKAGE_NAME} 是否已安装" - if rpm -q ${PACKAGE_NAME} &>/dev/null; then - LOG_INFO "${PACKAGE_NAME} 已安装,测试结束后保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "${PACKAGE_NAME} 未安装,将在测试中安装" - INSTALLED_BEFORE=false - fi - - # 如果未安装,则安装软件包 - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "安装 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装 ${PACKAGE_NAME} 失败" - fi - - # 测试 zipWith 函数使用自定义迭代器合并数组 - LOG_INFO "创建测试 Node.js 脚本" - cat > test_zipwith.js << "EOF" - const _ = require("lodash"); - - function customIteratee(a, b, c) { - return a + b + c; - } - - const array1 = [1, 2]; - const array2 = [10, 20]; - const array3 = [100, 200]; - - const result = _.zipWith(array1, array2, array3, customIteratee); - console.log(JSON.stringify(result)); - EOF - - LOG_INFO "执行 Node.js 测试脚本" - node test_zipwith.js - CHECK_RESULT $? 0 0 "执行 Node.js 脚本失败" - - LOG_INFO "验证输出结果" - EXPECTED="[111,222]" - ACTUAL=$(node test_zipwith.js) - if [ "${ACTUAL}" = "${EXPECTED}" ]; then - LOG_INFO "测试通过:zipWith 函数使用自定义迭代器合并数组成功" - else - LOG_ERROR "测试失败:期望 ${EXPECTED},实际 ${ACTUAL}" - exit 1 - fi - - # 清理临时文件 - LOG_INFO "清理临时测试文件" - rm -f test_zipwith.js - - # 如果测试前未安装,则卸载软件包 - 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/lodash/nodejs-lodash-zipwith/test_nodejs-lodash-zipwith_function_require.sh b/testcases/function_test/pkg_test/lodash/nodejs-lodash-zipwith/test_nodejs-lodash-zipwith_function_require.sh deleted file mode 100644 index 4aa501876b6..00000000000 --- a/testcases/function_test/pkg_test/lodash/nodejs-lodash-zipwith/test_nodejs-lodash-zipwith_function_require.sh +++ /dev/null @@ -1,165 +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-03 -# @License : Mulan PSL v2 -# @Desc : 测试在代码中成功引入 lodash.zipwith 模块 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装nodejs - LOG_INFO "检查nodejs是否已安装" - rpm -q nodejs > /dev/null 2>&1 - nodejs_installed=$? - - # 检查是否已安装npm - LOG_INFO "检查npm是否已安装" - rpm -q npm > /dev/null 2>&1 - npm_installed=$? - - # 检查yum源中是否有nodejs和npm包 - LOG_INFO "检查yum源中是否有nodejs和npm包" - dnf list available nodejs 2>/dev/null | grep -q nodejs - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有nodejs软件包" - exit 255 - fi - - dnf list available npm 2>/dev/null | grep -q npm - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有npm软件包" - exit 255 - fi - - # 如果未安装nodejs或npm,则进行安装 - if [ $nodejs_installed -ne 0 ] || [ $npm_installed -ne 0 ]; then - LOG_INFO "安装nodejs和npm" - dnf install -y nodejs npm - CHECK_RESULT $? 0 0 "安装nodejs和npm失败" - - # 设置安装标记,以便脚本结束时卸载 - need_cleanup=1 - else - LOG_INFO "nodejs和npm已安装,无需重新安装" - need_cleanup=0 - fi - - # 检查nodejs和npm命令是否可用 - LOG_INFO "检查nodejs和npm命令是否可用" - node --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "node命令不可用" - - npm --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "npm命令不可用" - - # 创建测试目录 - LOG_INFO "创建测试目录" - test_dir="/tmp/test_nodejs_lodash_$(date +%s)" - mkdir -p $test_dir - CHECK_RESULT $? 0 0 "创建测试目录失败" - - cd $test_dir - - # 初始化npm项目 - LOG_INFO "初始化npm项目" - npm init -y > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "npm初始化失败" - - # 安装lodash包 - LOG_INFO "安装lodash包" - npm install lodash > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装lodash失败" - - # 创建测试JavaScript文件 - LOG_INFO "创建测试JavaScript文件" - cat > test_zipwith.js << "EOF" - const _ = require("lodash"); - - // 测试lodash.zipWith函数 - function testZipWith() { - console.log("开始测试lodash.zipWith函数..."); - - // 示例数组 - const array1 = [1, 2, 3]; - const array2 = [10, 20, 30]; - const array3 = [100, 200, 300]; - - // 使用zipWith将数组元素相加 - const result = _.zipWith(array1, array2, array3, function(a, b, c) { - return a + b + c; - }); - - console.log("数组1:", array1); - console.log("数组2:", array2); - console.log("数组3:", array3); - console.log("zipWith结果(相加):", result); - - // 验证结果 - const expected = [111, 222, 333]; - if (JSON.stringify(result) === JSON.stringify(expected)) { - console.log("测试通过: lodash.zipWith函数工作正常"); - return 0; - } else { - console.log("测试失败: 预期结果", expected, "实际结果", result); - return 1; - } - } - - // 执行测试 - const testResult = testZipWith(); - process.exit(testResult); - EOF - - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 执行测试 - LOG_INFO "执行lodash.zipWith模块测试" - node test_zipwith.js - CHECK_RESULT $? 0 0 "lodash.zipWith模块测试失败" - - LOG_INFO "lodash.zipWith模块引入和使用测试成功" - - # 清理测试目录 - LOG_INFO "清理测试目录" - cd / - rm -rf $test_dir - CHECK_RESULT $? 0 0 "清理测试目录失败" - - # 如果脚本安装的软件包,则进行卸载 - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "卸载测试安装的软件包" - - # 卸载npm(如果之前未安装) - if [ $npm_installed -ne 0 ]; then - dnf remove -y npm - CHECK_RESULT $? 0 0 "卸载npm失败" - fi - - # 卸载nodejs(如果之前未安装) - if [ $nodejs_installed -ne 0 ]; then - dnf remove -y nodejs - CHECK_RESULT $? 0 0 "卸载nodejs失败" - fi - - LOG_INFO "环境已恢复到原始状态" - else - LOG_INFO "保持nodejs和npm的安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/nvml/nvml-help/test_nvml-help_basic_usage.sh b/testcases/function_test/pkg_test/nvml/nvml-help/test_nvml-help_basic_usage.sh deleted file mode 100644 index 23f8321fc34..00000000000 --- a/testcases/function_test/pkg_test/nvml/nvml-help/test_nvml-help_basic_usage.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试软件包nvml-help的基本帮助功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试软件包nvml-help的基本帮助功能" - - LOG_INFO "步骤1: 检查是否已安装nvml-help软件包" - rpm -q nvml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "nvml-help已安装,测试后保持安装状态" - INSTALLED=1 - else - LOG_INFO "nvml-help未安装,将在测试中安装" - INSTALLED=0 - fi - - LOG_INFO "步骤2: 检查yum源中是否存在nvml-help软件包" - dnf list available nvml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到nvml-help软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装nvml-help软件包" - dnf install -y nvml-help - CHECK_RESULT $? 0 0 "安装nvml-help失败" - fi - - LOG_INFO "步骤4: 测试nvml-help命令的基本帮助功能" - LOG_INFO "步骤4.1: 测试nvml-help命令是否存在" - which nvml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "nvml-help命令不存在" - - LOG_INFO "步骤4.2: 测试nvml-help命令的--help参数" - nvml-help --help > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "nvml-help命令不支持--help参数" - exit 255 - fi - CHECK_RESULT $? 0 0 "nvml-help --help执行失败" - - LOG_INFO "步骤4.3: 测试nvml-help命令的-h参数" - nvml-help -h > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "nvml-help命令不支持-h参数" - exit 255 - fi - CHECK_RESULT $? 0 0 "nvml-help -h执行失败" - - LOG_INFO "步骤5: 清理测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的nvml-help软件包" - dnf remove -y nvml-help - CHECK_RESULT $? 0 0 "卸载nvml-help失败" - else - LOG_INFO "保持原有安装状态,不卸载nvml-help" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/nvml/nvml-help/test_nvml-help_uninstall.sh b/testcases/function_test/pkg_test/nvml/nvml-help/test_nvml-help_uninstall.sh deleted file mode 100644 index 04844a0f249..00000000000 --- a/testcases/function_test/pkg_test/nvml/nvml-help/test_nvml-help_uninstall.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试软件包nvml-help的卸载功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试软件包nvml-help的卸载功能" - - # 检查是否已安装nvml-help - LOG_INFO "检查是否已安装nvml-help软件包" - if dnf list installed | grep -q "nvml-help"; then - LOG_INFO "nvml-help软件包已安装" - INSTALLED=1 - else - LOG_INFO "nvml-help软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有nvml-help软件包 - LOG_INFO "检查yum源中是否有nvml-help软件包" - if ! dnf list available | grep -q "nvml-help"; then - LOG_ERROR "yum源中没有nvml-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包作为测试步骤 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装nvml-help软件包" - dnf install -y nvml-help - CHECK_RESULT $? 0 0 "安装nvml-help软件包失败" - LOG_INFO "nvml-help软件包安装成功" - fi - - # 测试卸载功能 - LOG_INFO "开始测试卸载nvml-help软件包" - dnf remove -y nvml-help - CHECK_RESULT $? 0 0 "卸载nvml-help软件包失败" - LOG_INFO "nvml-help软件包卸载成功" - - # 环境恢复:如果原本未安装,则保持未安装状态;如果原本已安装,则重新安装 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "测试结束,保持环境未安装状态" - else - LOG_INFO "测试结束,恢复安装状态" - dnf install -y nvml-help - CHECK_RESULT $? 0 0 "重新安装nvml-help软件包失败" - LOG_INFO "nvml-help软件包重新安装成功" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/nvml/nvml-help/test_nvml-help_version.sh b/testcases/function_test/pkg_test/nvml/nvml-help/test_nvml-help_version.sh deleted file mode 100644 index b7a77291c6d..00000000000 --- a/testcases/function_test/pkg_test/nvml/nvml-help/test_nvml-help_version.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试软件包nvml-help的版本查询功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断环境是否已安装nvml-help软件包 - LOG_INFO "检查nvml-help软件包是否已安装" - rpm -q nvml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "nvml-help软件包已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "nvml-help软件包未安装,将在测试前安装并在测试后卸载" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否存在nvml-help软件包 - LOG_INFO "检查yum源中是否存在nvml-help软件包" - dnf list available nvml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到nvml-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "安装nvml-help软件包" - dnf install -y nvml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装nvml-help软件包失败" - fi - - # 测试nvml-help的版本查询功能 - LOG_INFO "执行nvml-help版本查询命令" - nvml-help --version > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "nvml-help版本查询命令执行成功" - # 获取版本信息并检查 - VERSION_OUTPUT=$(nvml-help --version 2>&1) - CHECK_RESULT $? 0 0 "nvml-help版本查询命令执行失败" - LOG_INFO "版本信息: $VERSION_OUTPUT" - else - # 检查是否因为参数不存在或不支持而失败 - nvml-help --help 2>&1 | grep -q "\-\-version" - if [ $? -ne 0 ]; then - LOG_ERROR "nvml-help命令不支持--version参数" - exit 255 - else - LOG_ERROR "nvml-help版本查询命令执行失败" - exit 1 - fi - fi - - # 清理环境 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "卸载nvml-help软件包" - dnf remove -y nvml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载nvml-help软件包失败" - LOG_INFO "环境已恢复至测试前状态" - else - LOG_INFO "测试完成,保持nvml-help软件包安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/proj/proj-help/test_proj-help_function_config.sh b/testcases/function_test/pkg_test/proj/proj-help/test_proj-help_function_config.sh deleted file mode 100644 index eaf34980d26..00000000000 --- a/testcases/function_test/pkg_test/proj/proj-help/test_proj-help_function_config.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-09 -# @License : Mulan PSL v2 -# @Desc : 测试 proj-help 软件包的配置功能,验证配置文件是否正确加载和应用。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试脚本:test_proj-help_function_config - - LOG_INFO "开始测试 proj-help 软件包的配置功能,验证配置文件是否正确加载和应用。" - - # 检查是否已安装 proj-help 软件包 - if dnf list installed proj-help &>/dev/null; then - LOG_INFO "proj-help 软件包已安装,测试结束后将保持安装状态。" - installed=true - else - LOG_INFO "proj-help 软件包未安装,将在测试结束后卸载。" - installed=false - fi - - # 检查 yum 源中是否有 proj-help 软件包 - if ! dnf list available proj-help &>/dev/null; then - LOG_ERROR "yum 源中未找到 proj-help 软件包,退出测试。" - exit 255 - fi - - # 安装 proj-help 软件包 - if [ "$installed" = false ]; then - LOG_INFO "正在安装 proj-help 软件包..." - dnf install -y proj-help - CHECK_RESULT $? 0 0 "安装 proj-help 软件包失败。" - fi - - # 验证配置文件是否正确加载和应用 - LOG_INFO "验证 proj-help 配置文件是否正确加载和应用..." - config_file="/etc/proj-help/config.conf" - if [ ! -f "$config_file" ]; then - LOG_ERROR "配置文件 $config_file 不存在。" - exit 255 - fi - - # 检查配置文件内容是否符合预期 - expected_config="example_config_value" - actual_config=$(grep "example_key" "$config_file" | cut -d"=" -f2 | tr -d " ") - if [ "$actual_config" != "$expected_config" ]; then - LOG_ERROR "配置文件内容不符合预期。" - exit 1 - fi - LOG_INFO "配置文件内容验证通过。" - - # 测试命令参数支持情况 - LOG_INFO "测试 proj-help 命令参数支持情况..." - proj-help --invalid-param &>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "不支持的参数未正确退出。" - exit 255 - fi - LOG_INFO "命令参数验证通过。" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "正在卸载 proj-help 软件包..." - dnf remove -y proj-help - CHECK_RESULT $? 0 0 "卸载 proj-help 软件包失败。" - fi - - LOG_INFO "测试完成,环境已恢复。" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/proj/proj-help/test_proj-help_function_help.sh b/testcases/function_test/pkg_test/proj/proj-help/test_proj-help_function_help.sh deleted file mode 100644 index 47671c3a42a..00000000000 --- a/testcases/function_test/pkg_test/proj/proj-help/test_proj-help_function_help.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-09 -# @License : Mulan PSL v2 -# @Desc : 测试 proj-help 软件包的帮助功能,验证帮助命令是否可以正确显示使用说明。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试 proj-help 软件包的帮助功能 - LOG_INFO "开始测试 proj-help 软件包的帮助功能" - - # 检查是否已安装 proj-help 软件包 - LOG_INFO "检查 proj-help 软件包是否已安装" - if ! dnf list installed proj-help &>/dev/null; then - LOG_INFO "proj-help 软件包未安装,准备安装" - # 检查 yum 源中是否有 proj-help 软件包 - if ! dnf list available proj-help &>/dev/null; then - LOG_ERROR "yum 源中未找到 proj-help 软件包" - exit 255 - fi - # 安装 proj-help 软件包 - dnf install -y proj-help - CHECK_RESULT $? 0 0 "安装 proj-help 软件包失败" - # 标记为需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "proj-help 软件包已安装" - NEED_UNINSTALL=0 - fi - - # 验证帮助命令是否可以正确显示使用说明 - LOG_INFO "验证 proj-help 的帮助命令" - proj-help --help - CHECK_RESULT $? 0 0 "proj-help 帮助命令执行失败" - - # 清理环境:如果之前未安装 proj-help,则卸载 - if [ "$NEED_UNINSTALL" -eq 1 ]; then - LOG_INFO "卸载 proj-help 软件包" - dnf remove -y proj-help - CHECK_RESULT $? 0 0 "卸载 proj-help 软件包失败" - fi - - LOG_INFO "测试 proj-help 软件包的帮助功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/proj/proj-help/test_proj-help_function_run.sh b/testcases/function_test/pkg_test/proj/proj-help/test_proj-help_function_run.sh deleted file mode 100644 index 5bfaa06a614..00000000000 --- a/testcases/function_test/pkg_test/proj/proj-help/test_proj-help_function_run.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-09 -# @License : Mulan PSL v2 -# @Desc : 测试 proj-help 软件包的运行功能,验证主程序是否可以正常启动和执行。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 proj-help 软件包的运行功能,验证主程序是否可以正常启动和执行。" - - # 检查环境是否已安装 proj-help - LOG_INFO "检查 proj-help 软件包是否已安装" - if dnf list installed proj-help &>/dev/null; then - LOG_INFO "proj-help 已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "proj-help 未安装,准备安装" - INSTALLED=false - fi - - # 检查 yum 源中是否存在 proj-help - LOG_INFO "检查 yum 源中是否存在 proj-help" - if ! dnf list available proj-help &>/dev/null; then - LOG_ERROR "yum 源中不存在 proj-help 软件包" - exit 255 - fi - - # 如果未安装则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 proj-help" - dnf install -y proj-help - CHECK_RESULT $? 0 0 "proj-help 安装失败" - fi - - # 验证主程序是否可以正常启动和执行 - LOG_INFO "验证主程序是否可以正常启动和执行" - proj-help --help - CHECK_RESULT $? 0 0 "proj-help 主程序启动失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 proj-help" - dnf remove -y proj-help - CHECK_RESULT $? 0 0 "proj-help 卸载失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-linecache2/python3-linecache2/test_python3-linecache2_function_getline.sh b/testcases/function_test/pkg_test/python-linecache2/python3-linecache2/test_python3-linecache2_function_getline.sh deleted file mode 100644 index c8e818561d5..00000000000 --- a/testcases/function_test/pkg_test/python-linecache2/python3-linecache2/test_python3-linecache2_function_getline.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-06 -# @License : Mulan PSL v2 -# @Desc : Test the getline function to retrieve a specific line from a file -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test the getline function to retrieve a specific line from a file" - - # 检查是否已安装python3-linecache - LOG_INFO "检查是否已安装python3-linecache" - dnf list installed python3-linecache > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-linecache已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "python3-linecache未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有python3-linecache软件包 - LOG_INFO "检查yum源中是否有python3-linecache软件包" - dnf list available python3-linecache > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-linecache软件包" - exit 255 - fi - - # 安装python3-linecache(如果未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装python3-linecache" - dnf install -y python3-linecache > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装python3-linecache失败" - fi - - # 测试getline功能:从文件中获取特定行 - LOG_INFO "测试getline功能:从文件中获取特定行" - TEST_FILE="/tmp/test_linecache.txt" - echo -e "line1\nline2\nline3" > $TEST_FILE - python3 -c " - import linecache - line = linecache.getline("$TEST_FILE", 2) - print(line.strip()) - " > /tmp/getline_output.txt - - CHECK_RESULT $? 0 0 "getline函数执行失败" - EXPECTED="line2" - ACTUAL=$(cat /tmp/getline_output.txt) - if [ "$ACTUAL" != "$EXPECTED" ]; then - LOG_ERROR "getline函数返回结果不符合预期:期望 "$EXPECTED",实际 "$ACTUAL"" - exit 1 - else - LOG_INFO "getline函数返回结果符合预期:"$ACTUAL"" - fi - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f $TEST_FILE /tmp/getline_output.txt - - # 卸载python3-linecache(如果最初未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载python3-linecache" - dnf remove -y python3-linecache > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载python3-linecache失败" - fi - - LOG_INFO "测试完成:Test the getline function to retrieve a specific line from a file" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-setuptools/python-setuptools-help/test_python-setuptools-help_function_help.sh b/testcases/function_test/pkg_test/python-setuptools/python-setuptools-help/test_python-setuptools-help_function_help.sh deleted file mode 100644 index cd1024850fd..00000000000 --- a/testcases/function_test/pkg_test/python-setuptools/python-setuptools-help/test_python-setuptools-help_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 : 2026-01-30 -# @License : Mulan PSL v2 -# @Desc : 测试获取setuptools帮助信息的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试获取setuptools帮助信息的功能" - LOG_INFO "步骤1: 检查系统是否已安装python3-setuptools" - if dnf list installed python3-setuptools &> /dev/null; then - LOG_INFO "python3-setuptools已安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "python3-setuptools未安装,将在测试中安装,并在脚本结束前卸载" - INSTALLED_BEFORE=false - fi - LOG_INFO "步骤2: 检查yum源中是否有python3-setuptools软件包" - if ! dnf list available python3-setuptools &> /dev/null; then - LOG_ERROR "yum源中未找到python3-setuptools软件包" - exit 255 - fi - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3: 安装python3-setuptools软件包" - dnf install -y python3-setuptools - CHECK_RESULT $? 0 0 "安装python3-setuptools失败" - fi - LOG_INFO "步骤4: 测试获取setuptools帮助信息的功能" - LOG_INFO "执行命令: python3 -m setuptools --help" - python3 -m setuptools --help - CHECK_RESULT $? 0 0 "执行python3 -m setuptools --help失败" - LOG_INFO "步骤5: 测试setuptools的无效参数" - LOG_INFO "执行命令: python3 -m setuptools --invalid-param" - python3 -m setuptools --invalid-param 2>/dev/null - if [ $? -eq 255 ]; then - LOG_INFO "无效参数处理符合预期(退出码255)" - else - LOG_ERROR "无效参数处理不符合预期" - exit 255 - fi - LOG_INFO "步骤6: 清理测试环境" - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载python3-setuptools软件包" - dnf remove -y python3-setuptools - CHECK_RESULT $? 0 0 "卸载python3-setuptools失败" - else - LOG_INFO "保持python3-setuptools安装状态" - fi - LOG_INFO "测试完成:测试获取setuptools帮助信息的功能" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-setuptools/python-setuptools-help/test_python-setuptools-help_function_import.sh b/testcases/function_test/pkg_test/python-setuptools/python-setuptools-help/test_python-setuptools-help_function_import.sh deleted file mode 100644 index f5c3dc16b76..00000000000 --- a/testcases/function_test/pkg_test/python-setuptools/python-setuptools-help/test_python-setuptools-help_function_import.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 : 2026-01-30 -# @License : Mulan PSL v2 -# @Desc : 测试能否成功导入python-setuptools-help模块 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:测试能否成功导入python-setuptools-help模块" - - # 检查yum源中是否存在python3-setuptools-help软件包 - LOG_INFO "步骤1:检查yum源中是否存在python3-setuptools-help软件包" - dnf list available python3-setuptools-help &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-setuptools-help软件包" - exit 255 - fi - - # 检查python3-setuptools-help是否已经安装 - LOG_INFO "步骤2:检查python3-setuptools-help是否已经安装" - rpm -q python3-setuptools-help &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "python3-setuptools-help已经安装,标记为已安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "python3-setuptools-help未安装,标记为未安装状态" - ALREADY_INSTALLED=0 - fi - - # 如果未安装,则安装python3-setuptools-help - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装python3-setuptools-help" - dnf install -y python3-setuptools-help - CHECK_RESULT $? 0 0 "安装python3-setuptools-help失败" - fi - - # 测试能否成功导入python-setuptools-help模块 - LOG_INFO "步骤4:测试能否成功导入python-setuptools-help模块" - python3 -c "import setuptools_help" &> /dev/null - CHECK_RESULT $? 0 0 "导入python-setuptools-help模块失败" - - # 如果之前未安装,则在测试结束后卸载python3-setuptools-help - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤5:卸载python3-setuptools-help" - dnf remove -y python3-setuptools-help - CHECK_RESULT $? 0 0 "卸载python3-setuptools-help失败" - fi - - LOG_INFO "测试结束:测试成功完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-setuptools/python-setuptools-help/test_python-setuptools-help_function_list.sh b/testcases/function_test/pkg_test/python-setuptools/python-setuptools-help/test_python-setuptools-help_function_list.sh deleted file mode 100644 index a94d9d5f90b..00000000000 --- a/testcases/function_test/pkg_test/python-setuptools/python-setuptools-help/test_python-setuptools-help_function_list.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 : 2026-03-31 -# @License : Mulan PSL v2 -# @Desc : 测试列出已安装包功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试列出已安装包功能" - LOG_INFO "步骤1:检查是否已安装python-setuptools" - if dnf list installed python-setuptools &> /dev/null; then - LOG_INFO "python-setuptools已安装,将保持安装状态" - INSTALLED="true" - else - LOG_INFO "python-setuptools未安装,将进行安装" - INSTALLED="false" - fi - - LOG_INFO "步骤2:检查yum源中是否有python-setuptools软件包" - if ! dnf list available python-setuptools &> /dev/null; then - LOG_ERROR "yum源中未找到python-setuptools软件包" - exit 255 - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装python-setuptools" - dnf install -y python-setuptools - CHECK_RESULT $? 0 0 "安装python-setuptools失败" - fi - - LOG_INFO "步骤4:测试列出已安装包功能" - if ! command -v easy_install &> /dev/null; then - LOG_ERROR "easy_install命令不存在" - exit 255 - fi - - easy_install --help | grep -q "\-\-help" - CHECK_RESULT $? 0 0 "easy_install --help命令执行失败" - - easy_install --help | grep -q "list" - CHECK_RESULT $? 0 0 "easy_install --help中未找到list参数支持" - - LOG_INFO "步骤5:执行列出已安装包命令" - easy_install --list - CHECK_RESULT $? 0 0 "列出已安装包失败" - - LOG_INFO "步骤6:清理环境" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载python-setuptools" - dnf remove -y python-setuptools - CHECK_RESULT $? 0 0 "卸载python-setuptools失败" - else - LOG_INFO "保持python-setuptools安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-setuptools/python-setuptools-help/test_python-setuptools-help_function_show.sh b/testcases/function_test/pkg_test/python-setuptools/python-setuptools-help/test_python-setuptools-help_function_show.sh deleted file mode 100644 index 1dde5d932ca..00000000000 --- a/testcases/function_test/pkg_test/python-setuptools/python-setuptools-help/test_python-setuptools-help_function_show.sh +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-31 -# @License : Mulan PSL v2 -# @Desc : 测试显示包详细信息功能 -# ############################################ - -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 expected=$2 - local exit_code=$3 - local reason=$4 - - if [ $actual -ne $expected ]; then - LOG_ERROR "$reason" - exit $exit_code - fi - } - - # 定义SSH命令函数(虽然题目说无需定义,但为完整性提供) - SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=$4 - sshpass -p "$password" ssh -o StrictHostKeyChecking=no "$user@$ip" "$cmd" - } - - # 定义主函数 - main() { - local package_name="python3-setuptools" - local command="python3 -m pip show" - local package_to_show="pip" - - LOG_INFO "开始测试显示包详细信息功能" - - # 步骤1:检查yum源中是否有python3-setuptools软件包 - LOG_INFO "步骤1:检查yum源中是否有$package_name软件包" - dnf list available $package_name > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有$package_name软件包" - exit 255 - fi - LOG_INFO "yum源中存在$package_name软件包" - - # 步骤2:检查环境是否已安装python3-setuptools - LOG_INFO "步骤2:检查环境是否已安装$package_name" - rpm -q $package_name > /dev/null 2>&1 - local installed=$? - if [ $installed -eq 0 ]; then - LOG_INFO "$package_name已安装,测试结束后将保持安装状态" - local need_uninstall=false - else - LOG_INFO "$package_name未安装,将在测试结束后卸载" - local need_uninstall=true - fi - - # 步骤3:如果未安装,则安装python3-setuptools - if [ $installed -ne 0 ]; then - LOG_INFO "步骤3:安装$package_name" - dnf install -y $package_name > /dev/null 2>&1 - CHECK_RESULT $? 0 1 "安装$package_name失败" - LOG_INFO "$package_name安装成功" - else - LOG_INFO "步骤3:跳过安装,$package_name已存在" - fi - - # 步骤4:检查命令参数是否存在或不支持 - LOG_INFO "步骤4:检查命令参数是否存在或不支持" - $command --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "命令$command不支持或参数错误" - exit 255 - fi - LOG_INFO "命令$command支持" - - # 步骤5:执行命令显示包详细信息 - LOG_INFO "步骤5:执行命令显示包详细信息" - $command $package_to_show > /dev/null 2>&1 - CHECK_RESULT $? 0 1 "显示包详细信息失败" - LOG_INFO "显示包详细信息成功" - - # 步骤6:清理环境 - LOG_INFO "步骤6:清理环境" - if [ "$need_uninstall" = true ]; then - LOG_INFO "卸载$package_name" - dnf remove -y $package_name > /dev/null 2>&1 - CHECK_RESULT $? 0 1 "卸载$package_name失败" - LOG_INFO "$package_name卸载成功" - else - LOG_INFO "保持$package_name安装状态" - fi - - LOG_INFO "测试显示包详细信息功能完成" - } - - # 调用主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-setuptools/python-setuptools-help/test_python-setuptools-help_function_upgrade.sh b/testcases/function_test/pkg_test/python-setuptools/python-setuptools-help/test_python-setuptools-help_function_upgrade.sh deleted file mode 100644 index 981e146a0f5..00000000000 --- a/testcases/function_test/pkg_test/python-setuptools/python-setuptools-help/test_python-setuptools-help_function_upgrade.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-31 -# @License : Mulan PSL v2 -# @Desc : 测试软件包升级功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试软件包升级功能" - LOG_INFO "步骤1:检查yum源中是否存在python3-setuptools软件包" - dnf list available python3-setuptools > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在python3-setuptools软件包" - exit 255 - fi - LOG_INFO "步骤2:检查系统是否已安装python3-setuptools" - rpm -q python3-setuptools > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "系统已安装python3-setuptools,脚本结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "系统未安装python3-setuptools,将在测试步骤中安装" - INSTALLED=false - fi - LOG_INFO "步骤3:测试软件包升级功能" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装python3-setuptools软件包" - dnf install -y python3-setuptools - CHECK_RESULT $? 0 0 "安装python3-setuptools失败" - fi - LOG_INFO "尝试升级python3-setuptools软件包" - dnf upgrade -y python3-setuptools - CHECK_RESULT $? 0 0 "升级python3-setuptools失败" - LOG_INFO "步骤4:验证升级后的软件包版本" - rpm -q python3-setuptools - CHECK_RESULT $? 0 0 "验证软件包版本失败" - LOG_INFO "步骤5:清理环境,恢复原始状态" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载python3-setuptools软件包" - dnf remove -y python3-setuptools - CHECK_RESULT $? 0 0 "卸载python3-setuptools失败" - else - LOG_INFO "系统原本已安装python3-setuptools,保持安装状态" - fi - LOG_INFO "测试软件包升级功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-setuptools/python-setuptools-help/test_python-setuptools-help_function_version.sh b/testcases/function_test/pkg_test/python-setuptools/python-setuptools-help/test_python-setuptools-help_function_version.sh deleted file mode 100644 index 7b85b5e38ab..00000000000 --- a/testcases/function_test/pkg_test/python-setuptools/python-setuptools-help/test_python-setuptools-help_function_version.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-30 -# @License : Mulan PSL v2 -# @Desc : 测试检查软件包版本的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="python3-setuptools" - - # 检查yum源中是否存在指定软件包 - LOG_INFO "检查yum源中是否存在软件包: $PACKAGE_NAME" - dnf list available $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在软件包: $PACKAGE_NAME" - exit 255 - fi - - # 检查当前环境是否已安装该软件包 - LOG_INFO "检查当前环境是否已安装软件包: $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 - - # 测试检查软件包版本的功能 - LOG_INFO "测试检查软件包版本的功能" - # 测试 --version 参数 - LOG_INFO "测试 --version 参数" - python3 -m pip --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "检查pip版本失败" - - # 测试 pip show 命令查看setuptools版本 - LOG_INFO "测试 pip show 命令查看setuptools版本" - python3 -m pip show setuptools | grep -i version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "通过pip show查看setuptools版本失败" - - # 测试不支持的参数 - LOG_INFO "测试不支持的参数" - python3 -m pip --invalid-param > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "不支持的参数正确处理" - else - LOG_ERROR "不支持的参数未正确处理" - exit 255 - fi - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载软件包: $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-b/texlive-asciilist-doc/test_texlive-asciilist-doc_function_doc_exist.sh b/testcases/function_test/pkg_test/texlive-split-b/texlive-asciilist-doc/test_texlive-asciilist-doc_function_doc_exist.sh deleted file mode 100644 index 9773cb95a21..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-b/texlive-asciilist-doc/test_texlive-asciilist-doc_function_doc_exist.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-20 -# @License : Mulan PSL v2 -# @Desc : Test documentation files -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试文档文件 - LOG_INFO "开始测试 texlive-asciilist-doc 文档文件" - - # 定义软件包名称 - PACKAGE_NAME="texlive-asciilist-doc" - - # 步骤1: 检查软件包是否已在yum源中 - LOG_INFO "步骤1: 检查软件包是否在yum源中" - 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: 检查软件包是否已安装" - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - PACKAGE_INSTALLED=$? - - # 步骤3: 如果未安装,则安装软件包 - if [ $PACKAGE_INSTALLED -ne 0 ]; then - LOG_INFO "步骤3: 安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4: 测试文档文件是否存在 - LOG_INFO "步骤4: 测试文档文件是否存在" - rpm -ql $PACKAGE_NAME | grep -E "\.pdf$|\.html$|\.txt$|\.md$" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "软件包 $PACKAGE_NAME 不包含文档文件" - - # 步骤5: 验证文档文件可读性 - LOG_INFO "步骤5: 验证文档文件可读性" - DOC_FILE=$(rpm -ql $PACKAGE_NAME | grep -E "\.pdf$|\.html$|\.txt$|\.md$" | head -1) - if [ -n "$DOC_FILE" ]; then - if [ -f "$DOC_FILE" ]; then - file "$DOC_FILE" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "文档文件 $DOC_FILE 不可读或格式错误" - else - LOG_ERROR "文档文件 $DOC_FILE 不存在" - CHECK_RESULT 1 0 0 "文档文件不存在" - fi - else - LOG_ERROR "未找到文档文件" - CHECK_RESULT 1 0 0 "未找到文档文件" - fi - - # 步骤6: 清理环境 - LOG_INFO "步骤6: 清理环境" - if [ $PACKAGE_INSTALLED -ne 0 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-b/texlive-asciilist-doc/test_texlive-asciilist-doc_function_query.sh b/testcases/function_test/pkg_test/texlive-split-b/texlive-asciilist-doc/test_texlive-asciilist-doc_function_query.sh deleted file mode 100644 index 43e91ee1770..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-b/texlive-asciilist-doc/test_texlive-asciilist-doc_function_query.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-02-20 -# @License : Mulan PSL v2 -# @Desc : Test query package info -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:Test query package info - - LOG_INFO "1. 检查系统中是否已安装texlive-asciilist-doc软件包" - rpm -q texlive-asciilist-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-asciilist-doc已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-asciilist-doc未安装,测试结束后将卸载" - INSTALLED=0 - fi - - LOG_INFO "2. 检查yum源中是否存在texlive-asciilist-doc软件包" - dnf list available texlive-asciilist-doc - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-asciilist-doc软件包" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "3. 安装texlive-asciilist-doc软件包" - dnf install -y texlive-asciilist-doc - CHECK_RESULT $? 0 0 "安装texlive-asciilist-doc失败" - fi - - LOG_INFO "4. 测试查询软件包信息功能" - dnf info texlive-asciilist-doc - CHECK_RESULT $? 0 0 "查询texlive-asciilist-doc软件包信息失败" - - LOG_INFO "5. 测试查询软件包文件列表功能" - rpm -ql texlive-asciilist-doc - CHECK_RESULT $? 0 0 "查询texlive-asciilist-doc文件列表失败" - - LOG_INFO "6. 测试查询软件包依赖关系" - rpm -qR texlive-asciilist-doc - CHECK_RESULT $? 0 0 "查询texlive-asciilist-doc依赖关系失败" - - LOG_INFO "7. 测试查询软件包提供的能力" - rpm -q --provides texlive-asciilist-doc - CHECK_RESULT $? 0 0 "查询texlive-asciilist-doc提供的能力失败" - - LOG_INFO "8. 测试查询软件包要求的依赖" - rpm -q --requires texlive-asciilist-doc - CHECK_RESULT $? 0 0 "查询texlive-asciilist-doc要求的依赖失败" - - LOG_INFO "9. 测试查询软件包变更日志" - rpm -q --changelog texlive-asciilist-doc | head -20 - CHECK_RESULT $? 0 0 "查询texlive-asciilist-doc变更日志失败" - - LOG_INFO "10. 测试无效参数处理" - rpm -q --invalid-param texlive-asciilist-doc 2>/dev/null - if [ $? -ne 255 ] && [ $? -ne 1 ]; then - LOG_ERROR "无效参数处理不符合预期" - exit 255 - fi - LOG_INFO "无效参数处理正常" - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "11. 清理环境:卸载texlive-asciilist-doc软件包" - dnf remove -y texlive-asciilist-doc - CHECK_RESULT $? 0 0 "卸载texlive-asciilist-doc失败" - else - LOG_INFO "11. 环境清理:保持texlive-asciilist-doc安装状态" - fi - - LOG_INFO "12. 验证环境已恢复" - if [ $INSTALLED -eq 0 ]; then - rpm -q texlive-asciilist-doc - if [ $? -eq 0 ]; then - LOG_ERROR "环境清理失败,texlive-asciilist-doc仍然存在" - exit 1 - else - LOG_INFO "环境已成功恢复,texlive-asciilist-doc已卸载" - fi - else - rpm -q texlive-asciilist-doc - CHECK_RESULT $? 0 0 "环境状态异常,texlive-asciilist-doc应保持安装" - LOG_INFO "环境已保持原有安装状态" - fi - - LOG_INFO "测试完成:Test query package info 所有测试项通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-b/texlive-asciilist-doc/test_texlive-asciilist-doc_function_remove.sh b/testcases/function_test/pkg_test/texlive-split-b/texlive-asciilist-doc/test_texlive-asciilist-doc_function_remove.sh deleted file mode 100644 index ca434661b3c..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-b/texlive-asciilist-doc/test_texlive-asciilist-doc_function_remove.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 : 2026-02-20 -# @License : Mulan PSL v2 -# @Desc : Test package removal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-asciilist-doc - LOG_INFO "检查texlive-asciilist-doc是否已安装" - if dnf list installed texlive-asciilist-doc &>/dev/null; then - LOG_INFO "texlive-asciilist-doc已安装,标记为保持安装状态" - KEEP_INSTALLED=1 - else - LOG_INFO "texlive-asciilist-doc未安装,标记为测试安装" - KEEP_INSTALLED=0 - fi - - # 检查yum源中是否有texlive-asciilist-doc软件包 - LOG_INFO "检查yum源中是否有texlive-asciilist-doc软件包" - if ! dnf list available texlive-asciilist-doc &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-asciilist-doc软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-asciilist-doc - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-asciilist-doc软件包" - dnf install -y texlive-asciilist-doc - CHECK_RESULT $? 0 0 "安装texlive-asciilist-doc失败" - fi - - # 验证安装是否成功 - LOG_INFO "验证texlive-asciilist-doc安装是否成功" - dnf list installed texlive-asciilist-doc &>/dev/null - CHECK_RESULT $? 0 0 "texlive-asciilist-doc安装验证失败" - - # 测试卸载功能 - LOG_INFO "测试卸载texlive-asciilist-doc软件包" - dnf remove -y texlive-asciilist-doc - CHECK_RESULT $? 0 0 "卸载texlive-asciilist-doc失败" - - # 验证卸载是否成功 - LOG_INFO "验证texlive-asciilist-doc是否已卸载" - if dnf list installed texlive-asciilist-doc &>/dev/null; then - LOG_ERROR "texlive-asciilist-doc卸载验证失败" - exit 1 - else - LOG_INFO "texlive-asciilist-doc卸载验证成功" - fi - - # 如果最初已安装,则重新安装以恢复环境 - if [ $KEEP_INSTALLED -eq 1 ]; then - LOG_INFO "恢复texlive-asciilist-doc安装状态" - dnf install -y texlive-asciilist-doc - CHECK_RESULT $? 0 0 "重新安装texlive-asciilist-doc失败" - LOG_INFO "环境已恢复,texlive-asciilist-doc保持安装状态" - else - LOG_INFO "环境已恢复,texlive-asciilist-doc保持未安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-b/texlive-asciilist-doc/test_texlive-asciilist-doc_function_verify.sh b/testcases/function_test/pkg_test/texlive-split-b/texlive-asciilist-doc/test_texlive-asciilist-doc_function_verify.sh deleted file mode 100644 index 762a437a01d..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-b/texlive-asciilist-doc/test_texlive-asciilist-doc_function_verify.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 : 2026-02-20 -# @License : Mulan PSL v2 -# @Desc : Test package integrity -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test package integrity" - LOG_INFO "步骤1:检查yum源中是否存在texlive-asciilist-doc软件包" - dnf list available texlive-asciilist-doc &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-asciilist-doc软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查系统是否已安装texlive-asciilist-doc" - if rpm -q texlive-asciilist-doc &>/dev/null; then - LOG_INFO "texlive-asciilist-doc已安装,标记为无需清理" - NEED_CLEANUP=0 - else - LOG_INFO "texlive-asciilist-doc未安装,标记为需要清理" - NEED_CLEANUP=1 - fi - - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "步骤3:安装texlive-asciilist-doc软件包" - dnf install -y texlive-asciilist-doc - CHECK_RESULT $? 0 0 "安装texlive-asciilist-doc失败" - fi - - LOG_INFO "步骤4:验证软件包完整性" - rpm -V texlive-asciilist-doc - CHECK_RESULT $? 0 0 "软件包完整性验证失败" - - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "步骤5:卸载texlive-asciilist-doc软件包" - dnf remove -y texlive-asciilist-doc - CHECK_RESULT $? 0 0 "卸载texlive-asciilist-doc失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-f/texlive-curve-doc/test_texlive-curve-doc_function_view_manual.sh b/testcases/function_test/pkg_test/texlive-split-f/texlive-curve-doc/test_texlive-curve-doc_function_view_manual.sh deleted file mode 100644 index e74110dadd2..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-f/texlive-curve-doc/test_texlive-curve-doc_function_view_manual.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 : 2026-03-25 -# @License : Mulan PSL v2 -# @Desc : Check ability to view the main manual -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:检查查看主手册的能力" - LOG_INFO "步骤1:检查系统是否已安装texlive-curve-doc软件包" - if dnf list installed texlive-curve-doc &>/dev/null; then - LOG_INFO "texlive-curve-doc已安装,测试后保持安装状态" - INSTALLED="true" - else - LOG_INFO "texlive-curve-doc未安装,将在测试中安装" - INSTALLED="false" - fi - - LOG_INFO "步骤2:检查yum源中是否有texlive-curve-doc软件包" - if ! dnf list available texlive-curve-doc &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-curve-doc软件包" - exit 255 - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装texlive-curve-doc软件包" - dnf install -y texlive-curve-doc - CHECK_RESULT $? 0 0 "安装texlive-curve-doc失败" - fi - - LOG_INFO "步骤4:检查texdoc命令是否可用" - if ! command -v texdoc &>/dev/null; then - LOG_ERROR "texdoc命令不存在" - exit 255 - fi - - LOG_INFO "步骤5:使用texdoc查看curve手册" - texdoc curve - CHECK_RESULT $? 0 0 "查看curve手册失败" - - LOG_INFO "步骤6:清理环境" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-curve-doc软件包" - dnf remove -y texlive-curve-doc - CHECK_RESULT $? 0 0 "卸载texlive-curve-doc失败" - else - LOG_INFO "保持texlive-curve-doc安装状态" - fi - - LOG_INFO "测试完成:检查查看主手册的能力" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-f/texlive-cutwin/test_texlive-cutwin_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-f/texlive-cutwin/test_texlive-cutwin_function_basic.sh deleted file mode 100644 index c5c5ccabb86..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-f/texlive-cutwin/test_texlive-cutwin_function_basic.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality of texlive-cutwin package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 texlive-cutwin 包的基本功能" - - # 检查是否已安装 texlive-cutwin 包 - if dnf list installed texlive-cutwin &>/dev/null; then - LOG_INFO "texlive-cutwin 已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-cutwin 未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-cutwin 包 - LOG_INFO "检查 yum 源中是否存在 texlive-cutwin 包" - if ! dnf list available texlive-cutwin &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-cutwin 包" - exit 255 - fi - - # 安装 texlive-cutwin 包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 texlive-cutwin 包" - dnf install -y texlive-cutwin - CHECK_RESULT $? 0 0 "安装 texlive-cutwin 包失败" - fi - - # 测试基本功能 - LOG_INFO "测试 texlive-cutwin 包的基本功能" - texlive-cutwin --version - CHECK_RESULT $? 0 0 "获取 texlive-cutwin 版本失败" - - # 测试不支持的命令参数(示例) - LOG_INFO "测试不支持的命令参数" - texlive-cutwin --invalid-arg &>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "不支持的参数未按预期退出" - exit 255 - fi - - # 清理环境(如果最初未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-cutwin 包以恢复环境" - dnf remove -y texlive-cutwin - CHECK_RESULT $? -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-o/texlive-mfnfss-doc/test_texlive-mfnfss-doc_function_view_doc.sh b/testcases/function_test/pkg_test/texlive-split-o/texlive-mfnfss-doc/test_texlive-mfnfss-doc_function_view_doc.sh deleted file mode 100644 index 11d9e15515b..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-o/texlive-mfnfss-doc/test_texlive-mfnfss-doc_function_view_doc.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-03 -# @License : Mulan PSL v2 -# @Desc : View main documentation file -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-mfnfss-doc软件包 - LOG_INFO "检查是否已安装texlive-mfnfss-doc软件包" - dnf list installed texlive-mfnfss-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-mfnfss-doc已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-mfnfss-doc未安装,将在测试前安装并在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-mfnfss-doc软件包 - LOG_INFO "检查yum源中是否有texlive-mfnfss-doc软件包" - dnf list available texlive-mfnfss-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-mfnfss-doc软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-mfnfss-doc软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-mfnfss-doc软件包" - dnf install -y texlive-mfnfss-doc - CHECK_RESULT $? 0 0 "安装texlive-mfnfss-doc失败" - fi - - # 查看主文档文件 - LOG_INFO "查看主文档文件" - texdoc mfnfss > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "查看texlive-mfnfss-doc主文档失败" - - # 如果测试前未安装,则在测试结束后卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-mfnfss-doc软件包" - dnf remove -y texlive-mfnfss-doc - CHECK_RESULT $? 0 0 "卸载texlive-mfnfss-doc失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-abspos/test_texlive-pst-abspos_function_position.sh b/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-abspos/test_texlive-pst-abspos_function_position.sh deleted file mode 100644 index f4d1bf7bb73..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-abspos/test_texlive-pst-abspos_function_position.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 absolute positioning functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试绝对定位功能" - - # 检查是否已安装texlive-pst-abspos - LOG_INFO "检查是否已安装texlive-pst-abspos" - if rpm -q texlive-pst-abspos &>/dev/null; then - LOG_INFO "texlive-pst-abspos已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-pst-abspos未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-pst-abspos - LOG_INFO "检查yum源中是否有texlive-pst-abspos" - if ! dnf list available texlive-pst-abspos &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-pst-abspos软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-pst-abspos - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-pst-abspos" - dnf install -y texlive-pst-abspos - CHECK_RESULT $? 0 0 "安装texlive-pst-abspos失败" - fi - - # 测试绝对定位功能 - LOG_INFO "测试绝对定位功能" - TEST_COMMAND="some_abs_pos_command --test" # 替换为实际的测试命令和参数 - if ! command -v some_abs_pos_command &>/dev/null; then - LOG_ERROR "命令some_abs_pos_command不存在或不支持" - exit 255 - fi - - $TEST_COMMAND - CHECK_RESULT $? 0 0 "绝对定位功能测试失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-pst-abspos" - dnf remove -y texlive-pst-abspos - CHECK_RESULT $? 0 0 "卸载texlive-pst-abspos失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-v/texlive-showhyphens-doc/test_texlive-showhyphens-doc_basic_usage.sh b/testcases/function_test/pkg_test/texlive-split-v/texlive-showhyphens-doc/test_texlive-showhyphens-doc_basic_usage.sh deleted file mode 100644 index 14de217a236..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-v/texlive-showhyphens-doc/test_texlive-showhyphens-doc_basic_usage.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-03-01 -# @License : Mulan PSL v2 -# @Desc : Test basic hyphenation display functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:测试基本连字符显示功能" - LOG_INFO "步骤1:检查是否已安装texlive-showhyphens-doc软件包" - rpm -q texlive-showhyphens-doc - if [ $? -eq 0 ]; then - LOG_INFO "texlive-showhyphens-doc已安装,标记为已安装状态" - INSTALLED="yes" - else - LOG_INFO "texlive-showhyphens-doc未安装" - INSTALLED="no" - fi - - LOG_INFO "步骤2:检查yum源中是否有texlive-showhyphens-doc软件包" - dnf list available texlive-showhyphens-doc - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-showhyphens-doc软件包" - exit 255 - fi - - if [ "$INSTALLED" = "no" ]; then - LOG_INFO "步骤3:安装texlive-showhyphens-doc软件包" - dnf install -y texlive-showhyphens-doc - CHECK_RESULT $? 0 0 "安装texlive-showhyphens-doc失败" - fi - - LOG_INFO "步骤4:检查texlive-showhyphens命令是否存在" - command -v texlive-showhyphens - CHECK_RESULT $? 0 0 "texlive-showhyphens命令不存在" - - LOG_INFO "步骤5:测试texlive-showhyphens基本用法,显示单词的连字符位置" - texlive-showhyphens documentation - CHECK_RESULT $? 0 0 "执行texlive-showhyphens documentation失败" - - LOG_INFO "步骤6:测试texlive-showhyphens不支持的参数" - texlive-showhyphens --invalid-option 2>/dev/null - if [ $? -ne 255 ] && [ $? -ne 1 ]; then - LOG_ERROR "不支持参数检查失败,命令未按预期退出" - exit 255 - fi - LOG_INFO "不支持参数检查通过" - - if [ "$INSTALLED" = "no" ]; then - LOG_INFO "步骤7:卸载texlive-showhyphens-doc软件包" - dnf remove -y texlive-showhyphens-doc - CHECK_RESULT $? 0 0 "卸载texlive-showhyphens-doc失败" - LOG_INFO "环境已恢复:已卸载测试安装的软件包" - else - LOG_INFO "环境已保持:未卸载原有的texlive-showhyphens-doc软件包" - fi - - LOG_INFO "测试结束:基本连字符显示功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-v/texlive-showhyphens-doc/test_texlive-showhyphens-doc_command_help.sh b/testcases/function_test/pkg_test/texlive-split-v/texlive-showhyphens-doc/test_texlive-showhyphens-doc_command_help.sh deleted file mode 100644 index 2f7eb0c8724..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-v/texlive-showhyphens-doc/test_texlive-showhyphens-doc_command_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-03-01 -# @License : Mulan PSL v2 -# @Desc : Test help information for showhyphens command -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-showhyphens-doc软件包 - LOG_INFO "检查texlive-showhyphens-doc软件包是否已安装" - dnf list installed texlive-showhyphens-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-showhyphens-doc软件包已安装,记录安装状态" - INSTALLED=true - else - LOG_INFO "texlive-showhyphens-doc软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-showhyphens-doc软件包 - LOG_INFO "检查yum源中是否存在texlive-showhyphens-doc软件包" - dnf list available texlive-showhyphens-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-showhyphens-doc软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装texlive-showhyphens-doc软件包" - dnf install -y texlive-showhyphens-doc - CHECK_RESULT $? 0 0 "安装texlive-showhyphens-doc软件包失败" - fi - - # 测试showhyphens命令的帮助信息 - LOG_INFO "测试showhyphens命令的帮助信息" - showhyphens --help - CHECK_RESULT $? 0 0 "执行showhyphens --help命令失败" - - # 测试showhyphens命令的无效参数 - LOG_INFO "测试showhyphens命令的无效参数" - showhyphens --invalid-parameter > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "showhyphens命令不支持无效参数,符合预期" - else - LOG_ERROR "showhyphens命令未正确处理无效参数" - exit 255 - fi - - # 恢复环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载texlive-showhyphens-doc软件包" - dnf remove -y texlive-showhyphens-doc - CHECK_RESULT $? 0 0 "卸载texlive-showhyphens-doc软件包失败" - else - LOG_INFO "保持texlive-showhyphens-doc软件包的安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-v/texlive-showhyphens-doc/test_texlive-showhyphens-doc_doc_verify.sh b/testcases/function_test/pkg_test/texlive-split-v/texlive-showhyphens-doc/test_texlive-showhyphens-doc_doc_verify.sh deleted file mode 100644 index d018f92099d..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-v/texlive-showhyphens-doc/test_texlive-showhyphens-doc_doc_verify.sh +++ /dev/null @@ -1,172 +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-01 -# @License : Mulan PSL v2 -# @Desc : Test documentation existence and basic format -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(虽然题目说直接使用,但实际脚本中需要定义) - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - - # 定义检查结果函数 - CHECK_RESULT() { - local actual=$1 - local expect=$2 - local mode=$3 - local message=$4 - - if [ $mode -eq 0 ]; then - if [ $actual -eq $expect ]; then - LOG_INFO "$message 成功" - return 0 - else - LOG_ERROR "$message 失败 (实际: $actual, 期望: $expect)" - exit $actual - fi - else - if [ $actual -ne $expect ]; then - LOG_INFO "$message 成功" - return 0 - else - LOG_ERROR "$message 失败 (实际: $actual, 期望: 非 $expect)" - exit 1 - fi - fi - } - - # 定义SSH命令函数 - SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=$4 - - # 简单实现,实际可能需要使用sshpass或密钥 - sshpass -p "$password" ssh -o StrictHostKeyChecking=no "$user@$ip" "$cmd" - } - - # 主测试函数 - main() { - LOG_INFO "开始测试:验证texlive-showhyphens-doc文档的存在性和基本格式" - - # 检查软件包是否在yum源中 - LOG_INFO "步骤1:检查texlive-showhyphens-doc软件包是否在yum源中" - dnf list available texlive-showhyphens-doc 2>/dev/null | grep -q texlive-showhyphens-doc - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-showhyphens-doc软件包不在yum源中" - exit 255 - fi - LOG_INFO "texlive-showhyphens-doc软件包在yum源中" - - # 检查是否已安装 - LOG_INFO "步骤2:检查texlive-showhyphens-doc是否已安装" - rpm -q texlive-showhyphens-doc >/dev/null 2>&1 - local already_installed=$? - - # 如果未安装,则安装 - if [ $already_installed -ne 0 ]; then - LOG_INFO "步骤3:安装texlive-showhyphens-doc软件包" - dnf install -y texlive-showhyphens-doc - CHECK_RESULT $? 0 0 "安装texlive-showhyphens-doc" - else - LOG_INFO "texlive-showhyphens-doc已安装,跳过安装步骤" - fi - - # 验证文档文件存在性 - LOG_INFO "步骤4:验证文档文件是否存在" - local doc_file=$(rpm -ql texlive-showhyphens-doc | grep -E "\.(pdf|html|txt)$" | head -1) - if [ -z "$doc_file" ]; then - LOG_ERROR "未找到texlive-showhyphens-doc的文档文件" - # 如果是测试期间安装的,需要卸载 - if [ $already_installed -ne 0 ]; then - dnf remove -y texlive-showhyphens-doc - fi - exit 1 - fi - - LOG_INFO "找到文档文件: $doc_file" - - # 检查文档文件是否可读 - LOG_INFO "步骤5:检查文档文件是否可读" - if [ -r "$doc_file" ]; then - LOG_INFO "文档文件可读" - else - LOG_ERROR "文档文件不可读: $doc_file" - # 如果是测试期间安装的,需要卸载 - if [ $already_installed -ne 0 ]; then - dnf remove -y texlive-showhyphens-doc - fi - exit 1 - fi - - # 检查文档基本格式(文件类型) - LOG_INFO "步骤6:检查文档文件格式" - file "$doc_file" | grep -q "text\|PDF\|HTML" - CHECK_RESULT $? 0 0 "检查文档文件格式" - - # 检查文档文件大小(确保不是空文件) - LOG_INFO "步骤7:检查文档文件大小" - local file_size=$(stat -c%s "$doc_file" 2>/dev/null || stat -f%z "$doc_file") - if [ $file_size -gt 0 ]; then - LOG_INFO "文档文件大小正常: ${file_size}字节" - else - LOG_ERROR "文档文件为空或大小异常" - # 如果是测试期间安装的,需要卸载 - if [ $already_installed -ne 0 ]; then - dnf remove -y texlive-showhyphens-doc - fi - exit 1 - fi - - # 测试texlive-showhyphens命令的基本功能 - LOG_INFO "步骤8:测试texlive-showhyphens命令基本功能" - texlive-showhyphens --help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "检查texlive-showhyphens命令帮助" - - # 测试不支持的参数 - LOG_INFO "步骤9:测试不支持的参数" - texlive-showhyphens --invalid-parameter 2>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "遇到不支持的参数,按规范退出" - exit 255 - fi - - # 清理环境:如果测试前未安装,则卸载 - LOG_INFO "步骤10:清理测试环境" - if [ $already_installed -ne 0 ]; then - LOG_INFO "卸载测试期间安装的texlive-showhyphens-doc软件包" - dnf remove -y texlive-showhyphens-doc - CHECK_RESULT $? 0 0 "卸载texlive-showhyphens-doc" - else - LOG_INFO "测试前已安装,保持安装状态" - fi - - LOG_INFO "测试完成:texlive-showhyphens-doc文档存在性和基本格式验证通过" - } - - # 执行主函数 - main "$@" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-v/texlive-showhyphens-doc/test_texlive-showhyphens-doc_install.sh b/testcases/function_test/pkg_test/texlive-split-v/texlive-showhyphens-doc/test_texlive-showhyphens-doc_install.sh deleted file mode 100644 index 9e5d46cd95e..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-v/texlive-showhyphens-doc/test_texlive-showhyphens-doc_install.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 : 2026-03-01 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试软件包安装" - LOG_INFO "步骤1: 检查软件包是否已在yum源中" - dnf list available texlive-showhyphens-doc 2>/dev/null | grep -q texlive-showhyphens-doc - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-showhyphens-doc软件包" - exit 255 - fi - - LOG_INFO "步骤2: 检查当前是否已安装该软件包" - if rpm -q texlive-showhyphens-doc >/dev/null 2>&1; then - LOG_INFO "软件包已安装,测试后保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "软件包未安装,将进行安装测试" - ALREADY_INSTALLED=0 - fi - - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装texlive-showhyphens-doc软件包" - dnf install -y texlive-showhyphens-doc - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - LOG_INFO "步骤4: 验证软件包安装成功" - rpm -q texlive-showhyphens-doc - CHECK_RESULT $? 0 0 "验证软件包安装失败" - - LOG_INFO "步骤5: 测试软件包功能" - texlive-showhyphens-doc --version - CHECK_RESULT $? 0 0 "执行texlive-showhyphens-doc --version失败" - - LOG_INFO "步骤6: 测试无效参数处理" - texlive-showhyphens-doc --invalid-param 2>/dev/null - if [ $? -ne 255 ] && [ $? -ne 1 ]; then - LOG_ERROR "无效参数处理不符合预期" - exit 255 - fi - - LOG_INFO "步骤7: 清理测试环境" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y texlive-showhyphens-doc - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持原有安装状态,不执行卸载" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-v/texlive-showhyphens-doc/test_texlive-showhyphens-doc_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-v/texlive-showhyphens-doc/test_texlive-showhyphens-doc_uninstall.sh deleted file mode 100644 index 8bc68c6af20..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-v/texlive-showhyphens-doc/test_texlive-showhyphens-doc_uninstall.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-03 -# @License : Mulan PSL v2 -# @Desc : Test package removal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test package removal" - - # 检查是否已安装texlive-showhyphens-doc包 - LOG_INFO "检查texlive-showhyphens-doc是否已安装" - dnf list installed texlive-showhyphens-doc &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-showhyphens-doc已安装,脚本结束时保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-showhyphens-doc未安装,将在测试后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-showhyphens-doc包 - LOG_INFO "检查yum源中是否有texlive-showhyphens-doc包" - dnf list available texlive-showhyphens-doc &>/dev/null - CHECK_RESULT $? 0 255 "yum源中不存在texlive-showhyphens-doc包" - - # 安装texlive-showhyphens-doc包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-showhyphens-doc包" - dnf install -y texlive-showhyphens-doc - CHECK_RESULT $? 0 0 "安装texlive-showhyphens-doc包失败" - fi - - # 测试texlive-showhyphens命令的参数支持情况 - LOG_INFO "测试texlive-showhyphens命令的参数支持情况" - texlive-showhyphens --help &>/dev/null - CHECK_RESULT $? 0 255 "texlive-showhyphens命令不支持--help参数" - - # 测试完成后恢复环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-showhyphens-doc包" - dnf remove -y texlive-showhyphens-doc - CHECK_RESULT $? 0 0 "卸载texlive-showhyphens-doc包失败" - fi - - LOG_INFO "测试完成:Test package removal" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-x/texlive-tikz-3dplot-doc/test_texlive-tikz-3dplot-doc_function_install.sh b/testcases/function_test/pkg_test/texlive-split-x/texlive-tikz-3dplot-doc/test_texlive-tikz-3dplot-doc_function_install.sh deleted file mode 100644 index 7098c71b0e6..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-x/texlive-tikz-3dplot-doc/test_texlive-tikz-3dplot-doc_function_install.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-03-12 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-tikz-3dplot-doc 软件包的安装功能,验证是否能够通过包管理器成功安装。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试 texlive-tikz-3dplot-doc 软件包的安装功能" - - LOG_INFO "步骤1: 检查 yum 源中是否存在 texlive-tikz-3dplot-doc 软件包" - dnf list available texlive-tikz-3dplot-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-tikz-3dplot-doc 软件包" - exit 255 - fi - LOG_INFO "yum 源中存在 texlive-tikz-3dplot-doc 软件包" - - LOG_INFO "步骤2: 检查当前环境是否已安装 texlive-tikz-3dplot-doc 软件包" - rpm -q texlive-tikz-3dplot-doc > /dev/null 2>&1 - INSTALLED=$? - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "当前环境已安装 texlive-tikz-3dplot-doc 软件包,测试将验证已安装状态" - NEED_CLEANUP=0 - else - LOG_INFO "当前环境未安装 texlive-tikz-3dplot-doc 软件包,将执行安装测试" - NEED_CLEANUP=1 - fi - - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "步骤3: 安装 texlive-tikz-3dplot-doc 软件包" - dnf install -y texlive-tikz-3dplot-doc - CHECK_RESULT $? 0 0 "安装 texlive-tikz-3dplot-doc 软件包失败" - LOG_INFO "texlive-tikz-3dplot-doc 软件包安装成功" - fi - - LOG_INFO "步骤4: 验证 texlive-tikz-3dplot-doc 软件包已正确安装" - rpm -q texlive-tikz-3dplot-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证 texlive-tikz-3dplot-doc 软件包安装状态失败" - LOG_INFO "验证 texlive-tikz-3dplot-doc 软件包安装状态成功" - - LOG_INFO "步骤5: 执行基本功能验证(例如检查文档文件是否存在)" - rpm -ql texlive-tikz-3dplot-doc | grep -q "\.pdf$" || rpm -ql texlive-tikz-3dplot-doc | grep -q "\.tex$" - CHECK_RESULT $? 0 0 "在 texlive-tikz-3dplot-doc 软件包中未找到预期的文档文件" - LOG_INFO "基本功能验证成功" - - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "步骤6: 清理环境,卸载测试安装的 texlive-tikz-3dplot-doc 软件包" - dnf remove -y texlive-tikz-3dplot-doc - CHECK_RESULT $? 0 0 "卸载 texlive-tikz-3dplot-doc 软件包失败" - LOG_INFO "环境清理完成,texlive-tikz-3dplot-doc 软件包已卸载" - else - LOG_INFO "步骤6: 环境已安装软件包,无需清理,保持安装状态" - fi - - LOG_INFO "测试 texlive-tikz-3dplot-doc 软件包的安装功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-shortmathj/test_texlive-shortmathj_function_install.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-shortmathj/test_texlive-shortmathj_function_install.sh deleted file mode 100644 index f53ac664c44..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-shortmathj/test_texlive-shortmathj_function_install.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : test installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已经安装texlive-shortmathj - LOG_INFO "检查是否已经安装texlive-shortmathj" - rpm -q texlive-shortmathj > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-shortmathj已经安装,脚本结束时保持安装状态" - installed=true - else - installed=false - fi - - # 检查yum源中是否有texlive-shortmathj软件包 - LOG_INFO "检查yum源中是否有texlive-shortmathj软件包" - dnf list available texlive-shortmathj > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有texlive-shortmathj软件包" - exit 255 - fi - - # 安装texlive-shortmathj - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-shortmathj" - dnf install -y texlive-shortmathj > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-shortmathj失败" - LOG_INFO "texlive-shortmathj安装成功" - fi - - # 测试texlive-shortmathj功能是否正常 - LOG_INFO "测试texlive-shortmathj功能是否正常" - # 假设测试命令为shortmathj --version,这里仅为示例,实际命令需替换为真实命令 - shortmathj --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-shortmathj功能测试失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-shortmathj以恢复环境" - dnf remove -y texlive-shortmathj > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-shortmathj失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-ucsmonograph/test_texlive-ucsmonograph_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-ucsmonograph/test_texlive-ucsmonograph_function_basic.sh deleted file mode 100644 index 56daa75f644..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-ucsmonograph/test_texlive-ucsmonograph_function_basic.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Basic functionality test for texlive-ucsmonograph -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-ucsmonograph 的基本功能" - - # 检查是否已安装 texlive-ucsmonograph - if dnf list installed texlive-ucsmonograph &>/dev/null; then - LOG_INFO "texlive-ucsmonograph 已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ucsmonograph 未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 texlive-ucsmonograph 软件包 - if ! dnf list available texlive-ucsmonograph &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-ucsmonograph 软件包" - exit 255 - fi - - # 安装 texlive-ucsmonograph - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 texlive-ucsmonograph" - dnf install -y texlive-ucsmonograph - CHECK_RESULT $? 0 0 "安装 texlive-ucsmonograph 失败" - fi - - # 测试 texlive-ucsmonograph 的基本功能 - LOG_INFO "测试 texlive-ucsmonograph 的基本功能" - texlive-ucsmonograph --version - CHECK_RESULT $? 0 0 "texlive-uxcsmongraph --version 执行失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载 texlive-ucsmonograph" - dnf remove -y texlive-ucsmonograph - CHECK_RESULT $? 0 0 "卸载 texlive-ucsmongrapha失败" - fi - - LOG_INFO "texlikee-uscmongraph基本功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-ucsmonograph/test_texlive-ucsmonograph_function_basic_compile.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-ucsmonograph/test_texlive-ucsmonograph_function_basic_compile.sh deleted file mode 100644 index 3b1e68c2fbf..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-ucsmonograph/test_texlive-ucsmonograph_function_basic_compile.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-03-19 -# @License : Mulan PSL v2 -# @Desc : Test basic document compilation using the ucsmonograph document class. -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称和命令 - PACKAGE_NAME="texlive-ucsmonograph" - TEST_FILE="test_ucsmonograph.tex" - EXPECTED_PDF="test_ucsmonograph.pdf" - - # 步骤1: 检查yum源中是否存在指定软件包 - LOG_INFO "步骤1: 检查yum源中是否存在${PACKAGE_NAME}软件包" - dnf list available ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - - # 步骤2: 检查系统是否已安装该软件包 - LOG_INFO "步骤2: 检查系统是否已安装${PACKAGE_NAME}软件包" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - PACKAGE_INSTALLED=$? - - # 步骤3: 如果未安装,则安装软件包 - if [ ${PACKAGE_INSTALLED} -ne 0 ]; then - LOG_INFO "步骤3: 安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败" - NEW_INSTALL=1 - else - LOG_INFO "步骤3: 软件包已安装,跳过安装步骤" - NEW_INSTALL=0 - fi - - # 步骤4: 创建测试LaTeX文档 - LOG_INFO "步骤4: 创建测试LaTeX文档" - cat > ${TEST_FILE} << "EOF" - \documentclass{ucsmonograph} - \begin{document} - \title{测试文档} - \author{测试作者} - \date{\today} - \maketitle - \chapter{测试章节} - 这是一个使用ucsmonograph文档类的基本编译测试。 - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 步骤5: 使用pdflatex编译文档 - LOG_INFO "步骤5: 使用pdflatex编译文档" - pdflatex -interaction=nonstopmode ${TEST_FILE} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pdflatex编译失败" - - # 步骤6: 检查生成的PDF文件 - LOG_INFO "步骤6: 检查生成的PDF文件" - if [ -f "${EXPECTED_PDF}" ]; then - LOG_INFO "PDF文件生成成功: ${EXPECTED_PDF}" - # 检查PDF文件是否有效 - file "${EXPECTED_PDF}" | grep -q "PDF document" - CHECK_RESULT $? 0 0 "生成的PDF文件无效" - else - LOG_ERROR "未找到生成的PDF文件" - exit 1 - fi - - # 步骤7: 清理临时文件 - LOG_INFO "步骤7: 清理临时文件" - rm -f test_ucsmonograph.aux test_ucsmonograph.log test_ucsmonograph.out test_ucsmonograph.toc - - # 步骤8: 环境恢复 - LOG_INFO "步骤8: 环境恢复" - if [ ${NEW_INSTALL} -eq 1 ]; then - LOG_INFO "卸载新安装的软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败" - else - LOG_INFO "软件包为预先安装,保持安装状态" - fi - - # 步骤9: 清理测试文件 - LOG_INFO "步骤9: 清理测试文件" - rm -f ${TEST_FILE} ${EXPECTED_PDF} - - LOG_INFO "测试完成: ucsmonograph文档类基本编译测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-ucsmonograph/test_texlive-ucsmonograph_function_doc_available.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-ucsmonograph/test_texlive-ucsmonograph_function_doc_available.sh deleted file mode 100644 index 478cec26b96..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-ucsmonograph/test_texlive-ucsmonograph_function_doc_available.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-19 -# @License : Mulan PSL v2 -# @Desc : Check if the package documentation is installed and accessible. -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:检查texlive-ucsmonograph软件包的文档是否安装并可访问" - - # 定义软件包名称 - PACKAGE_NAME="texlive-ucsmonograph" - DOC_PACKAGE_NAME="${PACKAGE_NAME}-doc" - - # 步骤1:检查软件包是否已在yum源中 - LOG_INFO "步骤1:检查${PACKAGE_NAME}和${DOC_PACKAGE_NAME}是否在yum源中" - dnf list available ${PACKAGE_NAME} ${DOC_PACKAGE_NAME} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包${PACKAGE_NAME}或${DOC_PACKAGE_NAME}不在yum源中" - exit 255 - fi - - # 步骤2:检查当前是否已安装软件包 - LOG_INFO "步骤2:检查当前是否已安装${PACKAGE_NAME}和${DOC_PACKAGE_NAME}" - INSTALLED=0 - rpm -q ${PACKAGE_NAME} &>/dev/null && rpm -q ${DOC_PACKAGE_NAME} &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为已安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将进行安装测试" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "步骤3:安装${PACKAGE_NAME}和${DOC_PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} ${DOC_PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4:检查文档文件是否存在 - LOG_INFO "步骤4:检查${DOC_PACKAGE_NAME}的文档文件" - DOC_FILES=$(rpm -ql ${DOC_PACKAGE_NAME} 2>/dev/null | grep -E "\.pdf$|\.html$|\.info$|\.txt$") - if [ -z "${DOC_FILES}" ]; then - LOG_ERROR "未找到${DOC_PACKAGE_NAME}的文档文件" - exit 1 - fi - - # 步骤5:验证文档文件可访问性 - LOG_INFO "步骤5:验证文档文件可访问性" - for DOC_FILE in ${DOC_FILES}; do - if [ -f "${DOC_FILE}" ] && [ -r "${DOC_FILE}" ]; then - LOG_INFO "文档文件 ${DOC_FILE} 存在且可读" - else - LOG_ERROR "文档文件 ${DOC_FILE} 不存在或不可读" - exit 1 - fi - done - - # 步骤6:清理环境(如果测试前未安装) - LOG_INFO "步骤6:清理测试环境" - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y ${PACKAGE_NAME} ${DOC_PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "测试前软件包已安装,保持安装状态" - fi - - LOG_INFO "测试完成:texlive-ucsmonograph软件包的文档已安装并可正常访问" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-multicolrule/test_texlive-multicolrule_function_basic_rule.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-multicolrule/test_texlive-multicolrule_function_basic_rule.sh deleted file mode 100644 index 95ba8966775..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-multicolrule/test_texlive-multicolrule_function_basic_rule.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-19 -# @License : Mulan PSL v2 -# @Desc : Test basic multicolumn rule drawing with default settings -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test basic multicolumn rule drawing with default settings" - - LOG_INFO "步骤1:检查系统中是否已安装texlive-multicolrule软件包" - rpm -q texlive-multicolrule > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-multicolrule已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-multicolrule未安装,将在测试前安装,测试结束后卸载" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查yum源中是否有texlive-multicolrule软件包" - dnf list available texlive-multicolrule > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-multicolrule软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-multicolrule软件包,退出测试" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-multicolrule软件包" - dnf install -y texlive-multicolrule > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-multicolrule软件包失败" - fi - - LOG_INFO "步骤4:检查multicolrule命令是否支持基本参数" - multicolrule --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "multicolrule命令不支持--help参数或命令不存在" - - LOG_INFO "步骤5:执行基本的multicolumn rule绘制测试" - multicolrule --output test_rule.pdf --width 10 --height 5 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行multicolrule命令绘制基本规则失败" - - LOG_INFO "步骤6:验证生成的PDF文件是否存在" - if [ -f test_rule.pdf ]; then - LOG_INFO "成功生成test_rule.pdf文件" - rm -f test_rule.pdf - else - LOG_ERROR "未找到生成的test_rule.pdf文件" - exit 1 - fi - - LOG_INFO "步骤7:清理测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-multicolrule软件包" - dnf remove -y texlive-multicolrule > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-multicolrule软件包失败" - else - LOG_INFO "保持texlive-multicolrule软件包安装状态" - fi - - LOG_INFO "测试完成:Test basic multicolumn rule drawing with default settings" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-multicolrule/test_texlive-multicolrule_function_check.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-multicolrule/test_texlive-multicolrule_function_check.sh deleted file mode 100644 index 4279b5be87a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-multicolrule/test_texlive-multicolrule_function_check.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-19 -# @License : Mulan PSL v2 -# @Desc : Test if the texlive-multicolrule package is installed on the system -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:检查系统是否安装了 texlive-multicolrule 软件包" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查 yum 源中是否存在 texlive-multicolrule 软件包" - dnf list available texlive-multicolrule &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-multicolrule 软件包" - exit 255 - fi - - # 检查当前系统是否已安装 texlive-multicolrule - LOG_INFO "检查系统是否已安装 texlive-multicolrule" - rpm -q texlive-multicolrule &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-multicolrule 已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-multicolrule 未安装,将执行安装步骤" - INSTALLED=0 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 texlive-multicolrule 软件包" - dnf install -y texlive-multicolrule - CHECK_RESULT $? 0 0 "安装 texlive-multicolrule 失败" - fi - - # 验证软件包安装成功 - LOG_INFO "验证 texlive-multicolrule 软件包安装成功" - rpm -q texlive-multicolrule - CHECK_RESULT $? 0 0 "texlive-multicolrule 软件包验证失败" - - # 测试软件包功能(示例:检查某个命令是否存在) - LOG_INFO "测试 texlive-multicolrule 提供的命令" - # 这里假设 texlive-multicolrule 安装后会提供 "multicolrule" 命令 - # 如果命令不存在,则退出 - command -v multicolrule &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-multicolrule 未提供预期的命令" - exit 255 - fi - - # 测试命令参数(示例:检查命令是否支持 --help 参数) - LOG_INFO "测试 texlive-multicolrule 命令参数支持" - multicolrule --help &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-multicolrule 命令不支持 --help 参数" - exit 255 - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 texlive-multicolrule 软件包" - dnf remove -y texlive-multicolrule - CHECK_RESULT $? 0 0 "卸载 texlive-multicolrule 失败" - LOG_INFO "环境已恢复,texlive-multicolrule 已卸载" - else - LOG_INFO "环境已恢复,保持 texlive-multicolrule 安装状态" - fi - - LOG_INFO "测试完成:texlive-multicolrule 软件包功能检查通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-multicolrule/test_texlive-multicolrule_function_rule_color.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-multicolrule/test_texlive-multicolrule_function_rule_color.sh deleted file mode 100644 index 0caed98b9bc..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-multicolrule/test_texlive-multicolrule_function_rule_color.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-03-19 -# @License : Mulan PSL v2 -# @Desc : Test setting custom color for the multicolumn rule -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:设置多列规则的自定义颜色" - LOG_INFO "步骤1:检查环境中是否已安装texlive-multicolrule软件包" - rpm -q texlive-multicolrule > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-multicolrule已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-multicolrule未安装,将在测试过程中安装" - INSTALLED=0 - fi - - LOG_INFO "步骤2:检查yum源中是否存在texlive-multicolrule软件包" - dnf list available texlive-multicolrule > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到texlive-multicolrule软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-multicolrule软件包,退出测试" - exit 255 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-multicolrule软件包" - dnf install -y texlive-multicolrule > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-multicolrule软件包失败" - fi - - LOG_INFO "步骤4:测试设置自定义颜色参数" - LOG_INFO "执行命令测试自定义颜色参数" - texlive-multicolrule --color red > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "不支持自定义颜色参数" - - LOG_INFO "步骤5:测试不存在的参数" - LOG_INFO "执行命令测试不存在的参数" - texlive-multicolrule --invalid-param > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "参数不存在或不支持,符合预期" - else - LOG_ERROR "参数不存在或不支持,但命令未返回255退出码" - exit 255 - fi - - LOG_INFO "步骤6:清理测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的texlive-multicolrule软件包" - dnf remove -y texlive-multicolrule > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-multicolrule软件包失败" - else - LOG_INFO "保持原有的texlive-multicolrule安装状态" - fi - - LOG_INFO "测试完成:设置多列规则的自定义颜色" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-multicolrule/test_texlive-multicolrule_function_rule_position.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-multicolrule/test_texlive-multicolrule_function_rule_position.sh deleted file mode 100644 index 59f45391a38..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-multicolrule/test_texlive-multicolrule_function_rule_position.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-19 -# @License : Mulan PSL v2 -# @Desc : Test adjusting the position of the rule between columns -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test adjusting the position of the rule between columns" - LOG_INFO "步骤1:检查texlive-multicolrule软件包是否在yum源中" - dnf list available texlive-multicolrule > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-multicolrule软件包不在yum源中" - exit 255 - fi - LOG_INFO "texlive-multicolrule软件包在yum源中" - - LOG_INFO "步骤2:检查是否已安装texlive-multicolrule" - rpm -q texlive-multicolrule > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-multicolrule已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-multicolrule未安装,将进行安装" - INSTALLED=0 - fi - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-multicolrule软件包" - dnf install -y texlive-multicolrule - CHECK_RESULT $? 0 0 "安装texlive-multicolrule失败" - LOG_INFO "安装texlive-multicolrule成功" - fi - - LOG_INFO "步骤4:测试调整列间规则位置的功能" - LOG_INFO "执行测试命令,验证规则位置调整参数" - if ! command -v multicolrule > /dev/null 2>&1; then - LOG_ERROR "multicolrule命令不存在" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texlive-multicolrule - fi - exit 255 - fi - - LOG_INFO "检查multicolrule命令是否支持位置参数" - multicolrule --help 2>&1 | grep -q "position" - if [ $? -ne 0 ]; then - LOG_ERROR "multicolrule命令不支持位置参数" - if [ $INSTALLED -eq 0 ]; then - dnf remove -y texlive-multicolrule - fi - exit 255 - fi - LOG_INFO "multicolrule命令支持位置参数" - - LOG_INFO "步骤5:执行具体的规则位置调整测试" - multicolrule --position=center - CHECK_RESULT $? 0 0 "调整规则位置到中间失败" - LOG_INFO "调整规则位置到中间成功" - - LOG_INFO "步骤6:清理测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-multicolrule软件包" - dnf remove -y texlive-multicolrule - CHECK_RESULT $? 0 0 "卸载texlive-multicolrule失败" - LOG_INFO "卸载texlive-multicolrule成功" - else - LOG_INFO "测试前已安装texlive-multicolrule,保持安装状态" - fi - - LOG_INFO "测试完成:Test adjusting the position of the rule between columns" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-multicolrule/test_texlive-multicolrule_function_rule_style.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-multicolrule/test_texlive-multicolrule_function_rule_style.sh deleted file mode 100644 index fbf97735568..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-multicolrule/test_texlive-multicolrule_function_rule_style.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-19 -# @License : Mulan PSL v2 -# @Desc : Test applying different line styles to the rule -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test applying different line styles to the rule" - - # 定义软件包名称 - PACKAGE_NAME="texlive-multicolrule" - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - dnf list available "$PACKAGE_NAME" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 步骤2:检查环境是否已安装该软件包 - LOG_INFO "步骤2:检查环境是否已安装该软件包" - if rpm -q "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试步骤中安装" - INSTALLED_BEFORE=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:检查指定命令的参数是否存在或支持 - LOG_INFO "步骤4:检查指定命令的参数是否存在或支持" - # 假设测试命令为 "multicolrule",参数为 "--style" - TEST_COMMAND="multicolrule" - TEST_PARAM="--style" - # 检查命令是否存在 - if ! command -v "$TEST_COMMAND" &>/dev/null; then - LOG_ERROR "命令 $TEST_COMMAND 不存在" - exit 255 - fi - # 检查参数是否支持(这里假设通过 "--help" 查看) - if ! "$TEST_COMMAND" --help 2>&1 | grep -q "$TEST_PARAM"; then - LOG_ERROR "参数 $TEST_PARAM 不支持" - exit 255 - fi - - # 步骤5:执行测试命令 - LOG_INFO "步骤5:执行测试命令:$TEST_COMMAND $TEST_PARAM solid" - "$TEST_COMMAND" "$TEST_PARAM" solid - CHECK_RESULT $? 0 0 "执行命令 $TEST_COMMAND $TEST_PARAM solid 失败" - - LOG_INFO "步骤5:执行测试命令:$TEST_COMMAND $TEST_PARAM dashed" - "$TEST_COMMAND" "$TEST_PARAM" dashed - CHECK_RESULT $? 0 0 "执行命令 $TEST_COMMAND $TEST_PARAM dashed 失败" - - LOG_INFO "步骤5:执行测试命令:$TEST_COMMAND $TEST_PARAM dotted" - "$TEST_COMMAND" "$TEST_PARAM" dotted - CHECK_RESULT $? 0 0 "执行命令 $TEST_COMMAND $TEST_PARAM dotted 失败" - - # 步骤6:如果需要,在第二个服务器上执行命令 - LOG_INFO "步骤6:在第二个服务器上执行命令" - SSH_CMD "ls" "$NODE2_IPV4" "$NODE2_PASSWORD" "$NODE2_USER" - CHECK_RESULT $? 0 0 "在第二个服务器上执行命令失败" - - # 步骤7:清理环境,恢复到之前的状态 - LOG_INFO "步骤7:清理环境,恢复到之前的状态" - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "软件包 $PACKAGE_NAME 在测试前已安装,保持安装状态" - fi - - LOG_INFO "测试完成:Test applying different line styles to the rule" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-z/texlive-multicolrule/test_texlive-multicolrule_function_rule_width.sh b/testcases/function_test/pkg_test/texlive-split-z/texlive-multicolrule/test_texlive-multicolrule_function_rule_width.sh deleted file mode 100644 index 5e376133645..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-z/texlive-multicolrule/test_texlive-multicolrule_function_rule_width.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-19 -# @License : Mulan PSL v2 -# @Desc : Test setting custom width for the multicolumn rule -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test setting custom width for the multicolumn rule" - - LOG_INFO "步骤1: 检查系统中是否已安装texlive-multicolrule软件包" - if rpm -q texlive-multicolrule &>/dev/null; then - LOG_INFO "texlive-multicolrule已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texlive-multicolrule未安装,将在测试过程中安装,并在测试结束后卸载" - INSTALLED_BEFORE=false - fi - - LOG_INFO "步骤2: 检查yum源中是否存在texlive-multicolrule软件包" - if ! dnf list available texlive-multicolrule &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-multicolrule软件包" - exit 255 - fi - - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3: 安装texlive-multicolrule软件包" - dnf install -y texlive-multicolrule - CHECK_RESULT $? 0 0 "安装texlive-multicolrule失败" - fi - - LOG_INFO "步骤4: 测试设置自定义multicolumn规则宽度功能" - LOG_INFO "步骤4.1: 创建测试LaTeX文档" - cat > test_multicolrule.tex << "EOF" - \documentclass{article} - \usepackage{multicolrule} - \begin{document} - \setlength{\multicolrulewidth}{2pt} - \begin{multicols}{2} - Column 1 text here. - \columnbreak - Column 2 text here. - \end{multicols} - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败" - - LOG_INFO "步骤4.2: 使用pdflatex编译测试文档" - pdflatex -interaction=nonstopmode test_multicolrule.tex - CHECK_RESULT $? 0 0 "编译LaTeX文档失败" - - LOG_INFO "步骤4.3: 检查生成的PDF文件" - if [ -f test_multicolrule.pdf ]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件生成失败" - exit 1 - fi - - LOG_INFO "步骤5: 清理测试文件" - rm -f test_multicolrule.tex test_multicolrule.pdf test_multicolrule.log test_multicolrule.aux - - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤6: 卸载texlive-multicolrule软件包" - dnf remove -y texlive-multicolrule - CHECK_RESULT $? 0 0 "卸载texlive-multicolrule失败" - fi - - LOG_INFO "测试完成:Test setting custom width for the multicolumn rule" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/yecht/yecht-javadoc/test_yecht-javadoc_function_generate.sh b/testcases/function_test/pkg_test/yecht/yecht-javadoc/test_yecht-javadoc_function_generate.sh deleted file mode 100644 index 40c24751de9..00000000000 --- a/testcases/function_test/pkg_test/yecht/yecht-javadoc/test_yecht-javadoc_function_generate.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : Test the generation of javadoc documentation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试生成javadoc文档的功能" - - # 检查是否已安装javadoc相关软件包 - LOG_INFO "检查是否已安装javadoc相关软件包" - if dnf list installed java-devel >/dev/null 2>&1; then - LOG_INFO "java-devel已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "java-devel未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查yum源中是否有java-devel软件包 - LOG_INFO "检查yum源中是否有java-devel软件包" - if ! dnf list available java-devel >/dev/null 2>&1; then - LOG_ERROR "yum源中没有java-devel软件包" - exit 255 - fi - - # 如果未安装,则安装java-devel - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装java-devel软件包" - dnf install -y java-devel - CHECK_RESULT $? 0 0 "安装java-devel失败" - fi - - # 测试生成javadoc文档的功能 - LOG_INFO "测试生成javadoc文档的功能" - javadoc -d /tmp/javadoc -sourcepath . -subpackages . - CHECK_RESULT $? 0 0 "生成javadoc文档失败" - - # 清理环境:如果之前未安装,则卸载java-devel - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载java-devel软件包" - dnf remove -y java-devel - CHECK_RESULT $? 0 0 "卸载java-devel失败" - fi - - LOG_INFO "测试完成:生成javadoc文档的功能测试完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/yecht/yecht-javadoc/test_yecht-javadoc_function_validate.sh b/testcases/function_test/pkg_test/yecht/yecht-javadoc/test_yecht-javadoc_function_validate.sh deleted file mode 100644 index 21c15bfe197..00000000000 --- a/testcases/function_test/pkg_test/yecht/yecht-javadoc/test_yecht-javadoc_function_validate.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-10 -# @License : Mulan PSL v2 -# @Desc : Test the validation of javadoc content -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试脚本:test_yecht-javadoc_function_validate - - # 步骤1:检查是否已安装javadoc软件包 - LOG_INFO "检查是否已安装javadoc软件包" - if dnf list installed javadoc &>/dev/null; then - LOG_INFO "javadoc已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "javadoc未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 步骤2:检查yum源中是否存在javadoc软件包 - LOG_INFO "检查yum源中是否存在javadoc软件包" - if ! dnf list available javadoc &>/dev/null; then - LOG_ERROR "yum源中未找到javadoc软件包" - exit 255 - fi - - # 步骤3:安装javadoc软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装javadoc软件包" - dnf install -y javadoc - CHECK_RESULT $? 0 0 "安装javadoc失败" - fi - - # 步骤4:验证javadoc命令是否支持指定参数 - LOG_INFO "验证javadoc命令是否支持指定参数" - if ! javadoc -help | grep -q "usage"; then - LOG_ERROR "javadoc命令不支持-help参数" - exit 255 - fi - - # 步骤5:执行javadoc命令并验证内容有效性 - LOG_INFO "执行javadoc命令并验证内容有效性" - mkdir -p test_output - javadoc -d test_output -sourcepath . -subpackages . - CHECK_RESULT $? 0 0 "javadoc生成文档失败" - - # 步骤6:检查生成的文档内容 - LOG_INFO "检查生成的文档内容" - if [ ! -f "test_output/index.html" ]; then - LOG_ERROR "未生成预期的index.html文件" - exit 1 - fi - - # 步骤7:清理测试环境 - LOG_INFO "清理测试环境" - rm -rf test_output - - # 步骤8:如果脚本开始时未安装javadoc,则卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载javadoc软件包" - dnf remove -y javadoc - CHECK_RESULT $? 0 0 "卸载javadoc失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file