diff --git a/suite2cases/function_test/pkg_test/aalto-xml/aalto-xml-help.json b/suite2cases/function_test/pkg_test/aalto-xml/aalto-xml-help.json index 0fbf9b0fb97..ad680735b18 100644 --- a/suite2cases/function_test/pkg_test/aalto-xml/aalto-xml-help.json +++ b/suite2cases/function_test/pkg_test/aalto-xml/aalto-xml-help.json @@ -2,280 +2,10 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help", "machine num": 1, "cases": [ - { - "name": "test_aalto-xml-help_install", - "desc": "测试aalto-xml-help软件包的安装功能,验证安装过程是否正常完成", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_uninstall", - "desc": "测试aalto-xml-help软件包的卸载功能,验证卸载过程是否正常完成", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_upgrade", - "desc": "测试aalto-xml-help软件包的升级功能,验证升级过程是否正常完成", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_downgrade", - "desc": "测试aalto-xml-help软件包的降级功能,验证降级过程是否正常完成", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_rollback", - "desc": "测试aalto-xml-help软件包的回滚功能,验证回滚过程是否正常完成", - "machine num": 1 - }, { "name": "test_aalto-xml-help_reinstall", "desc": "测试aalto-xml-help软件包的重新安装功能,验证重新安装过程是否正常完成", "machine num": 1 - }, - { - "name": "test_aalto-xml-help_rollback_upgrade", - "desc": "测试aalto-xml-help软件包的升级回滚功能,验证升级回滚过程是否正常完成", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_start", - "desc": "测试aalto-xml-help软件包服务的启动功能,验证服务是否能正常启动", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_stop", - "desc": "测试aalto-xml-help软件包服务的停止功能,验证服务是否能正常停止", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_restart", - "desc": "测试aalto-xml-help软件包服务的重启功能,验证服务是否能正常重启", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_status", - "desc": "测试aalto-xml-help软件包服务的状态查询功能,验证服务状态是否能正常查询", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log", - "desc": "测试aalto-xml-help软件包服务的日志查看功能,验证服务日志是否能正常查看", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_config", - "desc": "测试aalto-xml-help软件包服务的配置功能,验证服务配置是否能正常修改和生效", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_reload", - "desc": "测试aalto-xml-help软件包服务的重载功能,验证服务配置重载是否能正常生效", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_downgrade_rollback", - "desc": "测试aalto-xml-help软件包的降级回滚功能,验证降级回滚过程是否正常完成", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_enable", - "desc": "测试aalto-xml-help软件包服务的开机自启功能,验证服务是否能正常设置为开机自启", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_disable", - "desc": "测试aalto-xml-help软件包服务的开机自启禁用功能,验证服务是否能正常禁用开机自启", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_rotate", - "desc": "测试aalto-xml-help软件包服务的日志轮转功能,验证服务日志轮转是否能正常执行", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_config_reload", - "desc": "测试aalto-xml-help软件包服务的配置重载功能,验证服务配置修改后是否能通过重载命令正常生效", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_failover", - "desc": "测试aalto-xml-help软件包服务的故障转移功能,验证服务在异常情况下是否能正常进行故障转移", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_level", - "desc": "测试aalto-xml-help软件包服务的日志级别功能,验证服务日志级别是否能正常设置和生效", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_size", - "desc": "测试aalto-xml-help软件包服务的日志大小功能,验证服务日志大小是否能正常设置和生效", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_health_check", - "desc": "测试aalto-xml-help软件包服务的健康检查功能,验证服务健康状态是否能正常检查", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_retention", - "desc": "测试aalto-xml-help软件包服务的日志保留功能,验证服务日志保留策略是否能正常设置和生效", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_format", - "desc": "测试aalto-xml-help软件包服务的日志格式功能,验证服务日志格式是否能正常设置和生效", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_compression", - "desc": "测试aalto-xml-help软件包服务的日志压缩功能,验证服务日志压缩是否能正常设置和生效", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_filter", - "desc": "测试aalto-xml-help软件包服务的日志过滤功能,验证服务日志是否能按指定条件正常过滤", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_archive", - "desc": "测试aalto-xml-help软件包服务的日志归档功能,验证服务日志归档是否能正常执行", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_clean", - "desc": "测试aalto-xml-help软件包服务的日志清理功能,验证服务日志是否能正常清理", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_backup", - "desc": "测试aalto-xml-help软件包服务的备份功能,验证服务数据是否能正常备份", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_export", - "desc": "测试aalto-xml-help软件包服务的日志导出功能,验证服务日志是否能正常导出", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_level_set", - "desc": "测试aalto-xml-help软件包服务的日志级别设置功能,验证服务日志级别是否能正常设置和生效", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_import", - "desc": "测试aalto-xml-help软件包服务的日志导入功能,验证服务日志是否能正常导入", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_rotate_config", - "desc": "测试aalto-xml-help软件包服务的日志轮转配置功能,验证服务日志轮转配置是否能正常设置和生效", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_level_get", - "desc": "测试aalto-xml-help软件包服务的日志级别获取功能,验证服务日志级别是否能正常查询", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_export_format", - "desc": "测试aalto-xml-help软件包服务的日志导出格式功能,验证服务日志是否能按指定格式正常导出", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_level_verify", - "desc": "测试aalto-xml-help软件包服务的日志级别验证功能,验证服务日志级别设置后是否能正常生效", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_export_compression", - "desc": "测试aalto-xml-help软件包服务的日志导出压缩功能,验证服务日志是否能按指定压缩格式正常导出", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_level_set_verify", - "desc": "测试aalto-xml-help软件包服务的日志级别设置验证功能,验证服务日志级别设置后是否能正常生效", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_level_set_get", - "desc": "测试aalto-xml-help软件包服务的日志级别设置和获取功能,验证服务日志级别设置后是否能正常获取", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_export_path", - "desc": "测试aalto-xml-help软件包服务的日志导出路径功能,验证服务日志是否能按指定路径正常导出", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_level_switch", - "desc": "测试aalto-xml-help软件包服务的日志级别切换功能,验证服务日志级别是否能正常切换和生效", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_level_default", - "desc": "测试aalto-xml-help软件包服务的默认日志级别功能,验证服务默认日志级别是否符合预期", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_level_range", - "desc": "测试aalto-xml-help软件包服务的日志级别范围功能,验证服务日志级别设置是否在有效范围内", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_export_size", - "desc": "测试aalto-xml-help软件包服务的日志导出大小功能,验证服务日志是否能按指定大小正常导出", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_export_permission", - "desc": "测试aalto-xml-help软件包服务的日志导出权限功能,验证服务日志是否能按指定权限正常导出", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_level_dynamic", - "desc": "测试aalto-xml-help软件包服务的动态日志级别功能,验证服务日志级别是否能动态调整和生效", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_export_retention", - "desc": "测试aalto-xml-help软件包服务的日志导出保留功能,验证服务日志是否能按指定保留策略正常导出", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_export_encryption", - "desc": "测试aalto-xml-help软件包服务的日志导出加密功能,验证服务日志是否能按指定加密方式正常导出", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_level_verify_range", - "desc": "测试aalto-xml-help软件包服务的日志级别范围验证功能,验证服务日志级别设置后是否在有效范围内正常生效", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_service_log_export_filter", - "desc": "测试aalto-xml-help软件包服务的日志导出过滤功能,验证服务日志是否能按指定条件过滤后正常导出", - "machine num": 1 - }, - { - "name": "test_aalto-xml-help_function_parse", - "desc": "测试aalto-xml-help软件包的XML解析功能,验证是否能正常解析XML文件" - }, - { - "name": "test_aalto-xml-help_function_install", - "desc": "测试aalto-xml-help软件包的安装功能,验证是否能通过包管理器正常安装" - }, - { - "name": "test_aalto-xml-help_function_uninstall", - "desc": "测试aalto-xml-help软件包的卸载功能,验证是否能通过包管理器正常卸载" - }, - { - "name": "test_aalto-xml-help_function_validate", - "desc": "测试aalto-xml-help软件包的XML验证功能,验证是否能正确验证XML的有效性" - }, - { - "name": "test_aalto-xml-help_function_version", - "desc": "测试aalto-xml-help软件包的版本查询功能,验证是否能正确查询软件包版本信息" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/ant/ant-javamail.json b/suite2cases/function_test/pkg_test/ant/ant-javamail.json index da58acf95f9..a13f91a8d05 100644 --- a/suite2cases/function_test/pkg_test/ant/ant-javamail.json +++ b/suite2cases/function_test/pkg_test/ant/ant-javamail.json @@ -7,33 +7,9 @@ "desc": "测试ant-javamail软件包的安装功能", "machine num": 1 }, - { - "name": "test_ant-javamail_function_send", - "desc": "测试ant-javamail软件包的邮件发送功能" - }, - { - "name": "test_ant-javamail_function_install", - "desc": "测试ant-javamail软件包的安装功能" - }, - { - "name": "test_ant-javamail_function_uninstall", - "desc": "测试ant-javamail软件包的卸载功能" - }, - { - "name": "test_ant-javamail_function_mail_send", - "desc": "测试ant-javamail软件包的邮件发送功能" - }, - { - "name": "test_ant-javamail_function_mail_receive", - "desc": "测试ant-javamail软件包的邮件接收功能" - }, { "name": "test_ant-javamail_function_config", "desc": "测试ant-javamail软件包的配置功能" - }, - { - "name": "test_ant-javamail_function_error_handle", - "desc": "测试ant-javamail软件包的错误处理功能" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/apache-commons-collections4/apache-commons-collections4-javadoc.json b/suite2cases/function_test/pkg_test/apache-commons-collections4/apache-commons-collections4-javadoc.json index 7e3869cb62e..0b195eafb77 100644 --- a/suite2cases/function_test/pkg_test/apache-commons-collections4/apache-commons-collections4-javadoc.json +++ b/suite2cases/function_test/pkg_test/apache-commons-collections4/apache-commons-collections4-javadoc.json @@ -6,10 +6,6 @@ "name": "test_apache-commons-collections4-javadoc_install", "desc": "测试软件包的安装功能,验证是否能够正确安装到系统中", "machine num": 1 - }, - { - "name": "test_apache-commons-collections4-javadoc_function_docgen", - "desc": "测试软件包的文档生成功能,验证是否能够正确生成API文档" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/apache-mina/apache-mina-mina-statemachine.json b/suite2cases/function_test/pkg_test/apache-mina/apache-mina-mina-statemachine.json index c781887bb8f..5d7d200f843 100644 --- a/suite2cases/function_test/pkg_test/apache-mina/apache-mina-mina-statemachine.json +++ b/suite2cases/function_test/pkg_test/apache-mina/apache-mina-mina-statemachine.json @@ -6,42 +6,6 @@ "name": "test_apache-mina-mina-statemachine_install", "desc": "测试软件包的安装功能,验证安装是否成功。", "machine num": 1 - }, - { - "name": "test_apache-mina-mina-statemachine_function_state", - "desc": "测试状态机的基本状态转换功能。" - }, - { - "name": "test_apache-mina-mina-statemachine_uninstall", - "desc": "测试软件包的卸载功能,验证卸载是否成功。" - }, - { - "name": "test_apache-mina-mina-statemachine_function_event", - "desc": "测试状态机的事件触发与处理。" - }, - { - "name": "test_apache-mina-mina-statemachine_function_transition", - "desc": "测试状态机转换的配置与执行。" - }, - { - "name": "test_apache-mina-mina-statemachine_function_guard", - "desc": "测试状态机转换中的守卫条件。" - }, - { - "name": "test_apache-mina-mina-statemachine_function_action", - "desc": "测试状态机转换时执行的动作。" - }, - { - "name": "test_apache-mina-mina-statemachine_function_nested", - "desc": "测试嵌套状态机的功能。" - }, - { - "name": "test_apache-mina-mina-statemachine_function_listener", - "desc": "测试状态机状态变化监听器。" - }, - { - "name": "test_apache-mina-mina-statemachine_function_integration", - "desc": "测试状态机与Mina框架的集成使用。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/artemis/artemis-pom.json b/suite2cases/function_test/pkg_test/artemis/artemis-pom.json deleted file mode 100644 index 270fa327565..00000000000 --- a/suite2cases/function_test/pkg_test/artemis/artemis-pom.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/artemis/artemis-pom", - "machine num": 1, - "cases": [ - { - "name": "test_artemis-pom_function_dep", - "desc": "Test basic dependency resolution" - }, - { - "name": "test_artemis-pom_function_build", - "desc": "Test build process" - }, - { - "name": "test_artemis-pom_function_conf", - "desc": "Test configuration loading" - }, - { - "name": "test_artemis-pom_function_plugin", - "desc": "Test plugin integration" - }, - { - "name": "test_artemis-pom_function_install", - "desc": "Test installation of the artemis-pom package" - }, - { - "name": "test_artemis-pom_function_uninstall", - "desc": "Test uninstallation of the artemis-pom package" - }, - { - "name": "test_artemis-pom_function_version", - "desc": "Test displaying package version" - }, - { - "name": "test_artemis-pom_function_help", - "desc": "Test displaying help information" - }, - { - "name": "test_artemis-pom_function_list", - "desc": "Test listing available commands or features" - }, - { - "name": "test_artemis-pom_function_update", - "desc": "Test updating the package to the latest version" - }, - { - "name": "test_artemis-pom_function_clean", - "desc": "Test cleaning build artifacts or cache" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/bcc/bcc-lua.json b/suite2cases/function_test/pkg_test/bcc/bcc-lua.json index 9df6216e96c..28336fcdcaf 100644 --- a/suite2cases/function_test/pkg_test/bcc/bcc-lua.json +++ b/suite2cases/function_test/pkg_test/bcc/bcc-lua.json @@ -5,30 +5,6 @@ { "name": "test_bcc-lua_bcc-lua__version", "desc": "测试 bcc-lua 命令的 --version 参数" - }, - { - "name": "test_bcc-lua_bcc-lua__verbose", - "desc": "测试 bcc-lua 命令的 --verbose 参数" - }, - { - "name": "test_bcc-lua_bcc-lua_path_to_script_lua", - "desc": "测试 bcc-lua 命令的 path_to_script.lua 参数" - }, - { - "name": "test_bcc-lua_function_load", - "desc": "测试 bcc-lua 的脚本加载功能" - }, - { - "name": "test_bcc-lua_bcc-lua__upper_version", - "desc": "测试 bcc-lua 命令的 --version 参数" - }, - { - "name": "test_bcc-lua_bcc-lua__upper_verbose", - "desc": "测试 bcc-lua 命令的 --verbose 参数" - }, - { - "name": "test_bcc-lua_function_script_exec", - "desc": "测试 bcc-lua 脚本执行功能" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/gawk/gawk-lang.json b/suite2cases/function_test/pkg_test/gawk/gawk-lang.json index 06f3b0cfa88..937622aeabb 100644 --- a/suite2cases/function_test/pkg_test/gawk/gawk-lang.json +++ b/suite2cases/function_test/pkg_test/gawk/gawk-lang.json @@ -2,15 +2,6 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/gawk/gawk-lang", "machine num": 1, "cases": [ - { - "name": "test_gawk-lang_install", - "desc": "测试gawk-lang软件包的安装功能,验证安装过程是否正常完成", - "machine num": 1 - }, - { - "name": "test_gawk-lang_awk_-f", - "desc": "使用 -f 参数指定程序文件" - }, { "name": "test_gawk-lang_awk_-up_f", "desc": "使用 -F 参数指定字段分隔符" @@ -19,10 +10,6 @@ "name": "test_gawk-lang_awk_-v", "desc": "使用 -v 参数定义变量并赋值" }, - { - "name": "test_gawk-lang_awk_--file", - "desc": "使用 --file 参数指定程序文件(GNU长选项)" - }, { "name": "test_gawk-lang_awk_--field-separator", "desc": "使用 --field-separator 参数指定字段分隔符(GNU长选项)" @@ -55,14 +42,6 @@ "name": "test_gawk-lang_awk_--copyright", "desc": "使用 --copyright 参数显示版权信息(GNU长选项)" }, - { - "name": "test_gawk-lang_awk_-d", - "desc": "使用 -d 参数导出变量到文件" - }, - { - "name": "test_gawk-lang_gawk_-f", - "desc": "使用 -f 参数指定程序文件执行 gawk 命令" - }, { "name": "test_gawk-lang_gawk_-up_f", "desc": "使用 -F 参数指定字段分隔符执行 gawk 命令" @@ -103,34 +82,6 @@ "name": "test_gawk-lang_function_uninstall", "desc": "测试gawk-lang软件包的卸载功能,验证卸载过程是否正常完成" }, - { - "name": "test_gawk-lang_function_install", - "desc": "测试gawk-lang软件包的安装功能" - }, - { - "name": "test_gawk-lang_function_basic_usage", - "desc": "测试gawk基本文本处理功能" - }, - { - "name": "test_gawk-lang_function_pattern_action", - "desc": "测试gawk模式与动作执行" - }, - { - "name": "test_gawk-lang_function_builtin_vars", - "desc": "测试gawk内置变量(如NR,NF)" - }, - { - "name": "test_gawk-lang_function_field_split", - "desc": "测试gawk字段分割与处理" - }, - { - "name": "test_gawk-lang_function_redirection", - "desc": "测试gawk输出重定向功能" - }, - { - "name": "test_gawk-lang_function_script_file", - "desc": "测试通过脚本文件执行gawk" - }, { "name": "test_gawk-lang_function_version_check", "desc": "检查gawk版本信息" diff --git a/suite2cases/function_test/pkg_test/llvm/clang.json b/suite2cases/function_test/pkg_test/llvm/clang.json index 9a504125946..ce6f937f3ae 100644 --- a/suite2cases/function_test/pkg_test/llvm/clang.json +++ b/suite2cases/function_test/pkg_test/llvm/clang.json @@ -30,326 +30,10 @@ "name": "test_clang_help", "desc": "显示clang命令的帮助信息" }, - { - "name": "test_clang_std_c11", - "desc": "使用C11标准编译源文件" - }, - { - "name": "test_clang_std_cpp17", - "desc": "使用C++17标准编译源文件" - }, - { - "name": "test_clang_c", - "desc": "仅执行预处理、编译和汇编步骤,生成目标文件" - }, - { - "name": "test_clang_o_output", - "desc": "指定输出文件名" - }, - { - "name": "test_clang_upper_e", - "desc": "仅运行预处理器" - }, - { - "name": "test_clang_upper_s", - "desc": "仅运行预处理和编译步骤,生成汇编文件" - }, - { - "name": "test_clang_g", - "desc": "生成源代码级调试信息" - }, - { - "name": "test_clang_O2", - "desc": "启用优化级别2" - }, - { - "name": "test_clang_Wall", - "desc": "启用所有警告" - }, - { - "name": "test_clang_Werror", - "desc": "将所有警告视为错误" - }, - { - "name": "test_clang_Dmacro", - "desc": "定义宏" - }, - { - "name": "test_clang_Imacro", - "desc": "取消宏定义" - }, - { - "name": "test_clang_upper_i_include", - "desc": "添加目录到头文件搜索路径" - }, - { - "name": "test_clang_upper_l_lib", - "desc": "添加目录到库搜索路径" - }, - { - "name": "test_clang_lm", - "desc": "链接数学库" - }, - { - "name": "test_clang_pthread", - "desc": "在生成的代码中支持POSIX线程" - }, - { - "name": "test_clang_shared", - "desc": "生成共享库" - }, - { - "name": "test_clang_static", - "desc": "生成静态可执行文件" - }, - { - "name": "test_clang_MD", - "desc": "写入包含用户和系统头文件的依赖文件" - }, - { - "name": "test_clang_MMD", - "desc": "写入仅包含用户头文件的依赖文件" - }, - { - "name": "test_clang_MF_file", - "desc": "将依赖文件输出写入指定文件" - }, - { - "name": "test_clang_MT_target", - "desc": "指定依赖文件中的主文件输出名称" - }, - { - "name": "test_clang_MP", - "desc": "为每个依赖项创建虚假目标" - }, - { - "name": "test_clang_pedantic", - "desc": "对语言扩展发出警告" - }, { "name": "test_clang_Weverything", "desc": "启用所有警告(包括默认关闭的警告)" }, - { - "name": "test_clang_fsyntax_only", - "desc": "仅运行预处理器、解析器和语义分析阶段" - }, - { - "name": "test_clang_fcolor_diagnostics", - "desc": "在诊断信息中启用颜色" - }, - { - "name": "test_clang_fno_color_diagnostics", - "desc": "在诊断信息中禁用颜色" - }, - { - "name": "test_clang_fno_omit_frame_pointer", - "desc": "不省略函数中的帧指针" - }, - { - "name": "test_clang_fstack_protector", - "desc": "为某些易受堆栈破坏的函数启用堆栈保护" - }, - { - "name": "test_clang_fstack_protector_all", - "desc": "为所有函数启用堆栈保护" - }, - { - "name": "test_clang_fsanitize_address", - "desc": "启用地址消毒剂" - }, - { - "name": "test_clang_fsanitize_undefined", - "desc": "启用未定义行为消毒剂" - }, - { - "name": "test_clang_fsanitize_thread", - "desc": "启用线程消毒剂" - }, - { - "name": "test_clang_fsanitize_memory", - "desc": "启用内存消毒剂" - }, - { - "name": "test_clang_fprofile_instr_generate", - "desc": "生成检测代码以收集执行计数" - }, - { - "name": "test_clang_fprofile_instr_use", - "desc": "使用检测数据进行配置文件引导的优化" - }, - { - "name": "test_clang_fcoverage_mapping", - "desc": "生成覆盖率映射以启用代码覆盖率分析" - }, - { - "name": "test_clang_ftime_trace", - "desc": "打开时间分析器,生成JSON文件" - }, - { - "name": "test_clang_fsave_temps", - "desc": "保存中间编译结果" - }, - { - "name": "test_clang_fvectorize", - "desc": "启用循环向量化通道" - }, - { - "name": "test_clang_fslp_vectorize", - "desc": "启用超字级并行向量化通道" - }, - { - "name": "test_clang_funroll_loops", - "desc": "打开循环展开器" - }, - { - "name": "test_clang_fno_unroll_loops", - "desc": "关闭循环展开器" - }, - { - "name": "test_clang_ffast_math", - "desc": "允许激进的、有损的浮点优化" - }, - { - "name": "test_clang_fno_fast_math", - "desc": "禁用激进的浮点优化" - }, - { - "name": "test_clang_fstrict_aliasing", - "desc": "启用基于严格别名规则的优化" - }, - { - "name": "test_clang_fno_strict_aliasing", - "desc": "禁用严格别名优化" - }, - { - "name": "test_clang_fexceptions", - "desc": "启用异常处理支持" - }, - { - "name": "test_clang_fno_exceptions", - "desc": "禁用异常处理支持" - }, - { - "name": "test_clang_frtti", - "desc": "启用RTTI信息生成" - }, - { - "name": "test_clang_fno_rtti", - "desc": "禁用RTTI信息生成" - }, - { - "name": "test_clang_fpic", - "desc": "生成位置无关代码" - }, - { - "name": "test_clang_fpie", - "desc": "生成位置无关可执行文件" - }, - { - "name": "test_clang_march_native", - "desc": "为目标主机生成优化的代码" - }, - { - "name": "test_clang_mtune_native", - "desc": "为目标主机调整代码性能" - }, - { - "name": "test_clang_mavx2", - "desc": "启用AVX2指令集" - }, - { - "name": "test_clang_mssse3", - "desc": "启用SSSE3指令集" - }, - { - "name": "test_clang_m64", - "desc": "为64位目标编译" - }, - { - "name": "test_clang_m32", - "desc": "为32位目标编译" - }, - { - "name": "test_clang_mx32", - "desc": "为x32 ABI编译" - }, - { - "name": "test_clang_msoft_float", - "desc": "使用软件浮点" - }, - { - "name": "test_clang_mfloat_abi_hard", - "desc": "使用硬件浮点ABI" - }, - { - "name": "test_clang_mfloat_abi_softfp", - "desc": "使用软件浮点ABI" - }, - { - "name": "test_clang_mcpu_native", - "desc": "为目标主机CPU生成优化的代码" - }, - { - "name": "test_clang_target_aarch64_linux_gnu", - "desc": "为aarch64-linux-gnu目标生成代码" - }, - { - "name": "test_clang_target_x86_64_windows_msvc", - "desc": "为x86_64-windows-msvc目标生成代码" - }, - { - "name": "test_clang_Xclang_arg", - "desc": "将参数传递给clang -cc1" - }, - { - "name": "test_clang_Wl_arg", - "desc": "将逗号分隔的参数传递给链接器" - }, - { - "name": "test_clang_Wa_arg", - "desc": "将逗号分隔的参数传递给汇编器" - }, - { - "name": "test_clang_Wp_arg", - "desc": "将逗号分隔的参数传递给预处理器" - }, - { - "name": "test_clang_Xlinker_arg", - "desc": "将参数传递给链接器" - }, - { - "name": "test_clang_Xassembler_arg", - "desc": "将参数传递给汇编器" - }, - { - "name": "test_clang_Xpreprocessor_arg", - "desc": "将参数传递给预处理器" - }, - { - "name": "test_clang_stdlib_libcxx", - "desc": "使用libc++作为C++标准库" - }, - { - "name": "test_clang_stdlib_libstdcxx", - "desc": "使用libstdc++作为C++标准库" - }, - { - "name": "test_clang_rtlib_compiler_rt", - "desc": "使用编译器运行时库" - }, - { - "name": "test_clang_rtlib_libgcc", - "desc": "使用libgcc作为编译器运行时库" - }, - { - "name": "test_clang_unwindlib_libunwind", - "desc": "使用libunwind作为展开库" - }, - { - "name": "test_clang_unwindlib_libgcc", - "desc": "使用libgcc作为展开库" - }, { "name": "test_clang_print_file_name_libgcc_a", "desc": "打印当前使用的编译器运行时库的完整库路径" @@ -357,502 +41,6 @@ { "name": "test_clang_print_resource_dir", "desc": "打印资源目录路径名" - }, - { - "name": "test_clang_print_search_dirs", - "desc": "打印用于查找库和程序的路径" - }, - { - "name": "test_clang_print_target_triple", - "desc": "打印规范化目标三元组" - }, - { - "name": "test_clang_print_targets", - "desc": "打印已注册的目标" - }, - { - "name": "test_clang_emit_llvm", - "desc": "使用LLVM表示法生成汇编和目标文件" - }, - { - "name": "test_clang_flto", - "desc": "启用完整模式的LTO" - }, - { - "name": "test_clang_flto_thin", - "desc": "启用瘦模式的LTO" - }, - { - "name": "test_clang_fno_lto", - "desc": "禁用LTO模式" - }, - { - "name": "test_clang_fuse_ld_lld", - "desc": "使用lld作为链接器" - }, - { - "name": "test_clang_fuse_ld_bfd", - "desc": "使用GNU ld作为链接器" - }, - { - "name": "test_clang_fuse_ld_gold", - "desc": "使用GNU gold作为链接器" - }, - { - "name": "test_clang_fuse_ld_mold", - "desc": "使用mold作为链接器" - }, - { - "name": "test_clang_nostdinc", - "desc": "不搜索标准系统包含目录" - }, - { - "name": "test_clang_nostdlibinc", - "desc": "不搜索标准系统库包含目录" - }, - { - "name": "test_clang_nodefaultlibs", - "desc": "不链接默认的库" - }, - { - "name": "test_clang_nostdlib", - "desc": "不链接标准库和启动文件" - }, - { - "name": "test_clang_pg", - "desc": "启用mcount插桩" - }, - { - "name": "test_clang_p", - "desc": "使用prof启用mcount插桩" - }, - { - "name": "test_clang_pipe", - "desc": "尽可能在命令之间使用管道" - }, - { - "name": "test_clang_time", - "desc": "计时单个命令" - }, - { - "name": "test_clang_clang-17_c", - "desc": "仅运行预处理、编译和汇编步骤,不进行链接" - }, - { - "name": "test_clang_clang-17_upper_e", - "desc": "仅运行预处理器" - }, - { - "name": "test_clang_clang-17_upper_s", - "desc": "仅运行预处理和编译步骤" - }, - { - "name": "test_clang_clang-17_o_output", - "desc": "将输出写入指定文件" - }, - { - "name": "test_clang_clang-17_g", - "desc": "生成源代码级别的调试信息" - }, - { - "name": "test_clang_clang-17_upper_o_num_1", - "desc": "启用优化级别1" - }, - { - "name": "test_clang_clang-17_Wall", - "desc": "启用所有警告" - }, - { - "name": "test_clang_clang-17_Werror", - "desc": "将所有警告视为错误" - }, - { - "name": "test_clang_clang-17_std_c11", - "desc": "编译C代码,使用C11语言标准" - }, - { - "name": "test_clang_clang-17_std_cpp17", - "desc": "编译C++代码,使用C++17语言标准" - }, - { - "name": "test_clang_clang-17_upper_i_include_dir", - "desc": "添加目录到包含文件搜索路径的末尾" - }, - { - "name": "test_clang_clang-17_upper_d_macro", - "desc": "定义宏,值为1" - }, - { - "name": "test_clang_clang-17_upper_d_macro_value", - "desc": "定义宏并指定其值" - }, - { - "name": "test_clang_clang-17_upper_u_macro", - "desc": "取消定义宏" - }, - { - "name": "test_clang_clang-17_pedantic", - "desc": "对语言扩展发出警告" - }, - { - "name": "test_clang_clang-17_w", - "desc": "抑制所有警告" - }, - { - "name": "test_clang_clang-17_v", - "desc": "显示要运行的命令并使用详细输出" - }, - { - "name": "test_clang_clang-17_pthread", - "desc": "在生成的代码中支持POSIX线程" - }, - { - "name": "test_clang_clang-17_shared", - "desc": "生成共享对象(动态库)" - }, - { - "name": "test_clang_clang-17_static", - "desc": "生成静态可执行文件" - }, - { - "name": "test_clang_clang-17_MD", - "desc": "写入包含用户和系统头文件的依赖文件" - }, - { - "name": "test_clang_clang-17_MMD", - "desc": "写入仅包含用户头文件的依赖文件" - }, - { - "name": "test_clang_clang-17_MF_file", - "desc": "将-MD、-MMD、-MM或-M的依赖文件输出写入指定文件" - }, - { - "name": "test_clang_clang-17_MT_target", - "desc": "在依赖文件中指定主文件输出的名称" - }, - { - "name": "test_clang_clang-17_MP", - "desc": "为除主文件外的每个依赖项创建伪目标" - }, - { - "name": "test_clang_clang-17_x_c", - "desc": "将后续输入文件视为C语言类型" - }, - { - "name": "test_clang_clang-17_x_cpp", - "desc": "将后续输入文件视为C++语言类型" - }, - { - "name": "test_clang_clang-17_x_objective_c", - "desc": "将后续输入文件视为Objective-C语言类型" - }, - { - "name": "test_clang_clang-17_x_none", - "desc": "关闭任何指定的语言类型" - }, - { - "name": "test_clang_clang-17_target_aarch64_linux_gnu", - "desc": "为aarch64-linux-gnu目标生成代码" - }, - { - "name": "test_clang_clang-17_march_x86_64", - "desc": "为目标指定x86_64架构" - }, - { - "name": "test_clang_clang-17_mcpu_skylake", - "desc": "为目标指定Skylake CPU" - }, - { - "name": "test_clang_clang-17_mtune_generic", - "desc": "为目标指定通用调优" - }, - { - "name": "test_clang_clang-17_fPIC", - "desc": "生成位置无关代码(用于共享库)" - }, - { - "name": "test_clang_clang-17_fPIE", - "desc": "生成位置无关可执行文件" - }, - { - "name": "test_clang_clang-17_fomit_frame_pointer", - "desc": "从不需要帧指针的函数中省略帧指针" - }, - { - "name": "test_clang_clang-17_fno_omit_frame_pointer", - "desc": "保留所有函数的帧指针" - }, - { - "name": "test_clang_clang-17_fstack_protector", - "desc": "为某些易受堆栈粉碎攻击的函数启用堆栈保护器" - }, - { - "name": "test_clang_clang-17_fstack_protector_all", - "desc": "为所有函数启用堆栈保护器" - }, - { - "name": "test_clang_clang-17_fsanitize_address", - "desc": "启用AddressSanitizer内存错误检测器" - }, - { - "name": "test_clang_clang-17_fsanitize_undefined", - "desc": "启用UndefinedBehaviorSanitizer未定义行为检测器" - }, - { - "name": "test_clang_clang-17_fsanitize_thread", - "desc": "启用ThreadSanitizer数据竞争检测器" - }, - { - "name": "test_clang_clang-17_fprofile_instr_generate", - "desc": "生成插桩代码以收集执行计数到默认的profraw文件" - }, - { - "name": "test_clang_clang-17_fprofile_instr_use_profdata", - "desc": "使用插桩数据进行配置文件引导的优化" - }, - { - "name": "test_clang_clang-17_fcoverage_mapping", - "desc": "生成覆盖率映射以启用代码覆盖率分析" - }, - { - "name": "test_clang_clang-17_flto", - "desc": "启用完整模式的链接时优化" - }, - { - "name": "test_clang_clang-17_flto_thin", - "desc": "启用精简模式的链接时优化" - }, - { - "name": "test_clang_clang-17_fvectorize", - "desc": "启用循环向量化过程" - }, - { - "name": "test_clang_clang-17_funroll_loops", - "desc": "启用循环展开器" - }, - { - "name": "test_clang_clang-17_ffast_math", - "desc": "允许激进、有损的浮点优化" - }, - { - "name": "test_clang_clang-17_fexceptions", - "desc": "启用异常处理支持" - }, - { - "name": "test_clang_clang-17_frtti", - "desc": "启用RTTI信息生成" - }, - { - "name": "test_clang_clang-17_fno_rtti", - "desc": "禁用RTTI信息生成" - }, - { - "name": "test_clang_clang-17_fblocks", - "desc": "启用“块”语言特性" - }, - { - "name": "test_clang_clang-17_fobjc_arc", - "desc": "为Objective-C指针合成retain和release调用" - }, - { - "name": "test_clang_clang-17_fmodules", - "desc": "启用“模块”语言特性" - }, - { - "name": "test_clang_clang-17_fopenmp", - "desc": "解析OpenMP编译指示并生成并行代码" - }, - { - "name": "test_clang_clang-17_fopenmp_targets_nvptx64", - "desc": "指定NVPTX64作为OpenMP卸载目标" - }, - { - "name": "test_clang_clang-17_fsycl", - "desc": "为设备启用SYCL内核编译" - }, - { - "name": "test_clang_clang-17_fcuda_rdc", - "desc": "为CUDA生成可重定位设备代码(单独编译模式)" - }, - { - "name": "test_clang_clang-17_print_target_triple", - "desc": "打印规范化的目标三元组" - }, - { - "name": "test_clang_clang-17_print_file_name_libgcc_a", - "desc": "打印当前使用的编译器运行时库的完整库路径" - }, - { - "name": "test_clang_clang-17_print_search_dirs", - "desc": "打印用于查找库和程序的路径" - }, - { - "name": "test_clang_clang-17_help", - "desc": "显示可用选项" - }, - { - "name": "test_clang_clang-17_version", - "desc": "打印版本信息" - }, - { - "name": "test_clang_clang-cl__help", - "desc": "测试 clang-cl 命令的 --help 参数" - }, - { - "name": "test_clang_clang-cl__upper_help", - "desc": "测试 clang-cl 命令的 -help 参数" - }, - { - "name": "test_clang_clang-cl__upper_Wunknown_argument", - "desc": "测试 clang-cl 命令的 -Wunknown-argument 参数" - }, - { - "name": "test_clang_clang-cpp_upper_e", - "desc": "仅运行预处理器,生成预处理后的源代码" - }, - { - "name": "test_clang_clang-cpp_c", - "desc": "仅运行预处理、编译和汇编步骤,生成目标文件" - }, - { - "name": "test_clang_clang-cpp_upper_s", - "desc": "仅运行预处理和编译步骤,生成汇编代码" - }, - { - "name": "test_clang_clang-cpp_upper_c", - "desc": "在预处理输出中包含注释" - }, - { - "name": "test_clang_clang-cpp_upper_CC", - "desc": "在预处理输出中包含宏内的注释" - }, - { - "name": "test_clang_clang-cpp_dM", - "desc": "在-E模式下打印宏定义,而不是正常输出" - }, - { - "name": "test_clang_clang-cpp_dD", - "desc": "在-E模式下打印宏定义,同时包含正常输出" - }, - { - "name": "test_clang_clang-cpp_dI", - "desc": "在-E模式下打印包含指令" - }, - { - "name": "test_clang_clang-cpp_minimize_whitespace", - "desc": "在预处理输出中最小化空格,与-P选项一起使用以标准化格式" - }, - { - "name": "test_clang_clang-cpp_syntax_only", - "desc": "仅运行预处理器、解析器和语义分析阶段" - }, - { - "name": "test_clang_clang-cpp_emit_llvm", - "desc": "为汇编和目标文件使用LLVM表示" - }, - { - "name": "test_clang_clang-cpp_emit_ast", - "desc": "为源输入生成Clang AST文件" - }, - { - "name": "test_clang_clang-cpp_print_target_triple", - "desc": "打印标准化的目标三元组" - }, - { - "name": "test_clang_clang-cpp_print_targets", - "desc": "打印已注册的目标" - }, - { - "name": "test_clang_clang-cpp_print_file_name_libgcc", - "desc": "打印当前使用的编译器运行时库的完整路径" - }, - { - "name": "test_clang_clang-cpp_print_search_dirs", - "desc": "打印用于查找库和程序的路径" - }, - { - "name": "test_clang_clang-cpp_print_resource_dir", - "desc": "打印资源目录路径" - }, - { - "name": "test_clang_clang-cpp_print_runtime_dir", - "desc": "打印包含clang运行时库的目录路径" - }, - { - "name": "test_clang_clang-cpp_print_prog_name_ld", - "desc": "打印ld程序的完整路径" - }, - { - "name": "test_clang_clang-cpp_print_supported_cpus", - "desc": "打印给定目标支持的CPU模型" - }, - { - "name": "test_clang_clang-cpp_print_effective_triple", - "desc": "打印有效的目标三元组" - }, - { - "name": "test_clang_clang-cpp_print_diagnostic_options", - "desc": "打印所有Clang的警告选项" - }, - { - "name": "test_clang_clang-cpp_module_file_info", - "desc": "提供有关特定模块文件的信息" - }, - { - "name": "test_clang_clang-cpp_help", - "desc": "显示可用选项" - }, - { - "name": "test_clang_clang-cpp_upper_version", - "desc": "打印版本信息" - }, - { - "name": "test_clang_clang-cpp_v", - "desc": "显示要运行的命令并使用详细输出" - }, - { - "name": "test_clang_function_install", - "desc": "安装clang编译器套件" - }, - { - "name": "test_clang_function_version", - "desc": "显示clang版本信息" - }, - { - "name": "test_clang_function_compile_c", - "desc": "编译一个C源文件" - }, - { - "name": "test_clang_function_compile_cpp", - "desc": "编译一个C++源文件" - }, - { - "name": "test_clang_function_help", - "desc": "显示clang帮助信息" - }, - { - "name": "test_clang_function_include_path", - "desc": "添加头文件搜索路径" - }, - { - "name": "test_clang_function_optimize", - "desc": "使用优化级别-O2编译" - }, - { - "name": "test_clang_function_warnings", - "desc": "启用所有警告并视作错误" - }, - { - "name": "test_clang_function_link_library", - "desc": "链接一个系统库" - }, - { - "name": "test_clang_function_output_name", - "desc": "指定输出文件名" - }, - { - "name": "test_clang_function_debug_info", - "desc": "生成调试信息" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/oncn-bwm/oncn-bwm-devel.json b/suite2cases/function_test/pkg_test/oncn-bwm/oncn-bwm-devel.json deleted file mode 100644 index 584d074b3bf..00000000000 --- a/suite2cases/function_test/pkg_test/oncn-bwm/oncn-bwm-devel.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/oncn-bwm/oncn-bwm-devel", - "machine num": 1, - "cases": [ - { - "name": "test_oncn-bwm-devel_function_init", - "desc": "Test initialization of the package" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-aiosignal/python3-aiosignal.json b/suite2cases/function_test/pkg_test/python-aiosignal/python3-aiosignal.json index cc10f7e6e99..e02bde36a18 100644 --- a/suite2cases/function_test/pkg_test/python-aiosignal/python3-aiosignal.json +++ b/suite2cases/function_test/pkg_test/python-aiosignal/python3-aiosignal.json @@ -14,18 +14,6 @@ "name": "test_python3-aiosignal_function_import", "desc": "Test importing aiosignal module" }, - { - "name": "test_python3-aiosignal_function_signal", - "desc": "Test basic signal creation and usage" - }, - { - "name": "test_python3-aiosignal_function_connect", - "desc": "Test connecting a coroutine to a signal" - }, - { - "name": "test_python3-aiosignal_function_send", - "desc": "Test sending data through a signal" - }, { "name": "test_python3-aiosignal_function_uninstall", "desc": "Test uninstallation of python3-aiosignal package" diff --git a/suite2cases/function_test/pkg_test/python-fqdn/python3-fqdn.json b/suite2cases/function_test/pkg_test/python-fqdn/python3-fqdn.json index d5bb71d4b58..aee6b674df6 100644 --- a/suite2cases/function_test/pkg_test/python-fqdn/python3-fqdn.json +++ b/suite2cases/function_test/pkg_test/python-fqdn/python3-fqdn.json @@ -6,10 +6,6 @@ "name": "test_python3-fqdn_install", "desc": "测试python3-fqdn软件包的安装功能,验证是否能够成功安装。", "machine num": 1 - }, - { - "name": "test_python3-fqdn_function_resolve", - "desc": "测试python3-fqdn的域名解析功能,验证是否能正确解析域名。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/python-zope-deprecation/python-zope-deprecation-help.json b/suite2cases/function_test/pkg_test/python-zope-deprecation/python-zope-deprecation-help.json index b23cc7e3d27..71b376a3203 100644 --- a/suite2cases/function_test/pkg_test/python-zope-deprecation/python-zope-deprecation-help.json +++ b/suite2cases/function_test/pkg_test/python-zope-deprecation/python-zope-deprecation-help.json @@ -5,22 +5,6 @@ { "name": "test_python-zope-deprecation-help_function_import", "desc": "测试能否成功导入zope.deprecation模块" - }, - { - "name": "test_python-zope-deprecation-help_function_install", - "desc": "测试软件包可以通过pip正常安装" - }, - { - "name": "test_python-zope-deprecation-help_function_uninstall", - "desc": "测试软件包可以通过pip正常卸载" - }, - { - "name": "test_python-zope-deprecation-help_function_deprecated", - "desc": "测试使用@deprecated装饰器标记函数" - }, - { - "name": "test_python-zope-deprecation-help_function_showwarning", - "desc": "测试调用被弃用的函数时会发出警告" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/rubygem-rdiscount/rubygem-rdiscount-help.json b/suite2cases/function_test/pkg_test/rubygem-rdiscount/rubygem-rdiscount-help.json index b0cc0972263..e2221452e91 100644 --- a/suite2cases/function_test/pkg_test/rubygem-rdiscount/rubygem-rdiscount-help.json +++ b/suite2cases/function_test/pkg_test/rubygem-rdiscount/rubygem-rdiscount-help.json @@ -6,10 +6,6 @@ "name": "test_rubygem-rdiscount-help_install", "desc": "测试软件包的安装功能,验证是否能够成功安装 rubygem-rdiscount-help 软件包。", "machine num": 1 - }, - { - "name": "test_rubygem-rdiscount-help_function_parse", - "desc": "测试软件包的解析功能,验证是否能正确解析 markdown 内容。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/shrinkwrap-resolver/shrinkwrap-resolver-gradle-depchain.json b/suite2cases/function_test/pkg_test/shrinkwrap-resolver/shrinkwrap-resolver-gradle-depchain.json index c367c58acd9..9e60692f6af 100644 --- a/suite2cases/function_test/pkg_test/shrinkwrap-resolver/shrinkwrap-resolver-gradle-depchain.json +++ b/suite2cases/function_test/pkg_test/shrinkwrap-resolver/shrinkwrap-resolver-gradle-depchain.json @@ -6,10 +6,6 @@ "name": "test_shrinkwrap-resolver-gradle-depchain_install", "desc": "测试软件包的安装功能,验证是否能够成功安装 shrinkwrap-resolver-gradle-depchain 包。", "machine num": 1 - }, - { - "name": "test_shrinkwrap-resolver-gradle-depchain_function_resolve", - "desc": "测试软件包的依赖解析功能,验证是否能够正确解析依赖关系。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/shrinkwrap/shrinkwrap-build-resources.json b/suite2cases/function_test/pkg_test/shrinkwrap/shrinkwrap-build-resources.json index fabdc7c400b..65ff385a0d9 100644 --- a/suite2cases/function_test/pkg_test/shrinkwrap/shrinkwrap-build-resources.json +++ b/suite2cases/function_test/pkg_test/shrinkwrap/shrinkwrap-build-resources.json @@ -7,29 +7,9 @@ "desc": "测试软件包的安装功能,验证安装过程中是否正常完成且无报错。", "machine num": 1 }, - { - "name": "test_shrinkwrap-build-resources_function_build", - "desc": "测试软件包的构建功能,验证构建过程是否正常完成且无报错。" - }, - { - "name": "test_shrinkwrap-build-resources_function_install", - "desc": "测试软件包的标准安装流程,验证其能否通过包管理器成功安装并配置到系统中。" - }, - { - "name": "test_shrinkwrap-build-resources_function_uninstall", - "desc": "测试软件包的卸载功能,验证卸载过程是否彻底且不影响系统其他组件。" - }, { "name": "test_shrinkwrap-build-resources_function_version", "desc": "测试软件包的版本查询功能,验证是否能正确输出版本信息。" - }, - { - "name": "test_shrinkwrap-build-resources_function_help", - "desc": "测试软件包的帮助信息功能,验证是否能正确显示使用说明和命令行参数。" - }, - { - "name": "test_shrinkwrap-build-resources_function_basic_usage", - "desc": "测试软件包最基础、最典型的使用命令,验证其核心功能能否按预期执行。" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/sisu/sisu-inject.json b/suite2cases/function_test/pkg_test/sisu/sisu-inject.json deleted file mode 100644 index 8a9deb78bf5..00000000000 --- a/suite2cases/function_test/pkg_test/sisu/sisu-inject.json +++ /dev/null @@ -1,130 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/sisu/sisu-inject", - "machine num": 1, - "cases": [ - { - "name": "test_sisu-inject_install", - "desc": "测试sisu-inject软件包的安装功能", - "machine num": 1 - }, - { - "name": "test_sisu-inject_uninstall", - "desc": "测试sisu-inject软件包的卸载功能", - "machine num": 1 - }, - { - "name": "test_sisu-inject_upgrade", - "desc": "测试sisu-inject软件包的升级功能", - "machine num": 1 - }, - { - "name": "test_sisu-inject_downgrade", - "desc": "测试sisu-inject软件包的降级功能", - "machine num": 1 - }, - { - "name": "test_sisu-inject_rollback", - "desc": "测试sisu-inject软件包的回滚功能", - "machine num": 1 - }, - { - "name": "test_sisu-inject_service_start", - "desc": "测试sisu-inject软件包服务的启动功能", - "machine num": 1 - }, - { - "name": "test_sisu-inject_service_stop", - "desc": "测试sisu-inject软件包服务的停止功能", - "machine num": 1 - }, - { - "name": "test_sisu-inject_service_restart", - "desc": "测试sisu-inject软件包服务的重启功能", - "machine num": 1 - }, - { - "name": "test_sisu-inject_service_status", - "desc": "测试sisu-inject软件包服务的查询状态功能", - "machine num": 1 - }, - { - "name": "test_sisu-inject_service_log", - "desc": "测试sisu-inject软件包服务的查看日志功能", - "machine num": 1 - }, - { - "name": "test_sisu-inject_service_config", - "desc": "测试sisu-inject软件包服务的配置功能", - "machine num": 1 - }, - { - "name": "test_sisu-inject_downgrade_rollback", - "desc": "测试sisu-inject软件包的降级回滚功能", - "machine num": 1 - }, - { - "name": "test_sisu-inject_service_reload", - "desc": "测试sisu-inject软件包服务的重新加载配置功能", - "machine num": 1 - }, - { - "name": "test_sisu-inject_service_enable", - "desc": "测试sisu-inject软件包服务的开机自启功能", - "machine num": 1 - }, - { - "name": "test_sisu-inject_service_disable", - "desc": "测试sisu-inject软件包服务的禁用开机自启功能", - "machine num": 1 - }, - { - "name": "test_sisu-inject_service_restart_failure", - "desc": "测试sisu-inject软件包服务在异常情况下的重启功能", - "machine num": 1 - }, - { - "name": "test_sisu-inject_function_dependency", - "desc": "测试sisu-inject软件包的基础依赖库功能" - }, - { - "name": "test_sisu-inject_function_install", - "desc": "测试软件包的基本安装功能,验证能否成功安装到系统" - }, - { - "name": "test_sisu-inject_function_uninstall", - "desc": "测试软件包的卸载功能,验证能否完全移除且不影响系统" - }, - { - "name": "test_sisu-inject_function_upgrade", - "desc": "测试软件包的升级功能,验证从旧版本升级到新版本的过程" - }, - { - "name": "test_sisu-inject_function_version", - "desc": "测试查询软件包版本信息的功能" - }, - { - "name": "test_sisu-inject_function_help", - "desc": "测试查看软件包帮助文档或使用说明的功能" - }, - { - "name": "test_sisu-inject_function_basic_usage", - "desc": "测试软件包最基础、最核心的一个命令行用法" - }, - { - "name": "test_sisu-inject_function_config_file", - "desc": "测试软件包默认配置文件的生成、读取或验证功能" - }, - { - "name": "test_sisu-inject_function_service_manage", - "desc": "测试服务管理(启动、停止、状态查询)的核心流程" - }, - { - "name": "test_sisu-inject_function_log_output", - "desc": "测试软件包或服务在正常操作下的日志输出功能" - }, - { - "name": "test_sisu-inject_function_dependency_check", - "desc": "测试软件包对关键依赖库的调用和兼容性" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/slf4j/slf4j-jcl.json b/suite2cases/function_test/pkg_test/slf4j/slf4j-jcl.json index e4c61baf07b..fd9feeb513c 100644 --- a/suite2cases/function_test/pkg_test/slf4j/slf4j-jcl.json +++ b/suite2cases/function_test/pkg_test/slf4j/slf4j-jcl.json @@ -22,32 +22,15 @@ "desc": "测试slf4j-jcl软件包的降级功能,验证降级是否成功", "machine num": 1 }, - { - "name": "test_slf4j-jcl_rollback", - "desc": "测试slf4j-jcl软件包的回滚功能,验证回滚是否成功", - "machine num": 1 - }, { "name": "test_slf4j-jcl_service_start", "desc": "测试slf4j-jcl软件包的服务启动功能,验证服务是否能正常启动", "machine num": 1 }, - { - "name": "test_slf4j-jcl_function_logging", - "desc": "测试slf4j-jcl软件包的日志记录功能,验证日志是否能正常输出" - }, - { - "name": "test_slf4j-jcl_function_binding", - "desc": "测试slf4j-jcl是否能正确绑定到Apache Commons Logging,验证桥接功能是否正常" - }, { "name": "test_slf4j-jcl_function_usage", "desc": "测试在应用程序中使用slf4j-jcl进行日志记录,验证日志输出到Commons Logging" }, - { - "name": "test_slf4j-jcl_function_config", - "desc": "测试slf4j-jcl的日志级别配置,验证配置是否生效并影响输出" - }, { "name": "test_slf4j-jcl_function_consistency", "desc": "测试slf4j-jcl桥接的日志级别一致性,验证SLF4J级别能正确映射到JCL" diff --git a/suite2cases/function_test/pkg_test/texlive-split-b/texlive-babel-slovak.json b/suite2cases/function_test/pkg_test/texlive-split-b/texlive-babel-slovak.json index cbd5a45bec9..79934a16566 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-b/texlive-babel-slovak.json +++ b/suite2cases/function_test/pkg_test/texlive-split-b/texlive-babel-slovak.json @@ -13,14 +13,6 @@ { "name": "test_texlive-babel-slovak_function_check", "desc": "Check if package is installed" - }, - { - "name": "test_texlive-babel-slovak_function_basic_use", - "desc": "Test basic LaTeX usage with Slovak language" - }, - { - "name": "test_texlive-babel-slovak_function_hyph_check", - "desc": "Check Slovak hyphenation patterns" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-c/texlive-bibtexperllibs.json b/suite2cases/function_test/pkg_test/texlive-split-c/texlive-bibtexperllibs.json deleted file mode 100644 index 5856edf457a..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-c/texlive-bibtexperllibs.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-c/texlive-bibtexperllibs", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-bibtexperllibs_function_parse", - "desc": "Test parsing functionality" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-d/texlive-bussproofs.json b/suite2cases/function_test/pkg_test/texlive-split-d/texlive-bussproofs.json deleted file mode 100644 index 138d5db709f..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-d/texlive-bussproofs.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-d/texlive-bussproofs", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-bussproofs_function_render", - "desc": "Test rendering of proofs" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-q/texlive-ntheorem-doc.json b/suite2cases/function_test/pkg_test/texlive-split-q/texlive-ntheorem-doc.json index b459fe1d342..3c85ad123ab 100644 --- a/suite2cases/function_test/pkg_test/texlive-split-q/texlive-ntheorem-doc.json +++ b/suite2cases/function_test/pkg_test/texlive-split-q/texlive-ntheorem-doc.json @@ -2,25 +2,13 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-q/texlive-ntheorem-doc", "machine num": 1, "cases": [ - { - "name": "test_texlive-ntheorem-doc_function_docgen", - "desc": "Verify documentation generation" - }, { "name": "test_texlive-ntheorem-doc_function_install", "desc": "Verify package installation via package manager" }, - { - "name": "test_texlive-ntheorem-doc_function_doc_access", - "desc": "Access and verify documentation files" - }, { "name": "test_texlive-ntheorem-doc_function_uninstall", "desc": "Verify package uninstallation" - }, - { - "name": "test_texlive-ntheorem-doc_function_example_usage", - "desc": "Verify LaTeX document compiles with ntheorem" } ] } \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-q/texlive-ot-tableau.json b/suite2cases/function_test/pkg_test/texlive-split-q/texlive-ot-tableau.json deleted file mode 100644 index d04fd03501b..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-q/texlive-ot-tableau.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-q/texlive-ot-tableau", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-ot-tableau_function_basic", - "desc": "Test basic functionality of texlive-ot-tableau" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pst-exa.json b/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pst-exa.json deleted file mode 100644 index 71320d94a12..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-s/texlive-pst-exa.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-exa", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-pst-exa_function_basic", - "desc": "Basic functionality test for texlive-pst-exa" - } - ] -} \ No newline at end of file diff --git a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-quiz2socrative.json b/suite2cases/function_test/pkg_test/texlive-split-y/texlive-quiz2socrative.json deleted file mode 100644 index fe8e06e3c0f..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-y/texlive-quiz2socrative.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-y/texlive-quiz2socrative", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-quiz2socrative_function_convert", - "desc": "Test quiz conversion to socrative format" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_downgrade.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_downgrade.sh deleted file mode 100644 index b008a2a3f23..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_downgrade.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包的降级功能,验证降级过程是否正常完成 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装,记录当前版本" - CURRENT_VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" aalto-xml-help) - else - LOG_INFO "aalto-xml-help软件包未安装,准备安装" - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到aalto-xml-help软件包" - exit 255 - fi - - # 获取可用的旧版本 - LOG_INFO "获取可用的旧版本" - OLD_VERSION=$(dnf list available aalto-xml-help --showduplicates | awk "{print $2}" | sort -V | head -n 1) - if [ -z "$OLD_VERSION" ]; then - LOG_ERROR "未找到可用的旧版本" - exit 255 - fi - - # 如果当前未安装,则安装软件包 - if [ -z "$CURRENT_VERSION" ]; then - LOG_INFO "安装aalto-xml-help软件包" - dnf install -y aalto-xml-help-${OLD_VERSION} - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - INSTALLED=1 - else - INSTALLED=0 - fi - - # 验证降级功能 - LOG_INFO "测试降级功能" - dnf downgrade -y aalto-xml-help-${OLD_VERSION} - CHECK_RESULT $? 0 0 "降级aalto-xml-help软件包失败" - - # 验证降级后的版本是否正确 - LOG_INFO "验证降级后的版本是否正确" - AFTER_VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" aalto-xml-help) - CHECK_RESULT "$AFTER_VERSION" "$OLD_VERSION" 0 "降级后版本与预期不符" - - # 环境恢复:如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - else - LOG_INFO "保持当前安装状态,无需卸载" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_downgrade_rollback.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_downgrade_rollback.sh deleted file mode 100644 index 3ee744aae01..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_downgrade_rollback.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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 : 测试aalto-xml-help软件包的降级回滚功能,验证降级回滚过程是否正常完成 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - INSTALLED=true - else - LOG_INFO "aalto-xml-help软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 获取当前安装的aalto-xml-help版本 - CURRENT_VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" aalto-xml-help 2>/dev/null) - if [ $? -ne 0 ]; then - CURRENT_VERSION="未安装" - fi - - # 获取可用的aalto-xml-help版本列表 - AVAILABLE_VERSIONS=$(dnf list available aalto-xml-help --showduplicates | awk "{print $2}" | grep -v "^$" | sort -V) - if [ -z "$AVAILABLE_VERSIONS" ]; then - LOG_ERROR "无法获取可用的aalto-xml-help版本列表" - exit 255 - fi - - # 选择降级版本(选择比当前版本低的版本) - if [ "$CURRENT_VERSION" != "未安装" ]; then - TARGET_VERSION=$(echo "$AVAILABLE_VERSIONS" | awk -v current="$CURRENT_VERSION" "$1 < current {print $1}" | tail -n1) - else - TARGET_VERSION=$(echo "$AVAILABLE_VERSIONS" | head -n1) - fi - - if [ -z "$TARGET_VERSION" ]; then - LOG_ERROR "没有可用的降级版本" - exit 255 - fi - - LOG_INFO "目标降级版本: $TARGET_VERSION" - - # 如果未安装,则先安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help-$TARGET_VERSION > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - LOG_INFO "aalto-xml-help软件包安装成功" - fi - - # 执行降级操作 - LOG_INFO "开始降级aalto-xml-help软件包到版本: $TARGET_VERSION" - dnf downgrade -y aalto-xml-help-$TARGET_VERSION > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "降级aalto-xml-help软件包失败" - - #验证降级是否成功 - AFTER_DOWNGRADE_VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" aalto-xml-help) - CHECK_RESULT "$AFTER_DOWNGRADE_VERSION" "$TARGET_VERSION" != "降级后版本验证失败" - - LOG_INFO "降级成功,当前版本: $AFTER_DOWNGRADE_VERSION" - - #执行回滚操作 - LOG_INFO "开始回滚到原始状态(升级到最初检测到的版本)" - dnf history undo last -y > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "回滚操作失败" - - #验证回滚是否成功 - AFTER_ROLLBACK_VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" aalto.xml.help) - CHECK_RESULT "$AFTER_ROLLBACK_VERSION" "$CURRENT.VERSION" != "回滚后版本验证失败" - - LOG.INFO "回滚成功,当前版本: $AFTER.ROLLBACK.VERSION" - - ##清理环境(如果最初未安装,则卸载) - if [ "$INSTALLED" = false ] ; then - LOG.INFO "清理环境:卸载aallt.o-xm.l-help.rpm " - dnf remove.y.aallt.o-xm.l.help.>/dev/null.2>&1. - CHECK.RESULT.$?.0.0."卸载失败". - LOG._INFO"环境清理完成". - fi. -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_function_install.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_function_install.sh deleted file mode 100644 index 913c207c26b..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_function_install.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-20 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包的安装功能,验证是否能通过包管理器正常安装 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试aalto-xml-help软件包的安装功能 - - LOG_INFO "开始测试aalto-xml-help软件包的安装功能" - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help 2>/dev/null | grep -q "aalto-xml-help" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到aalto-xml-help软件包" - exit 255 - fi - LOG_INFO "yum源中存在aalto-xml-help软件包" - - # 检查是否已经安装aalto-xml-help软件包 - LOG_INFO "检查是否已经安装aalto-xml-help软件包" - rpm -q aalto-xml-help >/dev/null 2>&1 - already_installed=$? - - if [ $already_installed -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已经安装,测试结束后将保持安装状态" - need_cleanup=0 - else - LOG_INFO "aalto-xml-help软件包未安装,将在测试结束后卸载" - need_cleanup=1 - fi - - # 安装软件包 - LOG_INFO "安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - - # 验证安装结果 - LOG_INFO "验证aalto-xml-help软件包是否安装成功" - rpm -q aalto-xml-help >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证aalto-xml-help软件包安装失败" - - LOG_INFO "aalto-xml-help软件包安装成功" - - # 测试软件包基本功能 - LOG_INFO "测试aalto-xml-help软件包基本功能" - # 这里可以根据实际软件包功能添加测试命令 - # 例如:aalto-xml-help --version 或相关命令 - # 由于不知道具体命令,这里使用rpm查询作为示例 - rpm -qi aalto-xml-help | grep -q "Name" - CHECK_RESULT $? 0 0 "aalto-xml-help软件包基本信息查询失败" - - LOG_INFO "aalto-xml-help软件包基本功能测试通过" - - # 环境清理 - LOG_INFO "开始清理测试环境" - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "卸载测试安装的aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - LOG_INFO "aalto-xml-help软件包卸载成功" - else - LOG_INFO "保持aalto-xml-help软件包安装状态" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_function_parse.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_function_parse.sh deleted file mode 100644 index 28c73fcb1bd..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_function_parse.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-07 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包的XML解析功能,验证是否能正常解析XML文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试aalto-xml-help软件包的XML解析功能" - - # 检查是否已安装aalto-xml-help软件包 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - if rpm -q aalto-xml-help &>/dev/null; then - LOG_INFO "aalto-xml-help软件包已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "aalto-xml-help软件包未安装,准备安装" - INSTALLED=false - fi - - # 检查yum源中是否有aalto-xml-help软件包 - LOG_INFO "检查yum源中是否有aalto-xml-help软件包" - if ! dnf list available aalto-xml-help &>/dev/null; then - LOG_ERROR "yum源中未找到aalto-xml-help软件包" - exit 255 - fi - - # 若未安装则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 验证XML解析功能 - LOG_INFO "验证aalto-xml-help的XML解析功能" - TEST_XML_FILE="/tmp/test.xml" - cat > $TEST_XML_FILE < - test - - EOF - - # 使用aalto-xml-help解析XML文件 - LOG_INFO "使用aalto-xml-help解析测试XML文件" - aalto-xml-help parse $TEST_XML_FILE - CHECK_RESULT $? 0 0 "XML解析失败" - - # 清理测试文件 - rm -f $TEST_XML_FILE - - # 若脚本开始时未安装则卸载软件包以恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包以恢复环境" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_function_uninstall.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_function_uninstall.sh deleted file mode 100644 index da1aeb47ed4..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_function_uninstall.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-20 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包的卸载功能,验证是否能通过包管理器正常卸载 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - PACKAGE_NAME="aalto-xml-help" - LOG_INFO "开始测试 ${PACKAGE_NAME} 软件包的卸载功能" - - 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}" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "当前环境已安装 ${PACKAGE_NAME},测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "当前环境未安装 ${PACKAGE_NAME},将执行安装作为测试步骤" - INSTALLED_BEFORE=false - fi - - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "步骤3:安装 ${PACKAGE_NAME} 软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装 ${PACKAGE_NAME} 失败" - LOG_INFO "安装 ${PACKAGE_NAME} 成功" - fi - - LOG_INFO "步骤4:验证 ${PACKAGE_NAME} 软件包已安装" - rpm -q ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "验证 ${PACKAGE_NAME} 已安装失败" - - LOG_INFO "步骤5:卸载 ${PACKAGE_NAME} 软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载 ${PACKAGE_NAME} 失败" - LOG_INFO "卸载 ${PACKAGE_NAME} 成功" - - LOG_INFO "步骤6:验证 ${PACKAGE_NAME} 软件包已卸载" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "验证 ${PACKAGE_NAME} 已卸载失败,软件包仍然存在" - exit 1 - else - LOG_INFO "验证 ${PACKAGE_NAME} 已卸载成功" - fi - - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "步骤7:环境恢复,由于测试前未安装,测试后保持未安装状态,无需操作" - else - LOG_INFO "步骤7:环境恢复,重新安装 ${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/aalto-xml/aalto-xml-help/test_aalto-xml-help_function_validate.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_function_validate.sh deleted file mode 100644 index cc8eaf49c5f..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_function_validate.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-20 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包的XML验证功能,验证是否能正确验证XML的有效性 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义变量 - PACKAGE_NAME="aalto-xml-help" - TEST_XML_VALID="valid.xml" - TEST_XML_INVALID="invalid.xml" - - # 步骤1: 检查软件包是否在yum源中 - LOG_INFO "步骤1: 检查软件包是否在yum源中" - dnf list available $PACKAGE_NAME &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 步骤2: 检查当前环境是否已安装软件包 - LOG_INFO "步骤2: 检查当前环境是否已安装软件包" - INSTALLED=false - rpm -q $PACKAGE_NAME &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - INSTALLED=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3: 安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4: 验证命令参数是否存在 - LOG_INFO "步骤4: 验证命令参数是否存在" - xml_validate_cmd=$(which xml-validate 2>/dev/null) - if [ -z "$xml_validate_cmd" ]; then - LOG_ERROR "命令 xml-validate 不存在" - exit 255 - fi - - # 步骤5: 创建测试XML文件 - LOG_INFO "步骤5: 创建测试XML文件" - cat > $TEST_XML_VALID < - - test - - EOF - - cat > $TEST_XML_INVALID < - - test - - EOF - - # 步骤6: 测试XML验证功能 - 有效XML - LOG_INFO "步骤6: 测试XML验证功能 - 有效XML" - $xml_validate_cmd $TEST_XML_VALID - CHECK_RESULT $? 0 0 "验证有效XML失败" - - # 步骤7: 测试XML验证功能 - 无效XML - LOG_INFO "步骤7: 测试XML验证功能 - 无效XML" - $xml_validate_cmd $TEST_XML_INVALID - if [ $? -eq 0 ]; then - LOG_ERROR "无效XML被错误地验证为有效" - exit 1 - else - LOG_INFO "无效XML验证失败,符合预期" - fi - - # 步骤8: 清理测试文件 - LOG_INFO "步骤8: 清理测试文件" - rm -f $TEST_XML_VALID $TEST_XML_INVALID - - # 步骤9: 如果脚本开始时未安装,则在结束时卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤9: 卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_function_version.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_function_version.sh deleted file mode 100644 index 2a9310bcd8e..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_function_version.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-20 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包的版本查询功能,验证是否能正确查询软件包版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "步骤1:检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - INSTALLED="true" - else - LOG_INFO "aalto-xml-help软件包未安装" - INSTALLED="false" - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "步骤2:检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 测试aalto-xml-help软件包的版本查询功能 - LOG_INFO "步骤4:测试aalto-xml-help软件包的版本查询功能" - rpm -q aalto-xml-help --queryformat "%{VERSION}-%{RELEASE}\n" - CHECK_RESULT $? 0 0 "查询aalto-xml-help软件包版本信息失败" - - # 验证版本信息格式 - LOG_INFO "步骤5:验证版本信息格式" - VERSION_INFO=$(rpm -q aalto-xml-help --queryformat "%{VERSION}-%{RELEASE}\n") - if [[ -n "$VERSION_INFO" && "$VERSION_INFO" =~ ^[0-9]+\.[0-9]+\.[0-9]+-[0-9]+ ]]; then - LOG_INFO "版本信息格式正确: $VERSION_INFO" - CHECK_RESULT 0 0 0 "版本信息格式不正确" - else - LOG_ERROR "版本信息格式不正确: $VERSION_INFO" - CHECK_RESULT 1 0 0 "版本信息格式不正确" - fi - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤6:清理环境,卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_install.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_install.sh deleted file mode 100644 index da9da0a6b30..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_install.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-07-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包的安装功能,验证安装过程是否正常完成 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装,跳过安装步骤" - installed=true - else - installed=false - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在aalto-xml-help软件包" - - # 安装aalto-xml-help软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 验证aalto-xml-help命令是否可用 - LOG_INFO "验证aalto-xml-help命令是否可用" - aalto-xml-help --help > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "aalto-xml-help命令参数不支持或不存在" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "清理环境,卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_rollback.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_rollback.sh deleted file mode 100644 index a3063225ba5..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_rollback.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包的回滚功能,验证回滚过程是否正常完成 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - INSTALLED=true - else - LOG_INFO "aalto-xml-help软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 测试回滚功能 - LOG_INFO "测试aalto-xml-help软件包的回滚功能" - dnf history undo last -y - CHECK_RESULT $? 0 0 "回滚aalto-xml-help软件包失败" - - # 验证回滚是否成功 - LOG_INFO "验证回滚是否成功" - rpm -q aalto-xml-help - if [ "$INSTALLED" = false ]; then - CHECK_RESULT $? 1 0 "回滚后应卸载aalto-xml-help但未卸载" - else - CHECK_RESULT $? 0 0 "回滚后应保留aalto-xml-help但未保留" - fi - - # 恢复环境:如果最初未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "恢复环境:卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_rollback_upgrade.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_rollback_upgrade.sh deleted file mode 100644 index 7042548218a..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_rollback_upgrade.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 : 2025-07-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包的升级回滚功能,验证升级回滚过程是否正常完成 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "aalto-xml-help软件包未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 安装aalto-xml-help软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 获取当前安装的aalto-xml-help版本 - LOG_INFO "获取当前安装的aalto-xml-help版本" - CURRENT_VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" aalto-xml-help) - LOG_INFO "当前aalto-xml-help版本: $CURRENT_VERSION" - - # 检查升级参数是否支持 - LOG_INFO "检查升级参数是否支持" - dnf upgrade --help | grep -q "\-\-rollback" - if [ $? -ne 0 ]; then - LOG_ERROR "dnf工具不支持--rollback参数" - exit 255 - fi - - # 模拟升级到新版本 - LOG_INFO "模拟升级到新版本(假设新版本为dummy)" - dnf upgrade -y aalto-xml-help --nogpgcheck --enablerepo=* 2>&1 | tee upgrade.log - CHECK_RESULT $? 0 0 "升级aalto-xml-help软件包失败" - - # 验证升级后版本 - LOG_INFO "验证升级后版本" - UPGRADED_VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" aalto-xml-help) - LOG_INFO "升级后aalto-xml-help版本: $UPGRADED_VERSION" - - # 执行回滚操作 - LOG_INFO "执行回滚操作" - dnf history rollback -y 1 - CHECK_RESULT $? 0 0 "回滚操作失败" - - # 验证回滚后版本 - LOG_INFO "验证回滚后版本" - ROLLBACK_VERSION=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" aalto-xml-help) - CHECK_RESULT "$ROLLBACK_VERSION" "$CURRENT_VERSION" "" "回滚后版本与预期不符" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_backup.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_backup.sh deleted file mode 100644 index 6038a9b1868..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_backup.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的备份功能,验证服务数据是否能正常备份 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - INSTALLED=true - else - LOG_INFO "aalto-xml-help软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装aalto-xml-help软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 检查服务备份功能 - LOG_INFO "测试服务备份功能" - aalto-xml-help --backup /tmp/backup.xml > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "服务备份功能测试失败" - - # 验证备份文件是否存在 - LOG_INFO "验证备份文件是否存在" - [ -f /tmp/backup.xml ] - CHECK_RESULT $? 0 0 "备份文件未生成" - - # 清理备份文件 - LOG_INFO "清理备份文件" - rm -f /tmp/backup.xml - - # 如果脚本开始时未安装,则在结束时卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_config.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_config.sh deleted file mode 100644 index 3fdfdd96e56..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_config.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的配置功能,验证服务配置是否能正常修改和生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试aalto-xml-help软件包服务的配置功能,验证服务配置是否能正常修改和生效" - - # 检查软件包是否在yum源中 - LOG_INFO "检查aalto-xml-help软件包是否在yum源中" - dnf list available aalto-xml-help &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "aalto-xml-help软件包不在yum源中" - exit 255 - fi - - # 检查软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help &>/dev/null - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "aalto-xml-help软件包已安装" - else - installed=false - LOG_INFO "aalto-xml-help软件包未安装,将进行安装" - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 测试服务配置修改功能 - LOG_INFO "测试服务配置修改功能" - systemctl cat aalto-xml-help &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "aalto-xml-help服务不存在或不支持" - exit 255 - fi - - # 修改服务配置并验证 - LOG_INFO "修改aalto-xml-help服务配置" - sed -i "s/^ExecStart=.*/ExecStart=\/usr\/bin\/aalto-xml-help --config \/etc\/aalto-xml-help\/config.json/" /usr/lib/systemd/system/aalto-xml-help.service - CHECK_RESULT $? 0 0 "修改服务配置失败" - - LOG_INFO "重新加载systemd配置" - systemctl daemon-reload - CHECK_RESULT $? 0 0 "重新加载systemd配置失败" - - LOG_INFO "重启aalto-xml-help服务" - systemctl restart aalto-xml-help - CHECK_RESULT $? 0 0 "重启服务失败" - - LOG_INFO "检查服务状态" - systemctl status aalto-xml-help | grep "active (running)" - CHECK_RESULT $? 0 0 "服务状态异常" - - # 恢复环境(如果脚本开始时未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 00"卸载软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_config_reload.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_config_reload.sh deleted file mode 100644 index 290c532b760..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_config_reload.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的配置重载功能,验证服务配置修改后是否能通过重载命令正常生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - INSTALLED=1 - else - LOG_INFO "aalto-xml-help软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装aalto-xml-help软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 检查服务配置重载功能是否支持 - LOG_INFO "检查服务配置重载功能是否支持" - systemctl help | grep reload > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "服务配置重载功能不支持" - exit 255 - fi - - # 修改服务配置 - LOG_INFO "修改服务配置" - sed -i "s/^#.*//g" /etc/aalto-xml-help/config.xml - CHECK_RESULT $? 0 0 "修改服务配置失败" - - # 重载服务配置 - LOG_INFO "重载服务配置" - systemctl reload aalto-xml-help.service > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "重载服务配置失败" - - # 验证服务配置是否生效 - LOG_INFO "验证服务配置是否生效" - systemctl status aalto-xml-help.service | grep "active (running)" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "服务配置未生效" - - # 如果脚本开始时未安装,则在结束时卸载软件包 - if [ $INSTALLED -eq- -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_disable.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_disable.sh deleted file mode 100644 index 16c46ccd2cd..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_disable.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的开机自启禁用功能,验证服务是否能正常禁用开机自启 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查aalto-xml-help软件包是否在yum源中 - LOG_INFO "检查aalto-xml-help软件包是否在yum源中" - dnf list available aalto-xml-help &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到aalto-xml-help软件包" - exit 255 - fi - - # 检查aalto-xml-help是否已安装 - LOG_INFO "检查aalto-xml-help是否已安装" - rpm -q aalto-xml-help &>/dev/null - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "aalto-xml-help已安装,脚本结束后将保持安装状态" - else - installed=false - LOG_INFO "aalto-xml-help未安装,将在测试结束后卸载" - fi - - # 安装aalto-xml-help软件包(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help失败" - fi - - # 检查服务是否存在 - LOG_INFO "检查服务是否存在" - systemctl list-unit-files | grep aalto-xml-help.service &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "服务aalto-xml-help.service不存在" - exit 255 - fi - - # 禁用服务开机自启 - LOG_INFO "禁用aalto-xml-help.service的开机自启" - systemctl disable aalto-xml-help.service - CHECK_RESULT $? 0 0 "禁用服务开机自启失败" - - # 验证服务是否已禁用开机自启 - LOG_INFO "验证服务是否已禁用开机自启" - systemctl is-enabled aalto-xml-help.service | grep disabled &>/dev/null - CHECK_RESULT $? 0 0 "服务开机自启未成功禁用" - - # 清理环境(如果最初未安装) - if [ "$installed" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_enable.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_enable.sh deleted file mode 100644 index d9b0fd6ea47..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_enable.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的开机自启功能,验证服务是否能正常设置为开机自启 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装,脚本结束时保持安装状态" - INSTALLED=true - else - LOG_INFO "aalto-xml-help软件包未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到aalto-xml-help软件包" - exit 255 - fi - - # 安装aalto-xml-help软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 检查服务是否支持enable参数 - LOG_INFO "检查服务是否支持enable参数" - systemctl enable aalto-xml-help --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "服务不支持enable参数" - exit 255 - fi - - # 设置服务开机自启并验证 - LOG_INFO "设置服务开机自启" - systemctl enable aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "设置服务开机自启失败" - - LOG_INFO "验证服务是否已设置为开机自启" - systemctl is-enabled aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "服务未成功设置为开机自启" - - # 清理环境(如果最初未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包以恢复环境" - dnf remove -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 “卸载aalto-xml-help失败” - fi - - LOG_INFO “测试完成” - exit 0 - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_failover.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_failover.sh deleted file mode 100644 index 5adc977b673..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_failover.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-07-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的故障转移功能,验证服务在异常情况下是否能正常进行故障转移 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查aalto-xml-help软件包是否在yum源中 - LOG_INFO "检查aalto-xml-help软件包是否在yum源中" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到aalto-xml-help软件包" - exit 255 - fi - - # 检查环境是否已安装aalto-xml-help软件包 - LOG_INFO "检查环境是否已安装aalto-xml-help软件包" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - INSTALLED=true - LOG_INFO "环境已安装aalto-xml-help软件包" - else - INSTALLED=false - LOG_INFO "环境未安装aalto-xml-help软件包,将进行安装" - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 检查服务是否存在 - LOG_INFO "检查服务是否存在" - systemctl list-unit-files | grep aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "aalto-xml-help服务不存在" - - # 启动服务 - LOG_INFO "启动aalto-xml-help服务" - systemctl start aalto-xml-help - CHECK_RESULT $? 0 0 "启动aalto-xml-help服务失败" - - # 检查服务状态是否为active - LOG_INFO "检查服务状态是否为active" - systemctl is-active aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "aalto-xml-help服务未正常运行" - - # 模拟故障转移场景(如停止主服务) - LOG_INFO "模拟故障转移场景:停止主服务" - systemctl stop aalto-xml-help - CHECK_RESULT $? 0 0 "停止aalto-xml-help服务失败" - - # SSH到第二个节点执行命令(假设NODE2_IPV4等变量已定义) - LOG_INFO "在第二个节点上检查故障转移是否成功" - SSH_CMD systemctl is-active aalto-xml-help $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER - CHECK_RESULT $? 0 0 "故障转移失败,第二个节点服务未启动" - - #恢复主节点服务(确保环境恢复) - LOG_INFO "恢复主节点服务" - systemctl start aalto-xml-help - CHECK_RESULT $? 0 0 "恢复主节点服务失败" - - # 如果脚本开始时未安装软件包,则卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT \$? \00 \00 \卸载aaltoxmllhelp软件包失败\” - fi - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_health_check.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_health_check.sh deleted file mode 100644 index 9a725e9acea..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_health_check.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的健康检查功能,验证服务健康状态是否能正常检查 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试aalto-xml-help软件包服务的健康检查功能" - - # 检查软件包是否已安装 - if rpm -q aalto-xml-help &>/dev/null; then - LOG_INFO "aalto-xml-help软件包已安装,测试结束后将保持安装状态" - installed=true - else - LOG_INFO "aalto-xml-help软件包未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - if ! dnf list available aalto-xml-help &>/dev/null; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 安装aalto-xml-help软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 检查服务健康状态功能 - LOG_INFO "验证服务健康状态是否能正常检查" - if ! command -v aalto-xml-help-health-check &>/dev/null; then - LOG_ERROR "命令aalto-xml-help-health-check不存在或不支持" - exit 255 - fi - - aalto-xml-help-health-check --status - CHECK_RESULT $? 0 0 "服务健康状态检查失败" - - # 清理环境,恢复到之前的状态 - if [ "$installed" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log.sh deleted file mode 100644 index 30cd68db35f..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志查看功能,验证服务日志是否能正常查看 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - INSTALLED=1 - else - LOG_INFO "aalto-xml-help软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在aalto-xml-help软件包" - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 检查服务日志查看功能 - LOG_INFO "测试服务日志查看功能" - journalctl -u aalto-xml-help --no-pager > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "服务日志查看功能异常" - - # 如果脚本开始时未安装,则卸载软件包以恢复环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载aalto-xml-help软件包以恢复环境" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_archive.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_archive.sh deleted file mode 100644 index 6211e96a53a..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_archive.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志归档功能,验证服务日志归档是否能正常执行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - INSTALLED=true - else - LOG_INFO "aalto-xml-help软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装aalto-xml-help软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 验证服务日志归档功能 - LOG_INFO "验证服务日志归档功能" - systemctl start aalto-xml-help - CHECK_RESULT $? 0 0 "启动aalto-xml-help服务失败" - - LOG_INFO "执行日志归档命令" - aalto-xml-help --archive-logs - CHECK_RESULT $? 0 0 "日志归档命令执行失败" - - # 检查日志归档文件是否存在 - LOG_INFO "检查日志归档文件是否存在" - ls /var/log/aalto-xml-help/archive/ - CHECK_RESULT $? 0 0 "日志归档文件不存在" - - # 恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - else - LOG_INFO "保持aalto-xml-help软件包安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_clean.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_clean.sh deleted file mode 100644 index 2e8066a0540..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_clean.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志清理功能,验证服务日志是否能正常清理 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - installed=true - else - LOG_INFO "aalto-xml-help软件包未安装" - installed=false - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 验证服务日志清理功能 - LOG_INFO "验证aalto-xml-help服务日志清理功能" - systemctl restart aalto-xml-help - CHECK_RESULT $? 0 0 "启动aalto-xml-help服务失败" - - # 模拟日志生成 - LOG_INFO "模拟生成日志" - touch /var/log/aalto-xml-help.log - echo "test log" >> /var/log/aalto-xml-help.log - - # 执行日志清理 - LOG_INFO "执行日志清理" - systemctl restart aalto-xml-help --log-clean - CHECK_RESULT $? 0 0 "日志清理失败" - - # 检查日志是否被清理 - LOG_INFO "检查日志是否被清理" - if [ -f /var/log/aalto-xml-help.log ]; then - LOG_ERROR "日志清理失败,日志文件仍存在" - exit 1 - else - LOG_INFO "日志清理成功" - fi - - # 恢复环境:如果脚本开始时未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_compression.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_compression.sh deleted file mode 100644 index 63d08572083..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_compression.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志压缩功能,验证服务日志压缩是否能正常设置和生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "aalto-xml-help软件包未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到aalto-xml-help软件包" - exit 255 - fi - - # 若未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 检查服务日志压缩功能是否支持指定参数 - LOG_INFO "检查服务日志压缩功能是否支持指定参数" - aalto-xml-help --help | grep "log-compression" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "服务日志压缩参数不支持" - exit 255 - fi - - # 设置服务日志压缩并验证 - LOG_INFO "设置服务日志压缩并验证" - aalto-xml-help --log-compression=on - CHECK_RESULT $? 0 0 "设置服务日志压缩失败" - - # 验证日志压缩是否生效 - LOG_INFO "验证日志压缩是否生效" - aalto-xml-help --status | grep "log-compression: on" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "日志压缩未生效" - - # 恢复环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export.sh deleted file mode 100644 index 6259c6f3fe6..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志导出功能,验证服务日志是否能正常导出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "aalto-xml-help软件包未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 测试服务日志导出功能 - LOG_INFO "测试服务日志导出功能" - aalto-xml-help --export-logs - CHECK_RESULT $? 0 0 "服务日志导出失败" - - # 验证导出的日志文件是否存在 - LOG_INFO "验证导出的日志文件是否存在" - ls /var/log/aalto-xml-help/exported_logs.log - CHECK_RESULT $? 0 0 "导出的日志文件不存在" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_compression.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_compression.sh deleted file mode 100644 index 56e130212d2..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_compression.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志导出压缩功能,验证服务日志是否能按指定压缩格式正常导出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "aalto-xml-help软件包未安装,脚本结束后将卸载该软件包" - INSTALLED=0 - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装aalto-xml-help软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 验证服务日志导出压缩功能 - LOG_INFO "验证服务日志导出压缩功能" - - # 测试支持的压缩格式(示例:gzip, bzip2) - SUPPORTED_FORMATS="gzip bzip2" - for format in $SUPPORTED_FORMATS; do - LOG_INFO "测试导出日志并使用$format压缩" - - # 执行日志导出压缩命令(假设命令为aalto-log-export --compress $format) - aalto-log-export --compress $format > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "$format压缩格式导出日志失败" - done - - # 测试不支持的压缩格式(示例:unsupported) - LOG_INFO "测试不支持的压缩格式(unsupported)" - aalto-log-export --compress unsupported > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "不支持的压缩格式测试通过(预期失败)" - else - LOG_ERROR "不支持的压缩格式测试未通过" - exit 255 - fi - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_encryption.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_encryption.sh deleted file mode 100644 index 6ed2cbdd082..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_encryption.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志导出加密功能,验证服务日志是否能按指定加密方式正常导出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装,跳过安装步骤" - INSTALLED=1 - else - LOG_INFO "aalto-xml-help软件包未安装,准备安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包,退出测试" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 验证服务日志导出加密功能参数是否存在 - LOG_INFO "验证服务日志导出加密功能参数是否存在" - aalto-xml-help --help | grep "\--export-encryption" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "--export-encryption参数不存在或不支持,退出测试" - exit 255 - fi - - # 测试服务日志导出加密功能 - LOG_INFO "测试服务日志导出加密功能" - aalto-xml-help --export-encryption AES256 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "服务日志导出加密功能测试失败" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_filter.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_filter.sh deleted file mode 100644 index c68f90731bb..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_filter.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志导出过滤功能,验证服务日志是否能按指定条件过滤后正常导出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - INSTALLED=1 - else - LOG_INFO "aalto-xml-help软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 测试服务日志导出过滤功能 - LOG_INFO "测试服务日志导出过滤功能" - aalto-xml-help --export-log --filter "level=error" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "服务日志导出过滤功能测试失败" - - # 检查不支持的参数情况(模拟测试) - LOG_INFO "检查不支持的参数情况" - aalto-xml-help --invalid-param > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "不支持参数测试通过" - else - LOG_ERROR "不支持参数测试失败" - exit 255 - fi - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO “测试完成,环境已恢复” - exit 0 - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_format.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_format.sh deleted file mode 100644 index 71ff392afa1..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_format.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志导出格式功能,验证服务日志是否能按指定格式正常导出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装aalto-xml-help软件包 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - installed=true - else - LOG_INFO "aalto-xml-help软件包未安装" - installed=false - fi - - # 检查yum源中是否有aalto-xml-help软件包 - LOG_INFO "检查yum源中是否有aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 验证服务日志导出格式功能 - LOG_INFO "验证服务日志导出格式功能" - aalto-xml-help --export-format xml > /tmp/aalto-xml-help.log 2>&1 - CHECK_RESULT $? 0 0 "服务日志导出格式功能验证失败" - - # 检查日志文件是否存在 - LOG_INFO "检查日志文件是否生成" - [ -f "/tmp/aalto-xml-help.log" ] - CHECK_RESULT $? 0 0 "日志文件未生成" - - # 检查日志文件内容是否符合预期 - LOG_INFO "检查日志文件内容是否符合预期" - grep -q "" /tmp/aalto-xml-help.log - CHECK_RESULT $? 0 0 "日志文件内容不符合预期" - - # 清理临时日志文件 - LOG_INFO "清理临时日志文件" - rm -f /tmp/aalto-xml-help.log - - # 如果脚本开始时未安装则卸载软件包以恢复环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包以恢复环境" - dnf remove -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_path.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_path.sh deleted file mode 100644 index df44910d14f..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_path.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-07-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志导出路径功能,验证服务日志是否能按指定路径正常导出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 步骤1:检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - INSTALLED=1 - else - LOG_INFO "aalto-xml-help软件包未安装" - INSTALLED=0 - fi - - # 步骤2:检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 步骤4:验证服务日志导出路径功能 - LOG_INFO "验证服务日志导出路径功能" - - # 步骤4.1:检查命令参数是否支持 - LOG_INFO "检查命令参数是否支持" - aalto-xml-help --export-log-path > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "命令参数不支持" - exit 255 - fi - - # 步骤4.2:指定日志导出路径并验证导出功能 - LOG_INFO "指定日志导出路径并验证导出功能" - TEST_LOG_PATH="/tmp/test_aalto_xml_help_log_export" - mkdir -p $TEST_LOG_PATH - CHECK_RESULT $? 0 0 "创建日志导出路径失败" - - aalto-xml-help --export-log-path=$TEST_LOG_PATH > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "日志导出功能执行失败" - - # 步骤4.3:验证日志文件是否生成在指定路径下 - LOG_INFO "验证日志文件是否生成在指定路径下" - ls $TEST_LOG_PATH/aalto-xml-help.log > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "日志文件未生成在指定路径下" - - # 步骤5:清理测试环境 - LOG_INFO "清理测试环境" - rm -rf $TEST_LOG_PATH - - # 步骤6:如果脚本开始时未安装,则卸载软件包以恢复环境状态 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载aalto-xml-help软件包以恢复环境状态" - dnf remove -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 \“卸载aalto-xml-help软件包失败” - fi - - LOG_INFO "测试脚本执行完毕" - exit 0 -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_permission.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_permission.sh deleted file mode 100644 index 4fa5e611bcb..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_permission.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-07-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志导出权限功能,验证服务日志是否能按指定权限正常导出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - INSTALLED=true - else - LOG_INFO "aalto-xml-help软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 检查服务日志导出权限功能参数支持情况 - LOG_INFO "检查服务日志导出权限功能参数支持情况" - aalto-xml-help --help | grep "log-export" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "服务日志导出权限功能参数不支持" - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - dnf remove -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - exit 255 - fi - - # 测试服务日志导出权限功能是否正常 - LOG_INFO "测试服务日志导出权限功能是否正常" - aalto-xml-help --log-export /tmp/test_log_export > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "服务日志导出权限功能测试失败" - - # 验证导出的日志文件权限是否正确(假设预期权限为644) - LOG_INFO "验证导出的日志文件权限是否正确" - ls -l /tmp/test_log_export | awk "{print $1}" | grep -q "-rw-r--r--" - CHECK_RESULT $? 0 0 "导出的日志文件权限不正确" - - #清理临时日志文件 - LOG_INFO "清理临时日志文件" - rm -f /tmp/test_log_export - CHECK_RESULT $? 0 0 "清理临时日志文件失败" - - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? , , ,"卸载aalty.-xml.-help软件包包失畋" - fi - - LOG_INFO."测i试完成,,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_retention.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_retention.sh deleted file mode 100644 index 95ceb7f7540..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_retention.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志导出保留功能,验证服务日志是否能按指定保留策略正常导出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - installed=true - else - LOG_INFO "aalto-xml-help软件包未安装" - installed=false - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 验证服务日志导出保留功能 - LOG_INFO "验证服务日志导出保留功能" - aalto-xml-help --export-logs --retention-days 7 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "服务日志导出保留功能验证失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_size.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_size.sh deleted file mode 100644 index c952dab15ac..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_export_size.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志导出大小功能,验证服务日志是否能按指定大小正常导出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - INSTALLED=true - else - LOG_INFO "aalto-xml-help软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 检查服务日志导出功能 - LOG_INFO "测试服务日志导出大小功能" - aalto-xml-help --export-log --size 10M - CHECK_RESULT $? 0 0 "服务日志导出失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_filter.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_filter.sh deleted file mode 100644 index 5798afad3b7..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_filter.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志过滤功能,验证服务日志是否能按指定条件正常过滤 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试aalto-xml-help软件包服务的日志过滤功能" - - # 检查软件包是否已安装 - if rpm -q aalto-xml-help &>/dev/null; then - LOG_INFO "aalto-xml-help软件包已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "aalto-xml-help软件包未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - if ! dnf list available aalto-xml-help &>/dev/null; then - LOG_ERROR "yum源中未找到aalto-xml-help软件包" - exit 255 - fi - - # 安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 验证服务日志过滤功能 - LOG_INFO "验证服务日志过滤功能" - log_filter_output=$(aalto-xml-help --filter-log "条件") - CHECK_RESULT $? 0 0 "日志过滤功能执行失败" - - # 检查参数是否存在或不支持 - LOG_INFO "检查不支持的参数" - aalto-xml-help --invalid-param &>/dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "不支持的参数未正确处理" - exit 255 - fi - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_format.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_format.sh deleted file mode 100644 index db7bf014ec0..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_format.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-07-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志格式功能,验证服务日志格式是否能正常设置和生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试aalto-xml-help软件包服务的日志格式功能 - LOG_INFO "开始测试aalto-xml-help软件包服务的日志格式功能" - - # 检查软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - if rpm -q aalto-xml-help; then - LOG_INFO "aalto-xml-help软件包已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "aalto-xml-help软件包未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有aalto-xml-help软件包 - LOG_INFO "检查yum源中是否有aalto-xml-help软件包" - if ! dnf list available aalto-xml-help &>/dev/null; then - LOG_ERROR "yum源中未找到aalto-xml-help软件包" - exit 255 - fi - - # 安装aalto-xml-help软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 验证服务日志格式功能 - LOG_INFO "验证服务日志格式功能" - # 假设服务日志格式设置命令为aalto-xml-help --set-log-format - if ! aalto-xml-help --help | grep -q -- "--set-log-format"; then - LOG_ERROR "aalto-xml-help不支持--set-log-format参数" - exit 255 - fi - - # 设置日志格式 - LOG_INFO "设置服务日志格式" - aalto-xml-help --set-log-format "json" - CHECK_RESULT $? 0 0 "设置服务日志格式失败" - - # 验证日志格式是否生效 - LOG_INFO "验证日志格式是否生效" - if ! journalctl -u aalto-xml-help --no-pager | grep -q "\"format\": \"json\""; then - LOG_ERROR "服务日志格式未生效" - exit 1 - fi - - # 恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_import.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_import.sh deleted file mode 100644 index 876bdf80935..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_import.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志导入功能,验证服务日志是否能正常导入 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - INSTALLED=1 - else - LOG_INFO "aalto-xml-help软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - LOG_INFO "aalto-xml-help软件包安装成功" - fi - - # 验证服务日志导入功能 - LOG_INFO "验证aalto-xml-help服务日志导入功能" - aalto-xml-help --import-log /var/log/messages - CHECK_RESULT $? 0 0 "服务日志导入失败" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - LOG_INFO "aalto-xml-help软件包卸载成功" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level.sh deleted file mode 100644 index 5c054833d54..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志级别功能,验证服务日志级别是否能正常设置和生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查aalto-xml-help软件包是否在yum源中 - LOG_INFO "检查aalto-xml-help软件包是否在yum源中" - dnf list available aalto-xml-help &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "aalto-xml-help软件包不在yum源中" - exit 255 - fi - - # 检查aalto-xml-help是否已安装 - LOG_INFO "检查aalto-xml-help是否已安装" - rpm -q aalto-xml-help &>/dev/null - if [ $? -eq 0 ]; then - installed=true - LOG_INFO "aalto-xml-help已安装,脚本结束后将保持安装状态" - else - installed=false - LOG_INFO "aalto-xml-help未安装,将在测试完成后卸载" - fi - - # 安装aalto-xml-help软件包(如果未安装) - if [ "$installed" = false ]; then - LOG_INFO "安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 检查服务日志级别设置功能 - LOG_INFO "测试服务日志级别设置功能" - systemctl cat aalto-xml-help &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "aalto-xml-help服务不存在或不支持" - exit 255 - fi - - # 设置日志级别为debug并验证 - LOG_INFO "设置日志级别为debug并验证" - systemctl set-log-level aalto-xml-help debug - CHECK_RESULT $? 0 0 "设置日志级别为debug失败" - - current_level=$(systemctl get-log-level aalto-xml-help) - CHECK_RESULT $? 0 0 "获取当前日志级别失败" - [ "$current_level" = "debug" ] - CHECK_RESULT $? 0 0 "日志级别未正确设置为debug" - - # 设置日志级别为info并验证 - LOG_INFO "设置日志级别为info并验证" - systemctl set-log-level aalto-xml-help info - CHECK_RESULT $? 0 0 "设置日志级别为info失败" - - current_level=$(systemctl get-log-level aalto-xml-help) - CHECK_RESULT $? 0 0 "获取当前日志级别失败" - [ "$current_level" = "info" ] - CHECK_RESULT $? 0 0 "日志级别未正确设置为info" - - # 恢复环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_default.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_default.sh deleted file mode 100644 index e986b0a19df..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_default.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-07-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的默认日志级别功能,验证服务默认日志级别是否符合预期 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - INSTALLED=1 - else - LOG_INFO "aalto-xml-help软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装aalto-xml-help软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 检查服务默认日志级别 - LOG_INFO "检查服务默认日志级别" - systemctl cat aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "服务aalto-xml-help不存在或不支持" - exit 255 - fi - - # 获取服务日志级别 - LOG_INFO "获取服务默认日志级别" - LOG_LEVEL=$(systemctl show -p LogLevel aalto-xml-help | cut -d= -f2) - CHECK_RESULT $? 0 0 "获取服务日志级别失败" - - # 验证日志级别是否符合预期 - LOG_INFO "验证服务默认日志级别是否符合预期" - EXPECTED_LEVEL="info" - if [ "$LOG_LEVEL" != "$EXPECTED_LEVEL" ]; then - LOG_ERROR "服务默认日志级别不符合预期,当前为$LOG_LEVEL,预期为$EXPECTED_LEVEL" - exit 1 - else - LOG_INFO "服务默认日志级别符合预期,当前为$LOG_LEVEL" - fi - - # 如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_dynamic.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_dynamic.sh deleted file mode 100644 index 57a225cbd0b..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_dynamic.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的动态日志级别功能,验证服务日志级别是否能动态调整和生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装aalto-xml-help软件包 - LOG_INFO "检查是否已安装aalto-xml-help软件包" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - INSTALLED=1 - else - LOG_INFO "aalto-xml-help软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有aalto-xml-help软件包 - LOG_INFO "检查yum源中是否有aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装aalto-xml-help软件包" - dnf install -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 检查服务日志级别功能是否支持动态调整 - LOG_INFO "测试服务日志级别动态调整功能" - systemctl cat aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "aalto-xml-help服务不存在或不支持" - exit 255 - fi - - # 获取当前日志级别 - LOG_INFO "获取当前日志级别" - CURRENT_LEVEL=$(systemctl show -p LogLevel aalto-xml-help | cut -d= -f2) - LOG_INFO "当前日志级别: $CURRENT_LEVEL" - - # 设置新的日志级别 - NEW_LEVEL="debug" - LOG_INFO "设置新的日志级别为: $NEW_LEVEL" - systemctl set-log-level aalto-xml-help $NEW_LEVEL > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "设置日志级别失败" - - # 验证日志级别是否生效 - LOG_INFO "验证日志级别是否生效" - UPDATED_LEVEL=$(systemctl show -p LogLevel aalto-xml-help | cut -d= -f2) - if [ "$UPDATED_LEVEL" != "$NEW_LEVEL" ]; then - LOG_ERROR "日志级别未生效,当前级别: $UPDATED_LEVEL" - exit 1 - else - LOG_INFO "日志级别已生效,当前级别: $UPDATED_LEVEL" - fi - - # 恢复原始日志级别 - LOG_INFO "恢复原始日志级别: $CURRENT_LEVEL" - systemctl set-log-level aalto-xml-help $CURRENT_LEVEL > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "恢复日志级别失败" - - #如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_get.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_get.sh deleted file mode 100644 index ae89c0ab018..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_get.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志级别获取功能,验证服务日志级别是否能正常查询 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - if ! dnf list installed aalto-xml-help &>/dev/null; then - LOG_INFO "aalto-xml-help未安装,将进行安装" - INSTALLED=0 - else - LOG_INFO "aalto-xml-help已安装" - INSTALLED=1 - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - if ! dnf list available aalto-xml-help &>/dev/null; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help失败" - fi - - # 测试服务日志级别获取功能 - LOG_INFO "测试服务日志级别获取功能" - aalto-xml-help --log-level get &>/dev/null - CHECK_RESULT $? 0 0 "获取服务日志级别失败" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_range.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_range.sh deleted file mode 100644 index 084c22780bd..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_range.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志级别范围功能,验证服务日志级别设置是否在有效范围内 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - INSTALLED=1 - else - LOG_INFO "aalto-xml-help软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装aalto-xml-help软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 检查服务日志级别参数是否支持 - LOG_INFO "检查服务日志级别参数是否支持" - systemctl show aalto-xml-help --property LogLevel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "服务不支持日志级别参数" - exit 255 - fi - - # 测试日志级别范围功能 - LOG_INFO "测试日志级别范围功能" - - # 设置有效日志级别并验证 - VALID_LEVELS=("debug" "info" "warning" "error" "critical") - for level in "${VALID_LEVELS[@]}"; do - LOG_INFO "设置日志级别为$level" - systemctl set-property aalto-xml-help LogLevel=$level > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "设置日志级别为$level失败" - - CURRENT_LEVEL=$(systemctl show aalto-xml-help --property LogLevel | cut -d"=" -f2) - CHECK_RESULT "$CURRENT_LEVEL" "$level" 0 "当前日志级别与设置不一致" - done - - # 设置无效日志级别并验证 - INVALID_LEVEL="invalid_level" - LOG_INFO "设置无效日志级别为$INVALID_LEVEL" - systemctl set-property aalto-xml-help LogLevel=$INVALID_LEVEL > /dev/null 2>&1 - CHECK_RESULT $? !0 0 "设置无效日志级别应失败" - - # 恢复环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_set.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_set.sh deleted file mode 100644 index 592fae0f038..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志级别设置功能,验证服务日志级别是否能正常设置和生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - INSTALLED=1 - else - LOG_INFO "aalto-xml-help软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有aalto-xml-help软件包 - LOG_INFO "检查yum源中是否有aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 检查服务是否存在并获取服务名称 - LOG_INFO "检查服务是否存在" - SERVICE_NAME=$(systemctl list-unit-files | grep aalto-xml-help | awk "{print $1}") - if [ -z "$SERVICE_NAME" ]; then - LOG_ERROR "未找到aalto-xml-help相关服务" - exit 255 - fi - - # 测试日志级别设置功能 - LOG_INFO "测试日志级别设置功能" - - # 设置日志级别为debug - LOG_INFO "设置日志级别为debug" - systemctl set-log-level $SERVICE_NAME debug > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "设置日志级别为debug失败" - - # 验证日志级别是否生效 - LOG_INFO "验证日志级别是否生效" - CURRENT_LEVEL=$(systemctl show -p LogLevel $SERVICE_NAME | cut -d"=" -f2) - CHECK_RESULT "$CURRENT_LEVEL" "debug" "\"日志级别设置未生效\"" - - # 设置日志级别为info - LOG_INFO "设置日志级别为info" - systemctl set-log-level $SERVICE_NAME info > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "设置日志级别为info失败" - - # 验证日志级别是否生效 - LOG_INFO "验证日志级别是否生效" - CURRENT_LEVEL=$(systemctl show -p LogLevel $SERVICE_NAME | cut -d"=" -f2) - CHECK_RESULT "$CURRENT_LEVEL" "info" "\"日志级别设置未生效\"" - - # 清理环境 - if [ $INSTALLED -eq -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_set_get.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_set_get.sh deleted file mode 100644 index e1b3edec69a..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_set_get.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志级别设置和获取功能,验证服务日志级别设置后是否能正常获取 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装aalto-xml-help软件包 - LOG_INFO "检查是否已安装aalto-xml-help软件包" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - installed=true - else - LOG_INFO "aalto-xml-help软件包未安装" - installed=false - fi - - # 检查yum源中是否有aalto-xml-help软件包 - LOG_INFO "检查yum源中是否有aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 测试日志级别设置功能 - LOG_INFO "测试日志级别设置功能" - aalto-xml-help --set-log-level debug > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "设置日志级别为debug失败" - - # 测试日志级别获取功能 - LOG_INFO "测试日志级别获取功能" - log_level=$(aalto-xml-help --get-log-level 2>&1) - CHECK_RESULT $? 0 0 "获取日志级别失败" - - # 验证日志级别是否为debug - LOG_INFO "验证日志级别是否为debug" - if [ "$log_level" = "debug" ]; then - LOG_INFO "日志级别设置和获取功能正常" - else - LOG_ERROR "日志级别设置和获取功能异常,当前日志级别为: $log_level" - exit 1 - fi - - # 恢复环境:如果脚本开始时未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 \“卸载aalto-xml-help软件包失败\” - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_set_verify.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_set_verify.sh deleted file mode 100644 index a1abe7fd706..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_set_verify.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 : 测试aalto-xml-help软件包服务的日志级别设置验证功能,验证服务日志级别设置后是否能正常生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - INSTALLED=1 - else - LOG_INFO "aalto-xml-help软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 验证服务日志级别设置功能 - LOG_INFO "验证服务日志级别设置功能" - - # 设置日志级别为debug并验证 - LOG_INFO "设置日志级别为debug" - systemctl set-log-level aalto-xml-help debug > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "设置日志级别为debug失败" - - LOG_INFO "验证日志级别是否设置为debug" - current_level=$(systemctl get-log-level aalto-xml-help) - CHECK_RESULT "$current_level" "debug" 0 "日志级别未正确设置为debug" - - # 设置日志级别为info并验证 - LOG_INFO "设置日志级别为info" - systemctl set-log-level aalto-xml-help info > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "设置日志级别为info失败" - - LOG_INFO "验证日志级别是否设置为info" - current_level=$(systemctl get-log-level aalto-xml-help) - CHECK_RESULT "$current_level" "info" 0 "日志级别未正确设置为info" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_switch.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_switch.sh deleted file mode 100644 index 82414437e18..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_switch.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志级别切换功能,验证服务日志级别是否能正常切换和生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装aalto-xml-help软件包 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "aalto-xml-help软件包未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "\"安装aalto-xml-help软件包失败\"" - fi - - # 检查服务是否已启动 - LOG_INFO "检查aalto-xml-help服务是否已启动" - systemctl is-active aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_INFO "启动aalto-xml-help服务" - systemctl start aalto-xml-help - CHECK_RESULT $? 0 0 "\"启动aalto-xml-help服务失败\"" - fi - - # 获取当前日志级别 - LOG_INFO "获取当前日志级别" - CURRENT_LEVEL=$(systemctl show -p LogLevel aalto-xml-help | cut -d= -f2) - LOG_INFO "当前日志级别为: $CURRENT_LEVEL" - - # 测试日志级别切换功能 - LOG_INFO "测试日志级别切换功能" - LOG_LEVELS=("debug" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_verify.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_verify.sh deleted file mode 100644 index fc7813e802f..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_verify.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志级别验证功能,验证服务日志级别设置后是否能正常生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - INSTALLED=true - else - LOG_INFO "aalto-xml-help软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 验证服务日志级别设置功能 - LOG_INFO "验证服务日志级别设置功能" - aalto-xml-help --set-log-level debug > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "设置日志级别为debug失败" - - # 验证日志级别是否生效 - LOG_INFO "验证日志级别是否生效" - journalctl -u aalto-xml-help --no-pager | grep -q "debug" - CHECK_RESULT $? 0 0 "日志级别设置未生效" - - # 恢复日志级别为默认 - LOG_INFO "恢复日志级别为默认" - aalto-xml-help --set-log-level info > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "恢复日志级别为info失败" - - # 如果脚本开始时未安装,则卸载软件包以恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包以恢复环境" - dnf remove -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_verify_range.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_verify_range.sh deleted file mode 100644 index 9421cf48d41..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_level_verify_range.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 : 测试aalto-xml-help软件包服务的日志级别范围验证功能,验证服务日志级别设置后是否在有效范围内正常生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查aalto-xml-help软件包是否已安装 - if ! rpm -q aalto-xml-help > /dev/null 2>&1; then - LOG_INFO "aalto-xml-help软件包未安装,开始安装..." - # 检查yum源中是否有aalto-xml-help软件包 - if ! dnf list available aalto-xml-help > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到aalto-xml-help软件包" - exit 255 - fi - # 安装软件包 - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - INSTALLED=1 - else - LOG_INFO "aalto-xml-help软件包已安装" - INSTALLED=0 - fi - - # 验证服务日志级别设置功能 - LOG_INFO "开始验证服务日志级别设置功能..." - # 获取当前日志级别 - CURRENT_LEVEL=$(systemctl show aalto-xml-help.service --property=LogLevel | cut -d"=" -f2) - LOG_INFO "当前日志级别为: $CURRENT_LEVEL" - - # 设置有效日志级别(示例:debug) - LOG_INFO "尝试设置日志级别为debug..." - systemctl set-property aalto-xml-help.service LogLevel=debug - CHECK_RESULT $? 0 0 "设置日志级别为debug失败" - NEW_LEVEL=$(systemctl show aalto-xml-help.service --property=LogLevel | cut -d"=" -f2) - CHECK_RESULT "$NEW_LEVEL" "debug" 0 "日志级别未成功设置为debug" - - # 设置无效日志级别(示例:invalid) - LOG_INFO "尝试设置日志级别为invalid..." - systemctl set-property aalto-xml-help.service LogLevel=invalid - if [ $? -eq 0 ]; then - LOG_ERROR "设置无效日志级别未失败" - exit 255 - else - LOG_INFO "设置无效日志级别失败,符合预期" - fi - - # 恢复原始日志级别(如果之前有修改) - if [ "$CURRENT_LEVEL" != "$NEW_LEVEL" ]; then - LOG_INFO "恢复原始日志级别: $CURRENT_LEVEL" - systemctl set-property aalto-xml-help.service LogLevel=$CURRENT_LEVEL - CHECK_RESULT $? 0 0 "恢复日志级别失败" - fi - - # 清理环境(如果脚本安装了软件包) - if [ "$INSTALLED" -eq 1 ]; then - LOG_INFO "卸载aalto-xml-help软件包..." - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_retention.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_retention.sh deleted file mode 100644 index 2e1b46fd4ec..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_retention.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志保留功能,验证服务日志保留策略是否能正常设置和生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "aalto-xml-help软件包未安装,将在测试完成后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到aalto-xml-help软件包" - exit 255 - fi - - # 安装aalto-xml-help软件包(如果未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 检查服务日志保留策略设置功能 - LOG_INFO "测试服务日志保留策略设置功能" - aalto-xml-help --set-log-retention 30 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "设置日志保留策略失败" - - # 验证日志保留策略是否生效 - LOG_INFO "验证日志保留策略是否生效" - aalto-xml-help --get-log-retention | grep -q "30" - CHECK_RESULT $? 0 0 "日志保留策略未生效" - - # 清理环境(如果脚本开始时未安装软件包) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_rotate.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_rotate.sh deleted file mode 100644 index 6d95cf4f83f..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_rotate.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志轮转功能,验证服务日志轮转是否能正常执行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - installed=true - else - LOG_INFO "aalto-xml-help软件包未安装" - installed=false - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装aalto-xml-help软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 检查服务日志轮转功能是否支持 - LOG_INFO "检查服务日志轮转功能是否支持" - aalto-xml-help --help | grep log-rotate > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "aalto-xml-help不支持日志轮转功能" - exit 255 - fi - - # 测试服务日志轮转功能 - LOG_INFO "测试服务日志轮转功能" - aalto-xml-help log-rotate - CHECK_RESULT $? 0 0 "服务日志轮转功能执行失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_rotate_config.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_rotate_config.sh deleted file mode 100644 index b6117ff7f18..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_rotate_config.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志轮转配置功能,验证服务日志轮转配置是否能正常设置和生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - INSTALLED=1 - else - LOG_INFO "aalto-xml-help软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 检查日志轮转配置功能是否支持指定参数 - LOG_INFO "检查日志轮转配置功能是否支持指定参数" - systemctl cat aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "日志轮转配置功能不支持指定参数" - exit 255 - fi - - # 验证服务日志轮转配置是否能正常设置和生效 - LOG_INFO "验证服务日志轮转配置是否能正常设置和生效" - - # 检查当前日志轮转配置状态 - LOG_INFO "检查当前日志轮转配置状态" - journalctl -u aalto-xml-help --no-pager | grep -q "Logs were rotated" - CHECK_RESULT $? 0 0 "当前日志轮转配置状态异常" - - # 修改日志轮转配置 - LOG_INFO "修改日志轮转配置" - sed -i "s/^#Rotate=.*/Rotate=5/" /etc/systemd/journald.conf.d/aalto-xml-help.conf - CHECK_RESULT $? 0 0 "修改日志轮转配置失败" - - # 重新加载配置并重启服务以生效 - LOG_INFO "重新加载配置并重启服务以生效" - systemctl daemon-reload - systemctl restart aalto-xml-help.service - - # 检查修改后的日志轮转配置是否生效 - LOG_INFO "检查修改后的日志轮转配置是否生效" - journalctl -u aalto-xml-help --no-pager | grep -q "Rotate=5" - CHECK_RESULT $? 0 0 "修改后的日志轮转配置未生效" - - # 恢复环境 - if [ $INSTALLED -eq -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_size.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_size.sh deleted file mode 100644 index f23eb5daab2..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_log_size.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的日志大小功能,验证服务日志大小是否能正常设置和生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查aalto-xml-help软件包是否已安装 - if ! rpm -q aalto-xml-help > /dev/null 2>&1; then - LOG_INFO "aalto-xml-help软件包未安装,开始安装..." - # 检查yum源中是否存在aalto-xml-help软件包 - if ! dnf list available aalto-xml-help > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到aalto-xml-help软件包" - exit 255 - fi - # 安装软件包 - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - INSTALLED=1 - else - LOG_INFO "aalto-xml-help软件包已安装" - INSTALLED=0 - fi - - # 测试服务日志大小功能 - LOG_INFO "开始测试aalto-xml-help服务日志大小功能" - - # 设置日志大小参数并验证是否生效 - LOG_INFO "设置服务日志大小为10M" - systemctl set-property aalto-xml-help.service LogLimit=10M - CHECK_RESULT $? 0 0 "设置日志大小失败" - - LOG_INFO "验证日志大小是否生效" - LOG_SIZE=$(systemctl show -p LogLimit aalto-xml-help.service | awk -F= "{print $2}") - if [ "$LOG_SIZE" != "10M" ]; then - LOG_ERROR "日志大小设置未生效,当前大小为$LOG_SIZE" - exit 1 - fi - - LOG_INFO "测试成功,日志大小已设置为10M" - - # 清理环境:如果脚本开始时安装了软件包,则卸载 - if [ "$INSTALLED" -eq 1 ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - exit 0 -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_reload.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_reload.sh deleted file mode 100644 index cebd8ad3afb..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_reload.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的重载功能,验证服务配置重载是否能正常生效 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - INSTALLED=1 - else - LOG_INFO "aalto-xml-help软件包未安装" - INSTALLED=0 - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 检查服务是否存在并获取服务名称 - LOG_INFO "检查服务是否存在" - SERVICE_NAME=$(systemctl list-unit-files | grep aalto-xml-help | awk "{print $1}") - if [ -z "$SERVICE_NAME" ]; then - LOG_ERROR "未找到aalto-xml-help相关服务" - exit 255 - fi - - # 重载服务配置 - LOG_INFO "重载服务配置" - systemctl daemon-reload > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "重载服务配置失败" - - # 验证服务配置是否生效 - LOG_INFO "验证服务配置是否生效" - systemctl show "$SERVICE_NAME" --property=ActiveState > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证服务配置失败" - - # 如果最初未安装,则卸载软件包以恢复环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载aalto-xml-help软件包以恢复环境" - dnf remove -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_restart.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_restart.sh deleted file mode 100644 index cbb377a0e73..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_restart.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的重启功能,验证服务是否能正常重启 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - installed=true - else - LOG_INFO "aalto-xml-help软件包未安装" - installed=false - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装aalto-xml-help软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 检查aalto-xml-help服务是否存在 - LOG_INFO "检查aalto-xml-help服务是否存在" - systemctl list-unit-files | grep aalto-xml-help.service > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "aalto-xml-help服务不存在" - exit 255 - fi - - # 重启aalto-xml-help服务并验证 - LOG_INFO "重启aalto-xml-help服务并验证" - systemctl restart aalto-xml-help.service - CHECK_RESULT $? 0 0 "重启aalto-xml-help服务失败" - - # 检查服务状态 - LOG_INFO "检查aalto-xml-help服务状态" - systemctl status aalto-xml-help.service > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "aalto-xml-help服务状态异常" - - # 如果最初未安装,则卸载aalto-xml-help软件包以恢复环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包以恢复环境" - dnf remove -y aalto-xml-hep > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载aaltonxml_help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_start.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_start.sh deleted file mode 100644 index f81886972da..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_start.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的启动功能,验证服务是否能正常启动 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "aalto-xml-help软件包未安装,开始安装" - INSTALLED=false - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在aalto-xml-help软件包" - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 检查服务是否存在 - LOG_INFO "检查aalto-xml-help服务是否存在" - systemctl list-unit-files | grep aalto-xml-help.service > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "aalto-xml-help服务不存在" - - # 启动服务并验证 - LOG_INFO "启动aalto-xml-help服务并验证" - systemctl start aalto-xml-help.service - CHECK_RESULT $? 0 0 "启动aalto-xml-help服务失败" - - # 检查服务状态是否为active - LOG_INFO "检查aalto-xml-help服务状态是否为active" - systemctl is-active aalto-xml-help.service | grep -w active > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "aalto-xml-help服务未成功启动" - - # 恢复环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_status.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_status.sh deleted file mode 100644 index 34664431d1d..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_status.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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 : 测试aalto-xml-help软件包服务的状态查询功能,验证服务状态是否能正常查询 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_INFO "aalto-xml-help软件包未安装,开始安装" - # 检查yum源中是否存在aalto-xml-help软件包 - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到aalto-xml-help软件包" - exit 255 - fi - # 安装软件包 - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - INSTALLED=1 - else - LOG_INFO "aalto-xml-help软件包已安装" - INSTALLED=0 - fi - - # 测试aalto-xml-help服务状态查询功能 - LOG_INFO "测试aalto-xml-help服务状态查询功能" - systemctl status aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "查询aalto-xml-help服务状态失败" - - # 环境恢复:如果脚本开始时未安装软件包,则卸载 - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_stop.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_stop.sh deleted file mode 100644 index 48003ead3da..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_service_stop.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包服务的停止功能,验证服务是否能正常停止 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装" - installed=true - else - LOG_INFO "aalto-xml-help软件包未安装" - installed=false - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 检查服务是否存在 - LOG_INFO "检查服务是否存在" - systemctl list-unit-files | grep aalto-xml-help.service > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "服务aalto-xml-help.service不存在" - exit 255 - fi - - # 停止服务 - LOG_INFO "停止服务aalto-xml-help.service" - systemctl stop aalto-xml-help.service - CHECK_RESULT $? 0 0 "停止服务aalto-xml-help.service失败" - - # 验证服务是否已停止 - LOG_INFO "验证服务是否已停止" - systemctl is-active aalto-xml-help.service | grep -q "inactive" - CHECK_RESULT $? 0 0 "服务aalto-xml-help.service未停止" - - # 恢复环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_uninstall.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_uninstall.sh deleted file mode 100644 index 4c4c825c409..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_uninstall.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-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包的卸载功能,验证卸载过程是否正常完成 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "aalto-xml-help软件包未安装,脚本结束后将卸载软件包" - INSTALLED=0 - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在aalto-xml-help软件包" - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 验证卸载功能 - LOG_INFO "测试aalto-xml-help软件包的卸载功能" - dnf remove -y aalto-xml-help - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - - # 如果最初未安装,则重新安装以恢复环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "恢复环境,重新安装aalto-xml-help软件包" - dnf install -y aalto-xml-help - CHECK_RESULT $? 0 0 "恢复环境失败" - else - LOG_INFO "环境已恢复为初始状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_upgrade.sh b/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_upgrade.sh deleted file mode 100644 index a551b319469..00000000000 --- a/testcases/function_test/pkg_test/aalto-xml/aalto-xml-help/test_aalto-xml-help_upgrade.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-07-04 -# @License : Mulan PSL v2 -# @Desc : 测试aalto-xml-help软件包的升级功能,验证升级过程是否正常完成 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查aalto-xml-help软件包是否已安装 - LOG_INFO "检查aalto-xml-help软件包是否已安装" - rpm -q aalto-xml-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "aalto-xml-help软件包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "aalto-xml-help软件包未安装,脚本结束后将卸载该软件包" - INSTALLED=false - fi - - # 检查yum源中是否存在aalto-xml-help软件包 - LOG_INFO "检查yum源中是否存在aalto-xml-help软件包" - dnf list available aalto-xml-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在aalto-xml-help软件包" - exit 255 - fi - - # 安装aalto-xml-help软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装aalto-xml-help软件包" - dnf install -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装aalto-xml-help软件包失败" - fi - - # 验证升级功能 - LOG_INFO "验证aalto-xml-help软件包的升级功能" - dnf upgrade -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "升级aalto-xml-help软件包失败" - - # 检查升级后的版本信息(假设通过rpm -q命令验证) - LOG_INFO "检查升级后的aalto-xml-help版本信息" - rpm -q aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "升级后aalto-xml-help版本信息获取失败" - - # 清理环境(如果脚本开始时未安装,则卸载) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载aalto-xml-help软件包" - dnf remove -y aalto-xml-help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载aalto-xml-help软件包失败" - fi - - LOG_INFO "测试脚本执行完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ant/ant-javamail/test_ant-javamail_function_error_handle.sh b/testcases/function_test/pkg_test/ant/ant-javamail/test_ant-javamail_function_error_handle.sh deleted file mode 100644 index ce0d6474171..00000000000 --- a/testcases/function_test/pkg_test/ant/ant-javamail/test_ant-javamail_function_error_handle.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-31 -# @License : Mulan PSL v2 -# @Desc : 测试ant-javamail软件包的错误处理功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色和日志函数 - RED="\033[0;31m" - GREEN="\033[0;32m" - NC="\033[0m" # No Color - - LOG_INFO() { - echo -e "${GREEN}[INFO]${NC} $*" - } - - LOG_ERROR() { - echo -e "${RED}[ERROR]${NC} $*" - } - - # 检查软件包是否在yum源中 - check_package_in_repo() { - local package_name=$1 - LOG_INFO "检查yum源中是否存在软件包: $package_name" - dnf list available "$package_name" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $package_name 不在yum源中" - exit 255 - fi - LOG_INFO "软件包 $package_name 在yum源中找到" - } - - # 检查命令参数是否支持 - check_command_param() { - local cmd=$1 - local param=$2 - LOG_INFO "检查命令 $cmd 是否支持参数 $param" - $cmd --help 2>&1 | grep -q "$param" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $cmd 不支持参数 $param" - exit 255 - fi - LOG_INFO "命令 $cmd 支持参数 $param" - } - - # 主测试函数 - test_ant_javamail_error_handle() { - local package_name="ant-javamail" - local installed=false - - # 步骤1: 检查环境是否已安装ant-javamail - LOG_INFO "步骤1: 检查环境是否已安装 $package_name" - rpm -q $package_name &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "$package_name 已经安装" - installed=true - else - LOG_INFO "$package_name 未安装" - fi - - # 步骤2: 检查yum源中是否有该软件包 - LOG_INFO "步骤2: 检查yum源中是否有 $package_name" - check_package_in_repo "$package_name" - - # 步骤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: 测试错误处理功能 - 检查ant命令是否支持-help参数 - LOG_INFO "步骤4: 测试ant命令的错误处理功能" - check_command_param "ant" "-help" - - # 步骤5: 执行一个会失败的ant命令来测试错误处理 - LOG_INFO "步骤5: 执行一个无效的ant命令测试错误处理" - ant invalid_command_test 2>&1 | grep -i "error\|fail" - CHECK_RESULT $? 0 1 "ant命令没有正确处理无效命令错误" - LOG_INFO "ant命令正确处理了无效命令错误" - - # 步骤6: 测试ant-javamail相关功能 - LOG_INFO "步骤6: 测试ant-javamail基本功能" - ant -version - CHECK_RESULT $? 0 0 "ant命令执行失败" - LOG_INFO "ant命令执行成功" - - # 步骤7: 如果测试前未安装,则在测试结束后卸载软件包 - if [ "$installed" = "false" ]; then - LOG_INFO "步骤7: 卸载 $package_name" - dnf remove -y $package_name - CHECK_RESULT $? 0 0 "卸载 $package_name 失败" - LOG_INFO "$package_name 卸载成功" - else - LOG_INFO "步骤7: 保持 $package_name 安装状态" - fi - - LOG_INFO "测试完成: ant-javamail软件包的错误处理功能测试通过" - } - - # 执行测试 - test_ant_javamail_error_handle -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ant/ant-javamail/test_ant-javamail_function_install.sh b/testcases/function_test/pkg_test/ant/ant-javamail/test_ant-javamail_function_install.sh deleted file mode 100644 index 17e2b017bfb..00000000000 --- a/testcases/function_test/pkg_test/ant/ant-javamail/test_ant-javamail_function_install.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-31 -# @License : Mulan PSL v2 -# @Desc : 测试ant-javamail软件包的安装功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装了ant-javamail软件包 - LOG_INFO "检查系统是否已安装ant-javamail软件包" - rpm -q ant-javamail > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "系统已安装ant-javamail软件包,标记为已安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "系统未安装ant-javamail软件包,标记为未安装状态" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否存在ant-javamail软件包 - LOG_INFO "检查yum源中是否存在ant-javamail软件包" - dnf list available ant-javamail > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在ant-javamail软件包" - exit 255 - fi - - # 如果未安装,则进行安装 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "开始安装ant-javamail软件包" - dnf install -y ant-javamail - CHECK_RESULT $? 0 0 "安装ant-javamail软件包失败" - LOG_INFO "ant-javamail软件包安装成功" - fi - - # 验证软件包是否成功安装 - LOG_INFO "验证ant-javamail软件包是否成功安装" - rpm -q ant-javamail > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证ant-javamail软件包安装失败" - - # 测试软件包的基本功能 - LOG_INFO "测试ant-javamail软件包的基本功能" - # 这里可以添加具体的功能测试命令,例如检查相关文件是否存在 - # 示例:检查ant-javamail的jar包是否存在 - ls /usr/share/java/ant-javamail*.jar > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "ant-javamail相关文件不存在" - - # 如果之前未安装,则在测试结束后卸载软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "测试完成,开始卸载ant-javamail软件包" - dnf remove -y ant-javamail - CHECK_RESULT $? 0 0 "卸载ant-javamail软件包失败" - LOG_INFO "ant-javamail软件包卸载成功,环境已恢复" - else - LOG_INFO "测试完成,保持ant-javamail软件包安装状态" - fi - - LOG_INFO "ant-javamail软件包安装功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ant/ant-javamail/test_ant-javamail_function_mail_receive.sh b/testcases/function_test/pkg_test/ant/ant-javamail/test_ant-javamail_function_mail_receive.sh deleted file mode 100644 index 2a622543479..00000000000 --- a/testcases/function_test/pkg_test/ant/ant-javamail/test_ant-javamail_function_mail_receive.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-31 -# @License : Mulan PSL v2 -# @Desc : 测试ant-javamail软件包的邮件接收功能 -# ############################################ - -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 expected=$2 - local error_code=$3 - local error_msg=$4 - if [ "$actual" -ne "$expected" ]; then - LOG_ERROR "$error_msg" - exit $error_code - fi - } - - # 定义SSH命令函数(虽然题目说无需定义,但实际需要声明) - SSH_CMD() { - local cmd=$1 - local node_ip=$2 - local node_password=$3 - local node_user=$4 - # 这里只是模拟,实际应根据SSH实现 - sshpass -p "$node_password" ssh -o StrictHostKeyChecking=no "${node_user}@${node_ip}" "$cmd" - } - - # 测试脚本开始 - LOG_INFO "开始测试 ant-javamail 软件包的邮件接收功能" - - # 检查是否已安装 ant-javamail - LOG_INFO "检查 ant-javamail 是否已安装" - if dnf list installed ant-javamail &>/dev/null; then - LOG_INFO "ant-javamail 已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "ant-javamail 未安装,将在测试前安装" - INSTALLED_BEFORE=false - fi - - # 检查 yum 源中是否有 ant-javamail 软件包 - LOG_INFO "检查 yum 源中是否有 ant-javamail 软件包" - if ! dnf list available ant-javamail &>/dev/null; then - LOG_ERROR "yum 源中未找到 ant-javamail 软件包" - exit 255 - fi - - # 如果未安装,则安装 ant-javamail - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装 ant-javamail 软件包" - dnf install -y ant-javamail - CHECK_RESULT $? 0 0 "安装 ant-javamail 失败" - fi - - # 测试邮件接收功能 - LOG_INFO "测试 ant-javamail 的邮件接收功能" - # 这里假设有一个测试邮件接收的命令或脚本,例如使用 Java 程序测试 - # 假设测试命令是 test-mail-receive,参数为 --test-receive - if ! command -v test-mail-receive &>/dev/null; then - LOG_ERROR "测试命令 test-mail-receive 不存在或不支持" - exit 255 - fi - - # 执行测试命令 - test-mail-receive --test-receive - CHECK_RESULT $? 0 0 "邮件接收功能测试失败" - - # 如果测试前未安装,则在测试结束后卸载 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载 ant-javamail 软件包" - dnf remove -y ant-javamail - CHECK_RESULT $? 0 0 "卸载 ant-javamail 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ant/ant-javamail/test_ant-javamail_function_mail_send.sh b/testcases/function_test/pkg_test/ant/ant-javamail/test_ant-javamail_function_mail_send.sh deleted file mode 100644 index b0cbe214782..00000000000 --- a/testcases/function_test/pkg_test/ant/ant-javamail/test_ant-javamail_function_mail_send.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-31 -# @License : Mulan PSL v2 -# @Desc : 测试ant-javamail软件包的邮件发送功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试ant-javamail软件包的邮件发送功能 - - # 检查是否已安装ant-javamail - LOG_INFO "检查是否已安装ant-javamail软件包" - rpm -q ant-javamail > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "ant-javamail已安装,测试完成后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "ant-javamail未安装,将在测试前安装" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否有ant-javamail软件包 - LOG_INFO "检查yum源中是否有ant-javamail软件包" - dnf search ant-javamail > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到ant-javamail软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到ant-javamail软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "开始安装ant-javamail软件包" - dnf install -y ant-javamail - CHECK_RESULT $? 0 0 "安装ant-javamail软件包失败" - fi - - # 检查邮件发送功能 - LOG_INFO "测试邮件发送功能" - # 模拟发送邮件的测试,这里使用一个简单的Java程序来测试 - cat > /tmp/TestMailSend.java << "EOF" - import javax.mail.*; - import javax.mail.internet.*; - import java.util.Properties; - - public class TestMailSend { - public static void main(String[] args) { - // 这里仅测试ant-javamail的类是否可用,不实际发送邮件 - System.out.println("ant-javamail邮件发送功能测试开始"); - - try { - // 测试相关类是否可加载 - Class.forName("javax.mail.Session"); - Class.forName("javax.mail.internet.MimeMessage"); - Class.forName("javax.mail.internet.InternetAddress"); - - System.out.println("ant-javamail相关类加载成功"); - System.out.println("邮件发送功能测试通过"); - } catch (ClassNotFoundException e) { - System.err.println("ant-javamail相关类加载失败: " + e.getMessage()); - System.exit(1); - } - } - } - EOF - - # 编译并运行测试程序 - LOG_INFO "编译测试Java程序" - javac -cp $(find /usr/share/java -name "mail.jar" -o -name "javax.mail.jar" | head -1) /tmp/TestMailSend.java - CHECK_RESULT $? 0 0 "编译测试程序失败" - - LOG_INFO "运行邮件发送功能测试" - java -cp /tmp:$(find /usr/share/java -name "mail.jar" -o -name "javax.mail.jar" | head -1) TestMailSend - CHECK_RESULT $? 0 0 "邮件发送功能测试失败" - - # 清理临时文件 - LOG_INFO "清理临时测试文件" - rm -f /tmp/TestMailSend.java /tmp/TestMailSend.class - - # 如果测试前未安装,则在测试后卸载 - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "测试完成,卸载ant-javamail软件包" - dnf remove -y ant-javamail - CHECK_RESULT $? 0 0 "卸载ant-javamail软件包失败" - else - LOG_INFO "测试完成,保持ant-javamail软件包安装状态" - fi - - LOG_INFO "ant-javamail邮件发送功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ant/ant-javamail/test_ant-javamail_function_send.sh b/testcases/function_test/pkg_test/ant/ant-javamail/test_ant-javamail_function_send.sh deleted file mode 100644 index ed100942298..00000000000 --- a/testcases/function_test/pkg_test/ant/ant-javamail/test_ant-javamail_function_send.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-06 -# @License : Mulan PSL v2 -# @Desc : 测试ant-javamail软件包的邮件发送功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查ant-javamail软件包是否已安装 - LOG_INFO "检查ant-javamail软件包是否已安装" - if dnf list installed ant-javamail &>/dev/null; then - LOG_INFO "ant-javamail软件包已安装" - INSTALLED=true - else - LOG_INFO "ant-javamail软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在ant-javamail软件包 - LOG_INFO "检查yum源中是否存在ant-javamail软件包" - if ! dnf list available ant-javamail &>/dev/null; then - LOG_ERROR "yum源中不存在ant-javamail软件包" - exit 255 - fi - - # 如果未安装则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装ant-javamail软件包" - dnf install -y ant-javamail - CHECK_RESULT $? 0 0 "安装ant-javamail软件包失败" - fi - - # 测试ant-javamail的邮件发送功能 - LOG_INFO "测试ant-javamail的邮件发送功能" - # 假设邮件发送命令为ant-javamail-send,参数为--to recipient@example.com --subject "Test" --body "Test email" - if ! ant-javamail-send --to recipient@example.com --subject "Test" --body "Test email" &>/dev/null; then - LOG_ERROR "邮件发送失败" - # 检查是否为参数错误 - if ! ant-javamail-send --help | grep -q -- "--to"; then - LOG_ERROR "参数--to不存在或不支持" - exit 255 - fi - CHECK_RESULT $? 1 0 "邮件发送失败" - fi - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载ant-javamail软件包" - dnf remove -y ant-javamail - CHECK_RESULT $? 0 0 "卸载ant-javamail软件包失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/ant/ant-javamail/test_ant-javamail_function_uninstall.sh b/testcases/function_test/pkg_test/ant/ant-javamail/test_ant-javamail_function_uninstall.sh deleted file mode 100644 index 03f8900abe6..00000000000 --- a/testcases/function_test/pkg_test/ant/ant-javamail/test_ant-javamail_function_uninstall.sh +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-31 -# @License : Mulan PSL v2 -# @Desc : 测试ant-javamail软件包的卸载功能 -# ############################################ - -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 exit_code=$3 - local message=$4 - if [ $actual -ne $expect ]; then - LOG_ERROR "$message" - exit $exit_code - fi - } - - # 定义远程执行函数 - SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=$4 - sshpass -p "$password" ssh -o StrictHostKeyChecking=no "${user}@${ip}" "$cmd" - } - - # 定义软件包名称 - PACKAGE_NAME="ant-javamail" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "步骤1:检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - - # 步骤2:检查当前环境是否已安装软件包 - LOG_INFO "步骤2:检查当前环境是否已安装软件包 $PACKAGE_NAME" - dnf list installed $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 - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:验证软件包安装成功 - LOG_INFO "步骤4:验证软件包 $PACKAGE_NAME 安装成功" - dnf list installed $PACKAGE_NAME > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "软件包 $PACKAGE_NAME 未正确安装" - - # 步骤5:测试卸载功能 - LOG_INFO "步骤5:测试卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - - # 步骤6:验证软件包已卸载 - LOG_INFO "步骤6:验证软件包 $PACKAGE_NAME 已卸载" - dnf list installed $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 卸载后仍然存在" - exit 1 - else - LOG_INFO "软件包 $PACKAGE_NAME 已成功卸载" - fi - - # 步骤7:环境恢复 - LOG_INFO "步骤7:环境恢复" - if [ "$INSTALLED_BEFORE" = true ]; then - LOG_INFO "恢复软件包 $PACKAGE_NAME 的安装状态" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "重新安装软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $PACKAGE_NAME 已恢复到安装状态" - else - LOG_INFO "环境已恢复到未安装状态,无需额外操作" - fi - - # 步骤8:最终验证 - LOG_INFO "步骤8:最终验证环境状态" - if [ "$INSTALLED_BEFORE" = true ]; then - dnf list installed $PACKAGE_NAME > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "环境恢复后软件包 $PACKAGE_NAME 未正确安装" - LOG_INFO "环境恢复成功,软件包 $PACKAGE_NAME 已安装" - else - dnf list installed $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "环境恢复后软件包 $PACKAGE_NAME 不应存在" - exit 1 - else - LOG_INFO "环境恢复成功,软件包 $PACKAGE_NAME 未安装" - fi - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apache-mina/apache-mina-mina-statemachine/test_apache-mina-mina-statemachine_function_action.sh b/testcases/function_test/pkg_test/apache-mina/apache-mina-mina-statemachine/test_apache-mina-mina-statemachine_function_action.sh deleted file mode 100644 index 90b089d1b99..00000000000 --- a/testcases/function_test/pkg_test/apache-mina/apache-mina-mina-statemachine/test_apache-mina-mina-statemachine_function_action.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-24 -# @License : Mulan PSL v2 -# @Desc : 测试状态机转换时执行的动作。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试状态机转换时执行的动作。" - - LOG_INFO "步骤1: 检查环境中是否已安装apache-mina-mina-statemachine软件包" - rpm -q apache-mina-mina-statemachine - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,脚本结束后将保持安装状态。" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试步骤中安装,并在脚本结束前卸载。" - INSTALLED=false - fi - - LOG_INFO "步骤2: 检查yum源中是否有apache-mina-mina-statemachine软件包" - dnf list available apache-mina-mina-statemachine &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到apache-mina-mina-statemachine软件包。" - exit 255 - fi - - LOG_INFO "步骤3: 安装apache-mina-mina-statemachine软件包" - if [ "$INSTALLED" = false ]; then - dnf install -y apache-mina-mina-statemachine - CHECK_RESULT $? 0 0 "安装apache-mina-mina-statemachine软件包失败。" - fi - - LOG_INFO "步骤4: 验证软件包安装成功" - rpm -q apache-mina-mina-statemachine - CHECK_RESULT $? 0 0 "验证软件包安装失败。" - - LOG_INFO "步骤5: 测试状态机转换时执行的动作" - # 这里假设有一个命令或方法来测试状态机转换动作,例如使用特定的测试命令 - # 由于实际命令未知,这里使用一个示例命令,实际应根据具体软件包调整 - test_command="some_state_machine_test_command" - if ! command -v $test_command &>/dev/null; then - LOG_ERROR "命令 $test_command 不存在或不支持。" - exit 255 - fi - $test_command - CHECK_RESULT $? 0 0 "状态机转换时执行的动作测试失败。" - - LOG_INFO "步骤6: 清理环境,恢复到之前的状态" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载在测试过程中安装的apache-mina-mina-statemachine软件包。" - dnf remove -y apache-mina-mina-statemachine - CHECK_RESULT $? 0 0 "卸载apache-mina-mina-statemachine软件包失败。" - else - LOG_INFO "软件包在测试前已安装,保持安装状态。" - fi - - LOG_INFO "测试完成:测试状态机转换时执行的动作。" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apache-mina/apache-mina-mina-statemachine/test_apache-mina-mina-statemachine_function_event.sh b/testcases/function_test/pkg_test/apache-mina/apache-mina-mina-statemachine/test_apache-mina-mina-statemachine_function_event.sh deleted file mode 100644 index 1d65e4349fe..00000000000 --- a/testcases/function_test/pkg_test/apache-mina/apache-mina-mina-statemachine/test_apache-mina-mina-statemachine_function_event.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-24 -# @License : Mulan PSL v2 -# @Desc : 测试状态机的事件触发与处理。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(根据要求直接使用,这里只是模拟定义) - LOG_INFO() { - echo "[INFO] $1" - } - LOG_ERROR() { - echo "[ERROR] $1" - } - - # 定义检查结果函数(根据要求直接使用) - CHECK_RESULT() { - local actual=$1 - local expected=$2 - local error_code=$3 - local message=$4 - if [ $actual -ne $expected ]; then - LOG_ERROR "$message" - exit $error_code - fi - } - - # 定义SSH_CMD函数(根据要求直接使用) - SSH_CMD() { - local cmd=$1 - local node_ip=$2 - local node_password=$3 - local node_user=$4 - # 模拟SSH执行命令(实际环境中需要根据具体SSH工具调整) - sshpass -p "$node_password" ssh -o StrictHostKeyChecking=no "$node_user@$node_ip" "$cmd" - } - - # 定义软件包名称 - PACKAGE_NAME="apache-mina-statemachine" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "步骤1:检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - - # 步骤2:检查环境是否已安装软件包 - LOG_INFO "步骤2:检查环境是否已安装软件包 $PACKAGE_NAME" - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 255 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:测试状态机的事件触发与处理(模拟测试步骤) - LOG_INFO "步骤4:测试状态机的事件触发与处理" - # 模拟执行状态机相关命令(这里使用示例命令,实际需要根据具体软件调整) - STATEMACHINE_CMD="statemachine-demo --event test" - $STATEMACHINE_CMD &>/dev/null - CHECK_RESULT $? 0 1 "状态机事件触发与处理测试失败" - - # 步骤5:清理环境(如果测试前未安装,则卸载软件包) - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤5:卸载软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 1 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "步骤5:环境已安装软件包,保持安装状态" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apache-mina/apache-mina-mina-statemachine/test_apache-mina-mina-statemachine_function_guard.sh b/testcases/function_test/pkg_test/apache-mina/apache-mina-mina-statemachine/test_apache-mina-mina-statemachine_function_guard.sh deleted file mode 100644 index 59d93cfa375..00000000000 --- a/testcases/function_test/pkg_test/apache-mina/apache-mina-mina-statemachine/test_apache-mina-mina-statemachine_function_guard.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-24 -# @License : Mulan PSL v2 -# @Desc : 测试状态机转换中的守卫条件。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试状态机转换中的守卫条件" - - # 检查软件包是否在yum源中 - LOG_INFO "检查apache-mina-mina-statemachine软件包是否在yum源中" - dnf list available apache-mina-mina-statemachine 2>/dev/null | grep -q apache-mina-mina-statemachine - if [ $? -ne 0 ]; then - LOG_ERROR "软件包apache-mina-mina-statemachine不在yum源中" - exit 255 - fi - - # 检查环境是否已安装 - LOG_INFO "检查环境是否已安装apache-mina-mina-statemachine" - rpm -q apache-mina-mina-statemachine >/dev/null 2>&1 - already_installed=$? - - if [ $already_installed -eq 0 ]; then - LOG_INFO "环境已安装apache-mina-mina-statemachine,测试后保持安装状态" - else - LOG_INFO "环境未安装apache-mina-mina-statemachine,开始安装" - dnf install -y apache-mina-mina-statemachine - CHECK_RESULT $? 0 0 "安装apache-mina-mina-statemachine失败" - fi - - # 检查命令参数是否存在 - LOG_INFO "检查状态机命令参数" - if ! command -v statemachine-tool >/dev/null 2>&1; then - LOG_ERROR "statemachine-tool命令不存在" - exit 255 - fi - - # 检查-guard参数是否支持 - LOG_INFO "检查-guard参数是否支持" - statemachine-tool --help 2>&1 | grep -q "\-\-guard" - if [ $? -ne 0 ]; then - LOG_ERROR "statemachine-tool不支持--guard参数" - exit 255 - fi - - # 执行状态机守卫条件测试 - LOG_INFO "执行状态机守卫条件测试" - statemachine-tool --guard test_condition - CHECK_RESULT $? 0 0 "状态机守卫条件测试失败" - - # 如果需要多服务器测试,示例: - # LOG_INFO "在第二个节点上执行状态机测试" - # SSH_CMD "statemachine-tool --guard test_condition" $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER - # CHECK_RESULT $? 0 0 "第二个节点状态机守卫条件测试失败" - - # 清理环境 - LOG_INFO "清理测试环境" - if [ $already_installed -ne 0 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y apache-mina-mina-statemachine - CHECK_RESULT $? 0 0 "卸载apache-mina-mina-statemachine失败" - else - LOG_INFO "保持原有安装状态,不卸载软件包" - fi - - LOG_INFO "状态机转换中的守卫条件测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apache-mina/apache-mina-mina-statemachine/test_apache-mina-mina-statemachine_function_nested.sh b/testcases/function_test/pkg_test/apache-mina/apache-mina-mina-statemachine/test_apache-mina-mina-statemachine_function_nested.sh deleted file mode 100644 index cacb2ad2dcc..00000000000 --- a/testcases/function_test/pkg_test/apache-mina/apache-mina-mina-statemachine/test_apache-mina-mina-statemachine_function_nested.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-24 -# @License : Mulan PSL v2 -# @Desc : 测试嵌套状态机的功能。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试嵌套状态机的功能" - - # 定义软件包名称 - PACKAGE_NAME="apache-mina-mina-statemachine" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "检查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 "检查系统是否已经安装软件包: $PACKAGE_NAME" - if rpm -q $PACKAGE_NAME &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已经安装,测试结束后保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试过程中安装" - INSTALLED_BEFORE=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装软件包: $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:测试嵌套状态机的基本功能 - LOG_INFO "测试嵌套状态机的基本功能" - # 这里假设有一个测试命令或脚本可以验证嵌套状态机的功能,例如运行一个示例程序 - # 假设示例程序为 test_nested_statemachine,如果不存在则退出 - if ! command -v test_nested_statemachine &>/dev/null; then - LOG_ERROR "测试命令 test_nested_statemachine 不存在或不支持" - exit 255 - fi - test_nested_statemachine --test-nested - CHECK_RESULT $? 0 0 "嵌套状态机功能测试失败" - - # 步骤5:如果需要,在第二个节点上执行测试(假设需要多节点测试) - LOG_INFO "在第二个节点上测试嵌套状态机功能" - SSH_CMD "test_nested_statemachine --test-nested" $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER - CHECK_RESULT $? 0 0 "在第二个节点上测试嵌套状态机功能失败" - - # 步骤6:清理环境,如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载软件包: $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "测试前软件包已安装,保持安装状态" - fi - - LOG_INFO "嵌套状态机功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apache-mina/apache-mina-mina-statemachine/test_apache-mina-mina-statemachine_function_state.sh b/testcases/function_test/pkg_test/apache-mina/apache-mina-mina-statemachine/test_apache-mina-mina-statemachine_function_state.sh deleted file mode 100644 index 0c8ca6452ec..00000000000 --- a/testcases/function_test/pkg_test/apache-mina/apache-mina-mina-statemachine/test_apache-mina-mina-statemachine_function_state.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-02 -# @License : Mulan PSL v2 -# @Desc : 测试状态机的基本状态转换功能。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试状态机的基本状态转换功能" - - # 检查是否已安装apache-mina-mina-statemachine软件包 - LOG_INFO "检查是否已安装apache-mina-mina-statemachine软件包" - if rpm -q apache-mina-mina-statemachine &>/dev/null; then - LOG_INFO "apache-mina-mina-statemachine已安装" - installed=true - else - LOG_INFO "apache-mina-mina-statemachine未安装" - installed=false - fi - - # 检查yum源中是否有apache-mina-mina-statemachine软件包 - LOG_INFO "检查yum源中是否有apache-mina-mina-statemachine软件包" - if ! dnf list available apache-mina-mina-statemachine &>/dev/null; then - LOG_ERROR "yum源中未找到apache-mina-mina-statemachine软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "开始安装apache-mina-mina-statemachine软件包" - dnf install -y apache-mina-mina-statemachine - CHECK_RESULT $? 0 0 "安装apache-mina-mina-statemachine失败" - fi - - # 测试状态机的基本状态转换功能 - LOG_INFO "测试状态机的基本状态转换功能" - # 假设测试命令为mina-statemachine-test,参数为--test-state-transition - if ! mina-statemachine-test --help | grep -q -- "--test-state-transition"; then - LOG_ERROR "--test-state-transition参数不支持" - exit 255 - fi - - mina-statemachine-test --test-state-transition - CHECK_RESULT $? 0 0 "状态机基本状态转换功能测试失败" - - # 清理环境,恢复到之前的状态 - if [ "$installed" = false ]; then - LOG_INFO "卸载apache-mina-mina-statemachine软件包" - dnf remove -y apache-mina-mina-statemachine - CHECK_RESULT $? 0 0 "卸载apache-mina-mina-statemachine失败" - fi - - LOG_INFO "测试状态机的基本状态转换功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/apache-mina/apache-mina-mina-statemachine/test_apache-mina-mina-statemachine_uninstall.sh b/testcases/function_test/pkg_test/apache-mina/apache-mina-mina-statemachine/test_apache-mina-mina-statemachine_uninstall.sh deleted file mode 100644 index 629f8d20d82..00000000000 --- a/testcases/function_test/pkg_test/apache-mina/apache-mina-mina-statemachine/test_apache-mina-mina-statemachine_uninstall.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-24 -# @License : Mulan PSL v2 -# @Desc : 测试软件包的卸载功能,验证卸载是否成功。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - PACKAGE_NAME="apache-mina-mina-statemachine" - LOG_INFO "开始测试软件包卸载功能" - LOG_INFO "检查软件包是否已在yum源中" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到软件包 $PACKAGE_NAME" - exit 255 - fi - LOG_INFO "检查当前环境中是否已安装该软件包" - 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 - LOG_INFO "安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - LOG_INFO "执行卸载操作" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包失败" - LOG_INFO "验证软件包是否已成功卸载" - rpm -q $PACKAGE_NAME &>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "软件包卸载失败,仍可查询到" - exit 1 - else - LOG_INFO "软件包卸载成功" - fi - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "清理环境:恢复软件包安装状态" - dnf install -y $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "环境恢复失败,未能重新安装软件包" - exit 1 - else - LOG_INFO "环境恢复完成,软件包已重新安装" - fi - else - LOG_INFO "环境清理:重新安装软件包以恢复原始状态" - dnf install -y $PACKAGE_NAME &>/dev/null - LOG_INFO "环境已恢复到测试前的安装状态" - fi - LOG_INFO "测试软件包卸载功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_build.sh b/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_build.sh deleted file mode 100644 index db1af87ae0a..00000000000 --- a/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_build.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-03 -# @License : Mulan PSL v2 -# @Desc : Test build process -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_artemis-pom_function_build - - LOG_INFO "开始测试构建过程" - - # 检查是否已安装软件包 - LOG_INFO "检查软件包是否已安装" - if dnf list installed artemis-pom &>/dev/null; then - LOG_INFO "软件包已安装,跳过安装步骤" - installed=true - else - LOG_INFO "软件包未安装,准备安装" - installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有artemis-pom软件包" - if ! dnf list available artemis-pom &>/dev/null; then - LOG_ERROR "yum源中未找到artemis-pom软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装artemis-pom软件包" - dnf install -y artemis-pom - CHECK_RESULT $? 0 0 "安装artemis-pom失败" - fi - - # 测试构建过程 - LOG_INFO "执行构建命令" - build_output=$(artemis-pom build) - CHECK_RESULT $? 0 0 "构建命令执行失败" - - # 检查构建输出是否符合预期 - LOG_INFO "检查构建输出" - if [[ "$build_output" != *"Build successful"* ]]; then - LOG_ERROR "构建输出不符合预期" - exit 1 - fi - - # 如果需要跨服务器执行命令 - LOG_INFO "在第二个服务器上执行命令(示例)" - SSH_CMD ls $NODE2_IPV4 $NODE2_PASSWORD $NODE2_USER > /dev/null - CHECK_RESULT $? 0 0 "在第二个服务器上执行命令失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载artemis-pom软件包" - dnf remove -y artemis-pom - CHECK_RESULT $? 0 0 "卸载artemis-pom失败" - fi - - LOG_INFO "测试构建过程完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_clean.sh b/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_clean.sh deleted file mode 100644 index c9a442ef467..00000000000 --- a/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_clean.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-27 -# @License : Mulan PSL v2 -# @Desc : Test cleaning build artifacts or cache -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:清理构建产物或缓存" - - # 检查环境是否已安装artemis-pom软件包 - LOG_INFO "步骤1:检查artemis-pom软件包是否已安装" - if dnf list installed artemis-pom &>/dev/null; then - LOG_INFO "artemis-pom软件包已安装,将保持安装状态" - INSTALLED=true - else - LOG_INFO "artemis-pom软件包未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查yum源中是否有artemis-pom软件包 - LOG_INFO "步骤2:检查yum源中是否存在artemis-pom软件包" - if ! dnf list available artemis-pom &>/dev/null; then - LOG_ERROR "yum源中未找到artemis-pom软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装artemis-pom软件包" - dnf install -y artemis-pom - CHECK_RESULT $? 0 0 "安装artemis-pom软件包失败" - fi - - # 检查artemis-pom命令是否支持clean参数 - LOG_INFO "步骤4:检查artemis-pom命令是否支持clean参数" - if ! artemis-pom --help | grep -q "clean"; then - LOG_ERROR "artemis-pom命令不支持clean参数" - exit 255 - fi - - # 执行清理构建产物或缓存的操作 - LOG_INFO "步骤5:执行清理构建产物或缓存的操作" - artemis-pom clean - CHECK_RESULT $? 0 0 "清理构建产物或缓存失败" - - # 如果测试前未安装,则在测试结束后卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤6:卸载artemis-pom软件包" - dnf remove -y artemis-pom - CHECK_RESULT $? 0 0 "卸载artemis-pom软件包失败" - fi - - LOG_INFO "测试完成:清理构建产物或缓存" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_conf.sh b/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_conf.sh deleted file mode 100644 index 301525d4505..00000000000 --- a/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_conf.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-03 -# @License : Mulan PSL v2 -# @Desc : Test configuration loading -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已经安装artemis-pom软件包 - LOG_INFO "检查artemis-pom软件包是否已安装" - if dnf list installed artemis-pom &>/dev/null; then - LOG_INFO "artemis-pom软件包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "artemis-pom软件包未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在artemis-pom软件包 - LOG_INFO "检查yum源中是否存在artemis-pom软件包" - if ! dnf list available artemis-pom &>/dev/null; then - LOG_ERROR "yum源中未找到artemis-pom软件包" - exit 255 - fi - - # 安装artemis-pom软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装artemis-pom软件包" - dnf install -y artemis-pom - CHECK_RESULT $? 0 0 "安装artemis-pom软件包失败" - fi - - # 测试配置加载功能 - LOG_INFO "测试配置加载功能" - artemis-pom --load-config - CHECK_RESULT $? 0 0 "配置加载失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载artemis-pom软件包" - dnf remove -y artemis-pom - CHECK_RESULT $? 0 0 "卸载artemis-pom软件包失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_dep.sh b/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_dep.sh deleted file mode 100644 index daf44e4d120..00000000000 --- a/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_dep.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : Test basic dependency resolution -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查软件包是否已安装 - if dnf list installed artemis-pom &>/dev/null; then - LOG_INFO "artemis-pom 已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "artemis-pom 未安装,测试完成后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否有artemis-pom软件包 - LOG_INFO "检查yum源中是否存在artemis-pom软件包" - if ! dnf list available artemis-pom &>/dev/null; then - LOG_ERROR "yum源中未找到artemis-pom软件包" - exit 255 - fi - - # 安装artemis-pom软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装artemis-pom软件包" - dnf install -y artemis-pom - CHECK_RESULT $? 0 0 "安装artemis-pom软件包失败" - fi - - # 测试基本依赖解析功能 - LOG_INFO "测试基本依赖解析功能" - command_to_test="artemis-pom --resolve-dependencies" - eval "$command_to_test" &>/dev/null - CHECK_RESULT $? 0 0 "依赖解析功能测试失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载artemis-pom软件包" - dnf remove -y artemis-pom - CHECK_RESULT $? 0 0 "卸载artemis-pom软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_help.sh b/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_help.sh deleted file mode 100644 index ebfe40f9fb8..00000000000 --- a/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_help.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-27 -# @License : Mulan PSL v2 -# @Desc : Test displaying help information -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="artemis-pom" - - # 步骤1: 检查软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在软件包: ${PACKAGE_NAME}" - dnf list available ${PACKAGE_NAME} &> /dev/null - CHECK_RESULT $? 0 0 "软件包 ${PACKAGE_NAME} 不在yum源中" - - # 步骤2: 检查软件包是否已安装 - LOG_INFO "检查软件包是否已安装" - rpm -q ${PACKAGE_NAME} &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为已安装状态" - INSTALLED="true" - else - LOG_INFO "软件包未安装,标记为未安装状态" - INSTALLED="false" - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "安装软件包: ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4: 测试显示帮助信息 - LOG_INFO "测试显示帮助信息" - artemis-pom --help &> /dev/null - CHECK_RESULT $? 0 0 "显示帮助信息失败" - - # 步骤5: 测试无效参数 - LOG_INFO "测试无效参数" - artemis-pom --invalid-parameter &> /dev/null - if [ $? -eq 255 ]; then - LOG_INFO "无效参数处理正确" - else - LOG_ERROR "无效参数处理错误" - exit 255 - fi - - # 步骤6: 环境恢复 - LOG_INFO "环境恢复" - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "卸载软件包: ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_install.sh b/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_install.sh deleted file mode 100644 index 2ee65aa9289..00000000000 --- a/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_install.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-27 -# @License : Mulan PSL v2 -# @Desc : Test installation of the artemis-pom package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试 artemis-pom 软件包安装功能" - - LOG_INFO "步骤1:检查当前环境是否已安装 artemis-pom 软件包" - if dnf list installed artemis-pom &>/dev/null; then - LOG_INFO "环境已安装 artemis-pom 软件包,测试将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "环境未安装 artemis-pom 软件包,将在测试中执行安装" - INSTALLED_BEFORE_TEST=false - fi - - LOG_INFO "步骤2:检查 yum 源中是否存在 artemis-pom 软件包" - if ! dnf list available artemis-pom &>/dev/null; then - LOG_ERROR "yum 源中未找到 artemis-pom 软件包" - exit 255 - fi - - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤3:安装 artemis-pom 软件包" - dnf install -y artemis-pom - CHECK_RESULT $? 0 0 "安装 artemis-pom 软件包失败" - fi - - LOG_INFO "步骤4:验证 artemis-pom 软件包是否成功安装" - dnf list installed artemis-pom - CHECK_RESULT $? 0 0 "验证 artemis-pom 软件包安装状态失败" - - LOG_INFO "步骤5:检查 artemis-pom 命令的基本功能" - if command -v artemis-pom &>/dev/null; then - LOG_INFO "artemis-pom 命令存在,尝试获取帮助信息" - if artemis-pom --help &>/dev/null; then - LOG_INFO "artemis-pom --help 命令执行成功" - else - LOG_ERROR "artemis-pom --help 命令执行失败,参数可能不支持" - exit 255 - fi - else - LOG_ERROR "artemis-pom 命令不存在" - exit 255 - fi - - LOG_INFO "步骤6:清理测试环境" - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "卸载测试安装的 artemis-pom 软件包" - dnf remove -y artemis-pom - CHECK_RESULT $? 0 0 "卸载 artemis-pom 软件包失败" - LOG_INFO "已恢复环境到测试前状态(未安装 artemis-pom)" - else - LOG_INFO "测试前已安装 artemis-pom,保持安装状态" - fi - - LOG_INFO "artemis-pom 软件包安装功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_list.sh b/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_list.sh deleted file mode 100644 index c18f8e79ae4..00000000000 --- a/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_list.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-27 -# @License : Mulan PSL v2 -# @Desc : Test listing available commands or features -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test listing available commands or features" - - # 步骤1: 检查环境是否已经安装artemis-pom软件包 - LOG_INFO "步骤1: 检查artemis-pom软件包是否已安装" - if rpm -q artemis-pom &> /dev/null; then - LOG_INFO "artemis-pom软件包已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "artemis-pom软件包未安装,将在测试步骤中安装" - INSTALLED_BEFORE_TEST=false - fi - - # 步骤2: 检查yum源中是否有artemis-pom软件包 - LOG_INFO "步骤2: 检查yum源中是否有artemis-pom软件包" - if ! dnf list available artemis-pom &> /dev/null; then - LOG_ERROR "yum源中未找到artemis-pom软件包" - exit 255 - fi - - # 步骤3: 如果未安装,则安装artemis-pom软件包 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤3: 安装artemis-pom软件包" - dnf install -y artemis-pom - CHECK_RESULT $? 0 0 "安装artemis-pom软件包失败" - fi - - # 步骤4: 测试列出可用命令或功能(假设artemis-pom命令为artemis-pom --list) - LOG_INFO "步骤4: 执行artemis-pom --list命令,列出可用命令或功能" - if ! artemis-pom --help 2>&1 | grep -q "\-\-list"; then - LOG_ERROR "artemis-pom命令不支持--list参数" - exit 255 - fi - - artemis-pom --list - CHECK_RESULT $? 0 0 "执行artemis-pom --list命令失败" - - # 步骤5: 清理环境,如果测试前未安装,则卸载软件包 - LOG_INFO "步骤5: 清理测试环境" - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "卸载artemis-pom软件包" - dnf remove -y artemis-pom - CHECK_RESULT $? 0 0 "卸载artemis-pom软件包失败" - else - LOG_INFO "测试前已安装artemis-pom,保持安装状态" - fi - - LOG_INFO "测试完成:Test listing available commands or features" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_plugin.sh b/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_plugin.sh deleted file mode 100644 index 52037b1319d..00000000000 --- a/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_plugin.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-03 -# @License : Mulan PSL v2 -# @Desc : Test plugin integration -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试插件集成功能" - - # 检查是否已安装软件包 - LOG_INFO "检查环境是否已安装artemis-pom_function_plugin" - if dnf list installed artemis-pom_function_plugin &>/dev/null; then - LOG_INFO "环境已安装artemis-pom_function_plugin,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "环境未安装artemis-pom_function_plugin,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否存在artemis-pom_function_plugin" - if ! dnf list available artemis-pom_function_plugin &>/dev/null; then - LOG_ERROR "yum源中不存在artemis-pom_function_plugin,退出测试" - exit 255 - fi - - # 若未安装则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装artemis-pom_function_plugin" - dnf install -y artemis-pom_function_plugin - CHECK_RESULT $? 0 0 "安装artemis-pom_function_plugin失败" - fi - - # 测试插件功能 - LOG_INFO "测试插件功能" - some_command --parameter value # 替换为实际命令和参数 - CHECK_RESULT $? 0 0 "插件功能测试失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载artemis-pom_function_plugin" - dnf remove -y artemis-pom_function_plugin - CHECK_RESULT $? 0 0 "卸载artemis-pom_function_plugin失败" - fi - - LOG_INFO "插件集成功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_uninstall.sh b/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_uninstall.sh deleted file mode 100644 index 88842e25c9c..00000000000 --- a/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_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-02-27 -# @License : Mulan PSL v2 -# @Desc : Test uninstallation of the artemis-pom package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装artemis-pom软件包 - LOG_INFO "检查artemis-pom软件包是否已安装" - rpm -q artemis-pom &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "artemis-pom软件包已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "artemis-pom软件包未安装,将在测试过程中安装并卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有artemis-pom软件包 - LOG_INFO "检查yum源中是否有artemis-pom软件包" - dnf list available artemis-pom &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到artemis-pom软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装artemis-pom软件包" - dnf install -y artemis-pom - CHECK_RESULT $? 0 0 "安装artemis-pom软件包失败" - fi - - # 测试卸载功能 - LOG_INFO "测试卸载artemis-pom软件包" - dnf remove -y artemis-pom - CHECK_RESULT $? 0 0 "卸载artemis-pom软件包失败" - - # 验证软件包是否已卸载 - LOG_INFO "验证artemis-pom软件包是否已卸载" - rpm -q artemis-pom &>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "artemis-pom软件包卸载后仍存在" - exit 1 - else - LOG_INFO "artemis-pom软件包已成功卸载" - fi - - # 如果测试前未安装,则重新安装以恢复环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "恢复环境:重新安装artemis-pom软件包" - dnf install -y artemis-pom - CHECK_RESULT $? 0 0 "恢复环境时安装artemis-pom软件包失败" - else - LOG_INFO "环境已恢复至初始安装状态" - fi - - LOG_INFO "artemis-pom软件包卸载功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_update.sh b/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_update.sh deleted file mode 100644 index a4e14bf209d..00000000000 --- a/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_update.sh +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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 : Test updating the package to the latest version -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境变量设置 - SCRIPT_NAME="test_artemis-pom_function_update" - PACKAGE_NAME="artemis-pom" - - # 日志函数(直接使用) - LOG_INFO() { - echo "[INFO] $1" - } - - LOG_ERROR() { - echo "[ERROR] $1" >&2 - } - - # 检查软件包是否在yum源中 - check_package_in_repo() { - LOG_INFO "检查yum源中是否存在软件包: $PACKAGE_NAME" - dnf list available $PACKAGE_NAME --quiet 2>/dev/null - return $? - } - - # 检查是否已安装 - check_installed() { - LOG_INFO "检查软件包是否已安装: $PACKAGE_NAME" - rpm -q $PACKAGE_NAME >/dev/null 2>&1 - return $? - } - - # 安装软件包 - install_package() { - LOG_INFO "安装软件包: $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME --quiet - CHECK_RESULT $? 0 0 "安装软件包失败" - } - - # 卸载软件包 - uninstall_package() { - LOG_INFO "卸载软件包: $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME --quiet - CHECK_RESULT $? 0 0 "卸载软件包失败" - } - - # 更新软件包到最新版本 - update_package() { - LOG_INFO "更新软件包到最新版本: $PACKAGE_NAME" - dnf update -y $PACKAGE_NAME --quiet - CHECK_RESULT $? 0 0 "更新软件包失败" - } - - # 检查更新是否成功 - check_update_result() { - LOG_INFO "验证软件包是否已更新到最新版本" - current_version=$(rpm -q $PACKAGE_NAME --queryformat="%{VERSION}-%{RELEASE}") - dnf check-update $PACKAGE_NAME --quiet 2>/dev/null - - if [ $? -eq 0 ]; then - LOG_INFO "软件包已是最新版本: $current_version" - return 0 - else - LOG_ERROR "软件包更新失败或仍有可用更新" - return 1 - fi - } - - # 主测试函数 - main() { - LOG_INFO "开始测试: Test updating the package to the latest version" - - # 步骤1: 检查yum源中是否有该软件包 - check_package_in_repo - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在软件包: $PACKAGE_NAME" - exit 255 - fi - - # 记录初始安装状态 - check_installed - initial_installed=$? - - # 如果未安装,则安装作为测试步骤 - if [ $initial_installed -ne 0 ]; then - LOG_INFO "环境未安装软件包,开始安装测试" - install_package - need_cleanup=1 - else - LOG_INFO "环境已安装软件包,保持安装状态进行测试" - need_cleanup=0 - fi - - # 步骤2: 测试更新软件包到最新版本 - update_package - - # 步骤3: 验证更新结果 - check_update_result - CHECK_RESULT $? 0 0 "更新验证失败" - - LOG_INFO "测试步骤执行完成" - - # 环境清理 - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "清理测试环境,卸载安装的软件包" - uninstall_package - - # 验证卸载是否成功 - check_installed - if [ $? -eq 0 ]; then - LOG_ERROR "软件包卸载失败" - exit 1 - else - LOG_INFO "环境已恢复到初始未安装状态" - fi - else - LOG_INFO "保持环境安装状态,无需清理" - fi - - LOG_INFO "测试完成: Test updating the package to the latest version" - } - - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_version.sh b/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_function_version.sh deleted file mode 100644 index e503a61c1af..00000000000 --- a/testcases/function_test/pkg_test/artemis/artemis-pom/test_artemis-pom_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-02-27 -# @License : Mulan PSL v2 -# @Desc : Test displaying package version -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test displaying package version" - LOG_INFO "步骤1:检查当前环境中是否已安装artemis-pom软件包" - if dnf list installed artemis-pom > /dev/null 2>&1; then - LOG_INFO "artemis-pom软件包已安装,测试结束后将保持安装状态" - INSTALLED="true" - else - LOG_INFO "artemis-pom软件包未安装,将在测试步骤中安装" - INSTALLED="false" - fi - - LOG_INFO "步骤2:检查yum源中是否存在artemis-pom软件包" - if ! dnf list available artemis-pom > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到artemis-pom软件包" - exit 255 - fi - - LOG_INFO "步骤3:检查artemis-pom命令是否支持--version参数" - if ! dnf info artemis-pom | grep -q "Version"; then - LOG_ERROR "artemis-pom软件包不支持--version参数" - exit 255 - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤4:安装artemis-pom软件包" - dnf install -y artemis-pom - CHECK_RESULT $? 0 0 "安装artemis-pom软件包失败" - fi - - LOG_INFO "步骤5:执行artemis-pom --version命令查看版本信息" - artemis-pom --version - CHECK_RESULT $? 0 0 "执行artemis-pom --version命令失败" - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤6:卸载artemis-pom软件包,恢复环境" - dnf remove -y artemis-pom - CHECK_RESULT $? 0 0 "卸载artemis-pom软件包失败" - fi - - LOG_INFO "测试完成:Test displaying package version" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/bcc/bcc-lua/test_bcc-lua_bcc-lua__upper_verbose.sh b/testcases/function_test/pkg_test/bcc/bcc-lua/test_bcc-lua_bcc-lua__upper_verbose.sh deleted file mode 100644 index b34a3070a2e..00000000000 --- a/testcases/function_test/pkg_test/bcc/bcc-lua/test_bcc-lua_bcc-lua__upper_verbose.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-02 -# @License : Mulan PSL v2 -# @Desc : 测试 bcc-lua 命令的 --verbose 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 bcc-lua 命令的 --verbose 参数" - - # 检查是否已安装 bcc-lua - LOG_INFO "检查 bcc-lua 是否已安装" - if ! dnf list installed bcc-lua &>/dev/null; then - LOG_INFO "bcc-lua 未安装,将进行安装" - INSTALLED=false - else - LOG_INFO "bcc-lua 已安装" - INSTALLED=true - fi - - # 检查 yum 源中是否有 bcc-lua - LOG_INFO "检查 yum 源中是否有 bcc-lua" - if ! dnf list available bcc-lua &>/dev/null; then - LOG_ERROR "yum 源中未找到 bcc-lua 软件包" - exit 255 - fi - - # 如果未安装,则安装 bcc-lua - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 bcc-lua" - dnf install -y bcc-lua - CHECK_RESULT $? 0 0 "安装 bcc-lua 失败" - fi - - # 检查 --verbose 参数是否支持 - LOG_INFO "检查 --verbose 参数是否支持" - if ! bcc-lua --help | grep -q -- "--verbose"; then - LOG_ERROR "bcc-lua 命令不支持 --verbose 参数" - exit 255 - fi - - # 执行带 --verbose 参数的 bcc-lua 命令 - LOG_INFO "执行带 --verbose 参数的 bcc-lua 命令" - bcc-lua --verbose - CHECK_RESULT $? 0 0 "执行 bcc-lua --verbose 失败" - - # 恢复环境:如果之前未安装,则卸载 bcc-lua - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 bcc-lua" - dnf remove -y bcc-lua - CHECK_RESULT $? 0 0 "卸载 bcc-lu a失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/bcc/bcc-lua/test_bcc-lua_bcc-lua__upper_version.sh b/testcases/function_test/pkg_test/bcc/bcc-lua/test_bcc-lua_bcc-lua__upper_version.sh deleted file mode 100644 index dac271accce..00000000000 --- a/testcases/function_test/pkg_test/bcc/bcc-lua/test_bcc-lua_bcc-lua__upper_version.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-02 -# @License : Mulan PSL v2 -# @Desc : 测试 bcc-lua 命令的 --version 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 bcc-lua 命令的 --version 参数" - - # 检查是否已安装 bcc-lua - if dnf list installed bcc-lua &>/dev/null; then - LOG_INFO "bcc-lua 已安装,测试结束后将保持安装状态" - already_installed=true - else - LOG_INFO "bcc-lua 未安装,测试结束后将卸载" - already_installed=false - fi - - # 检查 yum 源中是否有 bcc-lua 软件包 - if ! dnf list available bcc-lua &>/dev/null; then - LOG_ERROR "yum 源中未找到 bcc-lua 软件包" - exit 255 - fi - - # 如果未安装,则安装 bcc-lua - if [ "$already_installed" = false ]; then - LOG_INFO "正在安装 bcc-lua" - dnf install -y bcc-lua - CHECK_RESULT $? 0 0 "安装 bcc-lua 失败" - fi - - # 测试 bcc-lua --version 参数 - LOG_INFO "测试 bcc-lua --version 参数" - bcc-lua --version - CHECK_RESULT $? 0 0 "执行 bcc-lua --version 失败" - - # 如果之前未安装,则卸载 bcc-lua - if [ "$already_installed" = false ]; then - LOG_INFO "正在卸载 bcc-lua" - dnf remove -y bcc-lua - CHECK_RESULT $? 0 0 "卸载 bcc-lua 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/bcc/bcc-lua/test_bcc-lua_bcc-lua__verbose.sh b/testcases/function_test/pkg_test/bcc/bcc-lua/test_bcc-lua_bcc-lua__verbose.sh deleted file mode 100644 index 8a3361055a1..00000000000 --- a/testcases/function_test/pkg_test/bcc/bcc-lua/test_bcc-lua_bcc-lua__verbose.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : 测试 bcc-lua 命令的 --verbose 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 bcc-lua 命令的 --verbose 参数" - - # 检查是否已安装 bcc-lua - LOG_INFO "检查 bcc-lua 是否已安装" - if dnf list installed bcc-lua &>/dev/null; then - LOG_INFO "bcc-lua 已安装,测试结束后将保持安装状态" - installed=true - else - LOG_INFO "bcc-lua 未安装,测试结束后将卸载" - installed=false - fi - - # 检查 yum 源中是否有 bcc-lua 软件包 - LOG_INFO "检查 yum 源中是否有 bcc-lua" - if ! dnf list available bcc-lua &>/dev/null; then - LOG_ERROR "yum 源中未找到 bcc-lua 软件包" - exit 255 - fi - - # 如果未安装则安装 bcc-lua - if [ "$installed" = false ]; then - LOG_INFO "安装 bcc-lua" - dnf install -y bcc-lua - CHECK_RESULT $? 0 0 "安装 bcc-lua 失败" - fi - - # 测试 --verbose 参数 - LOG_INFO "测试 bcc-lua --verbose" - bcc-lua --verbose &>/dev/null - CHECK_RESULT $? 0 0 "--verbose 参数不支持或执行失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载 bcc-lua" - dnf remove -y bcc-lua - CHECK_RESULT $? 0 0 "卸载 bcc-lua 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/bcc/bcc-lua/test_bcc-lua_bcc-lua_path_to_script_lua.sh b/testcases/function_test/pkg_test/bcc/bcc-lua/test_bcc-lua_bcc-lua_path_to_script_lua.sh deleted file mode 100644 index 77c715e7425..00000000000 --- a/testcases/function_test/pkg_test/bcc/bcc-lua/test_bcc-lua_bcc-lua_path_to_script_lua.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : 测试 bcc-lua 命令的 path_to_script.lua 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 bcc-lua 命令的 path_to_script.lua 参数" - - # 检查是否已安装 bcc-lua - LOG_INFO "检查是否已安装 bcc-lua" - if ! dnf list installed bcc-lua &>/dev/null; then - LOG_INFO "bcc-lua 未安装,开始安装" - if ! dnf list available bcc-lua &>/dev/null; then - LOG_ERROR "yum 源中未找到 bcc-lua 软件包" - exit 255 - fi - dnf install -y bcc-lua - CHECK_RESULT $? 0 0 "安装 bcc-lua 失败" - INSTALLED=1 - else - LOG_INFO "bcc-lua 已安装,跳过安装步骤" - INSTALLED=0 - fi - - # 检查 path_to_script.lua 参数是否存在 - LOG_INFO "检查 path_to_script.lua 参数是否支持" - if ! bcc-lua --help | grep -q "path_to_script.lua"; then - LOG_ERROR "bcc-lua 不支持 path_to_script.lua 参数" - if [ $INSTALLED -eq 1 ]; then - dnf remove -y bcc-lua - CHECK_RESULT $? 0 0 "卸载 bcc-lua 失败" - fi - exit 255 - fi - - # 执行测试命令 - LOG_INFO "执行测试命令:bcc-lua path_to_script.lua test_script.lua" - bcc-lua path_to_script.lua test_script.lua - CHECK_RESULT $? 0 0 "执行 bcc-lua path_to_script.lua 失败" - - # 清理环境(如果脚本开始时未安装) - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "清理环境,卸载 bcc-lue" - dnf remove -y bcc-lua - CHECK_RESULT $? 0 0 "卸载 bcc-luea失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/bcc/bcc-lua/test_bcc-lua_function_load.sh b/testcases/function_test/pkg_test/bcc/bcc-lua/test_bcc-lua_function_load.sh deleted file mode 100644 index 385c979159b..00000000000 --- a/testcases/function_test/pkg_test/bcc/bcc-lua/test_bcc-lua_function_load.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-29 -# @License : Mulan PSL v2 -# @Desc : 测试 bcc-lua 的脚本加载功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装bcc-lua - LOG_INFO "检查是否已安装bcc-lua" - if ! dnf list installed bcc-lua &>/dev/null; then - LOG_INFO "bcc-lua未安装,将进行安装" - INSTALLED=1 - else - LOG_INFO "bcc-lua已安装" - INSTALLED=0 - fi - - # 检查yum源中是否有bcc-lua软件包 - LOG_INFO "检查yum源中是否有bcc-lua软件包" - if ! dnf list available bcc-lua &>/dev/null; then - LOG_ERROR "yum源中未找到bcc-lua软件包" - exit 255 - fi - - # 安装bcc-lua(如果未安装) - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "开始安装bcc-lua" - dnf install -y bcc-lua - CHECK_RESULT $? 0 0 "安装bcc-lua失败" - fi - - # 测试bcc-lua脚本加载功能 - LOG_INFO "测试bcc-lua脚本加载功能" - if ! bpftrace -l "usdt:*" &>/dev/null; then - LOG_ERROR "bpftrace命令不支持或参数错误" - exit 255 - fi - - # 执行测试命令并检查结果 - LOG_INFO "执行测试命令并检查结果" - bpftrace -e "tracepoint:syscalls:sys_enter_openat { printf("%s %s\n", comm, str(args->filename)); }" & - PID=$! - sleep 2 - kill $PID - CHECK_RESULT $? 0 0 "执行bpftrace命令失败" - - # 清理环境(如果之前未安装) - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "卸载bcc-lua" - dnf remove -y bcc-lua - CHECK_RESULT $? 0 0 "卸载bcc-lua失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/bcc/bcc-lua/test_bcc-lua_function_script_exec.sh b/testcases/function_test/pkg_test/bcc/bcc-lua/test_bcc-lua_function_script_exec.sh deleted file mode 100644 index 28a58bfcf19..00000000000 --- a/testcases/function_test/pkg_test/bcc/bcc-lua/test_bcc-lua_function_script_exec.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-02 -# @License : Mulan PSL v2 -# @Desc : 测试 bcc-lua 脚本执行功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装bcc-lua软件包 - LOG_INFO "检查是否已安装bcc-lua软件包" - if rpm -q bcc-lua &>/dev/null; then - LOG_INFO "bcc-lua已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "bcc-lua未安装,将在测试步骤中安装" - installed=false - fi - - # 检查yum源中是否存在bcc-lua软件包 - LOG_INFO "检查yum源中是否存在bcc-lua软件包" - if ! dnf list available bcc-lua &>/dev/null; then - LOG_ERROR "yum源中不存在bcc-lua软件包" - exit 255 - fi - - # 如果未安装,则安装bcc-lua - if [ "$installed" = false ]; then - LOG_INFO "正在安装bcc-lua软件包" - dnf install -y bcc-lua - CHECK_RESULT $? 0 0 "安装bcc-lua失败" - fi - - # 测试bcc-lua脚本执行功能 - LOG_INFO "测试bcc-lua脚本执行功能" - if ! command -v bpftrace &>/dev/null; then - LOG_ERROR "bpftrace命令不存在或不支持" - exit 255 - fi - - # 执行示例命令 - LOG_INFO "执行示例命令:bpftrace -l "tracepoint:syscalls:sys_enter_openat"" - bpftrace -l "tracepoint:syscalls:sys_enter_openat" - CHECK_RESULT $? 0 0 "执行bpftrace命令失败" - - # 清理环境:如果脚本开始时未安装,则卸载bcc-lua - if [ "$installed" = false ]; then - LOG_INFO "卸载bcc-lua软件包" - dnf remove -y bcc-lua - CHECK_RESULT $? 0 0 "卸载bcc-lua失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_awk_--file.sh b/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_awk_--file.sh deleted file mode 100644 index a9d863cbfdb..00000000000 --- a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_awk_--file.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-08-03 -# @License : Mulan PSL v2 -# @Desc : 使用 --file 参数指定程序文件(GNU长选项) -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装gawk - LOG_INFO "检查是否已安装gawk" - rpm -q gawk > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "gawk已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "gawk未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有gawk包 - LOG_INFO "检查yum源中是否有gawk包" - dnf list available gawk > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到gawk包" - exit 255 - fi - - # 安装gawk(如果未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装gawk" - dnf install -y gawk - CHECK_RESULT $? 0 0 "安装gawk失败" - fi - - # 创建测试用的AWK程序文件 - LOG_INFO "创建测试用的AWK程序文件" - cat > test_program.awk < output.txt 2>&1 - CHECK_RESULT $? 0 0 "执行gawk --file失败" - - # 检查输出是否符合预期 - LOG_INFO "检查输出是否符合预期" - grep -q "Hello, AWK!" output.txt - CHECK_RESULT $? 0 0 "输出不符合预期" - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f test_program.awk output.txt - - # 卸载gawk(如果脚本开始时未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载gawk" - dnf remove -y gawk - CHECK_RESULT $? 0 0 "卸载gawk失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_awk_-d.sh b/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_awk_-d.sh deleted file mode 100644 index 8fe60f29732..00000000000 --- a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_awk_-d.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-08-03 -# @License : Mulan PSL v2 -# @Desc : 使用 -d 参数导出变量到文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 测试脚本:test_gawk-lang_awk_-d - - # 步骤1:检查是否已安装gawk软件包 - LOG_INFO "检查是否已安装gawk软件包" - if ! dnf list installed gawk &> /dev/null; then - LOG_INFO "gawk未安装,将进行安装" - INSTALLED=false - else - LOG_INFO "gawk已安装" - INSTALLED=true - fi - - # 步骤2:检查yum源中是否有gawk软件包 - LOG_INFO "检查yum源中是否有gawk软件包" - if ! dnf list available gawk &> /dev/null; then - LOG_ERROR "yum源中未找到gawk软件包" - exit 255 - fi - - # 步骤3:如果未安装,则安装gawk - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装gawk软件包" - dnf install -y gawk - CHECK_RESULT $? 0 0 "安装gawk失败" - fi - - # 步骤4:测试-d参数导出变量到文件 - LOG_INFO "测试-d参数导出变量到文件" - TEST_FILE="/tmp/gawk_test_file.txt" - TEST_VAR="test_variable=123" - - # 使用-d参数导出变量到文件 - LOG_INFO "执行命令:gawk -d "$TEST_VAR" > $TEST_FILE" - gawk -d "$TEST_VAR" > "$TEST_FILE" - CHECK_RESULT $? 0 0 "执行gawk -d命令失败" - - # 检查文件是否存在且内容正确 - LOG_INFO "检查导出的文件是否存在且内容正确" - if [ ! -f "$TEST_FILE" ]; then - LOG_ERROR "导出的文件不存在" - exit 1 - fi - - FILE_CONTENT=$(cat "$TEST_FILE") - if [ "$FILE_CONTENT" != "$TEST_VAR" ]; then - LOG_ERROR "导出的文件内容不正确" - exit 1 - fi - - # 步骤5:清理测试文件 - LOG_INFO "清理测试文件" - rm -f "$TEST_FILE" - CHECK_RESULT $? 0 0 "删除测试文件失败" - - # 步骤6:如果之前未安装,则卸载gawk以恢复环境状态(避免破坏性动作) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载临时安装的gawk软件包以恢复环境状态" - dnf remove -y gawk - CHECK_RESULT $? 0 0 "卸载gawk失败" - else - LOG_INFO "保持原环境状态(不卸载已存在的软件包)" - fi - - LOG_INFO "测试脚本执行完毕,所有步骤均已完成验证。环境状态已恢复。" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_awk_-f.sh b/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_awk_-f.sh deleted file mode 100644 index 70293e8d5fc..00000000000 --- a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_awk_-f.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-08-03 -# @License : Mulan PSL v2 -# @Desc : 使用 -f 参数指定程序文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装gawk - LOG_INFO "检查是否已安装gawk" - rpm -q gawk > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "gawk已安装,脚本结束时保持安装状态" - INSTALLED=1 - else - LOG_INFO "gawk未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有gawk软件包 - LOG_INFO "检查yum源中是否有gawk软件包" - dnf list available gawk > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到gawk软件包" - exit 255 - fi - - # 安装gawk软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "正在安装gawk软件包" - dnf install -y gawk > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装gawk失败" - fi - - # 创建测试用的AWK程序文件 - LOG_INFO "创建测试用的AWK程序文件" - cat < test.awk - BEGIN { print "Hello, AWK!" } - EOF - CHECK_RESULT $? 0 0 "创建AWK程序文件失败" - - # 使用-f参数执行AWK程序 - LOG_INFO "使用-f参数执行AWK程序" - gawk -f test.awk > output.txt 2>&1 - CHECK_RESULT $? 0 0 "执行AWK程序失败" - - # 检查输出结果是否符合预期 - LOG_INFO "检查输出结果是否符合预期" - grep "Hello, AWK!" output.txt > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "输出结果不符合预期" - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f test.awk output.txt - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 如果脚本开始时未安装gawk,则在结束时卸载 - if [ $INSTALLED -eq -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_function_basic_usage.sh b/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_function_basic_usage.sh deleted file mode 100644 index e85f7ef25ee..00000000000 --- a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_function_basic_usage.sh +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-31 -# @License : Mulan PSL v2 -# @Desc : 测试gawk基本文本处理功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色输出函数(如果未定义) - if ! command -v LOG_INFO &> /dev/null; then - LOG_INFO() { echo "[INFO] $*"; } - fi - if ! command -v LOG_ERROR &> /dev/null; then - LOG_ERROR() { echo "[ERROR] $*"; } - fi - - # 检查命令是否存在 - check_command() { - if ! command -v "$1" &> /dev/null; then - LOG_ERROR "命令 $1 不存在" - exit 255 - fi - } - - # 检查软件包是否在yum源中 - check_package_in_repo() { - if ! dnf list available "$1" &> /dev/null; then - LOG_ERROR "软件包 $1 不在yum源中" - exit 255 - fi - } - - # 检查参数是否支持 - check_param_support() { - local cmd=$1 - shift - if ! $cmd "$@" --help &> /dev/null; then - LOG_ERROR "命令 $cmd 不支持参数: $*" - exit 255 - fi - } - - # 主测试函数 - test_gawk_basic_usage() { - local package_name="gawk" - local installed=false - - # 步骤1:检查环境是否已安装gawk - LOG_INFO "步骤1:检查环境是否已安装gawk" - if command -v gawk &> /dev/null; then - LOG_INFO "gawk 已安装,跳过安装步骤" - installed=true - else - LOG_INFO "gawk 未安装,准备安装" - check_package_in_repo "$package_name" - LOG_INFO "安装 gawk" - dnf install -y "$package_name" - CHECK_RESULT $? 0 0 "安装gawk失败" - installed=false - fi - - # 步骤2:测试gawk基本文本处理功能 - LOG_INFO "步骤2:测试gawk基本文本处理功能" - - # 创建测试文件 - local test_file="/tmp/test_gawk.txt" - cat > "$test_file" << EOF - apple 10 - banana 20 - cherry 30 - EOF - - # 测试1:打印文件内容 - LOG_INFO "测试1:打印文件内容" - gawk "{print $1, $2}" "$test_file" - CHECK_RESULT $? 0 0 "gawk打印文件内容失败" - - # 测试2:计算总和 - LOG_INFO "测试2:计算第二列总和" - local sum=$(gawk "{sum+=$2} END {print sum}" "$test_file") - CHECK_RESULT $? 0 0 "gawk计算总和失败" - LOG_INFO "第二列总和为: $sum" - if [ "$sum" -eq 60 ]; then - LOG_INFO "总和计算正确" - else - LOG_ERROR "总和计算错误,预期60,实际$sum" - exit 1 - fi - - # 测试3:条件过滤 - LOG_INFO "测试3:过滤第二列大于15的行" - gawk "$2 > 15 {print $1, $2}" "$test_file" - CHECK_RESULT $? 0 0 "gawk条件过滤失败" - - # 测试4:检查不支持的参数(示例) - LOG_INFO "测试4:检查不支持的参数" - check_param_support gawk --invalid-param - - # 清理测试文件 - rm -f "$test_file" - - # 步骤3:环境恢复 - LOG_INFO "步骤3:环境恢复" - if [ "$installed" = false ]; then - LOG_INFO "卸载 gawk" - dnf remove -y "$package_name" - CHECK_RESULT $? 0 0 "卸载gawk失败" - else - LOG_INFO "保持gawk安装状态" - fi - - LOG_INFO "测试完成" - } - - # 执行测试 - test_gawk_basic_usage -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_function_builtin_vars.sh b/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_function_builtin_vars.sh deleted file mode 100644 index d2a4bacd265..00000000000 --- a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_function_builtin_vars.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-01-31 -# @License : Mulan PSL v2 -# @Desc : 测试gawk内置变量(如NR,NF) -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断gawk是否已经安装 - LOG_INFO "检查gawk是否已经安装" - if rpm -q gawk &> /dev/null; then - LOG_INFO "gawk已经安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "gawk未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查yum源中是否有gawk软件包 - LOG_INFO "检查yum源中是否有gawk软件包" - if ! dnf list available gawk &> /dev/null; then - LOG_ERROR "yum源中没有gawk软件包" - exit 255 - fi - - # 安装gawk(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装gawk软件包" - dnf install -y gawk - CHECK_RESULT $? 0 0 "安装gawk失败" - fi - - # 测试gawk的NR内置变量 - LOG_INFO "测试gawk的NR内置变量" - echo -e "line1\nline2\nline3" > test_file.txt - gawk "{print NR}" test_file.txt > nr_output.txt - CHECK_RESULT $? 0 0 "执行gawk NR测试失败" - expected_nr="1\n2\n3" - actual_nr=$(cat nr_output.txt) - if [ "$actual_nr" = "$expected_nr" ]; then - LOG_INFO "NR内置变量测试通过" - else - LOG_ERROR "NR内置变量测试失败" - exit 1 - fi - - # 测试gawk的NF内置变量 - LOG_INFO "测试gawk的NF内置变量" - echo -e "a b c\nd e\nf" > test_file2.txt - gawk "{print NF}" test_file2.txt > nf_output.txt - CHECK_RESULT $? 0 0 "执行gawk NF测试失败" - expected_nf="3\n2\n1" - actual_nf=$(cat nf_output.txt) - if [ "$actual_nf" = "$expected_nf" ]; then - LOG_INFO "NF内置变量测试通过" - else - LOG_ERROR "NF内置变量测试失败" - exit 1 - fi - - # 测试gawk不支持的内置变量(模拟参数不存在场景) - LOG_INFO "测试gawk不存在的内置变量" - gawk "{print NONE_EXIST}" test_file.txt 2>/dev/null - if [ $? -eq 255 ]; then - LOG_INFO "不存在的内置变量测试符合预期" - else - LOG_ERROR "不存在的内置变量测试未正确处理" - exit 255 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_file.txt test_file2.txt nr_output.txt nf_output.txt - - # 如果脚本开始时未安装gawk,则卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载gawk软件包" - dnf remove -y gawk - CHECK_RESULT $? 0 0 "卸载gawk失败" - else - LOG_INFO "保持gawk安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_function_field_split.sh b/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_function_field_split.sh deleted file mode 100644 index 93d1e5c8f0e..00000000000 --- a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_function_field_split.sh +++ /dev/null @@ -1,146 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-31 -# @License : Mulan PSL v2 -# @Desc : 测试gawk字段分割与处理 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 安装或卸载软件包函数 - install_or_remove_package() { - local action=$1 - local package_name=$2 - - if [ "$action" = "install" ]; then - LOG_INFO "正在安装软件包: $package_name" - dnf install -y "$package_name" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装软件包 $package_name 失败" - LOG_INFO "软件包 $package_name 安装成功" - elif [ "$action" = "remove" ]; then - LOG_INFO "正在卸载软件包: $package_name" - dnf remove -y "$package_name" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载软件包 $package_name 失败" - LOG_INFO "软件包 $package_name 卸载成功" - fi - } - - # 检查软件包是否在yum源中 - check_package_in_repo() { - local package_name=$1 - LOG_INFO "检查yum源中是否存在软件包: $package_name" - dnf list available "$package_name" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $package_name 不在yum源中" - exit 255 - fi - LOG_INFO "软件包 $package_name 在yum源中存在" - } - - # 检查命令参数是否支持 - check_command_option() { - local command=$1 - local option=$2 - LOG_INFO "检查命令 $command 是否支持参数 $option" - $command "$option" --help > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "命令 $command 不支持参数 $option" - exit 255 - fi - LOG_INFO "命令 $command 支持参数 $option" - } - - # 主测试函数 - test_gawk_field_split() { - LOG_INFO "开始测试gawk字段分割与处理功能" - - # 定义测试用的软件包 - local test_package="gawk" - local originally_installed=false - - # 检查是否已安装gawk - LOG_INFO "检查系统是否已安装gawk" - if rpm -q "$test_package" > /dev/null 2>&1; then - originally_installed=true - LOG_INFO "gawk已安装,测试结束后将保持安装状态" - else - LOG_INFO "gawk未安装,将在测试前安装" - # 检查yum源中是否有该软件包 - check_package_in_repo "$test_package" - # 安装软件包 - install_or_remove_package "install" "$test_package" - fi - - # 测试1: 基本字段分割测试 - LOG_INFO "测试1: 基本字段分割功能" - echo "apple,banana,cherry" | gawk -F, "{print $1, $2, $3}" - CHECK_RESULT $? 0 0 "gawk基本字段分割失败" - - # 测试2: 使用不同分隔符 - LOG_INFO "测试2: 使用冒号作为分隔符" - echo "root:x:0:0:root:/root:/bin/bash" | gawk -F: "{print "用户:" $1, "UID:" $3, "GID:" $4}" - CHECK_RESULT $? 0 0 "gawk使用冒号分隔符失败" - - # 测试3: 检查-F参数是否支持 - LOG_INFO "测试3: 验证-F参数支持" - check_command_option "gawk" "-F" - - # 测试4: 多行文本字段处理 - LOG_INFO "测试4: 处理多行文本字段" - cat > /tmp/test_gawk.txt << EOF - John,Doe,30 - Jane,Smith,25 - Bob,Johnson,35 - EOF - gawk -F, "{print "姓名:" $1 " " $2, "年龄:" $3}" /tmp/test_gawk.txt - CHECK_RESULT $? 0 0 "gawk处理多行文本失败" - - # 测试5: 字段数量统计 - LOG_INFO "测试5: 统计每行字段数量" - echo "a,b,c,d,e" | gawk -F, "{print NF}" - CHECK_RESULT $? 0 0 "gawk统计字段数量失败" - - # 测试6: 修改字段内容 - LOG_INFO "测试6: 修改字段内容" - echo "hello world" | gawk "{$2="gawk"; print $0}" - CHECK_RESULT $? 0 0 "gawk修改字段内容失败" - - # 测试7: 使用正则表达式作为分隔符 - LOG_INFO "测试7: 使用正则表达式作为分隔符" - echo "apple123banana456cherry" | gawk -F "[0-9]+" "{print $1, $2, $3}" - CHECK_RESULT $? 0 0 "gawk使用正则表达式分隔符失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f /tmp/test_gawk.txt - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 根据原始状态决定是否卸载 - if [ "$originally_installed" = false ]; then - LOG_INFO "原始环境未安装gawk,测试完成后卸载" - install_or_remove_package "remove" "$test_package" - else - LOG_INFO "原始环境已安装gawk,保持安装状态" - fi - - LOG_INFO "gawk字段分割与处理测试完成" - } - - # 执行测试 - test_gawk_field_split -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_function_install.sh b/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_function_install.sh deleted file mode 100644 index cb310fbd96f..00000000000 --- a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_function_install.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-31 -# @License : Mulan PSL v2 -# @Desc : 测试gawk-lang软件包的安装功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试gawk-lang软件包的安装功能" - LOG_INFO "步骤1: 检查yum源中是否存在gawk-lang软件包" - dnf list available gawk-lang &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到gawk-lang软件包" - exit 255 - fi - - LOG_INFO "步骤2: 检查当前环境是否已安装gawk-lang软件包" - rpm -q gawk-lang &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "gawk-lang软件包已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "gawk-lang软件包未安装,将在测试步骤中安装" - INSTALLED_BEFORE=0 - fi - - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "步骤3: 安装gawk-lang软件包" - dnf install -y gawk-lang - CHECK_RESULT $? 0 0 "安装gawk-lang软件包失败" - LOG_INFO "gawk-lang软件包安装成功" - fi - - LOG_INFO "步骤4: 验证gawk-lang软件包基本功能" - gawk --version &>/dev/null - CHECK_RESULT $? 0 0 "gawk命令执行失败" - LOG_INFO "gawk命令执行成功" - - LOG_INFO "步骤5: 清理测试环境" - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "卸载测试安装的gawk-lang软件包" - dnf remove -y gawk-lang - CHECK_RESULT $? 0 0 "卸载gawk-lang软件包失败" - LOG_INFO "gawk-lang软件包卸载成功" - else - LOG_INFO "测试前已安装gawk-lang,保持安装状态" - fi - - LOG_INFO "gawk-lang软件包安装功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_function_pattern_action.sh b/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_function_pattern_action.sh deleted file mode 100644 index 49ebb697048..00000000000 --- a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_function_pattern_action.sh +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-31 -# @License : Mulan PSL v2 -# @Desc : 测试gawk模式与动作执行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试gawk模式与动作执行 - - # 检查gawk软件包是否已安装 - LOG_INFO "检查gawk软件包是否已安装" - if rpm -q gawk >/dev/null 2>&1; then - LOG_INFO "gawk已安装,标记为保持安装状态" - KEEP_INSTALLED=true - else - LOG_INFO "gawk未安装,标记为需要卸载" - KEEP_INSTALLED=false - fi - - # 检查yum源中是否有gawk软件包 - LOG_INFO "检查yum源中是否有gawk软件包" - if ! dnf list available gawk >/dev/null 2>&1; then - LOG_ERROR "yum源中没有gawk软件包" - exit 255 - fi - - # 如果未安装则安装gawk - if ! $KEEP_INSTALLED; then - LOG_INFO "安装gawk软件包" - dnf install -y gawk - CHECK_RESULT $? 0 0 "安装gawk失败" - fi - - # 测试gawk命令是否存在 - LOG_INFO "测试gawk命令是否存在" - which gawk - CHECK_RESULT $? 0 0 "gawk命令不存在" - - # 测试gawk版本信息 - LOG_INFO "测试gawk版本信息" - gawk --version | head -1 - CHECK_RESULT $? 0 0 "获取gawk版本信息失败" - - # 测试gawk基础功能:打印文件内容 - LOG_INFO "测试gawk基础功能:打印文件内容" - echo -e "line1\nline2\nline3" > /tmp/test_gawk.txt - gawk "{print}" /tmp/test_gawk.txt - CHECK_RESULT $? 0 0 "gawk打印文件内容失败" - rm -f /tmp/test_gawk.txt - - # 测试gawk模式匹配:匹配包含特定字符串的行 - LOG_INFO "测试gawk模式匹配:匹配包含特定字符串的行" - echo -e "apple\nbanana\napple orange\ncherry" > /tmp/test_pattern.txt - gawk "/apple/ {print}" /tmp/test_pattern.txt - CHECK_RESULT $? 0 0 "gawk模式匹配失败" - rm -f /tmp/test_pattern.txt - - # 测试gawk动作执行:计算行数 - LOG_INFO "测试gawk动作执行:计算行数" - echo -e "a\nb\nc\nd\ne" > /tmp/test_count.txt - line_count=$(gawk "END {print NR}" /tmp/test_count.txt) - if [ "$line_count" -eq 5 ]; then - LOG_INFO "行数计算正确:$line_count" - else - LOG_ERROR "行数计算错误:期望5,实际$line_count" - exit 1 - fi - rm -f /tmp/test_count.txt - - # 测试gawk字段处理 - LOG_INFO "测试gawk字段处理" - echo -e "John 25 Engineer\nAlice 30 Manager\nBob 28 Developer" > /tmp/test_field.txt - gawk "{print "Name:", $1, "Age:", $2, "Job:", $3}" /tmp/test_field.txt - CHECK_RESULT $? 0 0 "gawk字段处理失败" - rm -f /tmp/test_field.txt - - # 测试gawk内置变量 - LOG_INFO "测试gawk内置变量使用" - echo -e "first line\nsecond line\nthird line" > /tmp/test_builtin.txt - gawk "{print "Line", NR, ":", $0}" /tmp/test_builtin.txt - CHECK_RESULT $? 0 0 "gawk内置变量使用失败" - rm -f /tmp/test_builtin.txt - - # 测试gawk模式与动作组合 - LOG_INFO "测试gawk模式与动作组合" - echo -e "error: file not found\ninfo: operation completed\nwarning: low disk space\nerror: permission denied" > /tmp/test_combo.txt - error_count=$(gawk "/error/ {count++} END {print count}" /tmp/test_combo.txt) - if [ "$error_count" -eq 2 ]; then - LOG_INFO "错误行数统计正确:$error_count" - else - LOG_ERROR "错误行数统计错误:期望2,实际$error_count" - exit 1 - fi - rm -f /tmp/test_combo.txt - - # 测试gawk不支持参数的情况 - LOG_INFO "测试gawk不支持参数的情况" - if gawk --nonexistent-option 2>&1 | grep -q "unrecognized option"; then - LOG_INFO "gawk正确处理了不支持的参数" - else - LOG_ERROR "gawk没有正确处理不支持的参数" - exit 255 - fi - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f /tmp/test_*.txt - - # 如果测试开始时未安装gawk,则在测试结束后卸载 - if ! $KEEP_INSTALLED; then - LOG_INFO "卸载gawk软件包" - dnf remove -y gawk - CHECK_RESULT $? 0 0 "卸载gawk失败" - else - LOG_INFO "保持gawk安装状态" - fi - - LOG_INFO "gawk模式与动作执行测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_function_redirection.sh b/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_function_redirection.sh deleted file mode 100644 index 0114fba654f..00000000000 --- a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_function_redirection.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-01-31 -# @License : Mulan PSL v2 -# @Desc : 测试gawk输出重定向功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装gawk - LOG_INFO "检查是否已安装gawk" - if dnf list installed gawk &>/dev/null; then - LOG_INFO "gawk已安装,脚本结束后将保持安装状态" - INSTALLED_FLAG=0 - else - LOG_INFO "gawk未安装,将在测试过程中安装" - INSTALLED_FLAG=1 - fi - - # 检查yum源中是否有gawk软件包 - LOG_INFO "检查yum源中是否有gawk软件包" - if ! dnf list available gawk &>/dev/null; then - LOG_ERROR "yum源中没有gawk软件包" - exit 255 - fi - - # 安装gawk(如果未安装) - if [ $INSTALLED_FLAG -eq 1 ]; then - LOG_INFO "安装gawk软件包" - dnf install -y gawk - CHECK_RESULT $? 0 0 "gawk安装失败" - fi - - # 测试gawk输出重定向功能 - LOG_INFO "测试gawk输出重定向功能" - echo -e "1 apple\n2 orange\n3 banana" > test_input.txt - CHECK_RESULT $? 0 0 "创建测试输入文件失败" - - # 测试输出重定向到文件 - LOG_INFO "执行gawk命令,将输出重定向到文件" - gawk "{print $2}" test_input.txt > test_output.txt - CHECK_RESULT $? 0 0 "gawk执行失败" - - # 检查输出文件内容 - LOG_INFO "检查输出文件内容" - expected_output="apple - orange - banana" - actual_output=$(cat test_output.txt) - if [ "$expected_output" = "$actual_output" ]; then - LOG_INFO "输出文件内容正确" - else - LOG_ERROR "输出文件内容不正确" - LOG_ERROR "期望输出:$expected_output" - LOG_ERROR "实际输出:$actual_output" - exit 1 - fi - - # 测试追加模式输出重定向 - LOG_INFO "测试追加模式输出重定向" - gawk "{print $1}" test_input.txt >> test_output.txt - CHECK_RESULT $? 0 0 "gawk追加输出失败" - - # 检查追加后的文件内容 - LOG_INFO "检查追加后的文件内容" - expected_append_output="apple - orange - banana - 1 - 2 - 3" - actual_append_output=$(cat test_output.txt) - if [ "$expected_append_output" = "$actual_append_output" ]; then - LOG_INFO "追加后的输出文件内容正确" - else - LOG_ERROR "追加后的输出文件内容不正确" - LOG_ERROR "期望输出:$expected_append_output" - LOG_ERROR "实际输出:$actual_append_output" - exit 1 - fi - - # 测试错误输出重定向 - LOG_INFO "测试错误输出重定向" - gawk "{print $3}" test_input.txt 2> error_output.txt - CHECK_RESULT $? 0 0 "gawk错误输出测试失败" - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f test_input.txt test_output.txt error_output.txt - CHECK_RESULT $? 0 0 "清理临时文件失败" - - # 卸载gawk(如果脚本开始时未安装) - if [ $INSTALLED_FLAG -eq 1 ]; then - LOG_INFO "卸载gawk软件包" - dnf remove -y gawk - CHECK_RESULT $? 0 0 "gawk卸载失败" - fi - - LOG_INFO "gawk输出重定向功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_function_script_file.sh b/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_function_script_file.sh deleted file mode 100644 index dbb8045ba3e..00000000000 --- a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_function_script_file.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-01-31 -# @License : Mulan PSL v2 -# @Desc : 测试通过脚本文件执行gawk -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "检查gawk软件包是否在yum源中" - dnf list available gawk 2>&1 | grep -q "gawk" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有找到gawk软件包" - exit 255 - fi - - LOG_INFO "检查当前环境中是否已安装gawk" - if command -v gawk &> /dev/null; then - LOG_INFO "gawk已安装,标记为已存在" - INSTALLED_BEFORE="yes" - else - LOG_INFO "gawk未安装,标记为未安装" - INSTALLED_BEFORE="no" - fi - - if [ "$INSTALLED_BEFORE" = "no" ]; then - LOG_INFO "开始安装gawk软件包" - dnf install -y gawk - CHECK_RESULT $? 0 0 "安装gawk失败" - LOG_INFO "gawk安装成功" - fi - - LOG_INFO "检查gawk命令是否支持-f参数" - gawk --help 2>&1 | grep -q -- "-f" - if [ $? -ne 0 ]; then - LOG_ERROR "gawk命令不支持-f参数" - exit 255 - fi - - LOG_INFO "创建测试脚本文件" - cat > /tmp/test_gawk_script.awk << "EOF" - BEGIN { print "开始处理" } - { print "行内容:", $0 } - END { print "处理结束" } - EOF - CHECK_RESULT $? 0 0 "创建测试脚本文件失败" - - LOG_INFO "创建测试输入文件" - cat > /tmp/test_input.txt << "EOF" - 第一行 - 第二行 - 第三行 - EOF - CHECK_RESULT $? 0 0 "创建测试输入文件失败" - - LOG_INFO "通过脚本文件执行gawk" - gawk -f /tmp/test_gawk_script.awk /tmp/test_input.txt - CHECK_RESULT $? 0 0 "通过脚本文件执行gawk失败" - - LOG_INFO "清理临时文件" - rm -f /tmp/test_gawk_script.awk /tmp/test_input.txt - CHECK_RESULT $? 0 0 "清理临时文件失败" - - if [ "$INSTALLED_BEFORE" = "no" ]; then - LOG_INFO "测试结束,卸载gawk软件包" - dnf remove -y gawk - CHECK_RESULT $? 0 0 "卸载gawk失败" - LOG_INFO "gawk卸载成功" - else - LOG_INFO "测试结束,保持gawk安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_gawk_-f.sh b/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_gawk_-f.sh deleted file mode 100644 index 8b1a18b2785..00000000000 --- a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_gawk_-f.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-08-03 -# @License : Mulan PSL v2 -# @Desc : 使用 -f 参数指定程序文件执行 gawk 命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装gawk - LOG_INFO "检查是否已安装gawk..." - rpm -q gawk > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "gawk已安装,脚本结束后将保持安装状态。" - INSTALLED=1 - else - LOG_INFO "gawk未安装,将在测试完成后卸载。" - INSTALLED=0 - fi - - # 检查yum源中是否有gawk软件包 - LOG_INFO "检查yum源中是否有gawk软件包..." - dnf list available gawk > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到gawk软件包,退出码255。" - exit 255 - fi - - # 安装gawk(如果未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装gawk..." - dnf install -y gawk > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装gawk失败" - fi - - # 创建测试用的gawk程序文件 - LOG_INFO "创建测试用的gawk程序文件..." - cat < test_gawk_program.awk - BEGIN { print "Hello, gawk!" } - EOF - - # 使用-f参数执行gawk命令 - LOG_INFO "使用-f参数执行gawk命令..." - gawk -f test_gawk_program.awk > output.txt 2>&1 - CHECK_RESULT $? 0 0 "执行gawk命令失败" - - # 检查输出是否符合预期 - LOG_INFO "检查输出是否符合预期..." - grep "Hello, gawk!" output.txt > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "输出不符合预期" - - # 清理临时文件 - LOG_INFO "清理临时文件..." - rm -f test_gawk_program.awk output.txt - - # 卸载gawk(如果之前未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载gawk..." - dnf remove -y gawk > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载gawk失败" - fi - - LOG_INFO "测试脚本执行完毕。" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_install.sh b/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_install.sh deleted file mode 100644 index 0b5d98dc986..00000000000 --- a/testcases/function_test/pkg_test/gawk/gawk-lang/test_gawk-lang_install.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-08-03 -# @License : Mulan PSL v2 -# @Desc : 测试gawk-lang软件包的安装功能,验证安装过程是否正常完成 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查gawk-lang软件包是否已安装 - LOG_INFO "检查gawk-lang软件包是否已安装" - rpm -q gawk-lang > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "gawk-lang软件包已安装,脚本结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "gawk-lang软件包未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否存在gawk-lang软件包 - LOG_INFO "检查yum源中是否存在gawk-lang软件包" - dnf list available gawk-lang > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在gawk-lang软件包" - - # 安装gawk-lang软件包 - LOG_INFO "安装gawk-lang软件包" - dnf install -y gawk-lang > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装gawk-lang软件包失败" - - # 验证gawk-lang命令是否可用 - LOG_INFO "验证gawk-lang命令是否可用" - gawk --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "gawk命令不可用" - - # 清理环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载gawk-lang软件包" - dnf remove -y gawk-lang > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载gawk-lang软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/oncn-bwm/oncn-bwm-devel/test_oncn-bwm-devel_function_init.sh b/testcases/function_test/pkg_test/oncn-bwm/oncn-bwm-devel/test_oncn-bwm-devel_function_init.sh deleted file mode 100644 index d8adea8f0f9..00000000000 --- a/testcases/function_test/pkg_test/oncn-bwm/oncn-bwm-devel/test_oncn-bwm-devel_function_init.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-13 -# @License : Mulan PSL v2 -# @Desc : Test initialization of the package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试软件包初始化功能" - - # 检查软件包是否已安装 - LOG_INFO "检查软件包是否已安装" - dnf list installed oncn-bwm-devel &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在软件包oncn-bwm-devel" - dnf list available oncn-bwm-devel &>/dev/null - CHECK_RESULT $? 0 255 "yum源中不存在软件包oncn-bwm-devel" - - # 若未安装则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装软件包oncn-bwm-devel" - dnf install -y oncn-bwm-devel - CHECK_RESULT $? 0 1 "安装软件包失败" - fi - - # 测试初始化功能 - LOG_INFO "测试初始化功能" - init_output=$(oncn-bwm-devel init) - CHECK_RESULT $? 0 1 "初始化命令执行失败" - - # 验证初始化输出是否符合预期 - LOG_INFO "验证初始化输出" - expected_output="Initialization completed successfully" - if [[ "$init_output" != *"$expected_output"* ]]; then - LOG_ERROR "初始化输出不符合预期" - exit 1 - fi - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载软件包oncn-bwm-devel" - dnf remove -y oncn-bwm-devel - CHECK_RESULT $? 0 1 "卸载软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-aiosignal/python3-aiosignal/test_python3-aiosignal_function_connect.sh b/testcases/function_test/pkg_test/python-aiosignal/python3-aiosignal/test_python3-aiosignal_function_connect.sh deleted file mode 100644 index 6321d4d5e01..00000000000 --- a/testcases/function_test/pkg_test/python-aiosignal/python3-aiosignal/test_python3-aiosignal_function_connect.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-09 -# @License : Mulan PSL v2 -# @Desc : Test connecting a coroutine to a signal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test connecting a coroutine to a signal" - - # 检查 yum 源中是否存在 python3-aiosignal 软件包 - LOG_INFO "检查 yum 源中是否存在 python3-aiosignal 软件包" - dnf list available python3-aiosignal > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中不存在 python3-aiosignal 软件包" - exit 255 - fi - - # 检查是否已安装 python3-aiosignal - LOG_INFO "检查是否已安装 python3-aiosignal" - rpm -q python3-aiosignal > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-aiosignal 已安装,测试后保持安装状态" - INSTALLED=1 - else - LOG_INFO "python3-aiosignal 未安装,将作为测试步骤安装" - INSTALLED=0 - fi - - # 如果未安装,则安装 python3-aiosignal - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 python3-aiosignal" - dnf install -y python3-aiosignal - CHECK_RESULT $? 0 0 "安装 python3-aiosignal 失败" - fi - - # 测试连接协程到信号的功能 - LOG_INFO "测试连接协程到信号的功能" - python3 -c " - import asyncio - import signal - import sys - - async def handle_signal(): - print("Signal received") - - async def main(): - loop = asyncio.get_running_loop() - loop.add_signal_handler(signal.SIGINT, lambda: asyncio.create_task(handle_signal())) - print("Signal handler added. Press Ctrl+C to test.") - await asyncio.sleep(5) - - if __name__ == "__main__": - asyncio.run(main()) - " - CHECK_RESULT $? 0 0 "连接协程到信号功能测试失败" - - # 环境清理:如果之前未安装,则卸载 python3-aiosignal - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 python3-aiosignal" - dnf remove -y python3-aiosignal - CHECK_RESULT $? 0 0 "卸载 python3-aiosignal 失败" - fi - - LOG_INFO "测试完成:Test connecting a coroutine to a signal" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-aiosignal/python3-aiosignal/test_python3-aiosignal_function_send.sh b/testcases/function_test/pkg_test/python-aiosignal/python3-aiosignal/test_python3-aiosignal_function_send.sh deleted file mode 100644 index 0de43293d14..00000000000 --- a/testcases/function_test/pkg_test/python-aiosignal/python3-aiosignal/test_python3-aiosignal_function_send.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-09 -# @License : Mulan PSL v2 -# @Desc : Test sending data through a signal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查软件包是否在yum源中 - check_package_exist() { - dnf list available "$1" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $1 在yum源中不存在" - exit 255 - fi - } - - # 检查命令参数是否支持 - check_command_option() { - local cmd=$1 - local option=$2 - $cmd --help 2>&1 | grep -q -- "$option" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $cmd 不支持参数 $option" - exit 255 - fi - } - - # 主测试函数 - test_python3_aiosignal_function_send() { - local package_name="python3-aiosignal" - local installed=false - - # 检查软件包是否已安装 - LOG_INFO "检查 $package_name 是否已安装" - rpm -q $package_name &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "$package_name 已安装" - installed=true - else - LOG_INFO "$package_name 未安装" - installed=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有 $package_name" - check_package_exist $package_name - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装 $package_name" - dnf install -y $package_name - CHECK_RESULT $? 0 0 "安装 $package_name 失败" - fi - - # 测试发送数据通过信号 - LOG_INFO "测试发送数据通过信号" - python3 -c " - import asyncio - import signal - import os - - async def handle_signal(): - loop = asyncio.get_running_loop() - future = loop.create_future() - - def signal_handler(signum, frame): - future.set_result("Signal received") - - loop.add_signal_handler(signal.SIGUSR1, signal_handler) - - # 发送信号 - os.kill(os.getpid(), signal.SIGUSR1) - - result = await future - print("Result:", result) - assert result == "Signal received" - print("Test passed") - - asyncio.run(handle_signal()) - " - CHECK_RESULT $? 0 0 "发送数据通过信号测试失败" - - # 清理环境 - LOG_INFO "清理测试环境" - if [ "$installed" = false ]; then - LOG_INFO "卸载 $package_name" - dnf remove -y $package_name - CHECK_RESULT $? 0 0 "卸载 $package_name 失败" - else - LOG_INFO "保持 $package_name 安装状态" - fi - - LOG_INFO "测试完成" - } - - # 执行测试 - test_python3_aiosignal_function_send -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-aiosignal/python3-aiosignal/test_python3-aiosignal_function_signal.sh b/testcases/function_test/pkg_test/python-aiosignal/python3-aiosignal/test_python3-aiosignal_function_signal.sh deleted file mode 100644 index afc4900e7a7..00000000000 --- a/testcases/function_test/pkg_test/python-aiosignal/python3-aiosignal/test_python3-aiosignal_function_signal.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-09 -# @License : Mulan PSL v2 -# @Desc : Test basic signal creation and usage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试开始:Test basic signal creation and usage" - - LOG_INFO "步骤1:检查yum源中是否存在python3-aiosignal软件包" - dnf list available python3-aiosignal &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-aiosignal软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查环境是否已安装python3-aiosignal" - rpm -q python3-aiosignal &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装python3-aiosignal,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "环境未安装python3-aiosignal,将在测试结束后卸载" - ALREADY_INSTALLED=0 - fi - - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤3:安装python3-aiosignal软件包" - dnf install -y python3-aiosignal - CHECK_RESULT $? 0 0 "安装python3-aiosignal失败" - fi - - LOG_INFO "步骤4:检查python3命令是否支持-aiosignal参数" - python3 -c "import aiosignal" 2>&1 | grep -q "ModuleNotFoundError" - if [ $? -eq 0 ]; then - LOG_ERROR "python3不支持aiosignal模块或参数" - exit 255 - fi - - LOG_INFO "步骤5:测试基本信号创建和使用" - cat > /tmp/test_aiosignal.py << "EOF" - import asyncio - import aiosignal - - async def test_signal(): - signal = aiosignal.Signal() - received = [] - - async def handler(value): - received.append(value) - - signal.append(handler) - await signal.send("test_value") - return len(received) == 1 and received[0] == "test_value" - - if __name__ == "__main__": - result = asyncio.run(test_signal()) - if result: - print("SUCCESS") - exit(0) - else: - print("FAILED") - exit(1) - EOF - - python3 /tmp/test_aiosignal.py - CHECK_RESULT $? 0 0 "基本信号创建和使用测试失败" - - LOG_INFO "步骤6:清理临时文件" - rm -f /tmp/test_aiosignal.py - - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "步骤7:卸载python3-aiosignal软件包" - dnf remove -y python3-aiosignal - CHECK_RESULT $? 0 0 "卸载python3-aiosignal失败" - fi - - LOG_INFO "测试完成:Test basic signal creation and usage" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-fqdn/python3-fqdn/test_python3-fqdn_function_resolve.sh b/testcases/function_test/pkg_test/python-fqdn/python3-fqdn/test_python3-fqdn_function_resolve.sh deleted file mode 100644 index f1a32df813b..00000000000 --- a/testcases/function_test/pkg_test/python-fqdn/python3-fqdn/test_python3-fqdn_function_resolve.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-07 -# @License : Mulan PSL v2 -# @Desc : 测试python3-fqdn的域名解析功能,验证是否能正确解析域名。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试python3-fqdn的域名解析功能" - - # 检查是否已安装python3-fqdn - if ! dnf list installed python3-fqdn &>/dev/null; then - LOG_INFO "python3-fqdn未安装,开始安装" - # 检查yum源中是否有该软件包 - if ! dnf list available python3-fqdn &>/dev/null; then - LOG_ERROR "yum源中未找到python3-fqdn软件包" - exit 255 - fi - dnf install -y python3-fqdn - CHECK_RESULT $? 0 0 "安装python3-fqdn失败" - INSTALLED=1 - else - LOG_INFO "python3-fqdn已安装" - INSTALLED=0 - fi - - # 测试域名解析功能 - LOG_INFO "测试域名解析功能" - python3 -c " - import socket - try: - ip = socket.gethostbyname("example.com") - print(f"Resolved IP: {ip}") - except Exception as e: - print(f"Error: {e}") - exit(1) - " - CHECK_RESULT $? 0 0 "域名解析失败" - - # 清理环境 - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "卸载python3-fqdn" - dnf remove -y python3-fqdn - CHECK_RESULT $? 0 0 "卸载python3-fqdn失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-zope-deprecation/python-zope-deprecation-help/test_python-zope-deprecation-help_function_install.sh b/testcases/function_test/pkg_test/python-zope-deprecation/python-zope-deprecation-help/test_python-zope-deprecation-help_function_install.sh deleted file mode 100644 index c98a51c252e..00000000000 --- a/testcases/function_test/pkg_test/python-zope-deprecation/python-zope-deprecation-help/test_python-zope-deprecation-help_function_install.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-11 -# @License : Mulan PSL v2 -# @Desc : 测试软件包可以通过pip正常安装 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试软件包可以通过pip正常安装" - - LOG_INFO "步骤1: 检查yum源中是否存在python-zope-deprecation-help软件包" - dnf list available python-zope-deprecation-help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python-zope-deprecation-help软件包" - exit 255 - fi - - LOG_INFO "步骤2: 检查当前环境是否已安装python-zope-deprecation-help" - rpm -q python-zope-deprecation-help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到python-zope-deprecation-help已安装,跳过安装步骤" - INSTALLED_BEFORE="true" - else - LOG_INFO "python-zope-deprecation-help未安装,开始安装" - INSTALLED_BEFORE="false" - - LOG_INFO "步骤3: 使用dnf安装python-zope-deprecation-help" - dnf install -y python-zope-deprecation-help - CHECK_RESULT $? 0 0 "安装python-zope-deprecation-help失败" - fi - - LOG_INFO "步骤4: 验证python-zope-deprecation-help是否成功安装" - rpm -q python-zope-deprecation-help - CHECK_RESULT $? 0 0 "验证python-zope-deprecation-help安装状态失败" - - LOG_INFO "步骤5: 测试通过pip安装python-zope-deprecation-help" - pip install python-zope-deprecation-help - CHECK_RESULT $? 0 0 "通过pip安装python-zope-deprecation-help失败" - - LOG_INFO "步骤6: 验证pip安装的软件包" - pip show python-zope-deprecation-help - CHECK_RESULT $? 0 0 "验证pip安装的python-zope-deprecation-help失败" - - LOG_INFO "步骤7: 清理pip安装的软件包" - pip uninstall -y python-zope-deprecation-help - CHECK_RESULT $? 0 0 "卸载pip安装的python-zope-deprecation-help失败" - - LOG_INFO "步骤8: 环境恢复" - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "卸载测试安装的python-zope-deprecation-help软件包" - dnf remove -y python-zope-deprecation-help - CHECK_RESULT $? 0 0 "卸载python-zope-deprecation-help失败" - else - LOG_INFO "保持原有安装状态,不进行卸载" - fi - - LOG_INFO "测试完成:软件包可以通过pip正常安装" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/rubygem-rdiscount/rubygem-rdiscount-help/test_rubygem-rdiscount-help_function_parse.sh b/testcases/function_test/pkg_test/rubygem-rdiscount/rubygem-rdiscount-help/test_rubygem-rdiscount-help_function_parse.sh deleted file mode 100644 index c5f38d73e19..00000000000 --- a/testcases/function_test/pkg_test/rubygem-rdiscount/rubygem-rdiscount-help/test_rubygem-rdiscount-help_function_parse.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-11 -# @License : Mulan PSL v2 -# @Desc : 测试软件包的解析功能,验证是否能正确解析 markdown 内容。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装rdiscount软件包 - LOG_INFO "检查是否已安装rdiscount软件包" - if rpm -q rubygem-rdiscount &>/dev/null; then - LOG_INFO "rdiscount软件包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "rdiscount软件包未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有rdiscount软件包 - LOG_INFO "检查yum源中是否有rdiscount软件包" - if ! dnf list available rubygem-rdiscount &>/dev/null; then - LOG_ERROR "yum源中未找到rdiscount软件包" - exit 255 - fi - - # 安装rdiscount软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装rdiscount软件包" - dnf install -y rubygem-rdiscount - CHECK_RESULT $? 0 0 "安装rdiscount软件包失败" - fi - - # 测试解析功能 - LOG_INFO "测试解析功能" - echo "# Test Markdown" > test.md - echo "This is a test." >> test.md - - result=$(rdiscount test.md) - CHECK_RESULT $? 0 0 "解析markdown内容失败" - - expected="

Test Markdown

\n

This is a test.

" - if [ "$result" != "$expected" ]; then - LOG_ERROR "解析结果不符合预期" - exit 1 - else - LOG_INFO "解析结果符合预期" - fi - - # 清理测试文件 - rm -f test.md - - # 卸载rdiscount软件包(如果最初未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载rdiscount软件包" - dnf remove -y rubygem-rdiscount - CHECK_RESULT $? 0 0 "卸载rdiscount软件包失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/shrinkwrap/shrinkwrap-build-resources/test_shrinkwrap-build-resources_function_build.sh b/testcases/function_test/pkg_test/shrinkwrap/shrinkwrap-build-resources/test_shrinkwrap-build-resources_function_build.sh deleted file mode 100644 index 2c3423c6137..00000000000 --- a/testcases/function_test/pkg_test/shrinkwrap/shrinkwrap-build-resources/test_shrinkwrap-build-resources_function_build.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-03 -# @License : Mulan PSL v2 -# @Desc : 测试软件包的构建功能,验证构建过程是否正常完成且无报错。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_shrinkwrap-build-resources_function_build.sh - - LOG_INFO "开始测试软件包的构建功能,验证构建过程是否正常完成且无报错。" - - # 检查是否已安装目标软件包 - LOG_INFO "检查目标软件包是否已安装..." - if dnf list installed shrinkwrap-build-resources &>/dev/null; then - LOG_INFO "目标软件包已安装,脚本结束时将保持安装状态。" - INSTALLED=true - else - LOG_INFO "目标软件包未安装,将在测试步骤中安装。" - INSTALLED=false - fi - - # 检查yum源中是否存在目标软件包 - LOG_INFO "检查yum源中是否存在目标软件包..." - if ! dnf list available shrinkwrap-build-resources &>/dev/null; then - LOG_ERROR "yum源中未找到目标软件包,退出测试。" - exit 255 - fi - - # 安装目标软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装目标软件包..." - dnf install -y shrinkwrap-build-resources - CHECK_RESULT $? 0 0 "安装目标软件包失败" - fi - - # 验证构建功能 - LOG_INFO "验证软件包的构建功能..." - build_command="shrinkwrap-build-resources build" - if ! command -v shrinkwrap-build-resources &>/dev/null; then - LOG_ERROR "构建命令不存在或不支持,退出测试。" - exit 255 - fi - - $build_command - CHECK_RESULT $? 0 0 "构建过程失败" - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境,卸载目标软件包..." - dnf remove -y shrinkwrap-build-resources - CHECK_RESULT $? 0 0 "卸载目标软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复。" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/shrinkwrap/shrinkwrap-build-resources/test_shrinkwrap-build-resources_function_help.sh b/testcases/function_test/pkg_test/shrinkwrap/shrinkwrap-build-resources/test_shrinkwrap-build-resources_function_help.sh deleted file mode 100644 index 2652dde75a9..00000000000 --- a/testcases/function_test/pkg_test/shrinkwrap/shrinkwrap-build-resources/test_shrinkwrap-build-resources_function_help.sh +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试软件包的帮助信息功能,验证是否能正确显示使用说明和命令行参数。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $1" - } - LOG_ERROR() { - echo "[ERROR] $1" - } - - # 定义检查结果函数 - CHECK_RESULT() { - local actual=$1 - local expect=$2 - local mode=$3 - local message=$4 - if [ $mode -eq 0 ]; then - if [ $actual -ne $expect ]; then - LOG_ERROR "$message" - exit 255 - fi - elif [ $mode -eq 1 ]; then - if [ $actual -eq $expect ]; then - LOG_ERROR "$message" - exit 255 - fi - fi - } - - # 定义SSH命令函数 - SSH_CMD() { - local cmd=$1 - local ip=$2 - local password=$3 - local user=$4 - sshpass -p "$password" ssh -o StrictHostKeyChecking=no "$user@$ip" "$cmd" - } - - # 测试软件包名称 - PACKAGE_NAME="shrinkwrap-build-resources" - - # 步骤1:检查软件包是否已在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - dnf list available "$PACKAGE_NAME" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 步骤2:检查软件包是否已安装 - LOG_INFO "步骤2:检查软件包是否已安装" - INSTALLED=false - if rpm -q "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - INSTALLED=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:测试帮助信息功能 - LOG_INFO "步骤4:测试软件包帮助信息功能" - # 假设帮助命令为 --help 或 -h - if command -v "$PACKAGE_NAME" &>/dev/null; then - # 测试 --help 参数 - LOG_INFO "测试 --help 参数" - "$PACKAGE_NAME" --help &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "--help 参数支持" - else - # 测试 -h 参数 - LOG_INFO "测试 -h 参数" - "$PACKAGE_NAME" -h &>/dev/null - CHECK_RESULT $? 0 0 "软件包 $PACKAGE_NAME 不支持 --help 或 -h 参数" - LOG_INFO "-h 参数支持" - fi - else - # 如果命令不存在,尝试使用包名直接执行 - LOG_INFO "尝试直接执行软件包命令" - "$PACKAGE_NAME" --help &>/dev/null - if [ $? -ne 0 ]; then - "$PACKAGE_NAME" -h &>/dev/null - CHECK_RESULT $? 0 0 "软件包 $PACKAGE_NAME 不支持帮助参数" - fi - fi - - # 步骤5:清理环境 - LOG_INFO "步骤5:清理环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/shrinkwrap/shrinkwrap-build-resources/test_shrinkwrap-build-resources_function_install.sh b/testcases/function_test/pkg_test/shrinkwrap/shrinkwrap-build-resources/test_shrinkwrap-build-resources_function_install.sh deleted file mode 100644 index 5137c037e78..00000000000 --- a/testcases/function_test/pkg_test/shrinkwrap/shrinkwrap-build-resources/test_shrinkwrap-build-resources_function_install.sh +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试软件包的标准安装流程,验证其能否通过包管理器成功安装并配置到系统中。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试软件包的标准安装流程,验证其能否通过包管理器成功安装并配置到系统中 - - # 定义软件包名称 - PACKAGE_NAME="shrinkwrap-build-resources" - - # 检查环境是否已经安装了指定软件包 - LOG_INFO "步骤1:检查系统是否已安装${PACKAGE_NAME}软件包" - if rpm -q ${PACKAGE_NAME} > /dev/null 2>&1; then - LOG_INFO "检测到${PACKAGE_NAME}已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "检测到${PACKAGE_NAME}未安装,将在测试后卸载" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "步骤2:检查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 "步骤3:获取${PACKAGE_NAME}软件包详细信息" - dnf info ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "获取软件包信息失败" - - # 安装软件包(如果未安装) - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "步骤4:安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装软件包失败" - LOG_INFO "软件包安装成功" - else - LOG_INFO "步骤4:跳过安装步骤,软件包已存在" - fi - - # 验证软件包是否成功安装 - LOG_INFO "步骤5:验证${PACKAGE_NAME}软件包是否安装成功" - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "软件包未正确安装" - - # 检查软件包文件是否已部署到系统 - LOG_INFO "步骤6:检查${PACKAGE_NAME}软件包文件部署情况" - rpm -ql ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "软件包文件未正确部署" - - # 验证软件包的基本功能(如果有可执行文件) - LOG_INFO "步骤7:检查软件包是否包含可执行文件" - EXEC_FILES=$(rpm -ql ${PACKAGE_NAME} | grep -E "/bin/|/sbin/|/usr/bin/|/usr/sbin/" | head -5) - if [ -n "${EXEC_FILES}" ]; then - LOG_INFO "找到可执行文件: $(echo ${EXEC_FILES} | tr "\n" " ")" - - # 测试第一个可执行文件的基本执行 - FIRST_EXEC=$(echo "${EXEC_FILES}" | head -1) - if [ -f "${FIRST_EXEC}" ] && [ -x "${FIRST_EXEC}" ]; then - LOG_INFO "步骤8:测试可执行文件${FIRST_EXEC}的基本功能" - # 尝试执行--help或--version参数 - if ${FIRST_EXEC} --help > /dev/null 2>&1; then - LOG_INFO "可执行文件${FIRST_EXEC} --help 执行成功" - elif ${FIRST_EXEC} --version > /dev/null 2>&1; then - LOG_INFO "可执行文件${FIRST_EXEC} --version 执行成功" - else - # 尝试不带参数执行(可能会失败,但检查命令是否存在) - timeout 2 ${FIRST_EXEC} > /dev/null 2>&1 - if [ $? -eq 124 ]; then - LOG_INFO "可执行文件${FIRST_EXEC} 存在但需要参数" - fi - fi - fi - else - LOG_INFO "软件包不包含标准可执行文件,可能是库文件或配置文件" - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ ${ALREADY_INSTALLED} -eq 0 ]; then - LOG_INFO "步骤9:清理测试环境,卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载软件包失败" - - # 验证软件包已卸载 - rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "错误:软件包卸载失败" - exit 1 - fi - LOG_INFO "软件包卸载成功,环境已恢复" - else - LOG_INFO "步骤9:保持${PACKAGE_NAME}软件包安装状态,不进行卸载" - fi - - LOG_INFO "测试完成:${PACKAGE_NAME}软件包的标准安装流程验证通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/shrinkwrap/shrinkwrap-build-resources/test_shrinkwrap-build-resources_function_uninstall.sh b/testcases/function_test/pkg_test/shrinkwrap/shrinkwrap-build-resources/test_shrinkwrap-build-resources_function_uninstall.sh deleted file mode 100644 index b851dac4649..00000000000 --- a/testcases/function_test/pkg_test/shrinkwrap/shrinkwrap-build-resources/test_shrinkwrap-build-resources_function_uninstall.sh +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试软件包的卸载功能,验证卸载过程是否彻底且不影响系统其他组件。 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - PACKAGE_NAME="shrinkwrap-build-resources" - LOG_INFO "开始测试软件包卸载功能" - LOG_INFO "步骤1: 检查系统中是否已安装$PACKAGE_NAME" - rpm -q $PACKAGE_NAME - if [ $? -eq 0 ]; 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软件包" - dnf list available $PACKAGE_NAME - if [ $? -ne 0 ]; 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失败" - fi - - LOG_INFO "步骤4: 验证软件包安装状态" - rpm -q $PACKAGE_NAME - CHECK_RESULT $? 0 0 "$PACKAGE_NAME未正确安装" - - LOG_INFO "步骤5: 执行卸载命令测试" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载$PACKAGE_NAME失败" - - LOG_INFO "步骤6: 验证软件包是否彻底卸载" - rpm -q $PACKAGE_NAME - if [ $? -eq 0 ]; then - LOG_ERROR "$PACKAGE_NAME卸载不彻底" - exit 1 - else - LOG_INFO "$PACKAGE_NAME已成功卸载" - fi - - LOG_INFO "步骤7: 检查系统其他组件是否受影响" - LOG_INFO "检查系统关键服务状态" - systemctl status > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "系统服务状态检查失败" - - LOG_INFO "检查yum/dnf功能是否正常" - dnf list installed | head -5 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "dnf功能异常" - - if [ "$INSTALLED_BEFORE_TEST" = true ]; then - LOG_INFO "步骤8: 恢复原始安装状态" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "重新安装$PACKAGE_NAME失败" - LOG_INFO "已恢复$PACKAGE_NAME的安装状态" - else - LOG_INFO "步骤8: 无需恢复,环境保持未安装状态" - fi - - LOG_INFO "步骤9: 最终环境验证" - if [ "$INSTALLED_BEFORE_TEST" = true ]; then - rpm -q $PACKAGE_NAME - CHECK_RESULT $? 0 0 "最终环境验证失败:$PACKAGE_NAME未安装" - else - rpm -q $PACKAGE_NAME - if [ $? -eq 0 ]; then - LOG_ERROR "最终环境验证失败:$PACKAGE_NAME不应被安装" - exit 1 - fi - fi - - LOG_INFO "测试完成:软件包卸载功能验证通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_downgrade.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_downgrade.sh deleted file mode 100644 index 86f0cebded9..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_downgrade.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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-06-17 -# @License : Mulan PSL v2 -# @Desc : 测试sisu-inject软件包的降级功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - - # 测试sisu-inject软件包的降级功能 - - # 检查yum源中是否存在sisu-inject软件包 - LOG_INFO "检查yum源中是否存在sisu-inject软件包" - dnf list available sisu-inject > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到sisu-inject软件包" - exit 255 - fi - - # 检查当前是否已安装sisu-inject - LOG_INFO "检查当前是否已安装sisu-inject" - rpm -q sisu-inject > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "sisu-inject已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "sisu-inject未安装,将在测试步骤中安装并在脚本结束前卸载" - INSTALLED=0 - fi - - # 如果未安装,则安装sisu-inject - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装sisu-inject软件包" - dnf install -y sisu-inject > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装sisu-inject失败" - fi - - # 获取当前sisu-inject版本 - LOG_INFO "获取当前sisu-inject版本" - CURRENT_VERSION=$(rpm -q --queryformat '%{VERSION}' sisu-inject) - CHECK_RESULT $? 0 0 "获取当前版本失败" - - # 检查是否有可用的降级版本 - LOG_INFO "检查是否有可用的降级版本" - LOWER_VERSION=$(dnf list available sisu-inject | awk '/sisu-inject/ {print $2}' | sort -V | head -n1) - if [ "$LOWER_VERSION" = "$CURRENT_VERSION" ]; then - LOG_ERROR "没有可用的降级版本" - exit 255 - fi - - # 执行降级操作 - LOG_INFO "执行降级操作,从$CURRENT_VERSION降级到$LOWER_VERSION" - dnf downgrade -y sisu-inlect-$LOWER_VERSION > /dev/null 2>&1 # Intentional typo for testing parameter check - if [ $? -ne 0 ]; then - LOG_ERROR "降级命令参数错误或不支持" - exit 255 - fi - - # 验证降级是否成功 - LOG_INFO "验证降级是否成功" - NEW_VERSION=$(rpm -q --queryformat '%{VERSION}' sisu-inject) - CHECK_RESULT $? 0 0 "获取新版本失败" - - if [ "$NEW_VERSION" != "$LOWER_VERSION" ]; then - LOG_ERROR "降级失败,当前版本为$NEW_VERSION,预期为$LOWER_VERSION" - exit 1 - else - LOG_INFO "降级成功,当前版本为$NEW_VERSION" - fi - - # 清理环境:如果脚本开始时未安装,则卸载软件包;否则保持安装状态 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载sisu-inject软件包以恢复环境" - dnf remove -y sisu-inlect > /dev/null 2>&1 # Intentional typo for testing parameter check - if [ $? -ne 0 ]; then - LOG_ERROR "卸载命令参数错误或不支持" - exit 255 - fi - - # Final check to ensure uninstallation was successful if needed (optional) - rpm -q sisu-inlect > /dev/null 2>&1 # Intentional typo for testing parameter check - if [ $? -eq 0 ]; then - LOG_ERROR "卸载失败,环境未恢复" - exit 1 # Non-standard exit code as per requirement #4 for other failures. - else - LOG_INFO "环境恢复完成" - fi - else - LOG_INFO "环境保持原状(已安装)" - fi - - exit # Exit with success (implicitly returns status of last command executed). - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_downgrade_rollback.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_downgrade_rollback.sh deleted file mode 100644 index fa7b973bc40..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_downgrade_rollback.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-06-17 -# @License : Mulan PSL v2 -# @Desc : 测试sisu-inject软件包的降级回滚功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - - LOG_INFO "开始测试sisu-inject软件包的降级回滚功能" - - # 检查sisu-inject软件包是否已安装 - if rpm -q sisu-inject &>/dev/null; then - LOG_INFO "sisu-inject软件包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "sisu-inject软件包未安装,测试结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在sisu-inject软件包 - LOG_INFO "检查yum源中是否存在sisu-inject软件包" - if ! dnf list available sisu-inject &>/dev/null; then - LOG_ERROR "yum源中不存在sisu-inject软件包" - exit 255 - fi - - # 安装sisu-inject软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装sisu-inject软件包" - dnf install -y sisu-inject - CHECK_RESULT $? 0 0 "安装sisu-inject软件包失败" - fi - - # 获取当前安装的sisu-inject版本 - CURRENT_VERSION=$(rpm -q --queryformat '%{VERSION}-%{RELEASE}' sisu-inject) - LOG_INFO "当前sisu-inject版本: $CURRENT_VERSION" - - # 检查是否存在旧版本可供降级 - LOG_INFO "检查是否存在旧版本的sisu-inject可供降级" - OLD_VERSION=$(dnf list --showduplicates sisu-inject | awk '{print $2}' | grep -v "$CURRENT_VERSION" | tail -n 1) - if [ -z "$OLD_VERSION" ]; then - LOG_ERROR "没有找到可供降级的旧版本" - exit 255 - fi - - LOG_INFO "找到可供降级的旧版本: $OLD_VERSION" - - # 执行降级操作 - LOG_INFO "开始降级到旧版本: $OLD_VERSION" - dnf downgrade -y sisu-inject-$OLD_VERSION - CHECK_RESULT $? 0 0 "降级到旧版本失败" - - # 验证降级后的版本 - NEW_VERSION=$(rpm -q --queryformat '%{VERSION}-%{RELEASE}' sisu-inject) - LOG_INFO "降级后的sisu-inject版本: $NEW_VERSION" - CHECK_RESULT "$NEW_VERSION" "$OLD_VERSION" 0 "降级后版本与预期不符" - - # 执行回滚操作(升级到当前最新版本) - LOG_INFO "开始回滚到最新版本" - dnf upgrade -y sisu-inject - CHECK_RESULT $? 0 0 "回滚到最新版本失败" - - # 验证回滚后的版本 - ROLLBACK_VERSION=$(rpm -q --queryformat '%{VERSION}-%{RELEASE}' sisu-inject) - LOG_INFO "回滚后的sisu-inject版本: $ROLLBACK_VERSION" - CHECK_RESULT "$ROLLBACK_VERSION" "$CURRENT_VERSION" 0 "回滚后版本与预期不符" - - # 清理环境(如果最初未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境,卸载sisu-inject软件包" - dnf remove -y sisu-inject - CHECK_RESULT $? 0 0 "卸载sisu-inlect软件包失败" - fi - - LOG_INFO "测试sisu-inlect的降级回滚功能完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_basic_usage.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_basic_usage.sh deleted file mode 100644 index c518b0b299d..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_basic_usage.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-28 -# @License : Mulan PSL v2 -# @Desc : 测试软件包最基础、最核心的一个命令行用法 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断sisu-inject软件包是否已安装 - LOG_INFO "检查sisu-inject软件包是否已安装" - if rpm -q sisu-inject &> /dev/null; then - LOG_INFO "sisu-inject软件包已安装" - INSTALLED=true - else - LOG_INFO "sisu-inject软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否有sisu-inject软件包 - LOG_INFO "检查yum源中是否有sisu-inject软件包" - dnf list available sisu-inject &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有sisu-inject软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装sisu-inject软件包" - dnf install -y sisu-inject - CHECK_RESULT $? 0 0 "安装sisu-inject软件包失败" - fi - - # 测试sisu-inject命令的最基础、最核心用法 - LOG_INFO "测试sisu-inject命令的基本用法" - LOG_INFO "执行sisu-inject --help查看帮助信息" - sisu-inject --help &> /dev/null - CHECK_RESULT $? 0 0 "sisu-inject --help命令执行失败" - - # 检查sisu-inject命令是否支持必需参数 - LOG_INFO "检查sisu-inject命令是否支持必需参数" - if ! sisu-inject --help | grep -q "required" &> /dev/null; then - LOG_ERROR "sisu-inject命令不支持必需参数或参数不存在" - # 清理环境:如果脚本开始时安装了软件包,则卸载 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载sisu-inject软件包" - dnf remove -y sisu-inject - CHECK_RESULT $? 0 0 "卸载sisu-inject软件包失败" - fi - exit 255 - fi - - # 执行sisu-inject命令的一个基础操作示例 - LOG_INFO "执行sisu-inject命令的基础操作示例" - # 假设sisu-inject有一个基础命令选项为--version,这里使用它作为示例 - if sisu-inject --help | grep -q "\-\-version" &> /dev/null; then - LOG_INFO "执行sisu-inject --version" - sisu-inject --version - CHECK_RESULT $? 0 0 "sisu-inject --version命令执行失败" - else - LOG_ERROR "sisu-inject命令不支持--version参数" - # 清理环境:如果脚本开始时安装了软件包,则卸载 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载sisu-inject软件包" - dnf remove -y sisu-inject - CHECK_RESULT $? 0 0 "卸载sisu-inject软件包失败" - fi - exit 255 - fi - - # 清理环境:如果脚本开始时未安装软件包,则卸载 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载sisu-inject软件包" - dnf remove -y sisu-inject - CHECK_RESULT $? 0 0 "卸载sisu-inject软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_config_file.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_config_file.sh deleted file mode 100644 index 13d1ebf4ec0..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_config_file.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-28 -# @License : Mulan PSL v2 -# @Desc : 测试软件包默认配置文件的生成、读取或验证功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试sisu-inject软件包配置文件功能" - - # 检查软件包是否在yum源中 - LOG_INFO "检查sisu-inject软件包是否在yum源中" - dnf list available sisu-inject 2>/dev/null | grep -q sisu-inject - if [ $? -ne 0 ]; then - LOG_ERROR "sisu-inject软件包不在yum源中" - exit 255 - fi - - # 检查是否已安装 - LOG_INFO "检查sisu-inject软件包是否已安装" - rpm -q sisu-inject >/dev/null 2>&1 - INSTALLED=$? - - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "安装sisu-inject软件包" - dnf install -y sisu-inject - CHECK_RESULT $? 0 0 "安装sisu-inject软件包失败" - fi - - # 测试配置文件生成功能 - LOG_INFO "测试配置文件生成功能" - sisu-inject --generate-config 2>&1 | grep -q "config generated" - CHECK_RESULT $? 0 0 "配置文件生成失败" - - # 测试配置文件读取功能 - LOG_INFO "测试配置文件读取功能" - if [ -f /etc/sisu-inject/config.yaml ]; then - sisu-inject --validate-config 2>&1 | grep -q "valid" - CHECK_RESULT $? 0 0 "配置文件验证失败" - else - LOG_INFO "默认配置文件不存在,创建测试配置文件" - echo "test: value" > /tmp/test_config.yaml - sisu-inject --config /tmp/test_config.yaml --validate 2>&1 | grep -q "valid" - CHECK_RESULT $? 0 0 "测试配置文件验证失败" - rm -f /tmp/test_config.yaml - fi - - # 测试无效参数处理 - LOG_INFO "测试无效参数处理" - sisu-inject --invalid-param 2>&1 | grep -q "unrecognized option" - CHECK_RESULT $? 0 255 "无效参数处理异常" - - # 清理环境 - LOG_INFO "清理测试环境" - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "卸载sisu-inject软件包" - dnf remove -y sisu-inject - CHECK_RESULT $? 0 0 "卸载sisu-inject软件包失败" - fi - - LOG_INFO "sisu-inject配置文件功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_dependency.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_dependency.sh deleted file mode 100644 index e6bb016ba1c..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_dependency.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-11 -# @License : Mulan PSL v2 -# @Desc : 测试sisu-inject软件包的基础依赖库功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试sisu-inject软件包的基础依赖库功能" - - # 检查sisu-inject软件包是否已安装 - if dnf list installed sisu-inject &>/dev/null; then - LOG_INFO "sisu-inject软件包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "sisu-inject软件包未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有sisu-inject软件包 - LOG_INFO "检查yum源中是否存在sisu-inject软件包" - if ! dnf list available sisu-inject &>/dev/null; then - LOG_ERROR "yum源中未找到sisu-inject软件包" - exit 255 - fi - - # 安装sisu-inject软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装sisu-inject软件包" - dnf install -y sisu-inject - CHECK_RESULT $? 0 0 "安装sisu-inject软件包失败" - fi - - # 测试基础依赖库功能 - LOG_INFO "测试基础依赖库功能" - sisu-inject --test-dependency - CHECK_RESULT $? 0 0 "基础依赖库功能测试失败" - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载sisu-inject软件包以恢复环境" - dnf remove -y sisu-inject - CHECK_RESULT $? 0 0 "卸载sisu-inject软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_dependency_check.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_dependency_check.sh deleted file mode 100644 index 967dfa1bc6a..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_dependency_check.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-28 -# @License : Mulan PSL v2 -# @Desc : 测试软件包对关键依赖库的调用和兼容性 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试软件包对关键依赖库的调用和兼容性" - - # 定义需要测试的软件包名称 - PACKAGE_NAME="sisu-inject" - LOG_INFO "测试的软件包为: ${PACKAGE_NAME}" - - # 检查软件包是否已经在yum源中 - LOG_INFO "检查yum源中是否存在软件包: ${PACKAGE_NAME}" - dnf list available ${PACKAGE_NAME} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到软件包: ${PACKAGE_NAME}" - exit 255 - fi - LOG_INFO "yum源中存在软件包: ${PACKAGE_NAME}" - - # 检查软件包是否已经安装 - LOG_INFO "检查软件包是否已经安装" - rpm -q ${PACKAGE_NAME} &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包已经安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE="true" - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED_BEFORE="false" - fi - - # 如果未安装,则安装软件包 - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "安装软件包: ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包失败" - LOG_INFO "软件包安装成功" - fi - - # 测试软件包的命令是否存在 - LOG_INFO "检查软件包命令是否存在" - which sisu-inject &>/dev/null - CHECK_RESULT $? 0 0 "sisu-inject命令不存在" - - # 测试软件包命令的基本参数 - LOG_INFO "测试软件包命令的基本参数" - sisu-inject --help &>/dev/null - CHECK_RESULT $? 0 0 "sisu-inject --help命令执行失败" - - # 测试软件包对关键依赖库的调用 - LOG_INFO "测试软件包对关键依赖库的调用" - sisu-inject --version &>/dev/null - CHECK_RESULT $? 0 0 "sisu-inject --version命令执行失败,可能依赖库调用异常" - - # 测试软件包的功能兼容性 - LOG_INFO "测试软件包功能兼容性" - sisu-inject --list &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "sisu-inject --list命令执行失败,可能参数不存在或不支持" - exit 255 - fi - LOG_INFO "sisu-inject --list命令执行成功" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "${INSTALLED_BEFORE}" = "false" ]; then - LOG_INFO "卸载软件包: ${PACKAGE_NAME}" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包失败" - LOG_INFO "软件包卸载成功" - else - LOG_INFO "软件包在脚本执行前已安装,保持安装状态" - fi - - LOG_INFO "测试软件包对关键依赖库的调用和兼容性完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_help.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_help.sh deleted file mode 100644 index 4f02b25651a..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_help.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-28 -# @License : Mulan PSL v2 -# @Desc : 测试查看软件包帮助文档或使用说明的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试查看软件包帮助文档或使用说明的功能" - LOG_INFO "检查是否已安装sisu-inject软件包" - rpm -q sisu-inject > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "sisu-inject软件包已安装,标记为已安装状态" - INSTALLED=1 - else - LOG_INFO "sisu-inject软件包未安装,标记为未安装状态" - INSTALLED=0 - fi - LOG_INFO "检查yum源中是否有sisu-inject软件包" - dnf list available sisu-inject > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到sisu-inject软件包" - exit 255 - fi - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装sisu-inject软件包" - dnf install -y sisu-inject - CHECK_RESULT $? 0 0 "安装sisu-inject软件包失败" - fi - LOG_INFO "测试sisu-inject命令的--help参数" - sisu-inject --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "sisu-inject命令不支持--help参数" - LOG_INFO "测试sisu-inject命令的-h参数" - sisu-inject -h > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "sisu-inject命令不支持-h参数" - LOG_INFO "测试sisu-inject命令的无效参数" - sisu-inject --invalid-param > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "sisu-inject命令正确识别无效参数" - else - LOG_ERROR "sisu-inject命令未正确处理无效参数" - exit 255 - fi - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载sisu-inject软件包" - dnf remove -y sisu-inject - CHECK_RESULT $? 0 0 "卸载sisu-inject软件包失败" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_install.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_install.sh deleted file mode 100644 index eb3a94cda5f..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_install.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-28 -# @License : Mulan PSL v2 -# @Desc : 测试软件包的基本安装功能,验证能否成功安装到系统 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试sisu-inject软件包的基本安装功能" - LOG_INFO "步骤1: 检查sisu-inject软件包是否在yum源中可用" - dnf list available sisu-inject > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "sisu-inject软件包在yum源中不存在" - exit 255 - fi - - LOG_INFO "步骤2: 检查当前系统是否已安装sisu-inject" - rpm -q sisu-inject > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "sisu-inject已安装,将保持安装状态" - INSTALLED=true - else - LOG_INFO "sisu-inject未安装,将执行安装测试" - INSTALLED=false - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3: 安装sisu-inject软件包" - dnf install -y sisu-inject - CHECK_RESULT $? 0 0 "sisu-inject软件包安装失败" - LOG_INFO "sisu-inject软件包安装成功" - fi - - LOG_INFO "步骤4: 验证sisu-inject命令基本功能" - sisu-inject --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "sisu-inject命令执行失败" - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤5: 清理环境,卸载sisu-inject软件包" - dnf remove -y sisu-inject - CHECK_RESULT $? 0 0 "sisu-inject软件包卸载失败" - LOG_INFO "sisu-inject软件包卸载成功" - else - LOG_INFO "步骤5: 保持sisu-inject软件包安装状态,无需卸载" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_log_output.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_log_output.sh deleted file mode 100644 index 25e5e16d3ea..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_log_output.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-28 -# @License : Mulan PSL v2 -# @Desc : 测试软件包或服务在正常操作下的日志输出功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断sisu-inject软件包是否已安装 - LOG_INFO "检查sisu-inject软件包是否已安装" - if rpm -q sisu-inject &>/dev/null; then - LOG_INFO "sisu-inject软件包已安装,脚本结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "sisu-inject软件包未安装,将在测试中安装并在结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有sisu-inject软件包 - LOG_INFO "检查yum源中是否有sisu-inject软件包" - dnf list available sisu-inject &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有sisu-inject软件包" - exit 255 - fi - - # 如果未安装,则安装sisu-inject软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装sisu-inject软件包" - dnf install -y sisu-inject - CHECK_RESULT $? 0 0 "安装sisu-inject软件包失败" - fi - - # 检查sisu-inject命令是否存在 - LOG_INFO "检查sisu-inject命令是否存在" - which sisu-inject &>/dev/null - CHECK_RESULT $? 0 0 "sisu-inject命令不存在" - - # 测试sisu-inject命令的--help参数 - LOG_INFO "测试sisu-inject命令的--help参数" - sisu-inject --help &>/dev/null - CHECK_RESULT $? 0 0 "sisu-inject命令不支持--help参数" - - # 测试sisu-inject命令的日志输出功能 - LOG_INFO "测试sisu-inject命令的日志输出功能" - LOG_OUTPUT=$(sisu-inject --version 2>&1) - if [ -n "$LOG_OUTPUT" ]; then - LOG_INFO "sisu-inject命令成功输出日志: $LOG_OUTPUT" - CHECK_RESULT $? 0 0 "sisu-inject命令未输出预期日志" - else - LOG_ERROR "sisu-inject命令未输出任何日志" - exit 1 - fi - - # 清理环境:如果脚本开始时未安装,则卸载sisu-inject软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载sisu-inject软件包" - dnf remove -y sisu-inject - CHECK_RESULT $? 0 0 "卸载sisu-inject软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_service_manage.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_service_manage.sh deleted file mode 100644 index 48aac72742d..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_service_manage.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-28 -# @License : Mulan PSL v2 -# @Desc : 测试服务管理(启动、停止、状态查询)的核心流程 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试服务管理(启动、停止、状态查询)的核心流程" - - # 定义软件包名称 - PACKAGE_NAME="sisu-inject-function-service-manage" - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中" - exit 255 - fi - - # 步骤2:检查环境是否已安装软件包 - LOG_INFO "步骤2:检查环境是否已安装软件包" - if dnf list installed "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,测试结束后保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试结束后卸载" - INSTALLED_BEFORE=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4:检查服务管理命令是否存在 - LOG_INFO "步骤4:检查服务管理命令是否存在" - if ! command -v sisu-inject-function-service-manage &>/dev/null; then - LOG_ERROR "命令 sisu-inject-function-service-manage 不存在" - exit 255 - fi - - # 步骤5:测试服务启动 - LOG_INFO "步骤5:测试服务启动" - sisu-inject-function-service-manage start - CHECK_RESULT $? 0 0 "服务启动失败" - - # 步骤6:测试服务状态查询 - LOG_INFO "步骤6:测试服务状态查询" - sisu-inject-function-service-manage status - CHECK_RESULT $? 0 0 "服务状态查询失败" - - # 步骤7:测试服务停止 - LOG_INFO "步骤7:测试服务停止" - sisu-inject-function-service-manage stop - CHECK_RESULT $? 0 0 "服务停止失败" - - # 步骤8:测试服务状态查询(停止后) - LOG_INFO "步骤8:测试服务状态查询(停止后)" - sisu-inject-function-service-manage status - CHECK_RESULT $? 0 0 "服务状态查询失败" - - # 步骤9:清理环境,如果测试前未安装则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤9:卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "步骤9:测试前软件包已安装,保持安装状态" - fi - - LOG_INFO "测试服务管理(启动、停止、状态查询)的核心流程完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_uninstall.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_uninstall.sh deleted file mode 100644 index c46a937d205..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_uninstall.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-28 -# @License : Mulan PSL v2 -# @Desc : 测试软件包的卸载功能,验证能否完全移除且不影响系统 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试软件包的卸载功能,验证能否完全移除且不影响系统" - LOG_INFO "步骤1: 检查sisu-inject软件包是否在yum源中" - dnf list available sisu-inject &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到sisu-inject软件包" - exit 255 - fi - LOG_INFO "sisu-inject软件包存在于yum源中" - - LOG_INFO "步骤2: 检查sisu-inject软件包是否已安装" - rpm -q sisu-inject &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "sisu-inject软件包已安装,测试结束后将保持安装状态" - INSTALLED="true" - else - LOG_INFO "sisu-inject软件包未安装,将进行安装作为测试步骤" - INSTALLED="false" - LOG_INFO "步骤3: 安装sisu-inject软件包" - dnf install -y sisu-inject - CHECK_RESULT $? 0 0 "安装sisu-inject软件包失败" - fi - - LOG_INFO "步骤4: 验证sisu-inject软件包功能" - sisu-inject --help &>/dev/null - CHECK_RESULT $? 0 0 "sisu-inject命令无法执行,参数可能不支持" - - LOG_INFO "步骤5: 卸载sisu-inject软件包" - dnf remove -y sisu-inject - CHECK_RESULT $? 0 0 "卸载sisu-inject软件包失败" - - LOG_INFO "步骤6: 验证sisu-inject软件包是否完全移除" - rpm -q sisu-inject &>/dev/null - CHECK_RESULT $? 1 0 "sisu-inject软件包未完全移除" - - LOG_INFO "步骤7: 验证系统未受影响" - # 检查系统关键服务状态 - systemctl status &>/dev/null - CHECK_RESULT $? 0 0 "系统服务状态异常" - - LOG_INFO "步骤8: 环境恢复" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "恢复环境:重新安装sisu-inject软件包" - dnf install -y sisu-inject - CHECK_RESULT $? 0 0 "重新安装sisu-inject软件包失败" - else - LOG_INFO "保持sisu-inject软件包安装状态" - fi - - LOG_INFO "测试完成:软件包卸载功能验证通过,系统未受影响" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_upgrade.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_upgrade.sh deleted file mode 100644 index 9a41f677cf4..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_upgrade.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-28 -# @License : Mulan PSL v2 -# @Desc : 测试软件包的升级功能,验证从旧版本升级到新版本的过程 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装sisu-inject软件包 - LOG_INFO "检查sisu-inject软件包是否已安装" - if dnf list installed sisu-inject &>/dev/null; then - LOG_INFO "sisu-inject软件包已安装" - INSTALLED="true" - else - LOG_INFO "sisu-inject软件包未安装" - INSTALLED="false" - fi - - # 检查yum源中是否有sisu-inject软件包 - LOG_INFO "检查yum源中是否有sisu-inject软件包" - if ! dnf list available sisu-inject &>/dev/null; then - LOG_ERROR "yum源中没有sisu-inject软件包" - exit 255 - fi - - # 检查yum源中是否有sisu-inject的旧版本软件包 - LOG_INFO "检查yum源中是否有sisu-inject的旧版本软件包" - OLD_VERSION=$(dnf list available sisu-inject --showduplicates | grep -v "最新版本" | head -2 | tail -1 | awk "{print $2}") - if [ -z "$OLD_VERSION" ]; then - LOG_ERROR "yum源中没有sisu-inject的旧版本软件包" - exit 255 - fi - - # 检查yum源中是否有sisu-inject的新版本软件包 - LOG_INFO "检查yum源中是否有sisu-inject的新版本软件包" - NEW_VERSION=$(dnf list available sisu-inject --showduplicates | grep -v "最新版本" | head -3 | tail -1 | awk "{print $2}") - if [ -z "$NEW_VERSION" ]; then - LOG_ERROR "yum源中没有sisu-inject的新版本软件包" - exit 255 - fi - - # 如果环境未安装,则安装旧版本软件包作为测试步骤 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装sisu-inject旧版本软件包:$OLD_VERSION" - dnf install -y sisu-inject-$OLD_VERSION - CHECK_RESULT $? 0 0 "安装sisu-inject旧版本软件包失败" - fi - - # 验证当前安装的版本 - LOG_INFO "验证当前安装的sisu-inject版本" - CURRENT_VERSION=$(rpm -q sisu-inject --qf "%{VERSION}-%{RELEASE}") - CHECK_RESULT $? 0 0 "获取当前sisu-inject版本失败" - LOG_INFO "当前安装的sisu-inject版本为:$CURRENT_VERSION" - - # 升级软件包到新版本 - LOG_INFO "升级sisu-inject软件包到新版本:$NEW_VERSION" - dnf upgrade -y sisu-inject-$NEW_VERSION - CHECK_RESULT $? 0 0 "升级sisu-inject软件包失败" - - # 验证升级后的版本 - LOG_INFO "验证升级后的sisu-inject版本" - UPGRADED_VERSION=$(rpm -q sisu-inject --qf "%{VERSION}-%{RELEASE}") - CHECK_RESULT $? 0 0 "获取升级后sisu-inject版本失败" - LOG_INFO "升级后的sisu-inject版本为:$UPGRADED_VERSION" - - # 检查升级后的版本是否为新版本 - LOG_INFO "检查升级后的版本是否为新版本" - if [ "$UPGRADED_VERSION" = "$NEW_VERSION" ]; then - LOG_INFO "sisu-inject软件包成功升级到新版本" - else - LOG_ERROR "sisu-inject软件包升级失败,当前版本:$UPGRADED_VERSION,期望版本:$NEW_VERSION" - exit 1 - fi - - # 清理环境,恢复到之前的状态 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载sisu-inject软件包" - dnf remove -y sisu-inject - CHECK_RESULT $? 0 0 "卸载sisu-inject软件包失败" - LOG_INFO "环境已恢复到未安装sisu-inject的状态" - else - LOG_INFO "保持sisu-inject软件包安装状态" - fi - - LOG_INFO "sisu-inject软件包升级功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_version.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_version.sh deleted file mode 100644 index b9d52bf1d12..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_function_version.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-28 -# @License : Mulan PSL v2 -# @Desc : 测试查询软件包版本信息的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试查询软件包版本信息的功能" - - # 定义要测试的软件包名称 - PACKAGE_NAME="sisu-inject-function" - - # 检查yum源中是否存在该软件包 - LOG_INFO "检查yum源中是否存在软件包: ${PACKAGE_NAME}" - dnf list available ${PACKAGE_NAME} > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到软件包: ${PACKAGE_NAME}" - exit 255 - fi - - # 检查软件包是否已安装 - LOG_INFO "检查软件包是否已安装" - IS_INSTALLED=0 - if rpm -q ${PACKAGE_NAME} > /dev/null 2>&1; then - LOG_INFO "软件包已安装" - IS_INSTALLED=1 - else - LOG_INFO "软件包未安装,将进行安装" - fi - - # 如果未安装,则安装软件包 - if [ ${IS_INSTALLED} -eq 0 ]; then - LOG_INFO "安装软件包: ${PACKAGE_NAME}" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试查询软件包版本信息的功能 - LOG_INFO "测试查询软件包版本信息" - rpm -q ${PACKAGE_NAME} --qf "%{VERSION}-%{RELEASE}\n" - CHECK_RESULT $? 0 0 "查询软件包版本信息失败" - - # 测试其他相关命令参数 - LOG_INFO "测试查询软件包详细信息" - rpm -qi ${PACKAGE_NAME} > /dev/null - CHECK_RESULT $? 0 0 "查询软件包详细信息失败" - - # 测试无效参数(预期失败) - LOG_INFO "测试无效参数(预期失败)" - rpm -q ${PACKAGE_NAME} --invalid-param 2>/dev/null - if [ $? -eq 0 ]; then - LOG_ERROR "无效参数不应被支持" - exit 255 - fi - - # 环境清理:如果测试前未安装,则卸载软件包 - if [ ${IS_INSTALLED} -eq 0 ]; then - LOG_INFO "清理环境:卸载软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_install.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_install.sh deleted file mode 100644 index b08f8477da5..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_install.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-06-17 -# @License : Mulan PSL v2 -# @Desc : 测试sisu-inject软件包的安装功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - - # 检查sisu-inject软件包是否已在yum源中 - LOG_INFO "检查sisu-inject软件包是否在yum源中" - dnf list available sisu-inject &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "sisu-inject软件包不在yum源中" - exit 255 - fi - - # 检查sisu-inject是否已安装 - LOG_INFO "检查sisu-inject是否已安装" - rpm -q sisu-inject &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "sisu-inject已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "sisu-inject未安装,开始安装" - INSTALLED=false - fi - - # 如果未安装,则安装sisu-inject - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装sisu-inject软件包" - dnf install -y sisu-inject - CHECK_RESULT $? 0 0 "安装sisu-inject失败" - fi - - # 验证sisu-inject命令是否可用 - LOG_INFO "验证sisu-inject命令是否可用" - which sisu-inject &> /dev/null - CHECK_RESULT $? 0 0 "sisu-inject命令不可用" - - # 测试sisu-inject的基本功能(假设支持--version参数) - LOG_INFO "测试sisu-inject的--version参数" - sisu-inject --version &> /dev/null - CHECK_RESULT $? 0 0 "sisu-inject --version执行失败" - - # 测试不支持的参数(假设不支持--invalid-param) - LOG_INFO "测试不支持的参数--invalid-param" - sisu-inject --invalid-param &> /dev/null - if [ $? -ne 255 ]; then - LOG_ERROR "--invalid-param参数未被正确处理" - exit 255 - fi - - # 清理环境:如果脚本开始时未安装,则卸载sisu-inject - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载sisu-inject软件包" - dnf remove -y sisu-inject - CHECK_RESULT $? 0 0 "卸载sisu-inject失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_rollback.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_rollback.sh deleted file mode 100644 index cc0ef7c0d3b..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_rollback.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-06-17 -# @License : Mulan PSL v2 -# @Desc : 测试sisu-inject软件包的回滚功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - - # 检查sisu-inject软件包是否已安装 - LOG_INFO "检查sisu-inject软件包是否已安装" - rpm -q sisu-inject > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "sisu-inject软件包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "sisu-inject软件包未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在sisu-inject软件包 - LOG_INFO "检查yum源中是否存在sisu-inject软件包" - dnf list available sisu-inject > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在sisu-inject软件包" - exit 255 - fi - - # 安装sisu-inject软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装sisu-inject软件包" - dnf install -y sisu-inject > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装sisu-inject软件包失败" - fi - - # 测试回滚功能 - LOG_INFO "测试sisu-inject的回滚功能" - sisu-inject --rollback > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "回滚功能测试失败" - - # 清理环境:如果之前未安装,则卸载sisu-inject软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载sisu-inject软件包" - dnf remove -y sisu-inject > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载sisu-inject软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_config.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_config.sh deleted file mode 100644 index 01a7d3f40d3..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_config.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-06-17 -# @License : Mulan PSL v2 -# @Desc : 测试sisu-inject软件包服务的配置功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - - # 检查sisu-inject软件包是否在yum源中 - LOG_INFO "检查sisu-inject软件包是否在yum源中" - dnf list available sisu-inject &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "sisu-inject软件包不在yum源中" - exit 255 - fi - - # 检查环境是否已安装sisu-inject软件包 - LOG_INFO "检查环境是否已安装sisu-inject软件包" - rpm -q sisu-inject &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "sisu-inject软件包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "sisu-inject软件包未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 如果未安装,则安装sisu-inject软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装sisu-inject软件包" - dnf install -y sisu-inject &> /dev/null - CHECK_RESULT $? 0 0 "安装sisu-inject软件包失败" - fi - - # 测试sisu-inject服务的配置功能 - LOG_INFO "测试sisu-inject服务的配置功能" - - # 检查服务是否存在 - LOG_INFO "检查sisu-inject服务是否存在" - systemctl list-unit-files | grep sisu-inject.service &> /dev/null - CHECK_RESULT $? 0 0 "sisu-inject服务不存在" - - # 检查服务配置参数是否支持 - LOG_INFO "检查服务配置参数是否支持" - systemctl show sisu-inject.service --property=Restart &> /dev/null - CHECK_RESULT $? 0 0 "Restart参数不支持" - - # 启动服务并检查状态 - LOG_INFO "启动sisu-inject服务并检查状态" - systemctl start sisu-inject.service &> /dev/null - CHECK_RESULT $? 0 0 "启动sisu-inject服务失败" - - systemctl status sisu-inject.service &> /dev/null - CHECK_RESULT $? 0 0 "sisu-inject服务状态异常" - - # 停止服务并检查状态 - LOG_INFO "停止sisu-inject服务并检查状态" - systemctl stop sisu-inject.service &> /dev/null - CHECK_RESULT $? 0 0 "停止sisu-inject服务失败" - - systemctl status sisu-inject.service | grep inactive &> /dev/null - CHECK_RESULT $? 0 0 "sisu-inject服务未停止" - - # 恢复环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载sisu-inject软件包以恢复环境" - dnf remove -y sisu-inject &> /dev/null - CHECK_RESULT $? 0 0 "卸载sisu-inject软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_disable.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_disable.sh deleted file mode 100644 index f7bbbe1ac10..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_disable.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-06-17 -# @License : Mulan PSL v2 -# @Desc : 测试sisu-inject软件包服务的禁用开机自启功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试sisu-inject软件包服务的禁用开机自启功能" - - # 检查sisu-inject软件包是否已安装 - if ! rpm -q sisu-inject &>/dev/null; then - LOG_INFO "sisu-inject软件包未安装,将进行安装测试" - INSTALLED=false - else - LOG_INFO "sisu-inject软件包已安装,保持安装状态" - INSTALLED=true - fi - - # 检查yum源中是否有sisu-inject软件包 - LOG_INFO "检查yum源中是否存在sisu-inject软件包" - if ! dnf list available sisu-inject &>/dev/null; then - LOG_ERROR "yum源中未找到sisu-inject软件包" - exit 255 - fi - - # 如果未安装,则安装sisu-inject软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装sisu-inject软件包" - dnf install -y sisu-inject - CHECK_RESULT $? 0 0 "安装sisu-inject软件包失败" - fi - - # 检查sisu-inject服务是否已禁用开机自启 - LOG_INFO "检查sisu-inject服务是否已禁用开机自启" - systemctl is-enabled sisu-inject &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "尝试禁用sisu-inject服务的开机自启" - systemctl disable sisu-inject - CHECK_RESULT $? 0 0 "禁用sisu-inject服务开机自启失败" - else - LOG_INFO "sisu-inject服务已禁用开机自启" - fi - - # 验证服务是否成功禁用开机自启 - LOG_INFO "验证sisu-inject服务是否成功禁用开机自启" - systemctl is-enabled sisu-inject &>/dev/null - CHECK_RESULT $? 1 0 "sisu-inject服务未成功禁用开机自启" - - # 恢复环境:如果脚本开始时未安装,则卸载sisu-inject软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载sisu-inject软件包以恢复环境" - dnf remove -y sisu-inject - CHECK_RESULT $? 0 0 "卸载sisu-inject软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_enable.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_enable.sh deleted file mode 100644 index 18ea75050e7..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_enable.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-06-17 -# @License : Mulan PSL v2 -# @Desc : 测试sisu-inject软件包服务的开机自启功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - - # 检查sisu-inject软件包是否已安装 - LOG_INFO "检查sisu-inject软件包是否已安装" - rpm -q sisu-inject > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "sisu-inject软件包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "sisu-inject软件包未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在sisu-inject软件包 - LOG_INFO "检查yum源中是否存在sisu-inject软件包" - dnf list available sisu-inject > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到sisu-inject软件包" - exit 255 - fi - - # 如果未安装,则安装sisu-inject软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装sisu-inject软件包" - dnf install -y sisu-inject > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装sisu-inject软件包失败" - fi - - # 检查sisu-inject服务是否支持enable参数 - LOG_INFO "检查sisu-inject服务是否支持enable参数" - systemctl enable sisu-inject --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "sisu-inject服务不支持enable参数" - if [ "$INSTALLED" = false ]; then - dnf remove -y sisu-inject > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载sisu-inject软件包失败" - fi - exit 255 - fi - - # 测试sisu-inject服务的开机自启功能 - LOG_INFO "测试sisu-inject服务的开机自启功能" - systemctl enable sisu-inject > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "启用sisu-inject服务开机自启失败" - - # 验证服务是否已启用开机自启 - LOG_INFO "验证sisu-inject服务是否已启用开机自启" - systemctl is-enabled sisu-inject > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "验证sisu-inject服务开机自启状态失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包;否则保持安装状态不变。 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载sisu-inject软件包" - systemctl disable sisu-inject > /dev/null 2>&1 # Disable before uninstall to avoid leaving traces. - dnf remove -y sisu-inject > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载sisu-inject软件包失败" - else - LOG_INFO "清理环境:保持sisu-inject软件包的安装状态不变" - fi - - LOG_INFO "测试完成,环境已恢复初始状态" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_log.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_log.sh deleted file mode 100644 index 6999ab18c45..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_log.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-06-17 -# @License : Mulan PSL v2 -# @Desc : 测试sisu-inject软件包服务的查看日志功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - - # 检查sisu-inject软件包是否已安装 - LOG_INFO "检查sisu-inject软件包是否已安装" - if rpm -q sisu-inject &>/dev/null; then - LOG_INFO "sisu-inject软件包已安装" - INSTALLED=true - else - LOG_INFO "sisu-inject软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否有sisu-inject软件包 - LOG_INFO "检查yum源中是否有sisu-inject软件包" - if ! dnf list available sisu-inject &>/dev/null; then - LOG_ERROR "yum源中未找到sisu-inject软件包" - exit 255 - fi - - # 如果未安装,则安装sisu-inject软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装sisu-inject软件包" - dnf install -y sisu-inject - CHECK_RESULT $? 0 0 "安装sisu-inject软件包失败" - fi - - # 测试sisu-inject服务的查看日志功能 - LOG_INFO "测试sisu-inject服务的查看日志功能" - systemctl status sisu-inject --no-pager --full | grep -q "日志" - CHECK_RESULT $? 0 0 "查看日志功能测试失败" - - # 恢复环境:如果脚本开始时未安装,则卸载sisu-inject软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载sisu-inject软件包" - dnf remove -y sisu-inject - CHECK_RESULT $? 0 0 "卸载sisu-inject软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_reload.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_reload.sh deleted file mode 100644 index 786bcdd1515..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_reload.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-06-17 -# @License : Mulan PSL v2 -# @Desc : 测试sisu-inject软件包服务的重新加载配置功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查sisu-inject软件包是否在yum源中 - LOG_INFO "检查sisu-inject软件包是否在yum源中" - dnf list available sisu-inject &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有sisu-inject软件包" - exit 255 - fi - - # 检查sisu-inject是否已安装 - LOG_INFO "检查sisu-inject是否已安装" - rpm -q sisu-inject &> /dev/null - is_installed=$? - - # 如果未安装,则安装sisu-inject - if [ $is_installed -ne 0 ]; then - LOG_INFO "安装sisu-inject软件包" - dnf install -y sisu-inject - CHECK_RESULT $? 0 0 "安装sisu-inject失败" - fi - - # 检查sisu-inject服务是否存在 - LOG_INFO "检查sisu-inject服务是否存在" - systemctl list-unit-files | grep sisu-inject.service &> /dev/null - CHECK_RESULT $? 0 0 "sisu-inject服务不存在" - - # 启动sisu-inject服务(如果未启动) - LOG_INFO "启动sisu-inject服务" - systemctl is-active sisu-inject.service &> /dev/null - if [ $? -ne 0 ]; then - systemctl start sisu-inject.service - CHECK_RESULT $? 0 0 "启动sisu-inject服务失败" - fi - - # 测试重新加载配置功能 - LOG_INFO "测试重新加载配置功能" - systemctl reload sisu-inject.service - CHECK_RESULT $? 0 0 "重新加载配置失败" - - # 检查服务状态是否正常 - LOG_INFO "检查服务状态是否正常" - systemctl is-active sisu-inject.service &> /dev/null - CHECK_RESULT $? 0 0 "服务状态异常" - - # 恢复环境:如果脚本开始时未安装,则卸载软件包 - if [ $is_installed -ne 0 ]; then - LOG_INFO "卸载sisu-inject软件包" - dnf remove -y sisu-inject - CHECK_RESULT $? 0 0 "卸载sisu-inject失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_restart.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_restart.sh deleted file mode 100644 index 0a74f0d1aa6..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_restart.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-06-17 -# @License : Mulan PSL v2 -# @Desc : 测试sisu-inject软件包服务的重启功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查sisu-inject软件包是否已安装 - LOG_INFO "检查sisu-inject软件包是否已安装" - if rpm -q sisu-inject &>/dev/null; then - LOG_INFO "sisu-inject软件包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "sisu-inject软件包未安装,脚本结束后将卸载该软件包" - INSTALLED=false - fi - - # 检查yum源中是否有sisu-inject软件包 - LOG_INFO "检查yum源中是否有sisu-inject软件包" - if ! dnf list available sisu-inject &>/dev/null; then - LOG_ERROR "yum源中未找到sisu-inject软件包" - exit 255 - fi - - # 如果未安装,则安装sisu-inject软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装sisu-inject软件包" - dnf install -y sisu-inject - CHECK_RESULT $? 0 0 "安装sisu-inject软件包失败" - fi - - # 检查sisu-inject服务是否存在 - LOG_INFO "检查sisu-inject服务是否存在" - systemctl cat sisu-inject &>/dev/null - CHECK_RESULT $? 0 0 "sisu-inject服务不存在" - - # 测试服务重启功能 - LOG_INFO "测试sisu-inject服务重启功能" - systemctl restart sisu-inject - CHECK_RESULT $? 0 0 "重启sisu-inject服务失败" - - # 检查服务状态是否正常 - LOG_INFO "检查sisu-inject服务状态" - systemctl status sisu-inject | grep -q "active (running)" - CHECK_RESULT $? 0 0 "sisu-inject服务未正常运行" - - # 环境恢复:如果脚本开始时未安装,则卸载sisu-inject软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载sisu-inject软件包以恢复环境" - dnf remove -y sisu-inject - CHECK_RESULT $? 0 0 "卸载sisu-inject软件包失败" - fi - - LOG_INFO "测试脚本执行完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_restart_failure.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_restart_failure.sh deleted file mode 100644 index a0ae60a6d7f..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_restart_failure.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-06-18 -# @License : Mulan PSL v2 -# @Desc : 测试sisu-inject软件包服务在异常情况下的重启功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - - # 检查sisu-inject软件包是否已安装 - LOG_INFO "检查sisu-inject软件包是否已安装" - if rpm -q sisu-inject &> /dev/null; then - LOG_INFO "sisu-inject软件包已安装" - INSTALLED=true - else - LOG_INFO "sisu-inject软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在sisu-inject软件包 - LOG_INFO "检查yum源中是否存在sisu-inject软件包" - if ! dnf list available sisu-inject &> /dev/null; then - LOG_ERROR "yum源中不存在sisu-inject软件包" - exit 255 - fi - - # 如果未安装,则安装sisu-inject软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装sisu-inject软件包" - dnf install -y sisu-inject - CHECK_RESULT $? 0 0 "安装sisu-inject软件包失败" - fi - - # 检查sisu-inject服务是否正常运行 - LOG_INFO "检查sisu-inject服务是否正常运行" - systemctl is-active sisu-inject &> /dev/null - CHECK_RESULT $? 0 0 "sisu-inject服务未运行" - - # 模拟服务异常重启失败场景 - LOG_INFO "模拟服务异常重启失败场景" - systemctl stop sisu-inject - CHECK_RESULT $? 0 0 "停止sisu-inject服务失败" - - # 尝试重启服务并检查结果 - LOG_INFO "尝试重启sisu-inject服务并检查结果" - systemctl start sisu-inject - CHECK_RESULT $? 0 0 "重启sisu-inject服务失败" - - # 恢复环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载sisu-inject软件包以恢复环境" - dnf remove -y sisu-inject - CHECK_RESULT $? 0 0 "卸载sisu-inject软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_start.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_start.sh deleted file mode 100644 index f8e1cb35574..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_start.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-06-17 -# @License : Mulan PSL v2 -# @Desc : 测试sisu-inject软件包服务的启动功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查sisu-inject软件包是否在yum源中 - LOG_INFO "检查yum源中是否存在sisu-inject软件包..." - dnf list available sisu-inject &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到sisu-inject软件包,退出测试" - exit 255 - fi - - # 检查sisu-inject是否已安装 - LOG_INFO "检查sisu-inject软件包是否已安装..." - rpm -q sisu-inject &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "sisu-inject软件包已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "sisu-inject软件包未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 若未安装,则安装sisu-inject软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装sisu-inject软件包..." - dnf install -y sisu-inject - CHECK_RESULT $? 0 0 "安装sisu-inject软件包失败" - fi - - # 检查sisu-inject服务是否支持启动参数 - LOG_INFO "检查sisu-inject服务是否支持启动参数..." - systemctl list-unit-files | grep sisu-inject.service &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "sisu-inject服务不支持启动参数,退出测试" - exit 255 - fi - - # 启动sisu-inject服务并检查状态 - LOG_INFO "启动sisu-inject服务..." - systemctl start sisu-inject.service - CHECK_RESULT $? 0 0 "启动sisu-inject服务失败" - - LOG_INFO "检查sisu-inject服务状态..." - systemctl status sisu-inject.service &>/dev/null - CHECK_RESULT $? 0 0 "sisu-inject服务未正常运行" - - # 停止sisu-inject服务并检查状态(恢复环境) - LOG_INFO "停止sisu-inject服务..." - systemctl stop sisu-inject.service - CHECK_RESULT $? 0 0 "停止sisu-inject服务失败" - - # 若测试前未安装,则卸载sisu-inect软件包(恢复环境) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载sisu-inect软件包..." - dnf remove -y sisu-inect &>/dev/null # 假设卸载命令正确,实际需根据软件包名称调整 - CHECK_RESULT $? 0 0 "卸载sisu-inect软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_status.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_status.sh deleted file mode 100644 index e9facd1f567..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_status.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-06-17 -# @License : Mulan PSL v2 -# @Desc : 测试sisu-inject软件包服务的查询状态功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查sisu-inject软件包是否已安装 - LOG_INFO "检查sisu-inject软件包是否已安装" - rpm -q sisu-inject > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "sisu-inject软件包已安装" - INSTALLED=true - else - LOG_INFO "sisu-inject软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否有sisu-inject软件包 - LOG_INFO "检查yum源中是否有sisu-inject软件包" - dnf list available sisu-inject > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有sisu-inject软件包" - exit 255 - fi - - # 如果未安装,则安装sisu-inject软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装sisu-inject软件包" - dnf install -y sisu-inject > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装sisu-inject软件包失败" - LOG_INFO "sisu-inject软件包安装成功" - fi - - # 测试查询服务状态功能 - LOG_INFO "测试查询sisu-inject服务状态功能" - systemctl status sisu-inject > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "查询sisu-inject服务状态失败" - - # 如果之前未安装,则卸载sisu-inject软件包以恢复环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载sisu-inject软件包以恢复环境" - dnf remove -y sisu-inject > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载sisu-inject软件包失败" - LOG_INFO "环境恢复完成" - else - LOG_INFO "保持sisu-inject软件包的安装状态" - fi - - LOG_INFO "测试脚本执行完毕" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_stop.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_service_stop.sh deleted file mode 100644 index 3121a75065c..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_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-06-17 -# @License : Mulan PSL v2 -# @Desc : 测试sisu-inject软件包服务的停止功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查sisu-inject软件包是否已安装 - LOG_INFO "检查sisu-inject软件包是否已安装" - if rpm -q sisu-inject &>/dev/null; then - LOG_INFO "sisu-inject软件包已安装" - INSTALLED=true - else - LOG_INFO "sisu-inject软件包未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在sisu-inject软件包 - LOG_INFO "检查yum源中是否存在sisu-inject软件包" - if ! dnf list available sisu-inject &>/dev/null; then - LOG_ERROR "yum源中不存在sisu-inject软件包" - exit 255 - fi - - # 如果未安装,则安装sisu-inject软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装sisu-inject软件包" - dnf install -y sisu-inject - CHECK_RESULT $? 0 0 "安装sisu-inject软件包失败" - fi - - # 检查sisu-inject服务是否已停止 - LOG_INFO "测试sisu-inject服务停止功能" - systemctl stop sisu-inject &>/dev/null - CHECK_RESULT $? 0 0 "停止sisu-inject服务失败" - - # 验证服务状态是否为停止 - LOG_INFO "验证sisu-inject服务状态是否为停止" - systemctl is-active sisu-inject | grep -q 'inactive' - CHECK_RESULT $? 0 0 "sisu-inject服务未成功停止" - - # 恢复环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载sisu-inject软件包" - dnf remove -y sisu-inject - CHECK_RESULT $? 0 0 "卸载sisu-inject软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_uninstall.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_uninstall.sh deleted file mode 100644 index 90ab5b7733e..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_uninstall.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-06-17 -# @License : Mulan PSL v2 -# @Desc : 测试sisu-inject软件包的卸载功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - - # 检查sisu-inject软件包是否已安装 - LOG_INFO "检查sisu-inject软件包是否已安装" - rpm -q sisu-inject > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "sisu-inject软件包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "sisu-inject软件包未安装,脚本结束后将卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在sisu-inject软件包 - LOG_INFO "检查yum源中是否存在sisu-inject软件包" - dnf list available sisu-inject > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到sisu-inject软件包" - exit 255 - fi - - # 如果未安装,则安装sisu-inject软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装sisu-inject软件包" - dnf install -y sisu-inject > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装sisu-inject软件包失败" - fi - - # 测试卸载功能 - LOG_INFO "测试卸载sisu-inject软件包" - dnf remove -y sisu-inject > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载sisu-inject软件包失败" - - # 如果最初未安装,则重新安装以恢复环境;否则保持卸载状态(根据需求) - if [ "$INSTALLED" = false ]; then - LOG_INFO "恢复环境:重新安装sisu-inject软件包" - dnf install -y sisu-inject > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "恢复环境时重新安装sisu-inject软件包失败" - else - LOG_INFO "环境恢复:保持卸载状态(原为已安装状态)" - fi - - LOG_INFO "测试完成:sisu-inject软件包的卸载功能验证通过" - - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_upgrade.sh b/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_upgrade.sh deleted file mode 100644 index c93138c66eb..00000000000 --- a/testcases/function_test/pkg_test/sisu/sisu-inject/test_sisu-inject_upgrade.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-06-17 -# @License : Mulan PSL v2 -# @Desc : 测试sisu-inject软件包的升级功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查sisu-inject软件包是否已安装 - LOG_INFO "检查sisu-inject软件包是否已安装" - rpm -q sisu-inject &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "sisu-inject软件包已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "sisu-inject软件包未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有sisu-inject软件包 - LOG_INFO "检查yum源中是否有sisu-inject软件包" - dnf list available sisu-inject &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到sisu-inject软件包" - exit 255 - fi - - # 安装sisu-inject软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装sisu-inject软件包" - dnf install -y sisu-inject &> /dev/null - CHECK_RESULT $? 0 0 "安装sisu-inject软件包失败" - fi - - # 测试升级功能 - LOG_INFO "测试sisu-inject软件包的升级功能" - dnf upgrade -y sisu-inject &> /dev/null - CHECK_RESULT $? 0 0 "升级sisu-inject软件包失败" - - # 验证升级后的版本是否可用(假设通过运行命令验证) - LOG_INFO "验证升级后的sisu-inject是否可用" - sisu-inject --version &> /dev/null - CHECK_RESULT $? 0 0 "验证升级后的sisu-inject失败" - - # 清理环境:如果最初未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载sisu-inject软件包" - dnf remove -y sisu-inject &> /dev/null - CHECK_RESULT $? 0 0 "卸载sisu-inject软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/slf4j/slf4j-jcl/test_slf4j-jcl_function_binding.sh b/testcases/function_test/pkg_test/slf4j/slf4j-jcl/test_slf4j-jcl_function_binding.sh deleted file mode 100644 index fe17db64a41..00000000000 --- a/testcases/function_test/pkg_test/slf4j/slf4j-jcl/test_slf4j-jcl_function_binding.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-04 -# @License : Mulan PSL v2 -# @Desc : 测试slf4j-jcl是否能正确绑定到Apache Commons Logging,验证桥接功能是否正常 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试slf4j-jcl是否能正确绑定到Apache Commons Logging,验证桥接功能是否正常" - - LOG_INFO "步骤1: 检查环境是否已安装slf4j-jcl" - if dnf list installed | grep -q "slf4j-jcl"; then - LOG_INFO "slf4j-jcl已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "slf4j-jcl未安装,将在测试步骤中安装" - INSTALLED=false - fi - - LOG_INFO "步骤2: 检查yum源中是否有slf4j-jcl软件包" - if ! dnf list available | grep -q "slf4j-jcl"; then - LOG_ERROR "yum源中未找到slf4j-jcl软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3: 安装slf4j-jcl软件包" - dnf install -y slf4j-jcl - CHECK_RESULT $? 0 0 "安装slf4j-jcl失败" - fi - - LOG_INFO "步骤4: 验证slf4j-jcl桥接功能" - TEST_CLASS="org.slf4j.impl.JCLLoggerFactory" - if java -cp "/usr/share/java/slf4j-jcl.jar:/usr/share/java/slf4j-api.jar:/usr/share/java/commons-logging.jar" \ - -Dorg.apache.commons.logging.LogFactory=org.slf4j.impl.JCLLoggerFactory \ - -e "import org.slf4j.LoggerFactory; import org.apache.commons.logging.LogFactory; \ - System.out.println(LogFactory.getFactory().getClass().getName());" 2>&1 | grep -q "$TEST_CLASS"; then - LOG_INFO "slf4j-jcl成功绑定到Apache Commons Logging" - CHECK_RESULT $? 0 0 "桥接功能验证失败" - else - LOG_ERROR "slf4j-jcl未能正确绑定到Apache Commons Logging" - CHECK_RESULT 1 0 1 "桥接功能异常" - fi - - LOG_INFO "步骤5: 清理测试环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载测试安装的slf4j-jcl软件包" - dnf remove -y slf4j-jcl - CHECK_RESULT $? 0 0 "卸载slf4j-jcl失败" - else - LOG_INFO "保持原有slf4j-jcl安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/slf4j/slf4j-jcl/test_slf4j-jcl_function_config.sh b/testcases/function_test/pkg_test/slf4j/slf4j-jcl/test_slf4j-jcl_function_config.sh deleted file mode 100644 index 1c4e0ca9038..00000000000 --- a/testcases/function_test/pkg_test/slf4j/slf4j-jcl/test_slf4j-jcl_function_config.sh +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-04 -# @License : Mulan PSL v2 -# @Desc : 测试slf4j-jcl的日志级别配置,验证配置是否生效并影响输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试slf4j-jcl的日志级别配置功能" - - # 定义软件包名称 - PACKAGE_NAME="slf4j-jcl" - - # 检查软件包是否已在yum源中 - LOG_INFO "1. 检查yum源中是否存在${PACKAGE_NAME}软件包" - if ! dnf list available ${PACKAGE_NAME} &>/dev/null; then - LOG_ERROR "yum源中未找到${PACKAGE_NAME}软件包" - exit 255 - fi - LOG_INFO "yum源中存在${PACKAGE_NAME}软件包" - - # 检查软件包是否已安装 - LOG_INFO "2. 检查${PACKAGE_NAME}是否已安装" - if rpm -q ${PACKAGE_NAME} &>/dev/null; then - INSTALLED="true" - LOG_INFO "${PACKAGE_NAME}已安装,测试结束后将保持安装状态" - else - INSTALLED="false" - LOG_INFO "${PACKAGE_NAME}未安装,测试结束后将卸载" - fi - - # 如果未安装,则安装软件包 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "3. 安装${PACKAGE_NAME}软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装${PACKAGE_NAME}失败" - fi - - # 测试步骤:验证日志级别配置功能 - LOG_INFO "4. 测试slf4j-jcl日志级别配置" - # 这里假设测试是通过一个Java程序来验证,需要编写一个简单的Java测试程序 - TEST_JAVA_FILE="/tmp/test_slf4j_jcl.java" - cat > ${TEST_JAVA_FILE} << "EOF" - import org.slf4j.Logger; - import org.slf4j.LoggerFactory; - - public class test_slf4j_jcl { - private static final Logger LOG = LoggerFactory.getLogger(test_slf4j_jcl.class); - - public static void main(String[] args) { - LOG.trace("Trace level message"); - LOG.debug("Debug level message"); - LOG.info("Info level message"); - LOG.warn("Warn level message"); - LOG.error("Error level message"); - } - } - EOF - - # 编译Java测试程序 - LOG_INFO "5. 编译Java测试程序" - javac -cp "/usr/share/java/slf4j-api.jar:/usr/share/java/slf4j-jcl.jar" ${TEST_JAVA_FILE} - CHECK_RESULT $? 0 0 "编译Java测试程序失败" - - # 运行测试程序并检查输出 - LOG_INFO "6. 运行测试程序验证日志输出" - # 设置日志级别为WARN,只应该看到WARN和ERROR级别的日志 - JAVA_OUTPUT=$(java -cp "/tmp:/usr/share/java/slf4j-api.jar:/usr/share/java/slf4j-jcl.jar:/usr/share/java/commons-logging.jar" \ - -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SLF4JLog \ - -Dorg.slf4j.simpleLogger.defaultLogLevel=warn \ - test_slf4j_jcl 2>&1) - - # 检查是否只包含WARN和ERROR级别的日志 - echo "${JAVA_OUTPUT}" | grep -q "WARN level message" - CHECK_RESULT $? 0 0 "未找到WARN级别日志" - echo "${JAVA_OUTPUT}" | grep -q "ERROR level message" - CHECK_RESULT $? 0 0 "未找到ERROR级别日志" - - # 检查是否不包含INFO级别及以下的日志 - echo "${JAVA_OUTPUT}" | grep -q "INFO level message" && CHECK_RESULT 1 0 1 "不应该出现INFO级别日志" - echo "${JAVA_OUTPUT}" | grep -q "DEBUG level message" && CHECK_RESULT 1 0 1 "不应该出现DEBUG级别日志" - echo "${JAVA_OUTPUT}" | grep -q "TRACE level message" && CHECK_RESULT 1 0 1 "不应该出现TRACE级别日志" - - LOG_INFO "7. 修改日志级别为INFO,验证配置生效" - # 设置日志级别为INFO,应该看到INFO及以上级别的日志 - JAVA_OUTPUT=$(java -cp "/tmp:/usr/share/java/slf4j-api.jar:/usr/share/java/slf4j-jcl.jar:/usr/share/java/commons-logging.jar" \ - -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SLF4JLog \ - -Dorg.slf4j.simpleLogger.defaultLogLevel=info \ - test_slf4j_jcl 2>&1) - - # 检查是否包含INFO及以上级别的日志 - echo "${JAVA_OUTPUT}" | grep -q "INFO level message" - CHECK_RESULT $? 0 0 "未找到INFO级别日志" - echo "${JAVA_OUTPUT}" | grep -q "WARN level message" - CHECK_RESULT $? 0 0 "未找到WARN级别日志" - echo "${JAVA_OUTPUT}" | grep -q "ERROR level message" - CHECK_RESULT $? 0 0 "未找到ERROR级别日志" - - # 检查是否不包含DEBUG及以下的日志 - echo "${JAVA_OUTPUT}" | grep -q "DEBUG level message" && CHECK_RESULT 1 0 1 "不应该出现DEBUG级别日志" - echo "${JAVA_OUTPUT}" | grep -q "TRACE level message" && CHECK_RESULT 1 0 1 "不应该出现TRACE级别日志" - - # 清理测试文件 - LOG_INFO "8. 清理测试文件" - rm -f ${TEST_JAVA_FILE} /tmp/test_slf4j_jcl.class - - # 如果测试前未安装,则卸载软件包 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "9. 卸载${PACKAGE_NAME}软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载${PACKAGE_NAME}失败" - fi - - LOG_INFO "slf4j-jcl日志级别配置测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/slf4j/slf4j-jcl/test_slf4j-jcl_function_logging.sh b/testcases/function_test/pkg_test/slf4j/slf4j-jcl/test_slf4j-jcl_function_logging.sh deleted file mode 100644 index 596ca6e71db..00000000000 --- a/testcases/function_test/pkg_test/slf4j/slf4j-jcl/test_slf4j-jcl_function_logging.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-02 -# @License : Mulan PSL v2 -# @Desc : 测试slf4j-jcl软件包的日志记录功能,验证日志是否能正常输出 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试slf4j-jcl软件包的日志记录功能,验证日志是否能正常输出 - - LOG_INFO "开始测试slf4j-jcl软件包的日志记录功能" - - # 检查是否已安装slf4j-jcl - if dnf list installed slf4j-jcl &>/dev/null; then - LOG_INFO "环境已安装slf4j-jcl,测试完成后将保持安装状态" - already_installed=true - else - LOG_INFO "环境未安装slf4j-jcl,将在测试完成后卸载" - already_installed=false - fi - - # 检查yum源中是否存在slf4j-jcl软件包 - LOG_INFO "检查yum源中是否存在slf4j-jcl软件包" - if ! dnf list available slf4j-jcl &>/dev/null; then - LOG_ERROR "yum源中未找到slf4j-jcl软件包" - exit 255 - fi - - # 安装slf4j-jcl软件包(如果未安装) - if [ "$already_installed" = false ]; then - LOG_INFO "开始安装slf4j-jcl软件包" - dnf install -y slf4j-jcl - CHECK_RESULT $? 0 0 "安装slf4j-jcl软件包失败" - fi - - # 验证日志记录功能 - LOG_INFO "验证日志记录功能是否正常" - - # 模拟日志输出 - java -cp $(rpm -ql slf4j-jcl | grep -E ".*slf4j-jcl.*jar" | head -n1) \ - org.slf4j.LoggerTest > /tmp/slf4j-jcl-test.log 2>&1 - CHECK_RESULT $? 0 0 "执行日志测试命令失败" - - # 检查日志文件内容 - if grep -q "日志输出测试" /tmp/slf4j-jcl-test.log; then - LOG_INFO "日志记录功能正常" - else - LOG_ERROR "日志记录功能异常,未找到预期日志内容" - exit 1 - fi - - # 清理临时文件 - rm -f /tmp/slf4j-jcl-test.log - - # 卸载slf4j-jcl软件包(如果测试前未安装) - if [ "$already_installed" = false ]; then - LOG_INFO "卸载slf4j-jcl软件包" - dnf remove -y slf4j-jcl - CHECK_RESULT $? 0 0 "卸载slf4j-jcl软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/slf4j/slf4j-jcl/test_slf4j-jcl_rollback.sh b/testcases/function_test/pkg_test/slf4j/slf4j-jcl/test_slf4j-jcl_rollback.sh deleted file mode 100644 index 6ba67e9bf98..00000000000 --- a/testcases/function_test/pkg_test/slf4j/slf4j-jcl/test_slf4j-jcl_rollback.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-06-26 -# @License : Mulan PSL v2 -# @Desc : 测试slf4j-jcl软件包的回滚功能,验证回滚是否成功 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试slf4j-jcl软件包的回滚功能,验证回滚是否成功" - - # 检查是否已安装slf4j-jcl - LOG_INFO "检查是否已安装slf4j-jcl" - dnf list installed slf4j-jcl > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "slf4j-jcl已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "slf4j-jcl未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查yum源中是否有slf4j-jcl软件包 - LOG_INFO "检查yum源中是否有slf4j-jcl软件包" - dnf list available slf4j-jcl > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到slf4j-jcl软件包" - exit 255 - fi - - # 安装slf4j-jcl软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装slf4j-jcl软件包" - dnf install -y slf4j-jcl > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装slf4j-jcl失败" - fi - - # 验证回滚功能 - LOG_INFO "验证回滚功能" - dnf history undo last -y > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "回滚slf4j-jcl失败" - - # 清理环境(如果脚本开始时未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境,卸载slf4j-jcl软件包" - dnf remove -y slf4j-jcl > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载slf4j-jcl失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-b/texlive-babel-slovak/test_texlive-babel-slovak_function_basic_use.sh b/testcases/function_test/pkg_test/texlive-split-b/texlive-babel-slovak/test_texlive-babel-slovak_function_basic_use.sh deleted file mode 100644 index 41ea1c1f950..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-b/texlive-babel-slovak/test_texlive-babel-slovak_function_basic_use.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-02 -# @License : Mulan PSL v2 -# @Desc : Test basic LaTeX usage with Slovak language -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test basic LaTeX usage with Slovak language" - - # 检查是否已安装 texlive-babel-slovak - LOG_INFO "检查是否已安装 texlive-babel-slovak" - dnf list installed texlive-babel-slovak &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "texlive-babel-slovak 已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-babel-slovak 未安装,将在测试中安装,并在结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有 texlive-babel-slovak - LOG_INFO "检查yum源中是否有 texlive-babel-slovak 软件包" - dnf search texlive-babel-slovak &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到 texlive-babel-slovak 软件包" - exit 255 - fi - - # 如果未安装,则安装 texlive-babel-slovak - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-babel-slovak" - dnf install -y texlive-babel-slovak - CHECK_RESULT $? 0 0 "安装 texlive-babel-slovak 失败" - fi - - # 创建一个简单的 LaTeX 文件测试 Slovak 语言支持 - LOG_INFO "创建测试 LaTeX 文件 test_slovak.tex" - cat > test_slovak.tex << "EOF" - \documentclass{article} - \usepackage[slovak]{babel} - \begin{document} - Ahoj svet! Toto je test slovenského jazyka v LaTeXu. - \end{document} - EOF - - # 检查是否安装了 pdflatex 命令 - LOG_INFO "检查 pdflatex 命令是否存在" - command -v pdflatex &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "pdflatex 命令不存在或不支持" - exit 255 - fi - - # 使用 pdflatex 编译 LaTeX 文件 - LOG_INFO "使用 pdflatex 编译 test_slovak.tex" - pdflatex -interaction=nonstopmode test_slovak.tex - CHECK_RESULT $? 0 0 "pdflatex 编译失败" - - # 检查生成的 PDF 文件是否存在 - LOG_INFO "检查生成的 PDF 文件是否存在" - if [ -f test_slovak.pdf ]; then - LOG_INFO "PDF 文件生成成功:test_slovak.pdf" - else - LOG_ERROR "PDF 文件未生成" - exit 1 - fi - - # 清理测试过程中生成的文件 - LOG_INFO "清理测试生成的临时文件" - rm -f test_slovak.tex test_slovak.log test_slovak.aux test_slovak.pdf - - # 如果测试前未安装,则在测试结束后卸载 texlive-babel-slovak - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-babel-slovak" - dnf remove -y texlive-babel-slovak - CHECK_RESULT $? 0 0 "卸载 texlive-babel-slovak 失败" - fi - - LOG_INFO "测试完成:Test basic LaTeX usage with Slovak language" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-b/texlive-babel-slovak/test_texlive-babel-slovak_function_hyph_check.sh b/testcases/function_test/pkg_test/texlive-split-b/texlive-babel-slovak/test_texlive-babel-slovak_function_hyph_check.sh deleted file mode 100644 index 4b3a0d64741..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-b/texlive-babel-slovak/test_texlive-babel-slovak_function_hyph_check.sh +++ /dev/null @@ -1,197 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-04-02 -# @License : Mulan PSL v2 -# @Desc : Check Slovak hyphenation patterns -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色输出函数 - LOG_INFO() { - echo -e "\033[32m[INFO]\033[0m $*" - } - - LOG_ERROR() { - echo -e "\033[31m[ERROR]\033[0m $*" - } - - # 检查软件包是否在yum源中存在 - check_package_in_repo() { - local pkg_name=$1 - LOG_INFO "检查yum源中是否存在软件包: $pkg_name" - if dnf list available "$pkg_name" &>/dev/null; then - LOG_INFO "软件包 $pkg_name 在yum源中存在" - return 0 - else - LOG_ERROR "软件包 $pkg_name 在yum源中不存在" - return 1 - fi - } - - # 检查命令参数是否支持 - check_command_option() { - local cmd=$1 - local option=$2 - LOG_INFO "检查命令 $cmd 是否支持参数 $option" - if $cmd --help 2>&1 | grep -q -- "$option"; then - LOG_INFO "命令 $cmd 支持参数 $option" - return 0 - else - LOG_ERROR "命令 $cmd 不支持参数 $option" - return 1 - fi - } - - # 检查Slovak连字符模式 - check_slovak_hyphenation() { - LOG_INFO "开始检查Slovak连字符模式" - - # 定义软件包名称 - local pkg_name="texlive-babel-slovak" - - # 检查软件包是否已安装 - if rpm -q "$pkg_name" &>/dev/null; then - LOG_INFO "软件包 $pkg_name 已安装,保持安装状态" - local was_installed=true - else - LOG_INFO "软件包 $pkg_name 未安装" - local was_installed=false - fi - - # 检查软件包是否在yum源中 - check_package_in_repo "$pkg_name" - CHECK_RESULT $? 0 0 "软件包 $pkg_name 不在yum源中" - - # 如果未安装,则安装软件包 - if [ "$was_installed" = false ]; then - LOG_INFO "安装软件包 $pkg_name" - dnf install -y "$pkg_name" - CHECK_RESULT $? 0 0 "安装软件包 $pkg_name 失败" - fi - - # 检查安装是否成功 - LOG_INFO "验证软件包 $pkg_name 是否安装成功" - rpm -q "$pkg_name" - CHECK_RESULT $? 0 0 "软件包 $pkg_name 未正确安装" - - # 检查相关文件是否存在 - LOG_INFO "检查Slovak连字符相关文件" - - # 查找Slovak连字符模式文件 - local hyphen_files=$(find /usr/share/texlive/ -name "*sk*" -type f 2>/dev/null | head -5) - - if [ -n "$hyphen_files" ]; then - LOG_INFO "找到Slovak连字符相关文件:" - echo "$hyphen_files" - - # 检查至少一个文件包含hyphen或hyph关键词 - local found_hyphen=false - for file in $hyphen_files; do - if file "$file" | grep -qi "text" && (grep -qi "hyphen" "$file" || grep -qi "hyph" "$file"); then - found_hyphen=true - LOG_INFO "文件 $file 包含连字符模式信息" - break - fi - done - - if [ "$found_hyphen" = false ]; then - LOG_ERROR "未找到包含连字符模式的Slovak文件" - CHECK_RESULT 1 0 0 "未找到有效的Slovak连字符模式文件" - fi - else - LOG_ERROR "未找到Slovak连字符相关文件" - CHECK_RESULT 1 0 0 "未找到Slovak连字符相关文件" - fi - - # 检查texlua命令是否可用 - LOG_INFO "检查texlua命令是否可用" - if command -v texlua &>/dev/null; then - LOG_INFO "texlua命令可用" - - # 尝试使用texlua检查连字符模式 - LOG_INFO "尝试使用texlua检查Slovak语言支持" - if texlua -e "print("Checking LuaTeX Slovak support")" &>/dev/null; then - LOG_INFO "texlua命令执行成功" - fi - else - LOG_INFO "texlua命令不可用,跳过相关检查" - fi - - # 检查kpathsea库是否包含Slovak模式 - LOG_INFO "检查kpathsea库中的Slovak模式" - if command -v kpsewhich &>/dev/null; then - LOG_INFO "查找Slovak连字符模式文件" - local hyph_file=$(kpsewhich hyph-sk.tex 2>/dev/null) - - if [ -n "$hyph_file" ] && [ -f "$hyph_file" ]; then - LOG_INFO "找到Slovak连字符模式文件: $hyph_file" - - # 检查文件内容 - if head -20 "$hyph_file" | grep -qi "slovak\|slovensk"; then - LOG_INFO "文件 $hyph_file 包含Slovak连字符模式" - else - LOG_ERROR "文件 $hyph_file 不包含Slovak连字符模式" - CHECK_RESULT 1 0 0 "Slovak连字符模式文件内容不正确" - fi - else - LOG_ERROR "未找到hyph-sk.tex文件" - # 这不是致命错误,因为文件名可能不同 - fi - else - LOG_INFO "kpsewhich命令不可用,跳过相关检查" - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$was_installed" = false ]; then - LOG_INFO "清理环境:卸载软件包 $pkg_name" - dnf remove -y "$pkg_name" - - # 验证卸载是否成功 - if rpm -q "$pkg_name" &>/dev/null; then - LOG_ERROR "软件包 $pkg_name 卸载失败" - CHECK_RESULT 1 0 0 "软件包卸载失败" - else - LOG_INFO "软件包 $pkg_name 已成功卸载" - fi - else - LOG_INFO "保持软件包 $pkg_name 的安装状态" - fi - - LOG_INFO "Slovak连字符模式检查完成" - } - - # 主函数 - main() { - LOG_INFO "开始执行Slovak连字符模式测试" - - # 检查dnf命令是否可用 - if ! command -v dnf &>/dev/null; then - LOG_ERROR "dnf命令不可用" - exit 255 - fi - - # 执行Slovak连字符模式检查 - check_slovak_hyphenation - - LOG_INFO "测试脚本执行完成" - } - - # 执行主函数 - main "$@" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-c/texlive-bibtexperllibs/test_texlive-bibtexperllibs_function_parse.sh b/testcases/function_test/pkg_test/texlive-split-c/texlive-bibtexperllibs/test_texlive-bibtexperllibs_function_parse.sh deleted file mode 100644 index a7a68886236..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-c/texlive-bibtexperllibs/test_texlive-bibtexperllibs_function_parse.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test parsing functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试解析功能" - - # 检查是否已安装texlive-bibtexperllibs - LOG_INFO "检查texlive-bibtexperllibs是否已安装" - if dnf list installed texlive-bibtexperllibs &>/dev/null; then - LOG_INFO "texlive-bibtexperllibs已安装,测试结束后保持安装状态" - installed=true - else - LOG_INFO "texlive-bibtexperllibs未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有texlive-bibtexperllibs - LOG_INFO "检查yum源中是否有texlive-bibtexperllibs" - if ! dnf list available texlive-bibtexperllibs &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-bibtexperllibs" - exit 255 - fi - - # 安装texlive-bibtexperllibs - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-bibtexperllibs" - dnf install -y texlive-bibtexperllibs - CHECK_RESULT $? 0 0 "安装texlive-bibtexperllibs失败" - fi - - # 测试解析功能 - LOG_INFO "测试解析功能" - command_to_test="texlive-bibtexperllibs --parse" - $command_to_test - CHECK_RESULT $? 0 0 "解析功能测试失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-bibtexperllibs" - dnf remove -y texlive-bibtexperllibs - CHECK_RESULT $? 0 0 "卸载texlive-bibtexperllibs失败" - fi - - LOG_INFO "测试解析功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-d/texlive-bussproofs/test_texlive-bussproofs_function_render.sh b/testcases/function_test/pkg_test/texlive-split-d/texlive-bussproofs/test_texlive-bussproofs_function_render.sh deleted file mode 100644 index b6da74b0584..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-d/texlive-bussproofs/test_texlive-bussproofs_function_render.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test rendering of proofs -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查texlive-bussproofs软件包是否已安装 - LOG_INFO "检查texlive-bussproofs软件包是否已安装" - if dnf list installed texlive-bussproofs &>/dev/null; then - LOG_INFO "texlive-bussproofs已安装" - INSTALLED=true - else - LOG_INFO "texlive-bussproofs未安装" - INSTALLED=false - fi - - # 检查yum源中是否存在texlive-bussproofs软件包 - LOG_INFO "检查yum源中是否存在texlive-bussproofs软件包" - if ! dnf list available texlive-bussproofs &>/dev/null; then - LOG_ERROR "yum源中不存在texlive-bussproofs软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-bussproofs - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-bussproofs" - dnf install -y texlive-bussproofs - CHECK_RESULT $? 0 0 "安装texlive-bussproofs失败" - LOG_INFO "texlive-bussproofs安装成功" - fi - - # 测试proof渲染功能 - LOG_INFO "测试proof渲染功能" - latex --interaction=nonstopmode test_proof.tex &>/dev/null - CHECK_RESULT $? 0 0 "渲染proof失败" - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f test_proof.aux test_proof.log test_proof.dvi - - # 如果最初未安装,则在测试完成后卸载texlive-bussproofs - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-bussproofs" - dnf remove -y texlive-bussproofs - CHECK_RESULT $? 0 0 "卸载texlive-bussproofs失败" - LOG_INFO "texlive-bussproofs卸载成功" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-q/texlive-ntheorem-doc/test_texlive-ntheorem-doc_function_doc_access.sh b/testcases/function_test/pkg_test/texlive-split-q/texlive-ntheorem-doc/test_texlive-ntheorem-doc_function_doc_access.sh deleted file mode 100644 index 78b921c8f41..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-q/texlive-ntheorem-doc/test_texlive-ntheorem-doc_function_doc_access.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-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 : Access and verify documentation files -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-ntheorem-doc - LOG_INFO "检查是否已安装texlive-ntheorem-doc" - rpm -q texlive-ntheorem-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ntheorem-doc已安装,测试完成后保持安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "texlive-ntheorem-doc未安装,将在测试完成后卸载" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否有texlive-ntheorem-doc - LOG_INFO "检查yum源中是否有texlive-ntheorem-doc" - dnf list available texlive-ntheorem-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到texlive-ntheorem-doc软件包" - - # 如果未安装,则安装软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "安装texlive-ntheorem-doc" - dnf install -y texlive-ntheorem-doc - CHECK_RESULT $? 0 0 "安装texlive-ntheorem-doc失败" - fi - - # 获取texlive-ntheorem-doc文档文件路径 - LOG_INFO "获取texlive-ntheorem-doc文档文件路径" - DOC_PATH=$(rpm -ql texlive-ntheorem-doc | head -1) - if [ -z "$DOC_PATH" ]; then - LOG_ERROR "未找到texlive-ntheorem-doc文档文件" - exit 1 - fi - - # 验证文档文件是否存在并可访问 - LOG_INFO "验证文档文件是否存在并可访问" - if [ -f "$DOC_PATH" ]; then - LOG_INFO "文档文件存在: $DOC_PATH" - file "$DOC_PATH" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "文档文件无法识别" - else - # 如果是目录,检查目录中是否有文件 - if [ -d "$DOC_PATH" ]; then - LOG_INFO "文档目录存在: $DOC_PATH" - DOC_FILE_COUNT=$(find "$DOC_PATH" -type f | wc -l) - if [ $DOC_FILE_COUNT -gt 0 ]; then - LOG_INFO "文档目录中包含 $DOC_FILE_COUNT 个文件" - # 检查第一个文件是否可读 - FIRST_FILE=$(find "$DOC_PATH" -type f | head -1) - if [ -r "$FIRST_FILE" ]; then - LOG_INFO "文档文件可读: $FIRST_FILE" - else - LOG_ERROR "文档文件不可读: $FIRST_FILE" - exit 1 - fi - else - LOG_ERROR "文档目录为空" - exit 1 - fi - else - LOG_ERROR "文档路径既不是文件也不是目录: $DOC_PATH" - exit 1 - fi - fi - - # 尝试访问文档内容(如果是文本文件) - LOG_INFO "尝试访问文档内容" - if file "$DOC_PATH" | grep -q "text"; then - head -5 "$DOC_PATH" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "无法读取文档内容" - LOG_INFO "文档内容可访问" - elif [ -d "$DOC_PATH" ]; then - # 如果是目录,尝试读取目录中的README或类似文件 - README_FILE=$(find "$DOC_PATH" -name "README*" -o -name "readme*" | head -1) - if [ -n "$README_FILE" ] && [ -f "$README_FILE" ]; then - head -5 "$README_FILE" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "无法读取README文件" - LOG_INFO "README文件可访问: $README_FILE" - else - LOG_INFO "未找到README文件,但目录结构正常" - fi - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $INSTALLED_FLAG -eq 0 ]; then - LOG_INFO "卸载texlive-ntheorem-doc" - dnf remove -y texlive-ntheorem-doc - CHECK_RESULT $? 0 0 "卸载texlive-ntheorem-doc失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-q/texlive-ntheorem-doc/test_texlive-ntheorem-doc_function_docgen.sh b/testcases/function_test/pkg_test/texlive-split-q/texlive-ntheorem-doc/test_texlive-ntheorem-doc_function_docgen.sh deleted file mode 100644 index 10c76f8fed8..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-q/texlive-ntheorem-doc/test_texlive-ntheorem-doc_function_docgen.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-05 -# @License : Mulan PSL v2 -# @Desc : Verify documentation generation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试文档生成功能" - - # 检查是否已安装texlive-ntheorem-doc - LOG_INFO "检查是否已安装texlive-ntheorem-doc" - rpm -q texlive-ntheorem-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ntheorem-doc已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ntheorem-doc未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-ntheorem-doc - LOG_INFO "检查yum源中是否有texlive-ntheorem-doc" - dnf list available texlive-ntheorem-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ntheorem-doc,退出测试" - exit 255 - fi - - # 安装texlive-ntheorem-doc - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装texlive-ntheorem-doc" - dnf install -y texlive-ntheorem-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装texlive-ntheorem-doc失败" - fi - - # 验证文档生成功能 - LOG_INFO "验证文档生成功能" - command_to_test="some_documentation_generation_command" # 替换为实际的文档生成命令 - $command_to_test > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "文档生成失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-ntheorem-doc" - dnf remove -y texlive-ntheorem-doc > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-ntheorem-doc失败" - fi - - LOG_INFO "测试文档生成功能完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-q/texlive-ntheorem-doc/test_texlive-ntheorem-doc_function_example_usage.sh b/testcases/function_test/pkg_test/texlive-split-q/texlive-ntheorem-doc/test_texlive-ntheorem-doc_function_example_usage.sh deleted file mode 100644 index 6c592b57764..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-q/texlive-ntheorem-doc/test_texlive-ntheorem-doc_function_example_usage.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2026-03-16 -# @License : Mulan PSL v2 -# @Desc : Verify LaTeX document compiles with ntheorem -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装texlive-ntheorem-doc - LOG_INFO "检查是否已安装texlive-ntheorem-doc" - rpm -q texlive-ntheorem-doc > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ntheorem-doc已安装,测试结束后将保持安装状态" - INSTALLED_FLAG=0 - else - LOG_INFO "texlive-ntheorem-doc未安装,将在测试后卸载" - INSTALLED_FLAG=1 - fi - - # 检查yum源中是否有texlive-ntheorem-doc - LOG_INFO "检查yum源中是否有texlive-ntheorem-doc" - dnf list available texlive-ntheorem-doc > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-ntheorem-doc软件包" - exit 255 - fi - - # 如果未安装,则安装texlive-ntheorem-doc - if [ $INSTALLED_FLAG -eq 1 ]; then - LOG_INFO "安装texlive-ntheorem-doc" - dnf install -y texlive-ntheorem-doc - CHECK_RESULT $? 0 0 "安装texlive-ntheorem-doc失败" - fi - - # 创建测试用的LaTeX文档 - LOG_INFO "创建测试用的LaTeX文档" - cat > test_ntheorem.tex << "EOF" - \documentclass{article} - \usepackage{ntheorem} - \newtheorem{theorem}{Theorem} - \begin{document} - \begin{theorem} - 这是一个测试定理。 - \end{theorem} - \end{document} - EOF - CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败" - - # 使用pdflatex编译文档 - LOG_INFO "使用pdflatex编译LaTeX文档" - pdflatex test_ntheorem.tex > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "pdflatex编译失败" - - # 检查生成的PDF文件是否存在 - LOG_INFO "检查生成的PDF文件是否存在" - if [ -f test_ntheorem.pdf ]; then - LOG_INFO "PDF文件生成成功" - CHECK_RESULT 0 0 0 "PDF文件生成成功" - else - LOG_ERROR "PDF文件未生成" - CHECK_RESULT 1 0 1 "PDF文件未生成" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_ntheorem.tex test_ntheorem.aux test_ntheorem.log test_ntheorem.pdf - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果测试前未安装,则卸载texlive-ntheorem-doc - if [ $INSTALLED_FLAG -eq 1 ]; then - LOG_INFO "卸载texlive-ntheorem-doc" - dnf remove -y texlive-ntheorem-doc - CHECK_RESULT $? 0 0 "卸载texlive-ntheorem-doc失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-q/texlive-ot-tableau/test_texlive-ot-tableau_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-q/texlive-ot-tableau/test_texlive-ot-tableau_function_basic.sh deleted file mode 100644 index 0d0417914c6..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-q/texlive-ot-tableau/test_texlive-ot-tableau_function_basic.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-12-07 -# @License : Mulan PSL v2 -# @Desc : Test basic functionality of texlive-ot-tableau -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 texlive-ot-tableau 的基本功能" - - # 检查软件包是否在yum源中 - LOG_INFO "检查 texlive-ot-tableau 是否在yum源中" - dnf list available texlive-ot-tableau > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "texlive-ot-tableau 不在yum源中" - exit 255 - fi - - # 检查环境是否已安装 texlive-ot-tableau - LOG_INFO "检查 texlive-ot-tableau 是否已安装" - rpm -q texlive-ot-tableau > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-ot-tableau 已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ot-tableau 未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 安装 texlive-ot-tableau - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 texlive-ot-tableau" - dnf install -y texlive-ot-tableau - CHECK_RESULT $? 0 0 "安装 texlive-ot-tableau 失败" - fi - - # 测试基本功能 - LOG_INFO "测试 texlive-ot-tableau 的基本功能" - texlive-ot-tableau --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-ot-tableau 基本功能测试失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 texlive-ot-tableau" - dnf remove -y texlive-ot-tableau - CHECK_RESULT $? 0 0 "卸载 texlive-ot-tableau 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-exa/test_texlive-pst-exa_function_basic.sh b/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-exa/test_texlive-pst-exa_function_basic.sh deleted file mode 100644 index e5c100495c5..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-s/texlive-pst-exa/test_texlive-pst-exa_function_basic.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Basic functionality test for texlive-pst-exa -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始执行Basic functionality test for texlive-pst-exa测试脚本" - - # 检查是否已安装texlive-pst-exa - LOG_INFO "检查是否已安装texlive-pst-exa" - rpm -q texlive-pst-exa > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-pst-exa已安装,脚本结束时将保持安装状态" - installed=true - else - LOG_INFO "texlive-pst-exa未安装,将在测试结束后卸载" - installed=false - fi - - # 检查yum源中是否有texlive-pst-exa - LOG_INFO "检查yum源中是否有texlive-pst-exa" - dnf list available texlive-pst-exa > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-pst-exa软件包" - exit 255 - fi - - # 安装texlive-pst-exa - if [ "$installed" = false ]; then - LOG_INFO "安装texlive-pst-exa" - dnf install -y texlive-pst-exa - CHECK_RESULT $? 0 0 "安装texlive-pst-exa失败" - fi - - # 测试texlive-pst-exa基本功能 - LOG_INFO "测试texlive-pst-exa基本功能" - texlive-pst-exa --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-pst-exa基本功能测试失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "卸载texlive-pst-exa" - dnf remove -y texlive-pst-exa - CHECK_RESULT $? 0 0 "卸载texlive-pst-exa失败" - fi - - LOG_INFO "Basic functionality test for texlive-pst-exa测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-y/texlive-quiz2socrative/test_texlive-quiz2socrative_function_convert.sh b/testcases/function_test/pkg_test/texlive-split-y/texlive-quiz2socrative/test_texlive-quiz2socrative_function_convert.sh deleted file mode 100644 index 6bbb16a6cea..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-y/texlive-quiz2socrative/test_texlive-quiz2socrative_function_convert.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2024 ISCAS .ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : honghua -# @Contact : honghua@iscas.ac.cn -# @Date : 2025-11-26 -# @License : Mulan PSL v2 -# @Desc : Test quiz conversion to socrative format -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装texlive-quiz2socrative软件包 - LOG_INFO "检查是否已安装texlive-quiz2socrative软件包" - dnf list installed texlive-quiz2socrative > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "texlive-quiz2socrative已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-quiz2socrative未安装,脚本结束时将卸载该软件包" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-quiz2socrative软件包 - LOG_INFO "检查yum源中是否有texlive-quiz2socrative软件包" - dnf list available texlive-quiz2socrative > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到texlive-quiz2socrative软件包" - exit 255 - fi - - # 安装texlive-quiz2socrative软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装texlive-quiz2socrative软件包" - dnf install -y texlive-quiz2socrative - CHECK_RESULT $? 0 0 "安装texlive-quiz2socrative失败" - fi - - # 测试quiz转换功能 - LOG_INFO "测试quiz转换功能" - texlive-quiz2socrative --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "texlive-quiz2socrative命令执行失败" - - LOG_INFO "测试quiz转换为socrative格式" - texlive-quiz2socrative --input test_quiz.tex --output test_socrative.json > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "quiz转换为socrative格式失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载texlive-quiz2socrative软件包" - dnf remove -y texlive-quiz2socrative > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载texlive-quiz2socrative失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file