diff --git a/suite2cases/function_test/pkg_test/ant/ant-jdepend.json b/suite2cases/function_test/pkg_test/ant/ant-jdepend.json index 778fb99431a..4aa89f3dde8 100644 --- a/suite2cases/function_test/pkg_test/ant/ant-jdepend.json +++ b/suite2cases/function_test/pkg_test/ant/ant-jdepend.json @@ -6,10 +6,6 @@ "name": "test_ant-jdepend_install", "desc": "测试ant-jdepend软件包的安装功能,验证是否能够正确安装到系统中。", "machine num": 1 - }, - { - "name": "test_ant-jdepend_function_analyze", - "desc": "测试ant-jdepend软件包的分析功能,验证是否能够正确分析依赖关系。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/bolt/bolt-help.json b/suite2cases/function_test/pkg_test/bolt/bolt-help.json deleted file mode 100644 index 9bb568428a3..00000000000 --- a/suite2cases/function_test/pkg_test/bolt/bolt-help.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/bolt/bolt-help", - "machine num": 1, - "cases": [ - { - "name": "test_bolt-help_function_check_install", - "desc": "测试 bolt-help 软件包是否已正确安装,验证其可执行文件或帮助文档是否存在。" - }, - { - "name": "test_bolt-help_function_show_help", - "desc": "测试运行 bolt-help 命令是否能显示基本的帮助信息或用法说明。" - }, - { - "name": "test_bolt-help_function_list_topics", - "desc": "测试 bolt-help 命令能否列出所有可用的帮助主题或子命令。" - }, - { - "name": "test_bolt-help_function_specific_topic", - "desc": "测试 bolt-help 命令查看特定帮助主题(如 config)时,能返回对应的详细内容。" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/lucene/lucene-memory.json b/suite2cases/function_test/pkg_test/lucene/lucene-memory.json index bc23c6fbbbf..59a1db0c621 100644 --- a/suite2cases/function_test/pkg_test/lucene/lucene-memory.json +++ b/suite2cases/function_test/pkg_test/lucene/lucene-memory.json @@ -5,10 +5,6 @@ { "name": "test_lucene-memory_function_install", "desc": "Test the installation of lucene-memory package" - }, - { - "name": "test_lucene-memory_function_search", - "desc": "Test the search functionality of lucene-memory package" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/maven-wagon/maven-wagon-ssh-external.json b/suite2cases/function_test/pkg_test/maven-wagon/maven-wagon-ssh-external.json index b3101335a17..1825fa8433e 100644 --- a/suite2cases/function_test/pkg_test/maven-wagon/maven-wagon-ssh-external.json +++ b/suite2cases/function_test/pkg_test/maven-wagon/maven-wagon-ssh-external.json @@ -6,18 +6,6 @@ "name": "test_maven-wagon-ssh-external_install", "desc": "测试软件包的安装功能,验证是否能够正确安装到系统中。", "machine num": 1 - }, - { - "name": "test_maven-wagon-ssh-external_function_upload", - "desc": "测试软件包的上传功能,验证文件是否能正确上传到远程服务器。" - }, - { - "name": "test_maven-wagon-ssh-external_function_download", - "desc": "测试软件包的下载功能,验证文件是否能正确从远程服务器下载。" - }, - { - "name": "test_maven-wagon-ssh-external_function_auth", - "desc": "测试软件包的认证功能,验证是否能正确处理SSH认证。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/maven2/maven-artifact-manager.json b/suite2cases/function_test/pkg_test/maven2/maven-artifact-manager.json deleted file mode 100644 index f9c6b68a0fd..00000000000 --- a/suite2cases/function_test/pkg_test/maven2/maven-artifact-manager.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/maven2/maven-artifact-manager", - "machine num": 1, - "cases": [ - { - "name": "test_maven-artifact-manager_function_download", - "desc": "Test the artifact download functionality" - }, - { - "name": "test_maven-artifact-manager_function_upload", - "desc": "Test the artifact upload functionality" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/mtx/mtx-help.json b/suite2cases/function_test/pkg_test/mtx/mtx-help.json deleted file mode 100644 index ef9eaed1a1f..00000000000 --- a/suite2cases/function_test/pkg_test/mtx/mtx-help.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/mtx/mtx-help", - "machine num": 1, - "cases": [ - { - "name": "test_mtx-help_function_install", - "desc": "Test the installation of mtx-help package" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-zope-interface/python3-zope-interface.json b/suite2cases/function_test/pkg_test/python-zope-interface/python3-zope-interface.json deleted file mode 100644 index 8f360157372..00000000000 --- a/suite2cases/function_test/pkg_test/python-zope-interface/python3-zope-interface.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/python-zope-interface/python3-zope-interface", - "machine num": 1, - "cases": [ - { - "name": "test_python3-zope-interface_function_interface", - "desc": "Test basic interface functionality" - }, - { - "name": "test_python3-zope-interface_function_adapter", - "desc": "Test adapter pattern functionality" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/qt6-qtconnectivity/qt6-qtconnectivity-devel.json b/suite2cases/function_test/pkg_test/qt6-qtconnectivity/qt6-qtconnectivity-devel.json deleted file mode 100644 index b2bfcdca60c..00000000000 --- a/suite2cases/function_test/pkg_test/qt6-qtconnectivity/qt6-qtconnectivity-devel.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/qt6-qtconnectivity/qt6-qtconnectivity-devel", - "machine num": 1, - "cases": [ - { - "name": "test_qt6-qtconnectivity-devel_function_bluetooth", - "desc": "Test Bluetooth connectivity functionality" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-a/texlive-adobemapping.json b/suite2cases/function_test/pkg_test/texlive-split-a/texlive-adobemapping.json index 747b1f29f44..10b75ec3eb9 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-a/texlive-adobemapping.json +++ b/suite2cases/function_test/pkg_test/texlive-split-a/texlive-adobemapping.json @@ -5,22 +5,6 @@ { "name": "test_texlive-adobemapping_function_install", "desc": "Test installation of texlive-adobemapping package" - }, - { - "name": "test_texlive-adobemapping_function_check_installed", - "desc": "Verify the package is correctly installed in the TeX system" - }, - { - "name": "test_texlive-adobemapping_function_map_file", - "desc": "Test the presence and basic validity of the Adobe mapping file (e.g., pdftex.map)" - }, - { - "name": "test_texlive-adobemapping_function_uninstall", - "desc": "Test removal of the texlive-adobemapping package" - }, - { - "name": "test_texlive-adobemapping_function_usage_font", - "desc": "Test basic font usage with the mapping in a simple LaTeX document" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-c/texlive-bezierplot.json b/suite2cases/function_test/pkg_test/texlive-split-c/texlive-bezierplot.json deleted file mode 100644 index 5989cabc153..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-c/texlive-bezierplot.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-bezierplot_function_draw", - "desc": "Test drawing bezier curves" - }, - { - "name": "test_texlive-bezierplot_function_install", - "desc": "Test installing the texlive-bezierplot package" - }, - { - "name": "test_texlive-bezierplot_function_uninstall", - "desc": "Test uninstalling the texlive-bezierplot package" - }, - { - "name": "test_texlive-bezierplot_function_check_installed", - "desc": "Test verifying the package is installed" - }, - { - "name": "test_texlive-bezierplot_function_draw_curve", - "desc": "Test drawing a bezier curve" - }, - { - "name": "test_texlive-bezierplot_function_set_style", - "desc": "Test setting curve line style" - }, - { - "name": "test_texlive-bezierplot_function_label_points", - "desc": "Test labeling control points" - }, - { - "name": "test_texlive-bezierplot_function_compile_doc", - "desc": "Test compiling a LaTeX document" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-d/texlive-carbohydrates.json b/suite2cases/function_test/pkg_test/texlive-split-d/texlive-carbohydrates.json index ffe16aaf455..ffaf5099f44 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-d/texlive-carbohydrates.json +++ b/suite2cases/function_test/pkg_test/texlive-split-d/texlive-carbohydrates.json @@ -2,14 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-d/texlive-carbohydrates", "machine num": 1, "cases": [ - { - "name": "test_texlive-carbohydrates_function_install", - "desc": "Test package installation" - }, - { - "name": "test_texlive-carbohydrates_function_uninstall", - "desc": "Test package removal" - }, { "name": "test_texlive-carbohydrates_function_list", "desc": "Test listing package files" @@ -18,10 +10,6 @@ "name": "test_texlive-carbohydrates_function_info", "desc": "Test querying package info" }, - { - "name": "test_texlive-carbohydrates_function_compile", - "desc": "Test compile with package" - }, { "name": "test_texlive-carbohydrates_function_check", "desc": "Test package existence" diff --git a/suite2cases/function_test/pkg_test/texlive-split-d/texlive-chickenize.json b/suite2cases/function_test/pkg_test/texlive-split-d/texlive-chickenize.json deleted file mode 100644 index 07515fd8f5e..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-d/texlive-chickenize.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-d/texlive-chickenize", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-chickenize_function_uninstall", - "desc": "Test package uninstallation" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-g/texlive-din1505-doc.json b/suite2cases/function_test/pkg_test/texlive-split-g/texlive-din1505-doc.json index 645b717f816..a88ed48988b 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-g/texlive-din1505-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-g/texlive-din1505-doc.json @@ -6,10 +6,6 @@ "name": "test_texlive-din1505-doc_install", "desc": "测试 texlive-din1505-doc 软件包的安装功能,验证是否能够正确安装到系统中。", "machine num": 1 - }, - { - "name": "test_texlive-din1505-doc_function_render", - "desc": "测试 texlive-din1505-doc 软件包的渲染功能,验证是否能够正确渲染文档。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-g/texlive-docbytex.json b/suite2cases/function_test/pkg_test/texlive-split-g/texlive-docbytex.json index d82c7262b19..2e677863e59 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-g/texlive-docbytex.json +++ b/suite2cases/function_test/pkg_test/texlive-split-g/texlive-docbytex.json @@ -2,26 +2,11 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex", "machine num": 1, "cases": [ - { - "name": "test_texlive-docbytex_install", - "desc": "测试texlive-docbytex软件包的安装功能,验证安装过程是否正常完成", - "machine num": 1 - }, { "name": "test_texlive-docbytex_uninstall", "desc": "测试texlive-docbytex软件包的卸载功能,验证卸载过程是否正常完成", "machine num": 1 }, - { - "name": "test_texlive-docbytex_upgrade", - "desc": "测试texlive-docbytex软件包的升级功能,验证升级过程是否正常完成", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_downgrade", - "desc": "测试texlive-docbytex软件包的降级功能,验证降级过程是否正常完成", - "machine num": 1 - }, { "name": "test_texlive-docbytex_rollback", "desc": "测试texlive-docbytex软件包的回滚功能,验证回滚过程是否正常完成", @@ -31,200 +16,6 @@ "name": "test_texlive-docbytex_reinstall", "desc": "测试texlive-docbytex软件包的重新安装功能,验证重新安装过程是否正常完成", "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_start", - "desc": "测试texlive-docbytex软件包的服务启动功能,验证服务是否能正常启动", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_stop", - "desc": "测试texlive-docbytex软件包的服务停止功能,验证服务是否能正常停止", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_restart", - "desc": "测试texlive-docbytex软件包的服务重启功能,验证服务是否能正常重启", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_status", - "desc": "测试texlive-docbytex软件包的服务状态查询功能,验证服务状态是否能正常查询", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log", - "desc": "测试texlive-docbytex软件包的服务日志查看功能,验证服务日志是否能正常查看", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_config", - "desc": "测试texlive-docbytex软件包的服务配置功能,验证服务配置是否能正常修改和生效", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_reload", - "desc": "测试texlive-docbytex软件包的服务重载功能,验证服务配置重载是否能正常生效", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_enable", - "desc": "测试texlive-docbytex软件包的服务开机自启功能,验证服务是否能正常设置为开机自启", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_disable", - "desc": "测试texlive-docbytex软件包的服务禁用开机自启功能,验证服务是否能正常取消开机自启设置", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_level", - "desc": "测试texlive-docbytex软件包的服务日志级别设置功能,验证日志级别是否能正常修改和生效", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_rotate", - "desc": "测试texlive-docbytex软件包的服务日志轮转功能,验证日志轮转是否能正常执行", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_autostart", - "desc": "测试texlive-docbytex软件包的服务自动启动功能,验证服务是否能在系统启动时自动启动", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_size", - "desc": "测试texlive-docbytex软件包的服务日志大小限制功能,验证日志大小限制是否能正常设置和生效", - "machine num": 0 - }, - { - "name": "test_texlive-docbytex_service_log_retention", - "desc": "测试texlive-docbytex软件包的服务日志保留功能,验证日志保留策略是否能正常设置和生效", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_clear", - "desc": "测试texlive-docbytex软件包的服务日志清空功能,验证日志清空是否能正常执行", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_archive", - "desc": "测试texlive-docbytex软件包的服务日志归档功能,验证日志归档是否能正常执行", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_filter", - "desc": "测试texlive-docbytex软件包的服务日志过滤功能,验证日志过滤是否能正常执行", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_timestamp", - "desc": "测试texlive-docbytex软件包的服务日志时间戳功能,验证日志时间戳是否能正常显示", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_format", - "desc": "测试texlive-docbytex软件包的服务日志格式设置功能,验证日志格式是否能正常修改和生效", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_backup", - "desc": "测试texlive-docbytex软件包的服务日志备份功能,验证日志备份是否能正常执行", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_health_check", - "desc": "测试texlive-docbytex软件包的服务健康检查功能,验证服务健康状态是否能正常检查", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_level_change", - "desc": "测试texlive-docbytex软件包的服务日志级别动态修改功能,验证日志级别是否能动态修改并生效", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_compression", - "desc": "测试texlive-docbytex软件包的服务日志压缩功能,验证日志压缩是否能正常执行", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_export", - "desc": "测试texlive-docbytex软件包的服务日志导出功能,验证日志导出是否能正常执行", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_level_query", - "desc": "测试texlive-docbytex软件包的服务日志级别查询功能,验证当前日志级别是否能正常查询", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_level_default", - "desc": "测试texlive-docbytex软件包的服务日志默认级别功能,验证日志默认级别是否符合预期", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_export_format", - "desc": "测试texlive-docbytex软件包的服务日志导出格式功能,验证日志导出格式是否符合预期", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_import", - "desc": "测试texlive-docbytex软件包的服务日志导入功能,验证日志导入是否能正常执行", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_level_set", - "desc": "测试texlive-docbytex软件包的服务日志级别设置功能,验证日志级别是否能正常设置和生效", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_level_verify", - "desc": "测试texlive-docbytex软件包的服务日志级别验证功能,验证设置的日志级别是否与实际记录一致", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_level_range", - "desc": "测试texlive-docbytex软件包的服务日志级别范围功能,验证设置超出范围的日志级别时是否能正确处理", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_level_invalid", - "desc": "测试texlive-docbytex软件包的服务日志级别无效设置功能,验证设置无效日志级别时是否能正确处理", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_level_restore", - "desc": "测试texlive-docbytex软件包的服务日志级别恢复功能,验证日志级别是否能恢复到默认级别", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_level_cycle", - "desc": "测试texlive-docbytex软件包的服务日志级别循环功能,验证日志级别循环设置是否能正常执行", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_level_max", - "desc": "测试texlive-docbytex软件包的服务日志级别最大值功能,验证设置最大日志级别是否能正常生效", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_level_min", - "desc": "测试texlive-docbytex软件包的服务日志级别最小值功能,验证设置最小日志级别是否能正常生效", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_level_cycle_set", - "desc": "测试texlive-docbytex软件包的服务日志级别循环设置功能,验证日志级别循环设置是否能正常执行", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_service_log_level_min_max", - "desc": "测试texlive-docbytex软件包的服务日志级别最小值和最大值功能,验证设置最小和最大日志级别是否能正常生效", - "machine num": 1 - }, - { - "name": "test_texlive-docbytex_function_docgen", - "desc": "测试texlive-docbytex的文档生成功能,验证是否能正常生成文档" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pst-node-doc.json b/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pst-node-doc.json index 3686bc57901..3a008babfba 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pst-node-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pst-node-doc.json @@ -5,18 +5,6 @@ { "name": "test_texlive-pst-node-doc_function_install", "desc": "Test package installation" - }, - { - "name": "test_texlive-pst-node-doc_function_remove", - "desc": "Test package removal" - }, - { - "name": "test_texlive-pst-node-doc_function_check", - "desc": "Test package presence check" - }, - { - "name": "test_texlive-pst-node-doc_function_doc_access", - "desc": "Test documentation file access" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-t/texlive-refstyle-doc.json b/suite2cases/function_test/pkg_test/texlive-split-t/texlive-refstyle-doc.json index bd3737ae94e..258b702b2b7 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-t/texlive-refstyle-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-t/texlive-refstyle-doc.json @@ -2,10 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-t/texlive-refstyle-doc", "machine num": 1, "cases": [ - { - "name": "test_texlive-refstyle-doc_function_basic", - "desc": "Check basic functionality" - }, { "name": "test_texlive-refstyle-doc_function_install", "desc": "Verify the installation of the texlive-refstyle-doc package" diff --git a/suite2cases/function_test/pkg_test/texlive-split-v/texlive-spot-doc.json b/suite2cases/function_test/pkg_test/texlive-split-v/texlive-spot-doc.json index 692e364e546..17a3e818232 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-v/texlive-spot-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-v/texlive-spot-doc.json @@ -13,14 +13,6 @@ { "name": "test_texlive-spot-doc_function_existence", "desc": "Check if texlive-spot-doc package files exist" - }, - { - "name": "test_texlive-spot-doc_function_version", - "desc": "Check the version of texlive-spot-doc package" - }, - { - "name": "test_texlive-spot-doc_function_doc_access", - "desc": "Verify access to texlive-spot-doc documentation" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-ucharcat.json b/suite2cases/function_test/pkg_test/texlive-split-y/texlive-ucharcat.json deleted file mode 100644 index 146717ae120..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-ucharcat.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-y/texlive-ucharcat", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-ucharcat_function_basic", - "desc": "Test basic functionality of ucharcat" - }, - { - "name": "test_texlive-ucharcat_function_install", - "desc": "Test installation of texlive-ucharcat package" - }, - { - "name": "test_texlive-ucharcat_function_uninstall", - "desc": "Test uninstallation of texlive-ucharcat package" - }, - { - "name": "test_texlive-ucharcat_function_check", - "desc": "Test checking if texlive-ucharcat is installed" - }, - { - "name": "test_texlive-ucharcat_function_unicode", - "desc": "Test unicode character handling" - }, - { - "name": "test_texlive-ucharcat_function_basic_use", - "desc": "Test basic command usage" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/uglify-js/js-uglify.json b/suite2cases/function_test/pkg_test/uglify-js/js-uglify.json deleted file mode 100644 index e90504e49b3..00000000000 --- a/suite2cases/function_test/pkg_test/uglify-js/js-uglify.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/uglify-js/js-uglify", - "machine num": 1, - "cases": [ - { - "name": "test_js-uglify_function_minify", - "desc": "Test minification of JS code" - }, - { - "name": "test_js-uglify_function_install", - "desc": "Test installation of js-uglify package" - }, - { - "name": "test_js-uglify_function_uninstall", - "desc": "Test uninstallation of js-uglify package" - }, - { - "name": "test_js-uglify_function_version", - "desc": "Test checking js-uglify version" - }, - { - "name": "test_js-uglify_function_cli", - "desc": "Test js-uglify CLI basic usage" - }, - { - "name": "test_js-uglify_function_sourcemap", - "desc": "Test minification with source map" - }, - { - "name": "test_js-uglify_function_mangle", - "desc": "Test minification with mangling" - }, - { - "name": "test_js-uglify_function_compress", - "desc": "Test minification with compression" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ant/ant-jdepend/test_ant-jdepend_function_analyze.sh b/testcases/function_test/pkg_test/ant/ant-jdepend/test_ant-jdepend_function_analyze.sh deleted file mode 100644 index 6068632ea65..00000000000 --- a/testcases/function_test/pkg_test/ant/ant-jdepend/test_ant-jdepend_function_analyze.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-09 -# @License : Mulan PSL v2 -# @Desc : 测试ant-jdepend软件包的分析功能,验证是否能够正确分析依赖关系。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试ant-jdepend软件包的分析功能" - - # 检查是否已安装ant-jdepend - if rpm -q ant-jdepend >/dev/null 2>&1; then - LOG_INFO "检测到ant-jdepend已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "未检测到ant-jdepend安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查yum源中是否存在ant-jdepend软件包 - LOG_INFO "检查yum源中是否存在ant-jdepend软件包" - if ! dnf list available ant-jdepend >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到ant-jdepend软件包" - exit 255 - fi - - # 安装ant-jdepend(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装ant-jdepend软件包" - dnf install -y ant-jdepend >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装ant-jdepend失败" - fi - - # 验证ant-jdepend命令是否可用 - LOG_INFO "验证ant-jdepend命令是否可用" - if ! command -v ant-jdepend >/dev/null 2>&1; then - LOG_ERROR "ant-jdepend命令不可用" - exit 255 - fi - - # 测试分析功能(假设使用--analyze参数) - LOG_INFO "测试ant-jdepend的分析功能" - if ! ant-jdepend --analyze >/dev/null 2>&1; then - LOG_ERROR "ant-jdepend分析功能测试失败" - CHECK_RESULT $? !0 0 "分析功能测试失败" - else - LOG_INFO "ant-jdepend分析功能测试通过" - fi - - # 清理环境(如果脚本开始时未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载ant-jdepend软件包" - dnf remove -y ant-jdepend >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载ant-jdepend失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复初始状态" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/bolt/bolt-help/test_bolt-help_function_check_install.sh b/testcases/function_test/pkg_test/bolt/bolt-help/test_bolt-help_function_check_install.sh deleted file mode 100644 index 665d9d4a97d..00000000000 --- a/testcases/function_test/pkg_test/bolt/bolt-help/test_bolt-help_function_check_install.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-29 -# @License : Mulan PSL v2 -# @Desc : 测试 bolt-help 软件包是否已正确安装,验证其可执行文件或帮助文档是否存在。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称和命令 - PACKAGE_NAME="bolt-help" - COMMAND_NAME="bolt-help" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "步骤1:检查yum源中是否存在${PACKAGE_NAME}软件包" - dnf list available ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - LOG_INFO "yum源中存在${PACKAGE_NAME}软件包" - - # 步骤2:检查系统是否已安装该软件包 - LOG_INFO "步骤2:检查系统是否已安装${PACKAGE_NAME}软件包" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - INSTALLED=$? - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "${PACKAGE_NAME}软件包已安装" - NEED_UNINSTALL=0 - else - LOG_INFO "${PACKAGE_NAME}软件包未安装" - NEED_UNINSTALL=1 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ ${NEED_UNINSTALL} -eq 1 ]; then - LOG_INFO "步骤3:安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}软件包失败" - LOG_INFO "成功安装${PACKAGE_NAME}软件包" - fi - - # 步骤4:验证可执行文件是否存在 - LOG_INFO "步骤4:验证${COMMAND_NAME}可执行文件是否存在" - which ${COMMAND_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "${COMMAND_NAME}可执行文件不存在" - - # 步骤5:验证帮助文档是否存在 - LOG_INFO "步骤5:验证${COMMAND_NAME}帮助文档是否存在" - ${COMMAND_NAME} --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "${COMMAND_NAME}帮助文档不存在或不可用" - - # 步骤6:验证其他常用参数 - LOG_INFO "步骤6:验证${COMMAND_NAME}其他参数支持情况" - ${COMMAND_NAME} -h > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "${COMMAND_NAME}不支持-h参数" - exit 255 - fi - LOG_INFO "${COMMAND_NAME}支持-h参数" - - # 步骤7:清理环境 - LOG_INFO "步骤7:清理测试环境" - if [ ${NEED_UNINSTALL} -eq 1 ]; then - LOG_INFO "卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}软件包失败" - LOG_INFO "成功卸载${PACKAGE_NAME}软件包,环境已恢复" - else - LOG_INFO "${PACKAGE_NAME}软件包在测试前已安装,保持安装状态" - fi - - LOG_INFO "测试完成:${PACKAGE_NAME}软件包安装验证通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/bolt/bolt-help/test_bolt-help_function_list_topics.sh b/testcases/function_test/pkg_test/bolt/bolt-help/test_bolt-help_function_list_topics.sh deleted file mode 100644 index 41a16420d6c..00000000000 --- a/testcases/function_test/pkg_test/bolt/bolt-help/test_bolt-help_function_list_topics.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-29 -# @License : Mulan PSL v2 -# @Desc : 测试 bolt-help 命令能否列出所有可用的帮助主题或子命令。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "检查测试环境是否已安装bolt软件包..." - if dnf list installed bolt &>/dev/null; then - LOG_INFO "bolt软件包已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "bolt软件包未安装,将在测试过程中安装" - INSTALLED=false - fi - - LOG_INFO "检查yum源中是否存在bolt软件包..." - if ! dnf list available bolt &>/dev/null; then - LOG_ERROR "yum源中未找到bolt软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装bolt软件包..." - dnf install -y bolt - CHECK_RESULT $? 0 0 "安装bolt软件包失败" - fi - - LOG_INFO "测试bolt-help命令能否列出所有可用的帮助主题或子命令..." - bolt help - CHECK_RESULT $? 0 0 "执行bolt-help命令失败" - - LOG_INFO "验证bolt-help命令是否支持--help参数..." - bolt help --help - if [ $? -ne 0 ]; then - LOG_ERROR "bolt-help命令不支持--help参数" - exit 255 - fi - - LOG_INFO "检查bolt-help命令输出的主题列表..." - bolt help | grep -q "Available topics" - CHECK_RESULT $? 0 0 "bolt-help命令未列出帮助主题" - - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载bolt软件包,恢复测试环境..." - dnf remove -y bolt - CHECK_RESULT $? 0 0 "卸载bolt软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/bolt/bolt-help/test_bolt-help_function_show_help.sh b/testcases/function_test/pkg_test/bolt/bolt-help/test_bolt-help_function_show_help.sh deleted file mode 100644 index 06780968ef7..00000000000 --- a/testcases/function_test/pkg_test/bolt/bolt-help/test_bolt-help_function_show_help.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-29 -# @License : Mulan PSL v2 -# @Desc : 测试运行 bolt-help 命令是否能显示基本的帮助信息或用法说明。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装bolt包 - LOG_INFO "检查是否已安装bolt包" - if rpm -q bolt > /dev/null 2>&1; then - LOG_INFO "bolt包已安装,脚本结束后保持安装状态" - already_installed=true - else - LOG_INFO "bolt包未安装,将在测试过程中安装" - already_installed=false - fi - - # 检查yum源中是否有bolt包 - LOG_INFO "检查yum源中是否有bolt包" - dnf list available bolt > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到bolt包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到bolt包" - exit 255 - fi - - # 如果未安装,则安装bolt包 - if [ "$already_installed" = "false" ]; then - LOG_INFO "安装bolt包" - dnf install -y bolt - CHECK_RESULT $? 0 0 "安装bolt包失败" - fi - - # 测试bolt-help命令是否能显示基本的帮助信息或用法说明 - LOG_INFO "测试bolt-help命令是否能显示基本的帮助信息或用法说明" - bolt --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "bolt --help命令执行失败" - - # 检查bolt --help输出是否包含帮助信息 - LOG_INFO "检查bolt --help输出是否包含帮助信息" - bolt --help | head -5 | grep -q -i "usage\|help\|command" - CHECK_RESULT $? 0 0 "bolt --help未显示基本的帮助信息或用法说明" - - # 清理环境:如果测试前未安装,则卸载bolt包 - if [ "$already_installed" = "false" ]; then - LOG_INFO "卸载bolt包" - dnf remove -y bolt - CHECK_RESULT $? 0 0 "卸载bolt包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/bolt/bolt-help/test_bolt-help_function_specific_topic.sh b/testcases/function_test/pkg_test/bolt/bolt-help/test_bolt-help_function_specific_topic.sh deleted file mode 100644 index 8650a402a7f..00000000000 --- a/testcases/function_test/pkg_test/bolt/bolt-help/test_bolt-help_function_specific_topic.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-29 -# @License : Mulan PSL v2 -# @Desc : 测试 bolt-help 命令查看特定帮助主题(如 config)时,能返回对应的详细内容。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 bolt-help 命令查看特定帮助主题(如 config)时,能返回对应的详细内容" - - LOG_INFO "步骤1:检查环境中是否已安装 bolt 软件包" - if command -v bolt > /dev/null 2>&1; then - LOG_INFO "环境中已安装 bolt 软件包,测试后将保持安装状态" - already_installed=true - else - LOG_INFO "环境中未安装 bolt 软件包,将进行安装作为测试步骤" - already_installed=false - fi - - if [ "$already_installed" = "false" ]; then - LOG_INFO "步骤2:检查 yum 源中是否存在 bolt 软件包" - dnf list available bolt 2>&1 | grep -q "bolt" - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 bolt 软件包" - exit 255 - fi - - LOG_INFO "步骤3:安装 bolt 软件包" - dnf install -y bolt - CHECK_RESULT $? 0 0 "安装 bolt 软件包失败" - fi - - LOG_INFO "步骤4:执行 bolt-help 命令查看 config 主题帮助" - bolt-help config > /tmp/bolt_help_output.txt 2>&1 - CHECK_RESULT $? 0 0 "执行 bolt-help config 命令失败" - - LOG_INFO "步骤5:检查帮助内容是否包含 config 相关详细信息" - grep -i "config" /tmp/bolt_help_output.txt > /dev/null - CHECK_RESULT $? 0 0 "帮助内容中未找到 config 相关信息" - - LOG_INFO "步骤6:验证 bolt-help 命令不支持无效参数" - bolt-help invalid_topic > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "无效参数处理正确,返回退出码 255" - else - LOG_ERROR "无效参数处理不正确" - exit 255 - fi - - LOG_INFO "步骤7:清理临时文件" - rm -f /tmp/bolt_help_output.txt - - if [ "$already_installed" = "false" ]; then - LOG_INFO "步骤8:卸载 bolt 软件包" - dnf remove -y bolt - CHECK_RESULT $? 0 0 "卸载 bolt 软件包失败" - LOG_INFO "已恢复环境,卸载了测试安装的 bolt 软件包" - else - LOG_INFO "环境已恢复,保持原有 bolt 软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/lucene/lucene-memory/test_lucene-memory_function_search.sh b/testcases/function_test/pkg_test/lucene/lucene-memory/test_lucene-memory_function_search.sh deleted file mode 100644 index ecd7128b22d..00000000000 --- a/testcases/function_test/pkg_test/lucene/lucene-memory/test_lucene-memory_function_search.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-10 -# @License : Mulan PSL v2 -# @Desc : Test the search functionality of lucene-memory package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 lucene-memory 包的搜索功能" - - # 检查软件包是否已安装 - LOG_INFO "检查 lucene-memory 是否已安装" - if dnf list installed lucene-memory &> /dev/null; then - LOG_INFO "lucene-memory 已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "lucene-memory 未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否存在 lucene-memory 包 - LOG_INFO "检查 yum 源中是否存在 lucene-memory" - if ! dnf list available lucene-memory &> /dev/null; then - LOG_ERROR "yum 源中未找到 lucene-memory 包" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装 lucene-memory" - dnf install -y lucene-memory - CHECK_RESULT $? 0 0 "lucene-memory 安装失败" - fi - - # 测试搜索功能 - LOG_INFO "测试 lucene-memory 的搜索功能" - if ! command -v lucene-search &> /dev/null; then - LOG_ERROR "lucene-search 命令不存在或不支持" - exit 255 - fi - - LOG_INFO "执行 lucene-search --test" - lucene-search --test - CHECK_RESULT $? 0 0 "lucene-search --test 执行失败" - - # 清理环境(如果最初未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 lucene-memory" - dnf remove -y lucene-memory - CHECK_RESULT $? 0 0 "lucene-memory卸载失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/maven-wagon/maven-wagon-ssh-external/test_maven-wagon-ssh-external_function_auth.sh b/testcases/function_test/pkg_test/maven-wagon/maven-wagon-ssh-external/test_maven-wagon-ssh-external_function_auth.sh deleted file mode 100644 index 5557d0ddb45..00000000000 --- a/testcases/function_test/pkg_test/maven-wagon/maven-wagon-ssh-external/test_maven-wagon-ssh-external_function_auth.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-09 -# @License : Mulan PSL v2 -# @Desc : 测试软件包的认证功能,验证是否能正确处理SSH认证。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装maven-wagon-ssh-external软件包 - LOG_INFO "检查是否已安装maven-wagon-ssh-external软件包" - rpm -q maven-wagon-ssh-external > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "maven-wagon-ssh-external已安装,脚本结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "maven-wagon-ssh-external未安装,脚本结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在maven-wagon-ssh-external软件包 - LOG_INFO "检查yum源中是否存在maven-wagon-ssh-external软件包" - dnf list available maven-wagon-ssh-external > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在maven-wagon-ssh-external软件包" - exit 255 - fi - - # 安装maven-wagon-ssh-external软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装maven-wagon-ssh-external软件包" - dnf install -y maven-wagon-ssh-external - CHECK_RESULT $? 0 0 "安装maven-wagon-ssh-external失败" - fi - - # 测试SSH认证功能 - LOG_INFO "测试SSH认证功能" - # 假设需要第二个服务器执行命令,使用SSH_CMD - SSH_CMD "ls" "$NODE2_IPV4" "$NODE2_PASSWORD" "$NODE2_USER" - CHECK_RESULT $? 0 0 "SSH认证功能测试失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载maven-wagon-ssh-external软件包" - dnf remove -y maven-wagon-ssh-external - CHECK_RESULT $? 0 0 "卸载maven-wagon-ssh-external失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/maven-wagon/maven-wagon-ssh-external/test_maven-wagon-ssh-external_function_download.sh b/testcases/function_test/pkg_test/maven-wagon/maven-wagon-ssh-external/test_maven-wagon-ssh-external_function_download.sh deleted file mode 100644 index 40e7634d3f2..00000000000 --- a/testcases/function_test/pkg_test/maven-wagon/maven-wagon-ssh-external/test_maven-wagon-ssh-external_function_download.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-09 -# @License : Mulan PSL v2 -# @Desc : 测试软件包的下载功能,验证文件是否能正确从远程服务器下载。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试软件包的下载功能,验证文件是否能正确从远程服务器下载。" - - # 检查是否已安装maven-wagon-ssh-external软件包 - LOG_INFO "检查是否已安装maven-wagon-ssh-external软件包。" - if dnf list installed maven-wagon-ssh-external &>/dev/null; then - LOG_INFO "maven-wagon-ssh-external已安装。" - installed=true - else - LOG_INFO "maven-wagon-ssh-external未安装。" - installed=false - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在maven-wagon-ssh-external软件包。" - if ! dnf list available maven-wagon-ssh-external &>/dev/null; then - LOG_ERROR "yum源中未找到maven-wagon-ssh-external软件包。" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装maven-wagon-ssh-external软件包。" - dnf install -y maven-wagon-ssh-external - CHECK_RESULT $? 0 0 "安装maven-wagon-ssh-external失败。" - fi - - # 测试下载功能 - LOG_INFO "测试从远程服务器下载文件的功能。" - download_url="http://example.com/testfile.txt" # 替换为实际的测试URL - wget "$download_url" -O /tmp/testfile.txt - CHECK_RESULT $? 0 0 "文件下载失败。" - - # 验证文件是否下载成功 - LOG_INFO "验证下载的文件是否存在。" - if [ -f "/tmp/testfile.txt" ]; then - LOG_INFO "文件下载成功。" - else - LOG_ERROR "文件下载失败。" - exit 1 - fi - - # 清理下载的文件 - LOG_INFO "清理测试文件。" - rm -f /tmp/testfile.txt - - # 如果脚本开始时未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载maven-wagon-ssh-external软件包以恢复环境。" - dnf remove -y maven-wagon-ssh-external - CHECK_RESULT $? 0 0 "卸载maven-wagon-ssh-external失败。" - fi - - LOG_INFO "测试完成,环境已恢复。" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/maven-wagon/maven-wagon-ssh-external/test_maven-wagon-ssh-external_function_upload.sh b/testcases/function_test/pkg_test/maven-wagon/maven-wagon-ssh-external/test_maven-wagon-ssh-external_function_upload.sh deleted file mode 100644 index f9b39e7b381..00000000000 --- a/testcases/function_test/pkg_test/maven-wagon/maven-wagon-ssh-external/test_maven-wagon-ssh-external_function_upload.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-09 -# @License : Mulan PSL v2 -# @Desc : 测试软件包的上传功能,验证文件是否能正确上传到远程服务器。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_maven-wagon-ssh-external_function_upload - - LOG_INFO "开始测试软件包的上传功能,验证文件是否能正确上传到远程服务器。" - - # 检查是否已安装软件包 - LOG_INFO "检查是否已安装 maven-wagon-ssh-external 软件包。" - if ! dnf list installed maven-wagon-ssh-external &>/dev/null; then - LOG_INFO "软件包未安装,准备安装。" - # 检查yum源中是否有该软件包 - if ! dnf list available maven-wagon-ssh-external &>/dev/null; then - LOG_ERROR "yum源中未找到 maven-wagon-ssh-external 软件包。" - exit 255 - fi - # 安装软件包 - dnf install -y maven-wagon-ssh-external - CHECK_RESULT $? 0 0 "安装 maven-wagon-ssh-external 软件包失败。" - INSTALLED=true - else - LOG_INFO "软件包已安装,跳过安装步骤。" - INSTALLED=false - fi - - # 测试文件上传功能 - LOG_INFO "测试文件上传功能。" - TEST_FILE="test_upload_file.txt" - echo "This is a test file for upload." > $TEST_FILE - REMOTE_PATH="/tmp/" - - # 检查参数是否存在 - if [ -z "$NODE2_IPV4" ] || [ -z "$NODE2_PASSWORD" ] || [ -z "$NODE2_USER" ]; then - LOG_ERROR "缺少必要的参数(NODE2_IPV4、NODE2_PASSWORD、NODE2_USER)。" - exit 255 - fi - - # 执行上传命令(假设使用scp上传) - LOG_INFO "尝试上传文件到远程服务器。" - SSH_CMD "mkdir -p $REMOTE_PATH" $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER - CHECK_RESULT $? 0 0 "远程服务器创建目录失败。" - scp $TEST_FILE ${NODE2_USER}@${NODE2_IPV4}:${REMOTE_PATH} - CHECK_RESULT $? 0 0 "文件上传失败。" - - # 验证文件是否上传成功 - LOG_INFO "验证文件是否上传成功。" - SSH_CMD "test -f ${REMOTE_PATH}/${TEST_FILE}" $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER - CHECK_RESULT $? 0 0 "文件未成功上传到远程服务器。" - - # 清理测试环境 - LOG_INFO "清理测试环境。" - - # 删除本地测试文件 - rm -f $TEST_FILE - - # 删除远程测试文件 - SSH_CMD "rm -f ${REMOTE_PATH}/${TEST_FILE}" $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER - CHECK_RESULT $? 0 0 "删除远程测试文件失败。" - - #如果脚本安装的软件包,则卸载它;否则保持原状。 - if [ "$INSTALLED" = true ]; then - LOG_INFO "卸载 maven-wagon-ssh-external 软件包。" - dnf remove -y maven-wagon-ssh-external - CHECK_RESULT $? 00"卸载 maven-wagon-ssh-externalfailed." - fi - - LOG_INFO “所有步骤完成,测试结束。” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/maven2/maven-artifact-manager/test_maven-artifact-manager_function_download.sh b/testcases/function_test/pkg_test/maven2/maven-artifact-manager/test_maven-artifact-manager_function_download.sh deleted file mode 100644 index 39cd8526af9..00000000000 --- a/testcases/function_test/pkg_test/maven2/maven-artifact-manager/test_maven-artifact-manager_function_download.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : Test the artifact download functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试脚本:test_maven-artifact-manager_function_download - - LOG_INFO "开始测试:Test the artifact download functionality" - - # 检查是否已安装maven-artifact-manager - if ! dnf list installed maven-artifact-manager &>/dev/null; then - LOG_INFO "环境未安装maven-artifact-manager,将进行安装测试" - INSTALLED_FOR_TEST=true - else - LOG_INFO "环境已安装maven-artifact-manager,测试后将保持安装状态" - INSTALLED_FOR_TEST=false - fi - - # 检查yum源中是否存在maven-artifact-manager软件包 - if ! dnf list available maven-artifact-manager &>/dev/null; then - LOG_ERROR "yum源中未找到maven-artifact-manager软件包" - exit 255 - fi - - # 安装maven-artifact-manager(如果未安装) - if $INSTALLED_FOR_TEST; then - LOG_INFO "正在安装maven-artifact-manager..." - dnf install -y maven-artifact-manager - CHECK_RESULT $? 0 0 "安装maven-artifact-manager失败" - fi - - # 测试artifact下载功能 - LOG_INFO "测试artifact下载功能..." - maven-artifact-manager download --artifact test-artifact --version 1.0.0 --output /tmp/test-artifact - CHECK_RESULT $? 0 0 "下载artifact失败" - - # 检查下载的文件是否存在 - if [ ! -f "/tmp/test-artifact" ]; then - LOG_ERROR "下载的artifact文件不存在" - exit 1 - fi - - # 清理下载的文件 - LOG_INFO "清理下载的artifact文件..." - rm -f /tmp/test-artifact - CHECK_RESULT $? 0 0 "清理artifact文件失败" - - # 卸载maven-artifact-manager(如果测试前未安装) - if $INSTALLED_FOR_TEST; then - LOG_INFO "正在卸载maven-artifact-manager..." - dnf remove -y maven-artifact-manager - CHECK_RESULT $? 0 0 "卸载maven-artifact-manager失败" - fi - - LOG_INFO "测试完成:Test the artifact download functionality" - - exit 0 - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/maven2/maven-artifact-manager/test_maven-artifact-manager_function_upload.sh b/testcases/function_test/pkg_test/maven2/maven-artifact-manager/test_maven-artifact-manager_function_upload.sh deleted file mode 100644 index f2fbf316543..00000000000 --- a/testcases/function_test/pkg_test/maven2/maven-artifact-manager/test_maven-artifact-manager_function_upload.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-13 -# @License : Mulan PSL v2 -# @Desc : Test the artifact upload functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装maven-artifact-manager - LOG_INFO "检查是否已安装maven-artifact-manager" - if dnf list installed maven-artifact-manager &>/dev/null; then - LOG_INFO "maven-artifact-manager已安装,脚本结束后保持安装状态" - installed=true - else - LOG_INFO "maven-artifact-manager未安装,将在脚本结束后卸载" - installed=false - fi - - # 检查yum源中是否有maven-artifact-manager - LOG_INFO "检查yum源中是否有maven-artifact-manager" - if ! dnf list available maven-artifact-manager &>/dev/null; then - LOG_ERROR "yum源中未找到maven-artifact-manager软件包" - exit 255 - fi - - # 安装maven-artifact-manager(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "安装maven-artifact-manager" - dnf install -y maven-artifact-manager - CHECK_RESULT $? 0 0 "安装maven-artifact-manager失败" - fi - - # 测试artifact上传功能 - LOG_INFO "测试artifact上传功能" - mvn deploy:deploy-file -DgroupId=com.example -DartifactId=demo -Dversion=1.0 -Dpackaging=jar -Dfile=demo.jar -Durl=http://example.com/repo -DrepositoryId=repo-id - CHECK_RESULT $? 0 0 "artifact上传失败" - - # 清理环境(如果脚本开始时未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载maven-artifact-manager" - dnf remove -y maven-artifact-manager - CHECK_RESULT $? 0 0 "卸载maven-artifact-manager失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mtx/mtx-help/test_mtx-help_function_install.sh b/testcases/function_test/pkg_test/mtx/mtx-help/test_mtx-help_function_install.sh deleted file mode 100644 index 7a10c984cd3..00000000000 --- a/testcases/function_test/pkg_test/mtx/mtx-help/test_mtx-help_function_install.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-09-12 -# @License : Mulan PSL v2 -# @Desc : Test the installation of mtx-help package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试mtx-help软件包的安装" - - # 检查yum源中是否存在mtx-help软件包 - LOG_INFO "检查yum源中是否存在mtx-help软件包" - dnf list available mtx-help &>/dev/null - CHECK_RESULT $? 0 255 "yum源中不存在mtx-help软件包" - - # 检查是否已安装mtx-help - LOG_INFO "检查是否已安装mtx-help" - if rpm -q mtx-help &>/dev/null; then - LOG_INFO "mtx-help已安装,跳过安装步骤" - installed=true - else - LOG_INFO "mtx-help未安装,开始安装" - installed=false - fi - - # 若未安装,则执行安装 - if [ "$installed" = false ]; then - LOG_INFO "安装mtx-help软件包" - dnf install -y mtx-help - CHECK_RESULT $? 0 0 "安装mtx-help软件包失败" - fi - - # 测试mtx-help命令功能 - LOG_INFO "测试mtx-help命令功能" - mtx-help --help &>/dev/null - CHECK_RESULT $? 0 255 "mtx-help命令参数不支持或不存在" - - # 若之前未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载mtx-help软件包" - dnf remove -y mtx-help - CHECK_RESULT $? 0 0 "卸载mtx-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-zope-interface/python3-zope-interface/test_python3-zope-interface_function_adapter.sh b/testcases/function_test/pkg_test/python-zope-interface/python3-zope-interface/test_python3-zope-interface_function_adapter.sh deleted file mode 100644 index 24c66b494e5..00000000000 --- a/testcases/function_test/pkg_test/python-zope-interface/python3-zope-interface/test_python3-zope-interface_function_adapter.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-08 -# @License : Mulan PSL v2 -# @Desc : Test adapter pattern functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test adapter pattern functionality" - - # 检查是否已安装python3-zope-interface - LOG_INFO "检查是否已安装python3-zope-interface" - if dnf list installed python3-zope-interface &>/dev/null; then - LOG_INFO "python3-zope-interface已安装,测试结束后将保持安装状态" - installed=true - else - LOG_INFO "python3-zope-interface未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有python3-zope-interface - LOG_INFO "检查yum源中是否有python3-zope-interface" - if ! dnf list available python3-zope-interface &>/dev/null; then - LOG_ERROR "yum源中未找到python3-zope-interface" - exit 255 - fi - - # 安装python3-zope-interface(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "开始安装python3-zope-interface" - dnf install -y python3-zope-interface - CHECK_RESULT $? 0 0 "安装python3-zope-interface失败" - fi - - # 测试adapter pattern功能 - LOG_INFO "测试adapter pattern功能" - output=$(python3 -c " - from zope.interface import Interface, implementer - - class IAnimal(Interface): - def speak(self): - pass - - @implementer(IAnimal) - class Dog: - def speak(self): - return "Woof!" - - class Cat: - def speak(self): - return "Meow!" - - from zope.interface.adapter import AdapterRegistry - - registry = AdapterRegistry() - registry.register([IAnimal], "", IAnimal, "", Cat) - - dog = Dog() - adapted_cat = registry.queryAdapter(dog, IAnimal) - print(adapted_cat.speak()) - " 2>&1) - - CHECK_RESULT $? 0 0 "执行adapter pattern测试失败" - CHECK_RESULT "$output" "Meow!" 0 "adapter pattern功能不符合预期" - - # 清理环境(如果之前未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-zope-interface" - dnf remove -y python3-zope-interface - CHECK_RESULT $? 0 0 "卸载python3-zope-interface失败" - fi - - LOG_INFO "测试完成:Test adapter pattern functionality" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-zope-interface/python3-zope-interface/test_python3-zope-interface_function_interface.sh b/testcases/function_test/pkg_test/python-zope-interface/python3-zope-interface/test_python3-zope-interface_function_interface.sh deleted file mode 100644 index e7bb07a8357..00000000000 --- a/testcases/function_test/pkg_test/python-zope-interface/python3-zope-interface/test_python3-zope-interface_function_interface.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-01 -# @License : Mulan PSL v2 -# @Desc : Test basic interface functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test basic interface functionality" - - # 检查yum源中是否存在python3-zope-interface软件包 - LOG_INFO "检查yum源中是否存在python3-zope-interface软件包" - dnf list available python3-zope-interface &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-zope-interface软件包" - exit 255 - fi - - # 检查是否已安装python3-zope-interface - LOG_INFO "检查是否已安装python3-zope-interface" - rpm -q python3-zope-interface &>/dev/null - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "python3-zope-interface已安装,脚本结束后将保持安装状态" - else - installed=false - LOG_INFO "python3-zope-interface未安装,将在测试步骤中安装" - fi - - # 若未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装python3-zope-interface软件包" - dnf install -y python3-zope-interface - CHECK_RESULT $? 0 0 "安装python3-zope-interface失败" - fi - - # 测试基本接口功能 - LOG_INFO "测试python3-zope-interface的基本接口功能" - python3 -c "import zope.interface; print(zope.interface.__version__)" &>/dev/null - CHECK_RESULT $? 0 0 "测试python3-zope-interface接口功能失败" - - # 若脚本开始时未安装,则卸载软件包以恢复环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载python3-zope-interface软件包以恢复环境" - dnf remove -y python3-zope-interface - CHECK_RESULT $? 0 0 "卸载python3-zope-interface失败" - fi - - LOG_INFO "测试完成:Test basic interface functionality" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt6-qtconnectivity/qt6-qtconnectivity-devel/test_qt6-qtconnectivity-devel_function_bluetooth.sh b/testcases/function_test/pkg_test/qt6-qtconnectivity/qt6-qtconnectivity-devel/test_qt6-qtconnectivity-devel_function_bluetooth.sh deleted file mode 100644 index 2c159094336..00000000000 --- a/testcases/function_test/pkg_test/qt6-qtconnectivity/qt6-qtconnectivity-devel/test_qt6-qtconnectivity-devel_function_bluetooth.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-03 -# @License : Mulan PSL v2 -# @Desc : Test Bluetooth connectivity functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查环境是否已安装qt6-qtconnectivity-devel - LOG_INFO "检查qt6-qtconnectivity-devel是否已安装" - rpm -q qt6-qtconnectivity-devel - if [ $? -eq 0 ]; then - LOG_INFO "qt6-qtconnectivity-devel已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "qt6-qtconnectivity-devel未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有qt6-qtconnectivity-devel - LOG_INFO "检查yum源中是否存在qt6-qtconnectivity-devel" - dnf list available qt6-qtconnectivity-devel - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt6-qtconnectivity-devel,退出" - exit 255 - fi - - # 安装qt6-qtconnectivity-devel - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装qt6-qtconnectivity-devel" - dnf install -y qt6-qtconnectivity-devel - CHECK_RESULT $? 0 0 "安装失败" - fi - - # 测试Bluetooth功能 - LOG_INFO "测试Bluetooth功能" - bluetoothctl --version - CHECK_RESULT $? 0 0 "bluetoothctl命令不支持" - - LOG_INFO "启动蓝牙服务" - systemctl start bluetooth - CHECK_RESULT $? 0 0 "启动蓝牙服务失败" - - LOG_INFO "检查蓝牙服务状态" - systemctl status bluetooth | grep "active (running)" - CHECK_RESULT $? 0 0 "蓝牙服务未运行" - - LOG_INFO "扫描蓝牙设备" - bluetoothctl scan on & - SCAN_PID=$! - sleep 10 - kill $SCAN_PID - CHECK_RESULT $? 0 0 "扫描蓝牙设备失败" - - # 清理环境,恢复之前状态 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载qt6-qtconnectivity-devel" - dnf remove -y qt6-qtconnectivity-devel - CHECK_RESULT $? 0 0 "卸载失败" - fi - - LOG_INFO "停止蓝牙服务" - systemctl stop bluetooth -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-a/texlive-adobemapping/test_texlive-adobemapping_function_check_installed.sh b/testcases/function_test/pkg_test/texlive-split-a/texlive-adobemapping/test_texlive-adobemapping_function_check_installed.sh deleted file mode 100644 index 99b73479717..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-a/texlive-adobemapping/test_texlive-adobemapping_function_check_installed.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-03 -# @License : Mulan PSL v2 -# @Desc : Verify the package is correctly installed in the TeX system -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - PACKAGE_NAME="texlive-adobemapping" - LOG_INFO "测试开始:验证TeX系统中${PACKAGE_NAME}软件包是否正确安装" - LOG_INFO "步骤1:检查系统中是否已安装${PACKAGE_NAME}软件包" - if dnf list installed "${PACKAGE_NAME}" > /dev/null 2>&1; then - LOG_INFO "系统中已安装${PACKAGE_NAME}软件包,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "系统中未安装${PACKAGE_NAME}软件包,将在测试步骤中进行安装" - INSTALLED_BEFORE_TEST=false - fi - LOG_INFO "步骤2:检查yum源中是否存在${PACKAGE_NAME}软件包" - if ! dnf list available "${PACKAGE_NAME}" > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - if [ "${INSTALLED_BEFORE_TEST}" = "false" ]; then - LOG_INFO "步骤3:安装${PACKAGE_NAME}软件包" - dnf install -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}软件包失败" - LOG_INFO "成功安装${PACKAGE_NAME}软件包" - fi - LOG_INFO "步骤4:验证${PACKAGE_NAME}软件包是否正确安装到TeX系统" - if command -v kpsewhich > /dev/null 2>&1; then - kpsewhich adobemapping.sty > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "在TeX系统中未找到adobemapping.sty文件,软件包可能未正确安装" - LOG_INFO "在TeX系统中成功找到adobemapping.sty文件" - else - LOG_INFO "未找到kpsewhich命令,尝试通过rpm查询文件" - rpm -ql "${PACKAGE_NAME}" | grep -q "adobemapping.sty" - CHECK_RESULT $? 0 0 "通过rpm查询未在${PACKAGE_NAME}包中找到adobemapping.sty文件" - LOG_INFO "通过rpm查询确认${PACKAGE_NAME}软件包包含adobemapping.sty文件" - fi - LOG_INFO "步骤5:清理测试环境" - if [ "${INSTALLED_BEFORE_TEST}" = "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 "测试完成:${PACKAGE_NAME}软件包在TeX系统中安装验证成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-a/texlive-adobemapping/test_texlive-adobemapping_function_map_file.sh b/testcases/function_test/pkg_test/texlive-split-a/texlive-adobemapping/test_texlive-adobemapping_function_map_file.sh deleted file mode 100644 index 40e75ce8320..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-a/texlive-adobemapping/test_texlive-adobemapping_function_map_file.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-03 -# @License : Mulan PSL v2 -# @Desc : Test the presence and basic validity of the Adobe mapping file (e.g., pdftex.map) -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试Adobe映射文件的存在性和基本有效性" - LOG_INFO "检查环境是否已安装texlive-adobemapping软件包" - - # 检查软件包是否已安装 - if dnf list installed texlive-adobemapping &>/dev/null; then - LOG_INFO "texlive-adobemapping已安装,测试后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-adobemapping未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否存在texlive-adobemapping软件包" - if ! dnf list available texlive-adobemapping &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-adobemapping软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-adobemapping软件包" - dnf install -y texlive-adobemapping - CHECK_RESULT $? 0 0 "安装texlive-adobemapping失败" - fi - - # 检查Adobe映射文件(例如pdftex.map)是否存在 - LOG_INFO "检查Adobe映射文件pdftex.map是否存在" - MAP_FILE="/usr/share/texlive/texmf-dist/fonts/map/pdftex/updmap/pdftex.map" - if [ ! -f "$MAP_FILE" ]; then - LOG_ERROR "Adobe映射文件pdftex.map不存在" - exit 1 - fi - - # 检查文件基本有效性,例如是否为非空文件 - LOG_INFO "检查Adobe映射文件pdftex.map是否非空" - if [ ! -s "$MAP_FILE" ]; then - LOG_ERROR "Adobe映射文件pdftex.map为空文件" - exit 1 - fi - - LOG_INFO "Adobe映射文件pdftex.map存在且非空,基本有效性检查通过" - - # 环境恢复:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-adobemapping软件包" - dnf remove -y texlive-adobemapping - CHECK_RESULT $? 0 0 "卸载texlive-adobemapping失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-a/texlive-adobemapping/test_texlive-adobemapping_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-a/texlive-adobemapping/test_texlive-adobemapping_function_uninstall.sh deleted file mode 100644 index 3f06e9d6148..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-a/texlive-adobemapping/test_texlive-adobemapping_function_uninstall.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-03 -# @License : Mulan PSL v2 -# @Desc : Test removal of the texlive-adobemapping package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "测试用例: 移除 texlive-adobemapping 软件包" - - LOG_INFO "步骤1: 检查软件包是否在yum源中" - if ! dnf list available texlive-adobemapping &> /dev/null; then - LOG_ERROR "yum源中未找到 texlive-adobemapping 软件包" - exit 255 - fi - - LOG_INFO "步骤2: 检查当前环境是否已安装 texlive-adobemapping" - if rpm -q texlive-adobemapping &> /dev/null; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "软件包未安装,测试将包含安装步骤" - INSTALLED_BEFORE_TEST=false - fi - - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤3: 安装 texlive-adobemapping 软件包" - dnf install -y texlive-adobemapping - CHECK_RESULT $? 0 0 "安装 texlive-adobemapping 失败" - fi - - LOG_INFO "步骤4: 验证 texlive-adobemapping 安装成功" - rpm -q texlive-adobemapping - CHECK_RESULT $? 0 0 "验证 texlive-adobemapping 安装失败" - - LOG_INFO "步骤5: 移除 texlive-adobemapping 软件包" - dnf remove -y texlive-adobemapping - CHECK_RESULT $? 0 0 "移除 texlive-adobemapping 失败" - - LOG_INFO "步骤6: 验证 texlive-adobemapping 已卸载" - if rpm -q texlive-adobemapping &> /dev/null; then - LOG_ERROR "卸载后验证失败,软件包仍然存在" - exit 1 - else - LOG_INFO "验证成功,软件包已卸载" - fi - - LOG_INFO "步骤7: 环境恢复" - if [ "$INSTALLED_BEFORE_TEST" = true ]; then - LOG_INFO "恢复初始状态:重新安装 texlive-adobemapping" - dnf install -y texlive-adobemapping - CHECK_RESULT $? 0 0 "恢复安装 texlive-adobemapping 失败" - else - LOG_INFO "初始状态为未安装,无需恢复安装" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-a/texlive-adobemapping/test_texlive-adobemapping_function_usage_font.sh b/testcases/function_test/pkg_test/texlive-split-a/texlive-adobemapping/test_texlive-adobemapping_function_usage_font.sh deleted file mode 100644 index e0998e6d73f..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-a/texlive-adobemapping/test_texlive-adobemapping_function_usage_font.sh +++ /dev/null @@ -1,150 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-03 -# @License : Mulan PSL v2 -# @Desc : Test basic font usage with the mapping in a simple LaTeX document -# ############################################ - -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 mode=$3 - local message=$4 - - if [ $mode -eq 0 ]; then - if [ $actual -ne $expect ]; then - LOG_ERROR "$message" - exit $actual - fi - else - if [ $actual -eq $expect ]; then - LOG_ERROR "$message" - exit 1 - fi - fi - return 0 - } - - # 定义SSH_CMD函数(虽然题目说无需定义,但实际使用前需要定义) - SSH_CMD() { - local cmd=$1 - local node_ip=$2 - local node_password=$3 - local node_user=$4 - - # 这里只是模拟,实际应根据SSH配置实现 - LOG_INFO "在节点 $node_ip 上执行命令: $cmd" - return 0 - } - - # 主测试函数 - main() { - local package_name="texlive-adobemapping" - local test_file="test_font.tex" - local pdf_file="test_font.pdf" - local installed_before_test=false - - LOG_INFO "开始测试:Test basic font usage with the mapping in a simple LaTeX document" - - # 步骤1:检查软件包是否已在yum源中 - LOG_INFO "步骤1:检查yum源中是否存在 $package_name 软件包" - dnf list available "$package_name" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在 $package_name 软件包" - exit 255 - fi - - # 步骤2:检查环境是否已安装该软件包 - LOG_INFO "步骤2:检查系统是否已安装 $package_name 软件包" - rpm -q "$package_name" &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "$package_name 已安装,测试结束后将保持安装状态" - installed_before_test=true - else - LOG_INFO "$package_name 未安装,将在测试过程中安装" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$installed_before_test" = false ]; then - LOG_INFO "步骤3:安装 $package_name 软件包" - dnf install -y "$package_name" - CHECK_RESULT $? 0 0 "安装 $package_name 失败" - fi - - # 步骤4:创建测试LaTeX文档 - LOG_INFO "步骤4:创建测试LaTeX文档" - cat > "$test_file" << "EOF" - \documentclass{article} - \usepackage{adobemapping} - \begin{document} - \fontfamily{AdobeMyungjoStd-Medium}\selectfont - 测试字体使用:Hello World! - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 步骤5:编译LaTeX文档 - LOG_INFO "步骤5:使用pdflatex编译LaTeX文档" - pdflatex -interaction=nonstopmode "$test_file" &>/dev/null - CHECK_RESULT $? 0 0 "编译LaTeX文档失败" - - # 步骤6:检查生成的PDF文件 - LOG_INFO "步骤6:检查生成的PDF文件" - if [ -f "$pdf_file" ]; then - LOG_INFO "PDF文件生成成功: $pdf_file" - # 检查PDF文件是否包含有效内容 - file "$pdf_file" | grep -q "PDF document" - CHECK_RESULT $? 0 0 "生成的PDF文件无效" - else - LOG_ERROR "PDF文件未生成" - exit 1 - fi - - # 步骤7:清理测试文件 - LOG_INFO "步骤7:清理测试生成的文件" - rm -f "$test_file" "$pdf_file" *.aux *.log *.out - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 步骤8:如果测试前未安装,则卸载软件包 - if [ "$installed_before_test" = false ]; then - LOG_INFO "步骤8:卸载 $package_name 软件包" - dnf remove -y "$package_name" - CHECK_RESULT $? 0 0 "卸载 $package_name 失败" - else - LOG_INFO "步骤8:保持 $package_name 安装状态" - fi - - LOG_INFO "测试完成:基本字体使用测试成功" - return 0 - } - - # 执行主函数 - main "$@" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_function_check_installed.sh b/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_function_check_installed.sh deleted file mode 100644 index 25d19a931e4..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_function_check_installed.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-13 -# @License : Mulan PSL v2 -# @Desc : Test verifying the package is installed -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:验证texlive-bezierplot软件包是否安装" - LOG_INFO "步骤1:检查yum源中是否存在texlive-bezierplot软件包" - dnf list available texlive-bezierplot &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-bezierplot软件包" - exit 255 - fi - LOG_INFO "yum源中存在texlive-bezierplot软件包" - - LOG_INFO "步骤2:检查当前环境是否已安装texlive-bezierplot" - rpm -q texlive-bezierplot &>/dev/null - INSTALLED=$? - - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "当前环境未安装texlive-bezierplot,将执行安装" - LOG_INFO "步骤3:安装texlive-bezierplot软件包" - dnf install -y texlive-bezierplot - CHECK_RESULT $? 0 0 "安装texlive-bezierplot失败" - LOG_INFO "texlive-bezierplot软件包安装成功" - NEED_CLEANUP=1 - else - LOG_INFO "当前环境已安装texlive-bezierplot,将保持安装状态" - NEED_CLEANUP=0 - fi - - LOG_INFO "步骤4:验证texlive-bezierplot软件包功能" - LOG_INFO "执行测试命令:bezierplot --help" - bezierplot --help &>/dev/null - CHECK_RESULT $? 0 0 "执行bezierplot --help命令失败" - - LOG_INFO "步骤5:清理测试环境" - if [ $NEED_CLEANUP -eq 1 ]; then - LOG_INFO "卸载在测试过程中安装的texlive-bezierplot软件包" - dnf remove -y texlive-bezierplot - CHECK_RESULT $? 0 0 "卸载texlive-bezierplot失败" - LOG_INFO "texlive-bezierplot软件包卸载成功" - else - LOG_INFO "测试前已安装texlive-bezierplot,保持安装状态,无需卸载" - fi - - LOG_INFO "测试完成:texlive-bezierplot软件包安装验证通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_function_compile_doc.sh b/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_function_compile_doc.sh deleted file mode 100644 index 165348f29eb..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_function_compile_doc.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-13 -# @License : Mulan PSL v2 -# @Desc : Test compiling a LaTeX document -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:编译LaTeX文档" - LOG_INFO "步骤1:检查是否已安装texlive-bezierplot软件包" - if rpm -q texlive-bezierplot &> /dev/null; then - LOG_INFO "texlive-bezierplot已安装,测试结束后将保持安装状态" - INSTALLED="yes" - else - LOG_INFO "texlive-bezierplot未安装,将在测试中安装,测试结束后卸载" - INSTALLED="no" - fi - - LOG_INFO "步骤2:检查yum源中是否有texlive-bezierplot软件包" - if ! dnf list available texlive-bezierplot &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-bezierplot软件包" - exit 255 - fi - - if [[ "$INSTALLED" == "no" ]]; then - LOG_INFO "步骤3:安装texlive-bezierplot软件包" - dnf install -y texlive-bezierplot - CHECK_RESULT $? 0 0 "安装texlive-bezierplot失败" - fi - - LOG_INFO "步骤4:创建一个测试LaTeX文档" - cat > test_doc.tex << "EOF" - \documentclass{article} - \usepackage{bezierplot} - \begin{document} - Test document for bezierplot. - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败" - - LOG_INFO "步骤5:编译LaTeX文档" - pdflatex test_doc.tex - CHECK_RESULT $? 0 0 "编译LaTeX文档失败" - - LOG_INFO "步骤6:检查生成的PDF文件" - if [[ -f test_doc.pdf ]]; then - LOG_INFO "PDF文件生成成功" - else - LOG_ERROR "PDF文件未生成" - exit 1 - fi - - LOG_INFO "步骤7:清理测试文件" - rm -f test_doc.tex test_doc.pdf test_doc.aux test_doc.log test_doc.out - - if [[ "$INSTALLED" == "no" ]]; then - LOG_INFO "步骤8:卸载texlive-bezierplot软件包" - dnf remove -y texlive-bezierplot - CHECK_RESULT $? 0 0 "卸载texlive-bezierplot失败" - fi - - LOG_INFO "测试完成:编译LaTeX文档成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_function_draw.sh b/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_function_draw.sh deleted file mode 100644 index 87712c16823..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_function_draw.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test drawing bezier curves -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-bezierplot - LOG_INFO "检查是否已安装texlive-bezierplot" - if dnf list installed texlive-bezierplot &>/dev/null; then - LOG_INFO "texlive-bezierplot已安装" - INSTALLED=true - else - LOG_INFO "texlive-bezierplot未安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-bezierplot软件包 - LOG_INFO "检查yum源中是否有texlive-bezierplot软件包" - if ! dnf list available texlive-bezierplot &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-bezierplot软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-bezierplot - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-bezierplot" - dnf install -y texlive-bezierplot - CHECK_RESULT $? 0 0 "安装texlive-bezierplot失败" - fi - - # 测试绘制贝塞尔曲线功能 - LOG_INFO "测试绘制贝塞尔曲线功能" - bezierplot --draw - CHECK_RESULT $? 0 0 "绘制贝塞尔曲线失败" - - # 清理环境:如果之前未安装,则卸载texlive-bezierplot - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载texlive-bezierplot" - dnf remove -y texlive-bezierplot - CHECK_RESULT $? 0 0 "卸载texlive-bezierplot失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_function_draw_curve.sh b/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_function_draw_curve.sh deleted file mode 100644 index 090dc114852..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_function_draw_curve.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-13 -# @License : Mulan PSL v2 -# @Desc : Test drawing a bezier curve -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:绘制贝塞尔曲线" - - LOG_INFO "步骤1:检查texlive-bezierplot软件包是否已在系统中安装" - if rpm -q texlive-bezierplot &>/dev/null; then - LOG_INFO "texlive-bezierplot已安装,脚本结束将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-bezierplot未安装,将在测试中安装" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否存在texlive-bezierplot软件包" - if ! dnf list available texlive-bezierplot &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-bezierplot软件包" - exit 255 - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装texlive-bezierplot软件包" - dnf install -y texlive-bezierplot - CHECK_RESULT $? 0 0 "安装texlive-bezierplot失败" - fi - - LOG_INFO "步骤4:验证bezierplot命令是否存在" - if ! command -v bezierplot &>/dev/null; then - LOG_ERROR "bezierplot命令不存在" - exit 255 - fi - - LOG_INFO "步骤5:测试bezierplot命令的--help参数" - bezierplot --help - CHECK_RESULT $? 0 0 "bezierplot --help 执行失败" - - LOG_INFO "步骤6:测试绘制贝塞尔曲线(基本功能)" - cat > test_curve.tex << "EOF" - \documentclass{article} - \usepackage{bezierplot} - \begin{document} - \begin{bezierplot} - \beziercurve(0,0)(1,1)(2,0) - \end{bezierplot} - \end{document} - EOF - bezierplot test_curve.tex - CHECK_RESULT $? 0 0 "使用bezierplot绘制基本贝塞尔曲线失败" - - LOG_INFO "步骤7:测试不支持的参数" - if bezierplot --invalid-arg &>/dev/null; then - LOG_ERROR "bezierplot 错误地接受了无效参数 --invalid-arg" - exit 255 - else - LOG_INFO "bezierplot 正确拒绝了无效参数" - fi - - LOG_INFO "步骤8:清理测试生成的文件" - rm -f test_curve.tex test_curve.pdf - - LOG_INFO "步骤9:环境恢复" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载测试安装的texlive-bezierplot软件包" - dnf remove -y texlive-bezierplot - CHECK_RESULT $? 0 0 "卸载texlive-bezierplot失败" - else - LOG_INFO "保持texlive-bezierplot的安装状态" - fi - - LOG_INFO "测试完成:绘制贝塞尔曲线" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_function_install.sh b/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_function_install.sh deleted file mode 100644 index f486c44387a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_function_install.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-13 -# @License : Mulan PSL v2 -# @Desc : Test installing the texlive-bezierplot package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:安装texlive-bezierplot软件包" - - # 检查是否已安装texlive-bezierplot - LOG_INFO "步骤1:检查texlive-bezierplot是否已安装" - if rpm -q texlive-bezierplot &> /dev/null; then - LOG_INFO "texlive-bezierplot已安装,将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-bezierplot未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "步骤2:检查yum源中是否存在texlive-bezierplot软件包" - if ! dnf list available texlive-bezierplot &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-bezierplot软件包" - exit 255 - fi - - # 如果未安装,则进行安装 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装texlive-bezierplot软件包" - dnf install -y texlive-bezierplot - CHECK_RESULT $? 0 0 "安装texlive-bezierplot失败" - LOG_INFO "texlive-bezierplot安装成功" - fi - - # 验证安装 - LOG_INFO "步骤4:验证texlive-bezierplot安装" - rpm -q texlive-bezierplot - CHECK_RESULT $? 0 0 "验证texlive-bezierplot安装失败" - - # 执行测试命令(假设测试命令是检查bezierplot命令是否存在) - LOG_INFO "步骤5:测试texlive-bezierplot功能" - if command -v bezierplot &> /dev/null; then - LOG_INFO "bezierplot命令存在" - else - LOG_ERROR "bezierplot命令不存在或不支持" - exit 255 - fi - - # 环境恢复:如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤6:卸载texlive-bezierplot软件包" - dnf remove -y texlive-bezierplot - CHECK_RESULT $? 0 0 "卸载texlive-bezierplot失败" - LOG_INFO "texlive-bezierplot卸载成功" - else - LOG_INFO "步骤6:保持texlive-bezierplot安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_function_label_points.sh b/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_function_label_points.sh deleted file mode 100644 index 5558ae2b2ed..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_function_label_points.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-13 -# @License : Mulan PSL v2 -# @Desc : Test labeling control points -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境初始化检查 - LOG_INFO "开始执行测试:Test labeling control points" - - # 步骤1:检查texlive-bezierplot软件包是否在yum源中 - LOG_INFO "检查texlive-bezierplot软件包是否在yum源中" - dnf list available texlive-bezierplot 2>/dev/null | grep -q texlive-bezierplot - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-bezierplot软件包不在yum源中" - exit 255 - fi - - # 步骤2:检查是否已安装texlive-bezierplot - LOG_INFO "检查是否已安装texlive-bezierplot" - rpm -q texlive-bezierplot >/dev/null 2>&1 - INSTALLED=$? - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "texlive-bezierplot已安装,测试后保持安装状态" - NEED_UNINSTALL=0 - else - LOG_INFO "texlive-bezierplot未安装,将在测试后卸载" - NEED_UNINSTALL=1 - fi - - # 步骤3:如果未安装则安装软件包 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "安装texlive-bezierplot软件包" - dnf install -y texlive-bezierplot - CHECK_RESULT $? 0 0 "安装texlive-bezierplot失败" - fi - - # 步骤4:检查bezierplot命令是否可用 - LOG_INFO "检查bezierplot命令是否可用" - which bezierplot >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "bezierplot命令不存在" - - # 步骤5:测试bezierplot的--label-points参数 - LOG_INFO "测试bezierplot的--label-points参数" - bezierplot --help 2>&1 | grep -q "\-\-label-points" - if [ $? -ne 0 ]; then - LOG_ERROR "bezierplot不支持--label-points参数" - exit 255 - fi - - # 步骤6:创建测试数据文件 - LOG_INFO "创建测试数据文件" - TEST_DATA="test_data.txt" - cat > $TEST_DATA << EOF - 0 0 - 1 1 - 2 0 - EOF - CHECK_RESULT $? 0 0 "创建测试数据文件失败" - - # 步骤7:使用--label-points参数执行bezierplot命令 - LOG_INFO "使用--label-points参数执行bezierplot命令" - bezierplot --label-points $TEST_DATA > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "bezierplot --label-points执行失败" - - # 步骤8:清理测试数据文件 - LOG_INFO "清理测试数据文件" - rm -f $TEST_DATA - CHECK_RESULT $? 0 0 "清理测试数据文件失败" - - # 步骤9:环境恢复 - LOG_INFO "环境恢复" - if [ $NEED_UNINSTALL -eq 1 ]; then - LOG_INFO "卸载texlive-bezierplot软件包" - dnf remove -y texlive-bezierplot - CHECK_RESULT $? 0 0 "卸载texlive-bezierplot失败" - else - LOG_INFO "保持texlive-bezierplot安装状态" - fi - - LOG_INFO "测试完成:Test labeling control points" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_function_set_style.sh b/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_function_set_style.sh deleted file mode 100644 index 4171fca3741..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_function_set_style.sh +++ /dev/null @@ -1,140 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-13 -# @License : Mulan PSL v2 -# @Desc : Test setting curve line style -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试设置曲线线条样式 - LOG_INFO "开始测试设置曲线线条样式功能" - - # 检查是否已安装texlive-bezierplot - LOG_INFO "检查texlive-bezierplot是否已安装" - if rpm -q texlive-bezierplot &>/dev/null; then - LOG_INFO "texlive-bezierplot已安装,测试完成后将保持安装状态" - already_installed=1 - else - LOG_INFO "texlive-bezierplot未安装,将在测试过程中安装" - already_installed=0 - fi - - # 检查yum源中是否有texlive-bezierplot软件包 - LOG_INFO "检查yum源中是否有texlive-bezierplot软件包" - if ! dnf list available texlive-bezierplot &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-bezierplot软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装texlive-bezierplot软件包" - dnf install -y texlive-bezierplot - CHECK_RESULT $? 0 0 "安装texlive-bezierplot失败" - fi - - # 测试设置曲线线条样式功能 - LOG_INFO "测试设置曲线线条样式功能" - LOG_INFO "创建测试TeX文件" - cat > test_style.tex << "EOF" - \documentclass{article} - \usepackage{bezierplot} - \begin{document} - \begin{bezierplot}[width=10cm,height=6cm] - % 设置不同的线条样式 - \draw[style=dashed] (0,0) .. controls (2,2) and (4,-2) .. (6,0); - \draw[style=dotted] (0,1) .. controls (2,3) and (4,-1) .. (6,1); - \draw[style=solid, line width=2pt] (0,2) .. controls (2,4) and (4,0) .. (6,2); - \end{bezierplot} - \end{document} - EOF - - # 编译TeX文件测试 - LOG_INFO "编译TeX文件测试线条样式设置" - pdflatex -interaction=nonstopmode test_style.tex - CHECK_RESULT $? 0 0 "编译TeX文件失败" - - # 检查生成的PDF文件 - LOG_INFO "检查生成的PDF文件" - if [ -f test_style.pdf ]; then - LOG_INFO "成功生成包含不同线条样式的PDF文件" - file test_style.pdf | grep -q "PDF document" - CHECK_RESULT $? 0 0 "生成的PDF文件格式不正确" - else - LOG_ERROR "未生成PDF文件" - exit 1 - fi - - # 测试不支持的参数 - LOG_INFO "测试不支持的线条样式参数" - cat > test_invalid_style.tex << "EOF" - \documentclass{article} - \usepackage{bezierplot} - \begin{document} - \begin{bezierplot}[width=10cm,height=6cm] - % 使用不支持的线条样式 - \draw[style=invalid_style] (0,0) .. controls (2,2) and (4,-2) .. (6,0); - \end{bezierplot} - \end{document} - EOF - - # 测试无效参数的处理 - LOG_INFO "测试无效参数的处理" - pdflatex -interaction=nonstopmode test_invalid_style.tex &>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "无效的线条样式参数应该导致编译失败" - exit 255 - else - LOG_INFO "无效的线条样式参数正确处理,编译失败为预期结果" - fi - - # 测试多个线条样式组合 - LOG_INFO "测试多个线条样式组合" - cat > test_combined_style.tex << "EOF" - \documentclass{article} - \usepackage{bezierplot} - \begin{document} - \begin{bezierplot}[width=10cm,height=6cm] - % 组合线条样式和颜色 - \draw[style=dashed, color=red] (0,0) .. controls (2,2) and (4,-2) .. (6,0); - \draw[style=dotted, color=blue, line width=1.5pt] (0,1) .. controls (2,3) and (4,-1) .. (6,1); - \end{bezierplot} - \end{document} - EOF - - pdflatex -interaction=nonstopmode test_combined_style.tex - CHECK_RESULT $? 0 0 "编译组合样式TeX文件失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_style.tex test_style.pdf test_style.log test_style.aux - rm -f test_invalid_style.tex test_invalid_style.pdf test_invalid_style.log test_invalid_style.aux - rm -f test_combined_style.tex test_combined_style.pdf test_combined_style.log test_combined_style.aux - - # 如果测试前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载texlive-bezierplot软件包" - dnf remove -y texlive-bezierplot - CHECK_RESULT $? 0 0 "卸载texlive-bezierplot失败" - else - LOG_INFO "保持texlive-bezierplot安装状态" - fi - - LOG_INFO "测试设置曲线线条样式功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_function_uninstall.sh deleted file mode 100644 index 5ade07a7fd4..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-c/texlive-bezierplot/test_texlive-bezierplot_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-13 -# @License : Mulan PSL v2 -# @Desc : Test uninstalling the texlive-bezierplot package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:卸载texlive-bezierplot包" - - LOG_INFO "步骤1: 检查yum源中是否存在texlive-bezierplot包" - dnf list available texlive-bezierplot &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-bezierplot包" - exit 255 - fi - - LOG_INFO "步骤2: 检查当前是否已安装texlive-bezierplot包" - rpm -q texlive-bezierplot &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "检测到texlive-bezierplot包已安装,记录安装状态" - INSTALLED=true - else - LOG_INFO "检测到texlive-bezierplot包未安装,将执行安装作为测试步骤" - INSTALLED=false - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3: 安装texlive-bezierplot包" - dnf install -y texlive-bezierplot - CHECK_RESULT $? 0 0 "安装texlive-bezierplot包失败" - fi - - LOG_INFO "步骤4: 验证texlive-bezierplot包功能(可选命令测试)" - bezierplot --help &>/dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "bezierplot命令不支持--help参数或命令不存在" - exit 255 - fi - CHECK_RESULT $? 0 0 "验证texlive-bezierplot包功能失败" - - LOG_INFO "步骤5: 执行卸载操作" - dnf remove -y texlive-bezierplot - CHECK_RESULT $? 0 0 "卸载texlive-bezierplot包失败" - - LOG_INFO "步骤6: 验证卸载结果" - rpm -q texlive-bezierplot &>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "卸载后仍检测到texlive-bezierplot包" - exit 1 - fi - LOG_INFO "卸载验证成功" - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤7: 恢复环境,保持与测试前一致(已卸载)" - LOG_INFO "环境已恢复,测试结束" - else - LOG_INFO "步骤7: 恢复环境,重新安装texlive-bezierplot包" - dnf install -y texlive-bezierplot - CHECK_RESULT $? 0 0 "重新安装texlive-bezierplot包失败" - LOG_INFO "环境已恢复,测试结束" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-d/texlive-carbohydrates/test_texlive-carbohydrates_function_compile.sh b/testcases/function_test/pkg_test/texlive-split-d/texlive-carbohydrates/test_texlive-carbohydrates_function_compile.sh deleted file mode 100644 index c6bbf977141..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-d/texlive-carbohydrates/test_texlive-carbohydrates_function_compile.sh +++ /dev/null @@ -1,180 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-17 -# @License : Mulan PSL v2 -# @Desc : Test compile with package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 设置严格模式 - set -e - - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - - # 定义检查结果函数 - CHECK_RESULT() { - local actual=$1 - local expect=$2 - local error_code=$3 - local error_msg=$4 - - if [ $actual -ne $expect ]; then - LOG_ERROR "$error_msg" - exit $error_code - fi - } - - # 定义SSH命令函数 - SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=$4 - - # 这里只是占位符,实际环境中SSH_CMD会有具体实现 - echo "SSH to $user@$ip: $cmd" - # 实际SSH命令示例: - # sshpass -p "$password" ssh -o StrictHostKeyChecking=no "$user@$ip" "$cmd" - } - - # 测试用例描述 - LOG_INFO "开始执行测试用例: Test compile with package" - - # 步骤1: 检查环境是否已安装texlive-carbohydrates - LOG_INFO "步骤1: 检查texlive-carbohydrates是否已安装" - if dnf list installed texlive-carbohydrates &>/dev/null; then - LOG_INFO "texlive-carbohydrates已安装,测试结束后保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texlive-carbohydrates未安装" - INSTALLED_BEFORE=false - fi - - # 步骤2: 检查yum源中是否有texlive-carbohydrates包 - LOG_INFO "步骤2: 检查yum源中是否有texlive-carbohydrates包" - if ! dnf list available texlive-carbohydrates &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-carbohydrates包" - exit 255 - fi - LOG_INFO "yum源中存在texlive-carbohydrates包" - - # 步骤3: 如果未安装,则安装texlive-carbohydrates - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤3: 安装texlive-carbohydrates包" - dnf install -y texlive-carbohydrates - CHECK_RESULT $? 0 1 "安装texlive-carbohydrates失败" - LOG_INFO "texlive-carbohydrates安装成功" - else - LOG_INFO "步骤3: 跳过安装,texlive-carbohydrates已存在" - fi - - # 步骤4: 测试编译功能 - LOG_INFO "步骤4: 测试texlive-carbohydrates编译功能" - - # 检查pdflatex命令是否存在 - if ! command -v pdflatex &>/dev/null; then - LOG_ERROR "pdflatex命令不存在" - exit 255 - fi - - # 创建测试文件 - TEST_FILE="test_carbohydrates.tex" - cat > "$TEST_FILE" << "EOF" - \documentclass{article} - \usepackage{carbohydrates} - \begin{document} - \glucose - \end{document} - EOF - - # 尝试编译测试文件 - LOG_INFO "尝试编译carbohydrates测试文档" - pdflatex -interaction=nonstopmode "$TEST_FILE" - CHECK_RESULT $? 0 1 "编译carbohydrates文档失败" - - # 检查生成的PDF文件 - if [ -f "test_carbohydrates.pdf" ]; then - LOG_INFO "PDF文件生成成功" - # 检查PDF文件大小 - PDF_SIZE=$(stat -c%s "test_carbohydrates.pdf" 2>/dev/null || stat -f%z "test_carbohydrates.pdf") - if [ "$PDF_SIZE" -gt 0 ]; then - LOG_INFO "生成的PDF文件大小: ${PDF_SIZE}字节" - else - LOG_ERROR "生成的PDF文件为空" - exit 1 - fi - else - LOG_ERROR "PDF文件未生成" - exit 1 - fi - - # 步骤5: 测试其他相关命令参数 - LOG_INFO "步骤5: 测试相关命令参数" - - # 测试latex命令 - if command -v latex &>/dev/null; then - LOG_INFO "测试latex命令" - latex -interaction=nonstopmode "$TEST_FILE" - CHECK_RESULT $? 0 0 "latex命令执行失败,但这不是致命错误" - else - LOG_INFO "latex命令不存在,跳过测试" - fi - - # 步骤6: 清理测试文件 - LOG_INFO "步骤6: 清理测试文件" - rm -f "$TEST_FILE" test_carbohydrates.aux test_carbohydrates.log test_carbohydrates.pdf test_carbohydrates.dvi test_carbohydrates.out - - # 步骤7: 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "步骤7: 卸载texlive-carbohydrates包" - dnf remove -y texlive-carbohydrates - CHECK_RESULT $? 0 1 "卸载texlive-carbohydrates失败" - LOG_INFO "texlive-carbohydrates卸载成功" - else - LOG_INFO "步骤7: 保持texlive-carbohydrates安装状态" - fi - - # 步骤8: 验证环境已恢复 - LOG_INFO "步骤8: 验证环境状态" - if [ "$INSTALLED_BEFORE" = "true" ]; then - if dnf list installed texlive-carbohydrates &>/dev/null; then - LOG_INFO "环境状态正确:texlive-carbohydrates仍保持安装" - else - LOG_ERROR "环境状态错误:texlive-carbohydrates被意外卸载" - exit 1 - fi - else - if dnf list installed texlive-carbohydrates &>/dev/null; then - LOG_ERROR "环境状态错误:texlive-carbohydrates未被正确卸载" - exit 1 - else - LOG_INFO "环境状态正确:texlive-carbohydrates已卸载" - fi - fi - - LOG_INFO "测试用例执行完成:Test compile with package" - LOG_INFO "所有测试步骤执行成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-d/texlive-carbohydrates/test_texlive-carbohydrates_function_install.sh b/testcases/function_test/pkg_test/texlive-split-d/texlive-carbohydrates/test_texlive-carbohydrates_function_install.sh deleted file mode 100644 index a765595657d..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-d/texlive-carbohydrates/test_texlive-carbohydrates_function_install.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-09-30 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_texlive-carbohydrates_function_install - - LOG_INFO "开始测试:Test package installation" - - # 检查是否已安装软件包 - LOG_INFO "检查软件包是否已安装" - dnf list installed texlive-carbohydrates &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,脚本结束时保持安装状态" - installed=true - else - LOG_INFO "软件包未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-carbohydrates软件包" - dnf list available texlive-carbohydrates &>/dev/null - CHECK_RESULT $? 0 255 "yum源中不存在texlive-carbohydrates软件包" - - # 安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-carbohydrates软件包" - dnf install -y texlive-carbohydrates - CHECK_RESULT $? 0 1 "安装texlive-carbohydrates软件包失败" - fi - - # 测试指定命令参数是否存在或不支持 - LOG_INFO "测试指定命令参数是否存在或不支持" - texdoc --help | grep -q -- "--list" - CHECK_RESULT $? 0 255 "texdoc命令不支持--list参数" - - # 测试命令执行是否成功(示例命令) - LOG_INFO "测试texdoc命令执行是否成功" - texdoc --list - CHECK_RESULT $? 0 1 "texdoc命令执行失败" - - # 清理环境(如果之前未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-carbohydrates软件包" - dnf remove -y texlive-carbohydrates - CHECK_RESULT $? 0 1 "卸载texlive-carbohydrates软件包失败" - fi - - LOG_INFO "测试完成:Test package installation" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-d/texlive-carbohydrates/test_texlive-carbohydrates_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-d/texlive-carbohydrates/test_texlive-carbohydrates_function_uninstall.sh deleted file mode 100644 index fdfb35ea6d7..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-d/texlive-carbohydrates/test_texlive-carbohydrates_function_uninstall.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-17 -# @License : Mulan PSL v2 -# @Desc : Test package removal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="texlive-carbohydrates-function" - - # 步骤1: 检查软件包是否在yum源中 - LOG_INFO "步骤1: 检查软件包是否在yum源中" - dnf list available "$PACKAGE_NAME" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 步骤2: 检查当前环境是否已安装该软件包 - LOG_INFO "步骤2: 检查当前环境是否已安装该软件包" - rpm -q "$PACKAGE_NAME" &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,脚本结束时将保持安装状态" - INSTALLED_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: 验证软件包安装成功" - rpm -q "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "验证软件包 $PACKAGE_NAME 安装失败" - - # 步骤5: 测试软件包卸载功能 - LOG_INFO "步骤5: 测试软件包卸载功能" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - - # 步骤6: 验证软件包已卸载 - LOG_INFO "步骤6: 验证软件包已卸载" - rpm -q "$PACKAGE_NAME" &>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 卸载后仍然存在" - exit 1 - else - LOG_INFO "软件包 $PACKAGE_NAME 已成功卸载" - fi - - # 步骤7: 环境恢复 - LOG_INFO "步骤7: 环境恢复" - if [ $INSTALLED_BEFORE -eq 1 ]; then - LOG_INFO "恢复原始安装状态:重新安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "重新安装软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "原始环境未安装软件包,无需重新安装" - fi - - # 步骤8: 最终验证环境状态 - LOG_INFO "步骤8: 最终验证环境状态" - if [ $INSTALLED_BEFORE -eq 1 ]; then - rpm -q "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "环境恢复后软件包 $PACKAGE_NAME 不存在" - LOG_INFO "环境已恢复为原始安装状态" - else - rpm -q "$PACKAGE_NAME" &>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "环境恢复后软件包 $PACKAGE_NAME 仍然存在" - exit 1 - else - LOG_INFO "环境已恢复为原始未安装状态" - fi - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-d/texlive-chickenize/test_texlive-chickenize_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-d/texlive-chickenize/test_texlive-chickenize_function_uninstall.sh deleted file mode 100644 index d11e200a39a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-d/texlive-chickenize/test_texlive-chickenize_function_uninstall.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-09-18 -# @License : Mulan PSL v2 -# @Desc : Test package uninstallation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_texlive-chickenize_function_uninstall - - LOG_INFO "开始测试软件包卸载功能" - - # 检查软件包是否已安装 - LOG_INFO "检查软件包是否已安装" - dnf list installed texlive-chickenize > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,保持状态" - installed=true - else - LOG_INFO "软件包未安装,将进行安装测试" - installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有texlive-chickenize软件包" - dnf list available texlive-chickenize > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-chickenize软件包" - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-chickenize软件包" - dnf install -y texlive-chickenize > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-chickenize失败" - fi - - # 测试卸载功能 - LOG_INFO "测试卸载texlive-chickenize软件包" - dnf remove -y texlive-chickenize > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-chickenize失败" - - # 如果最初未安装,则恢复环境(不重新安装) - if [ "$installed" = false ]; then - LOG_INFO "恢复环境:不重新安装软件包" - else - LOG_INFO "恢复环境:重新安装软件包" - dnf install -y texlive-chickenize > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "重新安装texlive-chickenize失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-din1505-doc/test_texlive-din1505-doc_function_render.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-din1505-doc/test_texlive-din1505-doc_function_render.sh deleted file mode 100644 index a3e59448812..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-din1505-doc/test_texlive-din1505-doc_function_render.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 : 测试 texlive-din1505-doc 软件包的渲染功能,验证是否能够正确渲染文档。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-din1505-doc 软件包的渲染功能" - - # 检查软件包是否已安装 - LOG_INFO "检查 texlive-din1505-doc 是否已安装" - if rpm -q texlive-din1505-doc &>/dev/null; then - LOG_INFO "texlive-din1505-doc 已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "texlive-din1505-doc 未安装,准备安装" - INSTALLED=false - fi - - # 检查 yum 源中是否有该软件包 - LOG_INFO "检查 yum 源中是否有 texlive-din1505-doc" - if ! dnf list available texlive-din1505-doc &>/dev/null; then - LOG_ERROR "yum 源中未找到 texlive-din1505-doc 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-din1505-doc" - dnf install -y texlive-din1505-doc - CHECK_RESULT $? 0 0 "安装 texlive-din1505-doc 失败" - fi - - # 测试渲染功能 - LOG_INFO "测试 texlive-din1505-doc 的渲染功能" - texlive-din1505-doc --render test_document.tex - CHECK_RESULT $? 0 0 "渲染文档失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-din1505-doc" - dnf remove -y texlive-din1505-doc - CHECK_RESULT $? 0 0 "卸载 texlive-din1505-doc 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_downgrade.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_downgrade.sh deleted file mode 100644 index df4704b74e5..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_downgrade.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-04 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的降级功能,验证降级过程是否正常完成 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了texlive-docbytex软件包 - LOG_INFO "检查是否已经安装了texlive-docbytex软件包" - dnf list installed texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已经安装" - INSTALLED=true - else - LOG_INFO "texlive-docbytex软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-docbytex软件包 - LOG_INFO "检查yum源中是否有texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-docbytex软件包" - exit 255 - fi - - # 获取当前安装的texlive-docbytex版本 - LOG_INFO "获取当前安装的texlive-docbytex版本" - CURRENT_VERSION=$(dnf list installed texlive-docbytex | awk "NR==2 {print $2}") - if [ -z "$CURRENT_VERSION" ]; then - CURRENT_VERSION="未安装" - fi - LOG_INFO "当前安装的texlive-docbytex版本: $CURRENT_VERSION" - - # 获取可用的texlive-docbytex版本列表 - LOG_INFO "获取可用的texlive-docbytex版本列表" - AVAILABLE_VERSIONS=$(dnf --showduplicates list texlive-docbytex | awk "NR>1 {print $2}" | sort -V) - if [ -z "$AVAILABLE_VERSIONS" ]; then - LOG_ERROR "无法获取texlive-docbytex的可用版本列表" - exit 255 - fi - - # 选择降级的目标版本(选择比当前版本低的第一个可用版本) - LOG_INFO "选择降级的目标版本" - TARGET_VERSION="" - for version in $AVAILABLE_VERSIONS; do - if [ "$version" != "$CURRENT_VERSION" ] && [ "$version" \< "$CURRENT_VERSION" ]; then - TARGET_VERSION=$version - break - fi - done - - if [ -z "$TARGET_VERSION" ]; then - LOG_ERROR "没有找到可用的降级版本" - exit 255 - fi - - LOG_INFO "目标降级版本: $TARGET_VERSION" - - # 执行降级操作 - LOG_INFO "执行降级操作" - dnf downgrade -y texlive-docbytex-$TARGET_VERSION > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "降级操作失败" - - # 验证降级后的版本 - LOG_INFO "验证降级后的版本" - NEW_VERSION=$(dnf list installed texlive-docbytex | awk "NR==2 {print $2}") - CHECK_RESULT $? 0 0 "无法获取降级后的版本" - if [ "$NEW_VERSION" != "$TARGET_VERSION" ]; then - LOG_ERROR "降级后的版本与目标版本不一致" - exit 1 - else - LOG_INFO "成功降级到目标版本: $NEW_VERSION" - fi - - # 恢复环境(如果最初未安装,则卸载) - if [ "$INSTALLED" = false ]; then - LOG_INFO "恢复环境,卸载texlive-docbytex软件包" - dnf remove -y texlive-docbytex > /dev/null 2>&1 - else - LOG_INFO "保持texlive-docbytec软件的安装状态不变" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_function_docgen.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_function_docgen.sh deleted file mode 100644 index 47715f163d9..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_function_docgen.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-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex的文档生成功能,验证是否能正常生成文档 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-docbytex的文档生成功能,验证是否能正常生成文档" - - # 检查是否已安装texlive-docbytex - LOG_INFO "检查是否已安装texlive-docbytex" - if dnf list installed texlive-docbytex &>/dev/null; then - LOG_INFO "texlive-docbytex已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-docbytex未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-docbytex软件包 - LOG_INFO "检查yum源中是否有texlive-docbytex软件包" - if ! dnf list available texlive-docbytex &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-docbytex软件包" - exit 255 - fi - - # 若未安装则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装texlive-docbytex" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装texlive-docbytex失败" - fi - - # 验证文档生成功能 - LOG_INFO "验证texlive-docbytex的文档生成功能" - docgen_output=$(docgen --help 2>&1) - if [[ "$docgen_output" != *"Usage"* ]]; then - LOG_ERROR "docgen命令参数不支持或不存在" - exit 255 - fi - - # 生成文档测试步骤(假设使用--generate参数) - LOG_INFO "执行文档生成命令" - docgen --generate test_doc.tex - CHECK_RESULT $? 0 0 "文档生成失败" - - # 检查生成的文档是否存在 - LOG_INFO "检查生成的文档是否存在" - if [ ! -f test_doc.tex ]; then - LOG_ERROR "未找到生成的文档test_doc.tex" - exit 1 - fi - - # 清理生成的测试文件 - LOG_INFO "清理生成的测试文件" - rm -f test_doc.tex - - # 若脚本开始时未安装,则卸载软件包以恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载之前安装的软件包texlive-docby tex以恢复环境" - dnf remove -y texlive-docbytex - CHECK_RESULT $? 00"卸载tex live- doc by Te X失败" - fi - - LOG_ INFO"测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_install.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_install.sh deleted file mode 100644 index 76dfb10b3ca..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_install.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-04 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的安装功能,验证安装过程是否正常完成 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-docbytex软件包是否已安装 - LOG_INFO "检查texlive-docbytex软件包是否已安装" - rpm -q texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-docbytex软件包未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-docbytex软件包 - LOG_INFO "检查yum源中是否存在texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-docbytex软件包" - - # 安装texlive-docbytex软件包 - LOG_INFO "开始安装texlive-docbytex软件包" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - - # 验证texlive-docbytx命令是否可用 - LOG_INFO "验证texlive-docbytex命令是否可用" - which texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "texlive-docbytx命令不可用" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境,卸载之前安装的软件包" - dnf remove -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_autostart.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_autostart.sh deleted file mode 100644 index 2dc332ffa30..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_autostart.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务自动启动功能,验证服务是否能在系统启动时自动启动 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - plaintext - # 检查是否已安装texlive-docbytex软件包 - LOG_INFO "检查是否已安装texlive-docbytex软件包" - rpm -q texlive-docbytex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装" - INSTALLED=true - else - LOG_INFO "texlive-docbytex软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-docbytex软件包 - LOG_INFO "检查yum源中是否有texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-docbytex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-docbytex软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-docbytex软件包" - dnf install -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 检查服务是否已启用自动启动 - LOG_INFO "检查服务是否已启用自动启动" - systemctl is-enabled texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "服务未启用自动启动" - exit 1 - else - LOG_INFO "服务已启用自动启动" - fi - - # 重启系统并验证服务是否自动启动 - LOG_INFO "重启系统并验证服务是否自动启动" - reboot - sleep 60 # 等待系统重启完成 - - # SSH到节点2验证服务状态 - LOG_INFO "在节点2上验证服务状态" - SSH_CMD systemctl is-active texlive-docbytex $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "服务未在节点2上自动启动" - - #环境恢复:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载之前安装的 texlive-docbytxe " - dnf remove -y texlivie-doctexe >/dev/null 2>&1 - CHECK_RESULT $? 00\"卸载 texlvie-doctxe 失败\"" - fi - - exit 00 - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_config.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_config.sh deleted file mode 100644 index 93797f78285..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_config.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务配置功能,验证服务配置是否能正常修改和生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试texlive-docbytex软件包的服务配置功能 - LOG_INFO "开始测试texlive-docbytex软件包的服务配置功能" - - # 检查软件包是否在yum源中 - LOG_INFO "检查texlive-docbytex软件包是否在yum源中" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-docbytex软件包" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查是否已安装texlive-docbytex" - rpm -q texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到texlive-docbytex已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "未检测到texlive-docbytex,执行安装" - dnf install -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-docbytex失败" - INSTALLED=false - fi - - # 测试服务配置修改和生效 - LOG_INFO "测试服务配置修改和生效" - systemctl cat texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "未找到texlive-docbytex服务配置" - exit 255 - fi - - # 修改服务配置并验证 - LOG_INFO "修改服务配置并验证" - sed -i "s/^#Restart=.*/Restart=always/" /usr/lib/systemd/system/texlive-docbytex.service > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "修改服务配置失败" - - systemctl daemon-reload > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "重新加载服务配置失败" - - systemctl restart texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "重启服务失败" - - systemctl status texlive-docbytex | grep "Restart=always" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "服务配置未生效" - - #恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境,卸载之前安装的软件包" - dnf remove -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 “卸载texlivetex-dobyte失败” - fi - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_disable.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_disable.sh deleted file mode 100644 index ff98df7d2dd..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_disable.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务禁用开机自启功能,验证服务是否能正常取消开机自启设置 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-docbytex软件包 - LOG_INFO "检查是否已安装texlive-docbytex软件包" - dnf list installed texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-docbytex未安装,将在测试后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-docbytex软件包 - LOG_INFO "检查yum源中是否有texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-docbytex软件包" - exit 255 - fi - - # 安装texlive-docbytex软件包(如果未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-docbytex软件包" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装失败" - fi - - # 检查服务是否存在并获取服务名 - LOG_INFO "检查服务是否存在" - SERVICE_NAME=$(systemctl list-unit-files | grep texlive | awk "{print $1}") - if [ -z "$SERVICE_NAME" ]; then - LOG_ERROR "未找到texlive相关服务" - exit 255 - fi - - # 禁用服务开机自启 - LOG_INFO "禁用服务开机自启" - systemctl disable $SERVICE_NAME - CHECK_RESULT $? 0 0 "禁用开机自启失败" - - # 验证服务是否已禁用开机自启 - LOG_INFO "验证服务是否已禁用开机自启" - systemctl is-enabled $SERVICE_NAME | grep -q "disabled" - CHECK_RESULT $? 0 0 "服务未成功禁用开机自启" - - # 恢复环境(如果最初未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-docbytex软件包" - dnf remove -y texlive-docbytex - CHECK_RESULT $? 0 0 "卸载失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_enable.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_enable.sh deleted file mode 100644 index b481aa74921..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_enable.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务开机自启功能,验证服务是否能正常设置为开机自启 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-docbytex软件包 - LOG_INFO "检查是否已安装texlive-docbytex软件包" - dnf list installed texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装" - INSTALLED=1 - else - LOG_INFO "texlive-docbytex软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-docbytex软件包 - LOG_INFO "检查yum源中是否有texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-docbytex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-docbytex软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-docbytex软件包" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 检查服务是否存在 - LOG_INFO "检查服务是否存在" - systemctl list-unit-files | grep texlive-docbytex.service > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "服务不存在" - exit 255 - fi - - # 设置服务开机自启并验证 - LOG_INFO "设置服务开机自启并验证" - systemctl enable texlive-docbytex.service - CHECK_RESULT $? 0 0 "设置服务开机自启失败" - - # 检查服务是否设置为开机自启 - LOG_INFO "检查服务是否设置为开机自启" - systemctl is-enabled texlive-docbytex.service | grep enabled > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "服务未设置为开机自启" - - #恢复环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO"卸载texlieve_dockbyex" - dnf remove -y texlieve_dockbyex - CHECK_RESULT$?00"卸载失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_health_check.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_health_check.sh deleted file mode 100644 index a6b64b4dcc2..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_health_check.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务健康检查功能,验证服务健康状态是否能正常检查 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-docbytex软件包 - LOG_INFO "检查是否已安装texlive-docbytex软件包" - if rpm -q texlive-docbytex >/dev/null 2>&1; then - LOG_INFO "texlive-docbytex已安装" - INSTALLED=true - else - LOG_INFO "texlive-docbytex未安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-docbytex软件包 - LOG_INFO "检查yum源中是否有texlive-docbytex软件包" - if ! dnf list available texlive-docbytex >/dev/null 2>&1; then - LOG_ERROR "yum源中未找到texlive-docbytex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-docbytex软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-docbytex软件包" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 测试服务健康检查功能 - LOG_INFO "测试texlive-docbytex服务健康检查功能" - systemctl status texlive-docbytex >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-docbytex服务健康检查失败" - - # 如果最初未安装,则卸载texlive-docbyx软件包以恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载之前安装的textive-live-dobyx软件包" - dnf remove -y textive-live-dobyx - CHECK_RESULT $? 0 0 "卸载textive-live-dobyx失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log.sh deleted file mode 100644 index 80fe6864867..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志查看功能,验证服务日志是否能正常查看 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-docbytex软件包是否已安装 - LOG_INFO "检查texlive-docbytex软件包是否已安装" - rpm -q texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装" - installed=true - else - LOG_INFO "texlive-docbytex软件包未安装" - installed=false - fi - - # 检查yum源中是否存在texlive-docbytex软件包 - LOG_INFO "检查yum源中是否存在texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-docbytex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-docbytex软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-docbytex软件包" - dnf install -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - LOG_INFO "texlive-docbytex软件包安装成功" - fi - - # 测试服务日志查看功能 - LOG_INFO "测试texlive-docbytex软件包的服务日志查看功能" - journalctl -u texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "查看服务日志失败" - - # 如果脚本开始时未安装,则在结束时卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载之前安装的texlive-docbytex软件包" - dnf remove -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-docbytex软件包失败" - LOG_INFO "成功卸载了之前安装的texlive-docby tex软件包" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_archive.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_archive.sh deleted file mode 100644 index c7e895ed0ef..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_archive.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志归档功能,验证日志归档是否能正常执行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-docbytex软件包 - LOG_INFO "检查是否已安装texlive-docbytex软件包" - if dnf list installed texlive-docbytex &>/dev/null; then - LOG_INFO "texlive-docbytex软件包已安装" - INSTALLED=true - else - LOG_INFO "texlive-docbytex软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-docbytex软件包 - LOG_INFO "检查yum源中是否有texlive-docbytex软件包" - if ! dnf list available texlive-docbytex &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-docbytex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-docbytex软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-docbytex软件包" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 测试日志归档功能 - LOG_INFO "测试texlive-docbytex软件包的服务日志归档功能" - LOG_INFO "执行日志归档命令" - texlive-docbytex --archive-logs - CHECK_RESULT $? 0 0 "日志归档功能执行失败" - - # 如果之前未安装,则在测试完成后卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-docbytex软件包" - dnf remove -y texlive-docbytex - CHECK_RESULT $? 0 0 "卸载texlive-docbytex软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_backup.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_backup.sh deleted file mode 100644 index 2266bc762b5..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_backup.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志备份功能,验证日志备份是否能正常执行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-docbytex软件包是否已安装 - LOG_INFO "检查texlive-docbytex软件包是否已安装" - rpm -q texlive-docbytex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装,无需再次安装" - INSTALLED=true - else - LOG_INFO "texlive-docbytex软件包未安装,将进行安装测试" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-docbytex软件包 - LOG_INFO "检查yum源中是否存在texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-docbytex软件包" - - # 若未安装,则安装texlive-docbytex软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-docbytex软件包" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 测试服务日志备份功能 - LOG_INFO "测试服务日志备份功能" - log_backup_cmd="some_log_backup_command" # 替换为实际的日志备份命令 - $log_backup_cmd - CHECK_RESULT $? 0 255 "日志备份命令执行失败" - - # 验证日志备份是否成功 - LOG_INFO "验证日志备份是否成功" - if [ -f "/path/to/backup/log" ]; then # 替换为实际的备份日志路径 - LOG_INFO "日志备份成功,文件存在" - else - LOG_ERROR "日志备份失败,文件不存在" - exit 1 # Linux标准退出码:操作未成功完成 - fi - - # 若测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-docbytex软件包" - dnf remove -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载textive-docbydex软甲包失败" - fi - - LOG_INFO “测试完成,环境已恢复” - exit O -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_clear.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_clear.sh deleted file mode 100644 index 57cf4795840..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_clear.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志清空功能,验证日志清空是否能正常执行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-docbytex软件包 - LOG_INFO "检查是否已安装texlive-docbytex软件包" - dnf list installed texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-docbytex软件包未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-docbytex软件包 - LOG_INFO "检查yum源中是否有texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-docbytex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-docbytex软件包" - dnf install -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 测试日志清空功能 - LOG_INFO "测试日志清空功能" - systemctl status texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "服务未运行或不存在" - exit 255 - fi - - # 清空日志 - LOG_INFO "清空服务日志" - journalctl --unit=texlive-docbytex --vacuum-size=1 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "清空日志失败" - - # 验证日志是否为空 - LOG_INFO "验证日志是否为空" - journalctl --unit=textlive-docbytexx --quiet | head -n1 > /dev/null 2>&1 - CHECK_RESULT $? 1 0 “验证失败” - - #恢复环境 - if [ "$INSTALLED" = false ]; then - dnf remove –y textlive–docbytexx - CHECK_RESULT$?00“卸载失败” - fi - - exit$? - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_compression.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_compression.sh deleted file mode 100644 index 388732fc667..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_compression.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志压缩功能,验证日志压缩是否能正常执行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-docbytex软件包的服务日志压缩功能" - - # 检查yum源中是否存在texlive-docbytex软件包 - LOG_INFO "检查yum源中是否存在texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-docbytex软件包" - exit 255 - fi - - # 检查是否已安装texlive-docbytex - LOG_INFO "检查是否已安装texlive-docbytex" - rpm -q texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "texlive-docbytex已安装" - else - installed=false - LOG_INFO "开始安装texlive-docbytex" - dnf install -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-docbytex失败" - fi - - # 测试服务日志压缩功能 - LOG_INFO "测试服务日志压缩功能" - journalctl --compress > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "日志压缩功能执行失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-docbytex" - dnf remove -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-docbytex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_export.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_export.sh deleted file mode 100644 index 7f28845c69a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_export.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志导出功能,验证日志导出是否能正常执行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-docbytex软件包 - LOG_INFO "检查texlive-docbytex软件包是否已安装" - dnf list installed texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装" - INSTALLED=1 - else - LOG_INFO "texlive-docbytex软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-docbytex软件包 - LOG_INFO "检查yum源中是否有texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-docbytex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-docbytex软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-docbytex软件包" - dnf install -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 测试日志导出功能 - LOG_INFO "测试texlive-docbytex软件包的日志导出功能" - TEXLIVE_LOG_EXPORT_CMD="texdoc --list" # 假设texdoc --list为日志导出命令 - $TEXLIVE_LOG_EXPORT_CMD > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "日志导出功能执行失败" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-docbytex软件包" - dnf remove -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-docbytecx软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_export_format.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_export_format.sh deleted file mode 100644 index 5d9bb305363..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_export_format.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志导出格式功能,验证日志导出格式是否符合预期 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-docbytex软件包是否已安装 - LOG_INFO "检查texlive-docbytex软件包是否已安装" - rpm -q texlive-docbytex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装" - installed=true - else - LOG_INFO "texlive-docbytex软件包未安装" - installed=false - fi - - # 检查yum源中是否有texlive-docbytex软件包 - LOG_INFO "检查yum源中是否有texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到texlive-docbytex软件包" - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-docbytex软件包" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 测试texlive-docbytex服务日志导出格式功能 - LOG_INFO "测试texlive-docbytex服务日志导出格式功能" - texlog_output=$(mktemp) - command_to_test="texlog --export-format=json > $teLOG_ERROR_output" - eval $command_to_test - CHECK_RESULT $? 0 255 "texlog命令参数不支持或不存在" - - # 检查导出的日志格式是否符合预期 - LOG_INFO "检查导出的日志格式是否符合预期" - if [ -s "$texlog_output" ]; then - jq empty "$texlog_output" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "导出的日志格式不符合JSON格式" - else - LOG_ERROR "导出的日志文件为空" - exit 1 - fi - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f "$teLOG_ERROR_output" - - # 如果脚本开始时未安装软件包,则在结束时卸载 - if [ "$installed" = false ]; then - LOG_INFO "卸载之前安装的软件包" - dnf remove -y texlive-docbytex > /dev/null - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_filter.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_filter.sh deleted file mode 100644 index e75fd7cbd40..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_filter.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志过滤功能,验证日志过滤是否能正常执行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-docbytex软件包 - LOG_INFO "检查texlive-docbytex软件包是否已安装" - rpm -q texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-docbytex软件包未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-docbytex软件包 - LOG_INFO "检查yum源中是否有texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-docbytex软件包" - exit 255 - fi - - # 安装texlive-docbytex软件包(如果未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-docbytex软件包" - dnf install -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 测试服务日志过滤功能 - LOG_INFO "测试texlive-docbyx服务日志过滤功能" - # 假设日志过滤命令为texlogfilter,参数为--filter-level=info(示例命令) - texlogfilter --filter-level=info > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "日志过滤功能执行失败" - - # 清理环境(如果脚本开始时未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载之前安装的test_script_demo软件包" - dnf remove -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-doxbtex软件包失败" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_format.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_format.sh deleted file mode 100644 index c8c8b2df91c..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_format.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志格式设置功能,验证日志格式是否能正常修改和生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-docbytex软件包 - LOG_INFO "检查是否已安装texlive-docbytex软件包" - if rpm -q texlive-docbytex >/dev/null 2>&1; then - LOG_INFO "texlive-docbytex已安装" - INSTALLED=true - else - LOG_INFO "texlive-docbytex未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-docbytex软件包 - LOG_INFO "检查yum源中是否存在texlive-docbytex软件包" - if ! dnf list available texlive-docbytex >/dev/null 2>&1; then - LOG_ERROR "yum源中不存在texlive-docbytex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-docbytex软件包" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装texlive-docbytex失败" - fi - - # 测试日志格式设置功能 - LOG_INFO "测试日志格式设置功能" - - # 修改日志格式 - LOG_INFO "修改日志格式" - sed -i "s/^LogFormat.*/LogFormat "%h %l %u %t \\"%r\\" %>s %b \\"%{Referer}i\\" \\"%{User-Agent}i\\"" combined/" /etc/rsyslog.conf - CHECK_RESULT $? 0 0 "修改日志格式失败" - - # 重启rsyslog服务使配置生效 - LOG_INFO "重启rsyslog服务" - systemctl restart rsyslog - CHECK_RESULT $? 0 0 "重启rsyslog服务失败" - - # 验证日志格式是否生效 - LOG_INFO "验证日志格式是否生效" - grep "LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined" /etc/rsyslog.conf >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "日志格式未生效" - - # 恢复原始日志格式 - LOG_INFO "恢复原始日志格式" - sed -i "s/^LogFormat.*/LogFormat "%h %l %u %t \\"%r\\" %>s %b" combined/" /etc/rsyslog.conf - CHECK_RESULT $? 0 0 "恢复日志格式失败" - - # 重启rsyslog服务 - LOG_INFO "重启rsyslog服务以恢复配置" - systemctl restart rsyslog - CHECK_RESULT $? 0 0 "重启rsyslog服务失败" - - # 如果最初未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-docbytex软件包" - dnf remove -y texlive-docbytex - CHECK_RESULT $? 0 0 "卸载texlive-docbytex失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_import.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_import.sh deleted file mode 100644 index 90041312cb2..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_import.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志导入功能,验证日志导入是否能正常执行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试texlive-docbytex软件包的服务日志导入功能 - LOG_INFO "开始测试texlive-docbytex软件包的服务日志导入功能" - - # 检查是否已安装texlive-docbytex软件包 - LOG_INFO "检查texlive-docbytex软件包是否已安装" - dnf list installed texlive-docbytex &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-docbytex软件包未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-docbytex软件包 - LOG_INFO "检查yum源中是否有texlive-docbytex软件包" - dnf list available texlive-docbytex &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-docbytex软件包" - exit 255 - fi - - # 安装texlive-docbytex软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-docbytex软件包" - dnf install -y texlive-docbytex &> /dev/null - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 测试服务日志导入功能 - LOG_INFO "测试texlive-docbyex服务日志导入功能" - # 假设日志导入命令为texlogimport,参数为--test(仅为示例,需根据实际命令调整) - texlogimport --test &> /dev/null - CHECK_RESULT $? 0 0 "日志导入功能执行失败" - - # 检查参数是否存在或不支持 - LOG_INFO "检查不支持的参数" - texlogimport --invalid-param &> /dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "不支持的参数未正确退出" - exit 255 - fi - - # 清理环境(如果测试前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-docbyex软件包" - dnf remove -y texlive-docbyex &> /dev/null - CHECK_RESULT $? 0 0 "卸载textive-dockbex软甲包失败" - fi - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level.sh deleted file mode 100644 index 0e4593c7936..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志级别设置功能,验证日志级别是否能正常修改和生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了texlive-docbytex软件包 - LOG_INFO "检查是否已安装texlive-docbytex软件包" - dnf list installed texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-docbytex软件包未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-docbytex软件包 - LOG_INFO "检查yum源中是否有texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-docbytex软件包" - exit 255 - fi - - # 安装texlive-docbytex软件包(如果未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "正在安装texlive-docbytex软件包" - dnf install -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 测试日志级别设置功能 - LOG_INFO "测试日志级别设置功能" - - # 验证日志级别是否能正常修改和生效 - LOG_INFO "修改日志级别为debug" - systemctl set-property texlive-docbytex.service LogLevel=debug - CHECK_RESULT $? 0 0 "修改日志级别为debug失败" - - LOG_INFO "验证日志级别是否生效" - systemctl show -p LogLevel texlive-docbytex.service | grep -q "LogLevel=debug" - CHECK_RESULT $? 0 0 "日志级别未生效" - - LOG_INFO "恢复日志级别为默认值" - systemctl set-property texlive-docbytex.service LogLevel=info - CHECK_RESULT $? 0 0 "恢复日志级别为info失败" - - LOG_INFO "验证日志级别是否恢复" - systemctl show -p LogLevel texlive-docbytex.service | grep -q "LogLevel=info" - CHECK_RESULT $? 0 0 "日志级别未恢复" - - # 清理环境(如果最初未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-docbytex软件包" - dnf remove -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "卸载texlive-docbytxe软甲包失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_change.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_change.sh deleted file mode 100644 index 610ec096450..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_change.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 : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志级别动态修改功能,验证日志级别是否能动态修改并生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-docbytex软件包是否已安装 - LOG_INFO "检查texlive-docbytex软件包是否已安装" - rpm -q texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装" - INSTALLED=1 - else - LOG_INFO "texlive-docbytex软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在texlive-docbytex软件包 - LOG_INFO "检查yum源中是否存在texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-docbytex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-docbytex软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-docbytex软件包" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 检查服务日志级别修改功能 - LOG_INFO "测试服务日志级别动态修改功能" - - # 获取当前日志级别 - LOG_INFO "获取当前日志级别" - CURRENT_LEVEL=$(systemctl show -p LogLevel texlive-docbytex | cut -d= -f2) - LOG_INFO "当前日志级别为: $CURRENT_LEVEL" - - # 修改日志级别为debug并验证 - LOG_INFO "修改日志级别为debug" - systemctl set-log-level texlive-docbytex debug > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "修改日志级别为debug失败" - - NEW_LEVEL=$(systemctl show -p LogLevel texlive-docbytex | cut -d= -f2) - CHECK_RESULT "$NEW_LEVEL" debug "\"日志级别修改为debug未生效\"" - - # 恢复日志级别为原始值并验证 - LOG_INFO "恢复日志级别为原始值: $CURRENT_LEVEL" - systemctl set-log-level texlive-docbytex "$CURRENT_LEVEL" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "\"恢复日志级别失败\"" - - RESTORED_LEVEL=$(systemctl show -p LogLevel texlive-docbylex | cut -d= -f2) - CHECK_RESULT "$RESTORED_LEVEL" "$CURRENT_LEVEL" "\"日志级别恢复未生效\"" - - # 如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-docbylex软件包" - dnf remove -y texlive-docbylex > /dev/null - CHECK_RESULT $? 0 0 "卸载texlive-docbylex软件包失败" - - # 再次确认卸载成功 - rpm -q texlive-doeclytex > /dev/null 2>&1 - if [ $? -eq 9]; then - LOG_ERROR("未能成功卸载") - exit 3 - fi - fi - - LOG_INFP("测试完成,环境已恢复") - exit 8 -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_cycle.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_cycle.sh deleted file mode 100644 index 48b1968f544..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_cycle.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志级别循环功能,验证日志级别循环设置是否能正常执行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-docbytex软件包是否已安装 - LOG_INFO "检查texlive-docbytex软件包是否已安装" - rpm -q texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-docbytex软件包未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-docbytex软件包 - LOG_INFO "检查yum源中是否存在texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-docbytex软件包" - exit 255 - fi - - # 安装texlive-docbytex软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-docbytex软件包" - dnf install -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - LOG_INFO "texlive-docbytex软件包安装成功" - fi - - # 测试日志级别循环功能 - LOG_INFO "测试texlive-docbytex软件包的日志级别循环功能" - - # 检查日志级别循环设置命令是否存在 - LOG_INFO "检查日志级别循环设置命令是否存在" - command -v texlogctl > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texlogctl命令不存在或不支持" - exit 255 - fi - - # 执行日志级别循环设置命令并验证结果 - LOG_INFO "执行日志级别循环设置命令" - for level in debug info warn error; do - texlogctl --set-level $level > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "设置日志级别为$level失败" - - current_level=$(texlogctl --get-level | awk "{print $2}") - CHECK_RESULT "$current_level" "$level" "\"当前日志级别$current_level与预期$level不符\"" - done - - LOG_INFO "日志级别循环功能测试完成" - - # 清理环境(如果最初未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始卸载texlive-docbytex软件包" - dnf remove -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-docbytecx软件包失败" - LOG_INFO "环境已恢复至初始状态" - fi - - exit 0 - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_cycle_set.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_cycle_set.sh deleted file mode 100644 index 2d7a1e50e81..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_cycle_set.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志级别循环设置功能,验证日志级别循环设置是否能正常执行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-docbytex软件包是否已安装 - LOG_INFO "检查texlive-docbytex软件包是否已安装" - rpm -q texlive-docbytex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装" - INSTALLED=1 - else - LOG_INFO "texlive-docbytex软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在texlive-docbytex软件包 - LOG_INFO "检查yum源中是否存在texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-docbytex软件包" - - # 若未安装则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-docbytex软件包" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 测试服务日志级别循环设置功能 - LOG_INFO "测试服务日志级别循环设置功能" - for level in debug info warn error; do - LOG_INFO "设置日志级别为$level" - texlive-docbytex --log-level $level - CHECK_RESULT $? 0 255 "设置日志级别$level失败" - - LOG_INFO "验证日志级别是否设置为$level" - current_level=$(texlive-docbytx --get-log-level) - CHECK_RESULT $? 0 255 "获取日志级别失败" - [ "$current_level" = "$level" ] - CHECK_RESULT $? 0 0 "日志级别设置不匹配" - done - - # 恢复环境:若脚本开始时未安装则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-docbytx软件包" - dnf remove -y texlive-docbytx - CHECK_RESULT $? 0 0 "卸载textive_dobctx软体包裹失敗しした。" - fi - - LOG_INFO “測試完成,環境已恢復” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_default.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_default.sh deleted file mode 100644 index 2b04c323bfa..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_default.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志默认级别功能,验证日志默认级别是否符合预期 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-docbytex软件包是否已安装 - if rpm -q texlive-docbytex &>/dev/null; then - LOG_INFO "环境已安装texlive-docbytex软件包,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "环境未安装texlive-docbytex软件包,测试结束后将卸载该软件包" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-docbytex软件包 - LOG_INFO "检查yum源中是否存在texlive-docbytex软件包" - if ! dnf list available texlive-docbytex &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-docbytex软件包" - exit 255 - fi - - # 安装texlive-docbytex软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-docbytex软件包" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 检查服务日志默认级别功能 - LOG_INFO "验证服务日志默认级别是否符合预期" - journalctl --no-pager -u texlive-docbytex.service | grep -q "LogLevel=info" - CHECK_RESULT $? 0 0 "服务日志默认级别不符合预期" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-docbytex软件包" - dnf remove -y texlive-docbytex - CHECK_RESULT $? 0 0 "卸载texlive-docbytex软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_invalid.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_invalid.sh deleted file mode 100644 index 9b6d4fa38d9..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_invalid.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志级别无效设置功能,验证设置无效日志级别时是否能正确处理 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-docbytex软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在texlive-docbytex软件包..." - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-docbytex软件包,退出测试" - exit 255 - fi - - # 检查环境是否已安装texlive-docbytex软件包 - LOG_INFO "检查环境是否已安装texlive-docbytex软件包..." - rpm -q texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装texlive-docbytex软件包,跳过安装步骤" - INSTALLED=1 - else - LOG_INFO "环境未安装texlive-docbytex软件包,开始安装..." - dnf install -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - INSTALLED=0 - fi - - # 测试设置无效日志级别 - LOG_INFO "测试设置无效日志级别功能..." - systemctl set-property texlive-docbytex.service LogLevel=invalid > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "设置无效日志级别未报错,功能异常" - exit 255 - else - LOG_INFO "设置无效日志级别报错,功能正常" - fi - - # 恢复环境状态(如果脚本开始时未安装软件包,则卸载) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-docbytex软件包..." - dnf remove -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-docbytex软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_max.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_max.sh deleted file mode 100644 index 474c07fa563..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_max.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志级别最大值功能,验证设置最大日志级别是否能正常生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试texlive-docbytex软件包的服务日志级别最大值功能" - - # 检查yum源中是否存在texlive-docbytex软件包 - LOG_INFO "检查yum源中是否存在texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-docbytex软件包" - exit 255 - fi - - # 检查是否已安装texlive-docbytex - LOG_INFO "检查是否已安装texlive-docbytex" - rpm -q texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "texlive-docbytex已安装,脚本结束后将保持安装状态" - else - installed=false - LOG_INFO "texlive-docbytex未安装,将在测试后卸载" - fi - - # 如果未安装,则安装texlive-docbytex - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-docbytex软件包" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装texlive-docbytex失败" - fi - - # 验证设置最大日志级别功能 - LOG_INFO "验证设置最大日志级别功能" - # 假设设置日志级别的命令为set_log_level,参数为--max-level - command -v set_log_level > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "命令set_log_level不存在或不支持" - exit 255 - fi - - # 测试设置最大日志级别为debug(假设debug为最高级别) - LOG_INFO "设置日志级别为debug" - set_log_level --max-level debug - CHECK_RESULT $? 0 0 "设置日志级别为debug失败" - - # TODO: 根据实际需求添加验证日志级别是否生效的步骤 - # 例如:检查日志文件内容或服务状态 - - # 恢复日志级别为默认值(假设info为默认级别) - LOG_INFO "恢复日志级别为info" - set_log_level --max-level info - CHECK_RESULT $? 0 0 "恢复日志级别为info失败" - - #如果脚本开始时未安装texlive-docbyx,则卸载 - if [ "$installed" = false ]; then - LOG_INFO"卸载texlve-doxbtex软件包" - dnf remove-y texlve-doxbte x - CHECK_RESULT$?00"卸载失败" - fi - - LOG_INF O“测试完成” - exit0 - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_min.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_min.sh deleted file mode 100644 index 7e3ef9c8ae8..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_min.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志级别最小值功能,验证设置最小日志级别是否能正常生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-docbytex软件包是否已安装 - LOG_INFO "检查texlive-docbytex软件包是否已安装" - rpm -q texlive-docbytex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装" - installed=true - else - LOG_INFO "texlive-docbytex软件包未安装" - installed=false - fi - - # 检查yum源中是否存在texlive-docbytex软件包 - LOG_INFO "检查yum源中是否存在texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-docbytex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-docbytex软件包" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 测试设置最小日志级别功能 - LOG_INFO "测试设置最小日志级别功能" - journalctl --since="1 hour ago" --no-pager -u texlive-docbytex.service --output=json | grep -q "\"PRIORITY\":\"0\"" - CHECK_RESULT $? 0 0 "设置最小日志级别功能未生效" - - # 恢复环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-docbytex软件包" - dnf remove -y texlive-docbytex - CHECK_RESULT $? 0 0 "卸载texlive-docbytex软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_min_max.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_min_max.sh deleted file mode 100644 index 35656527cfd..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_min_max.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志级别最小值和最大值功能,验证设置最小和最大日志级别是否能正常生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-docbytex软件包是否已安装 - LOG_INFO "检查texlive-docbytex软件包是否已安装" - rpm -q texlive-docbytex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装" - INSTALLED=true - else - LOG_INFO "texlive-docbytex软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-docbytex软件包 - LOG_INFO "检查yum源中是否存在texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-docbytex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-docbytex软件包" - dnf install -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 测试设置最小日志级别功能 - LOG_INFO "测试设置最小日志级别功能" - systemctl set-log-level texlive-docbytex --min-level=debug > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "设置最小日志级别失败" - - # 验证最小日志级别是否生效 - LOG_INFO "验证最小日志级别是否生效" - systemctl get-log-level texlive-docbytex | grep -q "debug" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "最小日志级别未生效" - - # 测试设置最大日志级别功能 - LOG_INFO "测试设置最大日志级别功能" - systemctl set-log-level texlive-docbytex --max-level=error > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "设置最大日志级别失败" - - # 验证最大日志级别是否生效 - LOG_INFO "验证最大日志级别是否生效" - systemctl get-log-level texlive-docbytex | grep -q "error" > /dev/null 2>&1 - CHECK_RESULT $?-eq-255; then - LOG_ERROR "参数不存在或不支持" - exit 255 - fi - - # 恢复日志级别为默认值 - LOG_INFO “恢复日志级别为默认值” - systemctl reset-log-level texlive—docbytext > / dev/ null 2>&l - CHECK_ RESULT $? O O “恢复默认日忐级別失敗” - - #如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_ INFO “卸载textive—docbytext软件包” - dnf remove -y textive—docbytext> / dev/ null Z>&l - CHECK_ RESULT $7 O O “卸载textive—docbytext軟件包失敗” - fi - - LOG_ INFO “測試完成,环境已恢複” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_query.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_query.sh deleted file mode 100644 index f916a6ec30a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_query.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志级别查询功能,验证当前日志级别是否能正常查询 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-docbytex软件包 - LOG_INFO "检查是否已安装texlive-docbytex软件包" - rpm -q texlive-docbytex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装" - installed=true - else - LOG_INFO "texlive-docbytex软件包未安装" - installed=false - fi - - # 检查yum源中是否存在texlive-docbytex软件包 - LOG_INFO "检查yum源中是否存在texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-docbytex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-docbytex软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-docbytex软件包" - dnf install -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 测试查询服务日志级别功能 - LOG_INFO "测试查询服务日志级别功能" - log_level=$(systemctl show -p LogLevel texlive-docbytex.service | cut -d= -f2) - if [ -z "$log_level" ]; then - LOG_ERROR "查询日志级别失败" - exit 255 - fi - LOG_INFO "当前日志级别为: $log_level" - - # 如果之前未安装,则卸载texlive-docbytex软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载之前安装的texlive-docbytex软件包" - dnf remove -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-docbytex软件包失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_range.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_range.sh deleted file mode 100644 index 37528cbb143..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_range.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志级别范围功能,验证设置超出范围的日志级别时是否能正确处理 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装texlive-docbytex软件包 - LOG_INFO "检查texlive-docbytex软件包是否已安装" - dnf list installed texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "texlive-docbytex软件包未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有texlive-docbytex软件包 - LOG_INFO "检查yum源中是否存在texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-docbytex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-docbytex软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装texlive-docbytex软件包" - dnf install -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 测试设置超出范围的日志级别 - LOG_INFO "测试设置超出范围的日志级别" - systemctl set-log-level texlive-docbyx invalid_level > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "设置超出范围的日志级别未正确处理" - - # 恢复环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-docbytex软件包" - dnf remove -y texlive-docbyx > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-docbyx软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_restore.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_restore.sh deleted file mode 100644 index 22aee036ec0..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_restore.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志级别恢复功能,验证日志级别是否能恢复到默认级别 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-docbytex软件包是否已安装 - LOG_INFO "检查texlive-docbytex软件包是否已安装" - dnf list installed texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装" - INSTALLED=1 - else - LOG_INFO "texlive-docbytex软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-docbytex软件包 - LOG_INFO "检查yum源中是否有texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-docbytex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-docbytex软件包" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 验证日志级别恢复功能 - LOG_INFO "验证日志级别恢复功能" - systemctl restart texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "重启texlive-docbytex服务失败" - - # 检查日志级别是否恢复为默认 - LOG_INFO "检查日志级别是否恢复为默认" - journalctl -u texlive-docbytec --no-pager | grep "default log level" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "日志级别未恢复为默认" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载之前安装的软件包" - dnf remove -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载失败,请手动清理环境" - else - LOG_INFO "环境保持原状,无需卸载" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_set.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_set.sh deleted file mode 100644 index 7eaea588e06..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_set.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志级别设置功能,验证日志级别是否能正常设置和生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试texlive-docbytex软件包的服务日志级别设置功能" - - # 检查是否已安装texlive-docbytex - LOG_INFO "检查是否已安装texlive-docbytex" - dnf list installed texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex已安装,跳过安装步骤" - INSTALLED=1 - else - LOG_INFO "texlive-docbytex未安装,准备安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-docbytex - LOG_INFO "检查yum源中是否有texlive-docbytex" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-docbytex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-docbytex - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-docbytex" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装失败" - fi - - # 测试日志级别设置功能 - LOG_INFO "测试日志级别设置功能" - - # 设置日志级别为debug并验证 - LOG_INFO "设置日志级别为debug" - systemctl set-log-level texlive-docbytex debug > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "设置日志级别为debug失败" - - # 验证日志级别是否生效 - LOG_INFO "验证日志级别是否生效" - systemctl get-log-level texlive-docbytex | grep debug > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "日志级别未生效" - - # 设置日志级别为info并验证(恢复默认) - LOG_INFO "设置日志级别为info(恢复默认)" - systemctl set-log-level texlive-docbytex info > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "设置日志级别为info失败" - - # 验证日志级别是否恢复为info - LOG_INFO "验证日志级别是否恢复为info" - systemctl get-log-level texlive- docbytes | grep info >/ dev/ null 2>&1 - CHECK_RESULT $? 00 \“恢复默认日志级别失败” - - # 如果最初未安装,则卸载tex live- doc by tes - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载tex live- doc by tes" - dnf remove - y tex live- doc by tes - CHECK_RESULT $? 00 \“卸载失败” - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_verify.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_verify.sh deleted file mode 100644 index 6cdccb82272..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_level_verify.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志级别验证功能,验证设置的日志级别是否与实际记录一致 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_texlive-docbytex_service_log_level_verify - - LOG_INFO "开始测试 texlive-docbytex 软件包的服务日志级别验证功能" - - # 检查 yum 源中是否存在 texlive-docbytex 软件包 - LOG_INFO "检查 yum 源中是否存在 texlive-docbytex 软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中不存在 texlive-docbytex 软件包" - exit 255 - fi - - # 检查是否已安装 texlive-docbytex - LOG_INFO "检查是否已安装 texlive-docbytex" - rpm -q texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "texlive-docbytex 已安装" - else - installed=false - LOG_INFO "texlive-docbytex 未安装,将进行安装" - fi - - # 如果未安装,则安装 texlive-docbytex - if [ "$installed" = false ]; then - LOG_INFO "安装 texlive-docbytex" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装 texlive-docbytex 失败" - fi - - # 验证日志级别设置功能 - LOG_INFO "验证日志级别设置功能" - - # 设置日志级别为 debug(假设支持 debug、info、error 等级别) - LOG_INFO "设置日志级别为 debug" - systemctl set-log-level texlive-docbytex debug > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "设置日志级别为 debug 失败" - - # 检查日志级别是否实际生效 - LOG_INFO "检查日志级别是否实际生效" - journalctl --unit=texlive-docbytex --priority=debug --no-pager | grep -q "debug" - CHECK_RESULT $? 0 0 "日志级别未生效" - - # 恢复日志级别为默认值(假设默认值为 info) - LOG_INFO "恢复日志级别为默认值" - systemctl set-log-level texlive-docbytex info > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "恢复日志级别为 info 失败" - - # 如果脚本开始时未安装,则在测试完成后卸载 texlive-docbytex - if [ "$installed" = false ]; then - LOG_INFO "卸载 texlive-docbytex" - dnf remove -y texlive-docbytex - CHECK_RESULT $? 0 0 "卸载 texlive-docbytex 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_retention.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_retention.sh deleted file mode 100644 index 12b33197050..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_retention.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志保留功能,验证日志保留策略是否能正常设置和生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试texlive-docbytex软件包的服务日志保留功能 - LOG_INFO "开始测试texlive-docbytex软件包的服务日志保留功能" - - # 检查yum源中是否存在texlive-docbytex软件包 - LOG_INFO "检查yum源中是否存在texlive-docbytex软件包" - dnf list texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-docbytex软件包" - exit 255 - fi - - # 检查是否已安装texlive-docbytex - LOG_INFO "检查是否已安装texlive-docbytex" - rpm -q texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到texlive-docbytex已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "未检测到texlive-docbytex安装,将进行安装" - INSTALLED=0 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-docbytex软件包" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装失败" - fi - - # 验证日志保留策略设置功能 - LOG_INFO "验证日志保留策略设置功能" - journalctl --disk-usage | grep -q "journalctl" - CHECK_RESULT $? 0 0 "日志保留策略设置失败" - - # 验证日志保留策略是否生效 - LOG_INFO "验证日志保留策略是否生效" - journalctl --vacuum-size=100M > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "日志保留策略未生效" - - # 清理环境:如果脚本开始时未安装,则卸载软件包;否则保持安装状态 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载之前未安装的软件包texlive-docbytex" - dnf remove -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载失败" - else - LOG_INFO "保持环境不变,不卸载texlive-docbytex" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_rotate.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_rotate.sh deleted file mode 100644 index c4c56d715d6..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_rotate.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志轮转功能,验证日志轮转是否能正常执行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装texlive-docbytex软件包 - LOG_INFO "检查texlive-docbytex软件包是否已安装" - dnf list installed texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-docbytex软件包未安装,脚本结束后将卸载该软件包" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-docbytex软件包 - LOG_INFO "检查yum源中是否存在texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-docbytex软件包" - exit 255 - fi - - # 安装texlive-docbytex软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-docbytex软件包" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 检查日志轮转功能是否支持指定参数 - LOG_INFO "检查日志轮转功能是否支持指定参数" - logrotate --help | grep "force" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "日志轮转功能不支持指定参数" - exit 255 - fi - - # 执行日志轮转测试步骤(假设日志文件为/var/log/example.log) - LOG_INFO "开始测试日志轮转功能" - logrotate -f /etc/logrotate.conf > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "日志轮转功能测试失败" - - # 清理环境(如果脚本开始时未安装texlive-docbytex软件包) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-docbytex软件包" - dnf remove -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_size.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_size.sh deleted file mode 100644 index ef4764927fa..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_size.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志大小限制功能,验证日志大小限制是否能正常设置和生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试texlive-docbytex软件包的服务日志大小限制功能 - LOG_INFO "开始测试texlive-docbytex软件包的服务日志大小限制功能" - - # 检查yum源中是否存在texlive-docbytex软件包 - LOG_INFO "检查yum源中是否存在texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-docbytex软件包" - exit 255 - fi - - # 检查是否已安装texlive-docbytex - LOG_INFO "检查是否已安装texlive-docbytex" - rpm -q texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "未安装texlive-docbytex,测试结束后将卸载" - INSTALLED=0 - fi - - # 若未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-docbytex软件包" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装失败" - fi - - # 测试日志大小限制功能 - LOG_INFO "测试日志大小限制功能" - # 假设设置日志大小限制为10MB(示例命令,需根据实际命令调整) - LOG_SIZE_LIMIT=10M - systemctl set-property texlive-docbytec.service LogLimitSize=$LOG_SIZE_LIMIT > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "设置日志大小限制失败" - - # 验证日志大小限制是否生效 - LOG_INFO "验证日志大小限制是否生效" - ACTUAL_LIMIT=$(systemctl show -p LogLimitSize texlive-docbytec.service | cut -d= -f2) - if [ "$ACTUAL_LIMIT" != "$LOG_SIZE_LIMIT" ]; then - LOG_ERROR "日志大小限制未生效,预期: $LOG_SIZE_LIMIT, 实际: $ACTUAL_LIMIT" - exit 1 - else - LOG_INFO "日志大小限制已生效: $ACTUAL_LIMIT" - fi - - # 恢复环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-docbytec软件包" - dnf remove -y texlive-docbytex - fi - - LOG_INFO "测试完成,环境已恢复" - exit 0 - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_timestamp.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_timestamp.sh deleted file mode 100644 index b6b97a91ca2..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_log_timestamp.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务日志时间戳功能,验证日志时间戳是否能正常显示 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-docbytex软件包是否已安装 - LOG_INFO "检查texlive-docbytex软件包是否已安装" - rpm -q texlive-docbytex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装,脚本结束后将保持安装状态" - installed=true - else - LOG_INFO "texlive-docbytex软件包未安装,将在测试步骤中安装" - installed=false - fi - - # 检查yum源中是否存在texlive-docbytex软件包 - LOG_INFO "检查yum源中是否存在texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-docbytex软件包" - exit 255 - fi - - # 安装texlive-docbytex软件包(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-docbytex软件包" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 验证日志时间戳功能 - LOG_INFO "验证日志时间戳功能" - journalctl --unit=docbytex.service --since="1 hour ago" --no-pager | grep -E "[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}" - CHECK_RESULT $? 0 0 "日志时间戳显示异常" - - # 清理环境(如果脚本开始时未安装texlive-docbytex) - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-docbytex软件包" - dnf remove -y texlive-docbytex - CHECK_RESULT $? 0 0 "卸载texlive-docbytex软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - exit 0 -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_reload.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_reload.sh deleted file mode 100644 index 683e0bc0aaf..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_reload.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务重载功能,验证服务配置重载是否能正常生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-docbytex软件包是否已安装 - LOG_INFO "检查texlive-docbytex软件包是否已安装" - rpm -q texlive-docbytex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-docbytex软件包未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-docbytex软件包 - LOG_INFO "检查yum源中是否存在texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在texlive-docbytex软件包" - - # 安装texlive-docbytex软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-docbytex软件包" - dnf install -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 验证服务配置重载功能 - LOG_INFO "验证服务配置重载功能" - systemctl reload texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "服务配置重载失败" - - # 清理环境(如果最初未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载之前安装的texlive-docbytex软件包" - dnf remove -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-docbyx软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_restart.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_restart.sh deleted file mode 100644 index ab976930e5a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_restart.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务重启功能,验证服务是否能正常重启 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查texlive-docbytex软件包是否已安装 - LOG_INFO "检查texlive-docbytex软件包是否已安装" - dnf list installed texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装" - INSTALLED=1 - else - LOG_INFO "texlive-docbytex软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-docbytex软件包 - LOG_INFO "检查yum源中是否有texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-docbytex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-docbytex软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装texlive-docbytex软件包" - dnf install -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 检查服务是否存在并获取服务名称 - LOG_INFO "检查服务是否存在" - SERVICE_NAME=$(systemctl list-unit-files | grep texlive | awk "{print $1}") - if [ -z "$SERVICE_NAME" ]; then - LOG_ERROR "未找到texlive相关服务" - exit 255 - fi - - # 重启服务并验证 - LOG_INFO "重启服务:$SERVICE_NAME" - systemctl restart $SERVICE_NAME - CHECK_RESULT $? 0 0 "重启服务失败" - - LOG_INFO "验证服务状态" - systemctl status $SERVICE_NAME | grep "active (running)" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "服务未正常运行" - - # 如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载texlive-docbytex软件包" - dnf remove -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 “卸载texlive-docbyx失败” - fi - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_start.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_start.sh deleted file mode 100644 index 0c9aa648d8b..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_start.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-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务启动功能,验证服务是否能正常启动 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-docbytex软件包是否已安装 - LOG_INFO "检查texlive-docbytex软件包是否已安装" - rpm -q texlive-docbytex - if [ $? -eq 0 ]; then - LOG_INFO "texlive-docbytex软件包已安装" - INSTALLED=true - else - LOG_INFO "texlive-docbytex软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-docbytex软件包 - LOG_INFO "检查yum源中是否有texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-docbytex软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-docbytex软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-docbytex软件包" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 检查服务是否存在 - LOG_INFO "检查服务是否存在" - systemctl list-unit-files | grep texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-docbytex服务不存在" - exit 255 - fi - - # 启动服务 - LOG_INFO "启动服务" - systemctl start texlive-docbytex - CHECK_RESULT $? 0 0 "启动texlive-docbylex服务失败" - - #验证服务状态是否为active - LOG_INFO "验证服务状态是否为active" - systemctl is-active texlive-docbylex | grep active > /dev/null 2>&1 - CHECK_RESULT $? , , ,"验证服务状态失败" - - #停止并禁用该测试用到的所有临时性服务. - systemctl stop texlivedocbylx. service && systemct disable. - - #恢复环境:如果脚本开始时未安装,则卸载该测试用到的所有临时性软件. - if [ "$INSTALLED" = false ]; then - dnf remove -y. - - CHECK_RESULT.$?. - - fi - - exit. -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_status.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_status.sh deleted file mode 100644 index 0f6f22f62cb..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_status.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务状态查询功能,验证服务状态是否能正常查询 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试texlive-docbytex软件包的服务状态查询功能 - LOG_INFO "开始测试texlive-docbytex软件包的服务状态查询功能" - - # 检查yum源中是否存在texlive-docbytex软件包 - LOG_INFO "检查yum源中是否存在texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-docbytex软件包" - exit 255 - fi - - # 检查是否已安装texlive-docbytex软件包 - LOG_INFO "检查是否已安装texlive-docbytex软件包" - rpm -q texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "系统已安装texlive-docbytex软件包" - INSTALLED=1 - else - LOG_INFO "系统未安装texlive-docbytex软件包,将进行安装" - INSTALLED=0 - fi - - # 如果未安装,则安装texlive-docbytex软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-docbytex软件包" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装失败" - fi - - # 查询服务状态 - LOG_INFO "查询texlive-docbytx服务状态" - systemctl status texlive-docbytx > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "服务状态查询失败" - - # 如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载之前安装的textive-live doc by tx 软体包" - dnf remove -y tex live doc by tx - CHECK RESULT $ ? 0 0 \“卸载失败” - fi - - LOG INFO \“测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_stop.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_stop.sh deleted file mode 100644 index 35b7aae346a..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_service_stop.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-05 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的服务停止功能,验证服务是否能正常停止 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-docbytex软件包是否已安装 - LOG_INFO "检查texlive-docbytex软件包是否已安装" - if rpm -q texlive-docbytex &>/dev/null; then - LOG_INFO "texlive-docbytex软件包已安装" - INSTALLED=true - else - LOG_INFO "texlive-docbytex软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-docbytex软件包 - LOG_INFO "检查yum源中是否存在texlive-docbytex软件包" - if ! dnf list available texlive-docbytex &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-docbytex软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-docbytex软件包" - dnf install -y texlive-docbytex - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 测试服务停止功能 - LOG_INFO "测试texlive-docbytex服务停止功能" - systemctl stop texlive-docbytex &>/dev/null - CHECK_RESULT $? 0 0 "停止texlive-docbytex服务失败" - - # 验证服务是否已停止 - LOG_INFO "验证texlive-docbytex服务是否已停止" - systemctl is-active texlive-docbytex &>/dev/null - CHECK_RESULT $? 3 0 "服务未成功停止" - - # 恢复环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-docbytex软件包" - dnf remove -y texlive-docbytex - CHECK_RESULT $? 0 0 "卸载texlive-docbytex软件包失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_upgrade.sh b/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_upgrade.sh deleted file mode 100644 index e42eaccee20..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-g/texlive-docbytex/test_texlive-docbytex_upgrade.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-07-04 -# @License : Mulan PSL v2 -# @Desc : 测试texlive-docbytex软件包的升级功能,验证升级过程是否正常完成 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试texlive-docbytex软件包的升级功能,验证升级过程是否正常完成 - - LOG_INFO "开始测试texlive-docbytex软件包的升级功能" - - # 检查yum源中是否存在texlive-docbytex软件包 - LOG_INFO "检查yum源中是否存在texlive-docbytex软件包" - dnf list available texlive-docbytex > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-docbytex软件包" - exit 255 - fi - - # 检查当前是否已安装texlive-docbytex软件包 - LOG_INFO "检查当前是否已安装texlive-docbytex软件包" - dnf list installed texlive-docbytex > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "当前已安装texlive-docbytex软件包,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "当前未安装texlive-docbytex软件包,测试结束后将卸载" - INSTALLED=false - fi - - # 如果未安装,则安装texlive-docbytex软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-docbytex软件包" - dnf install -y texlive-docbytex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-docbytex软件包失败" - fi - - # 检查texlive-docbytex软件包的当前版本 - LOG_INFO "检查当前安装的texlive-docbytex软件包版本" - CURRENT_VERSION=$(rpm -q texlive-docbytec --queryformat "%{VERSION}-%{RELEASE}") - LOG_INFO "当前texliev-doctxe版本: ${CURRENT_VERSION}" - - # 升级tlexvie-doctxe软件到最新版本 - LOG_INFO"开始升级tlexvie-doctxe到最新版本" - dnf update -y tlexvie-doctxe >/dev/null2>&1 - CHECK_RESULT$?00"升级tlexvie-doctxe失败" - - #检查升级后的tlexvie-doctxe版本 - NEW_VERSION=$(rpm -q tlexvie-doctxe --queryformat "%{VERSION}-%{RELEASE}") - if[ "$NEW_VERSION" != "$CURRENT_VERSION"]; then - LOG_INFO"升级成功,新版本为${NEW_VERSION}" - else - LOG_ERROR"升级失败,版本未变化" - exit1 - fi - - #如果初始未安装,则卸载tlexvie-doctxe软件以恢复环境 - if[ "$INSTALLED"=false]; then - LOG_INFO"恢复环境:卸载tlexvie-doctxe软件" - dnf remove-y tlexvie-doctxe>/dev/null2>&1 - CHECK_RESULT$?00"卸载tlexvie-doctxe失败" - fi - - LOG_INFO"测试完成:tlexvie-do ctx e的升级功能验证通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-node-doc/test_texlive-pst-node-doc_function_check.sh b/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-node-doc/test_texlive-pst-node-doc_function_check.sh deleted file mode 100644 index fad8ab71b02..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-node-doc/test_texlive-pst-node-doc_function_check.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-03-15 -# @License : Mulan PSL v2 -# @Desc : Test package presence check -# ############################################ - -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 mode=$3 - local message=$4 - - if [ $mode -eq 0 ]; then - if [ $actual -ne $expect ]; then - LOG_ERROR "$message" - exit $actual - fi - else - if [ $actual -eq $expect ]; then - LOG_ERROR "$message" - exit 1 - fi - fi - return 0 - } - - # 定义SSH命令函数(虽然题目说无需定义,但实际需要) - SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=$4 - - # 这里只是模拟,实际应该使用sshpass或其他方式 - LOG_INFO "在节点 $ip 上执行命令: $cmd" - return 0 - } - - # 测试包存在性检查 - LOG_INFO "开始执行测试:Test package presence check" - - # 定义要测试的包名 - PACKAGE_NAME="texlive-pst-node-doc" - - # 步骤1:检查包是否已在yum源中 - LOG_INFO "步骤1:检查 $PACKAGE_NAME 是否在yum源中" - dnf list available $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - LOG_INFO "包 $PACKAGE_NAME 在yum源中可用" - - # 步骤2:检查是否已安装 - LOG_INFO "步骤2:检查 $PACKAGE_NAME 是否已安装" - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "$PACKAGE_NAME 已安装" - ALREADY_INSTALLED=1 - else - LOG_INFO "$PACKAGE_NAME 未安装" - ALREADY_INSTALLED=0 - fi - - # 步骤3:如果未安装,则安装包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - LOG_INFO "安装 $PACKAGE_NAME 成功" - fi - - # 步骤4:验证包的功能 - LOG_INFO "步骤4:验证包的基本功能" - # 这里可以添加具体的功能测试,例如检查文档文件是否存在 - rpm -ql $PACKAGE_NAME | head -5 > /dev/null - CHECK_RESULT $? 0 0 "验证 $PACKAGE_NAME 文件列表失败" - - # 步骤5:清理环境 - LOG_INFO "步骤5:清理测试环境" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败" - LOG_INFO "卸载 $PACKAGE_NAME 成功" - else - LOG_INFO "保持 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试完成:Test package presence check" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-node-doc/test_texlive-pst-node-doc_function_doc_access.sh b/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-node-doc/test_texlive-pst-node-doc_function_doc_access.sh deleted file mode 100644 index 07beab27cb4..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-node-doc/test_texlive-pst-node-doc_function_doc_access.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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 documentation file access -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装 texlive-pst-node-doc 软件包 - LOG_INFO "检查是否已安装 texlive-pst-node-doc 软件包" - rpm -q texlive-pst-node-doc > /dev/null 2>&1 - is_installed=$? - - # 记录初始安装状态,用于脚本结束时的环境恢复 - initial_installed=$is_installed - - # 检查 yum 源中是否存在 texlive-pst-node-doc 软件包 - LOG_INFO "检查 yum 源中是否存在 texlive-pst-node-doc 软件包" - dnf list available texlive-pst-node-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 texlive-pst-node-doc 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $is_installed -ne 0 ]; then - LOG_INFO "未安装 texlive-pst-node-doc,开始安装" - dnf install -y texlive-pst-node-doc - CHECK_RESULT $? 0 0 "安装 texlive-pst-node-doc 失败" - fi - - # 测试文档文件访问 - LOG_INFO "测试 texlive-pst-node-doc 文档文件访问" - # 获取软件包安装的文档文件列表 - doc_files=$(rpm -ql texlive-pst-node-doc | grep -E "\.(pdf|html|txt|md)$" | head -5) - if [ -z "$doc_files" ]; then - LOG_INFO "软件包未包含标准文档文件,尝试查找其他文档" - doc_files=$(rpm -ql texlive-pst-node-doc | grep -i doc | head -5) - fi - - # 检查是否找到文档文件 - if [ -z "$doc_files" ]; then - LOG_ERROR "未找到 texlive-pst-node-doc 的文档文件" - # 根据初始状态决定是否卸载 - if [ $initial_installed -ne 0 ]; then - LOG_INFO "清理环境:卸载 texlive-pst-node-doc" - dnf remove -y texlive-pst-node-doc - fi - exit 1 - fi - - # 测试访问文档文件 - LOG_INFO "找到文档文件,开始测试访问" - for doc_file in $doc_files; do - if [ -f "$doc_file" ]; then - LOG_INFO "测试访问文档文件: $doc_file" - # 尝试读取文件基本信息 - file "$doc_file" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "访问文档文件 $doc_file 失败" - else - LOG_ERROR "文档文件不存在: $doc_file" - # 根据初始状态决定是否卸载 - if [ $initial_installed -ne 0 ]; then - LOG_INFO "清理环境:卸载 texlive-pst-node-doc" - dnf remove -y texlive-pst-node-doc - fi - exit 1 - fi - done - - LOG_INFO "文档文件访问测试完成" - - # 环境恢复:如果最初未安装,则卸载软件包 - if [ $initial_installed -ne 0 ]; then - LOG_INFO "清理环境:卸载 texlive-pst-node-doc" - dnf remove -y texlive-pst-node-doc - CHECK_RESULT $? 0 0 "卸载 texlive-pst-node-doc 失败" - else - LOG_INFO "环境保持已安装状态" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-node-doc/test_texlive-pst-node-doc_function_remove.sh b/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-node-doc/test_texlive-pst-node-doc_function_remove.sh deleted file mode 100644 index 750cb9c24e9..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-node-doc/test_texlive-pst-node-doc_function_remove.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-15 -# @License : Mulan PSL v2 -# @Desc : Test package removal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-pst-node-doc - LOG_INFO "检查是否已安装texlive-pst-node-doc" - rpm -q texlive-pst-node-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-pst-node-doc已安装,脚本结束将保持安装状态" - INSTALLED=1 - else - LOG_INFO "texlive-pst-node-doc未安装,将进行安装测试" - INSTALLED=0 - fi - - # 检查yum源中是否有texlive-pst-node-doc软件包 - LOG_INFO "检查yum源中是否有texlive-pst-node-doc软件包" - dnf list available texlive-pst-node-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到texlive-pst-node-doc软件包" - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装texlive-pst-node-doc软件包" - dnf install -y texlive-pst-node-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-pst-node-doc软件包失败" - fi - - # 测试软件包移除功能 - LOG_INFO "测试软件包移除功能" - dnf remove -y texlive-pst-node-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "移除texlive-pst-node-doc软件包失败" - - # 验证软件包是否已移除 - LOG_INFO "验证软件包是否已移除" - rpm -q texlive-pst-node-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "软件包移除失败,texlive-pst-node-doc仍然存在" - exit 1 - else - LOG_INFO "软件包移除成功" - fi - - # 如果最初未安装,则重新安装以恢复环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "恢复环境:重新安装texlive-pst-node-doc软件包" - dnf install -y texlive-pst-node-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "重新安装texlive-pst-node-doc软件包失败" - else - LOG_INFO "恢复环境:重新安装texlive-pst-node-doc软件包" - dnf install -y texlive-pst-node-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "重新安装texlive-pst-node-doc软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-t/texlive-refstyle-doc/test_texlive-refstyle-doc_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-t/texlive-refstyle-doc/test_texlive-refstyle-doc_function_basic.sh deleted file mode 100644 index ccf1e5dd819..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-t/texlive-refstyle-doc/test_texlive-refstyle-doc_function_basic.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Check basic functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Check basic functionality" - - # 检查是否已安装texlive-refstyle-doc - LOG_INFO "检查是否已安装texlive-refstyle-doc" - dnf list installed texlive-refstyle-doc &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-refstyle-doc已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-refstyle-doc未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-refstyle-doc - LOG_INFO "检查yum源中是否有texlive-refstyle-doc" - dnf list available texlive-refstyle-doc &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-refstyle-doc,退出测试" - exit 255 - fi - - # 安装texlive-refstyle-doc - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-refstyle-doc" - dnf install -y texlive-refstyle-doc &>/dev/null - CHECK_RESULT $? 0 0 "安装texlive-refstyle-doc失败" - fi - - # 测试基本功能 - LOG_INFO "测试基本功能" - command_to_test="some_command --option" # 替换为实际测试命令 - $command_to_test &>/dev/null - CHECK_RESULT $? 0 0 "测试基本功能失败" - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-refstyle-doc" - dnf remove -y texlive-refstyle-doc &>/dev/null - CHECK_RESULT $? 0 0 "卸载texlive-refstyle-doc失败" - fi - - LOG_INFO "测试完成:Check basic functionality" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-v/texlive-spot-doc/test_texlive-spot-doc_function_doc_access.sh b/testcases/function_test/pkg_test/texlive-split-v/texlive-spot-doc/test_texlive-spot-doc_function_doc_access.sh deleted file mode 100644 index e7e23f289c3..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-v/texlive-spot-doc/test_texlive-spot-doc_function_doc_access.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-27 -# @License : Mulan PSL v2 -# @Desc : Verify access to texlive-spot-doc documentation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本开始 - LOG_INFO "开始测试:Verify access to texlive-spot-doc documentation" - - # 定义软件包名称 - PACKAGE_NAME="texlive-spot-doc" - - # 步骤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 - LOG_INFO "软件包 $PACKAGE_NAME 在yum源中" - - # 步骤2:检查是否已安装 - LOG_INFO "步骤2:检查是否已安装" - rpm -q $PACKAGE_NAME >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - INSTALLED="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:验证文档访问 - LOG_INFO "步骤4:验证文档访问" - # 检查文档目录是否存在 - DOC_PATH="/usr/share/doc/$PACKAGE_NAME" - if [ -d "$DOC_PATH" ]; then - LOG_INFO "文档目录 $DOC_PATH 存在" - # 列出文档目录内容 - ls -la $DOC_PATH - CHECK_RESULT $? 0 0 "访问文档目录 $DOC_PATH 失败" - LOG_INFO "文档目录访问成功" - else - LOG_ERROR "文档目录 $DOC_PATH 不存在" - exit 1 - fi - - # 步骤5:清理环境 - LOG_INFO "步骤5:清理环境" - 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 "测试完成:Verify access to texlive-spot-doc documentation" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-v/texlive-spot-doc/test_texlive-spot-doc_function_version.sh b/testcases/function_test/pkg_test/texlive-split-v/texlive-spot-doc/test_texlive-spot-doc_function_version.sh deleted file mode 100644 index 5570cd14936..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-v/texlive-spot-doc/test_texlive-spot-doc_function_version.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-02-27 -# @License : Mulan PSL v2 -# @Desc : Check the version of texlive-spot-doc package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:检查 texlive-spot-doc 包的版本" - - # 检查软件包是否已在yum源中 - LOG_INFO "步骤1:检查yum源中是否存在 texlive-spot-doc 软件包" - dnf list available texlive-spot-doc &>/dev/null - CHECK_RESULT $? 0 0 "yum源中不存在 texlive-spot-doc 软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到 texlive-spot-doc 软件包" - exit 255 - fi - - # 检查系统是否已安装 texlive-spot-doc - LOG_INFO "步骤2:检查系统是否已安装 texlive-spot-doc" - rpm -q texlive-spot-doc &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-spot-doc 已安装,跳过安装步骤" - INSTALLED=1 - else - LOG_INFO "texlive-spot-doc 未安装,开始安装" - dnf install -y texlive-spot-doc - CHECK_RESULT $? 0 0 "安装 texlive-spot-doc 失败" - INSTALLED=0 - fi - - # 检查 texlive-spot-doc 版本 - LOG_INFO "步骤3:检查 texlive-spot-doc 包的版本" - rpm -q --queryformat "%{VERSION}-%{RELEASE}\n" texlive-spot-doc - CHECK_RESULT $? 0 0 "获取 texlive-spot-doc 版本失败" - - # 环境恢复:如果测试前未安装,则卸载软件包 - LOG_INFO "步骤4:恢复测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的 texlive-spot-doc 包" - dnf remove -y texlive-spot-doc - CHECK_RESULT $? 0 0 "卸载 texlive-spot-doc 失败" - else - LOG_INFO "测试前已安装 texlive-spot-doc,保持安装状态" - fi - - LOG_INFO "测试完成:texlive-spot-doc 版本检查成功" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-ucharcat/test_texlive-ucharcat_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-ucharcat/test_texlive-ucharcat_function_basic.sh deleted file mode 100644 index d78d72ebe59..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-ucharcat/test_texlive-ucharcat_function_basic.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality of ucharcat -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试ucharcat的基本功能" - - # 检查环境是否已安装texlive-ucharcat - LOG_INFO "检查是否已安装texlive-ucharcat" - if dnf list installed texlive-ucharcat &>/dev/null; then - LOG_INFO "texlive-ucharcat已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ucharcat未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-ucharcat - LOG_INFO "检查yum源中是否有texlive-ucharcat" - if ! dnf list available texlive-ucharcat &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-ucharcat,退出测试" - exit 255 - fi - - # 如果未安装,则安装texlive-ucharcat - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-ucharcat" - dnf install -y texlive-ucharcat - CHECK_RESULT $? 0 0 "安装texlive-ucharcat失败" - fi - - # 测试ucharcat基本功能 - LOG_INFO "测试ucharcat基本功能" - TEST_INPUT="test_input.txt" - TEST_OUTPUT="test_output.txt" - - # 创建测试输入文件 - echo "This is a test input for ucharcat." > "$TEST_INPUT" - - # 执行ucharcat命令并检查结果 - LOG_INFO "执行ucharcat命令" - if ! command -v ucharcat &>/dev/null; then - LOG_ERROR "未找到ucharcat命令,退出测试" - exit 255 - fi - - ucharcat "$TEST_INPUT" "$TEST_OUTPUT" - CHECK_RESULT $? 0 0 "ucharcat命令执行失败" - - # 检查输出文件是否存在且内容正确 - LOG_INFO "检查输出文件是否存在且内容正确" - if [ ! -f "$TEST_OUTPUT" ]; then - LOG_ERROR "输出文件未生成" - exit 1 - fi - - EXPECTED_CONTENT="This is a test input for ucharcat." - ACTUAL_CONTENT=$(cat "$TEST_OUTPUT") - if [ "$EXPECTED_CONTENT" != "$ACTUAL_CONTENT" ]; then - LOG_ERROR "输出文件内容不符合预期" - exit 1 - fi - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f "$TEST_INPUT" "$TEST_OUTPUT" - - # 如果测试前未安装,则卸载texlive-ucharcat以恢复环境状态。 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-ucharc以恢复环境状态" - dnf remove -y texlive-uchrcatt - CHECK_RESULT $? 0 0 "卸载texlve-ucahrca失败t" - fi - - LOG_INFO “ucahrca基本功能测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-ucharcat/test_texlive-ucharcat_function_basic_use.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-ucharcat/test_texlive-ucharcat_function_basic_use.sh deleted file mode 100644 index bcce408cd83..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-ucharcat/test_texlive-ucharcat_function_basic_use.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-16 -# @License : Mulan PSL v2 -# @Desc : Test basic command usage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_texlive-ucharcat_function_basic_use - - # 定义全局变量 - PACKAGE_NAME="texlive-ucharcat" - COMMAND_NAME="ucharcat" - LOG_INFO() { - echo "[INFO] $1" - } - LOG_ERROR() { - echo "[ERROR] $1" - } - # 检查软件包是否在yum源中 - check_package_in_repo() { - 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_exists() { - LOG_INFO "检查命令 $COMMAND_NAME 是否存在" - if command -v "$COMMAND_NAME" &>/dev/null; then - LOG_INFO "命令 $COMMAND_NAME 存在" - return 0 - else - LOG_ERROR "命令 $COMMAND_NAME 不存在" - return 1 - fi - } - # 检查命令参数是否支持 - check_command_param() { - LOG_INFO "检查命令 $COMMAND_NAME 是否支持参数 $1" - if "$COMMAND_NAME" "$1" --help &>/dev/null; then - LOG_INFO "命令 $COMMAND_NAME 支持参数 $1" - return 0 - else - LOG_ERROR "命令 $COMMAND_NAME 不支持参数 $1" - return 1 - fi - } - # 安装软件包 - install_package() { - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - } - # 卸载软件包 - uninstall_package() { - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - } - # 执行测试用例 - run_test() { - LOG_INFO "执行测试用例:Test basic command usage" - # 测试基本命令用法 - LOG_INFO "测试命令 $COMMAND_NAME 的基本用法" - "$COMMAND_NAME" --version - CHECK_RESULT $? 0 0 "命令 $COMMAND_NAME 执行失败" - LOG_INFO "测试命令 $COMMAND_NAME 的 --help 参数" - "$COMMAND_NAME" --help - CHECK_RESULT $? 0 0 "命令 $COMMAND_NAME 的 --help 参数执行失败" - } - # 主函数 - main() { - LOG_INFO "开始执行测试脚本" - # 检查软件包是否在yum源中 - if ! check_package_in_repo; then - exit 255 - fi - # 判断环境是否已经安装 - if check_command_exists; then - LOG_INFO "环境已经安装 $PACKAGE_NAME,保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "环境未安装 $PACKAGE_NAME,执行安装步骤" - INSTALLED_BEFORE=false - install_package - fi - # 执行测试用例 - run_test - # 环境恢复 - LOG_INFO "开始环境恢复" - if [ "$INSTALLED_BEFORE" = false ]; then - uninstall_package - else - LOG_INFO "环境已恢复至安装状态" - fi - LOG_INFO "测试脚本执行完毕" - } - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-ucharcat/test_texlive-ucharcat_function_check.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-ucharcat/test_texlive-ucharcat_function_check.sh deleted file mode 100644 index e93aa6b4fd7..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-ucharcat/test_texlive-ucharcat_function_check.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-16 -# @License : Mulan PSL v2 -# @Desc : Test checking if texlive-ucharcat is installed -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:检查texlive-ucharcat是否安装" - - # 检查是否已安装texlive-ucharcat - LOG_INFO "步骤1:检查当前是否已安装texlive-ucharcat" - if dnf list installed texlive-ucharcat &>/dev/null; then - LOG_INFO "texlive-ucharcat已安装,测试环境已满足" - installed_before_test=true - else - LOG_INFO "texlive-ucharcat未安装,将在测试中安装" - installed_before_test=false - fi - - # 检查yum源中是否有texlive-ucharcat软件包 - LOG_INFO "步骤2:检查yum源中是否有texlive-ucharcat软件包" - if ! dnf list available texlive-ucharcat &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-ucharcat软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed_before_test" = false ]; then - LOG_INFO "步骤3:安装texlive-ucharcat软件包" - dnf install -y texlive-ucharcat - CHECK_RESULT $? 0 0 "安装texlive-ucharcat失败" - fi - - # 检查安装后的状态 - LOG_INFO "步骤4:验证texlive-ucharcat是否安装成功" - dnf list installed texlive-ucharcat - CHECK_RESULT $? 0 0 "texlive-ucharcat安装后验证失败" - - # 检查texlive-ucharcat相关命令是否可用 - LOG_INFO "步骤5:检查texlive-ucharcat相关命令是否可用" - command -v ucharcat &>/dev/null - CHECK_RESULT $? 0 0 "ucharcat命令不可用" - - # 测试ucharcat命令基本功能 - LOG_INFO "步骤6:测试ucharcat命令基本功能" - echo "test" | ucharcat -h &>/dev/null - CHECK_RESULT $? 0 0 "ucharcat命令执行失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$installed_before_test" = false ]; then - LOG_INFO "步骤7:清理环境,卸载texlive-ucharcat软件包" - dnf remove -y texlive-ucharcat - CHECK_RESULT $? 0 0 "卸载texlive-ucharcat失败" - else - LOG_INFO "步骤7:测试前已安装texlive-ucharcat,保持安装状态" - fi - - LOG_INFO "测试完成:texlive-ucharcat功能检查通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-ucharcat/test_texlive-ucharcat_function_install.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-ucharcat/test_texlive-ucharcat_function_install.sh deleted file mode 100644 index 87d989fc834..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-ucharcat/test_texlive-ucharcat_function_install.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-16 -# @License : Mulan PSL v2 -# @Desc : Test installation of texlive-ucharcat package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:Test installation of texlive-ucharcat package" - - LOG_INFO "步骤1:检查当前环境是否已安装texlive-ucharcat软件包" - if rpm -q texlive-ucharcat &> /dev/null; then - LOG_INFO "texlive-ucharcat软件包已安装,测试将保持此状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "texlive-ucharcat软件包未安装" - INSTALLED_BEFORE_TEST=false - fi - - LOG_INFO "步骤2:检查yum源中是否存在texlive-ucharcat软件包" - if ! dnf list available texlive-ucharcat &> /dev/null; then - LOG_ERROR "yum源中未找到texlive-ucharcat软件包" - exit 255 - fi - - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤3:安装texlive-ucharcat软件包" - dnf install -y texlive-ucharcat - CHECK_RESULT $? 0 0 "安装texlive-ucharcat软件包失败" - fi - - LOG_INFO "步骤4:验证texlive-ucharcat软件包是否成功安装" - rpm -q texlive-ucharcat - CHECK_RESULT $? 0 0 "验证texlive-ucharcat软件包安装失败" - - LOG_INFO "步骤5:执行texlive-ucharcat相关功能测试(示例:检查ucharcat命令是否存在)" - command -v ucharcat - CHECK_RESULT $? 0 0 "ucharcat命令不存在" - - LOG_INFO "步骤6:清理测试环境" - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "卸载测试安装的texlive-ucharcat软件包" - dnf remove -y texlive-ucharcat - CHECK_RESULT $? 0 0 "卸载texlive-ucharcat软件包失败" - LOG_INFO "环境已恢复至测试前状态" - else - LOG_INFO "测试前已安装texlive-ucharcat,保持安装状态" - fi - - LOG_INFO "测试完成:Test installation of texlive-ucharcat package" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-ucharcat/test_texlive-ucharcat_function_unicode.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-ucharcat/test_texlive-ucharcat_function_unicode.sh deleted file mode 100644 index e9d108f6a70..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-ucharcat/test_texlive-ucharcat_function_unicode.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-16 -# @License : Mulan PSL v2 -# @Desc : Test unicode character handling -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - # 检查yum源中是否存在texlive-ucharcat软件包 - LOG_INFO "检查yum源中是否存在texlive-ucharcat软件包" - dnf list texlive-ucharcat &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在texlive-ucharcat软件包" - exit 255 - fi - - # 检查是否已安装texlive-ucharcat - LOG_INFO "检查是否已安装texlive-ucharcat" - if rpm -q texlive-ucharcat &>/dev/null; then - LOG_INFO "texlive-ucharcat已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "texlive-ucharcat未安装,将在测试前安装并在测试后卸载" - INSTALLED_BEFORE=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "安装texlive-ucharcat软件包" - dnf install -y texlive-ucharcat - CHECK_RESULT $? 0 0 "安装texlive-ucharcat失败" - fi - - # 测试unicode字符处理功能 - LOG_INFO "测试unicode字符处理功能" - # 假设texlive-ucharcat提供了一个名为ucharcat的命令来测试unicode处理 - # 检查ucharcat命令是否存在 - if ! command -v ucharcat &>/dev/null; then - LOG_ERROR "ucharcat命令不存在或不支持" - exit 255 - fi - - # 测试ucharcat命令的基本功能 - LOG_INFO "运行ucharcat命令测试unicode字符处理" - ucharcat --version - CHECK_RESULT $? 0 0 "ucharcat命令执行失败" - - # 测试具体的unicode字符处理 - LOG_INFO "测试具体的unicode字符处理" - echo "测试字符串: Hello 世界 🌍" | ucharcat - CHECK_RESULT $? 0 0 "unicode字符处理测试失败" - - # 清理环境 - LOG_INFO "清理测试环境" - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "卸载texlive-ucharcat软件包" - dnf remove -y texlive-ucharcat - CHECK_RESULT $? 0 0 "卸载texlive-ucharcat失败" - else - LOG_INFO "保持texlive-ucharcat安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-ucharcat/test_texlive-ucharcat_function_uninstall.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-ucharcat/test_texlive-ucharcat_function_uninstall.sh deleted file mode 100644 index 910627116f7..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-ucharcat/test_texlive-ucharcat_function_uninstall.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-16 -# @License : Mulan PSL v2 -# @Desc : Test uninstallation of texlive-ucharcat package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 设置环境变量 - PACKAGE_NAME="texlive-ucharcat" - LOG_INFO "开始测试: 卸载 ${PACKAGE_NAME} 包" - - # 检查yum源中是否存在该软件包 - LOG_INFO "步骤1: 检查yum源中是否存在 ${PACKAGE_NAME} 包" - dnf list available "${PACKAGE_NAME}" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在 ${PACKAGE_NAME} 包" - exit 255 - fi - LOG_INFO "yum源中存在 ${PACKAGE_NAME} 包" - - # 检查当前环境是否已安装该软件包 - LOG_INFO "步骤2: 检查当前环境是否已安装 ${PACKAGE_NAME} 包" - if dnf list installed "${PACKAGE_NAME}" > /dev/null 2>&1; then - LOG_INFO "当前环境已安装 ${PACKAGE_NAME} 包,标记为已安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "当前环境未安装 ${PACKAGE_NAME} 包,标记为未安装状态" - INSTALLED_BEFORE=false - fi - - # 如果未安装,则先安装软件包作为测试步骤 - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "步骤3: 安装 ${PACKAGE_NAME} 包" - dnf install -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "安装 ${PACKAGE_NAME} 包失败" - LOG_INFO "成功安装 ${PACKAGE_NAME} 包" - else - LOG_INFO "步骤3: 跳过安装步骤,因为 ${PACKAGE_NAME} 包已安装" - fi - - # 执行卸载测试 - LOG_INFO "步骤4: 卸载 ${PACKAGE_NAME} 包" - dnf remove -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "卸载 ${PACKAGE_NAME} 包失败" - LOG_INFO "成功卸载 ${PACKAGE_NAME} 包" - - # 验证卸载是否成功 - LOG_INFO "步骤5: 验证 ${PACKAGE_NAME} 包是否已卸载" - dnf list installed "${PACKAGE_NAME}" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "卸载验证失败,${PACKAGE_NAME} 包仍存在" - CHECK_RESULT 1 0 0 "卸载验证失败" - else - LOG_INFO "卸载验证成功,${PACKAGE_NAME} 包已不存在" - CHECK_RESULT 0 0 0 "卸载验证失败" - fi - - # 环境恢复:如果之前未安装,则保持卸载状态;如果之前已安装,则重新安装 - LOG_INFO "步骤6: 恢复环境到初始状态" - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "初始状态未安装 ${PACKAGE_NAME} 包,无需重新安装" - else - LOG_INFO "重新安装 ${PACKAGE_NAME} 包以恢复环境" - dnf install -y "${PACKAGE_NAME}" - CHECK_RESULT $? 0 0 "重新安装 ${PACKAGE_NAME} 包失败" - LOG_INFO "成功恢复 ${PACKAGE_NAME} 包安装状态" - fi - - LOG_INFO "测试完成: 卸载 ${PACKAGE_NAME} 包测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_cli.sh b/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_cli.sh deleted file mode 100644 index 28382d7e2a4..00000000000 --- a/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_cli.sh +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-24 -# @License : Mulan PSL v2 -# @Desc : Test js-uglify CLI basic usage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(虽然题目说不需要定义,但实际使用前需确保存在,这里提供基础实现以防未定义) - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - - # 定义检查结果函数(同样提供基础实现) - CHECK_RESULT() { - local actual=$1 - local expect=$2 - local mode=$3 - local message=$4 - if [ $mode -eq 0 ]; then - if [ $actual -ne $expect ]; then - LOG_ERROR "$message" - exit $actual - fi - else - if [ $actual -eq $expect ]; then - LOG_ERROR "$message" - exit 1 - fi - fi - LOG_INFO "$message 成功" - } - - # 定义SSH_CMD函数(提供基础实现) - SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=${4:-root} - sshpass -p "$password" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $user@$ip "$cmd" - } - - # 测试脚本开始 - LOG_INFO "开始测试:Test js-uglify CLI basic usage" - - # 步骤1:检查是否已安装js-uglify - LOG_INFO "步骤1:检查js-uglify是否已安装" - if command -v uglifyjs &> /dev/null; then - LOG_INFO "js-uglify已安装,标记为已安装状态" - INSTALLED=true - else - LOG_INFO "js-uglify未安装,标记为未安装状态" - INSTALLED=false - fi - - # 步骤2:检查yum源中是否有js-uglify软件包 - LOG_INFO "步骤2:检查yum源中是否有js-uglify软件包" - if ! dnf list available js-uglify &> /dev/null; then - LOG_ERROR "yum源中未找到js-uglify软件包" - exit 255 - fi - - # 步骤3:如果未安装,则安装js-uglify - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装js-uglify软件包" - dnf install -y js-uglify - CHECK_RESULT $? 0 0 "安装js-uglify" - fi - - # 步骤4:测试js-uglify基本用法(检查版本) - LOG_INFO "步骤4:测试js-uglify基本用法(检查版本)" - uglifyjs --version - CHECK_RESULT $? 0 0 "检查js-uglify版本" - - # 步骤5:测试js-uglify压缩JS文件 - LOG_INFO "步骤5:测试js-uglify压缩JS文件" - cat > test_input.js << "EOF" - function hello() { - console.log("Hello, World!"); - } - hello(); - EOF - uglifyjs test_input.js -o test_output.js -c - CHECK_RESULT $? 0 0 "压缩JS文件" - - # 步骤6:验证压缩后的文件是否存在且非空 - LOG_INFO "步骤6:验证压缩后的文件" - if [ -s test_output.js ]; then - LOG_INFO "压缩文件创建成功且非空" - else - LOG_ERROR "压缩文件创建失败或为空" - exit 1 - fi - - # 步骤7:清理测试文件 - LOG_INFO "步骤7:清理测试文件" - rm -f test_input.js test_output.js - CHECK_RESULT $? 0 0 "删除测试文件" - - # 步骤8:如果之前未安装,则卸载js-uglify - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤8:卸载js-uglify软件包" - dnf remove -y js-uglify - CHECK_RESULT $? 0 0 "卸载js-uglify" - else - LOG_INFO "步骤8:保持js-uglify安装状态" - fi - - LOG_INFO "测试完成:Test js-uglify CLI basic usage" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_compress.sh b/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_compress.sh deleted file mode 100644 index ad523ac584e..00000000000 --- a/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_compress.sh +++ /dev/null @@ -1,191 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-24 -# @License : Mulan PSL v2 -# @Desc : Test minification with compression -# ############################################ - -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 - } - - # 检查命令参数 - check_parameter() { - local param=$1 - local cmd=$2 - - if [ -z "$param" ]; then - LOG_ERROR "参数不存在或不支持" - exit 255 - fi - - # 检查命令是否支持该参数 - if ! $cmd --help 2>/dev/null | grep -q "$param"; then - LOG_ERROR "命令不支持参数: $param" - exit 255 - fi - } - - # 主测试函数 - test_js_uglify_function_compress() { - local package_name="uglify-js" - local is_installed=false - - LOG_INFO "开始测试:Test minification with compression" - - # 检查软件包是否已安装 - LOG_INFO "步骤1:检查软件包是否已安装" - if dnf list installed $package_name &>/dev/null; then - LOG_INFO "软件包 $package_name 已安装" - is_installed=true - else - LOG_INFO "软件包 $package_name 未安装" - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "步骤2:检查yum源中是否有软件包 $package_name" - if ! dnf search $package_name 2>/dev/null | grep -q "$package_name"; then - LOG_ERROR "yum源中没有找到软件包 $package_name" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$is_installed" = false ]; then - LOG_INFO "步骤3:安装软件包 $package_name" - dnf install -y $package_name - CHECK_RESULT $? 0 0 "安装软件包 $package_name 失败" - fi - - # 创建测试JavaScript文件 - LOG_INFO "步骤4:创建测试JavaScript文件" - cat > test_input.js << "EOF" - function add(a, b) { - // This is a comment - var result = a + b; - console.log("Result is: " + result); - return result; - } - - var x = 5; - var y = 10; - var sum = add(x, y); - EOF - - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 检查uglifyjs命令是否存在 - LOG_INFO "步骤5:检查uglifyjs命令是否存在" - if ! command -v uglifyjs &>/dev/null; then - LOG_ERROR "uglifyjs命令未找到" - exit 1 - fi - - # 测试压缩参数 - LOG_INFO "步骤6:测试压缩参数 -c" - check_parameter "-c" "uglifyjs" - - # 执行压缩测试 - LOG_INFO "步骤7:执行JavaScript压缩测试" - uglifyjs test_input.js -c -o test_output.js - CHECK_RESULT $? 0 0 "JavaScript压缩失败" - - # 验证压缩结果 - LOG_INFO "步骤8:验证压缩结果" - if [ -f test_output.js ]; then - original_size=$(stat -c%s test_input.js) - compressed_size=$(stat -c%s test_output.js) - LOG_INFO "原始文件大小: ${original_size}字节" - LOG_INFO "压缩后文件大小: ${compressed_size}字节" - - if [ $compressed_size -lt $original_size ]; then - LOG_INFO "压缩成功:文件大小减少 $((original_size - compressed_size)) 字节" - else - LOG_ERROR "压缩未减少文件大小" - exit 1 - fi - else - LOG_ERROR "压缩输出文件未生成" - exit 1 - fi - - # 验证压缩后的JavaScript是否可以执行 - LOG_INFO "步骤9:验证压缩后的JavaScript可执行性" - if command -v node &>/dev/null; then - node test_output.js >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "压缩后的JavaScript执行失败" - LOG_INFO "压缩后的JavaScript执行成功" - else - LOG_INFO "Node.js未安装,跳过执行验证" - fi - - # 测试更多压缩选项 - LOG_INFO "步骤10:测试高级压缩选项" - uglifyjs test_input.js -c sequences=true,conditionals=true,booleans=true -o test_advanced.js - CHECK_RESULT $? 0 0 "高级压缩选项测试失败" - - # 清理测试文件 - LOG_INFO "步骤11:清理测试文件" - rm -f test_input.js test_output.js test_advanced.js - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试开始时未安装,则卸载软件包 - if [ "$is_installed" = false ]; then - LOG_INFO "步骤12:卸载软件包 $package_name" - dnf remove -y $package_name - CHECK_RESULT $? 0 0 "卸载软件包 $package_name 失败" - LOG_INFO "已卸载软件包 $package_name" - else - LOG_INFO "步骤12:保持软件包安装状态" - fi - - LOG_INFO "测试完成:Test minification with compression 测试通过" - } - - # 执行测试 - test_js_uglify_function_compress - - # 环境恢复 - LOG_INFO "环境恢复完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_install.sh b/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_install.sh deleted file mode 100644 index 0c37bf70977..00000000000 --- a/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_install.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-24 -# @License : Mulan PSL v2 -# @Desc : Test installation of js-uglify package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="js-uglify" - - # 检查是否已安装 - LOG_INFO "检查系统是否已安装 $PACKAGE_NAME" - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "$PACKAGE_NAME 已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "$PACKAGE_NAME 未安装,测试结束后将卸载" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在 $PACKAGE_NAME 软件包" - dnf list available $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到 $PACKAGE_NAME 软件包" - exit 255 - fi - - # 安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "开始安装 $PACKAGE_NAME 软件包" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - LOG_INFO "$PACKAGE_NAME 安装成功" - fi - - # 验证软件包是否安装成功 - LOG_INFO "验证 $PACKAGE_NAME 是否安装成功" - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "$PACKAGE_NAME 安装验证失败" - - # 测试基本功能 - LOG_INFO "测试 $PACKAGE_NAME 基本功能" - which uglifyjs > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未找到 uglifyjs 命令" - - # 测试命令参数 - LOG_INFO "测试 uglifyjs 命令参数" - uglifyjs --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "uglifyjs --help 命令执行失败" - - # 测试无效参数 - LOG_INFO "测试 uglifyjs 无效参数" - uglifyjs --invalid-parameter > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "无效参数处理符合预期" - else - LOG_ERROR "无效参数处理不符合预期" - exit 255 - fi - - # 创建测试文件 - LOG_INFO "创建测试JavaScript文件" - TEST_FILE="/tmp/test_uglify.js" - cat > $TEST_FILE << EOF - function hello() { - console.log("Hello World!"); - var x = 1 + 2; - return x; - } - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - - # 使用uglifyjs压缩测试文件 - LOG_INFO "使用 uglifyjs 压缩JavaScript文件" - uglifyjs $TEST_FILE -o /tmp/test_uglify.min.js - CHECK_RESULT $? 0 0 "uglifyjs 压缩文件失败" - - # 验证压缩文件是否存在 - LOG_INFO "验证压缩文件是否生成" - [ -f "/tmp/test_uglify.min.js" ] - CHECK_RESULT $? 0 0 "压缩文件未生成" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f $TEST_FILE /tmp/test_uglify.min.js - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 环境恢复 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载 $PACKAGE_NAME 软件包" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败" - LOG_INFO "$PACKAGE_NAME 卸载成功" - else - LOG_INFO "保持 $PACKAGE_NAME 安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_mangle.sh b/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_mangle.sh deleted file mode 100644 index 50c69de8ef6..00000000000 --- a/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_mangle.sh +++ /dev/null @@ -1,199 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-24 -# @License : Mulan PSL v2 -# @Desc : Test minification with mangling -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 设置环境变量 - SCRIPT_NAME="test_js-uglify_function_mangle" - PACKAGE_NAME="uglify-js" - LOG_FILE="/tmp/${SCRIPT_NAME}.log" - - # 日志函数 - LOG_INFO() { - echo "[INFO] $(date "+%Y-%m-%d %H:%M:%S") $*" | tee -a "$LOG_FILE" - } - - LOG_ERROR() { - echo "[ERROR] $(date "+%Y-%m-%d %H:%M:%S") $*" | tee -a "$LOG_FILE" - } - - # 清理函数 - cleanup() { - LOG_INFO "开始清理环境" - - # 如果测试前未安装,则卸载安装的包 - if [[ "$ORIGINAL_INSTALL_STATUS" -ne 0 ]]; then - LOG_INFO "卸载测试安装的软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" > /dev/null 2>&1 - if [[ $? -ne 0 ]]; then - LOG_ERROR "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "软件包 $PACKAGE_NAME 卸载成功" - fi - fi - - # 清理临时文件 - if [[ -f "/tmp/test_input.js" ]]; then - rm -f "/tmp/test_input.js" - fi - if [[ -f "/tmp/test_output.js" ]]; then - rm -f "/tmp/test_output.js" - fi - - LOG_INFO "环境清理完成" - } - - # 信号处理 - trap cleanup EXIT INT TERM - - # 主测试函数 - main() { - LOG_INFO "开始测试: Test minification with mangling" - - # 步骤1: 检查软件包是否在yum源中 - LOG_INFO "步骤1: 检查软件包 $PACKAGE_NAME 是否在yum源中" - dnf list available "$PACKAGE_NAME" > /dev/null 2>&1 - if [[ $? -ne 0 ]]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - LOG_INFO "软件包 $PACKAGE_NAME 在yum源中可用" - - # 步骤2: 检查当前是否已安装 - LOG_INFO "步骤2: 检查 $PACKAGE_NAME 是否已安装" - rpm -q "$PACKAGE_NAME" > /dev/null 2>&1 - ORIGINAL_INSTALL_STATUS=$? - if [[ "$ORIGINAL_INSTALL_STATUS" -eq 0 ]]; then - LOG_INFO "$PACKAGE_NAME 已安装" - else - LOG_INFO "$PACKAGE_NAME 未安装,将在测试过程中安装" - fi - - # 步骤3: 安装软件包(如果未安装) - if [[ "$ORIGINAL_INSTALL_STATUS" -ne 0 ]]; then - LOG_INFO "步骤3: 安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $PACKAGE_NAME 安装成功" - fi - - # 步骤4: 检查命令参数支持 - LOG_INFO "步骤4: 检查 uglifyjs 命令的 -m 参数支持" - uglifyjs --help 2>&1 | grep -q "\-m" - if [[ $? -ne 0 ]]; then - LOG_ERROR "uglifyjs 命令不支持 -m 参数" - exit 255 - fi - LOG_INFO "uglifyjs 命令支持 -m 参数" - - # 步骤5: 创建测试文件 - LOG_INFO "步骤5: 创建测试JavaScript文件" - cat > /tmp/test_input.js << "EOF" - function calculateSum(a, b) { - var result = a + b; - return result; - } - - function calculateProduct(x, y) { - var product = x * y; - return product; - } - - var num1 = 10; - var num2 = 20; - var sum = calculateSum(num1, num2); - var product = calculateProduct(num1, num2); - console.log("Sum:", sum); - console.log("Product:", product); - EOF - CHECK_RESULT $? 0 0 "创建测试文件失败" - LOG_INFO "测试文件创建成功" - - # 步骤6: 执行代码压缩和混淆测试 - LOG_INFO "步骤6: 执行代码压缩和混淆(使用 -m 参数)" - uglifyjs /tmp/test_input.js -m -o /tmp/test_output.js 2>&1 - CHECK_RESULT $? 0 0 "执行代码压缩和混淆失败" - LOG_INFO "代码压缩和混淆执行成功" - - # 步骤7: 验证输出文件 - LOG_INFO "步骤7: 验证输出文件" - if [[ ! -f "/tmp/test_output.js" ]]; then - LOG_ERROR "输出文件未生成" - exit 1 - fi - - file_size=$(stat -c%s "/tmp/test_output.js" 2>/dev/null || stat -f%z "/tmp/test_output.js" 2>/dev/null) - if [[ "$file_size" -eq 0 ]]; then - LOG_ERROR "输出文件为空" - exit 1 - fi - - LOG_INFO "输出文件验证成功,文件大小: ${file_size}字节" - - # 步骤8: 验证混淆效果 - LOG_INFO "步骤8: 验证代码混淆效果" - original_content=$(cat /tmp/test_input.js) - minified_content=$(cat /tmp/test_output.js) - - # 检查原始函数名是否被替换 - if echo "$minified_content" | grep -q "calculateSum\|calculateProduct"; then - LOG_INFO "代码混淆验证: 部分函数名可能未被混淆" - else - LOG_INFO "代码混淆验证: 函数名已被成功混淆" - fi - - # 检查文件是否被压缩 - if [[ ${#minified_content} -lt ${#original_content} ]]; then - LOG_INFO "代码压缩验证: 文件大小从 ${#original_content} 字符减少到 ${#minified_content} 字符" - else - LOG_INFO "代码压缩验证: 文件大小未显著减少" - fi - - # 步骤9: 测试无效参数处理 - LOG_INFO "步骤9: 测试无效参数处理" - uglifyjs --invalid-param 2>&1 | grep -q "error\|invalid\|unrecognized" - CHECK_RESULT $? 0 0 "无效参数处理不符合预期" - LOG_INFO "无效参数处理正常" - - # 步骤10: 多服务器测试(如果配置了环境变量) - LOG_INFO "步骤10: 检查多服务器测试环境" - if [[ -n "$NODE2_IPV4" && -n "$NODE2_PASSWORD" && -n "$NODE2_USER" ]]; then - LOG_INFO "多服务器环境已配置,在第二台服务器上执行测试" - SSH_CMD "which uglifyjs > /dev/null 2>&1 && echo "uglifyjs available" || echo "uglifyjs not available"" "$NODE2_IPV4" "$NODE2_PASSWORD" "$NODE2_USER" - LOG_INFO "多服务器测试完成" - else - LOG_INFO "多服务器环境未配置,跳过此步骤" - fi - - LOG_INFO "测试完成: Test minification with mangling" - - # 根据原始安装状态决定是否清理 - if [[ "$ORIGINAL_INSTALL_STATUS" -eq 0 ]]; then - LOG_INFO "测试完成,保持 $PACKAGE_NAME 的安装状态" - else - LOG_INFO "测试完成,将卸载测试安装的 $PACKAGE_NAME" - fi - } - - # 执行主函数 - main "$@" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_minify.sh b/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_minify.sh deleted file mode 100644 index 3fc7f41beb1..00000000000 --- a/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_minify.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-09 -# @License : Mulan PSL v2 -# @Desc : Test minification of JS code -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装js-uglify软件包 - LOG_INFO "检查是否已安装js-uglify软件包" - dnf list installed js-uglify >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "js-uglify已安装,脚本结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "js-uglify未安装,脚本结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在js-uglify软件包 - LOG_INFO "检查yum源中是否存在js-uglify软件包" - dnf list available js-uglify >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中不存在js-uglify软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在js-uglify软件包" - exit 255 - fi - - # 安装js-uglify软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装js-uglify软件包" - dnf install -y js-uglify >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装js-uglify失败" - fi - - # 测试minification功能 - LOG_INFO "测试JS代码minification功能" - echo "function test() { console.log("Hello, world!"); }" > test.js - js-uglify test.js -o test.min.js >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "JS代码minification失败" - - # 检查生成的minified文件 - LOG_INFO "检查生成的minified文件" - [ -f test.min.js ] - CHECK_RESULT $? 0 0 "未生成minified文件" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test.js test.min.js - - # 卸载js-uglify软件包(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载js-uglify软件包" - dnf remove -y js-uglify >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载js-uglify失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_sourcemap.sh b/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_sourcemap.sh deleted file mode 100644 index a81ba18772e..00000000000 --- a/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_sourcemap.sh +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-24 -# @License : Mulan PSL v2 -# @Desc : Test minification with source map -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:Test minification with source map" - - # 定义软件包名称 - PACKAGE_NAME="nodejs-uglify-js" - LOG_INFO "检查软件包 ${PACKAGE_NAME} 是否在yum源中" - - # 检查yum源中是否存在该软件包 - if ! dnf list available ${PACKAGE_NAME} &>/dev/null; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 不在yum源中" - exit 255 - fi - - # 检查环境是否已安装 - if rpm -q ${PACKAGE_NAME} &>/dev/null; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装,将在测试中安装,并在测试结束后卸载" - INSTALLED_BEFORE_TEST=false - fi - - # 如果未安装,则安装软件包 - if [ "${INSTALLED_BEFORE_TEST}" = "false" ]; then - LOG_INFO "安装软件包 ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - fi - - # 检查 uglifyjs 命令是否支持 --source-map 参数 - LOG_INFO "检查 uglifyjs 命令是否支持 --source-map 参数" - if ! uglifyjs --help 2>&1 | grep -q "\-\-source-map"; then - LOG_ERROR "uglifyjs 命令不支持 --source-map 参数" - # 如果之前未安装,需要卸载 - if [ "${INSTALLED_BEFORE_TEST}" = "false" ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit 255 - fi - - # 创建测试文件 - LOG_INFO "创建测试JavaScript文件" - cat > test_input.js << "EOF" - function add(a, b) { - return a + b; - } - console.log(add(1, 2)); - EOF - CHECK_RESULT $? 0 0 "创建测试输入文件失败" - - # 使用 uglifyjs 进行压缩并生成 source map - LOG_INFO "使用 uglifyjs 压缩文件并生成 source map" - uglifyjs test_input.js --output test_output.min.js --source-map "url=test_output.min.js.map" --compress --mangle - CHECK_RESULT $? 0 0 "uglifyjs 压缩并生成 source map 失败" - - # 检查压缩文件是否生成 - LOG_INFO "检查压缩文件是否生成" - [ -f test_output.min.js ] - CHECK_RESULT $? 0 0 "压缩文件 test_output.min.js 未生成" - - # 检查 source map 文件是否生成 - LOG_INFO "检查 source map 文件是否生成" - [ -f test_output.min.js.map ] - CHECK_RESULT $? 0 0 "source map 文件 test_output.min.js.map 未生成" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_input.js test_output.min.js test_output.min.js.map - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则在测试结束后卸载软件包 - if [ "${INSTALLED_BEFORE_TEST}" = "false" ]; then - LOG_INFO "卸载软件包 ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - else - LOG_INFO "测试前软件包已安装,保持安装状态" - fi - - LOG_INFO "测试完成:Test minification with source map" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_uninstall.sh b/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_uninstall.sh deleted file mode 100644 index f18f2935540..00000000000 --- a/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_uninstall.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-24 -# @License : Mulan PSL v2 -# @Desc : Test uninstallation of js-uglify package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:卸载 js-uglify 软件包功能" - - LOG_INFO "步骤一:检查 yum 源中是否存在 js-uglify 软件包" - dnf list available js-uglify &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 js-uglify 软件包" - exit 255 - fi - LOG_INFO "yum 源中存在 js-uglify 软件包" - - LOG_INFO "步骤二:检查当前环境是否已安装 js-uglify" - rpm -q js-uglify &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "js-uglify 已安装,标记为需要保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "js-uglify 未安装,标记为需要安装并后续卸载" - INSTALLED_BEFORE=0 - fi - - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤三:安装 js-uglify 软件包" - dnf install -y js-uglify - CHECK_RESULT $? 0 0 "安装 js-uglify 失败" - LOG_INFO "js-uglify 安装成功" - else - LOG_INFO "步骤三:跳过安装,环境已存在 js-uglify" - fi - - LOG_INFO "步骤四:验证 js-uglify 命令基本功能" - js-uglify --help &> /dev/null - CHECK_RESULT $? 0 0 "js-uglify 命令无法执行" - - LOG_INFO "步骤五:卸载 js-uglify 软件包" - dnf remove -y js-uglify - CHECK_RESULT $? 0 0 "卸载 js-uglify 失败" - LOG_INFO "js-uglify 卸载成功" - - LOG_INFO "步骤六:验证 js-uglify 是否已卸载" - rpm -q js-uglify &> /dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "卸载后 js-uglify 仍然存在" - exit 1 - fi - LOG_INFO "验证通过,js-uglify 已成功卸载" - - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤七:清理环境,恢复为未安装状态" - LOG_INFO "环境已在步骤五卸载,无需额外操作" - else - LOG_INFO "步骤七:恢复环境,重新安装 js-uglify" - dnf install -y js-uglify - CHECK_RESULT $? 0 0 "恢复安装 js-uglify 失败" - LOG_INFO "js-uglify 重新安装成功,环境已恢复" - fi - - LOG_INFO "测试完成:卸载 js-uglify 软件包功能验证通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_version.sh b/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_version.sh deleted file mode 100644 index a29d151033c..00000000000 --- a/testcases/function_test/pkg_test/uglify-js/js-uglify/test_js-uglify_function_version.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-24 -# @License : Mulan PSL v2 -# @Desc : Test checking js-uglify version -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试用例:Test checking js-uglify version" - - LOG_INFO "步骤1:检查yum源中是否存在js-uglify软件包" - if ! dnf list available js-uglify &> /dev/null; then - LOG_ERROR "yum源中未找到js-uglify软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查js-uglify命令是否支持--version参数" - if ! js-uglify --help 2>&1 | grep -q "\-\-version"; then - LOG_ERROR "js-uglify命令不支持--version参数" - exit 255 - fi - - LOG_INFO "步骤3:检查js-uglify是否已安装" - if ! command -v js-uglify &> /dev/null; then - LOG_INFO "js-uglify未安装,开始安装" - dnf install -y js-uglify - CHECK_RESULT $? 0 0 "安装js-uglify失败" - INSTALLED_FLAG=1 - else - LOG_INFO "js-uglify已安装,跳过安装步骤" - INSTALLED_FLAG=0 - fi - - LOG_INFO "步骤4:执行js-uglify --version命令" - js-uglify --version - CHECK_RESULT $? 0 0 "执行js-uglify --version失败" - - LOG_INFO "步骤5:环境恢复" - if [ $INSTALLED_FLAG -eq 1 ]; then - LOG_INFO "卸载之前安装的js-uglify软件包" - dnf remove -y js-uglify - CHECK_RESULT $? 0 0 "卸载js-uglify失败" - else - LOG_INFO "保持js-uglify安装状态,无需卸载" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file