diff --git a/suite2cases/function_test/pkg_test/docbook-utils/docbook-utils-pdf.json b/suite2cases/function_test/pkg_test/docbook-utils/docbook-utils-pdf.json index f360d47dd22..440881f6b2b 100644 --- a/suite2cases/function_test/pkg_test/docbook-utils/docbook-utils-pdf.json +++ b/suite2cases/function_test/pkg_test/docbook-utils/docbook-utils-pdf.json @@ -10,50 +10,6 @@ "name": "test_docbook-utils-pdf_db2dvi__v", "desc": "测试db2dvi命令的版本选项" }, - { - "name": "test_docbook-utils-pdf_db2pdf_f", - "desc": "测试使用 -f 参数指定前端格式" - }, - { - "name": "test_docbook-utils-pdf_db2pdf_b", - "desc": "测试使用 -b 参数指定后端格式" - }, - { - "name": "test_docbook-utils-pdf_db2pdf_c", - "desc": "测试使用 -c 参数指定额外的 SGML 开放目录" - }, - { - "name": "test_docbook-utils-pdf_db2pdf_n", - "desc": "测试使用 -n 参数不使用标准 SGML 开放目录" - }, - { - "name": "test_docbook-utils-pdf_db2pdf_d", - "desc": "测试使用 -d 参数指定替代样式表" - }, - { - "name": "test_docbook-utils-pdf_db2pdf_l", - "desc": "测试使用 -l 参数指定替代 SGML 声明" - }, - { - "name": "test_docbook-utils-pdf_db2pdf_s", - "desc": "测试使用 -s 参数更改 SGML 分发的基础目录" - }, - { - "name": "test_docbook-utils-pdf_db2pdf_p", - "desc": "测试使用 -p 参数指定解析器程序" - }, - { - "name": "test_docbook-utils-pdf_db2pdf_o", - "desc": "测试使用 -o 参数设置输出目录" - }, - { - "name": "test_docbook-utils-pdf_db2pdf_u", - "desc": "测试使用 -u 参数仅输出一个大文件,覆盖样式表设置" - }, - { - "name": "test_docbook-utils-pdf_db2ps__v", - "desc": "测试 db2ps 命令的版本信息参数" - }, { "name": "test_docbook-utils-pdf_docbook2dvi__h", "desc": "测试 docbook2dvi 命令的帮助选项" @@ -77,26 +33,6 @@ { "name": "test_docbook-utils-pdf_docbook2ps__h", "desc": "测试 docbook2ps 的帮助信息参数" - }, - { - "name": "test_docbook-utils-pdf_function_db2pdf_conversion", - "desc": "测试db2pdf命令的文档转换功能" - }, - { - "name": "test_docbook-utils-pdf_function_db2ps_output", - "desc": "测试db2ps命令的输出功能" - }, - { - "name": "test_docbook-utils-pdf_function_docbook2dvi", - "desc": "测试docbook2dvi命令的基本功能" - }, - { - "name": "test_docbook-utils-pdf_function_docbook2ps", - "desc": "测试docbook2ps命令的基本功能" - }, - { - "name": "test_docbook-utils-pdf_function_error_handling", - "desc": "测试错误输入的处理能力" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/fence-agents/fence-agents-rsa.json b/suite2cases/function_test/pkg_test/fence-agents/fence-agents-rsa.json index 7af6a20c9d1..4f2a95b4d6b 100644 --- a/suite2cases/function_test/pkg_test/fence-agents/fence-agents-rsa.json +++ b/suite2cases/function_test/pkg_test/fence-agents/fence-agents-rsa.json @@ -2,10 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/fence-agents/fence-agents-rsa", "machine num": 1, "cases": [ - { - "name": "test_fence-agents-rsa_function_health", - "desc": "Test the health check functionality of fence-agents-rsa" - }, { "name": "test_fence-agents-rsa_function_install", "desc": "Test the installation process of the fence-agents-rsa package" @@ -17,14 +13,6 @@ { "name": "test_fence-agents-rsa_function_uninstall", "desc": "Test the removal process of the fence-agents-rsa package" - }, - { - "name": "test_fence-agents-rsa_function_usage", - "desc": "Test the basic usage and help output of fence-agents-rsa" - }, - { - "name": "test_fence-agents-rsa_function_config", - "desc": "Test the configuration file handling for fence-agents-rsa" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/glassfish-management-api/glassfish-management-api-javadoc.json b/suite2cases/function_test/pkg_test/glassfish-management-api/glassfish-management-api-javadoc.json index 9be057f18f2..6c344954bb5 100644 --- a/suite2cases/function_test/pkg_test/glassfish-management-api/glassfish-management-api-javadoc.json +++ b/suite2cases/function_test/pkg_test/glassfish-management-api/glassfish-management-api-javadoc.json @@ -6,18 +6,6 @@ "name": "test_glassfish-management-api-javadoc_upgrade", "desc": "测试glassfish-management-api-javadoc软件包的升级功能,验证升级是否成功。", "machine num": 1 - }, - { - "name": "test_glassfish-management-api-javadoc_function_install", - "desc": "测试glassfish-management-api-javadoc软件包的安装功能,验证安装是否成功。" - }, - { - "name": "test_glassfish-management-api-javadoc_function_docs", - "desc": "测试glassfish-management-api-javadoc软件包的文档生成功能,验证文档是否完整。" - }, - { - "name": "test_glassfish-management-api-javadoc_function_config", - "desc": "测试glassfish-management-api-javadoc软件包的配置功能,验证配置是否正确。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/glassfish-servlet-api/glassfish-servlet-api-help.json b/suite2cases/function_test/pkg_test/glassfish-servlet-api/glassfish-servlet-api-help.json index 5ab575bc5a0..72fc659f5de 100644 --- a/suite2cases/function_test/pkg_test/glassfish-servlet-api/glassfish-servlet-api-help.json +++ b/suite2cases/function_test/pkg_test/glassfish-servlet-api/glassfish-servlet-api-help.json @@ -5,10 +5,6 @@ { "name": "test_glassfish-servlet-api-help_function_install", "desc": "Test package installation" - }, - { - "name": "test_glassfish-servlet-api-help_function_validate", - "desc": "Test package validation" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/jandex-maven-plugin/jandex-maven-plugin-help.json b/suite2cases/function_test/pkg_test/jandex-maven-plugin/jandex-maven-plugin-help.json deleted file mode 100644 index b1076777600..00000000000 --- a/suite2cases/function_test/pkg_test/jandex-maven-plugin/jandex-maven-plugin-help.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/jandex-maven-plugin/jandex-maven-plugin-help", - "machine num": 1, - "cases": [ - { - "name": "test_jandex-maven-plugin-help_function_basic", - "desc": "Test basic functionality of jandex-maven-plugin-help" - }, - { - "name": "test_jandex-maven-plugin-help_function_config", - "desc": "Test config handling of jandex-maven-plugin-help" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/lorax/lorax-composer.json b/suite2cases/function_test/pkg_test/lorax/lorax-composer.json index 4954d5b8aa4..f80016114d9 100644 --- a/suite2cases/function_test/pkg_test/lorax/lorax-composer.json +++ b/suite2cases/function_test/pkg_test/lorax/lorax-composer.json @@ -5,26 +5,6 @@ { "name": "test_lorax-composer_function_service", "desc": "Test service start/stop" - }, - { - "name": "test_lorax-composer_function_install", - "desc": "Test package installation via dnf" - }, - { - "name": "test_lorax-composer_function_uninstall", - "desc": "Test package removal via dnf" - }, - { - "name": "test_lorax-composer_function_service_status", - "desc": "Test service status and enablement" - }, - { - "name": "test_lorax-composer_function_basic_usage", - "desc": "Test basic command line usage (e.g., --help, list-templates)" - }, - { - "name": "test_lorax-composer_function_image_build", - "desc": "Test simple OS image creation" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/perl-YAML/perl-YAML-help.json b/suite2cases/function_test/pkg_test/perl-YAML/perl-YAML-help.json index 25a8b7d186e..a1334ab7d2f 100644 --- a/suite2cases/function_test/pkg_test/perl-YAML/perl-YAML-help.json +++ b/suite2cases/function_test/pkg_test/perl-YAML/perl-YAML-help.json @@ -9,14 +9,6 @@ { "name": "test_perl-YAML-help_remove", "desc": "测试 perl-YAML-help 软件包的卸载功能,验证其能否被完全、干净地从系统中移除。" - }, - { - "name": "test_perl-YAML-help_basic_usage", - "desc": "测试 perl-YAML-help 软件包的基本用法,例如运行其提供的帮助命令(如 --help 或 man 手册),验证其核心功能可用。" - }, - { - "name": "test_perl-YAML-help_file_exist", - "desc": "测试 perl-YAML-help 软件包安装后,其核心文档或帮助文件(如手册页、README)是否存在于预期的系统路径中。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-yubico/python-yubico-help.json b/suite2cases/function_test/pkg_test/python-yubico/python-yubico-help.json deleted file mode 100644 index 57095b33ca1..00000000000 --- a/suite2cases/function_test/pkg_test/python-yubico/python-yubico-help.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/python-yubico/python-yubico-help", - "machine num": 1, - "cases": [ - { - "name": "test_python-yubico-help_function_init", - "desc": "Test initialization of python-yubico-help" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/qpid-proton/qpid-proton-c-help.json b/suite2cases/function_test/pkg_test/qpid-proton/qpid-proton-c-help.json deleted file mode 100644 index 473aa6ac316..00000000000 --- a/suite2cases/function_test/pkg_test/qpid-proton/qpid-proton-c-help.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/qpid-proton/qpid-proton-c-help", - "machine num": 1, - "cases": [ - { - "name": "test_qpid-proton-c-help_function_basic", - "desc": "Verify basic help functionality" - }, - { - "name": "test_qpid-proton-c-help_function_version", - "desc": "Check version information" - }, - { - "name": "test_qpid-proton-c-help_function_usage", - "desc": "Validate usage instructions" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/qt5-qtnetworkauth/qt5-qtnetworkauth-devel.json b/suite2cases/function_test/pkg_test/qt5-qtnetworkauth/qt5-qtnetworkauth-devel.json deleted file mode 100644 index fd50a0da38a..00000000000 --- a/suite2cases/function_test/pkg_test/qt5-qtnetworkauth/qt5-qtnetworkauth-devel.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/qt5-qtnetworkauth/qt5-qtnetworkauth-devel", - "machine num": 1, - "cases": [ - { - "name": "test_qt5-qtnetworkauth-devel_function_auth", - "desc": "Test authentication functionality" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/qt6-qtlocation/qt6-qtlocation-devel.json b/suite2cases/function_test/pkg_test/qt6-qtlocation/qt6-qtlocation-devel.json index 74ab2d9c485..4f088c3e89f 100644 --- a/suite2cases/function_test/pkg_test/qt6-qtlocation/qt6-qtlocation-devel.json +++ b/suite2cases/function_test/pkg_test/qt6-qtlocation/qt6-qtlocation-devel.json @@ -13,26 +13,6 @@ { "name": "test_qt6-qtlocation-devel_function_uninstall", "desc": "Test removal of qt6-qtlocation-devel package" - }, - { - "name": "test_qt6-qtlocation-devel_function_header_files", - "desc": "Test presence of Qt6Location development header files" - }, - { - "name": "test_qt6-qtlocation-devel_function_library_files", - "desc": "Test presence of Qt6Location development library files" - }, - { - "name": "test_qt6-qtlocation-devel_function_cmake_find", - "desc": "Test if CMake can find Qt6Location development package" - }, - { - "name": "test_qt6-qtlocation-devel_function_qmake_use", - "desc": "Test basic project compilation using qmake with QtLocation module" - }, - { - "name": "test_qt6-qtlocation-devel_function_basic_compile", - "desc": "Test compiling a simple program using Qt6Location headers" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/randomizedtesting/randomizedtesting-junit4-maven-plugin.json b/suite2cases/function_test/pkg_test/randomizedtesting/randomizedtesting-junit4-maven-plugin.json index c38dd170b60..5495488b9f9 100644 --- a/suite2cases/function_test/pkg_test/randomizedtesting/randomizedtesting-junit4-maven-plugin.json +++ b/suite2cases/function_test/pkg_test/randomizedtesting/randomizedtesting-junit4-maven-plugin.json @@ -6,18 +6,6 @@ "name": "test_randomizedtesting-junit4-maven-plugin_install", "desc": "测试软件包的安装功能,验证安装过程是否正常完成", "machine num": 1 - }, - { - "name": "test_randomizedtesting-junit4-maven-plugin_function_build", - "desc": "测试软件包的构建功能,验证构建过程是否正常完成" - }, - { - "name": "test_randomizedtesting-junit4-maven-plugin_function_execute", - "desc": "测试软件包的执行功能,验证执行过程是否正常完成" - }, - { - "name": "test_randomizedtesting-junit4-maven-plugin_function_config", - "desc": "测试软件包的配置功能,验证配置是否生效" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/rubygem-ZenTest/rubygem-ZenTest-doc.json b/suite2cases/function_test/pkg_test/rubygem-ZenTest/rubygem-ZenTest-doc.json index e376a7f8d0e..16ea49c8ee8 100644 --- a/suite2cases/function_test/pkg_test/rubygem-ZenTest/rubygem-ZenTest-doc.json +++ b/suite2cases/function_test/pkg_test/rubygem-ZenTest/rubygem-ZenTest-doc.json @@ -2,18 +2,10 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/rubygem-ZenTest/rubygem-ZenTest-doc", "machine num": 1, "cases": [ - { - "name": "test_rubygem-ZenTest-doc_function_install", - "desc": "测试安装软件包" - }, { "name": "test_rubygem-ZenTest-doc_function_uninstall", "desc": "测试卸载软件包" }, - { - "name": "test_rubygem-ZenTest-doc_function_version", - "desc": "测试查看软件包版本" - }, { "name": "test_rubygem-ZenTest-doc_function_list_files", "desc": "测试列出软件包包含的文件" diff --git a/suite2cases/function_test/pkg_test/texlive-split-e/texlive-cinzel-doc.json b/suite2cases/function_test/pkg_test/texlive-split-e/texlive-cinzel-doc.json deleted file mode 100644 index d2dbd96cc35..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-e/texlive-cinzel-doc.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-e/texlive-cinzel-doc", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-cinzel-doc_function_install", - "desc": "测试 texlive-cinzel-doc 软件包能否通过包管理器成功安装" - }, - { - "name": "test_texlive-cinzel-doc_function_check", - "desc": "测试 texlive-cinzel-doc 软件包文档文件在安装后是否存在" - }, - { - "name": "test_texlive-cinzel-doc_function_view", - "desc": "测试 texlive-cinzel-doc 软件包的文档内容能否正常读取" - }, - { - "name": "test_texlive-cinzel-doc_function_uninstall", - "desc": "测试 texlive-cinzel-doc 软件包能否通过包管理器成功卸载" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-k/texlive-hacm.json b/suite2cases/function_test/pkg_test/texlive-split-k/texlive-hacm.json index bda85bb3238..42ceaaf94ac 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-k/texlive-hacm.json +++ b/suite2cases/function_test/pkg_test/texlive-split-k/texlive-hacm.json @@ -15,22 +15,6 @@ { "name": "test_texlive-hacm_function_install", "desc": "测试 texlive-hacm 软件包的安装功能,验证安装过程是否正常完成。" - }, - { - "name": "test_texlive-hacm_function_uninstall", - "desc": "测试 texlive-hacm 软件包的卸载功能,验证卸载过程是否正常完成。" - }, - { - "name": "test_texlive-hacm_function_checkfiles", - "desc": "测试 texlive-hacm 核心文件是否已正确安装到系统路径中。" - }, - { - "name": "test_texlive-hacm_function_latexcompile", - "desc": "测试使用 texlive-hacm 宏包编写并编译一个简单的 LaTeX 文档。" - }, - { - "name": "test_texlive-hacm_function_version", - "desc": "测试 texlive-hacm 宏包的版本信息或可用性检查。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-n/texlive-luaindex.json b/suite2cases/function_test/pkg_test/texlive-split-n/texlive-luaindex.json index 7a93223c0c0..f13eec407c0 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-n/texlive-luaindex.json +++ b/suite2cases/function_test/pkg_test/texlive-split-n/texlive-luaindex.json @@ -6,18 +6,6 @@ "name": "test_texlive-luaindex_uninstall", "desc": "测试texlive-luaindex软件包的卸载功能,验证是否能够成功卸载。", "machine num": 1 - }, - { - "name": "test_texlive-luaindex_function_install", - "desc": "测试texlive-luaindex软件包的安装功能,验证是否能够成功安装到系统中。" - }, - { - "name": "test_texlive-luaindex_function_check", - "desc": "测试检查texlive-luaindex软件包是否已正确安装,验证其核心文件或命令是否存在。" - }, - { - "name": "test_texlive-luaindex_function_usage", - "desc": "测试texlive-luaindex软件包的基本用法,例如通过简单LaTeX文档验证其索引功能是否正常工作。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-o/texlive-memexsupp.json b/suite2cases/function_test/pkg_test/texlive-split-o/texlive-memexsupp.json index 526d4f1033c..a16b1f8f3b1 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-o/texlive-memexsupp.json +++ b/suite2cases/function_test/pkg_test/texlive-split-o/texlive-memexsupp.json @@ -13,10 +13,6 @@ { "name": "test_texlive-memexsupp_function_check", "desc": "Test if texlive-memexsupp package is available in system" - }, - { - "name": "test_texlive-memexsupp_function_use", - "desc": "Test basic usage of memexsupp package" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pst-intersect.json b/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pst-intersect.json deleted file mode 100644 index c37b1a37409..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pst-intersect.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-intersect", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-pst-intersect_function_basic", - "desc": "Basic functionality test" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-x/texlive-simplivre.json b/suite2cases/function_test/pkg_test/texlive-split-x/texlive-simplivre.json deleted file mode 100644 index 2aff64e7abd..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-x/texlive-simplivre.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-x/texlive-simplivre", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-simplivre_function_basic", - "desc": "Test basic functionality of texlive-simplivre" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_b.sh b/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_b.sh deleted file mode 100644 index dc778ecf5ce..00000000000 --- a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_b.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -b 参数指定后端格式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试docbook-utils-pdf的db2pdf命令的-b参数功能" - - # 检查是否已安装docbook-utils-pdf - if ! dnf list installed docbook-utils-pdf &>/dev/null; then - LOG_INFO "未安装docbook-utils-pdf,开始安装" - if ! dnf list available docbook-utils-pdf &>/dev/null; then - LOG_ERROR "yum源中未找到docbook-utils-pdf软件包" - exit 255 - fi - dnf install -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "安装docbook-utils-pdf失败" - INSTALLED=1 - else - LOG_INFO "docbook-utils-pdf已安装" - INSTALLED=0 - fi - - # 测试db2pdf命令的-b参数功能 - LOG_INFO "测试db2pdf命令的-b参数功能" - db2pdf -b invalid_backend test.xml &>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "db2pdf命令未正确处理无效的-b参数" - CHECK_RESULT 1 0 0 "db2pdf命令未正确处理无效的-b参数" - fi - - # 清理环境 - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "卸载docbook-utils-pdf" - dnf remove -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "卸载docbook-utils-pdf失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_c.sh b/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_c.sh deleted file mode 100644 index 96334889acf..00000000000 --- a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_c.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -c 参数指定额外的 SGML 开放目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 test_docbook-utils-pdf_db2pdf_c" - - # 检查是否已安装 docbook-utils-pdf - LOG_INFO "检查是否已安装 docbook-utils-pdf" - if ! dnf list installed docbook-utils-pdf &> /dev/null; then - LOG_INFO "docbook-utils-pdf 未安装,准备安装" - # 检查 yum 源中是否有该软件包 - if ! dnf list available docbook-utils-pdf &> /dev/null; then - LOG_ERROR "yum 源中未找到 docbook-utils-pdf 软件包" - exit 255 - fi - # 安装软件包 - dnf install -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "安装 docbook-utils-pdf 失败" - # 标记为需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "docbook-utils-pdf 已安装" - NEED_UNINSTALL=0 - fi - - # 测试使用 -c 参数指定额外的 SGML 开放目录 - LOG_INFO "测试使用 -c 参数指定额外的 SGML 开放目录" - db2pdf -c /tmp/test_sgml_catalog test_input.sgml &> /dev/null - - # 检查命令执行结果 - CHECK_RESULT $? 0 0 "db2pdf -c 参数测试失败" - - # 清理环境,如果之前未安装则卸载 - if [ $NEED_UNINSTALL -eq 1 ]; then - LOG_INFO "卸载 docbook-utils-pdf" - dnf remove -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "卸载 docbook-utils-pdf 失败" - fi - - LOG_INFO "测试 test_docbook-utils-pdf_db2pdf_c 完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_d.sh b/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_d.sh deleted file mode 100644 index 314521f9ae6..00000000000 --- a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_d.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -d 参数指定替代样式表 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用 -d 参数指定替代样式表" - - # 检查是否已安装docbook-utils-pdf - LOG_INFO "检查是否已安装docbook-utils-pdf" - if ! dnf list installed docbook-utils-pdf &>/dev/null; then - LOG_INFO "docbook-utils-pdf未安装,准备安装" - # 检查yum源中是否有该软件包 - if ! dnf list available docbook-utils-pdf &>/dev/null; then - LOG_ERROR "yum源中未找到docbook-utils-pdf软件包" - exit 255 - fi - # 安装软件包 - dnf install -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "安装docbook-utils-pdf失败" - # 标记为需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "docbook-utils-pdf已安装,无需重复安装" - fi - - # 测试-d参数 - LOG_INFO "测试-d参数指定替代样式表" - db2pdf -d /usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl test.xml &>/dev/null - CHECK_RESULT $? 0 0 "-d参数不支持或执行失败" - - # 清理环境 - if [ "$NEED_UNINSTALL" == "1" ]; then - LOG_INFO "卸载docbook-utils-pdf" - dnf remove -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "卸载docbook-utils-pdf失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_f.sh b/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_f.sh deleted file mode 100644 index 0b7ab85f132..00000000000 --- a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_f.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -f 参数指定前端格式 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装docbook-utils-pdf - LOG_INFO "检查是否已安装docbook-utils-pdf" - if ! dnf list installed docbook-utils-pdf &>/dev/null; then - LOG_INFO "docbook-utils-pdf未安装,将进行安装" - INSTALLED=false - else - LOG_INFO "docbook-utils-pdf已安装" - INSTALLED=true - fi - - # 检查yum源中是否有docbook-utils-pdf软件包 - LOG_INFO "检查yum源中是否有docbook-utils-pdf软件包" - if ! dnf list available docbook-utils-pdf &>/dev/null; then - LOG_ERROR "yum源中未找到docbook-utils-pdf软件包" - exit 255 - fi - - # 如果未安装,则安装docbook-utils-pdf - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装docbook-utils-pdf" - dnf install -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "安装docbook-utils-pdf失败" - fi - - # 测试使用-f参数指定前端格式 - LOG_INFO "测试使用-f参数指定前端格式" - db2pdf -f pdf test.docbook &>/dev/null - CHECK_RESULT $? 0 0 "使用-f参数指定前端格式失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载docbook-utils-pdf" - dnf remove -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "卸载docbook-utils-pdf失败" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_l.sh b/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_l.sh deleted file mode 100644 index 71c8675785d..00000000000 --- a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_l.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -l 参数指定替代 SGML 声明 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试:测试使用 -l 参数指定替代 SGML 声明" - - # 检查软件包是否在yum源中 - LOG_INFO "检查docbook-utils软件包是否在yum源中" - dnf list available docbook-utils > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有docbook-utils软件包" - exit 255 - fi - - # 检查环境是否已安装docbook-utils - LOG_INFO "检查环境是否已安装docbook-utils" - rpm -q docbook-utils > /dev/null 2>&1 - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "docbook-utils已安装,脚本结束后将保持安装状态" - else - installed=false - LOG_INFO "docbook-utils未安装,将在测试步骤中安装" - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装docbook-utils软件包" - dnf install -y docbook-utils - CHECK_RESULT $? 0 0 "安装docbook-utils失败" - fi - - # 测试使用-l参数指定替代SGML声明 - LOG_INFO "测试使用-l参数指定替代SGML声明" - db2pdf -l /path/to/declaration.sgml test.xml > /dev/null 2>&1 - - # 检查命令执行结果 - if [ $? -ne 0 ]; then - LOG_ERROR "-l参数不支持或指定路径不存在" - # 如果未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载docbook-utils软件包" - dnf remove -y docbook-utils > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载docbook-utils失败" - fi - exit 255 - else - CHECK_RESULT $? 0 0 "db2pdf命令执行失败" - fi - - # 清理环境:如果未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载docbook-utils软件包" - dnf remove -y docbook-utils > /dev/null 2>&1 - CHECK_RESULT $?                           - if [ $? -ne ] ; then - exit - fi - fi - - LOG_INFO "测试完成:测试使用 -l 参数指定替代 SGML 声明" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_n.sh b/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_n.sh deleted file mode 100644 index 54a14b5f010..00000000000 --- a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_n.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -n 参数不使用标准 SGML 开放目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查docbook-utils-pdf是否已安装 - LOG_INFO "检查docbook-utils-pdf是否已安装..." - if ! dnf list installed docbook-utils-pdf &>/dev/null; then - LOG_INFO "docbook-utils-pdf未安装,将进行安装..." - # 检查yum源中是否有该软件包 - if ! dnf list available docbook-utils-pdf &>/dev/null; then - LOG_ERROR "yum源中未找到docbook-utils-pdf软件包" - exit 255 - fi - # 安装软件包 - dnf install -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "安装docbook-utils-pdf失败" - # 标记为需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "docbook-utils-pdf已安装,无需重新安装" - fi - - # 测试使用 -n 参数不使用标准 SGML 开放目录 - LOG_INFO "测试使用 -n 参数不使用标准 SGML 开放目录..." - db2pdf -n test.docbook &>/dev/null - CHECK_RESULT $? 0 0 "db2pdf -n命令执行失败" - - # 检查参数是否存在或不支持 - LOG_INFO "检查db2pdf命令是否支持-n参数..." - if ! db2pdf --help | grep -q "\-n"; then - LOG_ERROR "db2pdf命令不支持-n参数" - exit 255 - fi - - # 清理环境:如果脚本安装了软件包则卸载 - if [ "$NEED_UNINSTALL" -eq 1 ]; then - LOG_INFO "卸载docbook-utils-pdf..." - dnf remove -y docbook-utils-pdf &>/dev/null - CHECK_RESULT $? 0 0 "卸载docbook-utils-pdf失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_o.sh b/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_o.sh deleted file mode 100644 index f5229b226c3..00000000000 --- a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_o.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 : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -o 参数设置输出目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用 -o 参数设置输出目录" - - # 检查是否已安装docbook-utils-pdf - LOG_INFO "检查是否已安装docbook-utils-pdf" - if ! dnf list installed docbook-utils-pdf &>/dev/null; then - LOG_INFO "docbook-utils-pdf未安装,将进行安装" - # 检查yum源中是否有该软件包 - if ! dnf list available docbook-utils-pdf &>/dev/null; then - LOG_ERROR "yum源中未找到docbook-utils-pdf软件包" - exit 255 - fi - # 安装软件包 - dnf install -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "安装docbook-utils-pdf失败" - # 标记为需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "docbook-utils-pdf已安装,无需重复安装" - fi - - # 检查db2pdf命令是否支持-o参数 - LOG_INFO "检查db2pdf命令是否支持-o参数" - if ! db2pdf --help | grep -q "\-o"; then - LOG_ERROR "db2pdf命令不支持-o参数" - exit 255 - fi - - # 创建临时输出目录 - LOG_INFO "创建临时输出目录" - OUTPUT_DIR=$(mktemp -d) - CHECK_RESULT $? 0 0 "创建临时目录失败" - - # 执行db2pdf命令并指定输出目录 - LOG_INFO "执行db2pdf命令并指定输出目录" - SAMPLE_DOCBOOK_FILE="/usr/share/docbook-utils/docbook.dsl" - db2pdf -o "$OUTPUT_DIR" "$SAMPLE_DOCBOOK_FILE" - CHECK_RESULT $? 0 0 "db2pdf命令执行失败" - - # 检查输出目录中是否生成PDF文件 - LOG_INFO "检查输出目录中是否生成PDF文件" - if [ ! -f "$OUTPUT_DIR"/*.pdf ]; then - LOG_ERROR "未在指定输出目录中找到PDF文件" - exit 1 - fi - - # 清理临时目录 - LOG_INFO "清理临时目录" - rm -rf "$OUTPUT_DIR" - CHECK_RESULT $? 0 0 "清理临时目录失败" - - # 如果之前安装了软件包,则卸载 - if [ "$NEED_UNINSTALL" -eq 1 ]; then - LOG_INFO "卸载docbook-utils-pdf" - dnf remove -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "卸载docbook-utils-pdf失败" - fi - - LOG_INFO "测试完成:测试使用 -o 参数设置输出目录" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_p.sh b/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_p.sh deleted file mode 100644 index c9015263968..00000000000 --- a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_p.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -p 参数指定解析器程序 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查docbook-utils-pdf软件包是否已安装 - LOG_INFO "检查docbook-utils-pdf软件包是否已安装" - rpm -q docbook-utils-pdf - if [ $? -eq 0 ]; then - LOG_INFO "docbook-utils-pdf软件包已安装" - installed=true - else - LOG_INFO "docbook-utils-pdf软件包未安装" - installed=false - fi - - # 检查yum源中是否有docbook-utils-pdf软件包 - LOG_INFO "检查yum源中是否有docbook-utils-pdf软件包" - dnf list available docbook-utils-pdf - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到docbook-utils-pdf软件包" - exit 255 - fi - - # 如果未安装,则安装docbook-utils-pdf软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装docbook-utils-pdf软件包" - dnf install -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "安装docbook-utils-pdf软件包失败" - fi - - # 测试使用 -p 参数指定解析器程序 - LOG_INFO "测试使用 -p 参数指定解析器程序" - db2pdf -p /usr/bin/xsltproc sample.xml - CHECK_RESULT $? 0 0 "使用 -p 参数指定解析器程序失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载docbook-utils-pdf软件包" - dnf remove -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "卸载docbook-utils-pdf软件包失败" - fi - - LOG_INFO "测试脚本执行完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_s.sh b/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_s.sh deleted file mode 100644 index e135af805ea..00000000000 --- a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_s.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -s 参数更改 SGML 分发的基础目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查docbook-utils-pdf软件包是否已安装 - LOG_INFO "检查docbook-utils-pdf软件包是否已安装" - rpm -q docbook-utils-pdf > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "docbook-utils-pdf软件包已安装" - INSTALLED=true - else - LOG_INFO "docbook-utils-pdf软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否有docbook-utils-pdf软件包 - LOG_INFO "检查yum源中是否有docbook-utils-pdf软件包" - dnf list available docbook-utils-pdf > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到docbook-utils-pdf软件包" - exit 255 - fi - - # 如果未安装,则安装docbook-utils-pdf软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装docbook-utils-pdf软件包" - dnf install -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "安装docbook-utils-pdf软件包失败" - fi - - # 测试使用 -s 参数更改 SGML 分发的基础目录 - LOG_INFO "测试使用 -s 参数更改 SGML 分发的基础目录" - db2pdf -s /tmp/test_sgml test.sgml > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用 -s 参数更改 SGML 分发的基础目录失败" - - # 如果之前未安装,则卸载docbook-utils-pdf软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载docbook-utils-pdf软件包" - dnf remove -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "卸载docbook-utils-pdf软件包失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_u.sh b/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_u.sh deleted file mode 100644 index ceaf1078a64..00000000000 --- a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2pdf_u.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试使用 -u 参数仅输出一个大文件,覆盖样式表设置 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试使用 -u 参数仅输出一个大文件,覆盖样式表设置" - - # 检查是否已安装 docbook-utils-pdf - LOG_INFO "检查是否已安装 docbook-utils-pdf" - if ! dnf list installed docbook-utils-pdf &>/dev/null; then - LOG_INFO "docbook-utils-pdf 未安装,将进行安装" - INSTALLED=false - else - LOG_INFO "docbook-utils-pdf 已安装" - INSTALLED=true - fi - - # 检查 yum 源中是否有 docbook-utils-pdf - LOG_INFO "检查 yum 源中是否有 docbook-utils-pdf" - if ! dnf list available docbook-utils-pdf &>/dev/null; then - LOG_ERROR "yum 源中未找到 docbook-utils-pdf" - exit 255 - fi - - # 如果未安装,则安装 docbook-utils-pdf - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 docbook-utils-pdf" - dnf install -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "安装 docbook-utils-pdf 失败" - fi - - # 测试 db2pdf -u 参数 - LOG_INFO "测试 db2pdf -u 参数" - db2pdf -u test.db &>/dev/null - CHECK_RESULT $? 0 0 "db2pdf -u test.db 执行失败" - - # 检查输出文件是否存在 - LOG_INFO "检查输出文件是否存在" - if [ ! -f test.pdf ]; then - LOG_ERROR "未生成 test.pdf 文件" - exit 1 - fi - - # 清理环境 - LOG_INFO "清理环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 docbook-utils-pdf" - dnf remove -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "卸载 docbook-utils-pdf 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2ps__v.sh b/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2ps__v.sh deleted file mode 100644 index f836b160294..00000000000 --- a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_db2ps__v.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试 db2ps 命令的版本信息参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 db2ps 命令的版本信息参数" - - # 检查是否已安装 docbook-utils-pdf 软件包 - LOG_INFO "检查 docbook-utils-pdf 是否已安装" - if ! dnf list installed docbook-utils-pdf &>/dev/null; then - LOG_INFO "docbook-utils-pdf 未安装,准备安装" - # 检查 yum 源中是否有该软件包 - if ! dnf list available docbook-utils-pdf &>/dev/null; then - LOG_ERROR "yum 源中未找到 docbook-utils-pdf 软件包" - exit 255 - fi - # 安装软件包 - dnf install -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "安装 docbook-utils-pdf 失败" - else - LOG_INFO "docbook-utils-pdf 已安装,跳过安装步骤" - fi - - # 检查 db2ps 命令是否支持 --version 参数 - LOG_INFO "检查 db2ps 命令是否支持 --version 参数" - db2ps --version &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "db2ps 命令不支持 --version 参数" - exit 255 - fi - - # 执行 db2ps --version,验证版本信息输出是否正确 - LOG_INFO "执行 db2ps --version 并验证输出" - db2ps --version | grep -q "db2ps" - CHECK_RESULT $? 0 0 "db2ps --version 输出不符合预期" - - # 清理环境:如果之前未安装,则卸载软件包 - if ! dnf list installed docbook-utils-pdf &>/dev/null; then - LOG_INFO "清理环境:卸载 docbook-utils-pdf" - dnf remove -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "卸载 docbook-utils-pdf 失败" - else - LOG_INFO “环境保持原状,不卸载 docook—uils-pd f” - fi - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_function_db2pdf_conversion.sh b/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_function_db2pdf_conversion.sh deleted file mode 100644 index 09696961225..00000000000 --- a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_function_db2pdf_conversion.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 : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试db2pdf命令的文档转换功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试db2pdf命令的文档转换功能" - - # 检查docbook-utils-pdf软件包是否在yum源中 - LOG_INFO "检查docbook-utils-pdf软件包是否在yum源中" - dnf list available docbook-utils-pdf &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有docbook-utils-pdf软件包" - exit 255 - fi - - # 检查是否已安装docbook-utils-pdf - LOG_INFO "检查是否已安装docbook-utils-pdf" - rpm -q docbook-utils-pdf &>/dev/null - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "docbook-utils-pdf已安装" - else - installed=false - LOG_INFO "docbook-utils-pdf未安装,将进行安装" - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装docbook-utils-pdf软件包" - dnf install -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "安装docbook-utils-pdf失败" - fi - - # 测试db2pdf命令的文档转换功能 - LOG_INFO "测试db2pdf命令的文档转换功能" - test_file="test.xml" # 假设存在一个测试用的XML文件 - - # 检查测试文件是否存在 - if [ ! -f "$test_file" ]; then - LOG_ERROR "测试文件$test_file不存在" - exit 255 - fi - - # 执行db2pdf命令进行转换 - LOG_INFO "执行db2pdf命令进行文档转换" - db2pdf "$test_file" &>/dev/null - - CHECK_RESULT $? 0 0 "db2pdf命令执行失败" - - # 检查生成的PDF文件是否存在 - output_pdf="${test_file%.*}.pdf" # 生成的PDF文件名 - if [ ! -f "$output_pdf" ]; then - LOG_ERROR "生成的PDF文件$output_pdf不存在" - exit 1 # PDF文件未生成,退出码1表示一般错误 - else - LOG_INFO "成功生成PDF文件$output_pdf" - fi - - # 清理生成的PDF文件(恢复环境) - LOG_INFO "清理生成的PDF文件" - rm -f "$output_pdf" - - # 如果脚本开始时未安装软件包,则在结束时卸载 - if [ "$installed" = false ]; then - LOG_INFO "卸载docbook-utils-pdf软件包" - dnf remove -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "卸载docbook-utils-pdf失败" - fi - - LOG_INFO "测试db2pdf命令的文档转换功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_function_db2ps_output.sh b/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_function_db2ps_output.sh deleted file mode 100644 index 2caa2920747..00000000000 --- a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_function_db2ps_output.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 : 2025-12-12 -# @License : Mulan PSL v2 -# @Desc : 测试db2ps命令的输出功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装docbook-utils-pdf软件包 - LOG_INFO "检查是否已安装docbook-utils-pdf软件包" - if ! dnf list installed docbook-utils-pdf &>/dev/null; then - LOG_INFO "docbook-utils-pdf未安装,开始安装" - # 检查yum源中是否有该软件包 - if ! dnf list available docbook-utils-pdf &>/dev/null; then - LOG_ERROR "yum源中未找到docbook-utils-pdf软件包" - exit 255 - fi - # 安装软件包 - dnf install -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "安装docbook-utils-pdf失败" - # 标记为需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "docbook-utils-pdf已安装,无需重复安装" - NEED_UNINSTALL=0 - fi - - # 测试db2ps命令的输出功能 - LOG_INFO "测试db2ps命令的输出功能" - # 检查db2ps命令是否存在 - if ! command -v db2ps &>/dev/null; then - LOG_ERROR "db2ps命令不存在或不支持" - exit 255 - fi - - # 创建一个临时测试文件 - LOG_INFO "创建临时测试文件" - TEST_FILE="test.db" - cat > $TEST_FILE < -
- Test Document - This is a test document. -
- EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 执行db2ps命令 - LOG_INFO "执行db2ps命令" - db2ps $TEST_FILE - CHECK_RESULT $? 0 0 "db2ps命令执行失败" - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f $TEST_FILE - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 如果之前未安装,则卸载软件包 - if [ $NEED_UNINSTALL -eq 1 ]; then - LOG_INFO "卸载docbook-utils-pdf软件包" - dnf remove -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "卸载docbook-utils-pdf失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_function_docbook2dvi.sh b/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_function_docbook2dvi.sh deleted file mode 100644 index d43924d44a0..00000000000 --- a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_function_docbook2dvi.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试docbook2dvi命令的基本功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试docbook2dvi命令的基本功能 - - LOG_INFO "开始测试docbook2dvi命令的基本功能" - - # 检查yum源中是否存在docbook-utils-pdf包 - LOG_INFO "检查yum源中是否存在docbook-utils-pdf包" - dnf list available docbook-utils-pdf &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到docbook-utils-pdf包" - exit 255 - fi - - # 检查是否已安装docbook-utils-pdf - LOG_INFO "检查是否已安装docbook-utils-pdf" - rpm -q docbook-utils-pdf &> /dev/null - if [ $? -ne 0 ]; then - INSTALLED=0 - LOG_INFO "未安装docbook-utils-pdf包,将进行安装" - dnf install -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "安装docbook-utils-pdf失败" - else - INSTALLED=1 - LOG_INFO "docbook-utils-pdf包已安装,跳过安装步骤" - fi - - # 测试docbook2dvi命令的基本功能 - LOG_INFO "测试docbook2dvi命令的基本功能" - echo " -
- Test Document - This is a test document. -
" > test.xml - - docbook2dvi test.xml &> /dev/null - CHECK_RESULT $? 0 0 "执行docbook2dvi命令失败" - - # 清理生成的临时文件 - LOG_INFO "清理临时文件" - rm -f test.xml test.dvi - - # 如果脚本开始时未安装,则在结束时卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载之前安装的docbook-utils-pdf包" - dnf remove -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "卸载docbook-utils-pdf失败" - fi - - LOG_INFO "测试docook2dvi命令的基本功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_function_docbook2ps.sh b/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_function_docbook2ps.sh deleted file mode 100644 index e67cf8d159c..00000000000 --- a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_function_docbook2ps.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试docbook2ps命令的基本功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试docbook2ps命令的基本功能" - - # 检查是否已安装docbook-utils-pdf - LOG_INFO "检查是否已安装docbook-utils-pdf" - if rpm -q docbook-utils-pdf &>/dev/null; then - LOG_INFO "docbook-utils-pdf已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "docbook-utils-pdf未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有docbook-utils-pdf软件包 - LOG_INFO "检查yum源中是否有docbook-utils-pdf软件包" - if ! dnf list available docbook-utils-pdf &>/dev/null; then - LOG_ERROR "yum源中未找到docbook-utils-pdf软件包" - exit 255 - fi - - # 安装docbook-utils-pdf软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装docbook-utils-pdf软件包" - dnf install -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "安装docbook-utils-pdf失败" - fi - - # 检查docbook2ps命令是否存在 - LOG_INFO "检查docbook2ps命令是否存在" - if ! command -v docbook2ps &>/dev/null; then - LOG_ERROR "docbook2ps命令不存在或不支持" - exit 255 - fi - - # 测试docbook2ps命令的基本功能 - LOG_INFO "测试docbook2ps命令的基本功能" - echo "
Test
" > test.xml - docbook2ps test.xml > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行docbook2ps命令失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.xml test.ps - - # 如果之前未安装,则卸载docbook-utils-pdf - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载docbook-utils-pdf软件包" - dnf remove -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "卸载docbook-utils-pdf失败" - fi - - LOG_INFO "测试docook2ps命令的基本功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_function_error_handling.sh b/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_function_error_handling.sh deleted file mode 100644 index 02175b4d049..00000000000 --- a/testcases/function_test/pkg_test/docbook-utils/docbook-utils-pdf/test_docbook-utils-pdf_function_error_handling.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-12 -# @License : Mulan PSL v2 -# @Desc : 测试错误输入的处理能力 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试错误输入的处理能力 - - LOG_INFO "开始测试docbook-utils-pdf的错误输入处理能力" - - # 检查是否已安装docbook-utils-pdf - if dnf list installed docbook-utils-pdf &>/dev/null; then - LOG_INFO "docbook-utils-pdf已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "docbook-utils-pdf未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有docbook-utils-pdf - LOG_INFO "检查yum源中是否存在docbook-utils-pdf" - if ! dnf list available docbook-utils-pdf &>/dev/null; then - LOG_ERROR "yum源中不存在docbook-utils-pdf" - exit 255 - fi - - # 如果未安装则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装docbook-utils-pdf" - dnf install -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "安装docbook-utils-pdf失败" - fi - - # 测试错误参数处理 - LOG_INFO "测试不支持参数时的错误处理" - docbook2pdf --invalid-arg &>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "未正确处理无效参数" - exit 255 - fi - - # 测试命令执行失败时的退出码 - LOG_INFO "测试命令执行失败时的退出码" - docbook2pdf non-existent-file &>/dev/null - CHECK_RESULT $? 1 0 "未正确处理命令执行失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载docbook-utils-pdf" - dnf remove -y docbook-utils-pdf - CHECK_RESULT $? 0 0 "卸载docbook-utils-pdf失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/fence-agents/fence-agents-rsa/test_fence-agents-rsa_function_config.sh b/testcases/function_test/pkg_test/fence-agents/fence-agents-rsa/test_fence-agents-rsa_function_config.sh deleted file mode 100644 index e79ef3b4c6d..00000000000 --- a/testcases/function_test/pkg_test/fence-agents/fence-agents-rsa/test_fence-agents-rsa_function_config.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-20 -# @License : Mulan PSL v2 -# @Desc : Test the configuration file handling for fence-agents-rsa -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 fence-agents-rsa 配置文件处理功能" - - # 定义软件包名称 - PACKAGE_NAME="fence-agents-rsa" - - # 步骤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=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,测试将进行安装和卸载" - INSTALLED_BEFORE=0 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:测试配置文件处理功能 - LOG_INFO "步骤4:测试配置文件处理功能" - # 这里假设 fence_rsa 是 fence-agents-rsa 提供的一个命令或脚本 - # 如果命令不存在或不支持,则退出码为255 - if ! command -v fence_rsa &>/dev/null; then - LOG_ERROR "命令 fence_rsa 不存在或不支持" - exit 255 - fi - - # 模拟测试配置文件处理,这里使用 --help 参数检查命令是否支持配置文件参数 - # 假设 --config 是用于指定配置文件的参数 - LOG_INFO "检查 fence_rsa 命令是否支持 --config 参数" - fence_rsa --help 2>&1 | grep -q -- "--config" - CHECK_RESULT $? 0 0 "fence_rsa 命令不支持 --config 参数" - - # 步骤5:执行一个简单的配置文件测试(这里使用虚拟配置文件) - LOG_INFO "步骤5:执行配置文件测试" - # 创建一个临时配置文件 - TEMP_CONFIG=$(mktemp) - echo "test_config=value" > $TEMP_CONFIG - # 尝试使用配置文件执行命令(这里假设命令会读取配置文件并输出内容) - # 如果命令执行失败,则按照Linux标准退出码退出 - fence_rsa --config $TEMP_CONFIG --test 2>&1 | grep -q "test_config" - CHECK_RESULT $? 0 0 "配置文件处理失败" - rm -f $TEMP_CONFIG - - # 步骤6:清理环境 - LOG_INFO "步骤6:清理环境" - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试 fence-agents-rsa 配置文件处理功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/fence-agents/fence-agents-rsa/test_fence-agents-rsa_function_health.sh b/testcases/function_test/pkg_test/fence-agents/fence-agents-rsa/test_fence-agents-rsa_function_health.sh deleted file mode 100644 index 3c8c663ad2f..00000000000 --- a/testcases/function_test/pkg_test/fence-agents/fence-agents-rsa/test_fence-agents-rsa_function_health.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-08 -# @License : Mulan PSL v2 -# @Desc : Test the health check functionality of fence-agents-rsa -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 fence-agents-rsa 的健康检查功能" - - # 检查环境是否已安装 fence-agents-rsa - LOG_INFO "检查 fence-agents-rsa 是否已安装" - if dnf list installed fence-agents-rsa &>/dev/null; then - LOG_INFO "fence-agents-rsa 已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "fence-agents-rsa 未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 fence-agents-rsa - LOG_INFO "检查 yum 源中是否有 fence-agents-rsa" - if ! dnf list available fence-agents-rsa &>/dev/null; then - LOG_ERROR "yum 源中未找到 fence-agents-rsa,退出测试" - exit 255 - fi - - # 如果未安装,则安装 fence-agents-rsa - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 fence-agents-rsa" - dnf install -y fence-agents-rsa - CHECK_RESULT $? 0 0 "安装 fence-agents-rsa 失败" - fi - - # 测试健康检查功能 - LOG_INFO "测试 fence_ack_manual -h 命令参数支持" - fence_ack_manual -h &>/dev/null - CHECK_RESULT $? 0 0 "fence_ack_manual 命令不支持 -h 参数" - - LOG_INFO "测试 fence_ack_manual --help 命令参数支持" - fence_ack_manual --help &>/dev/null - CHECK_RESULT $? 0 0 "fence_ack_manual 命令不支持 --help 参数" - - LOG_INFO "测试健康检查功能是否正常" - fence_ack_manual -o status &>/dev/null - CHECK_RESULT $? 0 0 "健康检查功能异常" - - # SSH到第二个节点测试(假设NODE2相关变量已定义) - LOG_INFO "在第二个节点上测试健康检查功能" - SSH_CMD "fence_ack_manual -o status" "$NODE2_IPV4" "$NODE2_PASSWORD" "$NODE2_USER" - CHECK_RESULT $? 0 0 "第二个节点上的健康检查功能异常" - - #环境恢复:如果之前未安装,则卸载 fence-agents-rsa - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 fence-agents-rsa" - dnf remove -y fence-agents-rsa - CHECK_RESULT $? 0 0 "卸载 fence-agents-rsa 失败" - fi - - LOG_INFO "fence-agents-ras的健康检查功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/fence-agents/fence-agents-rsa/test_fence-agents-rsa_function_usage.sh b/testcases/function_test/pkg_test/fence-agents/fence-agents-rsa/test_fence-agents-rsa_function_usage.sh deleted file mode 100644 index 43846285736..00000000000 --- a/testcases/function_test/pkg_test/fence-agents/fence-agents-rsa/test_fence-agents-rsa_function_usage.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 the basic usage and help output of fence-agents-rsa -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - # 环境检查:检查是否已安装fence-agents-rsa - LOG_INFO "检查是否已安装fence-agents-rsa" - if rpm -q fence-agents-rsa &>/dev/null; then - LOG_INFO "fence-agents-rsa已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "fence-agents-rsa未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查yum源中是否有fence-agents-rsa软件包 - LOG_INFO "检查yum源中是否有fence-agents-rsa软件包" - if ! dnf list available fence-agents-rsa &>/dev/null; then - LOG_ERROR "yum源中未找到fence-agents-rsa软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装fence-agents-rsa软件包" - dnf install -y fence-agents-rsa - CHECK_RESULT $? 0 0 "安装fence-agents-rsa失败" - fi - - # 测试fence-agents-rsa的基本用法和帮助输出 - LOG_INFO "测试fence-agents-rsa的基本用法和帮助输出" - - # 测试帮助输出 - LOG_INFO "执行fence_rsa --help" - fence_rsa --help - CHECK_RESULT $? 0 0 "执行fence_rsa --help失败" - - # 测试不带参数执行(预期显示帮助信息) - LOG_INFO "执行fence_rsa(不带参数)" - output=$(fence_rsa 2>&1) - echo "$output" | grep -q "Usage:" - CHECK_RESULT $? 0 0 "fence_rsa不带参数执行时未显示帮助信息" - - # 测试无效参数 - LOG_INFO "测试无效参数--invalid-option" - fence_rsa --invalid-option 2>&1 | grep -q "invalid option" - if [ $? -eq 0 ]; then - LOG_INFO "无效参数检查通过" - else - LOG_ERROR "无效参数检查失败,参数可能被错误支持" - exit 255 - fi - - # 环境清理:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载fence-agents-rsa软件包" - dnf remove -y fence-agents-rsa - CHECK_RESULT $? 0 0 "卸载fence-agents-rsa失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/glassfish-servlet-api/glassfish-servlet-api-help/test_glassfish-servlet-api-help_function_validate.sh b/testcases/function_test/pkg_test/glassfish-servlet-api/glassfish-servlet-api-help/test_glassfish-servlet-api-help_function_validate.sh deleted file mode 100644 index 5ad05061324..00000000000 --- a/testcases/function_test/pkg_test/glassfish-servlet-api/glassfish-servlet-api-help/test_glassfish-servlet-api-help_function_validate.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 : Test package validation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查环境是否已安装glassfish-servlet-api-help软件包 - LOG_INFO "检查glassfish-servlet-api-help是否已安装" - rpm -q glassfish-servlet-api-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "glassfish-servlet-api-help已安装,测试完成后保持安装状态" - INSTALLED=1 - else - LOG_INFO "glassfish-servlet-api-help未安装,测试完成后将卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在glassfish-servlet-api-help软件包 - LOG_INFO "检查yum源中是否存在glassfish-servlet-api-help软件包" - dnf list available glassfish-servlet-api-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到glassfish-servlet-api-help软件包" - exit 255 - fi - - # 安装glassfish-servlet-api-help软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装glassfish-servlet-api-help软件包" - dnf install -y glassfish-servlet-api-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装glassfish-servlet-api-help失败" - fi - - # 验证glassfish-servlet-api-help命令功能 - LOG_INFO "验证glassfish-servlet-api-help命令功能" - glassfish-servlet-api-help --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "glassfish-servlet-api-help命令功能验证失败" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载glassfish-servlet-api-help软件包" - dnf remove -y glassfish-servlet-api-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载glassfish-servlet-api-help失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/jandex-maven-plugin/jandex-maven-plugin-help/test_jandex-maven-plugin-help_function_basic.sh b/testcases/function_test/pkg_test/jandex-maven-plugin/jandex-maven-plugin-help/test_jandex-maven-plugin-help_function_basic.sh deleted file mode 100644 index a782e7343cb..00000000000 --- a/testcases/function_test/pkg_test/jandex-maven-plugin/jandex-maven-plugin-help/test_jandex-maven-plugin-help_function_basic.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-11-29 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality of jandex-maven-plugin-help -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试jandex-maven-plugin-help的基本功能 - LOG_INFO "开始测试jandex-maven-plugin-help的基本功能" - - # 检查是否已安装jandex-maven-plugin - LOG_INFO "检查jandex-maven-plugin是否已安装" - if dnf list installed jandex-maven-plugin &>/dev/null; then - LOG_INFO "jandex-maven-plugin已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "jandex-maven-plugin未安装,准备安装" - INSTALLED=false - fi - - # 检查yum源中是否有jandex-maven-plugin - LOG_INFO "检查yum源中是否有jandex-maven-plugin" - if ! dnf list available jandex-maven-plugin &>/dev/null; then - LOG_ERROR "yum源中未找到jandex-maven-plugin" - exit 255 - fi - - # 如果未安装,则安装jandex-maven-plugin - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装jandex-maven-plugin" - dnf install -y jandex-maven-plugin - CHECK_RESULT $? 0 0 "安装jandex-maven-plugin失败" - fi - - # 测试jandex-maven-plugin-help命令的基本功能 - LOG_INFO "测试jandex-maven-plugin-help命令的基本功能" - jandex-maven-plugin --help - CHECK_RESULT $? 0 0 "执行jandex-maven-plugin-help命令失败" - - # 检查参数是否存在 - LOG_INFO "检查不支持的参数" - jandex-maven-plugin --invalid-arg &>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "不支持的参数未正确退出" - exit 255 - fi - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载jandex-maven-plugin" - dnf remove -y jandex-maven-plugin - CHECK_RESULT $? 0 0 "卸载jandex-maven-plugin失败" - fi - - LOG_INFO "测试jandex-maven-plugin-help的基本功能完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/jandex-maven-plugin/jandex-maven-plugin-help/test_jandex-maven-plugin-help_function_config.sh b/testcases/function_test/pkg_test/jandex-maven-plugin/jandex-maven-plugin-help/test_jandex-maven-plugin-help_function_config.sh deleted file mode 100644 index bf64fb60157..00000000000 --- a/testcases/function_test/pkg_test/jandex-maven-plugin/jandex-maven-plugin-help/test_jandex-maven-plugin-help_function_config.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-07 -# @License : Mulan PSL v2 -# @Desc : Test config handling of jandex-maven-plugin-help -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test config handling of jandex-maven-plugin-help" - - # 检查是否已安装jandex-maven-plugin - LOG_INFO "检查是否已安装jandex-maven-plugin" - dnf list installed jandex-maven-plugin > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "jandex-maven-plugin已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "jandex-maven-plugin未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有jandex-maven-plugin - LOG_INFO "检查yum源中是否有jandex-maven-plugin" - dnf search jandex-maven-plugin > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到jandex-maven-plugin,退出测试" - exit 255 - fi - - # 安装jandex-maven-plugin - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装jandex-maven-plugin" - dnf install -y jandex-maven-plugin - CHECK_RESULT $? 0 0 "安装jandex-maven-plugin失败" - fi - - # 测试jandex-maven-plugin-help的config处理功能 - LOG_INFO "测试jandex-maven-plugin-help的config处理功能" - mvn jandex:help -Ddetail=true > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "jandex-maven-plugin-help的config处理功能测试失败" - - # 清理环境:如果测试前未安装,则卸载jandex-maven-plugin - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载jandex-maven-plugin" - dnf remove -y jandex-maven-plugin - CHECK_RESULT $? 0 0 "卸载jandex-maven-plugin失败" - fi - - LOG_INFO "测试完成:Test config handling of jandex-maven-plugin-help" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lorax/lorax-composer/test_lorax-composer_function_basic_usage.sh b/testcases/function_test/pkg_test/lorax/lorax-composer/test_lorax-composer_function_basic_usage.sh deleted file mode 100644 index f59fa5b61c8..00000000000 --- a/testcases/function_test/pkg_test/lorax/lorax-composer/test_lorax-composer_function_basic_usage.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-22 -# @License : Mulan PSL v2 -# @Desc : Test basic command line usage (e.g., --help, list-templates) -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义测试函数 - test_lorax_composer_function_basic_usage() { - # 定义软件包名称 - PACKAGE_NAME="lorax-composer" - # 定义测试命令 - CMD_HELP="lorax-composer --help" - CMD_LIST_TEMPLATES="lorax-composer list-templates" - - # 步骤1:检查环境是否已安装 lorax-composer - LOG_INFO "步骤1:检查环境是否已安装 lorax-composer" - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "lorax-composer 已安装,将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "lorax-composer 未安装,将在测试中安装" - INSTALLED_BEFORE=0 - fi - - # 步骤2:检查 yum 源中是否有 lorax-composer 软件包 - LOG_INFO "步骤2:检查 yum 源中是否有 lorax-composer 软件包" - if ! dnf list available $PACKAGE_NAME &>/dev/null; then - LOG_ERROR "yum 源中未找到 lorax-composer 软件包" - exit 255 - fi - - # 步骤3:如果未安装,则安装 lorax-composer - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤3:安装 lorax-composer" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装 lorax-composer 失败" - fi - - # 步骤4:测试 --help 参数 - LOG_INFO "步骤4:测试 --help 参数" - $CMD_HELP - CHECK_RESULT $? 0 0 "执行 --help 参数失败" - - # 步骤5:测试 list-templates 命令 - LOG_INFO "步骤5:测试 list-templates 命令" - $CMD_LIST_TEMPLATES - CHECK_RESULT $? 0 0 "执行 list-templates 命令失败" - - # 步骤6:清理环境,恢复到之前的状态 - LOG_INFO "步骤6:清理环境,恢复到之前的状态" - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "卸载 lorax-composer" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载 lorax-composer 失败" - else - LOG_INFO "保持 lorax-composer 安装状态" - fi - - LOG_INFO "测试完成" - } - - # 调用测试函数 - test_lorax_composer_function_basic_usage -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lorax/lorax-composer/test_lorax-composer_function_image_build.sh b/testcases/function_test/pkg_test/lorax/lorax-composer/test_lorax-composer_function_image_build.sh deleted file mode 100644 index 56e7518214f..00000000000 --- a/testcases/function_test/pkg_test/lorax/lorax-composer/test_lorax-composer_function_image_build.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-22 -# @License : Mulan PSL v2 -# @Desc : Test simple OS image creation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了lorax-composer - if dnf list installed lorax-composer &>/dev/null; then - LOG_INFO "lorax-composer已经安装,测试结束后保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "lorax-composer未安装,将在测试过程中安装" - INSTALLED_BEFORE=false - fi - - # 步骤1:检查yum源中是否有lorax-composer软件包 - LOG_INFO "步骤1:检查yum源中是否有lorax-composer软件包" - if ! dnf list available lorax-composer &>/dev/null; then - LOG_ERROR "yum源中没有找到lorax-composer软件包" - exit 255 - fi - - # 步骤2:安装lorax-composer(如果未安装) - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤2:安装lorax-composer" - dnf install -y lorax-composer - CHECK_RESULT $? 0 0 "安装lorax-composer失败" - fi - - # 步骤3:检查lorax-composer命令是否可用 - LOG_INFO "步骤3:检查lorax-composer命令是否可用" - if ! command -v lorax-composer &>/dev/null; then - LOG_ERROR "lorax-composer命令不可用" - exit 255 - fi - - # 步骤4:检查lorax-composer支持的参数 - LOG_INFO "步骤4:检查lorax-composer支持的参数" - if ! lorax-composer --help | grep -q "compose"; then - LOG_ERROR "lorax-composer不支持compose参数" - exit 255 - fi - - # 步骤5:创建一个简单的OS镜像 - LOG_INFO "步骤5:创建一个简单的OS镜像" - TEST_BLUEPRINT_FILE="/tmp/test-blueprint.toml" - cat > "$TEST_BLUEPRINT_FILE" << EOF - name = "test-image" - description = "Test OS image" - version = "0.0.1" - [[packages]] - name = "httpd" - version = "*" - EOF - - # 步骤6:使用lorax-composer创建镜像 - LOG_INFO "步骤6:使用lorax-composer创建镜像" - TEST_OUTPUT_DIR="/tmp/test-image-output" - mkdir -p "$TEST_OUTPUT_DIR" - lorax-composer compose start test-image qcow2 "$TEST_OUTPUT_DIR" - CHECK_RESULT $? 0 0 "创建OS镜像失败" - - # 步骤7:检查镜像是否生成 - LOG_INFO "步骤7:检查镜像是否生成" - if [ ! -f "$TEST_OUTPUT_DIR/test-image.qcow2" ]; then - LOG_ERROR "未找到生成的镜像文件" - exit 1 - fi - - # 步骤8:清理测试文件 - LOG_INFO "步骤8:清理测试文件" - rm -rf "$TEST_BLUEPRINT_FILE" "$TEST_OUTPUT_DIR" - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤9:卸载lorax-composer(如果测试前未安装) - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤9:卸载lorax-composer" - dnf remove -y lorax-composer - CHECK_RESULT $? 0 0 "卸载lorax-composer失败" - fi - - LOG_INFO "测试完成:简单OS镜像创建成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lorax/lorax-composer/test_lorax-composer_function_install.sh b/testcases/function_test/pkg_test/lorax/lorax-composer/test_lorax-composer_function_install.sh deleted file mode 100644 index 2e6a0841ada..00000000000 --- a/testcases/function_test/pkg_test/lorax/lorax-composer/test_lorax-composer_function_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-22 -# @License : Mulan PSL v2 -# @Desc : Test package installation via dnf -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test package installation via dnf" - - LOG_INFO "步骤1:检查测试环境是否已安装lorax-composer软件包" - if rpm -q lorax-composer &>/dev/null; then - LOG_INFO "lorax-composer已安装,测试结束后将保持安装状态" - INSTALLED="true" - else - LOG_INFO "lorax-composer未安装,将在测试步骤中安装" - INSTALLED="false" - fi - - LOG_INFO "步骤2:检查yum源中是否有lorax-composer软件包" - if ! dnf list available lorax-composer &>/dev/null; then - LOG_ERROR "yum源中未找到lorax-composer软件包" - exit 255 - fi - - LOG_INFO "步骤3:检查dnf install命令是否支持lorax-composer参数" - dnf install --help | grep -q "\-\-help" - CHECK_RESULT $? 0 0 "dnf install命令参数检查失败" - - LOG_INFO "步骤4:执行软件包安装测试" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "开始安装lorax-composer软件包" - dnf install -y lorax-composer - CHECK_RESULT $? 0 0 "lorax-composer安装失败" - LOG_INFO "lorax-composer安装成功" - fi - - LOG_INFO "步骤5:验证软件包安装结果" - rpm -q lorax-composer - CHECK_RESULT $? 0 0 "lorax-composer未正确安装" - - LOG_INFO "步骤6:测试软件包基本功能" - lorax-composer --help &>/dev/null - CHECK_RESULT $? 0 0 "lorax-composer基本功能测试失败" - - LOG_INFO "步骤7:环境清理" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载测试安装的lorax-composer软件包" - dnf remove -y lorax-composer - CHECK_RESULT $? 0 0 "lorax-composer卸载失败" - LOG_INFO "lorax-composer卸载成功" - else - LOG_INFO "保持原有lorax-composer安装状态" - fi - - LOG_INFO "测试完成:Test package installation via dnf" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lorax/lorax-composer/test_lorax-composer_function_service_status.sh b/testcases/function_test/pkg_test/lorax/lorax-composer/test_lorax-composer_function_service_status.sh deleted file mode 100644 index 0446ed25249..00000000000 --- a/testcases/function_test/pkg_test/lorax/lorax-composer/test_lorax-composer_function_service_status.sh +++ /dev/null @@ -1,251 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-22 -# @License : Mulan PSL v2 -# @Desc : Test service status and enablement -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查lorax-composer服务状态和启用状态的测试脚本 - - # 定义颜色输出函数 - LOG_INFO() { - echo -e "\033[32m[INFO]\033[0m $1" - } - - LOG_ERROR() { - echo -e "\033[31m[ERROR]\033[0m $1" - } - - # 检查软件包是否在yum源中 - check_package_in_repo() { - local package_name="$1" - LOG_INFO "检查yum源中是否存在软件包: $package_name" - - if dnf list available "$package_name" &>/dev/null; then - LOG_INFO "软件包 $package_name 在yum源中可用" - return 0 - else - LOG_ERROR "软件包 $package_name 不在yum源中" - return 1 - fi - } - - # 检查命令参数是否支持 - check_command_option() { - local command="$1" - local option="$2" - - LOG_INFO "检查命令 $command 是否支持参数: $option" - - # 使用--help或-h检查参数是否支持 - if $command --help 2>&1 | grep -q "\<$option\>"; then - LOG_INFO "命令 $command 支持参数 $option" - return 0 - elif $command -h 2>&1 | grep -q "\<$option\>"; then - LOG_INFO "命令 $command 支持参数 $option" - return 0 - else - LOG_ERROR "命令 $command 不支持参数 $option" - return 1 - fi - } - - # 主测试函数 - main() { - local package_name="lorax-composer" - local service_name="lorax-composer" - local original_install_state="unknown" - local test_installed=false - - LOG_INFO "开始测试: Test service status and enablement" - LOG_INFO "===============================================" - - # 步骤1: 检查当前lorax-composer安装状态 - LOG_INFO "步骤1: 检查当前lorax-composer安装状态" - if rpm -q "$package_name" &>/dev/null; then - LOG_INFO "lorax-composer已安装" - original_install_state="installed" - test_installed=true - else - LOG_INFO "lorax-composer未安装" - original_install_state="not_installed" - test_installed=false - fi - - # 步骤2: 检查软件包是否在yum源中 - LOG_INFO "步骤2: 检查软件包是否在yum源中" - if ! check_package_in_repo "$package_name"; then - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$original_install_state" = "not_installed" ]; then - LOG_INFO "步骤3: 安装lorax-composer软件包" - dnf install -y "$package_name" - CHECK_RESULT $? 0 0 "安装lorax-composer失败" - - # 验证安装 - if rpm -q "$package_name" &>/dev/null; then - LOG_INFO "lorax-composer安装成功" - else - LOG_ERROR "lorax-composer安装后验证失败" - exit 1 - fi - else - LOG_INFO "步骤3: lorax-composer已安装,跳过安装步骤" - fi - - # 步骤4: 检查systemctl命令参数是否支持 - LOG_INFO "步骤4: 检查systemctl命令参数是否支持" - if ! check_command_option "systemctl" "is-active"; then - exit 255 - fi - - if ! check_command_option "systemctl" "is-enabled"; then - exit 255 - fi - - # 步骤5: 检查lorax-composer服务状态 - LOG_INFO "步骤5: 检查lorax-composer服务状态" - systemctl status "$service_name" --no-pager - CHECK_RESULT $? 0 1 "检查服务状态失败" # 允许返回0或非0,因为服务可能未运行 - - # 步骤6: 检查服务是否活跃 - LOG_INFO "步骤6: 检查lorax-composer服务是否活跃" - systemctl is-active "$service_name" - local active_status=$? - - # 根据服务状态输出信息 - if [ $active_status -eq 0 ]; then - LOG_INFO "lorax-composer服务正在运行" - elif [ $active_status -eq 3 ]; then - LOG_INFO "lorax-composer服务未运行" - else - LOG_ERROR "检查服务活跃状态失败" - CHECK_RESULT $active_status 0 0 "检查服务活跃状态失败" - fi - - # 步骤7: 检查服务是否启用 - LOG_INFO "步骤7: 检查lorax-composer服务是否启用" - systemctl is-enabled "$service_name" - local enabled_status=$? - - # 根据服务启用状态输出信息 - if [ $enabled_status -eq 0 ]; then - LOG_INFO "lorax-composer服务已启用" - elif [ $enabled_status -eq 1 ]; then - LOG_INFO "lorax-composer服务未启用" - else - LOG_ERROR "检查服务启用状态失败" - CHECK_RESULT $enabled_status 0 0 "检查服务启用状态失败" - fi - - # 步骤8: 尝试启动服务(如果未运行) - LOG_INFO "步骤8: 尝试启动lorax-composer服务" - if [ $active_status -ne 0 ]; then - systemctl start "$service_name" - local start_result=$? - - if [ $start_result -eq 0 ]; then - LOG_INFO "成功启动lorax-composer服务" - - # 验证服务是否运行 - systemctl is-active "$service_name" - CHECK_RESULT $? 0 0 "服务启动后验证失败" - - # 停止服务以恢复原状 - LOG_INFO "停止服务以恢复环境" - systemctl stop "$service_name" - CHECK_RESULT $? 0 0 "停止服务失败" - else - LOG_INFO "启动lorax-composer服务失败(可能是正常情况)" - # 不检查结果,因为服务可能配置为不自动启动 - fi - else - LOG_INFO "服务已在运行,跳过启动步骤" - fi - - # 步骤9: 尝试启用服务(如果未启用) - LOG_INFO "步骤9: 尝试启用lorax-composer服务" - if [ $enabled_status -ne 0 ]; then - systemctl enable "$service_name" - local enable_result=$? - - if [ $enable_result -eq 0 ]; then - LOG_INFO "成功启用lorax-composer服务" - - # 验证服务是否启用 - systemctl is-enabled "$service_name" - CHECK_RESULT $? 0 0 "服务启用后验证失败" - - # 禁用服务以恢复原状 - LOG_INFO "禁用服务以恢复环境" - systemctl disable "$service_name" - CHECK_RESULT $? 0 0 "禁用服务失败" - else - LOG_INFO "启用lorax-composer服务失败(可能是正常情况)" - # 不检查结果,因为可能没有权限或其他原因 - fi - else - LOG_INFO "服务已启用,跳过启用步骤" - fi - - # 环境清理和恢复 - LOG_INFO "步骤10: 环境清理和恢复" - - # 如果测试前未安装,则卸载软件包 - if [ "$original_install_state" = "not_installed" ] && [ "$test_installed" = false ]; then - LOG_INFO "卸载测试安装的lorax-composer软件包" - dnf remove -y "$package_name" - CHECK_RESULT $? 0 0 "卸载lorax-composer失败" - - # 验证卸载 - if ! rpm -q "$package_name" &>/dev/null; then - LOG_INFO "lorax-composer卸载成功" - else - LOG_ERROR "lorax-composer卸载后验证失败" - exit 1 - fi - else - LOG_INFO "保持原有安装状态,不卸载软件包" - fi - - # 确保服务状态恢复 - LOG_INFO "确保lorax-composer服务状态恢复" - - # 如果原始状态是未运行,确保服务停止 - if [ $active_status -ne 0 ]; then - systemctl stop "$service_name" 2>/dev/null - LOG_INFO "确保服务已停止" - fi - - # 如果原始状态是未启用,确保服务禁用 - if [ $enabled_status -ne 0 ]; then - systemctl disable "$service_name" 2>/dev/null - LOG_INFO "确保服务已禁用" - fi - - LOG_INFO "测试完成: Test service status and enablement" - LOG_INFO "===============================================" - } - - # 执行主函数 - main "$@" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lorax/lorax-composer/test_lorax-composer_function_uninstall.sh b/testcases/function_test/pkg_test/lorax/lorax-composer/test_lorax-composer_function_uninstall.sh deleted file mode 100644 index f24b2ca6b8f..00000000000 --- a/testcases/function_test/pkg_test/lorax/lorax-composer/test_lorax-composer_function_uninstall.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-22 -# @License : Mulan PSL v2 -# @Desc : Test package removal via dnf -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(虽然题目说无需定义,但实际使用时需要定义,这里根据要求直接使用,但实际脚本需要定义) - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" - } - - # 定义检查结果函数(虽然题目说无需定义,但实际使用时需要定义,这里根据要求直接使用,但实际脚本需要定义) - CHECK_RESULT() { - local actual=$1 - local expect=$2 - local exit_code=$3 - local msg=$4 - if [ "$actual" -eq "$expect" ]; then - LOG_INFO "$msg 成功" - return 0 - else - LOG_ERROR "$msg 失败" - exit $exit_code - fi - } - - # 定义SSH_CMD函数(虽然题目说无需定义,但实际使用时需要定义,这里根据要求直接使用,但实际脚本需要定义) - 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="lorax-composer" - - # 检查是否已经安装 - LOG_INFO "检查 $PACKAGE_NAME 是否已经安装" - if dnf list installed "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "$PACKAGE_NAME 已经安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "$PACKAGE_NAME 未安装,将在测试中安装并卸载" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有 $PACKAGE_NAME 软件包" - if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "yum源中没有 $PACKAGE_NAME 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$ALREADY_INSTALLED" -eq 0 ]; then - LOG_INFO "安装 $PACKAGE_NAME 软件包" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME" - fi - - # 测试卸载软件包 - LOG_INFO "测试卸载 $PACKAGE_NAME 软件包" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME" - - # 验证软件包是否已卸载 - LOG_INFO "验证 $PACKAGE_NAME 是否已卸载" - if dnf list installed "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "$PACKAGE_NAME 卸载失败" - exit 1 - else - LOG_INFO "$PACKAGE_NAME 卸载成功" - fi - - # 环境恢复:如果之前未安装,则重新安装以保持环境原状 - if [ "$ALREADY_INSTALLED" -eq 0 ]; then - LOG_INFO "恢复环境:重新安装 $PACKAGE_NAME" - dnf install -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/perl-YAML/perl-YAML-help/test_perl-YAML-help_basic_usage.sh b/testcases/function_test/pkg_test/perl-YAML/perl-YAML-help/test_perl-YAML-help_basic_usage.sh deleted file mode 100644 index 5da1512dede..00000000000 --- a/testcases/function_test/pkg_test/perl-YAML/perl-YAML-help/test_perl-YAML-help_basic_usage.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-06 -# @License : Mulan PSL v2 -# @Desc : 测试 perl-YAML-help 软件包的基本用法,例如运行其提供的帮助命令(如 --help 或 man 手册),验证其核心功能可用。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试perl-YAML-help软件包的基本用法" - - LOG_INFO "检查perl-YAML-help软件包是否已安装" - if dnf list installed perl-YAML-help &>/dev/null; then - LOG_INFO "perl-YAML-help已安装,脚本结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "perl-YAML-help未安装,将在测试中安装并在结束后卸载" - already_installed=0 - fi - - LOG_INFO "检查yum源中是否有perl-YAML-help软件包" - if ! dnf list available perl-YAML-help &>/dev/null; then - LOG_ERROR "yum源中未找到perl-YAML-help软件包" - exit 255 - fi - - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装perl-YAML-help软件包" - dnf install -y perl-YAML-help - CHECK_RESULT $? 0 0 "安装perl-YAML-help失败" - fi - - LOG_INFO "测试perl-YAML-help的--help参数" - perl-YAML-help --help &>/dev/null - CHECK_RESULT $? 0 0 "perl-YAML-help --help命令执行失败" - - LOG_INFO "测试man手册是否可用" - man perl-YAML-help &>/dev/null - CHECK_RESULT $? 0 0 "man perl-YAML-help命令执行失败" - - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载perl-YAML-help软件包" - dnf remove -y perl-YAML-help - CHECK_RESULT $? 0 0 "卸载perl-YAML-help失败" - else - LOG_INFO "保持perl-YAML-help已安装状态" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/perl-YAML/perl-YAML-help/test_perl-YAML-help_file_exist.sh b/testcases/function_test/pkg_test/perl-YAML/perl-YAML-help/test_perl-YAML-help_file_exist.sh deleted file mode 100644 index 8961b2a3a9d..00000000000 --- a/testcases/function_test/pkg_test/perl-YAML/perl-YAML-help/test_perl-YAML-help_file_exist.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-06 -# @License : Mulan PSL v2 -# @Desc : 测试 perl-YAML-help 软件包安装后,其核心文档或帮助文件(如手册页、README)是否存在于预期的系统路径中。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试 perl-YAML-help 软件包安装后,其核心文档或帮助文件(如手册页、README)是否存在于预期的系统路径中。 - - # 定义预期的帮助文件路径 - HELP_FILES=( - "/usr/share/doc/perl-YAML-help/README" - "/usr/share/man/man1/perl-YAML-help.1.gz" - "/usr/share/doc/perl-YAML-help/ChangeLog" - ) - - # 检查软件包是否已在yum源中 - LOG_INFO "检查软件包 perl-YAML-help 是否在yum源中" - dnf list available perl-YAML-help &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 perl-YAML-help 不在yum源中" - exit 255 - fi - - # 检查系统是否已安装 perl-YAML-help - LOG_INFO "检查系统是否已安装 perl-YAML-help" - rpm -q perl-YAML-help &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 perl-YAML-help 已安装,标记为已存在安装" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包 perl-YAML-help 未安装,标记为未安装" - INSTALLED_BEFORE=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装软件包 perl-YAML-help" - dnf install -y perl-YAML-help - CHECK_RESULT $? 0 0 "安装 perl-YAML-help 失败" - fi - - # 验证帮助文件是否存在 - LOG_INFO "验证帮助文件是否存在" - for file in "${HELP_FILES[@]}"; do - LOG_INFO "检查文件: $file" - if [ -f "$file" ]; then - LOG_INFO "文件 $file 存在" - else - LOG_ERROR "文件 $file 不存在" - # 如果之前未安装,则需要卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载软件包 perl-YAML-help" - dnf remove -y perl-YAML-help - fi - exit 1 - fi - done - - # 如果之前未安装,则在测试结束后卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "测试完成,卸载软件包 perl-YAML-help" - dnf remove -y perl-YAML-help - CHECK_RESULT $? 0 0 "卸载 perl-YAML-help 失败" - else - LOG_INFO "测试完成,保持软件包 perl-YAML-help 安装状态" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-yubico/python-yubico-help/test_python-yubico-help_function_init.sh b/testcases/function_test/pkg_test/python-yubico/python-yubico-help/test_python-yubico-help_function_init.sh deleted file mode 100644 index 5314d4f16b2..00000000000 --- a/testcases/function_test/pkg_test/python-yubico/python-yubico-help/test_python-yubico-help_function_init.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-04 -# @License : Mulan PSL v2 -# @Desc : Test initialization of python-yubico-help -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test initialization of python-yubico-help" - - # 检查软件包是否已安装 - LOG_INFO "检查python-yubico-help是否已安装" - if dnf list installed python-yubico-help &>/dev/null; then - LOG_INFO "python-yubico-help已安装,测试完成后将保持安装状态" - installed=true - else - LOG_INFO "python-yubico-help未安装,测试完成后将卸载" - installed=false - fi - - # 检查yum源中是否有python-yubico-help - LOG_INFO "检查yum源中是否有python-yubico-help" - if ! dnf list available python-yubico-help &>/dev/null; then - LOG_ERROR "yum源中未找到python-yubico-help,退出测试" - exit 255 - fi - - # 安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装python-yubico-help" - dnf install -y python-yubico-help - CHECK_RESULT $? 0 0 "安装python-yubico-help失败" - fi - - # 测试初始化功能 - LOG_INFO "测试python-yubico-help的初始化功能" - python -c "import yubico_help; yubico_help.init()" - CHECK_RESULT $? 0 0 "初始化python-yubico-help失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载python-yubico-help" - dnf remove -y python-yubico-help - CHECK_RESULT $? 0 0 "卸载python-yubico-help失败" - fi - - LOG_INFO "测试完成:Test initialization of python-yubico-help" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qpid-proton/qpid-proton-c-help/test_qpid-proton-c-help_function_basic.sh b/testcases/function_test/pkg_test/qpid-proton/qpid-proton-c-help/test_qpid-proton-c-help_function_basic.sh deleted file mode 100644 index 1b2baf1c84c..00000000000 --- a/testcases/function_test/pkg_test/qpid-proton/qpid-proton-c-help/test_qpid-proton-c-help_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-12-06 -# @License : Mulan PSL v2 -# @Desc : Verify basic help functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查qpid-proton-c软件包是否已安装 - LOG_INFO "检查qpid-proton-c软件包是否已安装" - if rpm -q qpid-proton-c &>/dev/null; then - LOG_INFO "qpid-proton-c已安装" - INSTALLED=true - else - LOG_INFO "qpid-proton-c未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在qpid-proton-c软件包 - LOG_INFO "检查yum源中是否存在qpid-proton-c软件包" - if ! dnf list available qpid-proton-c &>/dev/null; then - LOG_ERROR "yum源中不存在qpid-proton-c软件包" - exit 255 - fi - - # 如果未安装,则安装qpid-proton-c - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装qpid-proton-c软件包" - dnf install -y qpid-proton-c - CHECK_RESULT $? 0 0 "安装qpid-proton-c失败" - fi - - # 验证基本帮助功能 - LOG_INFO "验证qpid-proton-c的基本帮助功能" - proton-help --help &>/dev/null - CHECK_RESULT $? 0 0 "proton-help命令不支持--help参数" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载qpid-proton-c软件包" - dnf remove -y qpid-proton-c - CHECK_RESULT $? 0 0 "卸载qpid-proton-c失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qpid-proton/qpid-proton-c-help/test_qpid-proton-c-help_function_usage.sh b/testcases/function_test/pkg_test/qpid-proton/qpid-proton-c-help/test_qpid-proton-c-help_function_usage.sh deleted file mode 100644 index d124ce67f32..00000000000 --- a/testcases/function_test/pkg_test/qpid-proton/qpid-proton-c-help/test_qpid-proton-c-help_function_usage.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-06 -# @License : Mulan PSL v2 -# @Desc : Validate usage instructions -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Validate usage instructions" - - # 检查是否已安装qpid-proton-c-help软件包 - LOG_INFO "步骤1:检查qpid-proton-c-help是否已安装" - if dnf list installed qpid-proton-c-help &>/dev/null; then - LOG_INFO "qpid-proton-c-help已安装,跳过安装步骤" - installed=true - else - LOG_INFO "qpid-proton-c-help未安装,准备安装" - installed=false - fi - - # 检查yum源中是否有qpid-proton-c-help软件包 - LOG_INFO "步骤2:检查yum源中是否有qpid-proton-c-help软件包" - if ! dnf list available qpid-proton-c-help &>/dev/null; then - LOG_ERROR "yum源中未找到qpid-proton-c-help软件包" - exit 255 - fi - - # 安装qpid-proton-c-help软件包(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "步骤3:安装qpid-proton-c-help软件包" - dnf install -y qpid-proton-c-help - CHECK_RESULT $? 0 0 "安装qpid-proton-c-help失败" - fi - - # 验证qpid-proton-c-help命令的用法说明 - LOG_INFO "步骤4:验证qpid-proton-c-help命令的用法说明" - output=$(qpid-proton-c --help 2>&1) - CHECK_RESULT $? 0 0 "执行qpid-proton-c --help失败" - - # 检查输出中是否包含用法说明 - LOG_INFO "步骤5:检查输出中是否包含用法说明" - if [[ "$output" != *"Usage:"* ]]; then - LOG_ERROR "输出中未找到用法说明" - exit 255 - fi - - # 清理环境(如果脚本开始时未安装) - if [ "$installed" = false ]; then - LOG_INFO "步骤6:卸载qpid-proton-c-help软件包" - dnf remove -y qpid-proton-c-help - CHECK_RESULT $? 0 0卸载失败" - fi - - LOG_INFO测试完成:Validate usage instructions" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qpid-proton/qpid-proton-c-help/test_qpid-proton-c-help_function_version.sh b/testcases/function_test/pkg_test/qpid-proton/qpid-proton-c-help/test_qpid-proton-c-help_function_version.sh deleted file mode 100644 index eeb1712cc08..00000000000 --- a/testcases/function_test/pkg_test/qpid-proton/qpid-proton-c-help/test_qpid-proton-c-help_function_version.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-06 -# @License : Mulan PSL v2 -# @Desc : Check version information -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试:检查版本信息" - - # 检查软件包是否已安装 - if ! rpm -q qpid-proton-c > /dev/null 2>&1; then - LOG_INFO "环境未安装qpid-proton-c,将进行安装" - # 检查yum源中是否有该软件包 - if ! dnf list available qpid-proton-c > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到qpid-proton-c软件包" - exit 255 - fi - # 安装软件包 - dnf install -y qpid-proton-c - CHECK_RESULT $? 0 0 "安装qpid-proton-c失败" - else - LOG_INFO "环境已安装qpid-proton-c,跳过安装步骤" - fi - - # 检查命令参数是否支持 - LOG_INFO "检查qpid-proton-c的版本信息" - if ! qpid-proton --help | grep -q "\-\-version"; then - LOG_ERROR "qpid-proton-c不支持--version参数" - exit 255 - fi - - # 执行命令并检查结果 - LOG_INFO "获取qpid-proton-c的版本信息" - qpid-proton --version - CHECK_RESULT $? 0 0 "获取版本信息失败" - - # 清理环境 - if ! rpm -q qpid-proton-c > /dev/null 2>&1; then - LOG_INFO "测试前未安装qpid-proton-c,将卸载软件包" - dnf remove -y qpid-proton-c - CHECK_RESULT $? 0 0 "卸载qpid-proton-c失败" - else - LOG_INFO "测试前已安装qpid-proton-c,保持安装状态" - fi - - LOG_INFO "测试完成:版本信息检查成功" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt5-qtnetworkauth/qt5-qtnetworkauth-devel/test_qt5-qtnetworkauth-devel_function_auth.sh b/testcases/function_test/pkg_test/qt5-qtnetworkauth/qt5-qtnetworkauth-devel/test_qt5-qtnetworkauth-devel_function_auth.sh deleted file mode 100644 index 89a83313b46..00000000000 --- a/testcases/function_test/pkg_test/qt5-qtnetworkauth/qt5-qtnetworkauth-devel/test_qt5-qtnetworkauth-devel_function_auth.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-03 -# @License : Mulan PSL v2 -# @Desc : Test authentication functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test authentication functionality" - - # 检查软件包是否已安装 - LOG_INFO "检查qt5-qtnetworkauth-devel是否已安装" - if dnf list installed qt5-qtnetworkauth-devel &>/dev/null; then - LOG_INFO "qt5-qtnetworkauth-devel已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "qt5-qtnetworkauth-devel未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有qt5-qtnetworkauth-devel" - if ! dnf list available qt5-qtnetworkauth-devel &>/dev/null; then - LOG_ERROR "yum源中未找到qt5-qtnetworkauth-devel" - exit 255 - fi - - # 安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装qt5-qtnetworkauth-devel" - dnf install -y qt5-qtnetworkauth-devel - CHECK_RESULT $? 0 0 "安装qt5-qtnetworkauth-devel失败" - fi - - # 测试认证功能 - LOG_INFO "测试认证功能" - auth_test_command="some_auth_test_command" # 替换为实际的测试命令 - if ! command -v "$auth_test_command" &>/dev/null; then - LOG_ERROR "命令$auth_test_command不存在或不支持" - exit 255 - fi - - $auth_test_command - CHECK_RESULT $? 0 0 "认证功能测试失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载qt5-qtnetworkauth-devel" - dnf remove -y qt5-qtnetworkauth-devel - CHECK_RESULT $? 0 0 "卸载qt5-qtnetworkauth-devel失败" - fi - - LOG_INFO "测试完成:Test authentication functionality" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt6-qtlocation/qt6-qtlocation-devel/test_qt6-qtlocation-devel_function_basic_compile.sh b/testcases/function_test/pkg_test/qt6-qtlocation/qt6-qtlocation-devel/test_qt6-qtlocation-devel_function_basic_compile.sh deleted file mode 100644 index 70966b4eae4..00000000000 --- a/testcases/function_test/pkg_test/qt6-qtlocation/qt6-qtlocation-devel/test_qt6-qtlocation-devel_function_basic_compile.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : Test compiling a simple program using Qt6Location headers -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用Qt6Location头文件编译简单程序" - - # 检查yum源中是否存在qt6-qtlocation-devel软件包 - LOG_INFO "检查yum源中是否存在qt6-qtlocation-devel软件包" - dnf list available qt6-qtlocation-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt6-qtlocation-devel软件包" - exit 255 - fi - - # 检查环境是否已安装qt6-qtlocation-devel - LOG_INFO "检查环境是否已安装qt6-qtlocation-devel" - rpm -q qt6-qtlocation-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "qt6-qtlocation-devel已安装,测试结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "qt6-qtlocation-devel未安装,将在测试前安装" - already_installed=0 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装qt6-qtlocation-devel软件包" - dnf install -y qt6-qtlocation-devel - CHECK_RESULT $? 0 0 "安装qt6-qtlocation-devel失败" - fi - - # 创建测试程序源代码 - LOG_INFO "创建测试程序源代码" - cat > test_qtlocation.cpp << "EOF" - #include - #include - - int main() { - QGeoCoordinate coord(37.7749, -122.4194); - std::cout << "Latitude: " << coord.latitude() << std::endl; - std::cout << "Longitude: " << coord.longitude() << std::endl; - return 0; - } - EOF - CHECK_RESULT $? 0 0 "创建测试程序源代码失败" - - # 编译测试程序 - LOG_INFO "编译测试程序" - g++ -o test_qtlocation test_qtlocation.cpp -I/usr/include/qt6 -lQt6Core -lQt6Location -fPIC - CHECK_RESULT $? 0 0 "编译测试程序失败" - - # 运行测试程序 - LOG_INFO "运行测试程序" - ./test_qtlocation - CHECK_RESULT $? 0 0 "运行测试程序失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_qtlocation.cpp test_qtlocation - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载qt6-qtlocation-devel软件包" - dnf remove -y qt6-qtlocation-devel - CHECK_RESULT $? 0 0 "卸载qt6-qtlocation-devel失败" - else - LOG_INFO "测试前已安装qt6-qtlocation-devel,保持安装状态" - fi - - LOG_INFO "测试完成:使用Qt6Location头文件编译简单程序" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt6-qtlocation/qt6-qtlocation-devel/test_qt6-qtlocation-devel_function_cmake_find.sh b/testcases/function_test/pkg_test/qt6-qtlocation/qt6-qtlocation-devel/test_qt6-qtlocation-devel_function_cmake_find.sh deleted file mode 100644 index 11c803764c8..00000000000 --- a/testcases/function_test/pkg_test/qt6-qtlocation/qt6-qtlocation-devel/test_qt6-qtlocation-devel_function_cmake_find.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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 : Test if CMake can find Qt6Location development package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:验证CMake能否找到Qt6Location开发包" - - # 检查yum源中是否存在qt6-qtlocation-devel包 - LOG_INFO "步骤1:检查yum源中是否存在qt6-qtlocation-devel包" - dnf list available qt6-qtlocation-devel &>/dev/null - CHECK_RESULT $? 0 0 "yum源中未找到qt6-qtlocation-devel包,退出码255" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt6-qtlocation-devel包" - exit 255 - fi - - # 检查系统是否已安装qt6-qtlocation-devel - LOG_INFO "步骤2:检查系统是否已安装qt6-qtlocation-devel" - if rpm -q qt6-qtlocation-devel &>/dev/null; then - LOG_INFO "qt6-qtlocation-devel已安装,测试后将保持安装状态" - INSTALLED=true - else - LOG_INFO "qt6-qtlocation-devel未安装,将进行安装测试" - INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装qt6-qtlocation-devel包" - dnf install -y qt6-qtlocation-devel - CHECK_RESULT $? 0 0 "安装qt6-qtlocation-devel失败" - fi - - # 验证CMake能否找到Qt6Location开发包 - LOG_INFO "步骤4:验证CMake能否找到Qt6Location开发包" - # 创建一个临时CMakeLists.txt文件来测试 - TEST_DIR=$(mktemp -d) - cd "$TEST_DIR" - - cat > CMakeLists.txt << "EOF" - cmake_minimum_required(VERSION 3.16) - project(TestQt6Location) - - find_package(Qt6 COMPONENTS Location REQUIRED) - - message(STATUS "Qt6Location found: ${Qt6Location_FOUND}") - message(STATUS "Qt6Location include dirs: ${Qt6Location_INCLUDE_DIRS}") - message(STATUS "Qt6Location libraries: ${Qt6Location_LIBRARIES}") - EOF - - # 运行CMake配置 - LOG_INFO "运行CMake配置以查找Qt6Location" - cmake . 2>&1 | tee cmake_output.log - CMAKE_RESULT=${PIPESTATUS[0]} - - # 检查CMake是否成功找到Qt6Location - if grep -q "Qt6Location found: TRUE" cmake_output.log; then - LOG_INFO "CMake成功找到Qt6Location开发包" - CHECK_RESULT $CMAKE_RESULT 0 0 "CMake配置过程失败" - else - LOG_ERROR "CMake未能找到Qt6Location开发包" - CHECK_RESULT 1 0 1 "CMake未能找到Qt6Location开发包" - fi - - # 清理临时目录 - LOG_INFO "步骤5:清理临时测试目录" - cd - - rm -rf "$TEST_DIR" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤6:卸载qt6-qtlocation-devel包" - dnf remove -y qt6-qtlocation-devel - CHECK_RESULT $? 0 0 "卸载qt6-qtlocation-devel失败" - LOG_INFO "已恢复环境:qt6-qtlocation-devel已卸载" - else - LOG_INFO "环境保持:qt6-qtlocation-devel保持安装状态" - fi - - LOG_INFO "测试完成:CMake能够成功找到Qt6Location开发包" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt6-qtlocation/qt6-qtlocation-devel/test_qt6-qtlocation-devel_function_header_files.sh b/testcases/function_test/pkg_test/qt6-qtlocation/qt6-qtlocation-devel/test_qt6-qtlocation-devel_function_header_files.sh deleted file mode 100644 index b9f9be3508d..00000000000 --- a/testcases/function_test/pkg_test/qt6-qtlocation/qt6-qtlocation-devel/test_qt6-qtlocation-devel_function_header_files.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : Test presence of Qt6Location development header files -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试Qt6Location开发头文件的存在性" - LOG_INFO "步骤1:检查yum源中是否存在qt6-qtlocation-devel软件包" - dnf list available qt6-qtlocation-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt6-qtlocation-devel软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查qt6-qtlocation-devel是否已安装" - rpm -q qt6-qtlocation-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "qt6-qtlocation-devel已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "qt6-qtlocation-devel未安装,将进行安装" - INSTALLED=false - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装qt6-qtlocation-devel软件包" - dnf install -y qt6-qtlocation-devel - CHECK_RESULT $? 0 0 "安装qt6-qtlocation-devel失败" - fi - - LOG_INFO "步骤4:检查Qt6Location开发头文件是否存在" - find /usr/include -name "qt6location*.h" -o -name "Qt6Location*.h" | head -5 - CHECK_RESULT $? 0 0 "未找到Qt6Location开发头文件" - - LOG_INFO "步骤5:验证头文件是否可用" - cat > /tmp/test_qt6location.cpp << "EOF" - #include - int main() { return 0; } - EOF - g++ -c /tmp/test_qt6location.cpp -I/usr/include/qt6 -I/usr/include/qt6/QtLocation 2>&1 - CHECK_RESULT $? 0 0 "Qt6Location头文件编译测试失败" - rm -f /tmp/test_qt6location.cpp /tmp/test_qt6location.o - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤6:卸载qt6-qtlocation-devel软件包" - dnf remove -y qt6-qtlocation-devel - CHECK_RESULT $? 0 0 "卸载qt6-qtlocation-devel失败" - else - LOG_INFO "步骤6:保持qt6-qtlocation-devel安装状态,跳过卸载" - fi - - LOG_INFO "Qt6Location开发头文件测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt6-qtlocation/qt6-qtlocation-devel/test_qt6-qtlocation-devel_function_library_files.sh b/testcases/function_test/pkg_test/qt6-qtlocation/qt6-qtlocation-devel/test_qt6-qtlocation-devel_function_library_files.sh deleted file mode 100644 index 4384bdb7e40..00000000000 --- a/testcases/function_test/pkg_test/qt6-qtlocation/qt6-qtlocation-devel/test_qt6-qtlocation-devel_function_library_files.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 : 2026-03-12 -# @License : Mulan PSL v2 -# @Desc : Test presence of Qt6Location development library files -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试Qt6Location开发库文件的存在性" - - # 检查是否已安装qt6-qtlocation-devel软件包 - if rpm -q qt6-qtlocation-devel &> /dev/null; then - LOG_INFO "qt6-qtlocation-devel软件包已安装,测试后保持安装状态" - INSTALLED=true - else - LOG_INFO "qt6-qtlocation-devel软件包未安装,将在测试中安装" - INSTALLED=false - fi - - # 检查yum源中是否存在qt6-qtlocation-devel软件包 - LOG_INFO "检查yum源中是否存在qt6-qtlocation-devel软件包" - if ! dnf list available qt6-qtlocation-devel &> /dev/null; then - LOG_ERROR "yum源中未找到qt6-qtlocation-devel软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装qt6-qtlocation-devel软件包" - dnf install -y qt6-qtlocation-devel - CHECK_RESULT $? 0 0 "安装qt6-qtlocation-devel软件包失败" - fi - - # 测试Qt6Location开发库文件的存在性 - LOG_INFO "测试Qt6Location开发库文件的存在性" - if [ -f /usr/include/qt6/QtLocation/QGeoAddress ]; then - LOG_INFO "找到Qt6Location开发库头文件: /usr/include/qt6/QtLocation/QGeoAddress" - else - LOG_ERROR "未找到Qt6Location开发库头文件: /usr/include/qt6/QtLocation/QGeoAddress" - exit 1 - fi - - if [ -f /usr/lib64/libQt6Location.so ]; then - LOG_INFO "找到Qt6Location开发库共享库文件: /usr/lib64/libQt6Location.so" - else - LOG_ERROR "未找到Qt6Location开发库共享库文件: /usr/lib64/libQt6Location.so" - exit 1 - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载qt6-qtlocation-devel软件包" - dnf remove -y qt6-qtlocation-devel - CHECK_RESULT $? 0 0 "卸载qt6-qtlocation-devel软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt6-qtlocation/qt6-qtlocation-devel/test_qt6-qtlocation-devel_function_qmake_use.sh b/testcases/function_test/pkg_test/qt6-qtlocation/qt6-qtlocation-devel/test_qt6-qtlocation-devel_function_qmake_use.sh deleted file mode 100644 index f3bd17d016a..00000000000 --- a/testcases/function_test/pkg_test/qt6-qtlocation/qt6-qtlocation-devel/test_qt6-qtlocation-devel_function_qmake_use.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-12 -# @License : Mulan PSL v2 -# @Desc : Test basic project compilation using qmake with QtLocation module -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了qt6-qtlocation-devel软件包 - LOG_INFO "检查是否已安装qt6-qtlocation-devel软件包" - dnf list installed qt6-qtlocation-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "qt6-qtlocation-devel软件包已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "qt6-qtlocation-devel软件包未安装,将在测试过程中安装并在测试结束后卸载" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否有qt6-qtlocation-devel软件包 - LOG_INFO "检查yum源中是否有qt6-qtlocation-devel软件包" - dnf list available qt6-qtlocation-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到qt6-qtlocation-devel软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt6-qtlocation-devel软件包,退出测试" - exit 255 - fi - - # 如果未安装,则安装qt6-qtlocation-devel软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "安装qt6-qtlocation-devel软件包" - dnf install -y qt6-qtlocation-devel - CHECK_RESULT $? 0 0 "安装qt6-qtlocation-devel软件包失败" - fi - - # 检查qmake命令是否存在 - LOG_INFO "检查qmake命令是否存在" - command -v qmake > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "qmake命令不存在" - if [ $? -ne 0 ]; then - LOG_ERROR "qmake命令不存在,退出测试" - exit 255 - fi - - # 检查qmake是否支持QtLocation模块 - LOG_INFO "检查qmake是否支持QtLocation模块" - qmake -query | grep -q "QT_INSTALL_PREFIX" - CHECK_RESULT $? 0 0 "qmake不支持查询QT_INSTALL_PREFIX" - if [ $? -ne 0 ]; then - LOG_ERROR "qmake不支持查询QT_INSTALL_PREFIX,退出测试" - exit 255 - fi - - # 创建测试项目目录 - LOG_INFO "创建测试项目目录" - TEST_DIR="/tmp/test_qtlocation_qmake" - mkdir -p $TEST_DIR - CHECK_RESULT $? 0 0 "创建测试项目目录失败" - - # 进入测试项目目录 - cd $TEST_DIR - - # 创建测试项目文件 - LOG_INFO "创建测试项目文件" - cat > test_qtlocation.pro << "EOF" - QT += core location - TEMPLATE = app - TARGET = test_qtlocation - SOURCES = main.cpp - EOF - - cat > main.cpp << "EOF" - #include - #include - #include - - int main(int argc, char *argv[]) - { - QCoreApplication a(argc, argv); - - QGeoCoordinate coord(37.7749, -122.4194); - qDebug() << "测试QtLocation模块:"; - qDebug() << "坐标纬度:" << coord.latitude(); - qDebug() << "坐标经度:" << coord.longitude(); - - return 0; - } - EOF - - # 使用qmake生成Makefile - LOG_INFO "使用qmake生成Makefile" - qmake test_qtlocation.pro - CHECK_RESULT $? 0 0 "qmake生成Makefile失败" - - # 编译测试项目 - LOG_INFO "编译测试项目" - make - CHECK_RESULT $? 0 0 "编译测试项目失败" - - # 运行测试程序 - LOG_INFO "运行测试程序" - ./test_qtlocation - CHECK_RESULT $? 0 0 "运行测试程序失败" - - # 清理测试项目 - LOG_INFO "清理测试项目" - cd / - rm -rf $TEST_DIR - CHECK_RESULT $? 0 0 "清理测试项目失败" - - # 如果测试前未安装,则卸载qt6-qtlocation-devel软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "卸载qt6-qtlocation-devel软件包" - dnf remove -y qt6-qtlocation-devel - CHECK_RESULT $? 0 0 "卸载qt6-qtlocation-devel软件包失败" - fi - - LOG_INFO "测试完成:使用qmake与QtLocation模块进行基本项目编译测试成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rubygem-ZenTest/rubygem-ZenTest-doc/test_rubygem-ZenTest-doc_function_install.sh b/testcases/function_test/pkg_test/rubygem-ZenTest/rubygem-ZenTest-doc/test_rubygem-ZenTest-doc_function_install.sh deleted file mode 100644 index d05d2a84385..00000000000 --- a/testcases/function_test/pkg_test/rubygem-ZenTest/rubygem-ZenTest-doc/test_rubygem-ZenTest-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-02-26 -# @License : Mulan PSL v2 -# @Desc : 测试安装软件包 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:安装软件包rubygem-ZenTest-doc-function" - - # 检查是否已安装 - if dnf list installed rubygem-ZenTest-doc-function &>/dev/null; then - LOG_INFO "检测到软件包rubygem-ZenTest-doc-function已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "检测到软件包rubygem-ZenTest-doc-function未安装,将在测试结束后卸载" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在软件包rubygem-ZenTest-doc-function" - if ! dnf list available rubygem-ZenTest-doc-function &>/dev/null; then - LOG_ERROR "yum源中未找到软件包rubygem-ZenTest-doc-function" - exit 255 - fi - - # 安装软件包 - LOG_INFO "安装软件包rubygem-ZenTest-doc-function" - dnf install -y rubygem-ZenTest-doc-function - CHECK_RESULT $? 0 0 "安装软件包失败" - - # 验证安装 - LOG_INFO "验证软件包是否安装成功" - dnf list installed rubygem-ZenTest-doc-function - CHECK_RESULT $? 0 0 "软件包安装后验证失败" - - # 测试软件包功能(示例:检查命令是否存在) - LOG_INFO "测试软件包提供的命令" - if command -v zentest &>/dev/null; then - LOG_INFO "找到zentest命令" - else - LOG_ERROR "未找到zentest命令" - exit 1 - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载软件包rubygem-ZenTest-doc-function" - dnf remove -y rubygem-ZenTest-doc-function - CHECK_RESULT $? 0 0 "卸载软件包失败" - LOG_INFO "环境已恢复:软件包已卸载" - else - LOG_INFO "环境已恢复:保持软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rubygem-ZenTest/rubygem-ZenTest-doc/test_rubygem-ZenTest-doc_function_version.sh b/testcases/function_test/pkg_test/rubygem-ZenTest/rubygem-ZenTest-doc/test_rubygem-ZenTest-doc_function_version.sh deleted file mode 100644 index 9d077de7ae1..00000000000 --- a/testcases/function_test/pkg_test/rubygem-ZenTest/rubygem-ZenTest-doc/test_rubygem-ZenTest-doc_function_version.sh +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-26 -# @License : Mulan PSL v2 -# @Desc : 测试查看软件包版本 -# ############################################ - -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 - elif [ $mode -eq 1 ]; then - 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:-root} - - sshpass -p "$password" ssh -o StrictHostKeyChecking=no "$user@$ip" "$cmd" - } - - # 测试查看软件包版本 - LOG_INFO "开始测试查看软件包版本功能" - - # 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在ZenTest-doc软件包" - dnf list available ZenTest-doc 2>/dev/null | grep -q "ZenTest-doc" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到ZenTest-doc软件包" - exit 255 - fi - - # 检查当前是否已安装 - LOG_INFO "检查ZenTest-doc软件包是否已安装" - if dnf list installed ZenTest-doc 2>/dev/null | grep -q "ZenTest-doc"; then - LOG_INFO "ZenTest-doc软件包已安装,测试后保持安装状态" - already_installed=true - else - LOG_INFO "ZenTest-doc软件包未安装,将在测试过程中安装" - already_installed=false - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = "false" ]; then - LOG_INFO "安装ZenTest-doc软件包" - dnf install -y ZenTest-doc - CHECK_RESULT $? 0 0 "安装ZenTest-doc软件包失败" - fi - - # 测试查看软件包版本 - LOG_INFO "测试查看ZenTest-doc软件包版本" - rpm -q ZenTest-doc --qf "%{VERSION}-%{RELEASE}\n" - CHECK_RESULT $? 0 0 "查看ZenTest-doc软件包版本失败" - - # 测试gem命令查看版本(如果软件包提供gem) - LOG_INFO "测试使用gem命令查看版本" - if command -v gem &>/dev/null; then - gem list | grep -i zentest - if [ $? -eq 0 ]; then - LOG_INFO "使用gem命令查看ZenTest版本成功" - else - LOG_INFO "ZenTest未通过gem安装,跳过gem版本检查" - fi - fi - - # 清理环境 - LOG_INFO "清理测试环境" - if [ "$already_installed" = "false" ]; then - LOG_INFO "卸载测试安装的ZenTest-doc软件包" - dnf remove -y ZenTest-doc - CHECK_RESULT $? 0 0 "卸载ZenTest-doc软件包失败" - else - LOG_INFO "保持ZenTest-doc软件包安装状态" - fi - - LOG_INFO "测试查看软件包版本功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-e/texlive-cinzel-doc/test_texlive-cinzel-doc_function_check.sh b/testcases/function_test/pkg_test/texlive-split-e/texlive-cinzel-doc/test_texlive-cinzel-doc_function_check.sh deleted file mode 100644 index 7441c8eae71..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-e/texlive-cinzel-doc/test_texlive-cinzel-doc_function_check.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-01 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-cinzel-doc 软件包文档文件在安装后是否存在 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试 texlive-cinzel-doc 软件包文档文件在安装后是否存在 - - LOG_INFO "1. 检查是否已安装 texlive-cinzel-doc 软件包" - rpm -q texlive-cinzel-doc - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试完成后将保持安装状态" - INSTALLED="yes" - else - LOG_INFO "软件包未安装,将在测试完成后卸载" - INSTALLED="no" - fi - - LOG_INFO "2. 检查 yum 源中是否存在 texlive-cinzel-doc 软件包" - dnf list available texlive-cinzel-doc - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中不存在 texlive-cinzel-doc 软件包" - exit 255 - fi - - if [ "$INSTALLED" = "no" ]; then - LOG_INFO "3. 安装 texlive-cinzel-doc 软件包" - dnf install -y texlive-cinzel-doc - CHECK_RESULT $? 0 0 "安装 texlive-cinzel-doc 失败" - fi - - LOG_INFO "4. 检查 texlive-cinzel-doc 文档文件是否存在" - rpm -ql texlive-cinzel-doc | grep -E "\.pdf$|\.html$|\.txt$|\.md$" | head -5 - CHECK_RESULT $? 0 0 "texlive-cinzel-doc 文档文件不存在或不符合预期" - - LOG_INFO "5. 验证特定文档文件路径" - DOC_PATH=$(rpm -ql texlive-cinzel-doc | grep -E "/doc/" | head -1) - if [ -n "$DOC_PATH" ]; then - LOG_INFO "找到文档路径: $DOC_PATH" - ls -la "$DOC_PATH" - CHECK_RESULT $? 0 0 "无法访问文档路径" - else - LOG_ERROR "未找到文档路径" - CHECK_RESULT 1 0 0 "未找到文档路径" - fi - - if [ "$INSTALLED" = "no" ]; then - LOG_INFO "6. 卸载 texlive-cinzel-doc 软件包" - dnf remove -y texlive-cinzel-doc - CHECK_RESULT $? 0 0 "卸载 texlive-cinzel-doc 失败" - fi - - LOG_INFO "7. 测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-e/texlive-cinzel-doc/test_texlive-cinzel-doc_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-e/texlive-cinzel-doc/test_texlive-cinzel-doc_function_uninstall.sh deleted file mode 100644 index 549697f247a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-e/texlive-cinzel-doc/test_texlive-cinzel-doc_function_uninstall.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-01 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-cinzel-doc 软件包能否通过包管理器成功卸载 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-cinzel-doc 软件包卸载功能" - - # 检查软件包是否在yum源中 - LOG_INFO "检查 yum 源中是否存在 texlive-cinzel-doc 软件包" - dnf list available texlive-cinzel-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-cinzel-doc 软件包不在 yum 源中" - exit 255 - fi - - # 检查软件包是否已安装 - LOG_INFO "检查 texlive-cinzel-doc 是否已安装" - rpm -q texlive-cinzel-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试后保持安装状态" - WAS_INSTALLED=true - else - LOG_INFO "软件包未安装,将先安装再测试卸载" - WAS_INSTALLED=false - fi - - # 如果未安装,则先安装 - if [ "$WAS_INSTALLED" = false ]; then - LOG_INFO "安装 texlive-cinzel-doc 软件包" - dnf install -y texlive-cinzel-doc - CHECK_RESULT $? 0 0 "安装 texlive-cinzel-doc 失败" - fi - - # 测试卸载功能 - LOG_INFO "测试卸载 texlive-cinzel-doc 软件包" - dnf remove -y texlive-cinzel-doc - CHECK_RESULT $? 0 0 "卸载 texlive-cinzel-doc 失败" - - # 验证卸载是否成功 - LOG_INFO "验证软件包是否已卸载" - rpm -q texlive-cinzel-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "软件包卸载失败,仍然存在" - exit 1 - else - LOG_INFO "软件包卸载成功" - fi - - # 环境恢复 - LOG_INFO "恢复测试环境" - if [ "$WAS_INSTALLED" = true ]; then - LOG_INFO "重新安装 texlive-cinzel-doc 以恢复原状态" - dnf install -y texlive-cinzel-doc - CHECK_RESULT $? 0 0 "重新安装 texlive-cinzel-doc 失败" - else - LOG_INFO "测试前未安装,无需恢复" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-e/texlive-cinzel-doc/test_texlive-cinzel-doc_function_view.sh b/testcases/function_test/pkg_test/texlive-split-e/texlive-cinzel-doc/test_texlive-cinzel-doc_function_view.sh deleted file mode 100644 index a30f5f91f26..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-e/texlive-cinzel-doc/test_texlive-cinzel-doc_function_view.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-01 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-cinzel-doc 软件包的文档内容能否正常读取 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-cinzel-doc - LOG_INFO "检查是否已安装texlive-cinzel-doc" - if dnf list installed texlive-cinzel-doc &>/dev/null; then - LOG_INFO "texlive-cinzel-doc已安装,测试结束后保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "texlive-cinzel-doc未安装,将在测试中安装" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否存在texlive-cinzel-doc - LOG_INFO "检查yum源中是否存在texlive-cinzel-doc" - if ! dnf list available texlive-cinzel-doc &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-cinzel-doc软件包" - exit 255 - fi - - # 如果未安装则安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "安装texlive-cinzel-doc软件包" - dnf install -y texlive-cinzel-doc - CHECK_RESULT $? 0 0 "安装texlive-cinzel-doc失败" - fi - - # 测试文档内容能否正常读取 - LOG_INFO "测试texlive-cinzel-doc文档内容读取" - # 查找文档文件 - DOC_FILE=$(find /usr/share/doc -name "*cinzel*" -type f | head -1) - if [ -z "$DOC_FILE" ]; then - LOG_ERROR "未找到texlive-cinzel-doc文档文件" - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-cinzel-doc" - dnf remove -y texlive-cinzel-doc - fi - exit 1 - fi - - # 尝试读取文档内容 - LOG_INFO "尝试读取文档文件:$DOC_FILE" - head -n 10 "$DOC_FILE" &>/dev/null - CHECK_RESULT $? 0 0 "读取texlive-cinzel-doc文档失败" - - # 检查文档内容是否包含相关关键词 - LOG_INFO "检查文档内容是否包含相关关键词" - if grep -i "cinzel" "$DOC_FILE" &>/dev/null || grep -i "font" "$DOC_FILE" &>/dev/null; then - LOG_INFO "文档内容检查通过" - else - LOG_ERROR "文档内容未找到相关关键词" - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-cinzel-doc" - dnf remove -y texlive-cinzel-doc - fi - exit 1 - fi - - # 清理环境 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-cinzel-doc" - dnf remove -y texlive-cinzel-doc - CHECK_RESULT $? 0 0 "卸载texlive-cinzel-doc失败" - else - LOG_INFO "保持texlive-cinzel-doc安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hacm/test_texlive-hacm_function_checkfiles.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hacm/test_texlive-hacm_function_checkfiles.sh deleted file mode 100644 index 7659199b8ab..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hacm/test_texlive-hacm_function_checkfiles.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-02-23 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-hacm 核心文件是否已正确安装到系统路径中。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-hacm 核心文件是否已正确安装到系统路径中" - - LOG_INFO "检查 texlive-hacm 软件包是否在 yum 源中" - if ! dnf list texlive-hacm &>/dev/null; then - LOG_ERROR "texlive-hacm 软件包不在 yum 源中" - exit 255 - fi - - LOG_INFO "检查系统是否已安装 texlive-hacm" - if rpm -q texlive-hacm &>/dev/null; then - LOG_INFO "texlive-hacm 已安装,测试结束后保持安装状态" - already_installed=1 - else - LOG_INFO "texlive-hacm 未安装,将执行安装步骤" - already_installed=0 - fi - - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装 texlive-hacm 软件包" - dnf install -y texlive-hacm - CHECK_RESULT $? 0 0 "安装 texlive-hacm 失败" - fi - - LOG_INFO "检查 texlive-hacm 核心文件是否已正确安装到系统路径中" - expected_files=( - "/usr/share/texlive/texmf-dist/tex/latex/hacm/hacm.sty" - "/usr/share/texlive/texmf-dist/fonts/tfm/public/hacm/cmex10.tfm" - "/usr/share/texlive/texmf-dist/fonts/type1/public/hacm/cmex10.pfb" - ) - - for file in "${expected_files[@]}"; do - if [ -f "$file" ]; then - LOG_INFO "文件 $file 存在" - else - LOG_ERROR "文件 $file 不存在" - exit 1 - fi - done - - LOG_INFO "texlive-hacm 核心文件检查完成" - - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载 texlive-hacm 软件包" - dnf remove -y texlive-hacm - CHECK_RESULT $? 0 0 "卸载 texlive-hacm 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hacm/test_texlive-hacm_function_latexcompile.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hacm/test_texlive-hacm_function_latexcompile.sh deleted file mode 100644 index 23b01be0a79..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hacm/test_texlive-hacm_function_latexcompile.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-02-23 -# @License : Mulan PSL v2 -# @Desc : 测试使用 texlive-hacm 宏包编写并编译一个简单的 LaTeX 文档。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-hacm 宏包编写并编译一个简单的 LaTeX 文档" - - # 检查是否已安装 texlive-hacm - LOG_INFO "检查 texlive-hacm 是否已安装" - if dnf list installed texlive-hacm &>/dev/null; then - LOG_INFO "texlive-hacm 已安装,测试结束后保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texlive-hacm 未安装,将在测试中安装" - INSTALLED_BEFORE=false - fi - - # 检查 yum 源中是否有 texlive-hacm 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-hacm 软件包" - if ! dnf list available texlive-hacm &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-hacm 软件包" - exit 255 - fi - - # 如果未安装,则安装 texlive-hacm - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装 texlive-hacm" - dnf install -y texlive-hacm - CHECK_RESULT $? 0 0 "安装 texlive-hacm 失败" - fi - - # 创建测试用的 LaTeX 文档 - LOG_INFO "创建测试用的 LaTeX 文档" - cat > test_hacm.tex << "EOF" - \documentclass{article} - \usepackage{hacm} - \begin{document} - Hello, World with HACM! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建 LaTeX 文档失败" - - # 编译 LaTeX 文档 - LOG_INFO "使用 pdflatex 编译 LaTeX 文档" - pdflatex test_hacm.tex - CHECK_RESULT $? 0 0 "编译 LaTeX 文档失败" - - # 检查是否生成 PDF 文件 - LOG_INFO "检查是否生成 PDF 文件" - if [ -f test_hacm.pdf ]; then - LOG_INFO "成功生成 PDF 文件" - else - LOG_ERROR "未生成 PDF 文件" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_hacm.tex test_hacm.pdf test_hacm.log test_hacm.aux test_hacm.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载 texlive-hacm - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载 texlive-hacm" - dnf remove -y texlive-hacm - CHECK_RESULT $? 0 0 "卸载 texlive-hacm 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hacm/test_texlive-hacm_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hacm/test_texlive-hacm_function_uninstall.sh deleted file mode 100644 index 15480566268..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hacm/test_texlive-hacm_function_uninstall.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-23 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-hacm 软件包的卸载功能,验证卸载过程是否正常完成。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-hacm" - - # 打印开始信息 - LOG_INFO "开始测试 ${PACKAGE_NAME} 软件包的卸载功能" - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - dnf list available ${PACKAGE_NAME} 2>/dev/null | grep -q "^${PACKAGE_NAME}" - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 不在yum源中" - exit 255 - fi - CHECK_RESULT $? 0 0 "检查软件包是否在yum源中失败" - - # 步骤2:检查当前环境是否已安装软件包 - LOG_INFO "步骤2:检查当前环境是否已安装软件包" - rpm -q ${PACKAGE_NAME} >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,记录安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,将在测试前安装" - INSTALLED_BEFORE=0 - fi - - # 步骤3:如果未安装,则安装软件包作为测试前提 - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "步骤3:安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4:验证软件包是否安装成功 - LOG_INFO "步骤4:验证软件包是否安装成功" - rpm -q ${PACKAGE_NAME} >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "软件包安装后验证失败" - - # 步骤5:执行卸载操作 - LOG_INFO "步骤5:执行卸载操作" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包失败" - - # 步骤6:验证软件包是否已卸载 - LOG_INFO "步骤6:验证软件包是否已卸载" - rpm -q ${PACKAGE_NAME} >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "软件包卸载后仍然存在" - CHECK_RESULT 1 0 0 "软件包卸载验证失败" - else - LOG_INFO "软件包卸载成功" - CHECK_RESULT 0 0 0 "软件包卸载验证失败" - fi - - # 步骤7:环境恢复 - LOG_INFO "步骤7:环境恢复" - if [ ${INSTALLED_BEFORE} -eq 0 ]; then - LOG_INFO "测试前未安装软件包,无需恢复" - else - LOG_INFO "重新安装软件包以恢复环境" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "恢复环境重新安装软件包失败" - rpm -q ${PACKAGE_NAME} >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "恢复环境后软件包验证失败" - fi - - LOG_INFO "测试完成:${PACKAGE_NAME} 软件包的卸载功能测试结束" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-k/texlive-hacm/test_texlive-hacm_function_version.sh b/testcases/function_test/pkg_test/texlive-split-k/texlive-hacm/test_texlive-hacm_function_version.sh deleted file mode 100644 index e89afc1ebbe..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-k/texlive-hacm/test_texlive-hacm_function_version.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-02-23 -# @License : Mulan PSL v2 -# @Desc : 测试 texlive-hacm 宏包的版本信息或可用性检查。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-hacm 宏包的版本信息或可用性检查" - - # 检查环境是否已安装 texlive-hacm - LOG_INFO "检查环境是否已安装 texlive-hacm" - if dnf list installed texlive-hacm &> /dev/null; then - LOG_INFO "texlive-hacm 已安装" - installed=true - else - LOG_INFO "texlive-hacm 未安装" - installed=false - fi - - # 检查 yum 源中是否有 texlive-hacm 软件包 - LOG_INFO "检查 yum 源中是否有 texlive-hacm 软件包" - if ! dnf list available texlive-hacm &> /dev/null; then - LOG_ERROR "yum 源中未找到 texlive-hacm 软件包" - exit 255 - fi - - # 如果未安装,则安装 texlive-hacm - if [ "$installed" = false ]; then - LOG_INFO "安装 texlive-hacm" - dnf install -y texlive-hacm - CHECK_RESULT $? 0 0 "安装 texlive-hacm 失败" - fi - - # 测试 texlive-hacm 的版本信息或可用性检查 - LOG_INFO "测试 texlive-hacm 的版本信息或可用性检查" - if command -v tlmgr &> /dev/null; then - # 使用 tlmgr 检查 texlive-hacm 包信息 - tlmgr info texlive-hacm - CHECK_RESULT $? 0 0 "获取 texlive-hacm 包信息失败" - else - # 如果 tlmgr 不存在,尝试使用其他方法检查包信息 - LOG_INFO "tlmgr 不可用,尝试其他方法检查 texlive-hacm" - rpm -qi texlive-hacm - CHECK_RESULT $? 0 0 "获取 texlive-hacm 包信息失败" - fi - - # 清理环境:如果测试前未安装,则卸载 texlive-hacm - if [ "$installed" = false ]; then - LOG_INFO "卸载 texlive-hacm" - dnf remove -y texlive-hacm - CHECK_RESULT $? 0 0 "卸载 texlive-hacm 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-n/texlive-luaindex/test_texlive-luaindex_function_check.sh b/testcases/function_test/pkg_test/texlive-split-n/texlive-luaindex/test_texlive-luaindex_function_check.sh deleted file mode 100644 index d0f2dd982fd..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-n/texlive-luaindex/test_texlive-luaindex_function_check.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : 测试检查texlive-luaindex软件包是否已正确安装,验证其核心文件或命令是否存在。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试检查texlive-luaindex软件包是否已正确安装,验证其核心文件或命令是否存在。 - - LOG_INFO "开始测试texlive-luaindex软件包功能检查" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在texlive-luaindex软件包" - dnf list available texlive-luaindex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-luaindex软件包" - exit 255 - fi - - # 检查当前是否已安装texlive-luaindex - LOG_INFO "检查系统是否已安装texlive-luaindex软件包" - dnf list installed texlive-luaindex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-luaindex软件包已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "texlive-luaindex软件包未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - # 如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-luaindex软件包" - dnf install -y texlive-luaindex - CHECK_RESULT $? 0 0 "安装texlive-luaindex软件包失败" - fi - - # 验证核心文件或命令是否存在 - LOG_INFO "验证texlive-luaindex核心文件或命令是否存在" - # 这里假设texlive-luaindex安装后会提供luaindex命令 - # 实际可能需要根据软件包实际情况调整 - which luaindex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "找到luaindex命令" - # 测试luaindex命令基本功能 - LOG_INFO "测试luaindex命令基本功能" - luaindex --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "luaindex命令无法执行" - else - # 如果没有luaindex命令,检查是否有其他核心文件 - LOG_INFO "未找到luaindex命令,检查其他核心文件" - # 检查常见的texlive-luaindex文件 - if [ -f /usr/share/texlive/texmf-dist/scripts/luaindex/luaindex.lua ]; then - LOG_INFO "找到luaindex.lua核心文件" - elif [ -f /usr/bin/luaindex ]; then - LOG_INFO "找到luaindex二进制文件" - else - LOG_INFO "检查texlive-luaindex文档文件" - rpm -ql texlive-luaindex | head -5 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未找到texlive-luaindex任何核心文件" - fi - fi - - # 验证软件包文件完整性 - LOG_INFO "验证texlive-luaindex软件包文件完整性" - rpm -V texlive-luaindex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-luaindex软件包文件不完整或已损坏" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载texlive-luaindex软件包" - dnf remove -y texlive-luaindex - CHECK_RESULT $? 0 0 "卸载texlive-luaindex软件包失败" - else - LOG_INFO "保持texlive-luaindex软件包安装状态" - fi - - LOG_INFO "texlive-luaindex软件包功能检查测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-n/texlive-luaindex/test_texlive-luaindex_function_install.sh b/testcases/function_test/pkg_test/texlive-split-n/texlive-luaindex/test_texlive-luaindex_function_install.sh deleted file mode 100644 index d4b132f11c9..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-n/texlive-luaindex/test_texlive-luaindex_function_install.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-luaindex软件包的安装功能,验证是否能够成功安装到系统中。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-luaindex软件包的安装功能" - - LOG_INFO "检查texlive-luaindex软件包是否已在yum源中" - dnf list available texlive-luaindex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-luaindex软件包" - exit 255 - fi - - LOG_INFO "检查当前是否已安装texlive-luaindex软件包" - if rpm -q texlive-luaindex > /dev/null 2>&1; then - LOG_INFO "检测到texlive-luaindex已安装,将保持安装状态" - already_installed=true - else - LOG_INFO "未安装texlive-luaindex,将执行安装测试" - already_installed=false - fi - - if [ "$already_installed" = false ]; then - LOG_INFO "执行安装texlive-luaindex软件包" - dnf install -y texlive-luaindex - CHECK_RESULT $? 0 0 "安装texlive-luaindex失败" - - LOG_INFO "验证texlive-luaindex是否安装成功" - rpm -q texlive-luaindex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证texlive-luaindex安装失败" - fi - - LOG_INFO "测试texlive-luaindex基本功能" - rpm -qi texlive-luaindex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "查询texlive-luaindex包信息失败" - - if [ "$already_installed" = false ]; then - LOG_INFO "清理环境:卸载texlive-luaindex软件包" - dnf remove -y texlive-luaindex - CHECK_RESULT $? 0 0 "卸载texlive-luaindex失败" - - LOG_INFO "验证texlive-luaindex是否已卸载" - rpm -q texlive-luaindex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "texlive-luaindex卸载失败" - exit 1 - fi - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-n/texlive-luaindex/test_texlive-luaindex_function_usage.sh b/testcases/function_test/pkg_test/texlive-split-n/texlive-luaindex/test_texlive-luaindex_function_usage.sh deleted file mode 100644 index 10e3db35bda..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-n/texlive-luaindex/test_texlive-luaindex_function_usage.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-15 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-luaindex软件包的基本用法,例如通过简单LaTeX文档验证其索引功能是否正常工作。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-luaindex软件包的基本用法" - LOG_INFO "检查texlive-luaindex软件包是否已在yum源中" - dnf list available texlive-luaindex - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-luaindex软件包在yum源中不存在" - exit 255 - fi - - LOG_INFO "检查系统是否已安装texlive-luaindex" - rpm -q texlive-luaindex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-luaindex已安装,测试后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-luaindex未安装,将进行安装" - INSTALLED=false - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-luaindex软件包" - dnf install -y texlive-luaindex - CHECK_RESULT $? 0 0 "安装texlive-luaindex失败" - fi - - LOG_INFO "创建一个简单的LaTeX文档以测试索引功能" - cat > test_index.tex << "EOF" - \documentclass{article} - \usepackage{luaindex} - \begin{document} - Hello, \index{world}world! - \printindex - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败" - - LOG_INFO "使用lualatex编译LaTeX文档(第一次运行,生成索引文件)" - lualatex test_index.tex - CHECK_RESULT $? 0 0 "第一次lualatex编译失败" - - LOG_INFO "使用lualatex编译LaTeX文档(第二次运行,处理索引)" - lualatex test_index.tex - CHECK_RESULT $? 0 0 "第二次lualatex编译失败" - - LOG_INFO "检查是否生成了索引输出文件(如test_index.ind)" - if [ -f test_index.ind ]; then - LOG_INFO "成功生成索引文件test_index.ind" - else - LOG_ERROR "未生成索引文件test_index.ind,索引功能可能异常" - exit 1 - fi - - LOG_INFO "清理测试生成的文件" - rm -f test_index.tex test_index.aux test_index.log test_index.ind test_index.ilg test_index.out test_index.pdf - - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-luaindex软件包" - dnf remove -y texlive-luaindex - CHECK_RESULT $? 0 0 "卸载texlive-luaindex失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "测试完成,texlive-luaindex保持安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-o/texlive-memexsupp/test_texlive-memexsupp_function_use.sh b/testcases/function_test/pkg_test/texlive-split-o/texlive-memexsupp/test_texlive-memexsupp_function_use.sh deleted file mode 100644 index cb1a55c7d2b..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-o/texlive-memexsupp/test_texlive-memexsupp_function_use.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Test basic usage of memexsupp package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试TeX Live memexsupp包的基本使用功能 - - LOG_INFO "开始测试TeX Live memexsupp包的基本使用功能" - - # 定义软件包名称 - PACKAGE_NAME="texlive-memexsupp" - LOG_INFO "测试软件包: $PACKAGE_NAME" - - # 步骤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 - LOG_INFO "软件包 $PACKAGE_NAME 在yum源中可用" - - # 步骤2: 检查当前是否已安装 - LOG_INFO "步骤2: 检查当前是否已安装" - INSTALLED=false - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - INSTALLED=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - INSTALLED=false - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3: 安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $PACKAGE_NAME 安装成功" - fi - - # 步骤4: 验证memexsupp包的基本功能 - LOG_INFO "步骤4: 验证memexsupp包的基本功能" - - # 检查memexsupp.sty文件是否存在 - LOG_INFO "检查memexsupp.sty文件是否存在" - MEMEXSUPP_FILE=$(kpsewhich memexsupp.sty) - if [ -n "$MEMEXSUPP_FILE" ] && [ -f "$MEMEXSUPP_FILE" ]; then - LOG_INFO "找到memexsupp.sty文件: $MEMEXSUPP_FILE" - else - LOG_ERROR "未找到memexsupp.sty文件" - CHECK_RESULT 1 0 0 "memexsupp.sty文件不存在" - fi - - # 步骤5: 测试基本的LaTeX文档编译 - LOG_INFO "步骤5: 测试基本的LaTeX文档编译" - - # 创建测试LaTeX文档 - TEST_TEX_FILE="/tmp/test_memexsupp.tex" - cat > $TEST_TEX_FILE << "EOF" - \documentclass{article} - \usepackage{memexsupp} - \begin{document} - Test document using memexsupp package. - \end{document} - EOF - - LOG_INFO "创建测试LaTeX文档: $TEST_TEX_FILE" - - # 尝试编译文档(不实际生成PDF,只检查语法) - LOG_INFO "尝试编译LaTeX文档(语法检查)" - pdflatex -draftmode -interaction=nonstopmode $TEST_TEX_FILE &>/dev/null - COMPILE_RESULT=$? - - if [ $COMPILE_RESULT -eq 0 ] || [ $COMPILE_RESULT -eq 1 ]; then - # LaTeX返回0表示成功,1表示有警告但成功 - LOG_INFO "LaTeX文档编译检查通过" - CHECK_RESULT 0 0 0 "LaTeX文档编译失败" - else - LOG_ERROR "LaTeX文档编译失败,退出码: $COMPILE_RESULT" - CHECK_RESULT $COMPILE_RESULT 0 0 "LaTeX文档编译失败" - fi - - # 步骤6: 检查memexsupp包提供的命令 - LOG_INFO "步骤6: 检查memexsupp包提供的命令" - - # 检查memexsupp包文档 - LOG_INFO "检查memexsupp包文档" - if [ -f "/usr/share/texlive/texmf-dist/doc/latex/memexsupp/README" ] || \ - [ -f "/usr/share/doc/texlive-doc/latex/memexsupp/README" ]; then - LOG_INFO "找到memexsupp包文档" - else - LOG_INFO "未找到memexsupp包文档,这可能是正常的" - fi - - # 步骤7: 清理测试文件 - LOG_INFO "步骤7: 清理测试文件" - rm -f /tmp/test_memexsupp.* 2>/dev/null - LOG_INFO "测试文件清理完成" - - # 步骤8: 环境恢复 - LOG_INFO "步骤8: 环境恢复" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载测试安装的软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $PACKAGE_NAME 卸载成功" - else - LOG_INFO "保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试TeX Live memexsupp包的基本使用功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-intersect/test_texlive-pst-intersect_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-intersect/test_texlive-pst-intersect_function_basic.sh deleted file mode 100644 index ee0b6465905..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-intersect/test_texlive-pst-intersect_function_basic.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Basic functionality test -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始执行测试脚本:test_texlive-pst-intersect_function_basic" - LOG_INFO "测试用例描述:Basic functionality test" - - # 检查软件包是否已安装 - LOG_INFO "检查环境是否已安装texlive-pst-intersect软件包" - if dnf list installed texlive-pst-intersect &>/dev/null; then - LOG_INFO "环境已安装texlive-pst-intersect软件包" - INSTALLED=true - else - LOG_INFO "环境未安装texlive-pst-intersect软件包" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-pst-intersect软件包" - if ! dnf list available texlive-pst-intersect &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-pst-intersect软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-pst-intersect软件包" - dnf install -y texlive-pst-intersect - CHECK_RESULT $? 0 0 "安装texlive-pst-intersect失败" - fi - - # 测试命令功能 - LOG_INFO "测试texlive-pst-intersect基本功能" - pst-intersect --version - CHECK_RESULT $? 0 0 "pst-intersect命令执行失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-pst-intersect软件包" - dnf remove -y texlive-pst-intersect - CHECK_RESULT $? 0 0 "卸载texlive-pst-intersect失败" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-x/texlive-simplivre/test_texlive-simplivre_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-x/texlive-simplivre/test_texlive-simplivre_function_basic.sh deleted file mode 100644 index a32076b088b..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-x/texlive-simplivre/test_texlive-simplivre_function_basic.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-26 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality of texlive-simplivre -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-simplivre的基本功能" - - # 检查是否已安装texlive-simplivre - LOG_INFO "检查texlive-simplivre是否已安装" - if dnf list installed texlive-simplivre &> /dev/null; then - LOG_INFO "texlive-simplivre已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-simplivre未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-simplivre - LOG_INFO "检查yum源中是否有texlive-simplivre" - if ! dnf list available texlive-simplivre &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-simplivre" - exit 255 - fi - - # 安装texlive-simplivre - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-simplivre" - dnf install -y texlive-simplivre - CHECK_RESULT $? 0 0 "安装texlive-simplivre失败" - fi - - # 测试texlive-simplivre基本功能 - LOG_INFO "测试texlive-simplivre基本功能" - texlive-simplivre --version - CHECK_RESULT $? 0 0 "texlive-simplivre版本检查失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-simplivre" - dnf remove -y texlive-simplivre - CHECK_RESULT $? 0 0 "卸载texlive-simplivre失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file